@sisense/sdk-ui 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.cjs +59 -59
- package/dist/ai.js +1097 -1171
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +587 -616
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{execute-query-b9oy2Egy.js → apply-styled-options-to-query-Bzt2GrgO.js} +1635 -1530
- package/dist/apply-styled-options-to-query-COD9fRYD.cjs +1 -0
- package/dist/{dimensions-C1R5YRt-.js → dimensions-Ce2zWFrs.js} +1 -1
- package/dist/dimensions-u3w5qNF0.cjs +1 -0
- package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
- package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
- package/dist/index.cjs +467 -452
- package/dist/index.js +27214 -34168
- package/dist/index.umd.js +718 -706
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +12 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +17 -5
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +16 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +5 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +6 -5
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +29 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/core/date-formats/simple-date-format-replacers.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-pivot-query/use-execute-pivot-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query/use-execute-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/area-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/areamap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/bar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/column-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/funnel-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/line-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pie-chart/pie-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/polar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scatter-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scattermap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sunburst-chart/sunburst-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/table.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/treemap-chart/treemap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +6 -6
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +6 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/plot-bands.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/axis-section.d.ts +29 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/tooltip-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +32 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +166 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/use-scroller-location-save.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/widget-by-id.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/use-get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +170 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +13 -16
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +26 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +12 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +10 -2
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +10 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +3 -4
- package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
- package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
- package/dist/packages/sdk-ui/src/props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
- package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +2 -0
- package/dist/packages/sdk-ui/src/types.d.ts +8 -8
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +10 -1
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +10 -1
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +10 -1
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +10 -1
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +12 -3
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +12 -3
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +12 -3
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +12 -3
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +10 -1
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +12 -3
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +10 -1
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +12 -3
- package/dist/types-COBvZZm_.cjs +1 -0
- package/dist/{types-DJtC8_5_.js → types-D6jCGncV.js} +1 -1
- package/dist/{quota-notification-CeKnEyQG.js → use-hover-B1HPf4hF.js} +27827 -19390
- package/dist/use-hover-CaQrW_gv.cjs +721 -0
- package/dist/{utils-BCp2ISWh.js → utils-BQtueE3Z.js} +13632 -13251
- package/dist/utils-CAubp1g1.cjs +179 -0
- package/dist/{widget-composer-CDNL9_XF.js → widget-composer-BAJFWk3t.js} +3 -3
- package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-C75b-E6W.cjs} +1 -1
- package/package.json +11 -10
- package/dist/dimensions-C7yXAoZs.cjs +0 -1
- package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +0 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/table-widget.d.ts +0 -22
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +0 -61
- package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
- package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
- package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +0 -25
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
- package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
- package/dist/types-C0QU2tsE.cjs +0 -1
- package/dist/utils-D8O1_kl3.cjs +0 -190
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Vt = Object.defineProperty, Wt = Object.defineProperties;
|
|
2
2
|
var jt = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var ke = Object.getOwnPropertySymbols;
|
|
4
4
|
var Kt = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var Be = (e, t, r) => t in e ? Vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, y = (e, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
|
-
Kt.call(t, r) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var r of
|
|
10
|
-
Gt.call(t, r) &&
|
|
7
|
+
Kt.call(t, r) && Be(e, r, t[r]);
|
|
8
|
+
if (ke)
|
|
9
|
+
for (var r of ke(t))
|
|
10
|
+
Gt.call(t, r) && Be(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
import { f as Yt, J as Jt } from "../types-
|
|
14
|
-
import { b as
|
|
15
|
-
import {
|
|
16
|
-
import { i as Vr, b as Wr, D as jr, d as Kr, a as Gr } from "../dimensions-
|
|
12
|
+
}, w = (e, t) => Wt(e, jt(t));
|
|
13
|
+
import { f as Yt, J as Jt } from "../types-D6jCGncV.js";
|
|
14
|
+
import { b as li, E as fi, a as di, i as mi, e as pi, d as gi } from "../types-D6jCGncV.js";
|
|
15
|
+
import { cg as Ht, bs as Qt, ch as Xt, ci as Zt, cj as er, aw as be, ck as tr, av as rr, cl as sr, bb as nr, ax as ir, cm as or, be as ar, bc as ur, aO as cr, ba as lr, bd as fr, d as dr, c as mr, k as pr, cn as gr, co as yr, cp as hr, cq as br, cr as Ar, cs as wr, ct as Fr, cu as Er, cv as Cr, cw as qr, cx as Tr, au as xr, cy as $r, cz as Sr, S as B, t as X, h as Or, b as $, al as _, ak as tt, cA as Dr, cB as Mr, cC as Nr, M as U, cD as Rr, cE as vr, aK as Ir, an as ze, am as Ae, cd as Pr, ce as kr, bP as rt, cF as st, ad as Br, cG as nt, cH as it, A as zr, cI as Lr, bG as Ur, aD as _r } from "../apply-styled-options-to-query-Bzt2GrgO.js";
|
|
16
|
+
import { i as Vr, b as Wr, D as jr, d as Kr, a as Gr } from "../dimensions-Ce2zWFrs.js";
|
|
17
17
|
function Yr(e, t) {
|
|
18
18
|
const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, o) => Array.from({ length: s + 1 }, (a, u) => o === 0 ? u : u === 0 ? o : 0));
|
|
19
19
|
for (let i = 1; i <= r; i++)
|
|
@@ -21,7 +21,152 @@ function Yr(e, t) {
|
|
|
21
21
|
n[i][o] = Math.min(n[i - 1][o] + 1, n[i][o - 1] + 1, n[i - 1][o - 1] + (e[i - 1] === t[o - 1] ? 0 : 1));
|
|
22
22
|
return n[r][s];
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
function we(e, t) {
|
|
25
|
+
const r = [];
|
|
26
|
+
let s = "", n = 0, i = !1, o = null;
|
|
27
|
+
for (let a = 0; a < e.length; a++) {
|
|
28
|
+
const u = e[a], c = e[a + 1];
|
|
29
|
+
if (i) {
|
|
30
|
+
if (u !== o) {
|
|
31
|
+
s += u;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (c === o) {
|
|
35
|
+
s += u + c, a++;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
i = !1, o = null, s += u;
|
|
39
|
+
continue;
|
|
40
|
+
} else {
|
|
41
|
+
if (u === "'" || u === '"') {
|
|
42
|
+
i = !0, o = u, s += u;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
|
|
46
|
+
r.push(s.trim()), s = "";
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
s += u;
|
|
51
|
+
}
|
|
52
|
+
return s.trim() && r.push(s.trim()), r;
|
|
53
|
+
}
|
|
54
|
+
function Jr(e, t) {
|
|
55
|
+
let r = 0, s = !1, n = null;
|
|
56
|
+
for (let i = 0; i < e.length; i++) {
|
|
57
|
+
const o = e[i], a = e[i + 1];
|
|
58
|
+
if (s) {
|
|
59
|
+
if (o !== n)
|
|
60
|
+
continue;
|
|
61
|
+
if (a === n) {
|
|
62
|
+
i++;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
s = !1, n = null;
|
|
66
|
+
} else {
|
|
67
|
+
if (o === "'" || o === '"') {
|
|
68
|
+
s = !0, n = o;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if ("([{".includes(o) && r++, ")]}".includes(o) && r--, o === t && r === 0)
|
|
72
|
+
return i;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
function Hr(e, t) {
|
|
78
|
+
if (e[t] !== "(")
|
|
79
|
+
return -1;
|
|
80
|
+
let r = 1, s = t + 1, n = !1, i = null;
|
|
81
|
+
for (; s < e.length; ) {
|
|
82
|
+
const o = e[s], a = e[s + 1];
|
|
83
|
+
if (n) {
|
|
84
|
+
if (o !== i) {
|
|
85
|
+
s++;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (a === i) {
|
|
89
|
+
s += 2;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
n = !1, i = null, s++;
|
|
93
|
+
} else {
|
|
94
|
+
if (o === "'" || o === '"') {
|
|
95
|
+
n = !0, i = o, s++;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if ("([{".includes(o) && r++, ")]}".includes(o) && --r === 0)
|
|
99
|
+
return s;
|
|
100
|
+
s++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return -1;
|
|
104
|
+
}
|
|
105
|
+
function Qr(e) {
|
|
106
|
+
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
107
|
+
}
|
|
108
|
+
function V(e) {
|
|
109
|
+
if (!e || typeof e != "string")
|
|
110
|
+
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
111
|
+
const t = e.trim();
|
|
112
|
+
if (!t)
|
|
113
|
+
throw new Error("Invalid composeCode: empty string");
|
|
114
|
+
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
115
|
+
if (!r)
|
|
116
|
+
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
117
|
+
const s = r[1], n = r[2], i = ot(n);
|
|
118
|
+
return {
|
|
119
|
+
function: s,
|
|
120
|
+
args: i
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function ot(e) {
|
|
124
|
+
return e.trim() ? we(e, ",").map(at) : [];
|
|
125
|
+
}
|
|
126
|
+
function at(e) {
|
|
127
|
+
if (!e)
|
|
128
|
+
throw new Error("Cannot parse empty argument value");
|
|
129
|
+
if (e === "null")
|
|
130
|
+
return null;
|
|
131
|
+
if (e === "undefined")
|
|
132
|
+
return;
|
|
133
|
+
if (e === "true")
|
|
134
|
+
return !0;
|
|
135
|
+
if (e === "false")
|
|
136
|
+
return !1;
|
|
137
|
+
if (e.match(/^-?\d+(\.\d+)?$/))
|
|
138
|
+
return parseFloat(e);
|
|
139
|
+
if (e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"')) {
|
|
140
|
+
const r = e[0];
|
|
141
|
+
return e.slice(1, -1).replace(new RegExp(`${r}${r}`, "g"), r);
|
|
142
|
+
}
|
|
143
|
+
if (e.startsWith("[") && e.endsWith("]")) {
|
|
144
|
+
const r = e.slice(1, -1).trim();
|
|
145
|
+
if (!r)
|
|
146
|
+
return [];
|
|
147
|
+
const s = ot(r);
|
|
148
|
+
return s.every((n) => typeof n == "string"), s;
|
|
149
|
+
}
|
|
150
|
+
if (e.startsWith("{") && e.endsWith("}")) {
|
|
151
|
+
const r = e.slice(1, -1).trim();
|
|
152
|
+
return r ? Zr(r) : {};
|
|
153
|
+
}
|
|
154
|
+
return e.includes("(") && e.includes(")") ? V(e) : (e.startsWith("DM."), e);
|
|
155
|
+
}
|
|
156
|
+
function Xr(e) {
|
|
157
|
+
const t = Jr(e, ":");
|
|
158
|
+
if (t === -1)
|
|
159
|
+
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
160
|
+
const r = Qr(e.slice(0, t).trim()), s = at(e.slice(t + 1).trim());
|
|
161
|
+
return [r, s];
|
|
162
|
+
}
|
|
163
|
+
function Zr(e) {
|
|
164
|
+
if (!e.trim())
|
|
165
|
+
return {};
|
|
166
|
+
const t = we(e, ",").map(Xr).filter(([, r]) => r !== null);
|
|
167
|
+
return Object.fromEntries(t);
|
|
168
|
+
}
|
|
169
|
+
class es {
|
|
25
170
|
constructor() {
|
|
26
171
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
27
172
|
}
|
|
@@ -38,9 +183,9 @@ class Jr {
|
|
|
38
183
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
39
184
|
}
|
|
40
185
|
}
|
|
41
|
-
class
|
|
186
|
+
class ut {
|
|
42
187
|
constructor(t) {
|
|
43
|
-
this.generateIdentifier = t, this.kv = new
|
|
188
|
+
this.generateIdentifier = t, this.kv = new es();
|
|
44
189
|
}
|
|
45
190
|
register(t, r) {
|
|
46
191
|
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
@@ -55,7 +200,7 @@ class ot {
|
|
|
55
200
|
return this.kv.getByKey(t);
|
|
56
201
|
}
|
|
57
202
|
}
|
|
58
|
-
class
|
|
203
|
+
class ts extends ut {
|
|
59
204
|
constructor() {
|
|
60
205
|
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
61
206
|
}
|
|
@@ -66,7 +211,7 @@ class Hr extends ot {
|
|
|
66
211
|
return this.classToAllowedProps.get(t);
|
|
67
212
|
}
|
|
68
213
|
}
|
|
69
|
-
function
|
|
214
|
+
function rs(e) {
|
|
70
215
|
if ("values" in Object)
|
|
71
216
|
return Object.values(e);
|
|
72
217
|
const t = [];
|
|
@@ -74,8 +219,8 @@ function Qr(e) {
|
|
|
74
219
|
e.hasOwnProperty(r) && t.push(e[r]);
|
|
75
220
|
return t;
|
|
76
221
|
}
|
|
77
|
-
function
|
|
78
|
-
const r =
|
|
222
|
+
function ss(e, t) {
|
|
223
|
+
const r = rs(e);
|
|
79
224
|
if ("find" in r)
|
|
80
225
|
return r.find(t);
|
|
81
226
|
const s = r;
|
|
@@ -85,20 +230,20 @@ function Xr(e, t) {
|
|
|
85
230
|
return i;
|
|
86
231
|
}
|
|
87
232
|
}
|
|
88
|
-
function
|
|
233
|
+
function W(e, t) {
|
|
89
234
|
Object.entries(e).forEach(([r, s]) => t(s, r));
|
|
90
235
|
}
|
|
91
236
|
function ee(e, t) {
|
|
92
237
|
return e.indexOf(t) !== -1;
|
|
93
238
|
}
|
|
94
|
-
function
|
|
239
|
+
function Le(e, t) {
|
|
95
240
|
for (let r = 0; r < e.length; r++) {
|
|
96
241
|
const s = e[r];
|
|
97
242
|
if (t(s))
|
|
98
243
|
return s;
|
|
99
244
|
}
|
|
100
245
|
}
|
|
101
|
-
class
|
|
246
|
+
class ns {
|
|
102
247
|
constructor() {
|
|
103
248
|
this.transfomers = {};
|
|
104
249
|
}
|
|
@@ -106,13 +251,13 @@ class Zr {
|
|
|
106
251
|
this.transfomers[t.name] = t;
|
|
107
252
|
}
|
|
108
253
|
findApplicable(t) {
|
|
109
|
-
return
|
|
254
|
+
return ss(this.transfomers, (r) => r.isApplicable(t));
|
|
110
255
|
}
|
|
111
256
|
findByName(t) {
|
|
112
257
|
return this.transfomers[t];
|
|
113
258
|
}
|
|
114
259
|
}
|
|
115
|
-
const
|
|
260
|
+
const is = (e) => Object.prototype.toString.call(e).slice(8, -1), ct = (e) => typeof e == "undefined", os = (e) => e === null, G = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, de = (e) => G(e) && Object.keys(e).length === 0, I = (e) => Array.isArray(e), as = (e) => typeof e == "string", us = (e) => typeof e == "number" && !isNaN(e), cs = (e) => typeof e == "boolean", ls = (e) => e instanceof RegExp, Y = (e) => e instanceof Map, J = (e) => e instanceof Set, lt = (e) => is(e) === "Symbol", fs = (e) => e instanceof Date && !isNaN(e.valueOf()), ds = (e) => e instanceof Error, Ue = (e) => typeof e == "number" && isNaN(e), ms = (e) => cs(e) || os(e) || ct(e) || us(e) || as(e) || lt(e), ps = (e) => typeof e == "bigint", gs = (e) => e === 1 / 0 || e === -1 / 0, ys = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), hs = (e) => e instanceof URL, ft = (e) => e.replace(/\./g, "\\."), ae = (e) => e.map(String).map(ft).join("."), K = (e) => {
|
|
116
261
|
const t = [];
|
|
117
262
|
let r = "";
|
|
118
263
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -138,12 +283,12 @@ function v(e, t, r, s) {
|
|
|
138
283
|
untransform: s
|
|
139
284
|
};
|
|
140
285
|
}
|
|
141
|
-
const
|
|
142
|
-
v(
|
|
286
|
+
const dt = [
|
|
287
|
+
v(ct, "undefined", () => null, () => {
|
|
143
288
|
}),
|
|
144
|
-
v(
|
|
145
|
-
v(
|
|
146
|
-
v(
|
|
289
|
+
v(ps, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
290
|
+
v(fs, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
291
|
+
v(ds, "Error", (e, t) => {
|
|
147
292
|
const r = {
|
|
148
293
|
name: e.name,
|
|
149
294
|
message: e.message
|
|
@@ -157,7 +302,7 @@ const lt = [
|
|
|
157
302
|
r[s] = e[s];
|
|
158
303
|
}), r;
|
|
159
304
|
}),
|
|
160
|
-
v(
|
|
305
|
+
v(ls, "regexp", (e) => "" + e, (e) => {
|
|
161
306
|
const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
|
|
162
307
|
return new RegExp(t, r);
|
|
163
308
|
}),
|
|
@@ -170,11 +315,11 @@ const lt = [
|
|
|
170
315
|
(e) => new Set(e)
|
|
171
316
|
),
|
|
172
317
|
v(Y, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
173
|
-
v((e) =>
|
|
318
|
+
v((e) => Ue(e) || gs(e), "number", (e) => Ue(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
174
319
|
v((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
175
|
-
v(
|
|
320
|
+
v(hs, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
176
321
|
];
|
|
177
|
-
function
|
|
322
|
+
function se(e, t, r, s) {
|
|
178
323
|
return {
|
|
179
324
|
isApplicable: e,
|
|
180
325
|
annotation: t,
|
|
@@ -182,12 +327,12 @@ function ie(e, t, r, s) {
|
|
|
182
327
|
untransform: s
|
|
183
328
|
};
|
|
184
329
|
}
|
|
185
|
-
const
|
|
330
|
+
const mt = se((e, t) => lt(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
186
331
|
const s = r.symbolRegistry.getValue(t[1]);
|
|
187
332
|
if (!s)
|
|
188
333
|
throw new Error("Trying to deserialize unknown symbol");
|
|
189
334
|
return s;
|
|
190
|
-
}),
|
|
335
|
+
}), bs = [
|
|
191
336
|
Int8Array,
|
|
192
337
|
Uint8Array,
|
|
193
338
|
Int16Array,
|
|
@@ -197,16 +342,16 @@ const ft = ie((e, t) => ut(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
|
|
|
197
342
|
Float32Array,
|
|
198
343
|
Float64Array,
|
|
199
344
|
Uint8ClampedArray
|
|
200
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
201
|
-
const r =
|
|
345
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), pt = se(ys, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
346
|
+
const r = bs[t[1]];
|
|
202
347
|
if (!r)
|
|
203
348
|
throw new Error("Trying to deserialize unknown typed array");
|
|
204
349
|
return new r(e);
|
|
205
350
|
});
|
|
206
|
-
function
|
|
351
|
+
function gt(e, t) {
|
|
207
352
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
208
353
|
}
|
|
209
|
-
const
|
|
354
|
+
const yt = se(gt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
210
355
|
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
211
356
|
if (!r)
|
|
212
357
|
return y({}, e);
|
|
@@ -219,44 +364,44 @@ const pt = ie(mt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
|
|
|
219
364
|
if (!s)
|
|
220
365
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
221
366
|
return Object.assign(Object.create(s.prototype), e);
|
|
222
|
-
}),
|
|
367
|
+
}), ht = se((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
|
|
223
368
|
const s = r.customTransformerRegistry.findByName(t[1]);
|
|
224
369
|
if (!s)
|
|
225
370
|
throw new Error("Trying to deserialize unknown custom value");
|
|
226
371
|
return s.deserialize(e);
|
|
227
|
-
}),
|
|
228
|
-
const r =
|
|
372
|
+
}), As = [yt, mt, ht, pt], _e = (e, t) => {
|
|
373
|
+
const r = Le(As, (n) => n.isApplicable(e, t));
|
|
229
374
|
if (r)
|
|
230
375
|
return {
|
|
231
376
|
value: r.transform(e, t),
|
|
232
377
|
type: r.annotation(e, t)
|
|
233
378
|
};
|
|
234
|
-
const s =
|
|
379
|
+
const s = Le(dt, (n) => n.isApplicable(e, t));
|
|
235
380
|
if (s)
|
|
236
381
|
return {
|
|
237
382
|
value: s.transform(e, t),
|
|
238
383
|
type: s.annotation
|
|
239
384
|
};
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
|
|
385
|
+
}, bt = {};
|
|
386
|
+
dt.forEach((e) => {
|
|
387
|
+
bt[e.annotation] = e;
|
|
243
388
|
});
|
|
244
|
-
const
|
|
389
|
+
const ws = (e, t, r) => {
|
|
245
390
|
if (I(t))
|
|
246
391
|
switch (t[0]) {
|
|
247
392
|
case "symbol":
|
|
248
|
-
return
|
|
393
|
+
return mt.untransform(e, t, r);
|
|
249
394
|
case "class":
|
|
250
|
-
return
|
|
395
|
+
return yt.untransform(e, t, r);
|
|
251
396
|
case "custom":
|
|
252
|
-
return
|
|
397
|
+
return ht.untransform(e, t, r);
|
|
253
398
|
case "typed-array":
|
|
254
|
-
return
|
|
399
|
+
return pt.untransform(e, t, r);
|
|
255
400
|
default:
|
|
256
401
|
throw new Error("Unknown transformation: " + t);
|
|
257
402
|
}
|
|
258
403
|
else {
|
|
259
|
-
const s =
|
|
404
|
+
const s = bt[t];
|
|
260
405
|
if (!s)
|
|
261
406
|
throw new Error("Unknown transformation: " + t);
|
|
262
407
|
return s.untransform(e, r);
|
|
@@ -269,7 +414,7 @@ const gs = (e, t, r) => {
|
|
|
269
414
|
r.next(), t--;
|
|
270
415
|
return r.next().value;
|
|
271
416
|
};
|
|
272
|
-
function
|
|
417
|
+
function At(e) {
|
|
273
418
|
if (ee(e, "__proto__"))
|
|
274
419
|
throw new Error("__proto__ is not allowed as a property");
|
|
275
420
|
if (ee(e, "prototype"))
|
|
@@ -277,8 +422,8 @@ function ht(e) {
|
|
|
277
422
|
if (ee(e, "constructor"))
|
|
278
423
|
throw new Error("constructor is not allowed as a property");
|
|
279
424
|
}
|
|
280
|
-
const
|
|
281
|
-
|
|
425
|
+
const Fs = (e, t) => {
|
|
426
|
+
At(t);
|
|
282
427
|
for (let r = 0; r < t.length; r++) {
|
|
283
428
|
const s = t[r];
|
|
284
429
|
if (J(e))
|
|
@@ -297,8 +442,8 @@ const ys = (e, t) => {
|
|
|
297
442
|
e = e[s];
|
|
298
443
|
}
|
|
299
444
|
return e;
|
|
300
|
-
},
|
|
301
|
-
if (
|
|
445
|
+
}, me = (e, t, r) => {
|
|
446
|
+
if (At(t), t.length === 0)
|
|
302
447
|
return r(e);
|
|
303
448
|
let s = e;
|
|
304
449
|
for (let i = 0; i < t.length - 1; i++) {
|
|
@@ -346,45 +491,45 @@ const ys = (e, t) => {
|
|
|
346
491
|
}
|
|
347
492
|
return e;
|
|
348
493
|
};
|
|
349
|
-
function
|
|
494
|
+
function pe(e, t, r = []) {
|
|
350
495
|
if (!e)
|
|
351
496
|
return;
|
|
352
497
|
if (!I(e)) {
|
|
353
|
-
|
|
498
|
+
W(e, (i, o) => pe(i, t, [...r, ...K(o)]));
|
|
354
499
|
return;
|
|
355
500
|
}
|
|
356
501
|
const [s, n] = e;
|
|
357
|
-
n &&
|
|
358
|
-
|
|
502
|
+
n && W(n, (i, o) => {
|
|
503
|
+
pe(i, t, [...r, ...K(o)]);
|
|
359
504
|
}), t(s, r);
|
|
360
505
|
}
|
|
361
|
-
function
|
|
362
|
-
return
|
|
363
|
-
e =
|
|
506
|
+
function Es(e, t, r) {
|
|
507
|
+
return pe(t, (s, n) => {
|
|
508
|
+
e = me(e, n, (i) => ws(i, s, r));
|
|
364
509
|
}), e;
|
|
365
510
|
}
|
|
366
|
-
function
|
|
511
|
+
function Cs(e, t) {
|
|
367
512
|
function r(s, n) {
|
|
368
|
-
const i =
|
|
513
|
+
const i = Fs(e, K(n));
|
|
369
514
|
s.map(K).forEach((o) => {
|
|
370
|
-
e =
|
|
515
|
+
e = me(e, o, () => i);
|
|
371
516
|
});
|
|
372
517
|
}
|
|
373
518
|
if (I(t)) {
|
|
374
519
|
const [s, n] = t;
|
|
375
520
|
s.forEach((i) => {
|
|
376
|
-
e =
|
|
377
|
-
}), n &&
|
|
521
|
+
e = me(e, K(i), () => e);
|
|
522
|
+
}), n && W(n, r);
|
|
378
523
|
} else
|
|
379
|
-
|
|
524
|
+
W(t, r);
|
|
380
525
|
return e;
|
|
381
526
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
527
|
+
const qs = (e, t) => G(e) || I(e) || Y(e) || J(e) || gt(e, t);
|
|
528
|
+
function Ts(e, t, r) {
|
|
384
529
|
const s = r.get(e);
|
|
385
530
|
s ? s.push(t) : r.set(e, [t]);
|
|
386
531
|
}
|
|
387
|
-
function
|
|
532
|
+
function xs(e, t) {
|
|
388
533
|
const r = {};
|
|
389
534
|
let s;
|
|
390
535
|
return e.forEach((n) => {
|
|
@@ -392,22 +537,22 @@ function ws(e, t) {
|
|
|
392
537
|
return;
|
|
393
538
|
t || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
|
|
394
539
|
const [i, ...o] = n;
|
|
395
|
-
i.length === 0 ? s = o.map(
|
|
396
|
-
}), s ?
|
|
540
|
+
i.length === 0 ? s = o.map(ae) : r[ae(i)] = o.map(ae);
|
|
541
|
+
}), s ? de(r) ? [s] : [s, r] : de(r) ? void 0 : r;
|
|
397
542
|
}
|
|
398
|
-
const
|
|
543
|
+
const wt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
399
544
|
var b;
|
|
400
|
-
const a =
|
|
545
|
+
const a = ms(e);
|
|
401
546
|
if (!a) {
|
|
402
|
-
|
|
547
|
+
Ts(e, n, t);
|
|
403
548
|
const g = o.get(e);
|
|
404
549
|
if (g)
|
|
405
550
|
return s ? {
|
|
406
551
|
transformedValue: null
|
|
407
552
|
} : g;
|
|
408
553
|
}
|
|
409
|
-
if (!
|
|
410
|
-
const g =
|
|
554
|
+
if (!qs(e, r)) {
|
|
555
|
+
const g = _e(e, r), m = g ? {
|
|
411
556
|
transformedValue: g.value,
|
|
412
557
|
annotations: [g.type]
|
|
413
558
|
} : {
|
|
@@ -419,16 +564,16 @@ const bt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
|
419
564
|
return {
|
|
420
565
|
transformedValue: null
|
|
421
566
|
};
|
|
422
|
-
const u =
|
|
423
|
-
|
|
567
|
+
const u = _e(e, r), c = (b = u == null ? void 0 : u.value) != null ? b : e, p = I(c) ? [] : {}, l = {};
|
|
568
|
+
W(c, (g, m) => {
|
|
424
569
|
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
425
570
|
throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
|
|
426
|
-
const A =
|
|
427
|
-
p[m] = A.transformedValue, I(A.annotations) ? l[m] = A.annotations : G(A.annotations) &&
|
|
428
|
-
l[
|
|
571
|
+
const A = wt(g, t, r, s, [...n, m], [...i, e], o);
|
|
572
|
+
p[m] = A.transformedValue, I(A.annotations) ? l[m] = A.annotations : G(A.annotations) && W(A.annotations, (C, N) => {
|
|
573
|
+
l[ft(m) + "." + N] = C;
|
|
429
574
|
});
|
|
430
575
|
});
|
|
431
|
-
const d =
|
|
576
|
+
const d = de(l) ? {
|
|
432
577
|
transformedValue: p,
|
|
433
578
|
annotations: u ? [u.type] : void 0
|
|
434
579
|
} : {
|
|
@@ -437,19 +582,19 @@ const bt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
|
437
582
|
};
|
|
438
583
|
return a || o.set(e, d), d;
|
|
439
584
|
};
|
|
440
|
-
function
|
|
585
|
+
function Ft(e) {
|
|
441
586
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
442
587
|
}
|
|
443
|
-
function
|
|
444
|
-
return
|
|
588
|
+
function Ve(e) {
|
|
589
|
+
return Ft(e) === "Array";
|
|
445
590
|
}
|
|
446
|
-
function
|
|
447
|
-
if (
|
|
591
|
+
function $s(e) {
|
|
592
|
+
if (Ft(e) !== "Object")
|
|
448
593
|
return !1;
|
|
449
594
|
const t = Object.getPrototypeOf(e);
|
|
450
595
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
451
596
|
}
|
|
452
|
-
function
|
|
597
|
+
function Ss(e, t, r, s, n) {
|
|
453
598
|
const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
|
|
454
599
|
i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
455
600
|
value: r,
|
|
@@ -458,17 +603,17 @@ function Cs(e, t, r, s, n) {
|
|
|
458
603
|
configurable: !0
|
|
459
604
|
});
|
|
460
605
|
}
|
|
461
|
-
function
|
|
462
|
-
if (
|
|
463
|
-
return e.map((n) =>
|
|
464
|
-
if (
|
|
606
|
+
function ge(e, t = {}) {
|
|
607
|
+
if (Ve(e))
|
|
608
|
+
return e.map((n) => ge(n, t));
|
|
609
|
+
if (!$s(e))
|
|
465
610
|
return e;
|
|
466
611
|
const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
467
612
|
return [...r, ...s].reduce((n, i) => {
|
|
468
|
-
if (
|
|
613
|
+
if (Ve(t.props) && !t.props.includes(i))
|
|
469
614
|
return n;
|
|
470
|
-
const o = e[i], a =
|
|
471
|
-
return
|
|
615
|
+
const o = e[i], a = ge(o, t);
|
|
616
|
+
return Ss(n, i, a, e, t.nonenumerable), n;
|
|
472
617
|
}, {});
|
|
473
618
|
}
|
|
474
619
|
class h {
|
|
@@ -476,27 +621,27 @@ class h {
|
|
|
476
621
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
477
622
|
*/
|
|
478
623
|
constructor({ dedupe: t = !1 } = {}) {
|
|
479
|
-
this.classRegistry = new
|
|
624
|
+
this.classRegistry = new ts(), this.symbolRegistry = new ut((r) => {
|
|
480
625
|
var s;
|
|
481
626
|
return (s = r.description) != null ? s : "";
|
|
482
|
-
}), this.customTransformerRegistry = new
|
|
627
|
+
}), this.customTransformerRegistry = new ns(), this.allowedErrorProps = [], this.dedupe = t;
|
|
483
628
|
}
|
|
484
629
|
serialize(t) {
|
|
485
|
-
const r = /* @__PURE__ */ new Map(), s =
|
|
630
|
+
const r = /* @__PURE__ */ new Map(), s = wt(t, r, this, this.dedupe), n = {
|
|
486
631
|
json: s.transformedValue
|
|
487
632
|
};
|
|
488
|
-
s.annotations && (n.meta =
|
|
633
|
+
s.annotations && (n.meta = w(y({}, n.meta), {
|
|
489
634
|
values: s.annotations
|
|
490
635
|
}));
|
|
491
|
-
const i =
|
|
492
|
-
return i && (n.meta =
|
|
636
|
+
const i = xs(r, this.dedupe);
|
|
637
|
+
return i && (n.meta = w(y({}, n.meta), {
|
|
493
638
|
referentialEqualities: i
|
|
494
639
|
})), n;
|
|
495
640
|
}
|
|
496
641
|
deserialize(t) {
|
|
497
642
|
const { json: r, meta: s } = t;
|
|
498
|
-
let n =
|
|
499
|
-
return s != null && s.values && (n =
|
|
643
|
+
let n = ge(r);
|
|
644
|
+
return s != null && s.values && (n = Es(n, s.values, this)), s != null && s.referentialEqualities && (n = Cs(n, s.referentialEqualities)), n;
|
|
500
645
|
}
|
|
501
646
|
stringify(t) {
|
|
502
647
|
return JSON.stringify(this.serialize(t));
|
|
@@ -528,7 +673,7 @@ h.registerClass = h.defaultInstance.registerClass.bind(h.defaultInstance);
|
|
|
528
673
|
h.registerSymbol = h.defaultInstance.registerSymbol.bind(h.defaultInstance);
|
|
529
674
|
h.registerCustom = h.defaultInstance.registerCustom.bind(h.defaultInstance);
|
|
530
675
|
h.allowErrorProps = h.defaultInstance.allowErrorProps.bind(h.defaultInstance);
|
|
531
|
-
const z = (e) => e === void 0 ? B.None : e,
|
|
676
|
+
const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e.type), Fe = (e) => new dr(
|
|
532
677
|
e.name,
|
|
533
678
|
e.expression,
|
|
534
679
|
e.type,
|
|
@@ -536,7 +681,7 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
536
681
|
z(e.sort),
|
|
537
682
|
e.dataSource,
|
|
538
683
|
e.composeCode
|
|
539
|
-
),
|
|
684
|
+
), Ee = (e) => new mr(
|
|
540
685
|
e.name,
|
|
541
686
|
e.expression,
|
|
542
687
|
e.granularity,
|
|
@@ -548,24 +693,24 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
548
693
|
), O = (e) => {
|
|
549
694
|
switch (e.__serializable) {
|
|
550
695
|
case "DimensionalAttribute":
|
|
551
|
-
return
|
|
696
|
+
return Fe(e);
|
|
552
697
|
case "DimensionalLevelAttribute":
|
|
553
|
-
return
|
|
698
|
+
return Ee(e);
|
|
554
699
|
default:
|
|
555
700
|
return e;
|
|
556
701
|
}
|
|
557
|
-
},
|
|
702
|
+
}, Et = (e) => new jr(
|
|
558
703
|
e.name,
|
|
559
704
|
e.expression,
|
|
560
705
|
e.attributes.map(O),
|
|
561
|
-
e.dimensions.map(
|
|
706
|
+
e.dimensions.map(Ds),
|
|
562
707
|
e.type,
|
|
563
708
|
e.description,
|
|
564
709
|
z(e.sort),
|
|
565
710
|
e.dataSource,
|
|
566
711
|
e.composeCode,
|
|
567
712
|
e.defaultAttribute ? O(e.defaultAttribute) : void 0
|
|
568
|
-
),
|
|
713
|
+
), Ct = (e) => new Kr(
|
|
569
714
|
e.name,
|
|
570
715
|
e.expression,
|
|
571
716
|
e.description,
|
|
@@ -574,16 +719,16 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
574
719
|
e.composeCode,
|
|
575
720
|
e.indexed,
|
|
576
721
|
e.merged
|
|
577
|
-
),
|
|
722
|
+
), Ds = (e) => {
|
|
578
723
|
switch (e.__serializable) {
|
|
579
724
|
case "DimensionalDimension":
|
|
580
|
-
return
|
|
725
|
+
return Et(e);
|
|
581
726
|
case "DimensionalDateDimension":
|
|
582
|
-
return
|
|
727
|
+
return Ct(e);
|
|
583
728
|
default:
|
|
584
729
|
return e;
|
|
585
730
|
}
|
|
586
|
-
},
|
|
731
|
+
}, Ce = (e) => new pr(
|
|
587
732
|
e.name,
|
|
588
733
|
O(e.attribute),
|
|
589
734
|
e.aggregation,
|
|
@@ -598,11 +743,11 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
598
743
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
599
744
|
switch (s.__serializable) {
|
|
600
745
|
case "DimensionalAttribute":
|
|
601
|
-
return [r,
|
|
746
|
+
return [r, Fe(s)];
|
|
602
747
|
case "DimensionalLevelAttribute":
|
|
603
|
-
return [r,
|
|
748
|
+
return [r, Ee(s)];
|
|
604
749
|
case "DimensionalBaseMeasure":
|
|
605
|
-
return [r,
|
|
750
|
+
return [r, Ce(s)];
|
|
606
751
|
case "DimensionalCalculatedMeasure":
|
|
607
752
|
return [r, qe(s)];
|
|
608
753
|
default:
|
|
@@ -621,7 +766,7 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
621
766
|
e.dataSource,
|
|
622
767
|
e.composeCode
|
|
623
768
|
);
|
|
624
|
-
},
|
|
769
|
+
}, qt = (e) => new yr(
|
|
625
770
|
e.name,
|
|
626
771
|
O(e.attribute),
|
|
627
772
|
e.format,
|
|
@@ -629,50 +774,50 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
629
774
|
z(e.sort),
|
|
630
775
|
e.dataSource,
|
|
631
776
|
e.composeCode
|
|
632
|
-
),
|
|
777
|
+
), ue = (e) => {
|
|
633
778
|
switch (e.__serializable) {
|
|
634
779
|
case "DimensionalBaseMeasure":
|
|
635
|
-
return
|
|
780
|
+
return Ce(e);
|
|
636
781
|
case "DimensionalCalculatedMeasure":
|
|
637
782
|
return qe(e);
|
|
638
783
|
case "DimensionalMeasureTemplate":
|
|
639
|
-
return
|
|
784
|
+
return qt(e);
|
|
640
785
|
default:
|
|
641
786
|
return e;
|
|
642
787
|
}
|
|
643
|
-
},
|
|
788
|
+
}, q = (e) => {
|
|
644
789
|
switch (e.__serializable) {
|
|
645
790
|
case "MembersFilter":
|
|
646
791
|
return new Sr(
|
|
647
792
|
O(e.attribute),
|
|
648
793
|
e.members,
|
|
649
|
-
e.config.backgroundFilter ?
|
|
794
|
+
e.config.backgroundFilter ? w(y({}, e.config), { backgroundFilter: q(e.config.backgroundFilter) }) : e.config,
|
|
650
795
|
e.composeCode
|
|
651
796
|
);
|
|
652
797
|
case "LogicalAttributeFilter":
|
|
653
798
|
return new $r(
|
|
654
|
-
e.filters.map((r) =>
|
|
799
|
+
e.filters.map((r) => q(r)),
|
|
655
800
|
e.operator,
|
|
656
801
|
e.config,
|
|
657
802
|
e.composeCode
|
|
658
803
|
);
|
|
659
804
|
case "CascadingFilter":
|
|
660
805
|
return new xr(
|
|
661
|
-
e._filters.map((r) =>
|
|
806
|
+
e._filters.map((r) => q(r)),
|
|
662
807
|
e.config,
|
|
663
808
|
e.composeCode
|
|
664
809
|
);
|
|
665
810
|
case "ExcludeFilter":
|
|
666
|
-
return new
|
|
667
|
-
|
|
668
|
-
e.input ?
|
|
811
|
+
return new Tr(
|
|
812
|
+
q(e.filter),
|
|
813
|
+
e.input ? q(e.input) : void 0,
|
|
669
814
|
e.config,
|
|
670
815
|
e.composeCode
|
|
671
816
|
);
|
|
672
817
|
case "MeasureFilter":
|
|
673
|
-
return new
|
|
818
|
+
return new qr(
|
|
674
819
|
O(e.attribute),
|
|
675
|
-
|
|
820
|
+
ue(e.measure),
|
|
676
821
|
e.operatorA,
|
|
677
822
|
e.valueA,
|
|
678
823
|
e.operatorB,
|
|
@@ -683,7 +828,7 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
683
828
|
case "RankingFilter":
|
|
684
829
|
return new Cr(
|
|
685
830
|
O(e.attribute),
|
|
686
|
-
|
|
831
|
+
ue(e.measure),
|
|
687
832
|
e.operator,
|
|
688
833
|
e.count,
|
|
689
834
|
e.config,
|
|
@@ -691,14 +836,14 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
691
836
|
);
|
|
692
837
|
case "MeasureRankingFilter":
|
|
693
838
|
return new Er(
|
|
694
|
-
|
|
839
|
+
ue(e.measure),
|
|
695
840
|
e.operator,
|
|
696
841
|
e.count,
|
|
697
842
|
e.config,
|
|
698
843
|
e.composeCode
|
|
699
844
|
);
|
|
700
845
|
case "NumericFilter":
|
|
701
|
-
return new
|
|
846
|
+
return new Fr(
|
|
702
847
|
O(e.attribute),
|
|
703
848
|
e.operatorA,
|
|
704
849
|
e.valueA,
|
|
@@ -708,7 +853,7 @@ const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e
|
|
|
708
853
|
e.composeCode
|
|
709
854
|
);
|
|
710
855
|
case "TextFilter":
|
|
711
|
-
return new
|
|
856
|
+
return new wr(
|
|
712
857
|
O(e.attribute),
|
|
713
858
|
e.operatorA,
|
|
714
859
|
e.valueA,
|
|
@@ -750,7 +895,7 @@ h.registerCustom(
|
|
|
750
895
|
{
|
|
751
896
|
isApplicable: Yt,
|
|
752
897
|
serialize: (e) => e.serialize(),
|
|
753
|
-
deserialize: (e) =>
|
|
898
|
+
deserialize: (e) => Os(e)
|
|
754
899
|
},
|
|
755
900
|
"JaqlElement"
|
|
756
901
|
);
|
|
@@ -758,7 +903,7 @@ h.registerCustom(
|
|
|
758
903
|
{
|
|
759
904
|
isApplicable: Ht,
|
|
760
905
|
serialize: (e) => e.serialize(),
|
|
761
|
-
deserialize: (e) =>
|
|
906
|
+
deserialize: (e) => Fe(e)
|
|
762
907
|
},
|
|
763
908
|
"DimensionalAttribute"
|
|
764
909
|
);
|
|
@@ -766,7 +911,7 @@ h.registerCustom(
|
|
|
766
911
|
{
|
|
767
912
|
isApplicable: Qt,
|
|
768
913
|
serialize: (e) => e.serialize(),
|
|
769
|
-
deserialize: (e) =>
|
|
914
|
+
deserialize: (e) => Ee(e)
|
|
770
915
|
},
|
|
771
916
|
"DimensionalLevelAttribute"
|
|
772
917
|
);
|
|
@@ -774,7 +919,7 @@ h.registerCustom(
|
|
|
774
919
|
{
|
|
775
920
|
isApplicable: Vr,
|
|
776
921
|
serialize: (e) => e.serialize(),
|
|
777
|
-
deserialize: (e) =>
|
|
922
|
+
deserialize: (e) => Et(e)
|
|
778
923
|
},
|
|
779
924
|
"DimensionalDimension"
|
|
780
925
|
);
|
|
@@ -782,7 +927,7 @@ h.registerCustom(
|
|
|
782
927
|
{
|
|
783
928
|
isApplicable: Wr,
|
|
784
929
|
serialize: (e) => e.serialize(),
|
|
785
|
-
deserialize: (e) =>
|
|
930
|
+
deserialize: (e) => Ct(e)
|
|
786
931
|
},
|
|
787
932
|
"DimensionalDateDimension"
|
|
788
933
|
);
|
|
@@ -790,7 +935,7 @@ h.registerCustom(
|
|
|
790
935
|
{
|
|
791
936
|
isApplicable: Xt,
|
|
792
937
|
serialize: (e) => e.serialize(),
|
|
793
|
-
deserialize: (e) =>
|
|
938
|
+
deserialize: (e) => Ce(e)
|
|
794
939
|
},
|
|
795
940
|
"DimensionalBaseMeasure"
|
|
796
941
|
);
|
|
@@ -806,15 +951,15 @@ h.registerCustom(
|
|
|
806
951
|
{
|
|
807
952
|
isApplicable: er,
|
|
808
953
|
serialize: (e) => e.serialize(),
|
|
809
|
-
deserialize: (e) =>
|
|
954
|
+
deserialize: (e) => qt(e)
|
|
810
955
|
},
|
|
811
956
|
"DimensionalMeasureTemplate"
|
|
812
957
|
);
|
|
813
958
|
h.registerCustom(
|
|
814
959
|
{
|
|
815
|
-
isApplicable:
|
|
960
|
+
isApplicable: be,
|
|
816
961
|
serialize: (e) => e.serialize(),
|
|
817
|
-
deserialize: (e) =>
|
|
962
|
+
deserialize: (e) => q(e)
|
|
818
963
|
},
|
|
819
964
|
"MembersFilter"
|
|
820
965
|
);
|
|
@@ -822,7 +967,7 @@ h.registerCustom(
|
|
|
822
967
|
{
|
|
823
968
|
isApplicable: tr,
|
|
824
969
|
serialize: (e) => e.serialize(),
|
|
825
|
-
deserialize: (e) =>
|
|
970
|
+
deserialize: (e) => q(e)
|
|
826
971
|
},
|
|
827
972
|
"LogicalAttributeFilter"
|
|
828
973
|
);
|
|
@@ -830,7 +975,7 @@ h.registerCustom(
|
|
|
830
975
|
{
|
|
831
976
|
isApplicable: rr,
|
|
832
977
|
serialize: (e) => e.serialize(),
|
|
833
|
-
deserialize: (e) =>
|
|
978
|
+
deserialize: (e) => q(e)
|
|
834
979
|
},
|
|
835
980
|
"CascadingFilter"
|
|
836
981
|
);
|
|
@@ -838,7 +983,7 @@ h.registerCustom(
|
|
|
838
983
|
{
|
|
839
984
|
isApplicable: sr,
|
|
840
985
|
serialize: (e) => e.serialize(),
|
|
841
|
-
deserialize: (e) =>
|
|
986
|
+
deserialize: (e) => q(e)
|
|
842
987
|
},
|
|
843
988
|
"ExcludeFilter"
|
|
844
989
|
);
|
|
@@ -846,7 +991,7 @@ h.registerCustom(
|
|
|
846
991
|
{
|
|
847
992
|
isApplicable: nr,
|
|
848
993
|
serialize: (e) => e.serialize(),
|
|
849
|
-
deserialize: (e) =>
|
|
994
|
+
deserialize: (e) => q(e)
|
|
850
995
|
},
|
|
851
996
|
"MeasureFilter"
|
|
852
997
|
);
|
|
@@ -854,7 +999,7 @@ h.registerCustom(
|
|
|
854
999
|
{
|
|
855
1000
|
isApplicable: ir,
|
|
856
1001
|
serialize: (e) => e.serialize(),
|
|
857
|
-
deserialize: (e) =>
|
|
1002
|
+
deserialize: (e) => q(e)
|
|
858
1003
|
},
|
|
859
1004
|
"RankingFilter"
|
|
860
1005
|
);
|
|
@@ -862,7 +1007,7 @@ h.registerCustom(
|
|
|
862
1007
|
{
|
|
863
1008
|
isApplicable: or,
|
|
864
1009
|
serialize: (e) => e.serialize(),
|
|
865
|
-
deserialize: (e) =>
|
|
1010
|
+
deserialize: (e) => q(e)
|
|
866
1011
|
},
|
|
867
1012
|
"MeasureRankingFilter"
|
|
868
1013
|
);
|
|
@@ -870,7 +1015,7 @@ h.registerCustom(
|
|
|
870
1015
|
{
|
|
871
1016
|
isApplicable: ar,
|
|
872
1017
|
serialize: (e) => e.serialize(),
|
|
873
|
-
deserialize: (e) =>
|
|
1018
|
+
deserialize: (e) => q(e)
|
|
874
1019
|
},
|
|
875
1020
|
"NumericFilter"
|
|
876
1021
|
);
|
|
@@ -878,7 +1023,7 @@ h.registerCustom(
|
|
|
878
1023
|
{
|
|
879
1024
|
isApplicable: ur,
|
|
880
1025
|
serialize: (e) => e.serialize(),
|
|
881
|
-
deserialize: (e) =>
|
|
1026
|
+
deserialize: (e) => q(e)
|
|
882
1027
|
},
|
|
883
1028
|
"TextFilter"
|
|
884
1029
|
);
|
|
@@ -886,7 +1031,7 @@ h.registerCustom(
|
|
|
886
1031
|
{
|
|
887
1032
|
isApplicable: cr,
|
|
888
1033
|
serialize: (e) => e.serialize(),
|
|
889
|
-
deserialize: (e) =>
|
|
1034
|
+
deserialize: (e) => q(e)
|
|
890
1035
|
},
|
|
891
1036
|
"DateRangeFilter"
|
|
892
1037
|
);
|
|
@@ -894,7 +1039,7 @@ h.registerCustom(
|
|
|
894
1039
|
{
|
|
895
1040
|
isApplicable: lr,
|
|
896
1041
|
serialize: (e) => e.serialize(),
|
|
897
|
-
deserialize: (e) =>
|
|
1042
|
+
deserialize: (e) => q(e)
|
|
898
1043
|
},
|
|
899
1044
|
"RelativeDateFilter"
|
|
900
1045
|
);
|
|
@@ -902,34 +1047,34 @@ h.registerCustom(
|
|
|
902
1047
|
{
|
|
903
1048
|
isApplicable: fr,
|
|
904
1049
|
serialize: (e) => e.serialize(),
|
|
905
|
-
deserialize: (e) =>
|
|
1050
|
+
deserialize: (e) => q(e)
|
|
906
1051
|
},
|
|
907
1052
|
"CustomFilter"
|
|
908
1053
|
);
|
|
909
|
-
const
|
|
1054
|
+
const ei = h, E = "DM.";
|
|
910
1055
|
function S(e) {
|
|
911
1056
|
return typeof e == "object" && e !== null;
|
|
912
1057
|
}
|
|
913
|
-
function
|
|
1058
|
+
function T(e) {
|
|
914
1059
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
915
1060
|
}
|
|
916
|
-
function
|
|
917
|
-
return e.every(
|
|
1061
|
+
function Tt(e) {
|
|
1062
|
+
return e.every(T);
|
|
918
1063
|
}
|
|
919
|
-
function
|
|
1064
|
+
function ne(e) {
|
|
920
1065
|
return "attribute" in e && "config" in e;
|
|
921
1066
|
}
|
|
922
1067
|
function Z(e) {
|
|
923
1068
|
return "left" in e && "right" in e && "operator" in e;
|
|
924
1069
|
}
|
|
925
|
-
function
|
|
926
|
-
return !
|
|
1070
|
+
function Te(e) {
|
|
1071
|
+
return !ne(e) && !Z(e);
|
|
927
1072
|
}
|
|
928
|
-
function
|
|
1073
|
+
function Ms(e) {
|
|
929
1074
|
return S(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
930
1075
|
}
|
|
931
|
-
function
|
|
932
|
-
return !S(e) || !("column" in e) ? !1 :
|
|
1076
|
+
function Ns(e) {
|
|
1077
|
+
return !S(e) || !("column" in e) ? !1 : T(e.column);
|
|
933
1078
|
}
|
|
934
1079
|
const x = 3;
|
|
935
1080
|
function R(e, t, r) {
|
|
@@ -941,14 +1086,14 @@ function R(e, t, r) {
|
|
|
941
1086
|
}
|
|
942
1087
|
return n !== void 0 ? { best: n, distance: s } : void 0;
|
|
943
1088
|
}
|
|
944
|
-
const
|
|
945
|
-
function
|
|
946
|
-
return e.localeCompare(t,
|
|
1089
|
+
const xt = "en";
|
|
1090
|
+
function ce(e, t) {
|
|
1091
|
+
return e.localeCompare(t, xt, { sensitivity: "accent" }) === 0;
|
|
947
1092
|
}
|
|
948
|
-
function
|
|
949
|
-
return t.length <= e.length && e.slice(0, t.length).localeCompare(t,
|
|
1093
|
+
function We(e, t) {
|
|
1094
|
+
return t.length <= e.length && e.slice(0, t.length).localeCompare(t, xt, { sensitivity: "accent" }) === 0;
|
|
950
1095
|
}
|
|
951
|
-
function
|
|
1096
|
+
function xe(e) {
|
|
952
1097
|
const t = [...e].sort((i, o) => o.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
953
1098
|
for (const i of e) {
|
|
954
1099
|
r.set(i.name, i);
|
|
@@ -966,7 +1111,7 @@ function $e(e) {
|
|
|
966
1111
|
columnMap: s
|
|
967
1112
|
};
|
|
968
1113
|
}
|
|
969
|
-
function
|
|
1114
|
+
function $e(e, t) {
|
|
970
1115
|
if (!e.startsWith(E))
|
|
971
1116
|
throw new Error(
|
|
972
1117
|
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
@@ -978,7 +1123,7 @@ function Se(e, t) {
|
|
|
978
1123
|
);
|
|
979
1124
|
let s, n;
|
|
980
1125
|
for (const m of t.sortedTables)
|
|
981
|
-
if (
|
|
1126
|
+
if (We(r, m.name + ".")) {
|
|
982
1127
|
const A = r.slice(m.name.length + 1);
|
|
983
1128
|
if (!A)
|
|
984
1129
|
throw new Error(
|
|
@@ -993,7 +1138,7 @@ function Se(e, t) {
|
|
|
993
1138
|
throw new Error(
|
|
994
1139
|
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
995
1140
|
);
|
|
996
|
-
const A = r.slice(0, m), C = R(A, t.sortedTables, (
|
|
1141
|
+
const A = r.slice(0, m), C = R(A, t.sortedTables, (oe) => oe.name), N = C && C.distance <= x ? ` Did you mean '${C.best.name}'?` : "";
|
|
997
1142
|
throw new Error(`Table '${A}' not found in the data model.${N}`);
|
|
998
1143
|
}
|
|
999
1144
|
const i = t.tableColumnMap.get(s.name);
|
|
@@ -1002,9 +1147,9 @@ function Se(e, t) {
|
|
|
1002
1147
|
let o, a;
|
|
1003
1148
|
const u = $.all;
|
|
1004
1149
|
for (const m of i) {
|
|
1005
|
-
if (
|
|
1150
|
+
if (ce(n, m.name))
|
|
1006
1151
|
return { table: s, column: m };
|
|
1007
|
-
if (!
|
|
1152
|
+
if (!We(n, m.name + "."))
|
|
1008
1153
|
continue;
|
|
1009
1154
|
const A = n.slice(m.name.length + 1);
|
|
1010
1155
|
if (!A)
|
|
@@ -1030,13 +1175,13 @@ function Se(e, t) {
|
|
|
1030
1175
|
)}.${A}`
|
|
1031
1176
|
);
|
|
1032
1177
|
}
|
|
1033
|
-
const c = n.indexOf("."), p = c === -1 ? n : n.slice(0, c), l = R(n, i, (m) => m.name), d = l && l.distance <= x && !
|
|
1178
|
+
const c = n.indexOf("."), p = c === -1 ? n : n.slice(0, c), l = R(n, i, (m) => m.name), d = l && l.distance <= x && !ce(l.best.name, p), b = d ? ` Did you mean '${l.best.name}'?` : "", g = !d && n.endsWith(".") && l !== void 0 && ce(l.best.name, p) ? ` Use '${p}' without a trailing dot.` : "";
|
|
1034
1179
|
throw new Error(
|
|
1035
1180
|
`Column '${p}' not found in table '${s.name}'.${b}${g}`
|
|
1036
1181
|
);
|
|
1037
1182
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const { table: r, column: s, level: n } =
|
|
1183
|
+
function Rs(e, t) {
|
|
1184
|
+
const { table: r, column: s, level: n } = $e(e, t);
|
|
1040
1185
|
if (n) {
|
|
1041
1186
|
if (!X(s.dataType))
|
|
1042
1187
|
throw new Error(
|
|
@@ -1063,7 +1208,7 @@ function Ss(e, t) {
|
|
|
1063
1208
|
return { table: r, column: s, level: n };
|
|
1064
1209
|
}
|
|
1065
1210
|
function H(e, t, r, s) {
|
|
1066
|
-
const { table: n, column: i, level: o } =
|
|
1211
|
+
const { table: n, column: i, level: o } = Rs(e, r);
|
|
1067
1212
|
let a = o;
|
|
1068
1213
|
if (X(i.dataType) && a === void 0 && (s != null && s.inferredDateLevel)) {
|
|
1069
1214
|
const u = s.inferredDateLevel, c = $.all;
|
|
@@ -1092,8 +1237,8 @@ function H(e, t, r, s) {
|
|
|
1092
1237
|
dataSource: t
|
|
1093
1238
|
});
|
|
1094
1239
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const { column: s, level: n } =
|
|
1240
|
+
function vs(e, t, r) {
|
|
1241
|
+
const { column: s, level: n } = $e(e, r);
|
|
1097
1242
|
if (n)
|
|
1098
1243
|
throw new Error(
|
|
1099
1244
|
`Invalid DateDimension name format: '${e}'. Expected format: '${E}TableName.ColumnName'`
|
|
@@ -1108,15 +1253,15 @@ function Os(e, t, r) {
|
|
|
1108
1253
|
dataSource: t
|
|
1109
1254
|
});
|
|
1110
1255
|
}
|
|
1111
|
-
const
|
|
1256
|
+
const Is = (e, t) => {
|
|
1112
1257
|
if (!e) return;
|
|
1113
1258
|
const r = typeof e == "object" ? e.direction : e;
|
|
1114
|
-
if (!
|
|
1115
|
-
return
|
|
1259
|
+
if (!tt(r))
|
|
1260
|
+
return w(y({}, t), {
|
|
1116
1261
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
|
|
1117
1262
|
});
|
|
1118
|
-
},
|
|
1119
|
-
const n =
|
|
1263
|
+
}, Ps = (e, t, r, s) => {
|
|
1264
|
+
const n = Is(e.sortType, s);
|
|
1120
1265
|
if (n)
|
|
1121
1266
|
return {
|
|
1122
1267
|
attribute: H(e.column, t, r),
|
|
@@ -1125,11 +1270,11 @@ const Ds = (e, t) => {
|
|
|
1125
1270
|
};
|
|
1126
1271
|
const i = H(e.column, t, r), o = _(e, "column");
|
|
1127
1272
|
return { attribute: i, style: o };
|
|
1128
|
-
},
|
|
1129
|
-
error:
|
|
1273
|
+
}, ks = (e, t, r, s) => typeof e == "string" ? { attribute: H(e, t, r) } : Ms(e) ? Ps(e, t, r, s) : {
|
|
1274
|
+
error: w(y({}, s), {
|
|
1130
1275
|
message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
|
|
1131
1276
|
})
|
|
1132
|
-
},
|
|
1277
|
+
}, $t = (e) => {
|
|
1133
1278
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
1134
1279
|
if (!t)
|
|
1135
1280
|
return { success: !0, data: [] };
|
|
@@ -1153,7 +1298,7 @@ const Ds = (e, t) => {
|
|
|
1153
1298
|
input: o
|
|
1154
1299
|
};
|
|
1155
1300
|
try {
|
|
1156
|
-
const c =
|
|
1301
|
+
const c = ks(o, r, s, u);
|
|
1157
1302
|
if (c.error) {
|
|
1158
1303
|
i.push(c.error);
|
|
1159
1304
|
return;
|
|
@@ -1163,47 +1308,47 @@ const Ds = (e, t) => {
|
|
|
1163
1308
|
);
|
|
1164
1309
|
} catch (c) {
|
|
1165
1310
|
const p = c instanceof Error ? c.message : "Unknown error";
|
|
1166
|
-
i.push(
|
|
1311
|
+
i.push(w(y({}, u), { message: p }));
|
|
1167
1312
|
}
|
|
1168
1313
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
1169
1314
|
};
|
|
1170
|
-
function
|
|
1315
|
+
function Se(e, t) {
|
|
1171
1316
|
const r = Reflect.get(e, t);
|
|
1172
1317
|
if (typeof r != "function")
|
|
1173
1318
|
throw new Error(`Function '${t}' not found or is not a function`);
|
|
1174
1319
|
return r;
|
|
1175
1320
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const r = e.replace("measureFactory.", ""), n =
|
|
1178
|
-
if (!
|
|
1321
|
+
function Bs(e, t) {
|
|
1322
|
+
const r = e.replace("measureFactory.", ""), n = Se(Dr, r)(...t);
|
|
1323
|
+
if (!Te(n))
|
|
1179
1324
|
throw new Error(`Function '${e}' did not return a valid Measure`);
|
|
1180
1325
|
return n;
|
|
1181
1326
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const r = e.replace("filterFactory.logic.", ""), n =
|
|
1327
|
+
function zs(e, t) {
|
|
1328
|
+
const r = e.replace("filterFactory.logic.", ""), n = Se(Mr, r)(...t);
|
|
1184
1329
|
if (!Z(n))
|
|
1185
1330
|
throw new Error(`Function '${e}' did not return a valid FilterRelations`);
|
|
1186
1331
|
return n;
|
|
1187
1332
|
}
|
|
1188
|
-
function
|
|
1333
|
+
function Ls(e, t) {
|
|
1189
1334
|
if (e.startsWith("filterFactory.logic."))
|
|
1190
|
-
return
|
|
1191
|
-
const r = e.replace("filterFactory.", ""), n =
|
|
1192
|
-
if (!
|
|
1335
|
+
return zs(e, t);
|
|
1336
|
+
const r = e.replace("filterFactory.", ""), n = Se(Nr, r)(...t);
|
|
1337
|
+
if (!ne(n) && !Z(n))
|
|
1193
1338
|
throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
|
|
1194
1339
|
return n;
|
|
1195
1340
|
}
|
|
1196
|
-
function
|
|
1341
|
+
function Us(e, t) {
|
|
1197
1342
|
const s = e.split(".")[0];
|
|
1198
1343
|
if (s === "measureFactory")
|
|
1199
|
-
return
|
|
1344
|
+
return Bs(e, t);
|
|
1200
1345
|
if (s === "filterFactory")
|
|
1201
|
-
return
|
|
1346
|
+
return Ls(e, t);
|
|
1202
1347
|
throw new Error(
|
|
1203
1348
|
`Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
|
|
1204
1349
|
);
|
|
1205
1350
|
}
|
|
1206
|
-
const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s),
|
|
1351
|
+
const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s), _s = /* @__PURE__ */ new Set([
|
|
1207
1352
|
"CORREL",
|
|
1208
1353
|
"COVARP",
|
|
1209
1354
|
"COVAR",
|
|
@@ -1333,159 +1478,19 @@ const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s), ks = /*
|
|
|
1333
1478
|
SIN: f("scalar", 1, 1),
|
|
1334
1479
|
SQRT: f("scalar", 1, 1),
|
|
1335
1480
|
TAN: f("scalar", 1, 1)
|
|
1336
|
-
},
|
|
1481
|
+
}, Vs = Object.keys(te).filter(
|
|
1337
1482
|
(e) => te[e].category === "xdiff"
|
|
1338
1483
|
);
|
|
1339
|
-
function
|
|
1340
|
-
return
|
|
1484
|
+
function St() {
|
|
1485
|
+
return Vs;
|
|
1341
1486
|
}
|
|
1342
|
-
function
|
|
1487
|
+
function Ot(e) {
|
|
1343
1488
|
const t = te[e.toUpperCase()];
|
|
1344
1489
|
return t == null ? void 0 : t.requiredDateLevel;
|
|
1345
1490
|
}
|
|
1346
|
-
function
|
|
1491
|
+
function Ws(e, t) {
|
|
1347
1492
|
return e === t ? e === 1 ? "1 parameter" : `${e} parameters` : t === Number.POSITIVE_INFINITY ? e <= 1 ? "any number of parameters" : `at least ${e} parameters` : `${e} or ${t} parameters`;
|
|
1348
1493
|
}
|
|
1349
|
-
function De(e, t) {
|
|
1350
|
-
const r = [];
|
|
1351
|
-
let s = "", n = 0, i = !1, o = null;
|
|
1352
|
-
for (let a = 0; a < e.length; a++) {
|
|
1353
|
-
const u = e[a], c = e[a + 1];
|
|
1354
|
-
if (i) {
|
|
1355
|
-
if (u !== o) {
|
|
1356
|
-
s += u;
|
|
1357
|
-
continue;
|
|
1358
|
-
}
|
|
1359
|
-
if (c === o) {
|
|
1360
|
-
s += u + c, a++;
|
|
1361
|
-
continue;
|
|
1362
|
-
}
|
|
1363
|
-
i = !1, o = null, s += u;
|
|
1364
|
-
continue;
|
|
1365
|
-
} else {
|
|
1366
|
-
if (u === "'" || u === '"') {
|
|
1367
|
-
i = !0, o = u, s += u;
|
|
1368
|
-
continue;
|
|
1369
|
-
}
|
|
1370
|
-
if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
|
|
1371
|
-
r.push(s.trim()), s = "";
|
|
1372
|
-
continue;
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
s += u;
|
|
1376
|
-
}
|
|
1377
|
-
return s.trim() && r.push(s.trim()), r;
|
|
1378
|
-
}
|
|
1379
|
-
function Ls(e, t) {
|
|
1380
|
-
let r = 0, s = !1, n = null;
|
|
1381
|
-
for (let i = 0; i < e.length; i++) {
|
|
1382
|
-
const o = e[i], a = e[i + 1];
|
|
1383
|
-
if (s) {
|
|
1384
|
-
if (o !== n) continue;
|
|
1385
|
-
if (a === n) {
|
|
1386
|
-
i++;
|
|
1387
|
-
continue;
|
|
1388
|
-
}
|
|
1389
|
-
s = !1, n = null;
|
|
1390
|
-
} else {
|
|
1391
|
-
if (o === "'" || o === '"') {
|
|
1392
|
-
s = !0, n = o;
|
|
1393
|
-
continue;
|
|
1394
|
-
}
|
|
1395
|
-
if ("([{".includes(o) && r++, ")]}".includes(o) && r--, o === t && r === 0) return i;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
return -1;
|
|
1399
|
-
}
|
|
1400
|
-
function Us(e, t) {
|
|
1401
|
-
if (e[t] !== "(") return -1;
|
|
1402
|
-
let r = 1, s = t + 1, n = !1, i = null;
|
|
1403
|
-
for (; s < e.length; ) {
|
|
1404
|
-
const o = e[s], a = e[s + 1];
|
|
1405
|
-
if (n) {
|
|
1406
|
-
if (o !== i) {
|
|
1407
|
-
s++;
|
|
1408
|
-
continue;
|
|
1409
|
-
}
|
|
1410
|
-
if (a === i) {
|
|
1411
|
-
s += 2;
|
|
1412
|
-
continue;
|
|
1413
|
-
}
|
|
1414
|
-
n = !1, i = null, s++;
|
|
1415
|
-
} else {
|
|
1416
|
-
if (o === "'" || o === '"') {
|
|
1417
|
-
n = !0, i = o, s++;
|
|
1418
|
-
continue;
|
|
1419
|
-
}
|
|
1420
|
-
if ("([{".includes(o) && r++, ")]}".includes(o) && --r === 0) return s;
|
|
1421
|
-
s++;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
return -1;
|
|
1425
|
-
}
|
|
1426
|
-
function _s(e) {
|
|
1427
|
-
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
1428
|
-
}
|
|
1429
|
-
function W(e) {
|
|
1430
|
-
if (!e || typeof e != "string")
|
|
1431
|
-
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
1432
|
-
const t = e.trim();
|
|
1433
|
-
if (!t)
|
|
1434
|
-
throw new Error("Invalid composeCode: empty string");
|
|
1435
|
-
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
1436
|
-
if (!r)
|
|
1437
|
-
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
1438
|
-
const s = r[1], n = r[2], i = St(n);
|
|
1439
|
-
return {
|
|
1440
|
-
function: s,
|
|
1441
|
-
args: i
|
|
1442
|
-
};
|
|
1443
|
-
}
|
|
1444
|
-
function St(e) {
|
|
1445
|
-
return e.trim() ? De(e, ",").map(Ot) : [];
|
|
1446
|
-
}
|
|
1447
|
-
function Ot(e) {
|
|
1448
|
-
if (!e)
|
|
1449
|
-
throw new Error("Cannot parse empty argument value");
|
|
1450
|
-
if (e === "null")
|
|
1451
|
-
return null;
|
|
1452
|
-
if (e === "undefined")
|
|
1453
|
-
return;
|
|
1454
|
-
if (e === "true")
|
|
1455
|
-
return !0;
|
|
1456
|
-
if (e === "false")
|
|
1457
|
-
return !1;
|
|
1458
|
-
if (e.match(/^-?\d+(\.\d+)?$/))
|
|
1459
|
-
return parseFloat(e);
|
|
1460
|
-
if (e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"')) {
|
|
1461
|
-
const r = e[0];
|
|
1462
|
-
return e.slice(1, -1).replace(new RegExp(`${r}${r}`, "g"), r);
|
|
1463
|
-
}
|
|
1464
|
-
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1465
|
-
const r = e.slice(1, -1).trim();
|
|
1466
|
-
if (!r)
|
|
1467
|
-
return [];
|
|
1468
|
-
const s = St(r);
|
|
1469
|
-
return s.every((n) => typeof n == "string"), s;
|
|
1470
|
-
}
|
|
1471
|
-
if (e.startsWith("{") && e.endsWith("}")) {
|
|
1472
|
-
const r = e.slice(1, -1).trim();
|
|
1473
|
-
return r ? Ws(r) : {};
|
|
1474
|
-
}
|
|
1475
|
-
return e.includes("(") && e.includes(")") ? W(e) : (e.startsWith("DM."), e);
|
|
1476
|
-
}
|
|
1477
|
-
function Vs(e) {
|
|
1478
|
-
const t = Ls(e, ":");
|
|
1479
|
-
if (t === -1)
|
|
1480
|
-
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
1481
|
-
const r = _s(e.slice(0, t).trim()), s = Ot(e.slice(t + 1).trim());
|
|
1482
|
-
return [r, s];
|
|
1483
|
-
}
|
|
1484
|
-
function Ws(e) {
|
|
1485
|
-
if (!e.trim()) return {};
|
|
1486
|
-
const t = De(e, ",").map(Vs).filter(([, r]) => r !== null);
|
|
1487
|
-
return Object.fromEntries(t);
|
|
1488
|
-
}
|
|
1489
1494
|
const js = /\[(\w[\w.-]*)\]/g, Dt = /* @__PURE__ */ new Set([
|
|
1490
1495
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1491
1496
|
"AVG",
|
|
@@ -1512,7 +1517,7 @@ const js = /\[(\w[\w.-]*)\]/g, Dt = /* @__PURE__ */ new Set([
|
|
|
1512
1517
|
"i"
|
|
1513
1518
|
);
|
|
1514
1519
|
function Mt(e) {
|
|
1515
|
-
return
|
|
1520
|
+
return T(e) ? !0 : typeof e == "string" && e.startsWith(E) ? !1 : S(e) && "kind" in e ? e.kind === "measure" : !0;
|
|
1516
1521
|
}
|
|
1517
1522
|
function Gs(e) {
|
|
1518
1523
|
const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
|
|
@@ -1588,14 +1593,14 @@ function Zs(e, t) {
|
|
|
1588
1593
|
return e.length;
|
|
1589
1594
|
}
|
|
1590
1595
|
function en(e) {
|
|
1591
|
-
return
|
|
1596
|
+
return we(e, ",").filter((t) => t.trim().length > 0).length;
|
|
1592
1597
|
}
|
|
1593
1598
|
function tn(e, t, r, s) {
|
|
1594
1599
|
for (; t < e.length && /\s/.test(e[t]); )
|
|
1595
1600
|
t++;
|
|
1596
1601
|
if (e[t] !== "(")
|
|
1597
1602
|
return t;
|
|
1598
|
-
const n = t, i =
|
|
1603
|
+
const n = t, i = Hr(e, n);
|
|
1599
1604
|
if (i === -1)
|
|
1600
1605
|
return n + 1;
|
|
1601
1606
|
const o = e.slice(n + 1, i);
|
|
@@ -1625,7 +1630,7 @@ function vt(e) {
|
|
|
1625
1630
|
function rn(e) {
|
|
1626
1631
|
const t = vt(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1627
1632
|
for (const { name: n, argCount: i } of t) {
|
|
1628
|
-
if (
|
|
1633
|
+
if (_s.has(n)) {
|
|
1629
1634
|
r.has(n) || (r.add(n), M(
|
|
1630
1635
|
e,
|
|
1631
1636
|
`${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
|
|
@@ -1635,7 +1640,7 @@ function rn(e) {
|
|
|
1635
1640
|
const o = te[n];
|
|
1636
1641
|
if (o && (i < o.minArgs || i > o.maxArgs) && !s.has(n)) {
|
|
1637
1642
|
s.add(n);
|
|
1638
|
-
const a =
|
|
1643
|
+
const a = Ws(o.minArgs, o.maxArgs);
|
|
1639
1644
|
M(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${a}`);
|
|
1640
1645
|
}
|
|
1641
1646
|
}
|
|
@@ -1681,7 +1686,7 @@ function an(e) {
|
|
|
1681
1686
|
const s = r.map((i) => `[${Nt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
|
|
1682
1687
|
e.errorOnUnusedContext ? M(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
|
|
1683
1688
|
}
|
|
1684
|
-
function
|
|
1689
|
+
function je(e, t, r, s) {
|
|
1685
1690
|
var o;
|
|
1686
1691
|
const n = (o = s.context[j(e)]) != null ? o : s.context[e];
|
|
1687
1692
|
if (n === void 0) return;
|
|
@@ -1694,7 +1699,7 @@ function Je(e, t, r, s) {
|
|
|
1694
1699
|
}
|
|
1695
1700
|
if (s.schemaIndex)
|
|
1696
1701
|
try {
|
|
1697
|
-
const a =
|
|
1702
|
+
const a = $e(n, s.schemaIndex);
|
|
1698
1703
|
X(a.column.dataType) ? r && a.level && a.level !== r && M(
|
|
1699
1704
|
s,
|
|
1700
1705
|
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${a.level}'.`
|
|
@@ -1708,10 +1713,10 @@ function Je(e, t, r, s) {
|
|
|
1708
1713
|
}
|
|
1709
1714
|
}
|
|
1710
1715
|
function un(e) {
|
|
1711
|
-
const t =
|
|
1716
|
+
const t = St(), r = Rt(e.formula, t);
|
|
1712
1717
|
for (const s of r) {
|
|
1713
|
-
const n =
|
|
1714
|
-
|
|
1718
|
+
const n = Ot(s.functionName);
|
|
1719
|
+
je(s.ref1, s, n, e), je(s.ref2, s, n, e);
|
|
1715
1720
|
}
|
|
1716
1721
|
}
|
|
1717
1722
|
function cn(e, t, r = {}) {
|
|
@@ -1757,7 +1762,7 @@ function fn(e, t) {
|
|
|
1757
1762
|
const o = dn(s), a = {};
|
|
1758
1763
|
for (const [u, c] of Object.entries(i)) {
|
|
1759
1764
|
const p = `args[2].${u}`;
|
|
1760
|
-
if (
|
|
1765
|
+
if (T(c))
|
|
1761
1766
|
a[`${u}`] = D({
|
|
1762
1767
|
data: c,
|
|
1763
1768
|
context: {
|
|
@@ -1789,9 +1794,9 @@ function fn(e, t) {
|
|
|
1789
1794
|
e[2] = a;
|
|
1790
1795
|
}
|
|
1791
1796
|
function dn(e) {
|
|
1792
|
-
const t =
|
|
1797
|
+
const t = St(), r = Rt(e, t), s = {};
|
|
1793
1798
|
for (const n of r) {
|
|
1794
|
-
const i =
|
|
1799
|
+
const i = Ot(n.functionName);
|
|
1795
1800
|
if (i !== void 0)
|
|
1796
1801
|
for (const o of [n.ref1, n.ref2]) {
|
|
1797
1802
|
const a = s[o];
|
|
@@ -1816,38 +1821,38 @@ function mn(e) {
|
|
|
1816
1821
|
function pn(e) {
|
|
1817
1822
|
return It(e) || Pt(e);
|
|
1818
1823
|
}
|
|
1819
|
-
function
|
|
1824
|
+
function ie(e) {
|
|
1820
1825
|
return e.type === U.TextAttribute ? "text" : e.type === U.NumericAttribute ? "numeric" : e.type === U.DateLevel ? "date/datetime" : "unknown";
|
|
1821
1826
|
}
|
|
1822
|
-
function
|
|
1827
|
+
function Oe(e, t) {
|
|
1823
1828
|
const r = e[0];
|
|
1824
1829
|
if (!r || typeof r != "object" || !("type" in r))
|
|
1825
1830
|
throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1826
1831
|
return r;
|
|
1827
1832
|
}
|
|
1828
|
-
function
|
|
1829
|
-
const r =
|
|
1833
|
+
function Ke(e, t) {
|
|
1834
|
+
const r = Oe(e, t);
|
|
1830
1835
|
if (!pn(r))
|
|
1831
1836
|
throw new Error(
|
|
1832
|
-
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1837
|
+
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ie(
|
|
1833
1838
|
r
|
|
1834
1839
|
)} attribute`
|
|
1835
1840
|
);
|
|
1836
1841
|
}
|
|
1837
1842
|
function P(e, t) {
|
|
1838
|
-
const r =
|
|
1843
|
+
const r = Oe(e, t);
|
|
1839
1844
|
if (!Pt(r))
|
|
1840
1845
|
throw new Error(
|
|
1841
|
-
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1846
|
+
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ie(
|
|
1842
1847
|
r
|
|
1843
1848
|
)} attribute`
|
|
1844
1849
|
);
|
|
1845
1850
|
}
|
|
1846
1851
|
function k(e, t) {
|
|
1847
|
-
const r =
|
|
1852
|
+
const r = Oe(e, t);
|
|
1848
1853
|
if (!It(r))
|
|
1849
1854
|
throw new Error(
|
|
1850
|
-
`${t.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1855
|
+
`${t.pathPrefix}args[0]: Attribute must be string type, got ${ie(
|
|
1851
1856
|
r
|
|
1852
1857
|
)} attribute`
|
|
1853
1858
|
);
|
|
@@ -1860,7 +1865,7 @@ function gn(e, t) {
|
|
|
1860
1865
|
}
|
|
1861
1866
|
function yn(e, t) {
|
|
1862
1867
|
const r = gn(e, t);
|
|
1863
|
-
if (!
|
|
1868
|
+
if (!be(r))
|
|
1864
1869
|
throw new Error(
|
|
1865
1870
|
`${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
|
|
1866
1871
|
);
|
|
@@ -1868,8 +1873,8 @@ function yn(e, t) {
|
|
|
1868
1873
|
const hn = {
|
|
1869
1874
|
"measureFactory.customFormula": fn,
|
|
1870
1875
|
// String | Number filters
|
|
1871
|
-
"filterFactory.equals":
|
|
1872
|
-
"filterFactory.doesntEqual":
|
|
1876
|
+
"filterFactory.equals": Ke,
|
|
1877
|
+
"filterFactory.doesntEqual": Ke,
|
|
1873
1878
|
// Numeric filters
|
|
1874
1879
|
"filterFactory.greaterThan": P,
|
|
1875
1880
|
"filterFactory.greaterThanOrEqual": P,
|
|
@@ -2419,18 +2424,18 @@ const kt = {
|
|
|
2419
2424
|
{ type: "FilterRelationsNode", required: !0 }
|
|
2420
2425
|
]
|
|
2421
2426
|
};
|
|
2422
|
-
function
|
|
2427
|
+
function De(e) {
|
|
2423
2428
|
return kt[`${e}`];
|
|
2424
2429
|
}
|
|
2425
2430
|
function An(e) {
|
|
2426
|
-
const t =
|
|
2431
|
+
const t = De(e);
|
|
2427
2432
|
return t ? t.filter((r) => r.required).length : 0;
|
|
2428
2433
|
}
|
|
2429
|
-
function
|
|
2430
|
-
const t =
|
|
2434
|
+
function wn(e) {
|
|
2435
|
+
const t = De(e);
|
|
2431
2436
|
return t ? t.length : 0;
|
|
2432
2437
|
}
|
|
2433
|
-
function
|
|
2438
|
+
function Fn(e) {
|
|
2434
2439
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
2435
2440
|
return !1;
|
|
2436
2441
|
const r = Date.parse(e);
|
|
@@ -2439,7 +2444,7 @@ function wn(e) {
|
|
|
2439
2444
|
const s = new Date(e);
|
|
2440
2445
|
return !isNaN(s.getTime());
|
|
2441
2446
|
}
|
|
2442
|
-
function
|
|
2447
|
+
function le(e, t, r, s) {
|
|
2443
2448
|
if (e.startsWith(E))
|
|
2444
2449
|
try {
|
|
2445
2450
|
return H(e, t, r);
|
|
@@ -2454,7 +2459,7 @@ function de(e, t, r, s) {
|
|
|
2454
2459
|
function En(e, t, r, s) {
|
|
2455
2460
|
if (e.startsWith(E))
|
|
2456
2461
|
try {
|
|
2457
|
-
return
|
|
2462
|
+
return vs(e, t, r);
|
|
2458
2463
|
} catch (n) {
|
|
2459
2464
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2460
2465
|
throw new Error(`${s}: ${i}`);
|
|
@@ -2509,7 +2514,7 @@ function Cn(e) {
|
|
|
2509
2514
|
throw new Error(
|
|
2510
2515
|
`${o}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
|
|
2511
2516
|
);
|
|
2512
|
-
return
|
|
2517
|
+
return le(t, s, n, o);
|
|
2513
2518
|
case "Attribute[]":
|
|
2514
2519
|
if (!Array.isArray(t))
|
|
2515
2520
|
throw new Error(
|
|
@@ -2518,11 +2523,11 @@ function Cn(e) {
|
|
|
2518
2523
|
return t.map((a, u) => {
|
|
2519
2524
|
if (typeof a != "string")
|
|
2520
2525
|
throw new Error(`${o}[${u}]: Expected attribute string, got ${typeof a}`);
|
|
2521
|
-
return
|
|
2526
|
+
return le(a, s, n, `${o}[${u}]`);
|
|
2522
2527
|
});
|
|
2523
2528
|
case "Measure":
|
|
2524
2529
|
case "BaseMeasure":
|
|
2525
|
-
if (!
|
|
2530
|
+
if (!T(t))
|
|
2526
2531
|
throw new Error(
|
|
2527
2532
|
`${o}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
|
|
2528
2533
|
);
|
|
@@ -2536,7 +2541,7 @@ function Cn(e) {
|
|
|
2536
2541
|
`${o}: Expected array of measure function calls, got ${typeof t}`
|
|
2537
2542
|
);
|
|
2538
2543
|
return t.map((a, u) => {
|
|
2539
|
-
if (!
|
|
2544
|
+
if (!T(a))
|
|
2540
2545
|
throw new Error(
|
|
2541
2546
|
`${o}[${u}]: Expected measure function call, got ${typeof a}`
|
|
2542
2547
|
);
|
|
@@ -2546,7 +2551,7 @@ function Cn(e) {
|
|
|
2546
2551
|
});
|
|
2547
2552
|
});
|
|
2548
2553
|
case "Filter":
|
|
2549
|
-
if (!
|
|
2554
|
+
if (!T(t))
|
|
2550
2555
|
throw new Error(
|
|
2551
2556
|
`${o}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
|
|
2552
2557
|
);
|
|
@@ -2560,7 +2565,7 @@ function Cn(e) {
|
|
|
2560
2565
|
`${o}: Expected array of filter function calls, got ${typeof t}`
|
|
2561
2566
|
);
|
|
2562
2567
|
return t.map((a, u) => {
|
|
2563
|
-
if (!
|
|
2568
|
+
if (!T(a))
|
|
2564
2569
|
throw new Error(
|
|
2565
2570
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2566
2571
|
);
|
|
@@ -2572,7 +2577,7 @@ function Cn(e) {
|
|
|
2572
2577
|
case "FilterRelationsNode":
|
|
2573
2578
|
if (Array.isArray(t))
|
|
2574
2579
|
return t.map((a, u) => {
|
|
2575
|
-
if (!
|
|
2580
|
+
if (!T(a))
|
|
2576
2581
|
throw new Error(
|
|
2577
2582
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2578
2583
|
);
|
|
@@ -2581,7 +2586,7 @@ function Cn(e) {
|
|
|
2581
2586
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2582
2587
|
});
|
|
2583
2588
|
});
|
|
2584
|
-
if (
|
|
2589
|
+
if (T(t))
|
|
2585
2590
|
return D({
|
|
2586
2591
|
data: t,
|
|
2587
2592
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
@@ -2600,7 +2605,7 @@ function Cn(e) {
|
|
|
2600
2605
|
throw new Error(
|
|
2601
2606
|
`${o}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
|
|
2602
2607
|
);
|
|
2603
|
-
const a =
|
|
2608
|
+
const a = le(
|
|
2604
2609
|
t,
|
|
2605
2610
|
s,
|
|
2606
2611
|
n,
|
|
@@ -2608,7 +2613,7 @@ function Cn(e) {
|
|
|
2608
2613
|
);
|
|
2609
2614
|
if (!mn(a))
|
|
2610
2615
|
throw new Error(
|
|
2611
|
-
`${o}: Attribute must be date/datetime type, got ${
|
|
2616
|
+
`${o}: Attribute must be date/datetime type, got ${ie(
|
|
2612
2617
|
a
|
|
2613
2618
|
)} attribute`
|
|
2614
2619
|
);
|
|
@@ -2617,7 +2622,7 @@ function Cn(e) {
|
|
|
2617
2622
|
case "Measure | number":
|
|
2618
2623
|
if (typeof t == "number")
|
|
2619
2624
|
return t;
|
|
2620
|
-
if (
|
|
2625
|
+
if (T(t))
|
|
2621
2626
|
return D({
|
|
2622
2627
|
data: t,
|
|
2623
2628
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
@@ -2627,7 +2632,7 @@ function Cn(e) {
|
|
|
2627
2632
|
);
|
|
2628
2633
|
case "Date | string":
|
|
2629
2634
|
if (typeof t == "string") {
|
|
2630
|
-
if (
|
|
2635
|
+
if (Fn(t))
|
|
2631
2636
|
return t;
|
|
2632
2637
|
throw new Error(
|
|
2633
2638
|
`${o}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
|
|
@@ -2655,14 +2660,14 @@ function Cn(e) {
|
|
|
2655
2660
|
}
|
|
2656
2661
|
}
|
|
2657
2662
|
function D(e) {
|
|
2658
|
-
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u =
|
|
2663
|
+
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u = De(i);
|
|
2659
2664
|
if (!u) {
|
|
2660
2665
|
const g = Object.keys(kt), m = R(i, g, (C) => C), A = m && m.distance <= x ? ` Did you mean '${m.best}'?` : "";
|
|
2661
2666
|
throw new Error(
|
|
2662
2667
|
`${a}function: Unknown function '${i}'.${A}`
|
|
2663
2668
|
);
|
|
2664
2669
|
}
|
|
2665
|
-
const c = An(i), p =
|
|
2670
|
+
const c = An(i), p = wn(i);
|
|
2666
2671
|
if (o.length < c)
|
|
2667
2672
|
throw new Error(
|
|
2668
2673
|
`${a}function: Expected at least ${c} arguments, got ${o.length}`
|
|
@@ -2694,8 +2699,8 @@ function D(e) {
|
|
|
2694
2699
|
});
|
|
2695
2700
|
l.push(N);
|
|
2696
2701
|
} catch (N) {
|
|
2697
|
-
const
|
|
2698
|
-
d.push(
|
|
2702
|
+
const oe = N instanceof Error ? N.message : "Unknown error";
|
|
2703
|
+
d.push(oe);
|
|
2699
2704
|
}
|
|
2700
2705
|
}
|
|
2701
2706
|
if (d.length > 0) {
|
|
@@ -2714,23 +2719,23 @@ function D(e) {
|
|
|
2714
2719
|
const m = g instanceof Error ? g.message : "Unknown validation error";
|
|
2715
2720
|
throw new Error(m);
|
|
2716
2721
|
}
|
|
2717
|
-
return
|
|
2722
|
+
return Us(i, l);
|
|
2718
2723
|
}
|
|
2719
2724
|
function Bt(e) {
|
|
2720
2725
|
const { attribute: t, config: r } = e;
|
|
2721
|
-
if (
|
|
2726
|
+
if (be(e) && Rr(t)) {
|
|
2722
2727
|
const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i = vr(r), o = Object.keys(i).length === 0 ? void 0 : i;
|
|
2723
2728
|
return Ir(t, n, o);
|
|
2724
2729
|
}
|
|
2725
2730
|
return e;
|
|
2726
2731
|
}
|
|
2727
|
-
function
|
|
2732
|
+
function qn(e) {
|
|
2728
2733
|
let t = [];
|
|
2729
2734
|
for (const r of e)
|
|
2730
|
-
Z(r) ? t =
|
|
2735
|
+
Z(r) ? t = ze(r, t) : t = ze([Bt(r)], t);
|
|
2731
2736
|
return t != null ? t : [];
|
|
2732
2737
|
}
|
|
2733
|
-
const
|
|
2738
|
+
const Tn = (e) => {
|
|
2734
2739
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2735
2740
|
return t.forEach((o, a) => {
|
|
2736
2741
|
const u = {
|
|
@@ -2743,15 +2748,15 @@ const qn = (e) => {
|
|
|
2743
2748
|
data: o,
|
|
2744
2749
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2745
2750
|
});
|
|
2746
|
-
!Z(c) && !
|
|
2751
|
+
!Z(c) && !ne(c) ? i.push(w(y({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2747
2752
|
} catch (c) {
|
|
2748
2753
|
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2749
|
-
i.push(
|
|
2754
|
+
i.push(w(y({}, u), { message: p }));
|
|
2750
2755
|
}
|
|
2751
|
-
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data:
|
|
2752
|
-
},
|
|
2756
|
+
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: qn(n) };
|
|
2757
|
+
}, Me = (e) => {
|
|
2753
2758
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2754
|
-
return t ?
|
|
2759
|
+
return t ? Tt(t) ? Tn({
|
|
2755
2760
|
data: t,
|
|
2756
2761
|
context: { dataSource: r, schemaIndex: s }
|
|
2757
2762
|
}) : {
|
|
@@ -2778,15 +2783,15 @@ const qn = (e) => {
|
|
|
2778
2783
|
data: o,
|
|
2779
2784
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2780
2785
|
});
|
|
2781
|
-
|
|
2786
|
+
ne(c) ? n.push(Bt(c)) : i.push(w(y({}, u), { message: "Invalid filter JSON" }));
|
|
2782
2787
|
} catch (c) {
|
|
2783
2788
|
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2784
|
-
i.push(
|
|
2789
|
+
i.push(w(y({}, u), { message: p }));
|
|
2785
2790
|
}
|
|
2786
2791
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2787
|
-
},
|
|
2792
|
+
}, Ne = (e) => {
|
|
2788
2793
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2789
|
-
return t ?
|
|
2794
|
+
return t ? Tt(t) ? xn({
|
|
2790
2795
|
data: t,
|
|
2791
2796
|
context: { dataSource: r, schemaIndex: s }
|
|
2792
2797
|
}) : {
|
|
@@ -2801,8 +2806,8 @@ const qn = (e) => {
|
|
|
2801
2806
|
]
|
|
2802
2807
|
} : { success: !0, data: [] };
|
|
2803
2808
|
}, $n = (e, t) => {
|
|
2804
|
-
if (e && !
|
|
2805
|
-
return
|
|
2809
|
+
if (e && !tt(e))
|
|
2810
|
+
return w(y({}, t), {
|
|
2806
2811
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
|
|
2807
2812
|
});
|
|
2808
2813
|
}, Sn = (e, t, r) => {
|
|
@@ -2812,15 +2817,15 @@ const qn = (e) => {
|
|
|
2812
2817
|
data: e,
|
|
2813
2818
|
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2814
2819
|
});
|
|
2815
|
-
return
|
|
2820
|
+
return Te(i) ? { success: !0, data: i } : {
|
|
2816
2821
|
success: !1,
|
|
2817
|
-
errors: [
|
|
2822
|
+
errors: [w(y({}, r), { message: "Invalid measure JSON" })]
|
|
2818
2823
|
};
|
|
2819
2824
|
} catch (i) {
|
|
2820
2825
|
const o = i instanceof Error ? i.message : "Unknown error";
|
|
2821
2826
|
return {
|
|
2822
2827
|
success: !1,
|
|
2823
|
-
errors: [
|
|
2828
|
+
errors: [w(y({}, r), { message: o })]
|
|
2824
2829
|
};
|
|
2825
2830
|
}
|
|
2826
2831
|
}, On = (e, t, r, s) => {
|
|
@@ -2828,10 +2833,10 @@ const qn = (e) => {
|
|
|
2828
2833
|
data: e.column,
|
|
2829
2834
|
context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
|
|
2830
2835
|
});
|
|
2831
|
-
if (!
|
|
2836
|
+
if (!Te(n))
|
|
2832
2837
|
return {
|
|
2833
2838
|
style: {},
|
|
2834
|
-
error:
|
|
2839
|
+
error: w(y({}, s), { message: "Invalid measure JSON" })
|
|
2835
2840
|
};
|
|
2836
2841
|
const i = $n(e.sortType, s);
|
|
2837
2842
|
if (i) {
|
|
@@ -2841,9 +2846,9 @@ const qn = (e) => {
|
|
|
2841
2846
|
const o = _(e, "column");
|
|
2842
2847
|
return { measure: n, style: o };
|
|
2843
2848
|
}, Dn = (e, t, r, s) => {
|
|
2844
|
-
if (
|
|
2849
|
+
if (Ns(e))
|
|
2845
2850
|
return On(e, t, r, s);
|
|
2846
|
-
if (
|
|
2851
|
+
if (T(e)) {
|
|
2847
2852
|
const n = Sn(
|
|
2848
2853
|
e,
|
|
2849
2854
|
{ dataSource: t, schemaIndex: r },
|
|
@@ -2852,7 +2857,7 @@ const qn = (e) => {
|
|
|
2852
2857
|
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2853
2858
|
}
|
|
2854
2859
|
return {
|
|
2855
|
-
error:
|
|
2860
|
+
error: w(y({}, s), {
|
|
2856
2861
|
message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
|
|
2857
2862
|
})
|
|
2858
2863
|
};
|
|
@@ -2890,7 +2895,7 @@ const qn = (e) => {
|
|
|
2890
2895
|
);
|
|
2891
2896
|
} catch (c) {
|
|
2892
2897
|
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2893
|
-
i.push(
|
|
2898
|
+
i.push(w(y({}, u), { message: p }));
|
|
2894
2899
|
}
|
|
2895
2900
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2896
2901
|
};
|
|
@@ -2899,7 +2904,7 @@ function Q(e) {
|
|
|
2899
2904
|
Object.entries(e).map(([t, r]) => [t, Q(r)])
|
|
2900
2905
|
) : e;
|
|
2901
2906
|
}
|
|
2902
|
-
function
|
|
2907
|
+
function F(e, t, r) {
|
|
2903
2908
|
const s = e();
|
|
2904
2909
|
if (!s.success) {
|
|
2905
2910
|
const n = r ? s.errors.map(r) : s.errors;
|
|
@@ -2907,63 +2912,29 @@ function w(e, t, r) {
|
|
|
2907
2912
|
}
|
|
2908
2913
|
return s.data;
|
|
2909
2914
|
}
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
const s = r == null ? void 0 : r.sortType;
|
|
2914
|
-
if (!s) return t;
|
|
2915
|
-
const n = typeof s == "object" ? s.direction : s;
|
|
2916
|
-
return se(n) ? t.sort(ne(n)) : t;
|
|
2917
|
-
});
|
|
2918
|
-
}
|
|
2919
|
-
function Nn(e) {
|
|
2920
|
-
var t, r;
|
|
2921
|
-
return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1;
|
|
2922
|
-
}
|
|
2923
|
-
function Rn(e) {
|
|
2924
|
-
var t, r;
|
|
2925
|
-
return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1;
|
|
2926
|
-
}
|
|
2927
|
-
function vn(e) {
|
|
2928
|
-
var r, s;
|
|
2929
|
-
const t = [];
|
|
2930
|
-
for (const { measure: n, style: i } of e) {
|
|
2931
|
-
const o = i == null ? void 0 : i.sortType, a = o && se(o) ? n.sort(ne(o)) : n;
|
|
2932
|
-
t.push(a), i != null && i.trend && !Nn(n) && t.push(
|
|
2933
|
-
Pr(n, `${Ie}_${(r = n.name) != null ? r : "Measure"}`, i.trend)
|
|
2934
|
-
), i != null && i.forecast && !Rn(n) && t.push(
|
|
2935
|
-
kr(
|
|
2936
|
-
n,
|
|
2937
|
-
`${Pe}_${(s = n.name) != null ? s : "Measure"}`,
|
|
2938
|
-
i.forecast
|
|
2939
|
-
)
|
|
2940
|
-
);
|
|
2941
|
-
}
|
|
2942
|
-
return t;
|
|
2943
|
-
}
|
|
2944
|
-
const ii = (e) => {
|
|
2945
|
-
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = $e(s), i = [], o = w(
|
|
2946
|
-
() => qt({
|
|
2915
|
+
const ti = (e) => {
|
|
2916
|
+
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = xe(s), i = [], o = F(
|
|
2917
|
+
() => $t({
|
|
2947
2918
|
data: t.dimensions || [],
|
|
2948
2919
|
context: { dataSource: r, schemaIndex: n }
|
|
2949
2920
|
}),
|
|
2950
2921
|
i
|
|
2951
|
-
), a =
|
|
2922
|
+
), a = F(
|
|
2952
2923
|
() => zt({
|
|
2953
2924
|
data: t.measures || [],
|
|
2954
2925
|
context: { dataSource: r, schemaIndex: n }
|
|
2955
2926
|
}),
|
|
2956
2927
|
i
|
|
2957
|
-
), u =
|
|
2958
|
-
() =>
|
|
2928
|
+
), u = F(
|
|
2929
|
+
() => Me({
|
|
2959
2930
|
data: t.filters || [],
|
|
2960
2931
|
context: { dataSource: r, schemaIndex: n }
|
|
2961
2932
|
}),
|
|
2962
2933
|
i
|
|
2963
2934
|
);
|
|
2964
2935
|
let c = null;
|
|
2965
|
-
return t.highlights && (c =
|
|
2966
|
-
() =>
|
|
2936
|
+
return t.highlights && (c = F(
|
|
2937
|
+
() => Ne({
|
|
2967
2938
|
data: t.highlights || [],
|
|
2968
2939
|
context: { dataSource: r, schemaIndex: n }
|
|
2969
2940
|
}),
|
|
@@ -2974,21 +2945,21 @@ const ii = (e) => {
|
|
|
2974
2945
|
} : {
|
|
2975
2946
|
success: !0,
|
|
2976
2947
|
data: y({
|
|
2977
|
-
dataSource:
|
|
2978
|
-
dimensions: o ?
|
|
2979
|
-
measures: a ?
|
|
2948
|
+
dataSource: Ae(r),
|
|
2949
|
+
dimensions: o ? Pr(o) : [],
|
|
2950
|
+
measures: a ? kr(a) : [],
|
|
2980
2951
|
filters: u || []
|
|
2981
2952
|
}, c && { highlights: c })
|
|
2982
2953
|
};
|
|
2983
2954
|
};
|
|
2984
|
-
function
|
|
2955
|
+
function Ge(e) {
|
|
2985
2956
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2986
2957
|
}
|
|
2987
|
-
function
|
|
2958
|
+
function Re(e) {
|
|
2988
2959
|
const t = [], r = [];
|
|
2989
2960
|
return e.forEach((s, n) => {
|
|
2990
2961
|
var l, d, b;
|
|
2991
|
-
const i =
|
|
2962
|
+
const i = Ge(s) ? s.column : s, o = Ge(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
|
|
2992
2963
|
if (!i.composeCode) {
|
|
2993
2964
|
r.push({
|
|
2994
2965
|
category: "dimensions",
|
|
@@ -3007,18 +2978,18 @@ function ke(e) {
|
|
|
3007
2978
|
});
|
|
3008
2979
|
return;
|
|
3009
2980
|
}
|
|
3010
|
-
const u = (b = o != null && o.sortType ?
|
|
2981
|
+
const u = (b = o != null && o.sortType ? rt(o.sortType) : void 0) != null ? b : ((l = i.getSort) == null ? void 0 : l.call(i)) !== void 0 && ((d = i.getSort) == null ? void 0 : d.call(i)) !== B.None ? i.getSort() : void 0, c = o ? _(o, "column") : {};
|
|
3011
2982
|
if (u !== void 0 && u !== B.None || o && Object.keys(c).length > 0) {
|
|
3012
2983
|
const g = y(y({
|
|
3013
2984
|
column: i.composeCode
|
|
3014
|
-
}, u !== void 0 && u !== B.None && { sortType:
|
|
2985
|
+
}, u !== void 0 && u !== B.None && { sortType: st(u) }), c);
|
|
3015
2986
|
t.push(g);
|
|
3016
2987
|
} else
|
|
3017
2988
|
t.push(i.composeCode);
|
|
3018
2989
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3019
2990
|
}
|
|
3020
|
-
const
|
|
3021
|
-
function
|
|
2991
|
+
const ye = "Unknown error";
|
|
2992
|
+
function ve(e) {
|
|
3022
2993
|
if (!e)
|
|
3023
2994
|
return { success: !0, data: [] };
|
|
3024
2995
|
const t = [];
|
|
@@ -3036,9 +3007,9 @@ function Be(e) {
|
|
|
3036
3007
|
]
|
|
3037
3008
|
};
|
|
3038
3009
|
try {
|
|
3039
|
-
return { success: !0, data: [
|
|
3010
|
+
return { success: !0, data: [V(e.composeCode)] };
|
|
3040
3011
|
} catch (s) {
|
|
3041
|
-
const n = s instanceof Error ? s.message :
|
|
3012
|
+
const n = s instanceof Error ? s.message : ye;
|
|
3042
3013
|
return {
|
|
3043
3014
|
success: !1,
|
|
3044
3015
|
errors: [
|
|
@@ -3065,10 +3036,10 @@ function Be(e) {
|
|
|
3065
3036
|
return;
|
|
3066
3037
|
}
|
|
3067
3038
|
try {
|
|
3068
|
-
const o =
|
|
3039
|
+
const o = V(s.composeCode);
|
|
3069
3040
|
r.push(o);
|
|
3070
3041
|
} catch (o) {
|
|
3071
|
-
const a = o instanceof Error ? o.message :
|
|
3042
|
+
const a = o instanceof Error ? o.message : ye;
|
|
3072
3043
|
t.push({
|
|
3073
3044
|
category: "filters",
|
|
3074
3045
|
index: n,
|
|
@@ -3078,7 +3049,7 @@ function Be(e) {
|
|
|
3078
3049
|
}
|
|
3079
3050
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
3080
3051
|
}
|
|
3081
|
-
function
|
|
3052
|
+
function Ie(e) {
|
|
3082
3053
|
if (!e)
|
|
3083
3054
|
return { success: !0, data: [] };
|
|
3084
3055
|
const t = [], r = [];
|
|
@@ -3094,10 +3065,10 @@ function ze(e) {
|
|
|
3094
3065
|
return;
|
|
3095
3066
|
}
|
|
3096
3067
|
try {
|
|
3097
|
-
const o =
|
|
3068
|
+
const o = V(s.composeCode);
|
|
3098
3069
|
t.push(o);
|
|
3099
3070
|
} catch (o) {
|
|
3100
|
-
const a = o instanceof Error ? o.message :
|
|
3071
|
+
const a = o instanceof Error ? o.message : ye;
|
|
3101
3072
|
r.push({
|
|
3102
3073
|
category: "highlights",
|
|
3103
3074
|
index: n,
|
|
@@ -3107,14 +3078,14 @@ function ze(e) {
|
|
|
3107
3078
|
}
|
|
3108
3079
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3109
3080
|
}
|
|
3110
|
-
function
|
|
3081
|
+
function Ye(e) {
|
|
3111
3082
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
3112
3083
|
}
|
|
3113
|
-
function
|
|
3084
|
+
function Pe(e) {
|
|
3114
3085
|
const t = [], r = [];
|
|
3115
3086
|
return e.forEach((s, n) => {
|
|
3116
3087
|
var u, c, p;
|
|
3117
|
-
const i =
|
|
3088
|
+
const i = Ye(s) ? s.column : s, o = Ye(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
|
|
3118
3089
|
if (!i.composeCode) {
|
|
3119
3090
|
r.push({
|
|
3120
3091
|
category: "measures",
|
|
@@ -3125,11 +3096,11 @@ function Le(e) {
|
|
|
3125
3096
|
return;
|
|
3126
3097
|
}
|
|
3127
3098
|
try {
|
|
3128
|
-
const l =
|
|
3099
|
+
const l = V(i.composeCode), d = (p = o != null && o.sortType ? rt(o.sortType) : void 0) != null ? p : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== B.None ? i.getSort() : void 0;
|
|
3129
3100
|
if (d !== void 0 && d !== B.None || o && Object.keys(_(o, "column")).length > 0) {
|
|
3130
3101
|
const g = o ? _(o, "column") : {}, m = y(y({
|
|
3131
3102
|
column: l
|
|
3132
|
-
}, d !== void 0 && d !== B.None && { sortType:
|
|
3103
|
+
}, d !== void 0 && d !== B.None && { sortType: st(d) }), g);
|
|
3133
3104
|
t.push(m);
|
|
3134
3105
|
} else
|
|
3135
3106
|
t.push(l);
|
|
@@ -3144,42 +3115,42 @@ function Le(e) {
|
|
|
3144
3115
|
}
|
|
3145
3116
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3146
3117
|
}
|
|
3147
|
-
function
|
|
3118
|
+
function Je(e) {
|
|
3148
3119
|
var t, r, s, n;
|
|
3149
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3120
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(nt)) != null ? n : !1);
|
|
3150
3121
|
}
|
|
3151
|
-
function
|
|
3122
|
+
function He(e) {
|
|
3152
3123
|
var t, r, s, n;
|
|
3153
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3124
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(it)) != null ? n : !1);
|
|
3154
3125
|
}
|
|
3155
|
-
function
|
|
3126
|
+
function Qe(e) {
|
|
3156
3127
|
try {
|
|
3157
|
-
const t =
|
|
3128
|
+
const t = V(e.trim());
|
|
3158
3129
|
return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
|
|
3159
3130
|
} catch (t) {
|
|
3160
3131
|
return;
|
|
3161
3132
|
}
|
|
3162
3133
|
}
|
|
3163
|
-
function
|
|
3134
|
+
function Mn(e) {
|
|
3164
3135
|
var s, n, i;
|
|
3165
3136
|
if (!(e != null && e.length)) return [];
|
|
3166
3137
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3167
3138
|
for (let o = 0; o < e.length; o++) {
|
|
3168
3139
|
if (t.has(o)) continue;
|
|
3169
3140
|
const a = e[o];
|
|
3170
|
-
if (
|
|
3141
|
+
if (Je(a) || He(a)) {
|
|
3171
3142
|
r.push(a);
|
|
3172
3143
|
continue;
|
|
3173
3144
|
}
|
|
3174
|
-
const u = (s = a.name) != null ? s : "Measure", c = `${
|
|
3145
|
+
const u = (s = a.name) != null ? s : "Measure", c = `${nt}_${u}`, p = `${it}_${u}`;
|
|
3175
3146
|
let l, d, b = o + 1;
|
|
3176
|
-
if (b < e.length && !t.has(b) &&
|
|
3147
|
+
if (b < e.length && !t.has(b) && Je(e[b]) && e[b].name === c) {
|
|
3177
3148
|
const g = (n = e[b].composeCode) == null ? void 0 : n.trim();
|
|
3178
|
-
g && (l =
|
|
3149
|
+
g && (l = Qe(g), t.add(b), b++);
|
|
3179
3150
|
}
|
|
3180
|
-
if (b < e.length && !t.has(b) &&
|
|
3151
|
+
if (b < e.length && !t.has(b) && He(e[b]) && e[b].name === p) {
|
|
3181
3152
|
const g = (i = e[b].composeCode) == null ? void 0 : i.trim();
|
|
3182
|
-
g && (d =
|
|
3153
|
+
g && (d = Qe(g), t.add(b));
|
|
3183
3154
|
}
|
|
3184
3155
|
l !== void 0 || d !== void 0 ? r.push(y(y({
|
|
3185
3156
|
column: a
|
|
@@ -3187,20 +3158,20 @@ function In(e) {
|
|
|
3187
3158
|
}
|
|
3188
3159
|
return r;
|
|
3189
3160
|
}
|
|
3190
|
-
function
|
|
3191
|
-
const t = [], r =
|
|
3192
|
-
() =>
|
|
3161
|
+
function ri(e) {
|
|
3162
|
+
const t = [], r = F(
|
|
3163
|
+
() => Re(e.dimensions || []),
|
|
3193
3164
|
t
|
|
3194
|
-
), s =
|
|
3195
|
-
() =>
|
|
3165
|
+
), s = Mn(e.measures || []), n = F(
|
|
3166
|
+
() => Pe(s),
|
|
3196
3167
|
t
|
|
3197
|
-
), i =
|
|
3198
|
-
() =>
|
|
3168
|
+
), i = F(
|
|
3169
|
+
() => ve(e.filters),
|
|
3199
3170
|
t
|
|
3200
3171
|
);
|
|
3201
3172
|
let o = null;
|
|
3202
|
-
if (e.highlights && e.highlights.length > 0 && (o =
|
|
3203
|
-
() =>
|
|
3173
|
+
if (e.highlights && e.highlights.length > 0 && (o = F(
|
|
3174
|
+
() => Ie(e.highlights),
|
|
3204
3175
|
t
|
|
3205
3176
|
)), t.length > 0)
|
|
3206
3177
|
return {
|
|
@@ -3220,7 +3191,7 @@ function oi(e) {
|
|
|
3220
3191
|
}
|
|
3221
3192
|
const Lt = new Set(
|
|
3222
3193
|
zr.filter((e) => e !== "image")
|
|
3223
|
-
),
|
|
3194
|
+
), Xe = Object.freeze([...Lt]), fe = /* @__PURE__ */ new Set([
|
|
3224
3195
|
"category",
|
|
3225
3196
|
"value",
|
|
3226
3197
|
"breakBy",
|
|
@@ -3243,7 +3214,7 @@ const Lt = new Set(
|
|
|
3243
3214
|
"min",
|
|
3244
3215
|
"max",
|
|
3245
3216
|
"seriesToColorMap"
|
|
3246
|
-
]),
|
|
3217
|
+
]), Nn = {
|
|
3247
3218
|
line: {
|
|
3248
3219
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3249
3220
|
requiredAxes: ["category", "value"]
|
|
@@ -3316,7 +3287,7 @@ const Lt = new Set(
|
|
|
3316
3287
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3317
3288
|
requiredAxes: ["category", "value"]
|
|
3318
3289
|
}
|
|
3319
|
-
},
|
|
3290
|
+
}, Rn = /* @__PURE__ */ new Set([
|
|
3320
3291
|
"category",
|
|
3321
3292
|
"breakBy",
|
|
3322
3293
|
"breakByPoint",
|
|
@@ -3324,7 +3295,7 @@ const Lt = new Set(
|
|
|
3324
3295
|
"geo",
|
|
3325
3296
|
"details",
|
|
3326
3297
|
"date"
|
|
3327
|
-
]),
|
|
3298
|
+
]), vn = /* @__PURE__ */ new Set([
|
|
3328
3299
|
"value",
|
|
3329
3300
|
"size",
|
|
3330
3301
|
"colorBy",
|
|
@@ -3336,8 +3307,8 @@ const Lt = new Set(
|
|
|
3336
3307
|
"max",
|
|
3337
3308
|
"color"
|
|
3338
3309
|
]);
|
|
3339
|
-
function
|
|
3340
|
-
const t =
|
|
3310
|
+
function In(e) {
|
|
3311
|
+
const t = Nn[e];
|
|
3341
3312
|
if (t)
|
|
3342
3313
|
return {
|
|
3343
3314
|
validAxes: new Set(t.validAxes),
|
|
@@ -3347,18 +3318,18 @@ function zn(e) {
|
|
|
3347
3318
|
function Ut(e) {
|
|
3348
3319
|
return typeof e == "string" && Lt.has(e);
|
|
3349
3320
|
}
|
|
3350
|
-
function
|
|
3351
|
-
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" ||
|
|
3321
|
+
function Pn(e, t, r) {
|
|
3322
|
+
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Rn.has(e))
|
|
3352
3323
|
return !0;
|
|
3353
|
-
if (
|
|
3324
|
+
if (vn.has(e))
|
|
3354
3325
|
return !1;
|
|
3355
3326
|
const s = Array.isArray(t) ? t[0] : t;
|
|
3356
3327
|
if (!s)
|
|
3357
3328
|
return !0;
|
|
3358
3329
|
let n;
|
|
3359
|
-
return S(s) && "column" in s && (n = s.column), !(
|
|
3330
|
+
return S(s) && "column" in s && (n = s.column), !(T(s) || n !== void 0 && T(n));
|
|
3360
3331
|
}
|
|
3361
|
-
function
|
|
3332
|
+
function kn(e) {
|
|
3362
3333
|
const t = [], r = {
|
|
3363
3334
|
chartType: "",
|
|
3364
3335
|
dataOptions: {}
|
|
@@ -3382,7 +3353,7 @@ function Un(e) {
|
|
|
3382
3353
|
} else if (Ut(s))
|
|
3383
3354
|
r.chartType = s;
|
|
3384
3355
|
else {
|
|
3385
|
-
const i = R(String(s),
|
|
3356
|
+
const i = R(String(s), Xe, (u) => u), o = i && i.distance <= x ? ` Did you mean '${i.best}'?` : "", a = Xe.slice(0, 8).join(", ");
|
|
3386
3357
|
t.push({
|
|
3387
3358
|
category: "chartType",
|
|
3388
3359
|
index: -1,
|
|
@@ -3402,12 +3373,12 @@ function Un(e) {
|
|
|
3402
3373
|
} else n !== null && typeof n == "object" && (r.dataOptions = n);
|
|
3403
3374
|
return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
|
|
3404
3375
|
}
|
|
3405
|
-
function
|
|
3376
|
+
function Bn(e) {
|
|
3406
3377
|
return e.map(
|
|
3407
3378
|
({ attribute: t, style: r }) => r ? y({ column: t }, r) : t
|
|
3408
3379
|
);
|
|
3409
3380
|
}
|
|
3410
|
-
function
|
|
3381
|
+
function zn(e) {
|
|
3411
3382
|
return e.map(
|
|
3412
3383
|
({ measure: t, style: r }) => r ? y({ column: t }, r) : t
|
|
3413
3384
|
);
|
|
@@ -3415,8 +3386,8 @@ function Vn(e) {
|
|
|
3415
3386
|
function _t(e) {
|
|
3416
3387
|
return Array.isArray(e) ? e : [e];
|
|
3417
3388
|
}
|
|
3418
|
-
function
|
|
3419
|
-
return (t) =>
|
|
3389
|
+
function he(e) {
|
|
3390
|
+
return (t) => w(y({}, t), {
|
|
3420
3391
|
category: "dataOptions",
|
|
3421
3392
|
index: e
|
|
3422
3393
|
});
|
|
@@ -3428,60 +3399,60 @@ function re(e, t, r, s, n) {
|
|
|
3428
3399
|
if (i.length === 0)
|
|
3429
3400
|
return [];
|
|
3430
3401
|
if (r === "dimension") {
|
|
3431
|
-
const a =
|
|
3432
|
-
() =>
|
|
3402
|
+
const a = F(
|
|
3403
|
+
() => $t({
|
|
3433
3404
|
data: i,
|
|
3434
3405
|
context: s
|
|
3435
3406
|
}),
|
|
3436
3407
|
n,
|
|
3437
|
-
|
|
3408
|
+
he(e)
|
|
3438
3409
|
);
|
|
3439
|
-
return a !== null ?
|
|
3410
|
+
return a !== null ? Bn(a) : null;
|
|
3440
3411
|
}
|
|
3441
|
-
const o =
|
|
3412
|
+
const o = F(
|
|
3442
3413
|
() => zt({
|
|
3443
3414
|
data: i,
|
|
3444
3415
|
context: s
|
|
3445
3416
|
}),
|
|
3446
3417
|
n,
|
|
3447
|
-
|
|
3418
|
+
he(e)
|
|
3448
3419
|
);
|
|
3449
|
-
return o !== null ?
|
|
3420
|
+
return o !== null ? zn(o) : null;
|
|
3450
3421
|
}
|
|
3451
|
-
function
|
|
3422
|
+
function Ze(e, t, r) {
|
|
3452
3423
|
const s = Array.isArray(t) ? t : t != null ? [t] : [];
|
|
3453
3424
|
if (r === "dimension") {
|
|
3454
|
-
const i =
|
|
3425
|
+
const i = Re(
|
|
3455
3426
|
s
|
|
3456
3427
|
);
|
|
3457
3428
|
return i.success ? { success: !0, data: i.data } : {
|
|
3458
3429
|
success: !1,
|
|
3459
|
-
errors: i.errors.map((o) =>
|
|
3430
|
+
errors: i.errors.map((o) => w(y({}, o), {
|
|
3460
3431
|
category: "dataOptions",
|
|
3461
3432
|
index: e
|
|
3462
3433
|
}))
|
|
3463
3434
|
};
|
|
3464
3435
|
}
|
|
3465
|
-
const n =
|
|
3436
|
+
const n = Pe(s);
|
|
3466
3437
|
return n.success ? { success: !0, data: n.data } : {
|
|
3467
3438
|
success: !1,
|
|
3468
|
-
errors: n.errors.map((i) =>
|
|
3439
|
+
errors: n.errors.map((i) => w(y({}, i), {
|
|
3469
3440
|
category: "dataOptions",
|
|
3470
3441
|
index: e
|
|
3471
3442
|
}))
|
|
3472
3443
|
};
|
|
3473
3444
|
}
|
|
3474
|
-
function
|
|
3445
|
+
function Ln(e, t) {
|
|
3475
3446
|
let r;
|
|
3476
3447
|
S(e) && "column" in e && (r = e.column);
|
|
3477
|
-
const n = !(
|
|
3448
|
+
const n = !(T(e) || r !== void 0 && T(r)) ? "dimension" : "measure", i = [], o = re("columns", [e], n, t, i);
|
|
3478
3449
|
return o !== null ? { success: !0, data: o } : { success: !1, errors: i };
|
|
3479
3450
|
}
|
|
3480
|
-
function
|
|
3451
|
+
function Un(e, t, r, s) {
|
|
3481
3452
|
const n = [];
|
|
3482
3453
|
for (const i of e) {
|
|
3483
|
-
const o =
|
|
3484
|
-
() =>
|
|
3454
|
+
const o = F(
|
|
3455
|
+
() => Ln(i, t),
|
|
3485
3456
|
r,
|
|
3486
3457
|
s
|
|
3487
3458
|
);
|
|
@@ -3489,7 +3460,7 @@ function jn(e, t, r, s) {
|
|
|
3489
3460
|
}
|
|
3490
3461
|
return n;
|
|
3491
3462
|
}
|
|
3492
|
-
function
|
|
3463
|
+
function _n(e, t, r) {
|
|
3493
3464
|
if (!e || !S(e))
|
|
3494
3465
|
return r.push({
|
|
3495
3466
|
category: "dataOptions",
|
|
@@ -3499,8 +3470,8 @@ function Kn(e, t, r) {
|
|
|
3499
3470
|
}), null;
|
|
3500
3471
|
const s = {}, { chartType: n } = t, i = r.length, o = e, a = Object.keys(e), u = /* @__PURE__ */ new Map();
|
|
3501
3472
|
for (const l of a)
|
|
3502
|
-
if (!
|
|
3503
|
-
const d = R(l, [...
|
|
3473
|
+
if (!fe.has(l)) {
|
|
3474
|
+
const d = R(l, [...fe], (g) => g), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "";
|
|
3504
3475
|
d && d.distance <= x && u.set(l, d.best), r.push({
|
|
3505
3476
|
category: "dataOptions",
|
|
3506
3477
|
index: l,
|
|
@@ -3508,10 +3479,10 @@ function Kn(e, t, r) {
|
|
|
3508
3479
|
message: `Unknown dataOptions key '${l}'.${b}`
|
|
3509
3480
|
});
|
|
3510
3481
|
}
|
|
3511
|
-
const c = n ?
|
|
3482
|
+
const c = n ? In(n) : void 0;
|
|
3512
3483
|
if (c) {
|
|
3513
3484
|
for (const l of a)
|
|
3514
|
-
if (l !== "seriesToColorMap" && !c.validAxes.has(l) &&
|
|
3485
|
+
if (l !== "seriesToColorMap" && !c.validAxes.has(l) && fe.has(l)) {
|
|
3515
3486
|
const d = R(l, [...c.validAxes], (m) => m), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "", g = [...c.validAxes].join(", ");
|
|
3516
3487
|
r.push({
|
|
3517
3488
|
category: "dataOptions",
|
|
@@ -3553,15 +3524,15 @@ function Kn(e, t, r) {
|
|
|
3553
3524
|
continue;
|
|
3554
3525
|
}
|
|
3555
3526
|
if (l === "columns") {
|
|
3556
|
-
s[l] =
|
|
3527
|
+
s[l] = Un(
|
|
3557
3528
|
_t(d),
|
|
3558
3529
|
t,
|
|
3559
3530
|
r,
|
|
3560
|
-
|
|
3531
|
+
he("columns")
|
|
3561
3532
|
);
|
|
3562
3533
|
continue;
|
|
3563
3534
|
}
|
|
3564
|
-
const b =
|
|
3535
|
+
const b = Pn(l, d, n) ? "dimension" : "measure", g = re(
|
|
3565
3536
|
l,
|
|
3566
3537
|
d,
|
|
3567
3538
|
b,
|
|
@@ -3575,37 +3546,37 @@ function Kn(e, t, r) {
|
|
|
3575
3546
|
}
|
|
3576
3547
|
return r.length > i ? null : s;
|
|
3577
3548
|
}
|
|
3578
|
-
function
|
|
3549
|
+
function Vn(e) {
|
|
3579
3550
|
if (typeof e != "string") return "iqr";
|
|
3580
3551
|
const t = e.split("/")[1];
|
|
3581
3552
|
return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
|
|
3582
3553
|
}
|
|
3583
|
-
const
|
|
3554
|
+
const si = (e) => {
|
|
3584
3555
|
var m;
|
|
3585
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3556
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = kn(t);
|
|
3586
3557
|
if (o.length > 0)
|
|
3587
3558
|
return { success: !1, errors: o };
|
|
3588
|
-
const a = i.chartType, u =
|
|
3589
|
-
let p =
|
|
3559
|
+
const a = i.chartType, u = xe(n), c = [];
|
|
3560
|
+
let p = _n(
|
|
3590
3561
|
i.dataOptions,
|
|
3591
3562
|
{ dataSource: s, schemaIndex: u, chartType: a },
|
|
3592
3563
|
c
|
|
3593
3564
|
);
|
|
3594
3565
|
if (a === "boxplot" && p) {
|
|
3595
|
-
const A =
|
|
3596
|
-
p =
|
|
3566
|
+
const A = Vn((m = i.styleOptions) == null ? void 0 : m.subtype), C = A === "iqr" || A === "standardDeviation";
|
|
3567
|
+
p = w(y({}, p), { boxType: A, outliersEnabled: C });
|
|
3597
3568
|
}
|
|
3598
3569
|
let l = null;
|
|
3599
|
-
i.filters && i.filters.length > 0 && (l =
|
|
3600
|
-
() =>
|
|
3570
|
+
i.filters && i.filters.length > 0 && (l = F(
|
|
3571
|
+
() => Me({
|
|
3601
3572
|
data: i.filters || [],
|
|
3602
3573
|
context: { dataSource: s, schemaIndex: u }
|
|
3603
3574
|
}),
|
|
3604
3575
|
c
|
|
3605
3576
|
));
|
|
3606
3577
|
let d = null;
|
|
3607
|
-
if (i.highlights && i.highlights.length > 0 && (d =
|
|
3608
|
-
() =>
|
|
3578
|
+
if (i.highlights && i.highlights.length > 0 && (d = F(
|
|
3579
|
+
() => Ne({
|
|
3609
3580
|
data: i.highlights || [],
|
|
3610
3581
|
context: { dataSource: s, schemaIndex: u }
|
|
3611
3582
|
}),
|
|
@@ -3631,7 +3602,7 @@ const ai = (e) => {
|
|
|
3631
3602
|
return {
|
|
3632
3603
|
success: !0,
|
|
3633
3604
|
data: y(y(y({
|
|
3634
|
-
dataSet:
|
|
3605
|
+
dataSet: Ae(s),
|
|
3635
3606
|
chartType: b,
|
|
3636
3607
|
dataOptions: p
|
|
3637
3608
|
}, i.styleOptions && {
|
|
@@ -3639,7 +3610,7 @@ const ai = (e) => {
|
|
|
3639
3610
|
styleOptions: i.styleOptions
|
|
3640
3611
|
}), l && { filters: l }), d && { highlights: d })
|
|
3641
3612
|
};
|
|
3642
|
-
},
|
|
3613
|
+
}, ni = (e) => {
|
|
3643
3614
|
const t = [];
|
|
3644
3615
|
if (!e.chartType)
|
|
3645
3616
|
return {
|
|
@@ -3666,20 +3637,20 @@ const ai = (e) => {
|
|
|
3666
3637
|
]
|
|
3667
3638
|
};
|
|
3668
3639
|
let r = null;
|
|
3669
|
-
const s =
|
|
3640
|
+
const s = Wn(e.dataOptions);
|
|
3670
3641
|
s.success ? r = s.data : t.push(...s.errors);
|
|
3671
3642
|
let n;
|
|
3672
3643
|
if (e.filters) {
|
|
3673
|
-
const u =
|
|
3674
|
-
() =>
|
|
3644
|
+
const u = F(
|
|
3645
|
+
() => ve(e.filters),
|
|
3675
3646
|
t
|
|
3676
3647
|
);
|
|
3677
3648
|
n = u != null ? u : void 0;
|
|
3678
3649
|
}
|
|
3679
3650
|
let i;
|
|
3680
3651
|
if (e.highlights && e.highlights.length > 0) {
|
|
3681
|
-
const u =
|
|
3682
|
-
() =>
|
|
3652
|
+
const u = F(
|
|
3653
|
+
() => Ie(e.highlights),
|
|
3683
3654
|
t
|
|
3684
3655
|
);
|
|
3685
3656
|
i = u != null ? u : void 0;
|
|
@@ -3699,7 +3670,7 @@ const ai = (e) => {
|
|
|
3699
3670
|
)
|
|
3700
3671
|
};
|
|
3701
3672
|
};
|
|
3702
|
-
function
|
|
3673
|
+
function Wn(e) {
|
|
3703
3674
|
const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
|
|
3704
3675
|
for (const [n, i] of Object.entries(e)) {
|
|
3705
3676
|
if (n === "seriesToColorMap" && i) {
|
|
@@ -3712,12 +3683,12 @@ function Yn(e) {
|
|
|
3712
3683
|
}
|
|
3713
3684
|
const o = Array.isArray(i) ? i : [i], a = Array.isArray(i), u = [], c = [];
|
|
3714
3685
|
for (let p = 0; p < o.length; p++) {
|
|
3715
|
-
const l = o[p], b =
|
|
3686
|
+
const l = o[p], b = jn(l) ? Re([
|
|
3716
3687
|
l
|
|
3717
|
-
]) :
|
|
3688
|
+
]) : Pe([l]);
|
|
3718
3689
|
b.success ? u.push(...b.data) : b.errors.forEach((g) => {
|
|
3719
3690
|
var m;
|
|
3720
|
-
c.push(
|
|
3691
|
+
c.push(w(y({}, g), { index: p, input: (m = g.input) != null ? m : l }));
|
|
3721
3692
|
});
|
|
3722
3693
|
}
|
|
3723
3694
|
if (c.length > 0) {
|
|
@@ -3728,7 +3699,7 @@ function Yn(e) {
|
|
|
3728
3699
|
}
|
|
3729
3700
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3730
3701
|
}
|
|
3731
|
-
function
|
|
3702
|
+
function jn(e) {
|
|
3732
3703
|
const t = Array.isArray(e) ? e[0] : e;
|
|
3733
3704
|
if (!t || !S(t))
|
|
3734
3705
|
return !0;
|
|
@@ -3747,13 +3718,13 @@ function Jn(e) {
|
|
|
3747
3718
|
}
|
|
3748
3719
|
return !("aggregation" in r || "attribute" in r && "aggregation" in r);
|
|
3749
3720
|
}
|
|
3750
|
-
const
|
|
3751
|
-
function
|
|
3721
|
+
const et = ["rows", "columns", "values", "grandTotals"];
|
|
3722
|
+
function Kn(e) {
|
|
3752
3723
|
if (!S(e)) return !1;
|
|
3753
3724
|
const t = Object.keys(e);
|
|
3754
3725
|
return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
|
|
3755
3726
|
}
|
|
3756
|
-
function
|
|
3727
|
+
function Gn(e) {
|
|
3757
3728
|
const t = [], r = {
|
|
3758
3729
|
dataOptions: {}
|
|
3759
3730
|
};
|
|
@@ -3777,8 +3748,8 @@ function Qn(e) {
|
|
|
3777
3748
|
const n = s;
|
|
3778
3749
|
r.dataOptions = n;
|
|
3779
3750
|
for (const o of Object.keys(n))
|
|
3780
|
-
if (!
|
|
3781
|
-
const a = R(o, [...
|
|
3751
|
+
if (!et.includes(o)) {
|
|
3752
|
+
const a = R(o, [...et], (c) => c), u = a && a.distance <= x ? ` Did you mean '${a.best}'?` : "";
|
|
3782
3753
|
t.push({
|
|
3783
3754
|
category: "dataOptions",
|
|
3784
3755
|
index: o,
|
|
@@ -3796,7 +3767,7 @@ function Qn(e) {
|
|
|
3796
3767
|
});
|
|
3797
3768
|
}
|
|
3798
3769
|
const i = n.grandTotals;
|
|
3799
|
-
i != null && !
|
|
3770
|
+
i != null && !Kn(i) && t.push({
|
|
3800
3771
|
category: "dataOptions",
|
|
3801
3772
|
index: "grandTotals",
|
|
3802
3773
|
input: i,
|
|
@@ -3805,7 +3776,7 @@ function Qn(e) {
|
|
|
3805
3776
|
}
|
|
3806
3777
|
return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
|
|
3807
3778
|
}
|
|
3808
|
-
function
|
|
3779
|
+
function Yn(e, t, r) {
|
|
3809
3780
|
if (!e || typeof e != "object")
|
|
3810
3781
|
return r.push({
|
|
3811
3782
|
category: "dataOptions",
|
|
@@ -3833,26 +3804,26 @@ function Xn(e, t, r) {
|
|
|
3833
3804
|
);
|
|
3834
3805
|
return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
|
|
3835
3806
|
}
|
|
3836
|
-
const
|
|
3837
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3807
|
+
const ii = (e) => {
|
|
3808
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Gn(t);
|
|
3838
3809
|
if (o.length > 0)
|
|
3839
3810
|
return { success: !1, errors: o };
|
|
3840
|
-
const a =
|
|
3811
|
+
const a = xe(n), u = [], c = Yn(
|
|
3841
3812
|
i.dataOptions,
|
|
3842
3813
|
{ dataSource: s, schemaIndex: a },
|
|
3843
3814
|
u
|
|
3844
3815
|
);
|
|
3845
3816
|
let p = null;
|
|
3846
|
-
i.filters && i.filters.length > 0 && (p =
|
|
3847
|
-
() =>
|
|
3817
|
+
i.filters && i.filters.length > 0 && (p = F(
|
|
3818
|
+
() => Me({
|
|
3848
3819
|
data: i.filters || [],
|
|
3849
3820
|
context: { dataSource: s, schemaIndex: a }
|
|
3850
3821
|
}),
|
|
3851
3822
|
u
|
|
3852
3823
|
));
|
|
3853
3824
|
let l = null;
|
|
3854
|
-
return i.highlights && i.highlights.length > 0 && (l =
|
|
3855
|
-
() =>
|
|
3825
|
+
return i.highlights && i.highlights.length > 0 && (l = F(
|
|
3826
|
+
() => Ne({
|
|
3856
3827
|
data: i.highlights || [],
|
|
3857
3828
|
context: { dataSource: s, schemaIndex: a }
|
|
3858
3829
|
}),
|
|
@@ -3863,11 +3834,11 @@ const ci = (e) => {
|
|
|
3863
3834
|
} : {
|
|
3864
3835
|
success: !0,
|
|
3865
3836
|
data: y(y(y({
|
|
3866
|
-
dataSet:
|
|
3837
|
+
dataSet: Ae(s),
|
|
3867
3838
|
dataOptions: c
|
|
3868
3839
|
}, i.styleOptions && { styleOptions: i.styleOptions }), p && { filters: p }), l && { highlights: l })
|
|
3869
3840
|
};
|
|
3870
|
-
},
|
|
3841
|
+
}, oi = (e) => {
|
|
3871
3842
|
const t = [];
|
|
3872
3843
|
if (!e.dataOptions)
|
|
3873
3844
|
return {
|
|
@@ -3885,28 +3856,28 @@ const ci = (e) => {
|
|
|
3885
3856
|
for (const c of ["rows", "columns"]) {
|
|
3886
3857
|
const p = r[c];
|
|
3887
3858
|
if (p && p.length > 0) {
|
|
3888
|
-
const l =
|
|
3859
|
+
const l = Ze(c, p, "dimension");
|
|
3889
3860
|
l.success ? s[c] = l.data : t.push(...l.errors);
|
|
3890
3861
|
}
|
|
3891
3862
|
}
|
|
3892
3863
|
const n = r.values;
|
|
3893
3864
|
if (n && n.length > 0) {
|
|
3894
|
-
const c =
|
|
3865
|
+
const c = Ze("values", n, "measure");
|
|
3895
3866
|
c.success ? s.values = c.data : t.push(...c.errors);
|
|
3896
3867
|
}
|
|
3897
3868
|
r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
|
|
3898
3869
|
let i;
|
|
3899
3870
|
if (e.filters) {
|
|
3900
|
-
const c =
|
|
3901
|
-
() =>
|
|
3871
|
+
const c = F(
|
|
3872
|
+
() => ve(e.filters),
|
|
3902
3873
|
t
|
|
3903
3874
|
);
|
|
3904
3875
|
i = c != null ? c : void 0;
|
|
3905
3876
|
}
|
|
3906
3877
|
let o;
|
|
3907
3878
|
if (e.highlights && e.highlights.length > 0) {
|
|
3908
|
-
const c =
|
|
3909
|
-
() =>
|
|
3879
|
+
const c = F(
|
|
3880
|
+
() => Ie(e.highlights),
|
|
3910
3881
|
t
|
|
3911
3882
|
);
|
|
3912
3883
|
o = c != null ? c : void 0;
|
|
@@ -3923,7 +3894,7 @@ const ci = (e) => {
|
|
|
3923
3894
|
)
|
|
3924
3895
|
};
|
|
3925
3896
|
};
|
|
3926
|
-
function
|
|
3897
|
+
function Jn(e) {
|
|
3927
3898
|
const { filters: t, relations: r } = _r(
|
|
3928
3899
|
e.filters || []
|
|
3929
3900
|
);
|
|
@@ -3937,23 +3908,23 @@ function Zn(e) {
|
|
|
3937
3908
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
3938
3909
|
};
|
|
3939
3910
|
}
|
|
3940
|
-
function
|
|
3941
|
-
const s =
|
|
3911
|
+
function ai(e, t, r = !1) {
|
|
3912
|
+
const s = Jn(e), n = Lr(s, t);
|
|
3942
3913
|
return Ur(n, r);
|
|
3943
3914
|
}
|
|
3944
3915
|
export {
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3916
|
+
ei as CustomSuperJSON,
|
|
3917
|
+
li as EMPTY_EXPANDED_QUERY_MODEL,
|
|
3918
|
+
fi as EMPTY_SIMPLE_QUERY_MODEL,
|
|
3919
|
+
di as isByIdDashboardCodeParams,
|
|
3920
|
+
mi as isByIdWidgetCodeParams,
|
|
3921
|
+
pi as isClientSideDashboardCodeParams,
|
|
3922
|
+
gi as isClientSideWidgetCodeParams,
|
|
3923
|
+
si as translateChartFromJSON,
|
|
3924
|
+
ni as translateChartToJSON,
|
|
3925
|
+
ii as translatePivotTableFromJSON,
|
|
3926
|
+
oi as translatePivotTableToJSON,
|
|
3927
|
+
ti as translateQueryFromJSON,
|
|
3928
|
+
ri as translateQueryToJSON,
|
|
3929
|
+
ai as translateQueryToJaql
|
|
3959
3930
|
};
|