@sisense/sdk-ui 2.23.0 → 2.24.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 +3 -3
- package/dist/ai.js +7 -7
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1172 -986
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{dimensions-C0BmtTH2.js → dimensions-C1R5YRt-.js} +1 -1
- package/dist/{dimensions-2t18RSZC.cjs → dimensions-C7yXAoZs.cjs} +1 -1
- package/dist/{execute-query-DmAyVFF5.cjs → execute-query-0Y9Fn9Pf.cjs} +1 -1
- package/dist/{execute-query-CHYTupEo.js → execute-query-b9oy2Egy.js} +7 -4
- package/dist/{index-Dx6wvLd3.cjs → index-Ck-0gJC9.cjs} +1 -1
- package/dist/{index-DCAC0mJe.js → index-r66Tjiqj.js} +21 -1
- package/dist/index.cjs +599 -595
- package/dist/index.js +14631 -14441
- package/dist/index.umd.js +951 -947
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-csv-download.d.ts +24 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +20 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/helpers/use-translated-data-options.d.ts +12 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-csv-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-csv-download.d.ts +15 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-csv-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/tabber-buttons-widget/types.d.ts +8 -8
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +21 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +11 -2
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-csv-query-file-loader.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-with-csv-download-menu-item.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/app/client-application.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/custom-widgets-provider-adapter.d.ts +2 -1
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +11 -4
- package/dist/packages/sdk-ui/src/infra/plugins/custom-plugin-context-provider.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/plugin-provider.d.ts +4 -2
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/types.d.ts +12 -4
- package/dist/packages/sdk-ui/src/infra/plugins/use-widget-plugin-registry.d.ts +7 -0
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/validate-plugins.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +302 -0
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +33 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +40 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/custom-formula/validate-custom-formula.d.ts +15 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/formula-function-schemas.d.ts +22 -6
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +19 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/schema-index.d.ts +5 -2
- package/dist/packages/sdk-ui/src/props.d.ts +19 -1
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +2 -0
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +2 -0
- package/dist/packages/sdk-ui/src/shared/const.d.ts +5 -0
- package/dist/packages/sdk-ui/src/shared/types/menu-item.d.ts +5 -1
- package/dist/packages/sdk-ui/src/shared/utils/menu-item-converters.d.ts +12 -0
- package/dist/{quota-notification-RAaHp-eO.cjs → quota-notification-BqRYSJ7r.cjs} +137 -137
- package/dist/{quota-notification-CVl0isIV.js → quota-notification-CeKnEyQG.js} +11248 -11000
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +22 -2
- 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 +22 -2
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +22 -2
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +22 -2
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +24 -4
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +24 -4
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +24 -4
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +24 -4
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +22 -2
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +24 -4
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +22 -2
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +24 -4
- package/dist/{types-DZ4vWh8j.cjs → types-C0QU2tsE.cjs} +1 -1
- package/dist/{types-B96nVbgX.js → types-DJtC8_5_.js} +1 -1
- package/dist/{utils-ChqSLRbz.js → utils-BCp2ISWh.js} +208 -204
- package/dist/{utils-CgV-jWWQ.cjs → utils-D8O1_kl3.cjs} +16 -16
- package/dist/{widget-composer-Blul90Zb.cjs → widget-composer-BkHZISs7.cjs} +1 -1
- package/dist/{widget-composer-Cf_CN3Ux.js → widget-composer-CDNL9_XF.js} +3 -3
- package/package.json +8 -8
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/index.d.ts +0 -5
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-context.d.ts +0 -15
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Vt = Object.defineProperty, Wt = Object.defineProperties;
|
|
2
|
+
var jt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Ue = Object.getOwnPropertySymbols;
|
|
4
|
+
var Kt = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var _e = (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
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var r of
|
|
10
|
-
|
|
7
|
+
Kt.call(t, r) && _e(e, r, t[r]);
|
|
8
|
+
if (Ue)
|
|
9
|
+
for (var r of Ue(t))
|
|
10
|
+
Gt.call(t, r) && _e(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
}, F = (e, t) =>
|
|
13
|
-
import { f as
|
|
14
|
-
import { b as
|
|
15
|
-
import { cb as
|
|
16
|
-
import { i as
|
|
17
|
-
function
|
|
12
|
+
}, F = (e, t) => Wt(e, jt(t));
|
|
13
|
+
import { f as Yt, J as Jt } from "../types-DJtC8_5_.js";
|
|
14
|
+
import { b as pi, E as gi, a as yi, i as hi, e as bi, d as Ai } from "../types-DJtC8_5_.js";
|
|
15
|
+
import { cb as Ht, bK as Qt, cc as Xt, cd as Zt, ce as er, aG as Fe, cf as tr, aF as rr, cg as sr, bi as nr, aH as ir, ch as or, bl as ar, bj as ur, aV as cr, bh as lr, bk as fr, d as dr, c as mr, k as pr, ci as gr, cj as yr, ck as hr, cl as br, cm as Ar, cn as Fr, co as wr, cp as Er, cq as Cr, cr as Tr, cs as qr, aE as xr, ct as $r, cu as Sr, S as B, t as X, h as Or, b as $, av as _, at as se, cv as Dr, cw as Mr, cx as Nr, M as U, cy as Rr, cz as vr, aR as Ir, ax as Ve, aw as we, bQ as ne, U as Pr, V as kr, cA as it, ag as Br, A as zr, cB as Lr, y as Ur, x as _r } from "../execute-query-b9oy2Egy.js";
|
|
16
|
+
import { i as Vr, b as Wr, D as jr, d as Kr, a as Gr } from "../dimensions-C1R5YRt-.js";
|
|
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++)
|
|
20
20
|
for (let o = 1; o <= s; o++)
|
|
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
|
-
class
|
|
24
|
+
class Jr {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -38,9 +38,9 @@ class Vr {
|
|
|
38
38
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
class
|
|
41
|
+
class ot {
|
|
42
42
|
constructor(t) {
|
|
43
|
-
this.generateIdentifier = t, this.kv = new
|
|
43
|
+
this.generateIdentifier = t, this.kv = new Jr();
|
|
44
44
|
}
|
|
45
45
|
register(t, r) {
|
|
46
46
|
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
@@ -55,7 +55,7 @@ class rt {
|
|
|
55
55
|
return this.kv.getByKey(t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
58
|
+
class Hr extends ot {
|
|
59
59
|
constructor() {
|
|
60
60
|
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
61
61
|
}
|
|
@@ -66,7 +66,7 @@ class Wr extends rt {
|
|
|
66
66
|
return this.classToAllowedProps.get(t);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Qr(e) {
|
|
70
70
|
if ("values" in Object)
|
|
71
71
|
return Object.values(e);
|
|
72
72
|
const t = [];
|
|
@@ -74,8 +74,8 @@ function Kr(e) {
|
|
|
74
74
|
e.hasOwnProperty(r) && t.push(e[r]);
|
|
75
75
|
return t;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const r =
|
|
77
|
+
function Xr(e, t) {
|
|
78
|
+
const r = Qr(e);
|
|
79
79
|
if ("find" in r)
|
|
80
80
|
return r.find(t);
|
|
81
81
|
const s = r;
|
|
@@ -85,20 +85,20 @@ function Jr(e, t) {
|
|
|
85
85
|
return i;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function V(e, t) {
|
|
89
89
|
Object.entries(e).forEach(([r, s]) => t(s, r));
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ee(e, t) {
|
|
92
92
|
return e.indexOf(t) !== -1;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function We(e, t) {
|
|
95
95
|
for (let r = 0; r < e.length; r++) {
|
|
96
96
|
const s = e[r];
|
|
97
97
|
if (t(s))
|
|
98
98
|
return s;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class Zr {
|
|
102
102
|
constructor() {
|
|
103
103
|
this.transfomers = {};
|
|
104
104
|
}
|
|
@@ -106,13 +106,13 @@ class Yr {
|
|
|
106
106
|
this.transfomers[t.name] = t;
|
|
107
107
|
}
|
|
108
108
|
findApplicable(t) {
|
|
109
|
-
return
|
|
109
|
+
return Xr(this.transfomers, (r) => r.isApplicable(t));
|
|
110
110
|
}
|
|
111
111
|
findByName(t) {
|
|
112
112
|
return this.transfomers[t];
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const es = (e) => Object.prototype.toString.call(e).slice(8, -1), at = (e) => typeof e == "undefined", ts = (e) => e === null, G = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, pe = (e) => G(e) && Object.keys(e).length === 0, I = (e) => Array.isArray(e), rs = (e) => typeof e == "string", ss = (e) => typeof e == "number" && !isNaN(e), ns = (e) => typeof e == "boolean", is = (e) => e instanceof RegExp, Y = (e) => e instanceof Map, J = (e) => e instanceof Set, ut = (e) => es(e) === "Symbol", os = (e) => e instanceof Date && !isNaN(e.valueOf()), as = (e) => e instanceof Error, je = (e) => typeof e == "number" && isNaN(e), us = (e) => ns(e) || ts(e) || at(e) || ss(e) || rs(e) || ut(e), cs = (e) => typeof e == "bigint", ls = (e) => e === 1 / 0 || e === -1 / 0, fs = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), ds = (e) => e instanceof URL, ct = (e) => e.replace(/\./g, "\\."), ce = (e) => e.map(String).map(ct).join("."), K = (e) => {
|
|
116
116
|
const t = [];
|
|
117
117
|
let r = "";
|
|
118
118
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -138,12 +138,12 @@ function v(e, t, r, s) {
|
|
|
138
138
|
untransform: s
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
v(
|
|
141
|
+
const lt = [
|
|
142
|
+
v(at, "undefined", () => null, () => {
|
|
143
143
|
}),
|
|
144
|
-
v(
|
|
145
|
-
v(
|
|
146
|
-
v(
|
|
144
|
+
v(cs, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
145
|
+
v(os, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
146
|
+
v(as, "Error", (e, t) => {
|
|
147
147
|
const r = {
|
|
148
148
|
name: e.name,
|
|
149
149
|
message: e.message
|
|
@@ -157,24 +157,24 @@ const ot = [
|
|
|
157
157
|
r[s] = e[s];
|
|
158
158
|
}), r;
|
|
159
159
|
}),
|
|
160
|
-
v(
|
|
160
|
+
v(is, "regexp", (e) => "" + e, (e) => {
|
|
161
161
|
const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
|
|
162
162
|
return new RegExp(t, r);
|
|
163
163
|
}),
|
|
164
164
|
v(
|
|
165
|
-
|
|
165
|
+
J,
|
|
166
166
|
"set",
|
|
167
167
|
// (sets only exist in es6+)
|
|
168
168
|
// eslint-disable-next-line es5/no-es6-methods
|
|
169
169
|
(e) => [...e.values()],
|
|
170
170
|
(e) => new Set(e)
|
|
171
171
|
),
|
|
172
|
-
v(
|
|
173
|
-
v((e) =>
|
|
172
|
+
v(Y, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
173
|
+
v((e) => je(e) || ls(e), "number", (e) => je(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
174
174
|
v((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
175
|
-
v(
|
|
175
|
+
v(ds, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
176
176
|
];
|
|
177
|
-
function
|
|
177
|
+
function ie(e, t, r, s) {
|
|
178
178
|
return {
|
|
179
179
|
isApplicable: e,
|
|
180
180
|
annotation: t,
|
|
@@ -182,12 +182,12 @@ function se(e, t, r, s) {
|
|
|
182
182
|
untransform: s
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const ft = ie((e, t) => ut(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
186
186
|
const s = r.symbolRegistry.getValue(t[1]);
|
|
187
187
|
if (!s)
|
|
188
188
|
throw new Error("Trying to deserialize unknown symbol");
|
|
189
189
|
return s;
|
|
190
|
-
}),
|
|
190
|
+
}), ms = [
|
|
191
191
|
Int8Array,
|
|
192
192
|
Uint8Array,
|
|
193
193
|
Int16Array,
|
|
@@ -197,19 +197,19 @@ const at = se((e, t) => nt(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
|
|
|
197
197
|
Float32Array,
|
|
198
198
|
Float64Array,
|
|
199
199
|
Uint8ClampedArray
|
|
200
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
201
|
-
const r =
|
|
200
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), dt = ie(fs, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
201
|
+
const r = ms[t[1]];
|
|
202
202
|
if (!r)
|
|
203
203
|
throw new Error("Trying to deserialize unknown typed array");
|
|
204
204
|
return new r(e);
|
|
205
205
|
});
|
|
206
|
-
function
|
|
206
|
+
function mt(e, t) {
|
|
207
207
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
208
208
|
}
|
|
209
|
-
const
|
|
209
|
+
const pt = ie(mt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
210
210
|
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
211
211
|
if (!r)
|
|
212
|
-
return
|
|
212
|
+
return y({}, e);
|
|
213
213
|
const s = {};
|
|
214
214
|
return r.forEach((n) => {
|
|
215
215
|
s[n] = e[n];
|
|
@@ -219,49 +219,49 @@ const lt = se(ct, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
|
|
|
219
219
|
if (!s)
|
|
220
220
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
221
221
|
return Object.assign(Object.create(s.prototype), e);
|
|
222
|
-
}),
|
|
222
|
+
}), gt = ie((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
223
|
const s = r.customTransformerRegistry.findByName(t[1]);
|
|
224
224
|
if (!s)
|
|
225
225
|
throw new Error("Trying to deserialize unknown custom value");
|
|
226
226
|
return s.deserialize(e);
|
|
227
|
-
}),
|
|
228
|
-
const r =
|
|
227
|
+
}), ps = [pt, ft, gt, dt], Ke = (e, t) => {
|
|
228
|
+
const r = We(ps, (n) => n.isApplicable(e, t));
|
|
229
229
|
if (r)
|
|
230
230
|
return {
|
|
231
231
|
value: r.transform(e, t),
|
|
232
232
|
type: r.annotation(e, t)
|
|
233
233
|
};
|
|
234
|
-
const s =
|
|
234
|
+
const s = We(lt, (n) => n.isApplicable(e, t));
|
|
235
235
|
if (s)
|
|
236
236
|
return {
|
|
237
237
|
value: s.transform(e, t),
|
|
238
238
|
type: s.annotation
|
|
239
239
|
};
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
}, yt = {};
|
|
241
|
+
lt.forEach((e) => {
|
|
242
|
+
yt[e.annotation] = e;
|
|
243
243
|
});
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
244
|
+
const gs = (e, t, r) => {
|
|
245
|
+
if (I(t))
|
|
246
246
|
switch (t[0]) {
|
|
247
247
|
case "symbol":
|
|
248
|
-
return
|
|
248
|
+
return ft.untransform(e, t, r);
|
|
249
249
|
case "class":
|
|
250
|
-
return
|
|
250
|
+
return pt.untransform(e, t, r);
|
|
251
251
|
case "custom":
|
|
252
|
-
return
|
|
252
|
+
return gt.untransform(e, t, r);
|
|
253
253
|
case "typed-array":
|
|
254
|
-
return
|
|
254
|
+
return dt.untransform(e, t, r);
|
|
255
255
|
default:
|
|
256
256
|
throw new Error("Unknown transformation: " + t);
|
|
257
257
|
}
|
|
258
258
|
else {
|
|
259
|
-
const s =
|
|
259
|
+
const s = yt[t];
|
|
260
260
|
if (!s)
|
|
261
261
|
throw new Error("Unknown transformation: " + t);
|
|
262
262
|
return s.untransform(e, r);
|
|
263
263
|
}
|
|
264
|
-
},
|
|
264
|
+
}, L = (e, t) => {
|
|
265
265
|
if (t > e.size)
|
|
266
266
|
throw new Error("index out of bounds");
|
|
267
267
|
const r = e.keys();
|
|
@@ -269,22 +269,22 @@ const ls = (e, t, r) => {
|
|
|
269
269
|
r.next(), t--;
|
|
270
270
|
return r.next().value;
|
|
271
271
|
};
|
|
272
|
-
function
|
|
273
|
-
if (
|
|
272
|
+
function ht(e) {
|
|
273
|
+
if (ee(e, "__proto__"))
|
|
274
274
|
throw new Error("__proto__ is not allowed as a property");
|
|
275
|
-
if (
|
|
275
|
+
if (ee(e, "prototype"))
|
|
276
276
|
throw new Error("prototype is not allowed as a property");
|
|
277
|
-
if (
|
|
277
|
+
if (ee(e, "constructor"))
|
|
278
278
|
throw new Error("constructor is not allowed as a property");
|
|
279
279
|
}
|
|
280
|
-
const
|
|
281
|
-
|
|
280
|
+
const ys = (e, t) => {
|
|
281
|
+
ht(t);
|
|
282
282
|
for (let r = 0; r < t.length; r++) {
|
|
283
283
|
const s = t[r];
|
|
284
|
-
if (
|
|
285
|
-
e =
|
|
286
|
-
else if (
|
|
287
|
-
const n = +s, i = +t[++r] == 0 ? "key" : "value", o =
|
|
284
|
+
if (J(e))
|
|
285
|
+
e = L(e, +s);
|
|
286
|
+
else if (Y(e)) {
|
|
287
|
+
const n = +s, i = +t[++r] == 0 ? "key" : "value", o = L(e, n);
|
|
288
288
|
switch (i) {
|
|
289
289
|
case "key":
|
|
290
290
|
e = o;
|
|
@@ -297,41 +297,41 @@ const fs = (e, t) => {
|
|
|
297
297
|
e = e[s];
|
|
298
298
|
}
|
|
299
299
|
return e;
|
|
300
|
-
},
|
|
301
|
-
if (
|
|
300
|
+
}, ge = (e, t, r) => {
|
|
301
|
+
if (ht(t), t.length === 0)
|
|
302
302
|
return r(e);
|
|
303
303
|
let s = e;
|
|
304
304
|
for (let i = 0; i < t.length - 1; i++) {
|
|
305
305
|
const o = t[i];
|
|
306
|
-
if (
|
|
306
|
+
if (I(s)) {
|
|
307
307
|
const a = +o;
|
|
308
308
|
s = s[a];
|
|
309
|
-
} else if (
|
|
309
|
+
} else if (G(s))
|
|
310
310
|
s = s[o];
|
|
311
|
-
else if (
|
|
311
|
+
else if (J(s)) {
|
|
312
312
|
const a = +o;
|
|
313
|
-
s =
|
|
314
|
-
} else if (
|
|
313
|
+
s = L(s, a);
|
|
314
|
+
} else if (Y(s)) {
|
|
315
315
|
if (i === t.length - 2)
|
|
316
316
|
break;
|
|
317
|
-
const u = +o, c = +t[++i] == 0 ? "key" : "value",
|
|
317
|
+
const u = +o, c = +t[++i] == 0 ? "key" : "value", p = L(s, u);
|
|
318
318
|
switch (c) {
|
|
319
319
|
case "key":
|
|
320
|
-
s =
|
|
320
|
+
s = p;
|
|
321
321
|
break;
|
|
322
322
|
case "value":
|
|
323
|
-
s = s.get(
|
|
323
|
+
s = s.get(p);
|
|
324
324
|
break;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
const n = t[t.length - 1];
|
|
329
|
-
if (
|
|
330
|
-
const i =
|
|
329
|
+
if (I(s) ? s[+n] = r(s[+n]) : G(s) && (s[n] = r(s[n])), J(s)) {
|
|
330
|
+
const i = L(s, +n), o = r(i);
|
|
331
331
|
i !== o && (s.delete(i), s.add(o));
|
|
332
332
|
}
|
|
333
|
-
if (
|
|
334
|
-
const i = +t[t.length - 2], o =
|
|
333
|
+
if (Y(s)) {
|
|
334
|
+
const i = +t[t.length - 2], o = L(s, i);
|
|
335
335
|
switch (+n == 0 ? "key" : "value") {
|
|
336
336
|
case "key": {
|
|
337
337
|
const u = r(o);
|
|
@@ -346,45 +346,45 @@ const fs = (e, t) => {
|
|
|
346
346
|
}
|
|
347
347
|
return e;
|
|
348
348
|
};
|
|
349
|
-
function
|
|
349
|
+
function ye(e, t, r = []) {
|
|
350
350
|
if (!e)
|
|
351
351
|
return;
|
|
352
|
-
if (!
|
|
353
|
-
|
|
352
|
+
if (!I(e)) {
|
|
353
|
+
V(e, (i, o) => ye(i, t, [...r, ...K(o)]));
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
356
|
const [s, n] = e;
|
|
357
|
-
n &&
|
|
358
|
-
|
|
357
|
+
n && V(n, (i, o) => {
|
|
358
|
+
ye(i, t, [...r, ...K(o)]);
|
|
359
359
|
}), t(s, r);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
return
|
|
363
|
-
e =
|
|
361
|
+
function hs(e, t, r) {
|
|
362
|
+
return ye(t, (s, n) => {
|
|
363
|
+
e = ge(e, n, (i) => gs(i, s, r));
|
|
364
364
|
}), e;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function bs(e, t) {
|
|
367
367
|
function r(s, n) {
|
|
368
|
-
const i =
|
|
369
|
-
s.map(
|
|
370
|
-
e =
|
|
368
|
+
const i = ys(e, K(n));
|
|
369
|
+
s.map(K).forEach((o) => {
|
|
370
|
+
e = ge(e, o, () => i);
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
|
-
if (
|
|
373
|
+
if (I(t)) {
|
|
374
374
|
const [s, n] = t;
|
|
375
375
|
s.forEach((i) => {
|
|
376
|
-
e =
|
|
377
|
-
}), n &&
|
|
376
|
+
e = ge(e, K(i), () => e);
|
|
377
|
+
}), n && V(n, r);
|
|
378
378
|
} else
|
|
379
|
-
|
|
379
|
+
V(t, r);
|
|
380
380
|
return e;
|
|
381
381
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
382
|
+
const As = (e, t) => G(e) || I(e) || Y(e) || J(e) || mt(e, t);
|
|
383
|
+
function Fs(e, t, r) {
|
|
384
384
|
const s = r.get(e);
|
|
385
385
|
s ? s.push(t) : r.set(e, [t]);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ws(e, t) {
|
|
388
388
|
const r = {};
|
|
389
389
|
let s;
|
|
390
390
|
return e.forEach((n) => {
|
|
@@ -392,64 +392,64 @@ function gs(e, t) {
|
|
|
392
392
|
return;
|
|
393
393
|
t || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
|
|
394
394
|
const [i, ...o] = n;
|
|
395
|
-
i.length === 0 ? s = o.map(
|
|
396
|
-
}), s ?
|
|
395
|
+
i.length === 0 ? s = o.map(ce) : r[ce(i)] = o.map(ce);
|
|
396
|
+
}), s ? pe(r) ? [s] : [s, r] : pe(r) ? void 0 : r;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
399
|
-
var
|
|
400
|
-
const a =
|
|
398
|
+
const bt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
399
|
+
var b;
|
|
400
|
+
const a = us(e);
|
|
401
401
|
if (!a) {
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
402
|
+
Fs(e, n, t);
|
|
403
|
+
const g = o.get(e);
|
|
404
|
+
if (g)
|
|
405
405
|
return s ? {
|
|
406
406
|
transformedValue: null
|
|
407
|
-
} :
|
|
407
|
+
} : g;
|
|
408
408
|
}
|
|
409
|
-
if (!
|
|
410
|
-
const
|
|
411
|
-
transformedValue:
|
|
412
|
-
annotations: [
|
|
409
|
+
if (!As(e, r)) {
|
|
410
|
+
const g = Ke(e, r), m = g ? {
|
|
411
|
+
transformedValue: g.value,
|
|
412
|
+
annotations: [g.type]
|
|
413
413
|
} : {
|
|
414
414
|
transformedValue: e
|
|
415
415
|
};
|
|
416
|
-
return a || o.set(e,
|
|
416
|
+
return a || o.set(e, m), m;
|
|
417
417
|
}
|
|
418
|
-
if (
|
|
418
|
+
if (ee(i, e))
|
|
419
419
|
return {
|
|
420
420
|
transformedValue: null
|
|
421
421
|
};
|
|
422
|
-
const u =
|
|
423
|
-
|
|
424
|
-
if (
|
|
425
|
-
throw new Error(`Detected property ${
|
|
426
|
-
const
|
|
427
|
-
m
|
|
428
|
-
l[
|
|
422
|
+
const u = Ke(e, r), c = (b = u == null ? void 0 : u.value) != null ? b : e, p = I(c) ? [] : {}, l = {};
|
|
423
|
+
V(c, (g, m) => {
|
|
424
|
+
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
425
|
+
throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
|
|
426
|
+
const A = bt(g, t, r, s, [...n, m], [...i, e], o);
|
|
427
|
+
p[m] = A.transformedValue, I(A.annotations) ? l[m] = A.annotations : G(A.annotations) && V(A.annotations, (C, N) => {
|
|
428
|
+
l[ct(m) + "." + N] = C;
|
|
429
429
|
});
|
|
430
430
|
});
|
|
431
|
-
const
|
|
432
|
-
transformedValue:
|
|
431
|
+
const d = pe(l) ? {
|
|
432
|
+
transformedValue: p,
|
|
433
433
|
annotations: u ? [u.type] : void 0
|
|
434
434
|
} : {
|
|
435
|
-
transformedValue:
|
|
435
|
+
transformedValue: p,
|
|
436
436
|
annotations: u ? [u.type, l] : l
|
|
437
437
|
};
|
|
438
|
-
return a || o.set(e,
|
|
438
|
+
return a || o.set(e, d), d;
|
|
439
439
|
};
|
|
440
|
-
function
|
|
440
|
+
function At(e) {
|
|
441
441
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
return
|
|
443
|
+
function Ge(e) {
|
|
444
|
+
return At(e) === "Array";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
if (
|
|
446
|
+
function Es(e) {
|
|
447
|
+
if (At(e) !== "Object")
|
|
448
448
|
return !1;
|
|
449
449
|
const t = Object.getPrototypeOf(e);
|
|
450
450
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Cs(e, t, r, s, n) {
|
|
453
453
|
const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
|
|
454
454
|
i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
455
455
|
value: r,
|
|
@@ -458,45 +458,45 @@ function bs(e, t, r, s, n) {
|
|
|
458
458
|
configurable: !0
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
if (
|
|
463
|
-
return e.map((n) =>
|
|
464
|
-
if (!
|
|
461
|
+
function he(e, t = {}) {
|
|
462
|
+
if (Ge(e))
|
|
463
|
+
return e.map((n) => he(n, t));
|
|
464
|
+
if (!Es(e))
|
|
465
465
|
return e;
|
|
466
466
|
const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
467
467
|
return [...r, ...s].reduce((n, i) => {
|
|
468
|
-
if (
|
|
468
|
+
if (Ge(t.props) && !t.props.includes(i))
|
|
469
469
|
return n;
|
|
470
|
-
const o = e[i], a =
|
|
471
|
-
return
|
|
470
|
+
const o = e[i], a = he(o, t);
|
|
471
|
+
return Cs(n, i, a, e, t.nonenumerable), n;
|
|
472
472
|
}, {});
|
|
473
473
|
}
|
|
474
|
-
class
|
|
474
|
+
class h {
|
|
475
475
|
/**
|
|
476
476
|
* @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
477
|
*/
|
|
478
478
|
constructor({ dedupe: t = !1 } = {}) {
|
|
479
|
-
this.classRegistry = new
|
|
479
|
+
this.classRegistry = new Hr(), this.symbolRegistry = new ot((r) => {
|
|
480
480
|
var s;
|
|
481
481
|
return (s = r.description) != null ? s : "";
|
|
482
|
-
}), this.customTransformerRegistry = new
|
|
482
|
+
}), this.customTransformerRegistry = new Zr(), this.allowedErrorProps = [], this.dedupe = t;
|
|
483
483
|
}
|
|
484
484
|
serialize(t) {
|
|
485
|
-
const r = /* @__PURE__ */ new Map(), s =
|
|
485
|
+
const r = /* @__PURE__ */ new Map(), s = bt(t, r, this, this.dedupe), n = {
|
|
486
486
|
json: s.transformedValue
|
|
487
487
|
};
|
|
488
|
-
s.annotations && (n.meta = F(
|
|
488
|
+
s.annotations && (n.meta = F(y({}, n.meta), {
|
|
489
489
|
values: s.annotations
|
|
490
490
|
}));
|
|
491
|
-
const i =
|
|
492
|
-
return i && (n.meta = F(
|
|
491
|
+
const i = ws(r, this.dedupe);
|
|
492
|
+
return i && (n.meta = F(y({}, n.meta), {
|
|
493
493
|
referentialEqualities: i
|
|
494
494
|
})), n;
|
|
495
495
|
}
|
|
496
496
|
deserialize(t) {
|
|
497
497
|
const { json: r, meta: s } = t;
|
|
498
|
-
let n =
|
|
499
|
-
return s != null && s.values && (n =
|
|
498
|
+
let n = he(r);
|
|
499
|
+
return s != null && s.values && (n = hs(n, s.values, this)), s != null && s.referentialEqualities && (n = bs(n, s.referentialEqualities)), n;
|
|
500
500
|
}
|
|
501
501
|
stringify(t) {
|
|
502
502
|
return JSON.stringify(this.serialize(t));
|
|
@@ -511,7 +511,7 @@ class y {
|
|
|
511
511
|
this.symbolRegistry.register(t, r);
|
|
512
512
|
}
|
|
513
513
|
registerCustom(t, r) {
|
|
514
|
-
this.customTransformerRegistry.register(
|
|
514
|
+
this.customTransformerRegistry.register(y({
|
|
515
515
|
name: r
|
|
516
516
|
}, t));
|
|
517
517
|
}
|
|
@@ -519,16 +519,16 @@ class y {
|
|
|
519
519
|
this.allowedErrorProps.push(...t);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
const z = (e) => e === void 0 ? B.None : e,
|
|
522
|
+
h.defaultInstance = new h();
|
|
523
|
+
h.serialize = h.defaultInstance.serialize.bind(h.defaultInstance);
|
|
524
|
+
h.deserialize = h.defaultInstance.deserialize.bind(h.defaultInstance);
|
|
525
|
+
h.stringify = h.defaultInstance.stringify.bind(h.defaultInstance);
|
|
526
|
+
h.parse = h.defaultInstance.parse.bind(h.defaultInstance);
|
|
527
|
+
h.registerClass = h.defaultInstance.registerClass.bind(h.defaultInstance);
|
|
528
|
+
h.registerSymbol = h.defaultInstance.registerSymbol.bind(h.defaultInstance);
|
|
529
|
+
h.registerCustom = h.defaultInstance.registerCustom.bind(h.defaultInstance);
|
|
530
|
+
h.allowErrorProps = h.defaultInstance.allowErrorProps.bind(h.defaultInstance);
|
|
531
|
+
const z = (e) => e === void 0 ? B.None : e, Ts = (e) => new Jt(e.metadataItem, e.type), Ee = (e) => new dr(
|
|
532
532
|
e.name,
|
|
533
533
|
e.expression,
|
|
534
534
|
e.type,
|
|
@@ -536,7 +536,7 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
536
536
|
z(e.sort),
|
|
537
537
|
e.dataSource,
|
|
538
538
|
e.composeCode
|
|
539
|
-
),
|
|
539
|
+
), Ce = (e) => new mr(
|
|
540
540
|
e.name,
|
|
541
541
|
e.expression,
|
|
542
542
|
e.granularity,
|
|
@@ -545,27 +545,27 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
545
545
|
z(e.sort),
|
|
546
546
|
e.dataSource,
|
|
547
547
|
e.composeCode
|
|
548
|
-
),
|
|
548
|
+
), O = (e) => {
|
|
549
549
|
switch (e.__serializable) {
|
|
550
550
|
case "DimensionalAttribute":
|
|
551
|
-
return
|
|
551
|
+
return Ee(e);
|
|
552
552
|
case "DimensionalLevelAttribute":
|
|
553
|
-
return
|
|
553
|
+
return Ce(e);
|
|
554
554
|
default:
|
|
555
555
|
return e;
|
|
556
556
|
}
|
|
557
|
-
},
|
|
557
|
+
}, Ft = (e) => new jr(
|
|
558
558
|
e.name,
|
|
559
559
|
e.expression,
|
|
560
|
-
e.attributes.map(
|
|
561
|
-
e.dimensions.map(
|
|
560
|
+
e.attributes.map(O),
|
|
561
|
+
e.dimensions.map(qs),
|
|
562
562
|
e.type,
|
|
563
563
|
e.description,
|
|
564
564
|
z(e.sort),
|
|
565
565
|
e.dataSource,
|
|
566
566
|
e.composeCode,
|
|
567
|
-
e.defaultAttribute ?
|
|
568
|
-
),
|
|
567
|
+
e.defaultAttribute ? O(e.defaultAttribute) : void 0
|
|
568
|
+
), wt = (e) => new Kr(
|
|
569
569
|
e.name,
|
|
570
570
|
e.expression,
|
|
571
571
|
e.description,
|
|
@@ -574,44 +574,44 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
574
574
|
e.composeCode,
|
|
575
575
|
e.indexed,
|
|
576
576
|
e.merged
|
|
577
|
-
),
|
|
577
|
+
), qs = (e) => {
|
|
578
578
|
switch (e.__serializable) {
|
|
579
579
|
case "DimensionalDimension":
|
|
580
|
-
return
|
|
580
|
+
return Ft(e);
|
|
581
581
|
case "DimensionalDateDimension":
|
|
582
|
-
return
|
|
582
|
+
return wt(e);
|
|
583
583
|
default:
|
|
584
584
|
return e;
|
|
585
585
|
}
|
|
586
|
-
},
|
|
586
|
+
}, Te = (e) => new pr(
|
|
587
587
|
e.name,
|
|
588
|
-
|
|
588
|
+
O(e.attribute),
|
|
589
589
|
e.aggregation,
|
|
590
590
|
e.format,
|
|
591
591
|
e.description,
|
|
592
592
|
z(e.sort),
|
|
593
593
|
e.dataSource,
|
|
594
594
|
e.composeCode
|
|
595
|
-
),
|
|
595
|
+
), qe = (e) => {
|
|
596
596
|
const t = Object.fromEntries(
|
|
597
597
|
Object.entries(e.context).map(([r, s]) => {
|
|
598
598
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
599
599
|
switch (s.__serializable) {
|
|
600
600
|
case "DimensionalAttribute":
|
|
601
|
-
return [r,
|
|
601
|
+
return [r, Ee(s)];
|
|
602
602
|
case "DimensionalLevelAttribute":
|
|
603
|
-
return [r,
|
|
603
|
+
return [r, Ce(s)];
|
|
604
604
|
case "DimensionalBaseMeasure":
|
|
605
|
-
return [r,
|
|
605
|
+
return [r, Te(s)];
|
|
606
606
|
case "DimensionalCalculatedMeasure":
|
|
607
|
-
return [r,
|
|
607
|
+
return [r, qe(s)];
|
|
608
608
|
default:
|
|
609
609
|
return [r, s];
|
|
610
610
|
}
|
|
611
611
|
return [r, s];
|
|
612
612
|
})
|
|
613
613
|
);
|
|
614
|
-
return new
|
|
614
|
+
return new gr(
|
|
615
615
|
e.name,
|
|
616
616
|
e.expression,
|
|
617
617
|
t,
|
|
@@ -621,58 +621,58 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
621
621
|
e.dataSource,
|
|
622
622
|
e.composeCode
|
|
623
623
|
);
|
|
624
|
-
},
|
|
624
|
+
}, Et = (e) => new yr(
|
|
625
625
|
e.name,
|
|
626
|
-
|
|
626
|
+
O(e.attribute),
|
|
627
627
|
e.format,
|
|
628
628
|
e.description,
|
|
629
629
|
z(e.sort),
|
|
630
630
|
e.dataSource,
|
|
631
631
|
e.composeCode
|
|
632
|
-
),
|
|
632
|
+
), le = (e) => {
|
|
633
633
|
switch (e.__serializable) {
|
|
634
634
|
case "DimensionalBaseMeasure":
|
|
635
|
-
return
|
|
635
|
+
return Te(e);
|
|
636
636
|
case "DimensionalCalculatedMeasure":
|
|
637
|
-
return
|
|
637
|
+
return qe(e);
|
|
638
638
|
case "DimensionalMeasureTemplate":
|
|
639
|
-
return
|
|
639
|
+
return Et(e);
|
|
640
640
|
default:
|
|
641
641
|
return e;
|
|
642
642
|
}
|
|
643
|
-
},
|
|
643
|
+
}, T = (e) => {
|
|
644
644
|
switch (e.__serializable) {
|
|
645
645
|
case "MembersFilter":
|
|
646
|
-
return new
|
|
647
|
-
|
|
646
|
+
return new Sr(
|
|
647
|
+
O(e.attribute),
|
|
648
648
|
e.members,
|
|
649
|
-
e.config.backgroundFilter ? F(
|
|
649
|
+
e.config.backgroundFilter ? F(y({}, e.config), { backgroundFilter: T(e.config.backgroundFilter) }) : e.config,
|
|
650
650
|
e.composeCode
|
|
651
651
|
);
|
|
652
652
|
case "LogicalAttributeFilter":
|
|
653
|
-
return new
|
|
654
|
-
e.filters.map((r) =>
|
|
653
|
+
return new $r(
|
|
654
|
+
e.filters.map((r) => T(r)),
|
|
655
655
|
e.operator,
|
|
656
656
|
e.config,
|
|
657
657
|
e.composeCode
|
|
658
658
|
);
|
|
659
659
|
case "CascadingFilter":
|
|
660
|
-
return new
|
|
661
|
-
e._filters.map((r) =>
|
|
660
|
+
return new xr(
|
|
661
|
+
e._filters.map((r) => T(r)),
|
|
662
662
|
e.config,
|
|
663
663
|
e.composeCode
|
|
664
664
|
);
|
|
665
665
|
case "ExcludeFilter":
|
|
666
|
-
return new
|
|
667
|
-
|
|
668
|
-
e.input ?
|
|
666
|
+
return new qr(
|
|
667
|
+
T(e.filter),
|
|
668
|
+
e.input ? T(e.input) : void 0,
|
|
669
669
|
e.config,
|
|
670
670
|
e.composeCode
|
|
671
671
|
);
|
|
672
672
|
case "MeasureFilter":
|
|
673
|
-
return new
|
|
674
|
-
|
|
675
|
-
|
|
673
|
+
return new Tr(
|
|
674
|
+
O(e.attribute),
|
|
675
|
+
le(e.measure),
|
|
676
676
|
e.operatorA,
|
|
677
677
|
e.valueA,
|
|
678
678
|
e.operatorB,
|
|
@@ -681,25 +681,25 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
681
681
|
e.composeCode
|
|
682
682
|
);
|
|
683
683
|
case "RankingFilter":
|
|
684
|
-
return new
|
|
685
|
-
|
|
686
|
-
|
|
684
|
+
return new Cr(
|
|
685
|
+
O(e.attribute),
|
|
686
|
+
le(e.measure),
|
|
687
687
|
e.operator,
|
|
688
688
|
e.count,
|
|
689
689
|
e.config,
|
|
690
690
|
e.composeCode
|
|
691
691
|
);
|
|
692
692
|
case "MeasureRankingFilter":
|
|
693
|
-
return new
|
|
694
|
-
|
|
693
|
+
return new Er(
|
|
694
|
+
le(e.measure),
|
|
695
695
|
e.operator,
|
|
696
696
|
e.count,
|
|
697
697
|
e.config,
|
|
698
698
|
e.composeCode
|
|
699
699
|
);
|
|
700
700
|
case "NumericFilter":
|
|
701
|
-
return new
|
|
702
|
-
|
|
701
|
+
return new wr(
|
|
702
|
+
O(e.attribute),
|
|
703
703
|
e.operatorA,
|
|
704
704
|
e.valueA,
|
|
705
705
|
e.operatorB,
|
|
@@ -708,8 +708,8 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
708
708
|
e.composeCode
|
|
709
709
|
);
|
|
710
710
|
case "TextFilter":
|
|
711
|
-
return new
|
|
712
|
-
|
|
711
|
+
return new Fr(
|
|
712
|
+
O(e.attribute),
|
|
713
713
|
e.operatorA,
|
|
714
714
|
e.valueA,
|
|
715
715
|
e.config,
|
|
@@ -717,8 +717,8 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
717
717
|
);
|
|
718
718
|
case "DateRangeFilter": {
|
|
719
719
|
const { valueA: r, valueB: s } = e;
|
|
720
|
-
return new
|
|
721
|
-
|
|
720
|
+
return new Ar(
|
|
721
|
+
O(e.attribute),
|
|
722
722
|
r,
|
|
723
723
|
s,
|
|
724
724
|
e.config,
|
|
@@ -726,8 +726,8 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
726
726
|
);
|
|
727
727
|
}
|
|
728
728
|
case "RelativeDateFilter":
|
|
729
|
-
return new
|
|
730
|
-
|
|
729
|
+
return new br(
|
|
730
|
+
O(e.attribute),
|
|
731
731
|
e.offset,
|
|
732
732
|
e.count,
|
|
733
733
|
e.operator,
|
|
@@ -736,8 +736,8 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
736
736
|
e.composeCode
|
|
737
737
|
);
|
|
738
738
|
case "CustomFilter":
|
|
739
|
-
return new
|
|
740
|
-
|
|
739
|
+
return new hr(
|
|
740
|
+
O(e.attribute),
|
|
741
741
|
e.jaqlExpression,
|
|
742
742
|
e.config,
|
|
743
743
|
e.composeCode
|
|
@@ -746,202 +746,209 @@ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e
|
|
|
746
746
|
return e;
|
|
747
747
|
}
|
|
748
748
|
};
|
|
749
|
-
|
|
749
|
+
h.registerCustom(
|
|
750
750
|
{
|
|
751
|
-
isApplicable:
|
|
751
|
+
isApplicable: Yt,
|
|
752
752
|
serialize: (e) => e.serialize(),
|
|
753
|
-
deserialize: (e) =>
|
|
753
|
+
deserialize: (e) => Ts(e)
|
|
754
754
|
},
|
|
755
755
|
"JaqlElement"
|
|
756
756
|
);
|
|
757
|
-
|
|
757
|
+
h.registerCustom(
|
|
758
758
|
{
|
|
759
|
-
isApplicable:
|
|
759
|
+
isApplicable: Ht,
|
|
760
760
|
serialize: (e) => e.serialize(),
|
|
761
|
-
deserialize: (e) =>
|
|
761
|
+
deserialize: (e) => Ee(e)
|
|
762
762
|
},
|
|
763
763
|
"DimensionalAttribute"
|
|
764
764
|
);
|
|
765
|
-
|
|
765
|
+
h.registerCustom(
|
|
766
766
|
{
|
|
767
|
-
isApplicable:
|
|
767
|
+
isApplicable: Qt,
|
|
768
768
|
serialize: (e) => e.serialize(),
|
|
769
|
-
deserialize: (e) =>
|
|
769
|
+
deserialize: (e) => Ce(e)
|
|
770
770
|
},
|
|
771
771
|
"DimensionalLevelAttribute"
|
|
772
772
|
);
|
|
773
|
-
|
|
773
|
+
h.registerCustom(
|
|
774
774
|
{
|
|
775
|
-
isApplicable:
|
|
775
|
+
isApplicable: Vr,
|
|
776
776
|
serialize: (e) => e.serialize(),
|
|
777
|
-
deserialize: (e) =>
|
|
777
|
+
deserialize: (e) => Ft(e)
|
|
778
778
|
},
|
|
779
779
|
"DimensionalDimension"
|
|
780
780
|
);
|
|
781
|
-
|
|
781
|
+
h.registerCustom(
|
|
782
782
|
{
|
|
783
|
-
isApplicable:
|
|
783
|
+
isApplicable: Wr,
|
|
784
784
|
serialize: (e) => e.serialize(),
|
|
785
|
-
deserialize: (e) =>
|
|
785
|
+
deserialize: (e) => wt(e)
|
|
786
786
|
},
|
|
787
787
|
"DimensionalDateDimension"
|
|
788
788
|
);
|
|
789
|
-
|
|
789
|
+
h.registerCustom(
|
|
790
790
|
{
|
|
791
|
-
isApplicable:
|
|
791
|
+
isApplicable: Xt,
|
|
792
792
|
serialize: (e) => e.serialize(),
|
|
793
|
-
deserialize: (e) =>
|
|
793
|
+
deserialize: (e) => Te(e)
|
|
794
794
|
},
|
|
795
795
|
"DimensionalBaseMeasure"
|
|
796
796
|
);
|
|
797
|
-
|
|
797
|
+
h.registerCustom(
|
|
798
798
|
{
|
|
799
|
-
isApplicable:
|
|
799
|
+
isApplicable: Zt,
|
|
800
800
|
serialize: (e) => e.serialize(),
|
|
801
|
-
deserialize: (e) =>
|
|
801
|
+
deserialize: (e) => qe(e)
|
|
802
802
|
},
|
|
803
803
|
"DimensionalCalculatedMeasure"
|
|
804
804
|
);
|
|
805
|
-
|
|
805
|
+
h.registerCustom(
|
|
806
806
|
{
|
|
807
|
-
isApplicable:
|
|
807
|
+
isApplicable: er,
|
|
808
808
|
serialize: (e) => e.serialize(),
|
|
809
|
-
deserialize: (e) =>
|
|
809
|
+
deserialize: (e) => Et(e)
|
|
810
810
|
},
|
|
811
811
|
"DimensionalMeasureTemplate"
|
|
812
812
|
);
|
|
813
|
-
|
|
813
|
+
h.registerCustom(
|
|
814
814
|
{
|
|
815
|
-
isApplicable:
|
|
815
|
+
isApplicable: Fe,
|
|
816
816
|
serialize: (e) => e.serialize(),
|
|
817
|
-
deserialize: (e) =>
|
|
817
|
+
deserialize: (e) => T(e)
|
|
818
818
|
},
|
|
819
819
|
"MembersFilter"
|
|
820
820
|
);
|
|
821
|
-
|
|
821
|
+
h.registerCustom(
|
|
822
822
|
{
|
|
823
|
-
isApplicable:
|
|
823
|
+
isApplicable: tr,
|
|
824
824
|
serialize: (e) => e.serialize(),
|
|
825
|
-
deserialize: (e) =>
|
|
825
|
+
deserialize: (e) => T(e)
|
|
826
826
|
},
|
|
827
827
|
"LogicalAttributeFilter"
|
|
828
828
|
);
|
|
829
|
-
|
|
829
|
+
h.registerCustom(
|
|
830
830
|
{
|
|
831
|
-
isApplicable:
|
|
831
|
+
isApplicable: rr,
|
|
832
832
|
serialize: (e) => e.serialize(),
|
|
833
|
-
deserialize: (e) =>
|
|
833
|
+
deserialize: (e) => T(e)
|
|
834
834
|
},
|
|
835
835
|
"CascadingFilter"
|
|
836
836
|
);
|
|
837
|
-
|
|
837
|
+
h.registerCustom(
|
|
838
838
|
{
|
|
839
|
-
isApplicable:
|
|
839
|
+
isApplicable: sr,
|
|
840
840
|
serialize: (e) => e.serialize(),
|
|
841
|
-
deserialize: (e) =>
|
|
841
|
+
deserialize: (e) => T(e)
|
|
842
842
|
},
|
|
843
843
|
"ExcludeFilter"
|
|
844
844
|
);
|
|
845
|
-
|
|
845
|
+
h.registerCustom(
|
|
846
846
|
{
|
|
847
|
-
isApplicable:
|
|
847
|
+
isApplicable: nr,
|
|
848
848
|
serialize: (e) => e.serialize(),
|
|
849
|
-
deserialize: (e) =>
|
|
849
|
+
deserialize: (e) => T(e)
|
|
850
850
|
},
|
|
851
851
|
"MeasureFilter"
|
|
852
852
|
);
|
|
853
|
-
|
|
853
|
+
h.registerCustom(
|
|
854
854
|
{
|
|
855
|
-
isApplicable:
|
|
855
|
+
isApplicable: ir,
|
|
856
856
|
serialize: (e) => e.serialize(),
|
|
857
|
-
deserialize: (e) =>
|
|
857
|
+
deserialize: (e) => T(e)
|
|
858
858
|
},
|
|
859
859
|
"RankingFilter"
|
|
860
860
|
);
|
|
861
|
-
|
|
861
|
+
h.registerCustom(
|
|
862
862
|
{
|
|
863
|
-
isApplicable:
|
|
863
|
+
isApplicable: or,
|
|
864
864
|
serialize: (e) => e.serialize(),
|
|
865
|
-
deserialize: (e) =>
|
|
865
|
+
deserialize: (e) => T(e)
|
|
866
866
|
},
|
|
867
867
|
"MeasureRankingFilter"
|
|
868
868
|
);
|
|
869
|
-
|
|
869
|
+
h.registerCustom(
|
|
870
870
|
{
|
|
871
|
-
isApplicable:
|
|
871
|
+
isApplicable: ar,
|
|
872
872
|
serialize: (e) => e.serialize(),
|
|
873
|
-
deserialize: (e) =>
|
|
873
|
+
deserialize: (e) => T(e)
|
|
874
874
|
},
|
|
875
875
|
"NumericFilter"
|
|
876
876
|
);
|
|
877
|
-
|
|
877
|
+
h.registerCustom(
|
|
878
878
|
{
|
|
879
|
-
isApplicable:
|
|
879
|
+
isApplicable: ur,
|
|
880
880
|
serialize: (e) => e.serialize(),
|
|
881
|
-
deserialize: (e) =>
|
|
881
|
+
deserialize: (e) => T(e)
|
|
882
882
|
},
|
|
883
883
|
"TextFilter"
|
|
884
884
|
);
|
|
885
|
-
|
|
885
|
+
h.registerCustom(
|
|
886
886
|
{
|
|
887
|
-
isApplicable:
|
|
887
|
+
isApplicable: cr,
|
|
888
888
|
serialize: (e) => e.serialize(),
|
|
889
|
-
deserialize: (e) =>
|
|
889
|
+
deserialize: (e) => T(e)
|
|
890
890
|
},
|
|
891
891
|
"DateRangeFilter"
|
|
892
892
|
);
|
|
893
|
-
|
|
893
|
+
h.registerCustom(
|
|
894
894
|
{
|
|
895
|
-
isApplicable:
|
|
895
|
+
isApplicable: lr,
|
|
896
896
|
serialize: (e) => e.serialize(),
|
|
897
|
-
deserialize: (e) =>
|
|
897
|
+
deserialize: (e) => T(e)
|
|
898
898
|
},
|
|
899
899
|
"RelativeDateFilter"
|
|
900
900
|
);
|
|
901
|
-
|
|
901
|
+
h.registerCustom(
|
|
902
902
|
{
|
|
903
|
-
isApplicable:
|
|
903
|
+
isApplicable: fr,
|
|
904
904
|
serialize: (e) => e.serialize(),
|
|
905
|
-
deserialize: (e) =>
|
|
905
|
+
deserialize: (e) => T(e)
|
|
906
906
|
},
|
|
907
907
|
"CustomFilter"
|
|
908
908
|
);
|
|
909
|
-
const
|
|
910
|
-
function
|
|
909
|
+
const ni = h, E = "DM.";
|
|
910
|
+
function S(e) {
|
|
911
911
|
return typeof e == "object" && e !== null;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function q(e) {
|
|
914
914
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
return e.every(
|
|
916
|
+
function Ct(e) {
|
|
917
|
+
return e.every(q);
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function oe(e) {
|
|
920
920
|
return "attribute" in e && "config" in e;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function Z(e) {
|
|
923
923
|
return "left" in e && "right" in e && "operator" in e;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
926
|
-
return !
|
|
925
|
+
function xe(e) {
|
|
926
|
+
return !oe(e) && !Z(e);
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
928
|
+
function xs(e) {
|
|
929
|
+
return S(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
932
|
-
return !
|
|
931
|
+
function $s(e) {
|
|
932
|
+
return !S(e) || !("column" in e) ? !1 : q(e.column);
|
|
933
933
|
}
|
|
934
934
|
const x = 3;
|
|
935
|
-
function
|
|
935
|
+
function R(e, t, r) {
|
|
936
936
|
if (t.length === 0) return;
|
|
937
937
|
let s = Number.MAX_SAFE_INTEGER, n;
|
|
938
938
|
for (const i of t) {
|
|
939
|
-
const o = r(i), a =
|
|
939
|
+
const o = r(i), a = Yr(e, o);
|
|
940
940
|
a < s && (s = a, n = i);
|
|
941
941
|
}
|
|
942
942
|
return n !== void 0 ? { best: n, distance: s } : void 0;
|
|
943
943
|
}
|
|
944
|
-
|
|
944
|
+
const Tt = "en";
|
|
945
|
+
function fe(e, t) {
|
|
946
|
+
return e.localeCompare(t, Tt, { sensitivity: "accent" }) === 0;
|
|
947
|
+
}
|
|
948
|
+
function Ye(e, t) {
|
|
949
|
+
return t.length <= e.length && e.slice(0, t.length).localeCompare(t, Tt, { sensitivity: "accent" }) === 0;
|
|
950
|
+
}
|
|
951
|
+
function $e(e) {
|
|
945
952
|
const t = [...e].sort((i, o) => o.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
946
953
|
for (const i of e) {
|
|
947
954
|
r.set(i.name, i);
|
|
@@ -959,79 +966,79 @@ function xe(e) {
|
|
|
959
966
|
columnMap: s
|
|
960
967
|
};
|
|
961
968
|
}
|
|
962
|
-
function
|
|
963
|
-
if (!e.startsWith(
|
|
969
|
+
function Se(e, t) {
|
|
970
|
+
if (!e.startsWith(E))
|
|
964
971
|
throw new Error(
|
|
965
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
972
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
966
973
|
);
|
|
967
|
-
const r = e.slice(
|
|
974
|
+
const r = e.slice(E.length);
|
|
968
975
|
if (!r)
|
|
969
976
|
throw new Error(
|
|
970
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
977
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
971
978
|
);
|
|
972
979
|
let s, n;
|
|
973
|
-
for (const
|
|
974
|
-
if (r.
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
980
|
+
for (const m of t.sortedTables)
|
|
981
|
+
if (Ye(r, m.name + ".")) {
|
|
982
|
+
const A = r.slice(m.name.length + 1);
|
|
983
|
+
if (!A)
|
|
977
984
|
throw new Error(
|
|
978
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
985
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
979
986
|
);
|
|
980
|
-
s =
|
|
987
|
+
s = m, n = A;
|
|
981
988
|
break;
|
|
982
989
|
}
|
|
983
990
|
if (!s) {
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
991
|
+
const m = r.indexOf(".");
|
|
992
|
+
if (m === -1)
|
|
986
993
|
throw new Error(
|
|
987
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
994
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
988
995
|
);
|
|
989
|
-
const
|
|
990
|
-
throw new Error(`Table '${
|
|
996
|
+
const A = r.slice(0, m), C = R(A, t.sortedTables, (ue) => ue.name), N = C && C.distance <= x ? ` Did you mean '${C.best.name}'?` : "";
|
|
997
|
+
throw new Error(`Table '${A}' not found in the data model.${N}`);
|
|
991
998
|
}
|
|
992
999
|
const i = t.tableColumnMap.get(s.name);
|
|
993
1000
|
if (!i)
|
|
994
1001
|
throw new Error(`Table '${s.name}' found but has no columns`);
|
|
995
1002
|
let o, a;
|
|
996
1003
|
const u = $.all;
|
|
997
|
-
for (const
|
|
998
|
-
if (n
|
|
999
|
-
return { table: s, column:
|
|
1000
|
-
if (!n.
|
|
1004
|
+
for (const m of i) {
|
|
1005
|
+
if (fe(n, m.name))
|
|
1006
|
+
return { table: s, column: m };
|
|
1007
|
+
if (!Ye(n, m.name + "."))
|
|
1001
1008
|
continue;
|
|
1002
|
-
const
|
|
1003
|
-
if (!
|
|
1009
|
+
const A = n.slice(m.name.length + 1);
|
|
1010
|
+
if (!A)
|
|
1004
1011
|
continue;
|
|
1005
|
-
const
|
|
1006
|
-
if (
|
|
1007
|
-
if (
|
|
1008
|
-
return { table: s, column:
|
|
1009
|
-
o || (o =
|
|
1012
|
+
const C = u.includes(A), N = X(m.dataType);
|
|
1013
|
+
if (C) {
|
|
1014
|
+
if (N)
|
|
1015
|
+
return { table: s, column: m, level: A };
|
|
1016
|
+
o || (o = m, a = A);
|
|
1010
1017
|
continue;
|
|
1011
1018
|
}
|
|
1012
|
-
|
|
1019
|
+
N && !o && (o = m, a = A);
|
|
1013
1020
|
}
|
|
1014
1021
|
if (o && a) {
|
|
1015
1022
|
if (u.includes(a))
|
|
1016
1023
|
throw new Error(
|
|
1017
1024
|
`Invalid date level '${a}' in dimensional element '${e}'. Column '${s.name}.${o.name}' is not a datetime column`
|
|
1018
1025
|
);
|
|
1019
|
-
const
|
|
1026
|
+
const m = R(a, u, (C) => C), A = m && m.distance <= x ? ` Did you mean '${m.best}'?` : "";
|
|
1020
1027
|
throw new Error(
|
|
1021
1028
|
`Invalid date level '${a}' in dimensional element '${e}'. Valid levels are: ${u.join(
|
|
1022
1029
|
", "
|
|
1023
|
-
)}.${
|
|
1030
|
+
)}.${A}`
|
|
1024
1031
|
);
|
|
1025
1032
|
}
|
|
1026
|
-
const c = n.indexOf("."),
|
|
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 && !fe(l.best.name, p), b = d ? ` Did you mean '${l.best.name}'?` : "", g = !d && n.endsWith(".") && l !== void 0 && fe(l.best.name, p) ? ` Use '${p}' without a trailing dot.` : "";
|
|
1027
1034
|
throw new Error(
|
|
1028
|
-
`Column '${
|
|
1035
|
+
`Column '${p}' not found in table '${s.name}'.${b}${g}`
|
|
1029
1036
|
);
|
|
1030
1037
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const { table: r, column: s, level: n } =
|
|
1038
|
+
function Ss(e, t) {
|
|
1039
|
+
const { table: r, column: s, level: n } = Se(e, t);
|
|
1033
1040
|
if (n) {
|
|
1034
|
-
if (!
|
|
1041
|
+
if (!X(s.dataType))
|
|
1035
1042
|
throw new Error(
|
|
1036
1043
|
`Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
|
|
1037
1044
|
);
|
|
@@ -1055,28 +1062,28 @@ function Cs(e, t) {
|
|
|
1055
1062
|
}
|
|
1056
1063
|
return { table: r, column: s, level: n };
|
|
1057
1064
|
}
|
|
1058
|
-
function
|
|
1059
|
-
const { table: n, column: i, level: o } =
|
|
1065
|
+
function H(e, t, r, s) {
|
|
1066
|
+
const { table: n, column: i, level: o } = Ss(e, r);
|
|
1060
1067
|
let a = o;
|
|
1061
|
-
if (
|
|
1068
|
+
if (X(i.dataType) && a === void 0 && (s != null && s.inferredDateLevel)) {
|
|
1062
1069
|
const u = s.inferredDateLevel, c = $.all;
|
|
1063
1070
|
if (!c.includes(u))
|
|
1064
1071
|
throw new Error(
|
|
1065
1072
|
`Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
|
|
1066
1073
|
);
|
|
1067
|
-
const
|
|
1074
|
+
const p = `${e}.${u}`, l = $.dateOnly;
|
|
1068
1075
|
if (i.dataType === "date" && !l.includes(u))
|
|
1069
1076
|
throw new Error(
|
|
1070
|
-
`Invalid level '${u}' in dimensional element '${
|
|
1077
|
+
`Invalid level '${u}' in dimensional element '${p}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
|
|
1071
1078
|
);
|
|
1072
|
-
const
|
|
1073
|
-
if (i.dataType === "time" && !
|
|
1079
|
+
const d = $.timeOnly;
|
|
1080
|
+
if (i.dataType === "time" && !d.includes(u))
|
|
1074
1081
|
throw new Error(
|
|
1075
|
-
`Invalid level '${u}' in dimensional element '${
|
|
1082
|
+
`Invalid level '${u}' in dimensional element '${p}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
|
|
1076
1083
|
);
|
|
1077
1084
|
a = u;
|
|
1078
1085
|
}
|
|
1079
|
-
return
|
|
1086
|
+
return Or({
|
|
1080
1087
|
expression: i.expression,
|
|
1081
1088
|
dataType: i.dataType,
|
|
1082
1089
|
granularity: a,
|
|
@@ -1085,44 +1092,44 @@ function G(e, t, r, s) {
|
|
|
1085
1092
|
dataSource: t
|
|
1086
1093
|
});
|
|
1087
1094
|
}
|
|
1088
|
-
function
|
|
1089
|
-
const { column: s, level: n } =
|
|
1095
|
+
function Os(e, t, r) {
|
|
1096
|
+
const { column: s, level: n } = Se(e, r);
|
|
1090
1097
|
if (n)
|
|
1091
1098
|
throw new Error(
|
|
1092
|
-
`Invalid DateDimension name format: '${e}'. Expected format: '${
|
|
1099
|
+
`Invalid DateDimension name format: '${e}'. Expected format: '${E}TableName.ColumnName'`
|
|
1093
1100
|
);
|
|
1094
|
-
if (!
|
|
1101
|
+
if (!X(s.dataType))
|
|
1095
1102
|
throw new Error(
|
|
1096
1103
|
`Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
|
|
1097
1104
|
);
|
|
1098
|
-
return
|
|
1105
|
+
return Gr({
|
|
1099
1106
|
name: s.name,
|
|
1100
1107
|
expression: s.expression,
|
|
1101
1108
|
dataSource: t
|
|
1102
1109
|
});
|
|
1103
1110
|
}
|
|
1104
|
-
const
|
|
1111
|
+
const Ds = (e, t) => {
|
|
1105
1112
|
if (!e) return;
|
|
1106
1113
|
const r = typeof e == "object" ? e.direction : e;
|
|
1107
|
-
if (!
|
|
1108
|
-
return F(
|
|
1114
|
+
if (!se(r))
|
|
1115
|
+
return F(y({}, t), {
|
|
1109
1116
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
|
|
1110
1117
|
});
|
|
1111
|
-
},
|
|
1112
|
-
const n =
|
|
1118
|
+
}, Ms = (e, t, r, s) => {
|
|
1119
|
+
const n = Ds(e.sortType, s);
|
|
1113
1120
|
if (n)
|
|
1114
1121
|
return {
|
|
1115
|
-
attribute:
|
|
1122
|
+
attribute: H(e.column, t, r),
|
|
1116
1123
|
style: {},
|
|
1117
1124
|
error: n
|
|
1118
1125
|
};
|
|
1119
|
-
const i =
|
|
1126
|
+
const i = H(e.column, t, r), o = _(e, "column");
|
|
1120
1127
|
return { attribute: i, style: o };
|
|
1121
|
-
},
|
|
1122
|
-
error: F(
|
|
1128
|
+
}, Ns = (e, t, r, s) => typeof e == "string" ? { attribute: H(e, t, r) } : xs(e) ? Ms(e, t, r, s) : {
|
|
1129
|
+
error: F(y({}, s), {
|
|
1123
1130
|
message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
|
|
1124
1131
|
})
|
|
1125
|
-
},
|
|
1132
|
+
}, qt = (e) => {
|
|
1126
1133
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
1127
1134
|
if (!t)
|
|
1128
1135
|
return { success: !0, data: [] };
|
|
@@ -1146,7 +1153,7 @@ const xs = (e, t) => {
|
|
|
1146
1153
|
input: o
|
|
1147
1154
|
};
|
|
1148
1155
|
try {
|
|
1149
|
-
const c =
|
|
1156
|
+
const c = Ns(o, r, s, u);
|
|
1150
1157
|
if (c.error) {
|
|
1151
1158
|
i.push(c.error);
|
|
1152
1159
|
return;
|
|
@@ -1155,106 +1162,335 @@ const xs = (e, t) => {
|
|
|
1155
1162
|
c.style !== void 0 ? { attribute: c.attribute, style: c.style } : { attribute: c.attribute }
|
|
1156
1163
|
);
|
|
1157
1164
|
} catch (c) {
|
|
1158
|
-
const
|
|
1159
|
-
i.push(F(
|
|
1165
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
1166
|
+
i.push(F(y({}, u), { message: p }));
|
|
1160
1167
|
}
|
|
1161
1168
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
1162
1169
|
};
|
|
1163
|
-
function
|
|
1170
|
+
function Oe(e, t) {
|
|
1164
1171
|
const r = Reflect.get(e, t);
|
|
1165
1172
|
if (typeof r != "function")
|
|
1166
1173
|
throw new Error(`Function '${t}' not found or is not a function`);
|
|
1167
1174
|
return r;
|
|
1168
1175
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const r = e.replace("measureFactory.", ""), n =
|
|
1171
|
-
if (!
|
|
1176
|
+
function Rs(e, t) {
|
|
1177
|
+
const r = e.replace("measureFactory.", ""), n = Oe(Dr, r)(...t);
|
|
1178
|
+
if (!xe(n))
|
|
1172
1179
|
throw new Error(`Function '${e}' did not return a valid Measure`);
|
|
1173
1180
|
return n;
|
|
1174
1181
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const r = e.replace("filterFactory.logic.", ""), n =
|
|
1177
|
-
if (!
|
|
1182
|
+
function vs(e, t) {
|
|
1183
|
+
const r = e.replace("filterFactory.logic.", ""), n = Oe(Mr, r)(...t);
|
|
1184
|
+
if (!Z(n))
|
|
1178
1185
|
throw new Error(`Function '${e}' did not return a valid FilterRelations`);
|
|
1179
1186
|
return n;
|
|
1180
1187
|
}
|
|
1181
|
-
function
|
|
1188
|
+
function Is(e, t) {
|
|
1182
1189
|
if (e.startsWith("filterFactory.logic."))
|
|
1183
|
-
return
|
|
1184
|
-
const r = e.replace("filterFactory.", ""), n =
|
|
1185
|
-
if (!
|
|
1190
|
+
return vs(e, t);
|
|
1191
|
+
const r = e.replace("filterFactory.", ""), n = Oe(Nr, r)(...t);
|
|
1192
|
+
if (!oe(n) && !Z(n))
|
|
1186
1193
|
throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
|
|
1187
1194
|
return n;
|
|
1188
1195
|
}
|
|
1189
|
-
function
|
|
1196
|
+
function Ps(e, t) {
|
|
1190
1197
|
const s = e.split(".")[0];
|
|
1191
1198
|
if (s === "measureFactory")
|
|
1192
|
-
return
|
|
1199
|
+
return Rs(e, t);
|
|
1193
1200
|
if (s === "filterFactory")
|
|
1194
|
-
return
|
|
1201
|
+
return Is(e, t);
|
|
1195
1202
|
throw new Error(
|
|
1196
1203
|
`Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
|
|
1197
1204
|
);
|
|
1198
1205
|
}
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1206
|
+
const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s), ks = /* @__PURE__ */ new Set([
|
|
1207
|
+
"CORREL",
|
|
1208
|
+
"COVARP",
|
|
1209
|
+
"COVAR",
|
|
1210
|
+
"EXPONDIST",
|
|
1211
|
+
"INTERCEPT",
|
|
1212
|
+
"LARGEST",
|
|
1213
|
+
"NORMDIST",
|
|
1214
|
+
"POISSONDIST",
|
|
1215
|
+
"SKEWP",
|
|
1216
|
+
"SKEW",
|
|
1217
|
+
"SLOPE",
|
|
1218
|
+
"TDIST",
|
|
1219
|
+
"COSH",
|
|
1220
|
+
"SINH",
|
|
1221
|
+
"TANH",
|
|
1222
|
+
"ORDERING",
|
|
1223
|
+
"RDOUBLE",
|
|
1224
|
+
"RINT"
|
|
1225
|
+
]), te = {
|
|
1226
|
+
// ── X-diff (datetime difference operators) ──
|
|
1227
|
+
SDIFF: f("xdiff", 2, 2, {
|
|
1203
1228
|
requiredDateLevel: $.Seconds,
|
|
1204
1229
|
argType: "datetime"
|
|
1205
|
-
},
|
|
1206
|
-
MNDIFF: {
|
|
1207
|
-
category: "time-diff",
|
|
1208
|
-
argCount: 2,
|
|
1230
|
+
}),
|
|
1231
|
+
MNDIFF: f("xdiff", 2, 2, {
|
|
1209
1232
|
requiredDateLevel: $.Minutes,
|
|
1210
1233
|
argType: "datetime"
|
|
1211
|
-
},
|
|
1212
|
-
HDIFF: {
|
|
1213
|
-
category: "time-diff",
|
|
1214
|
-
argCount: 2,
|
|
1234
|
+
}),
|
|
1235
|
+
HDIFF: f("xdiff", 2, 2, {
|
|
1215
1236
|
requiredDateLevel: $.Hours,
|
|
1216
1237
|
argType: "datetime"
|
|
1217
|
-
},
|
|
1218
|
-
DDIFF: {
|
|
1219
|
-
category: "time-diff",
|
|
1220
|
-
argCount: 2,
|
|
1238
|
+
}),
|
|
1239
|
+
DDIFF: f("xdiff", 2, 2, {
|
|
1221
1240
|
requiredDateLevel: $.Days,
|
|
1222
1241
|
argType: "datetime"
|
|
1223
|
-
},
|
|
1224
|
-
MDIFF: {
|
|
1225
|
-
category: "time-diff",
|
|
1226
|
-
argCount: 2,
|
|
1242
|
+
}),
|
|
1243
|
+
MDIFF: f("xdiff", 2, 2, {
|
|
1227
1244
|
requiredDateLevel: $.Months,
|
|
1228
1245
|
argType: "datetime"
|
|
1229
|
-
},
|
|
1230
|
-
QDIFF: {
|
|
1231
|
-
category: "time-diff",
|
|
1232
|
-
argCount: 2,
|
|
1246
|
+
}),
|
|
1247
|
+
QDIFF: f("xdiff", 2, 2, {
|
|
1233
1248
|
requiredDateLevel: $.Quarters,
|
|
1234
1249
|
argType: "datetime"
|
|
1235
|
-
},
|
|
1236
|
-
YDIFF: {
|
|
1237
|
-
category: "time-diff",
|
|
1238
|
-
argCount: 2,
|
|
1250
|
+
}),
|
|
1251
|
+
YDIFF: f("xdiff", 2, 2, {
|
|
1239
1252
|
requiredDateLevel: $.Years,
|
|
1240
1253
|
argType: "datetime"
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
(
|
|
1254
|
+
}),
|
|
1255
|
+
// ── Aggregation ──
|
|
1256
|
+
ANYVALUE: f("aggregative", 1, 1),
|
|
1257
|
+
SUM: f("aggregative", 1, 2),
|
|
1258
|
+
AVG: f("aggregative", 1, 2),
|
|
1259
|
+
MIN: f("aggregative", 1, 2),
|
|
1260
|
+
MAX: f("aggregative", 1, 2),
|
|
1261
|
+
COUNT: f("aggregative", 1, 2),
|
|
1262
|
+
DUPCOUNT: f("aggregative", 1, 1),
|
|
1263
|
+
COUNTDUPLICATES: f("aggregative", 1, 1),
|
|
1264
|
+
STDEV: f("aggregative", 1, 2),
|
|
1265
|
+
STDEVP: f("aggregative", 1, 2),
|
|
1266
|
+
VAR: f("aggregative", 1, 2),
|
|
1267
|
+
VARP: f("aggregative", 1, 2),
|
|
1268
|
+
MEDIAN: f("aggregative", 1, 2),
|
|
1269
|
+
QUARTILE: f("aggregative", 2, 3),
|
|
1270
|
+
PERCENTILE: f("aggregative", 2, 3),
|
|
1271
|
+
LOWERWHISKERMAX_IQR: f("aggregative", 1, 1),
|
|
1272
|
+
LOWERWHISKERMAX_STDEVP: f("aggregative", 1, 1),
|
|
1273
|
+
UPPERWHISKERMIN_IQR: f("aggregative", 1, 1),
|
|
1274
|
+
UPPERWHISKERMIN_STDEVP: f("aggregative", 1, 1),
|
|
1275
|
+
OUTLIERSCOUNT_IQR: f("aggregative", 1, 1),
|
|
1276
|
+
OUTLIERSCOUNT_STDEVP: f("aggregative", 1, 1),
|
|
1277
|
+
MODE: f("aggregative", 1, 1),
|
|
1278
|
+
NOAGGFUNCTION: f("aggregative", 1, 1),
|
|
1279
|
+
// ── Window ──
|
|
1280
|
+
RANK: f("window", 0, Number.POSITIVE_INFINITY),
|
|
1281
|
+
RSUM: f("window", 1, 2),
|
|
1282
|
+
RAVG: f("window", 1, 2),
|
|
1283
|
+
YTDSUM: f("window", 1, 1),
|
|
1284
|
+
QTDSUM: f("window", 1, 1),
|
|
1285
|
+
MTDSUM: f("window", 1, 1),
|
|
1286
|
+
WTDSUM: f("window", 1, 1),
|
|
1287
|
+
YTDAVG: f("window", 1, 1),
|
|
1288
|
+
QTDAVG: f("window", 1, 1),
|
|
1289
|
+
MTDAVG: f("window", 1, 1),
|
|
1290
|
+
WTDAVG: f("window", 1, 1),
|
|
1291
|
+
// ── String ──
|
|
1292
|
+
CONCAT: f("string", 2, Number.POSITIVE_INFINITY),
|
|
1293
|
+
LEFT: f("string", 2, 2),
|
|
1294
|
+
RIGHT: f("string", 2, 2),
|
|
1295
|
+
// ── Scalar / math ──
|
|
1296
|
+
ABS: f("scalar", 1, 1),
|
|
1297
|
+
ACOS: f("scalar", 1, 1),
|
|
1298
|
+
ASIN: f("scalar", 1, 1),
|
|
1299
|
+
ATAN: f("scalar", 1, 1),
|
|
1300
|
+
CEILING: f("scalar", 1, 1),
|
|
1301
|
+
CONTRIBUTION: f("scalar", 1, 1),
|
|
1302
|
+
COS: f("scalar", 1, 1),
|
|
1303
|
+
COT: f("scalar", 1, 1),
|
|
1304
|
+
DIFFPASTDAY: f("scalar", 1, 1),
|
|
1305
|
+
DIFFPASTMONTH: f("scalar", 1, 1),
|
|
1306
|
+
DIFFPASTPERIOD: f("scalar", 1, 1),
|
|
1307
|
+
DIFFPASTQUARTER: f("scalar", 1, 1),
|
|
1308
|
+
DIFFPASTWEEK: f("scalar", 1, 1),
|
|
1309
|
+
DIFFPASTYEAR: f("scalar", 1, 1),
|
|
1310
|
+
EXP: f("scalar", 1, 1),
|
|
1311
|
+
FLOOR: f("scalar", 1, 1),
|
|
1312
|
+
GROWTH: f("growth", 1, 1),
|
|
1313
|
+
GROWTHPASTMONTH: f("growth", 1, 1),
|
|
1314
|
+
GROWTHPASTQUARTER: f("growth", 1, 1),
|
|
1315
|
+
GROWTHPASTWEEK: f("growth", 1, 1),
|
|
1316
|
+
GROWTHPASTYEAR: f("growth", 1, 1),
|
|
1317
|
+
GROWTHRATE: f("growth", 1, 1),
|
|
1318
|
+
LN: f("scalar", 1, 1),
|
|
1319
|
+
LOG10: f("scalar", 1, 1),
|
|
1320
|
+
MINUS: f("scalar", 1, 1),
|
|
1321
|
+
MOD: f("scalar", 2, 2),
|
|
1322
|
+
QUOTIENT: f("scalar", 2, 2),
|
|
1323
|
+
PASTDAY: f("date", 1, 2),
|
|
1324
|
+
PASTMONTH: f("date", 1, 2),
|
|
1325
|
+
PASTPERIOD: f("date", 1, 2),
|
|
1326
|
+
PASTQUARTER: f("date", 1, 2),
|
|
1327
|
+
PASTWEEK: f("date", 1, 2),
|
|
1328
|
+
PASTYEAR: f("date", 1, 2),
|
|
1329
|
+
PERCENTILEDISCFORINTERNALUSEONLY: f("scalar", 1, 1),
|
|
1330
|
+
PERCENTILECONTFORINTERNALUSEONLY: f("scalar", 1, 1),
|
|
1331
|
+
POWER: f("scalar", 2, 2),
|
|
1332
|
+
ROUND: f("scalar", 2, 2),
|
|
1333
|
+
SIN: f("scalar", 1, 1),
|
|
1334
|
+
SQRT: f("scalar", 1, 1),
|
|
1335
|
+
TAN: f("scalar", 1, 1)
|
|
1336
|
+
}, Bs = Object.keys(te).filter(
|
|
1337
|
+
(e) => te[e].category === "xdiff"
|
|
1244
1338
|
);
|
|
1245
|
-
function
|
|
1246
|
-
return
|
|
1339
|
+
function xt() {
|
|
1340
|
+
return Bs;
|
|
1247
1341
|
}
|
|
1248
|
-
function
|
|
1249
|
-
const t =
|
|
1342
|
+
function $t(e) {
|
|
1343
|
+
const t = te[e.toUpperCase()];
|
|
1250
1344
|
return t == null ? void 0 : t.requiredDateLevel;
|
|
1251
1345
|
}
|
|
1252
|
-
|
|
1346
|
+
function zs(e, t) {
|
|
1347
|
+
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
|
+
}
|
|
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
|
+
const js = /\[(\w[\w.-]*)\]/g, Dt = /* @__PURE__ */ new Set([
|
|
1253
1490
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1254
1491
|
"AVG",
|
|
1255
1492
|
"COUNT",
|
|
1256
1493
|
"DUPCOUNT",
|
|
1257
|
-
"LARGEST",
|
|
1258
1494
|
"MAX",
|
|
1259
1495
|
"MEDIAN",
|
|
1260
1496
|
"MIN",
|
|
@@ -1268,39 +1504,33 @@ const Ns = /\[(\w[\w.-]*)\]/g, Ct = /* @__PURE__ */ new Set([
|
|
|
1268
1504
|
"QTDAVG",
|
|
1269
1505
|
"QTDSUM",
|
|
1270
1506
|
"YTDAVG",
|
|
1271
|
-
"YTDSUM"
|
|
1507
|
+
"YTDSUM"
|
|
1272
1508
|
// RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
|
|
1273
|
-
//
|
|
1274
|
-
|
|
1275
|
-
"
|
|
1276
|
-
"COVAR",
|
|
1277
|
-
"SKEWP",
|
|
1278
|
-
"SKEW",
|
|
1279
|
-
"SLOPE"
|
|
1280
|
-
]), Rs = new RegExp(
|
|
1281
|
-
`\\b(${Array.from(Ct).join("|")})\\s*\\(`,
|
|
1509
|
+
// CORREL, COVAR*, SKEW*, SLOPE, LARGEST are unsupported in custom formulas (see UNSUPPORTED_FORMULA_FUNCTIONS).
|
|
1510
|
+
]), Ks = new RegExp(
|
|
1511
|
+
`\\b(${Array.from(Dt).join("|")})\\s*\\(`,
|
|
1282
1512
|
"i"
|
|
1283
1513
|
);
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1514
|
+
function Mt(e) {
|
|
1515
|
+
return q(e) ? !0 : typeof e == "string" && e.startsWith(E) ? !1 : S(e) && "kind" in e ? e.kind === "measure" : !0;
|
|
1286
1516
|
}
|
|
1287
|
-
function
|
|
1517
|
+
function Gs(e) {
|
|
1288
1518
|
const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
|
|
1289
1519
|
let s;
|
|
1290
1520
|
for (; (s = t.exec(e)) !== null; ) {
|
|
1291
1521
|
const n = s[1];
|
|
1292
|
-
|
|
1522
|
+
Dt.has(n.toUpperCase()) || r.add(n);
|
|
1293
1523
|
}
|
|
1294
1524
|
return Array.from(r);
|
|
1295
1525
|
}
|
|
1296
|
-
function
|
|
1526
|
+
function Ys(e) {
|
|
1297
1527
|
return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
|
|
1298
1528
|
}
|
|
1299
|
-
function
|
|
1529
|
+
function Js(e) {
|
|
1300
1530
|
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1301
1531
|
}
|
|
1302
|
-
const j = (e) => e.startsWith("[") ? e : `[${e}]`,
|
|
1303
|
-
function
|
|
1532
|
+
const j = (e) => e.startsWith("[") ? e : `[${e}]`, Nt = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
1533
|
+
function Rt(e, t) {
|
|
1304
1534
|
if (t.length === 0) return [];
|
|
1305
1535
|
const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
|
|
1306
1536
|
`\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
|
|
@@ -1312,7 +1542,7 @@ function $t(e, t) {
|
|
|
1312
1542
|
ref2: n[3].trim()
|
|
1313
1543
|
}));
|
|
1314
1544
|
}
|
|
1315
|
-
function
|
|
1545
|
+
function Hs(e, t, r) {
|
|
1316
1546
|
var o, a, u;
|
|
1317
1547
|
const s = Object.keys(t), n = ((o = r.errorPrefix) != null ? o : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
|
|
1318
1548
|
return {
|
|
@@ -1327,110 +1557,180 @@ function zs(e, t, r) {
|
|
|
1327
1557
|
result: { isValid: !0, errors: [], warnings: [], references: [], unusedContextKeys: [] }
|
|
1328
1558
|
};
|
|
1329
1559
|
}
|
|
1330
|
-
function
|
|
1560
|
+
function M(e, t) {
|
|
1331
1561
|
e.result.errors.push(t), e.result.isValid = !1;
|
|
1332
1562
|
}
|
|
1333
|
-
const
|
|
1334
|
-
function
|
|
1563
|
+
const Qs = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
|
|
1564
|
+
function Xs(e) {
|
|
1335
1565
|
const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
|
|
1336
|
-
(s) => !
|
|
1566
|
+
(s) => !Qs.has(s[1].toUpperCase())
|
|
1337
1567
|
);
|
|
1338
|
-
r &&
|
|
1568
|
+
r && M(
|
|
1339
1569
|
e,
|
|
1340
1570
|
`${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
|
|
1341
1571
|
);
|
|
1342
1572
|
}
|
|
1343
|
-
function
|
|
1573
|
+
function Zs(e, t) {
|
|
1574
|
+
const r = e[t];
|
|
1575
|
+
let s = t + 1;
|
|
1576
|
+
for (; s < e.length; ) {
|
|
1577
|
+
const n = e[s], i = e[s + 1];
|
|
1578
|
+
if (n !== r) {
|
|
1579
|
+
s++;
|
|
1580
|
+
continue;
|
|
1581
|
+
}
|
|
1582
|
+
if (i === r) {
|
|
1583
|
+
s += 2;
|
|
1584
|
+
continue;
|
|
1585
|
+
}
|
|
1586
|
+
return s + 1;
|
|
1587
|
+
}
|
|
1588
|
+
return e.length;
|
|
1589
|
+
}
|
|
1590
|
+
function en(e) {
|
|
1591
|
+
return De(e, ",").filter((t) => t.trim().length > 0).length;
|
|
1592
|
+
}
|
|
1593
|
+
function tn(e, t, r, s) {
|
|
1594
|
+
for (; t < e.length && /\s/.test(e[t]); )
|
|
1595
|
+
t++;
|
|
1596
|
+
if (e[t] !== "(")
|
|
1597
|
+
return t;
|
|
1598
|
+
const n = t, i = Us(e, n);
|
|
1599
|
+
if (i === -1)
|
|
1600
|
+
return n + 1;
|
|
1601
|
+
const o = e.slice(n + 1, i);
|
|
1602
|
+
return s.push({ name: r.toUpperCase(), argCount: en(o) }), s.push(...vt(o)), i + 1;
|
|
1603
|
+
}
|
|
1604
|
+
function vt(e) {
|
|
1605
|
+
const t = [];
|
|
1606
|
+
let r = 0;
|
|
1607
|
+
for (; r < e.length; ) {
|
|
1608
|
+
const s = e[r];
|
|
1609
|
+
if (s === "'" || s === '"') {
|
|
1610
|
+
r = Zs(e, r);
|
|
1611
|
+
continue;
|
|
1612
|
+
}
|
|
1613
|
+
if (/[A-Za-z_]/.test(s)) {
|
|
1614
|
+
const n = r;
|
|
1615
|
+
for (r++; r < e.length && /[A-Za-z0-9_]/.test(e[r]); )
|
|
1616
|
+
r++;
|
|
1617
|
+
const i = e.slice(n, r);
|
|
1618
|
+
r = tn(e, r, i, t);
|
|
1619
|
+
continue;
|
|
1620
|
+
}
|
|
1621
|
+
r++;
|
|
1622
|
+
}
|
|
1623
|
+
return t;
|
|
1624
|
+
}
|
|
1625
|
+
function rn(e) {
|
|
1626
|
+
const t = vt(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1627
|
+
for (const { name: n, argCount: i } of t) {
|
|
1628
|
+
if (ks.has(n)) {
|
|
1629
|
+
r.has(n) || (r.add(n), M(
|
|
1630
|
+
e,
|
|
1631
|
+
`${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
|
|
1632
|
+
));
|
|
1633
|
+
continue;
|
|
1634
|
+
}
|
|
1635
|
+
const o = te[n];
|
|
1636
|
+
if (o && (i < o.minArgs || i > o.maxArgs) && !s.has(n)) {
|
|
1637
|
+
s.add(n);
|
|
1638
|
+
const a = zs(o.minArgs, o.maxArgs);
|
|
1639
|
+
M(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${a}`);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
function sn(e) {
|
|
1344
1644
|
return [
|
|
1345
1645
|
...new Set(
|
|
1346
|
-
[...e.matchAll(new RegExp(
|
|
1646
|
+
[...e.matchAll(new RegExp(js.source, "g"))].map((t) => t[1])
|
|
1347
1647
|
)
|
|
1348
1648
|
];
|
|
1349
1649
|
}
|
|
1350
|
-
function
|
|
1650
|
+
function nn(e) {
|
|
1351
1651
|
const t = e.result.references.filter(
|
|
1352
1652
|
(n) => !e.canonicalContextKeys.has(j(n))
|
|
1353
1653
|
);
|
|
1354
1654
|
if (t.length === 0) return;
|
|
1355
|
-
const r = e.contextKeys.map((n) => `[${
|
|
1356
|
-
|
|
1655
|
+
const r = e.contextKeys.map((n) => `[${Nt(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
|
|
1656
|
+
M(
|
|
1357
1657
|
e,
|
|
1358
1658
|
`${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
|
|
1359
1659
|
);
|
|
1360
1660
|
}
|
|
1361
|
-
function
|
|
1362
|
-
if (
|
|
1661
|
+
function on(e) {
|
|
1662
|
+
if (Ks.test(e.formula)) return;
|
|
1363
1663
|
const t = e.result.references.filter((r) => {
|
|
1364
1664
|
var n;
|
|
1365
1665
|
const s = (n = e.context[j(r)]) != null ? n : e.context[r];
|
|
1366
|
-
return s !== void 0 && !
|
|
1666
|
+
return s !== void 0 && !Mt(s);
|
|
1367
1667
|
});
|
|
1368
|
-
t.length !== 0 &&
|
|
1668
|
+
t.length !== 0 && M(
|
|
1369
1669
|
e,
|
|
1370
|
-
`${e.errorPrefix}args[1]: ${
|
|
1371
|
-
|
|
1372
|
-
)}Bracket reference(s) ${
|
|
1670
|
+
`${e.errorPrefix}args[1]: ${Js(
|
|
1671
|
+
Gs(e.formula)
|
|
1672
|
+
)}Bracket reference(s) ${Ys(
|
|
1373
1673
|
t
|
|
1374
1674
|
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1375
1675
|
);
|
|
1376
1676
|
}
|
|
1377
|
-
function
|
|
1677
|
+
function an(e) {
|
|
1378
1678
|
if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
|
|
1379
1679
|
const t = new Set(e.result.references.map(j)), r = e.contextKeys.filter((i) => !t.has(j(i)));
|
|
1380
1680
|
if (e.result.unusedContextKeys = r, r.length === 0) return;
|
|
1381
|
-
const s = r.map((i) => `[${
|
|
1382
|
-
e.errorOnUnusedContext ?
|
|
1681
|
+
const s = r.map((i) => `[${Nt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
|
|
1682
|
+
e.errorOnUnusedContext ? M(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
|
|
1383
1683
|
}
|
|
1384
|
-
function
|
|
1684
|
+
function Je(e, t, r, s) {
|
|
1385
1685
|
var o;
|
|
1386
1686
|
const n = (o = s.context[j(e)]) != null ? o : s.context[e];
|
|
1387
1687
|
if (n === void 0) return;
|
|
1388
|
-
if (!(typeof n == "string" && n.startsWith(
|
|
1389
|
-
|
|
1688
|
+
if (!(typeof n == "string" && n.startsWith(E))) {
|
|
1689
|
+
Mt(n) && M(
|
|
1390
1690
|
s,
|
|
1391
|
-
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${
|
|
1691
|
+
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${E}Table.Column.Level).`
|
|
1392
1692
|
);
|
|
1393
1693
|
return;
|
|
1394
1694
|
}
|
|
1395
1695
|
if (s.schemaIndex)
|
|
1396
1696
|
try {
|
|
1397
|
-
const a =
|
|
1398
|
-
|
|
1697
|
+
const a = Se(n, s.schemaIndex);
|
|
1698
|
+
X(a.column.dataType) ? r && a.level && a.level !== r && M(
|
|
1399
1699
|
s,
|
|
1400
1700
|
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${a.level}'.`
|
|
1401
|
-
) :
|
|
1701
|
+
) : M(
|
|
1402
1702
|
s,
|
|
1403
1703
|
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${a.column.name}'.`
|
|
1404
1704
|
);
|
|
1405
1705
|
} catch (a) {
|
|
1406
1706
|
const u = a instanceof Error ? a.message : "Unknown error";
|
|
1407
|
-
|
|
1707
|
+
M(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
|
|
1408
1708
|
}
|
|
1409
1709
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const t =
|
|
1710
|
+
function un(e) {
|
|
1711
|
+
const t = xt(), r = Rt(e.formula, t);
|
|
1412
1712
|
for (const s of r) {
|
|
1413
|
-
const n =
|
|
1414
|
-
|
|
1713
|
+
const n = $t(s.functionName);
|
|
1714
|
+
Je(s.ref1, s, n, e), Je(s.ref2, s, n, e);
|
|
1415
1715
|
}
|
|
1416
1716
|
}
|
|
1417
|
-
function
|
|
1717
|
+
function cn(e, t, r = {}) {
|
|
1418
1718
|
var n;
|
|
1419
|
-
const s =
|
|
1420
|
-
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n ||
|
|
1719
|
+
const s = Hs(e, t, r);
|
|
1720
|
+
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || M(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (Xs(s), rn(s), s.result.references = sn(e), s.result.references.length === 0 ? (s.result.warnings.push(
|
|
1421
1721
|
`${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1422
|
-
), s.result) : s.contextKeys.length === 0 ? (
|
|
1722
|
+
), s.result) : s.contextKeys.length === 0 ? (M(
|
|
1423
1723
|
s,
|
|
1424
1724
|
`${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1425
|
-
), s.result) : (
|
|
1725
|
+
), s.result) : (nn(s), on(s), an(s), un(s), s.result));
|
|
1426
1726
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const s =
|
|
1727
|
+
function ln(e, t, r = {}) {
|
|
1728
|
+
const s = cn(e, t, r);
|
|
1429
1729
|
if (!s.isValid)
|
|
1430
1730
|
throw new Error(s.errors.join("; "));
|
|
1431
1731
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1432
1732
|
}
|
|
1433
|
-
function
|
|
1733
|
+
function fn(e, t) {
|
|
1434
1734
|
if (e.length < 3 || e.length > 5)
|
|
1435
1735
|
throw new Error(
|
|
1436
1736
|
`${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
@@ -1441,12 +1741,12 @@ function Ys(e, t) {
|
|
|
1441
1741
|
`${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
|
|
1442
1742
|
);
|
|
1443
1743
|
const s = r, n = e[2];
|
|
1444
|
-
if (!
|
|
1744
|
+
if (!S(n))
|
|
1445
1745
|
throw new Error(
|
|
1446
1746
|
`${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
|
|
1447
1747
|
);
|
|
1448
1748
|
const i = n;
|
|
1449
|
-
|
|
1749
|
+
ln(s, i, {
|
|
1450
1750
|
errorPrefix: `${t.pathPrefix}`,
|
|
1451
1751
|
errorOnUnusedContext: !0,
|
|
1452
1752
|
// Strict validation: all context keys must be used
|
|
@@ -1454,130 +1754,130 @@ function Ys(e, t) {
|
|
|
1454
1754
|
// Custom formulas must have content
|
|
1455
1755
|
schemaIndex: t.schemaIndex
|
|
1456
1756
|
});
|
|
1457
|
-
const o =
|
|
1757
|
+
const o = dn(s), a = {};
|
|
1458
1758
|
for (const [u, c] of Object.entries(i)) {
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1461
|
-
a[`${u}`] =
|
|
1759
|
+
const p = `args[2].${u}`;
|
|
1760
|
+
if (q(c))
|
|
1761
|
+
a[`${u}`] = D({
|
|
1462
1762
|
data: c,
|
|
1463
1763
|
context: {
|
|
1464
1764
|
dataSource: t.dataSource,
|
|
1465
1765
|
schemaIndex: t.schemaIndex,
|
|
1466
|
-
pathPrefix:
|
|
1766
|
+
pathPrefix: p
|
|
1467
1767
|
}
|
|
1468
1768
|
});
|
|
1469
|
-
else if (typeof c == "string" && c.startsWith(
|
|
1470
|
-
const l = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u,
|
|
1769
|
+
else if (typeof c == "string" && c.startsWith(E)) {
|
|
1770
|
+
const l = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, d = o[l];
|
|
1471
1771
|
try {
|
|
1472
|
-
a[`${u}`] =
|
|
1772
|
+
a[`${u}`] = H(
|
|
1473
1773
|
c,
|
|
1474
1774
|
t.dataSource,
|
|
1475
1775
|
t.schemaIndex,
|
|
1476
|
-
|
|
1776
|
+
d !== void 0 ? { inferredDateLevel: d } : void 0
|
|
1477
1777
|
);
|
|
1478
|
-
} catch (
|
|
1479
|
-
const
|
|
1480
|
-
throw new Error(`${
|
|
1778
|
+
} catch (b) {
|
|
1779
|
+
const g = b instanceof Error ? b.message : "Unknown error";
|
|
1780
|
+
throw new Error(`${p}: ${g}`);
|
|
1481
1781
|
}
|
|
1482
1782
|
} else if (c && typeof c == "object" && "kind" in c)
|
|
1483
1783
|
a[`${u}`] = c;
|
|
1484
1784
|
else
|
|
1485
1785
|
throw new Error(
|
|
1486
|
-
`${
|
|
1786
|
+
`${p}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${E}...), but got: ${typeof c}`
|
|
1487
1787
|
);
|
|
1488
1788
|
}
|
|
1489
1789
|
e[2] = a;
|
|
1490
1790
|
}
|
|
1491
|
-
function
|
|
1492
|
-
const t =
|
|
1791
|
+
function dn(e) {
|
|
1792
|
+
const t = xt(), r = Rt(e, t), s = {};
|
|
1493
1793
|
for (const n of r) {
|
|
1494
|
-
const i =
|
|
1794
|
+
const i = $t(n.functionName);
|
|
1495
1795
|
if (i !== void 0)
|
|
1496
1796
|
for (const o of [n.ref1, n.ref2]) {
|
|
1497
1797
|
const a = s[o];
|
|
1498
1798
|
if (a !== void 0 && a !== i)
|
|
1499
1799
|
throw new Error(
|
|
1500
|
-
`Reference [${o}] is used in
|
|
1800
|
+
`Reference [${o}] is used in xdiff functions with conflicting date levels ('${a}' and '${i}'). Specify the date level in the context (e.g. DM.Table.Column.${i}).`
|
|
1501
1801
|
);
|
|
1502
1802
|
s[o] = i;
|
|
1503
1803
|
}
|
|
1504
1804
|
}
|
|
1505
1805
|
return s;
|
|
1506
1806
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return e.type ===
|
|
1807
|
+
function It(e) {
|
|
1808
|
+
return e.type === U.TextAttribute;
|
|
1509
1809
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return e.type ===
|
|
1810
|
+
function Pt(e) {
|
|
1811
|
+
return e.type === U.NumericAttribute;
|
|
1512
1812
|
}
|
|
1513
|
-
function
|
|
1514
|
-
return e.type ===
|
|
1813
|
+
function mn(e) {
|
|
1814
|
+
return e.type === U.DateLevel;
|
|
1515
1815
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return
|
|
1816
|
+
function pn(e) {
|
|
1817
|
+
return It(e) || Pt(e);
|
|
1518
1818
|
}
|
|
1519
|
-
function
|
|
1520
|
-
return e.type ===
|
|
1819
|
+
function ae(e) {
|
|
1820
|
+
return e.type === U.TextAttribute ? "text" : e.type === U.NumericAttribute ? "numeric" : e.type === U.DateLevel ? "date/datetime" : "unknown";
|
|
1521
1821
|
}
|
|
1522
|
-
function
|
|
1822
|
+
function Me(e, t) {
|
|
1523
1823
|
const r = e[0];
|
|
1524
1824
|
if (!r || typeof r != "object" || !("type" in r))
|
|
1525
1825
|
throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1526
1826
|
return r;
|
|
1527
1827
|
}
|
|
1528
|
-
function
|
|
1529
|
-
const r =
|
|
1530
|
-
if (!
|
|
1828
|
+
function He(e, t) {
|
|
1829
|
+
const r = Me(e, t);
|
|
1830
|
+
if (!pn(r))
|
|
1531
1831
|
throw new Error(
|
|
1532
|
-
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1832
|
+
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ae(
|
|
1533
1833
|
r
|
|
1534
1834
|
)} attribute`
|
|
1535
1835
|
);
|
|
1536
1836
|
}
|
|
1537
|
-
function
|
|
1538
|
-
const r =
|
|
1539
|
-
if (!
|
|
1837
|
+
function P(e, t) {
|
|
1838
|
+
const r = Me(e, t);
|
|
1839
|
+
if (!Pt(r))
|
|
1540
1840
|
throw new Error(
|
|
1541
|
-
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1841
|
+
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ae(
|
|
1542
1842
|
r
|
|
1543
1843
|
)} attribute`
|
|
1544
1844
|
);
|
|
1545
1845
|
}
|
|
1546
1846
|
function k(e, t) {
|
|
1547
|
-
const r =
|
|
1548
|
-
if (!
|
|
1847
|
+
const r = Me(e, t);
|
|
1848
|
+
if (!It(r))
|
|
1549
1849
|
throw new Error(
|
|
1550
|
-
`${t.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1850
|
+
`${t.pathPrefix}args[0]: Attribute must be string type, got ${ae(
|
|
1551
1851
|
r
|
|
1552
1852
|
)} attribute`
|
|
1553
1853
|
);
|
|
1554
1854
|
}
|
|
1555
|
-
function
|
|
1855
|
+
function gn(e, t) {
|
|
1556
1856
|
const r = e[0];
|
|
1557
1857
|
if (!r || typeof r != "object" || !("attribute" in r))
|
|
1558
1858
|
throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1559
1859
|
return r;
|
|
1560
1860
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const r =
|
|
1563
|
-
if (!
|
|
1861
|
+
function yn(e, t) {
|
|
1862
|
+
const r = gn(e, t);
|
|
1863
|
+
if (!Fe(r))
|
|
1564
1864
|
throw new Error(
|
|
1565
1865
|
`${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
|
|
1566
1866
|
);
|
|
1567
1867
|
}
|
|
1568
|
-
const
|
|
1569
|
-
"measureFactory.customFormula":
|
|
1868
|
+
const hn = {
|
|
1869
|
+
"measureFactory.customFormula": fn,
|
|
1570
1870
|
// String | Number filters
|
|
1571
|
-
"filterFactory.equals":
|
|
1572
|
-
"filterFactory.doesntEqual":
|
|
1871
|
+
"filterFactory.equals": He,
|
|
1872
|
+
"filterFactory.doesntEqual": He,
|
|
1573
1873
|
// Numeric filters
|
|
1574
|
-
"filterFactory.greaterThan":
|
|
1575
|
-
"filterFactory.greaterThanOrEqual":
|
|
1576
|
-
"filterFactory.lessThan":
|
|
1577
|
-
"filterFactory.lessThanOrEqual":
|
|
1578
|
-
"filterFactory.between":
|
|
1579
|
-
"filterFactory.betweenNotEqual":
|
|
1580
|
-
"filterFactory.numeric":
|
|
1874
|
+
"filterFactory.greaterThan": P,
|
|
1875
|
+
"filterFactory.greaterThanOrEqual": P,
|
|
1876
|
+
"filterFactory.lessThan": P,
|
|
1877
|
+
"filterFactory.lessThanOrEqual": P,
|
|
1878
|
+
"filterFactory.between": P,
|
|
1879
|
+
"filterFactory.betweenNotEqual": P,
|
|
1880
|
+
"filterFactory.numeric": P,
|
|
1581
1881
|
// String filters
|
|
1582
1882
|
"filterFactory.contains": k,
|
|
1583
1883
|
"filterFactory.doesntContain": k,
|
|
@@ -1587,12 +1887,12 @@ const en = {
|
|
|
1587
1887
|
"filterFactory.doesntEndWith": k,
|
|
1588
1888
|
"filterFactory.like": k,
|
|
1589
1889
|
// Exclude filter
|
|
1590
|
-
"filterFactory.exclude":
|
|
1890
|
+
"filterFactory.exclude": yn
|
|
1591
1891
|
};
|
|
1592
|
-
function
|
|
1593
|
-
return
|
|
1892
|
+
function bn(e) {
|
|
1893
|
+
return hn[`${e}`];
|
|
1594
1894
|
}
|
|
1595
|
-
const
|
|
1895
|
+
const kt = {
|
|
1596
1896
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1597
1897
|
// Basic aggregations
|
|
1598
1898
|
"measureFactory.sum": [
|
|
@@ -2119,18 +2419,18 @@ const St = {
|
|
|
2119
2419
|
{ type: "FilterRelationsNode", required: !0 }
|
|
2120
2420
|
]
|
|
2121
2421
|
};
|
|
2122
|
-
function
|
|
2123
|
-
return
|
|
2422
|
+
function Ne(e) {
|
|
2423
|
+
return kt[`${e}`];
|
|
2124
2424
|
}
|
|
2125
|
-
function
|
|
2126
|
-
const t =
|
|
2425
|
+
function An(e) {
|
|
2426
|
+
const t = Ne(e);
|
|
2127
2427
|
return t ? t.filter((r) => r.required).length : 0;
|
|
2128
2428
|
}
|
|
2129
|
-
function
|
|
2130
|
-
const t =
|
|
2429
|
+
function Fn(e) {
|
|
2430
|
+
const t = Ne(e);
|
|
2131
2431
|
return t ? t.length : 0;
|
|
2132
2432
|
}
|
|
2133
|
-
function
|
|
2433
|
+
function wn(e) {
|
|
2134
2434
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
2135
2435
|
return !1;
|
|
2136
2436
|
const r = Date.parse(e);
|
|
@@ -2139,31 +2439,31 @@ function nn(e) {
|
|
|
2139
2439
|
const s = new Date(e);
|
|
2140
2440
|
return !isNaN(s.getTime());
|
|
2141
2441
|
}
|
|
2142
|
-
function
|
|
2143
|
-
if (e.startsWith(
|
|
2442
|
+
function de(e, t, r, s) {
|
|
2443
|
+
if (e.startsWith(E))
|
|
2144
2444
|
try {
|
|
2145
|
-
return
|
|
2445
|
+
return H(e, t, r);
|
|
2146
2446
|
} catch (n) {
|
|
2147
2447
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2148
2448
|
throw new Error(`${s}: ${i}`);
|
|
2149
2449
|
}
|
|
2150
2450
|
throw new Error(
|
|
2151
|
-
`${s}: Invalid attribute '${e}'. Expected format: '${
|
|
2451
|
+
`${s}: Invalid attribute '${e}'. Expected format: '${E}TableName.ColumnName[.Level]'`
|
|
2152
2452
|
);
|
|
2153
2453
|
}
|
|
2154
|
-
function
|
|
2155
|
-
if (e.startsWith(
|
|
2454
|
+
function En(e, t, r, s) {
|
|
2455
|
+
if (e.startsWith(E))
|
|
2156
2456
|
try {
|
|
2157
|
-
return
|
|
2457
|
+
return Os(e, t, r);
|
|
2158
2458
|
} catch (n) {
|
|
2159
2459
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2160
2460
|
throw new Error(`${s}: ${i}`);
|
|
2161
2461
|
}
|
|
2162
2462
|
throw new Error(
|
|
2163
|
-
`${s}: Invalid date dimension string '${e}'. Expected format: '${
|
|
2463
|
+
`${s}: Invalid date dimension string '${e}'. Expected format: '${E}TableName.ColumnName'`
|
|
2164
2464
|
);
|
|
2165
2465
|
}
|
|
2166
|
-
function
|
|
2466
|
+
function Cn(e) {
|
|
2167
2467
|
const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, o = i;
|
|
2168
2468
|
if (t === void 0) {
|
|
2169
2469
|
if (r.required)
|
|
@@ -2209,7 +2509,7 @@ function an(e) {
|
|
|
2209
2509
|
throw new Error(
|
|
2210
2510
|
`${o}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
|
|
2211
2511
|
);
|
|
2212
|
-
return
|
|
2512
|
+
return de(t, s, n, o);
|
|
2213
2513
|
case "Attribute[]":
|
|
2214
2514
|
if (!Array.isArray(t))
|
|
2215
2515
|
throw new Error(
|
|
@@ -2218,15 +2518,15 @@ function an(e) {
|
|
|
2218
2518
|
return t.map((a, u) => {
|
|
2219
2519
|
if (typeof a != "string")
|
|
2220
2520
|
throw new Error(`${o}[${u}]: Expected attribute string, got ${typeof a}`);
|
|
2221
|
-
return
|
|
2521
|
+
return de(a, s, n, `${o}[${u}]`);
|
|
2222
2522
|
});
|
|
2223
2523
|
case "Measure":
|
|
2224
2524
|
case "BaseMeasure":
|
|
2225
|
-
if (!
|
|
2525
|
+
if (!q(t))
|
|
2226
2526
|
throw new Error(
|
|
2227
2527
|
`${o}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
|
|
2228
2528
|
);
|
|
2229
|
-
return
|
|
2529
|
+
return D({
|
|
2230
2530
|
data: t,
|
|
2231
2531
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2232
2532
|
});
|
|
@@ -2236,21 +2536,21 @@ function an(e) {
|
|
|
2236
2536
|
`${o}: Expected array of measure function calls, got ${typeof t}`
|
|
2237
2537
|
);
|
|
2238
2538
|
return t.map((a, u) => {
|
|
2239
|
-
if (!
|
|
2539
|
+
if (!q(a))
|
|
2240
2540
|
throw new Error(
|
|
2241
2541
|
`${o}[${u}]: Expected measure function call, got ${typeof a}`
|
|
2242
2542
|
);
|
|
2243
|
-
return
|
|
2543
|
+
return D({
|
|
2244
2544
|
data: a,
|
|
2245
2545
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2246
2546
|
});
|
|
2247
2547
|
});
|
|
2248
2548
|
case "Filter":
|
|
2249
|
-
if (!
|
|
2549
|
+
if (!q(t))
|
|
2250
2550
|
throw new Error(
|
|
2251
2551
|
`${o}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
|
|
2252
2552
|
);
|
|
2253
|
-
return
|
|
2553
|
+
return D({
|
|
2254
2554
|
data: t,
|
|
2255
2555
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2256
2556
|
});
|
|
@@ -2260,11 +2560,11 @@ function an(e) {
|
|
|
2260
2560
|
`${o}: Expected array of filter function calls, got ${typeof t}`
|
|
2261
2561
|
);
|
|
2262
2562
|
return t.map((a, u) => {
|
|
2263
|
-
if (!
|
|
2563
|
+
if (!q(a))
|
|
2264
2564
|
throw new Error(
|
|
2265
2565
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2266
2566
|
);
|
|
2267
|
-
return
|
|
2567
|
+
return D({
|
|
2268
2568
|
data: a,
|
|
2269
2569
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2270
2570
|
});
|
|
@@ -2272,17 +2572,17 @@ function an(e) {
|
|
|
2272
2572
|
case "FilterRelationsNode":
|
|
2273
2573
|
if (Array.isArray(t))
|
|
2274
2574
|
return t.map((a, u) => {
|
|
2275
|
-
if (!
|
|
2575
|
+
if (!q(a))
|
|
2276
2576
|
throw new Error(
|
|
2277
2577
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2278
2578
|
);
|
|
2279
|
-
return
|
|
2579
|
+
return D({
|
|
2280
2580
|
data: a,
|
|
2281
2581
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2282
2582
|
});
|
|
2283
2583
|
});
|
|
2284
|
-
if (
|
|
2285
|
-
return
|
|
2584
|
+
if (q(t))
|
|
2585
|
+
return D({
|
|
2286
2586
|
data: t,
|
|
2287
2587
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2288
2588
|
});
|
|
@@ -2294,21 +2594,21 @@ function an(e) {
|
|
|
2294
2594
|
throw new Error(
|
|
2295
2595
|
`${o}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
|
|
2296
2596
|
);
|
|
2297
|
-
return
|
|
2597
|
+
return En(t, s, n, o);
|
|
2298
2598
|
case "LevelAttribute": {
|
|
2299
2599
|
if (typeof t != "string")
|
|
2300
2600
|
throw new Error(
|
|
2301
2601
|
`${o}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
|
|
2302
2602
|
);
|
|
2303
|
-
const a =
|
|
2603
|
+
const a = de(
|
|
2304
2604
|
t,
|
|
2305
2605
|
s,
|
|
2306
2606
|
n,
|
|
2307
2607
|
o
|
|
2308
2608
|
);
|
|
2309
|
-
if (!
|
|
2609
|
+
if (!mn(a))
|
|
2310
2610
|
throw new Error(
|
|
2311
|
-
`${o}: Attribute must be date/datetime type, got ${
|
|
2611
|
+
`${o}: Attribute must be date/datetime type, got ${ae(
|
|
2312
2612
|
a
|
|
2313
2613
|
)} attribute`
|
|
2314
2614
|
);
|
|
@@ -2317,8 +2617,8 @@ function an(e) {
|
|
|
2317
2617
|
case "Measure | number":
|
|
2318
2618
|
if (typeof t == "number")
|
|
2319
2619
|
return t;
|
|
2320
|
-
if (
|
|
2321
|
-
return
|
|
2620
|
+
if (q(t))
|
|
2621
|
+
return D({
|
|
2322
2622
|
data: t,
|
|
2323
2623
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2324
2624
|
});
|
|
@@ -2327,7 +2627,7 @@ function an(e) {
|
|
|
2327
2627
|
);
|
|
2328
2628
|
case "Date | string":
|
|
2329
2629
|
if (typeof t == "string") {
|
|
2330
|
-
if (
|
|
2630
|
+
if (wn(t))
|
|
2331
2631
|
return t;
|
|
2332
2632
|
throw new Error(
|
|
2333
2633
|
`${o}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
|
|
@@ -2354,83 +2654,83 @@ function an(e) {
|
|
|
2354
2654
|
return t;
|
|
2355
2655
|
}
|
|
2356
2656
|
}
|
|
2357
|
-
function
|
|
2358
|
-
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u =
|
|
2657
|
+
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 = Ne(i);
|
|
2359
2659
|
if (!u) {
|
|
2360
|
-
const
|
|
2660
|
+
const g = Object.keys(kt), m = R(i, g, (C) => C), A = m && m.distance <= x ? ` Did you mean '${m.best}'?` : "";
|
|
2361
2661
|
throw new Error(
|
|
2362
|
-
`${a}function: Unknown function '${i}'.${
|
|
2662
|
+
`${a}function: Unknown function '${i}'.${A}`
|
|
2363
2663
|
);
|
|
2364
2664
|
}
|
|
2365
|
-
const c =
|
|
2665
|
+
const c = An(i), p = Fn(i);
|
|
2366
2666
|
if (o.length < c)
|
|
2367
2667
|
throw new Error(
|
|
2368
2668
|
`${a}function: Expected at least ${c} arguments, got ${o.length}`
|
|
2369
2669
|
);
|
|
2370
|
-
if (o.length >
|
|
2670
|
+
if (o.length > p)
|
|
2371
2671
|
throw new Error(
|
|
2372
|
-
`${a}function: Expected at most ${
|
|
2672
|
+
`${a}function: Expected at most ${p} arguments, got ${o.length}`
|
|
2373
2673
|
);
|
|
2374
|
-
const l = [],
|
|
2375
|
-
for (let
|
|
2376
|
-
const
|
|
2377
|
-
if (
|
|
2378
|
-
|
|
2674
|
+
const l = [], d = [];
|
|
2675
|
+
for (let g = 0; g < Math.max(o.length, u.length); g++) {
|
|
2676
|
+
const m = u[`${g}`], A = o[`${g}`], C = a ? `${a}args[${g}]` : `args[${g}]`;
|
|
2677
|
+
if (A === void 0) {
|
|
2678
|
+
m != null && m.required && d.push(`${C}: Missing required argument (expected ${m.type})`);
|
|
2379
2679
|
continue;
|
|
2380
2680
|
}
|
|
2381
|
-
if (!
|
|
2382
|
-
|
|
2681
|
+
if (!m) {
|
|
2682
|
+
d.push(`${C}: Unexpected argument`);
|
|
2383
2683
|
continue;
|
|
2384
2684
|
}
|
|
2385
2685
|
try {
|
|
2386
|
-
const
|
|
2387
|
-
data:
|
|
2686
|
+
const N = Cn({
|
|
2687
|
+
data: A,
|
|
2388
2688
|
context: {
|
|
2389
2689
|
dataSource: r,
|
|
2390
2690
|
schemaIndex: s,
|
|
2391
|
-
pathPrefix:
|
|
2392
|
-
argSchema:
|
|
2691
|
+
pathPrefix: C,
|
|
2692
|
+
argSchema: m
|
|
2393
2693
|
}
|
|
2394
2694
|
});
|
|
2395
|
-
l.push(
|
|
2396
|
-
} catch (
|
|
2397
|
-
const
|
|
2398
|
-
|
|
2695
|
+
l.push(N);
|
|
2696
|
+
} catch (N) {
|
|
2697
|
+
const ue = N instanceof Error ? N.message : "Unknown error";
|
|
2698
|
+
d.push(ue);
|
|
2399
2699
|
}
|
|
2400
2700
|
}
|
|
2401
|
-
if (
|
|
2402
|
-
const
|
|
2403
|
-
throw new Error(
|
|
2701
|
+
if (d.length > 0) {
|
|
2702
|
+
const g = d.join("; ");
|
|
2703
|
+
throw new Error(g);
|
|
2404
2704
|
}
|
|
2405
|
-
const
|
|
2406
|
-
if (
|
|
2705
|
+
const b = bn(i);
|
|
2706
|
+
if (b)
|
|
2407
2707
|
try {
|
|
2408
|
-
|
|
2708
|
+
b(l, {
|
|
2409
2709
|
dataSource: r,
|
|
2410
2710
|
schemaIndex: s,
|
|
2411
2711
|
pathPrefix: a
|
|
2412
2712
|
});
|
|
2413
|
-
} catch (
|
|
2414
|
-
const
|
|
2415
|
-
throw new Error(
|
|
2713
|
+
} catch (g) {
|
|
2714
|
+
const m = g instanceof Error ? g.message : "Unknown validation error";
|
|
2715
|
+
throw new Error(m);
|
|
2416
2716
|
}
|
|
2417
|
-
return
|
|
2717
|
+
return Ps(i, l);
|
|
2418
2718
|
}
|
|
2419
|
-
function
|
|
2719
|
+
function Bt(e) {
|
|
2420
2720
|
const { attribute: t, config: r } = e;
|
|
2421
|
-
if (
|
|
2422
|
-
const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i =
|
|
2423
|
-
return
|
|
2721
|
+
if (Fe(e) && Rr(t)) {
|
|
2722
|
+
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
|
+
return Ir(t, n, o);
|
|
2424
2724
|
}
|
|
2425
2725
|
return e;
|
|
2426
2726
|
}
|
|
2427
|
-
function
|
|
2727
|
+
function Tn(e) {
|
|
2428
2728
|
let t = [];
|
|
2429
2729
|
for (const r of e)
|
|
2430
|
-
|
|
2730
|
+
Z(r) ? t = Ve(r, t) : t = Ve([Bt(r)], t);
|
|
2431
2731
|
return t != null ? t : [];
|
|
2432
2732
|
}
|
|
2433
|
-
const
|
|
2733
|
+
const qn = (e) => {
|
|
2434
2734
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2435
2735
|
return t.forEach((o, a) => {
|
|
2436
2736
|
const u = {
|
|
@@ -2439,19 +2739,19 @@ const cn = (e) => {
|
|
|
2439
2739
|
input: o
|
|
2440
2740
|
};
|
|
2441
2741
|
try {
|
|
2442
|
-
const c =
|
|
2742
|
+
const c = D({
|
|
2443
2743
|
data: o,
|
|
2444
2744
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2445
2745
|
});
|
|
2446
|
-
!
|
|
2746
|
+
!Z(c) && !oe(c) ? i.push(F(y({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2447
2747
|
} catch (c) {
|
|
2448
|
-
const
|
|
2449
|
-
i.push(F(
|
|
2748
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2749
|
+
i.push(F(y({}, u), { message: p }));
|
|
2450
2750
|
}
|
|
2451
|
-
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data:
|
|
2452
|
-
},
|
|
2751
|
+
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: Tn(n) };
|
|
2752
|
+
}, Re = (e) => {
|
|
2453
2753
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2454
|
-
return t ?
|
|
2754
|
+
return t ? Ct(t) ? qn({
|
|
2455
2755
|
data: t,
|
|
2456
2756
|
context: { dataSource: r, schemaIndex: s }
|
|
2457
2757
|
}) : {
|
|
@@ -2465,7 +2765,7 @@ const cn = (e) => {
|
|
|
2465
2765
|
}
|
|
2466
2766
|
]
|
|
2467
2767
|
} : { success: !0, data: [] };
|
|
2468
|
-
},
|
|
2768
|
+
}, xn = (e) => {
|
|
2469
2769
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2470
2770
|
return t.forEach((o, a) => {
|
|
2471
2771
|
const u = {
|
|
@@ -2474,19 +2774,19 @@ const cn = (e) => {
|
|
|
2474
2774
|
input: o
|
|
2475
2775
|
};
|
|
2476
2776
|
try {
|
|
2477
|
-
const c =
|
|
2777
|
+
const c = D({
|
|
2478
2778
|
data: o,
|
|
2479
2779
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2480
2780
|
});
|
|
2481
|
-
|
|
2781
|
+
oe(c) ? n.push(Bt(c)) : i.push(F(y({}, u), { message: "Invalid filter JSON" }));
|
|
2482
2782
|
} catch (c) {
|
|
2483
|
-
const
|
|
2484
|
-
i.push(F(
|
|
2783
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2784
|
+
i.push(F(y({}, u), { message: p }));
|
|
2485
2785
|
}
|
|
2486
2786
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2487
|
-
},
|
|
2787
|
+
}, ve = (e) => {
|
|
2488
2788
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2489
|
-
return t ?
|
|
2789
|
+
return t ? Ct(t) ? xn({
|
|
2490
2790
|
data: t,
|
|
2491
2791
|
context: { dataSource: r, schemaIndex: s }
|
|
2492
2792
|
}) : {
|
|
@@ -2500,51 +2800,51 @@ const cn = (e) => {
|
|
|
2500
2800
|
}
|
|
2501
2801
|
]
|
|
2502
2802
|
} : { success: !0, data: [] };
|
|
2503
|
-
},
|
|
2504
|
-
if (e && !
|
|
2505
|
-
return F(
|
|
2803
|
+
}, $n = (e, t) => {
|
|
2804
|
+
if (e && !se(e))
|
|
2805
|
+
return F(y({}, t), {
|
|
2506
2806
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
|
|
2507
2807
|
});
|
|
2508
|
-
},
|
|
2808
|
+
}, Sn = (e, t, r) => {
|
|
2509
2809
|
const { dataSource: s, schemaIndex: n } = t;
|
|
2510
2810
|
try {
|
|
2511
|
-
const i =
|
|
2811
|
+
const i = D({
|
|
2512
2812
|
data: e,
|
|
2513
2813
|
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2514
2814
|
});
|
|
2515
|
-
return
|
|
2815
|
+
return xe(i) ? { success: !0, data: i } : {
|
|
2516
2816
|
success: !1,
|
|
2517
|
-
errors: [F(
|
|
2817
|
+
errors: [F(y({}, r), { message: "Invalid measure JSON" })]
|
|
2518
2818
|
};
|
|
2519
2819
|
} catch (i) {
|
|
2520
2820
|
const o = i instanceof Error ? i.message : "Unknown error";
|
|
2521
2821
|
return {
|
|
2522
2822
|
success: !1,
|
|
2523
|
-
errors: [F(
|
|
2823
|
+
errors: [F(y({}, r), { message: o })]
|
|
2524
2824
|
};
|
|
2525
2825
|
}
|
|
2526
|
-
},
|
|
2527
|
-
const n =
|
|
2826
|
+
}, On = (e, t, r, s) => {
|
|
2827
|
+
const n = D({
|
|
2528
2828
|
data: e.column,
|
|
2529
2829
|
context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
|
|
2530
2830
|
});
|
|
2531
|
-
if (!
|
|
2831
|
+
if (!xe(n))
|
|
2532
2832
|
return {
|
|
2533
2833
|
style: {},
|
|
2534
|
-
error: F(
|
|
2834
|
+
error: F(y({}, s), { message: "Invalid measure JSON" })
|
|
2535
2835
|
};
|
|
2536
|
-
const i =
|
|
2836
|
+
const i = $n(e.sortType, s);
|
|
2537
2837
|
if (i) {
|
|
2538
2838
|
const a = _(e, "column");
|
|
2539
2839
|
return { measure: n, style: a, error: i };
|
|
2540
2840
|
}
|
|
2541
2841
|
const o = _(e, "column");
|
|
2542
2842
|
return { measure: n, style: o };
|
|
2543
|
-
},
|
|
2544
|
-
if (
|
|
2545
|
-
return
|
|
2546
|
-
if (
|
|
2547
|
-
const n =
|
|
2843
|
+
}, Dn = (e, t, r, s) => {
|
|
2844
|
+
if ($s(e))
|
|
2845
|
+
return On(e, t, r, s);
|
|
2846
|
+
if (q(e)) {
|
|
2847
|
+
const n = Sn(
|
|
2548
2848
|
e,
|
|
2549
2849
|
{ dataSource: t, schemaIndex: r },
|
|
2550
2850
|
s
|
|
@@ -2552,11 +2852,11 @@ const cn = (e) => {
|
|
|
2552
2852
|
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2553
2853
|
}
|
|
2554
2854
|
return {
|
|
2555
|
-
error: F(
|
|
2855
|
+
error: F(y({}, s), {
|
|
2556
2856
|
message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
|
|
2557
2857
|
})
|
|
2558
2858
|
};
|
|
2559
|
-
},
|
|
2859
|
+
}, zt = (e) => {
|
|
2560
2860
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2561
2861
|
if (!t)
|
|
2562
2862
|
return { success: !0, data: [] };
|
|
@@ -2580,7 +2880,7 @@ const cn = (e) => {
|
|
|
2580
2880
|
input: o
|
|
2581
2881
|
};
|
|
2582
2882
|
try {
|
|
2583
|
-
const c =
|
|
2883
|
+
const c = Dn(o, r, s, u);
|
|
2584
2884
|
if (c.error) {
|
|
2585
2885
|
i.push(c.error);
|
|
2586
2886
|
return;
|
|
@@ -2589,8 +2889,8 @@ const cn = (e) => {
|
|
|
2589
2889
|
c.style !== void 0 ? { measure: c.measure, style: c.style } : { measure: c.measure }
|
|
2590
2890
|
);
|
|
2591
2891
|
} catch (c) {
|
|
2592
|
-
const
|
|
2593
|
-
i.push(F(
|
|
2892
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2893
|
+
i.push(F(y({}, u), { message: p }));
|
|
2594
2894
|
}
|
|
2595
2895
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2596
2896
|
};
|
|
@@ -2607,55 +2907,55 @@ function w(e, t, r) {
|
|
|
2607
2907
|
}
|
|
2608
2908
|
return s.data;
|
|
2609
2909
|
}
|
|
2610
|
-
const
|
|
2611
|
-
function
|
|
2910
|
+
const Ie = "$trend", Pe = "$forecast";
|
|
2911
|
+
function Mn(e) {
|
|
2612
2912
|
return e.map(({ attribute: t, style: r }) => {
|
|
2613
2913
|
const s = r == null ? void 0 : r.sortType;
|
|
2614
2914
|
if (!s) return t;
|
|
2615
2915
|
const n = typeof s == "object" ? s.direction : s;
|
|
2616
|
-
return
|
|
2916
|
+
return se(n) ? t.sort(ne(n)) : t;
|
|
2617
2917
|
});
|
|
2618
2918
|
}
|
|
2619
|
-
function
|
|
2919
|
+
function Nn(e) {
|
|
2620
2920
|
var t, r;
|
|
2621
2921
|
return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1;
|
|
2622
2922
|
}
|
|
2623
|
-
function
|
|
2923
|
+
function Rn(e) {
|
|
2624
2924
|
var t, r;
|
|
2625
2925
|
return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1;
|
|
2626
2926
|
}
|
|
2627
|
-
function
|
|
2927
|
+
function vn(e) {
|
|
2628
2928
|
var r, s;
|
|
2629
2929
|
const t = [];
|
|
2630
2930
|
for (const { measure: n, style: i } of e) {
|
|
2631
|
-
const o = i == null ? void 0 : i.sortType, a = o &&
|
|
2632
|
-
t.push(a), i != null && i.trend && !
|
|
2633
|
-
|
|
2634
|
-
), i != null && i.forecast && !
|
|
2635
|
-
|
|
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(
|
|
2636
2936
|
n,
|
|
2637
|
-
`${
|
|
2937
|
+
`${Pe}_${(s = n.name) != null ? s : "Measure"}`,
|
|
2638
2938
|
i.forecast
|
|
2639
2939
|
)
|
|
2640
2940
|
);
|
|
2641
2941
|
}
|
|
2642
2942
|
return t;
|
|
2643
2943
|
}
|
|
2644
|
-
const
|
|
2645
|
-
const { data: t } = e, { dataSource: r, tables: s } = e.context, n =
|
|
2646
|
-
() =>
|
|
2944
|
+
const ii = (e) => {
|
|
2945
|
+
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = $e(s), i = [], o = w(
|
|
2946
|
+
() => qt({
|
|
2647
2947
|
data: t.dimensions || [],
|
|
2648
2948
|
context: { dataSource: r, schemaIndex: n }
|
|
2649
2949
|
}),
|
|
2650
2950
|
i
|
|
2651
2951
|
), a = w(
|
|
2652
|
-
() =>
|
|
2952
|
+
() => zt({
|
|
2653
2953
|
data: t.measures || [],
|
|
2654
2954
|
context: { dataSource: r, schemaIndex: n }
|
|
2655
2955
|
}),
|
|
2656
2956
|
i
|
|
2657
2957
|
), u = w(
|
|
2658
|
-
() =>
|
|
2958
|
+
() => Re({
|
|
2659
2959
|
data: t.filters || [],
|
|
2660
2960
|
context: { dataSource: r, schemaIndex: n }
|
|
2661
2961
|
}),
|
|
@@ -2663,7 +2963,7 @@ const Jn = (e) => {
|
|
|
2663
2963
|
);
|
|
2664
2964
|
let c = null;
|
|
2665
2965
|
return t.highlights && (c = w(
|
|
2666
|
-
() =>
|
|
2966
|
+
() => ve({
|
|
2667
2967
|
data: t.highlights || [],
|
|
2668
2968
|
context: { dataSource: r, schemaIndex: n }
|
|
2669
2969
|
}),
|
|
@@ -2673,22 +2973,22 @@ const Jn = (e) => {
|
|
|
2673
2973
|
errors: i
|
|
2674
2974
|
} : {
|
|
2675
2975
|
success: !0,
|
|
2676
|
-
data:
|
|
2677
|
-
dataSource:
|
|
2678
|
-
dimensions: o ?
|
|
2679
|
-
measures: a ?
|
|
2976
|
+
data: y({
|
|
2977
|
+
dataSource: we(r),
|
|
2978
|
+
dimensions: o ? Mn(o) : [],
|
|
2979
|
+
measures: a ? vn(a) : [],
|
|
2680
2980
|
filters: u || []
|
|
2681
2981
|
}, c && { highlights: c })
|
|
2682
2982
|
};
|
|
2683
2983
|
};
|
|
2684
|
-
function
|
|
2984
|
+
function Qe(e) {
|
|
2685
2985
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2686
2986
|
}
|
|
2687
|
-
function
|
|
2987
|
+
function ke(e) {
|
|
2688
2988
|
const t = [], r = [];
|
|
2689
2989
|
return e.forEach((s, n) => {
|
|
2690
|
-
var l,
|
|
2691
|
-
const i =
|
|
2990
|
+
var l, d, b;
|
|
2991
|
+
const i = Qe(s) ? s.column : s, o = Qe(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
|
|
2692
2992
|
if (!i.composeCode) {
|
|
2693
2993
|
r.push({
|
|
2694
2994
|
category: "dimensions",
|
|
@@ -2698,145 +2998,31 @@ function Re(e) {
|
|
|
2698
2998
|
});
|
|
2699
2999
|
return;
|
|
2700
3000
|
}
|
|
2701
|
-
if (!i.composeCode.startsWith(
|
|
3001
|
+
if (!i.composeCode.startsWith(E)) {
|
|
2702
3002
|
r.push({
|
|
2703
3003
|
category: "dimensions",
|
|
2704
3004
|
index: n,
|
|
2705
3005
|
input: a(),
|
|
2706
|
-
message: `Expected composeCode to start with '${
|
|
3006
|
+
message: `Expected composeCode to start with '${E}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
|
|
2707
3007
|
});
|
|
2708
3008
|
return;
|
|
2709
3009
|
}
|
|
2710
|
-
const u = (
|
|
3010
|
+
const u = (b = o != null && o.sortType ? ne(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") : {};
|
|
2711
3011
|
if (u !== void 0 && u !== B.None || o && Object.keys(c).length > 0) {
|
|
2712
|
-
const
|
|
3012
|
+
const g = y(y({
|
|
2713
3013
|
column: i.composeCode
|
|
2714
|
-
}, u !== void 0 && u !== B.None && { sortType:
|
|
2715
|
-
t.push(
|
|
3014
|
+
}, u !== void 0 && u !== B.None && { sortType: it(u) }), c);
|
|
3015
|
+
t.push(g);
|
|
2716
3016
|
} else
|
|
2717
3017
|
t.push(i.composeCode);
|
|
2718
3018
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2719
3019
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
let s = "", n = 0, i = !1, o = null;
|
|
2723
|
-
for (let a = 0; a < e.length; a++) {
|
|
2724
|
-
const u = e[a], c = e[a + 1];
|
|
2725
|
-
if (i) {
|
|
2726
|
-
if (u !== o) {
|
|
2727
|
-
s += u;
|
|
2728
|
-
continue;
|
|
2729
|
-
}
|
|
2730
|
-
if (c === o) {
|
|
2731
|
-
s += u + c, a++;
|
|
2732
|
-
continue;
|
|
2733
|
-
}
|
|
2734
|
-
i = !1, o = null, s += u;
|
|
2735
|
-
continue;
|
|
2736
|
-
} else {
|
|
2737
|
-
if (u === "'" || u === '"') {
|
|
2738
|
-
i = !0, o = u, s += u;
|
|
2739
|
-
continue;
|
|
2740
|
-
}
|
|
2741
|
-
if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
|
|
2742
|
-
r.push(s.trim()), s = "";
|
|
2743
|
-
continue;
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
s += u;
|
|
2747
|
-
}
|
|
2748
|
-
return s.trim() && r.push(s.trim()), r;
|
|
2749
|
-
}
|
|
2750
|
-
function Fn(e, t) {
|
|
2751
|
-
let r = 0, s = !1, n = null;
|
|
2752
|
-
for (let i = 0; i < e.length; i++) {
|
|
2753
|
-
const o = e[i], a = e[i + 1];
|
|
2754
|
-
if (s) {
|
|
2755
|
-
if (o !== n) continue;
|
|
2756
|
-
if (a === n) {
|
|
2757
|
-
i++;
|
|
2758
|
-
continue;
|
|
2759
|
-
}
|
|
2760
|
-
s = !1, n = null;
|
|
2761
|
-
} else {
|
|
2762
|
-
if (o === "'" || o === '"') {
|
|
2763
|
-
s = !0, n = o;
|
|
2764
|
-
continue;
|
|
2765
|
-
}
|
|
2766
|
-
if ("([{".includes(o) && r++, ")]}".includes(o) && r--, o === t && r === 0) return i;
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
return -1;
|
|
2770
|
-
}
|
|
2771
|
-
function wn(e) {
|
|
2772
|
-
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
2773
|
-
}
|
|
2774
|
-
function V(e) {
|
|
2775
|
-
if (!e || typeof e != "string")
|
|
2776
|
-
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
2777
|
-
const t = e.trim();
|
|
2778
|
-
if (!t)
|
|
2779
|
-
throw new Error("Invalid composeCode: empty string");
|
|
2780
|
-
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
2781
|
-
if (!r)
|
|
2782
|
-
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
2783
|
-
const s = r[1], n = r[2], i = Nt(n);
|
|
2784
|
-
return {
|
|
2785
|
-
function: s,
|
|
2786
|
-
args: i
|
|
2787
|
-
};
|
|
2788
|
-
}
|
|
2789
|
-
function Nt(e) {
|
|
2790
|
-
return e.trim() ? vt(e, ",").map(Rt) : [];
|
|
2791
|
-
}
|
|
2792
|
-
function Rt(e) {
|
|
2793
|
-
if (!e)
|
|
2794
|
-
throw new Error("Cannot parse empty argument value");
|
|
2795
|
-
if (e === "null")
|
|
2796
|
-
return null;
|
|
2797
|
-
if (e === "undefined")
|
|
2798
|
-
return;
|
|
2799
|
-
if (e === "true")
|
|
2800
|
-
return !0;
|
|
2801
|
-
if (e === "false")
|
|
2802
|
-
return !1;
|
|
2803
|
-
if (e.match(/^-?\d+(\.\d+)?$/))
|
|
2804
|
-
return parseFloat(e);
|
|
2805
|
-
if (e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"')) {
|
|
2806
|
-
const r = e[0];
|
|
2807
|
-
return e.slice(1, -1).replace(new RegExp(`${r}${r}`, "g"), r);
|
|
2808
|
-
}
|
|
2809
|
-
if (e.startsWith("[") && e.endsWith("]")) {
|
|
2810
|
-
const r = e.slice(1, -1).trim();
|
|
2811
|
-
if (!r)
|
|
2812
|
-
return [];
|
|
2813
|
-
const s = Nt(r);
|
|
2814
|
-
return s.every((n) => typeof n == "string"), s;
|
|
2815
|
-
}
|
|
2816
|
-
if (e.startsWith("{") && e.endsWith("}")) {
|
|
2817
|
-
const r = e.slice(1, -1).trim();
|
|
2818
|
-
return r ? An(r) : {};
|
|
2819
|
-
}
|
|
2820
|
-
return e.includes("(") && e.includes(")") ? V(e) : (e.startsWith("DM."), e);
|
|
2821
|
-
}
|
|
2822
|
-
function qn(e) {
|
|
2823
|
-
const t = Fn(e, ":");
|
|
2824
|
-
if (t === -1)
|
|
2825
|
-
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
2826
|
-
const r = wn(e.slice(0, t).trim()), s = Rt(e.slice(t + 1).trim());
|
|
2827
|
-
return [r, s];
|
|
2828
|
-
}
|
|
2829
|
-
function An(e) {
|
|
2830
|
-
if (!e.trim()) return {};
|
|
2831
|
-
const t = vt(e, ",").map(qn).filter(([, r]) => r !== null);
|
|
2832
|
-
return Object.fromEntries(t);
|
|
2833
|
-
}
|
|
2834
|
-
const ge = "Unknown error";
|
|
2835
|
-
function Ie(e) {
|
|
3020
|
+
const be = "Unknown error";
|
|
3021
|
+
function Be(e) {
|
|
2836
3022
|
if (!e)
|
|
2837
3023
|
return { success: !0, data: [] };
|
|
2838
3024
|
const t = [];
|
|
2839
|
-
if (
|
|
3025
|
+
if (Br(e)) {
|
|
2840
3026
|
if (!e.composeCode)
|
|
2841
3027
|
return {
|
|
2842
3028
|
success: !1,
|
|
@@ -2850,9 +3036,9 @@ function Ie(e) {
|
|
|
2850
3036
|
]
|
|
2851
3037
|
};
|
|
2852
3038
|
try {
|
|
2853
|
-
return { success: !0, data: [
|
|
3039
|
+
return { success: !0, data: [W(e.composeCode)] };
|
|
2854
3040
|
} catch (s) {
|
|
2855
|
-
const n = s instanceof Error ? s.message :
|
|
3041
|
+
const n = s instanceof Error ? s.message : be;
|
|
2856
3042
|
return {
|
|
2857
3043
|
success: !1,
|
|
2858
3044
|
errors: [
|
|
@@ -2879,10 +3065,10 @@ function Ie(e) {
|
|
|
2879
3065
|
return;
|
|
2880
3066
|
}
|
|
2881
3067
|
try {
|
|
2882
|
-
const o =
|
|
3068
|
+
const o = W(s.composeCode);
|
|
2883
3069
|
r.push(o);
|
|
2884
3070
|
} catch (o) {
|
|
2885
|
-
const a = o instanceof Error ? o.message :
|
|
3071
|
+
const a = o instanceof Error ? o.message : be;
|
|
2886
3072
|
t.push({
|
|
2887
3073
|
category: "filters",
|
|
2888
3074
|
index: n,
|
|
@@ -2892,7 +3078,7 @@ function Ie(e) {
|
|
|
2892
3078
|
}
|
|
2893
3079
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2894
3080
|
}
|
|
2895
|
-
function
|
|
3081
|
+
function ze(e) {
|
|
2896
3082
|
if (!e)
|
|
2897
3083
|
return { success: !0, data: [] };
|
|
2898
3084
|
const t = [], r = [];
|
|
@@ -2908,10 +3094,10 @@ function ke(e) {
|
|
|
2908
3094
|
return;
|
|
2909
3095
|
}
|
|
2910
3096
|
try {
|
|
2911
|
-
const o =
|
|
3097
|
+
const o = W(s.composeCode);
|
|
2912
3098
|
t.push(o);
|
|
2913
3099
|
} catch (o) {
|
|
2914
|
-
const a = o instanceof Error ? o.message :
|
|
3100
|
+
const a = o instanceof Error ? o.message : be;
|
|
2915
3101
|
r.push({
|
|
2916
3102
|
category: "highlights",
|
|
2917
3103
|
index: n,
|
|
@@ -2921,14 +3107,14 @@ function ke(e) {
|
|
|
2921
3107
|
}
|
|
2922
3108
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2923
3109
|
}
|
|
2924
|
-
function
|
|
3110
|
+
function Xe(e) {
|
|
2925
3111
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2926
3112
|
}
|
|
2927
|
-
function
|
|
3113
|
+
function Le(e) {
|
|
2928
3114
|
const t = [], r = [];
|
|
2929
3115
|
return e.forEach((s, n) => {
|
|
2930
|
-
var u, c,
|
|
2931
|
-
const i =
|
|
3116
|
+
var u, c, p;
|
|
3117
|
+
const i = Xe(s) ? s.column : s, o = Xe(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
|
|
2932
3118
|
if (!i.composeCode) {
|
|
2933
3119
|
r.push({
|
|
2934
3120
|
category: "measures",
|
|
@@ -2939,89 +3125,89 @@ function Be(e) {
|
|
|
2939
3125
|
return;
|
|
2940
3126
|
}
|
|
2941
3127
|
try {
|
|
2942
|
-
const l =
|
|
2943
|
-
if (
|
|
2944
|
-
const
|
|
3128
|
+
const l = W(i.composeCode), d = (p = o != null && o.sortType ? ne(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
|
+
if (d !== void 0 && d !== B.None || o && Object.keys(_(o, "column")).length > 0) {
|
|
3130
|
+
const g = o ? _(o, "column") : {}, m = y(y({
|
|
2945
3131
|
column: l
|
|
2946
|
-
},
|
|
2947
|
-
t.push(
|
|
3132
|
+
}, d !== void 0 && d !== B.None && { sortType: it(d) }), g);
|
|
3133
|
+
t.push(m);
|
|
2948
3134
|
} else
|
|
2949
3135
|
t.push(l);
|
|
2950
3136
|
} catch (l) {
|
|
2951
|
-
const
|
|
3137
|
+
const d = l instanceof Error ? l.message : "Unknown error";
|
|
2952
3138
|
r.push({
|
|
2953
3139
|
category: "measures",
|
|
2954
3140
|
index: n,
|
|
2955
3141
|
input: a(),
|
|
2956
|
-
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${
|
|
3142
|
+
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${d}. ComposeCode: '${i.composeCode}'`
|
|
2957
3143
|
});
|
|
2958
3144
|
}
|
|
2959
3145
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2960
3146
|
}
|
|
2961
|
-
function
|
|
3147
|
+
function Ze(e) {
|
|
2962
3148
|
var t, r, s, n;
|
|
2963
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
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(Ie)) != null ? n : !1);
|
|
2964
3150
|
}
|
|
2965
|
-
function
|
|
3151
|
+
function et(e) {
|
|
2966
3152
|
var t, r, s, n;
|
|
2967
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
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(Pe)) != null ? n : !1);
|
|
2968
3154
|
}
|
|
2969
|
-
function
|
|
3155
|
+
function tt(e) {
|
|
2970
3156
|
try {
|
|
2971
|
-
const t =
|
|
3157
|
+
const t = W(e.trim());
|
|
2972
3158
|
return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
|
|
2973
3159
|
} catch (t) {
|
|
2974
3160
|
return;
|
|
2975
3161
|
}
|
|
2976
3162
|
}
|
|
2977
|
-
function
|
|
3163
|
+
function In(e) {
|
|
2978
3164
|
var s, n, i;
|
|
2979
3165
|
if (!(e != null && e.length)) return [];
|
|
2980
3166
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
2981
3167
|
for (let o = 0; o < e.length; o++) {
|
|
2982
3168
|
if (t.has(o)) continue;
|
|
2983
3169
|
const a = e[o];
|
|
2984
|
-
if (
|
|
3170
|
+
if (Ze(a) || et(a)) {
|
|
2985
3171
|
r.push(a);
|
|
2986
3172
|
continue;
|
|
2987
3173
|
}
|
|
2988
|
-
const u = (s = a.name) != null ? s : "Measure", c = `${
|
|
2989
|
-
let l,
|
|
2990
|
-
if (
|
|
2991
|
-
const
|
|
2992
|
-
|
|
3174
|
+
const u = (s = a.name) != null ? s : "Measure", c = `${Ie}_${u}`, p = `${Pe}_${u}`;
|
|
3175
|
+
let l, d, b = o + 1;
|
|
3176
|
+
if (b < e.length && !t.has(b) && Ze(e[b]) && e[b].name === c) {
|
|
3177
|
+
const g = (n = e[b].composeCode) == null ? void 0 : n.trim();
|
|
3178
|
+
g && (l = tt(g), t.add(b), b++);
|
|
2993
3179
|
}
|
|
2994
|
-
if (
|
|
2995
|
-
const
|
|
2996
|
-
|
|
3180
|
+
if (b < e.length && !t.has(b) && et(e[b]) && e[b].name === p) {
|
|
3181
|
+
const g = (i = e[b].composeCode) == null ? void 0 : i.trim();
|
|
3182
|
+
g && (d = tt(g), t.add(b));
|
|
2997
3183
|
}
|
|
2998
|
-
l !== void 0 ||
|
|
3184
|
+
l !== void 0 || d !== void 0 ? r.push(y(y({
|
|
2999
3185
|
column: a
|
|
3000
|
-
}, l && Object.keys(l).length > 0 && { trend: l }),
|
|
3186
|
+
}, l && Object.keys(l).length > 0 && { trend: l }), d && Object.keys(d).length > 0 && { forecast: d })) : r.push(a);
|
|
3001
3187
|
}
|
|
3002
3188
|
return r;
|
|
3003
3189
|
}
|
|
3004
|
-
function
|
|
3190
|
+
function oi(e) {
|
|
3005
3191
|
const t = [], r = w(
|
|
3006
|
-
() =>
|
|
3192
|
+
() => ke(e.dimensions || []),
|
|
3007
3193
|
t
|
|
3008
|
-
), s =
|
|
3009
|
-
() =>
|
|
3194
|
+
), s = In(e.measures || []), n = w(
|
|
3195
|
+
() => Le(s),
|
|
3010
3196
|
t
|
|
3011
3197
|
), i = w(
|
|
3012
|
-
() =>
|
|
3198
|
+
() => Be(e.filters),
|
|
3013
3199
|
t
|
|
3014
3200
|
);
|
|
3015
3201
|
let o = null;
|
|
3016
3202
|
if (e.highlights && e.highlights.length > 0 && (o = w(
|
|
3017
|
-
() =>
|
|
3203
|
+
() => ze(e.highlights),
|
|
3018
3204
|
t
|
|
3019
3205
|
)), t.length > 0)
|
|
3020
3206
|
return {
|
|
3021
3207
|
success: !1,
|
|
3022
3208
|
errors: t
|
|
3023
3209
|
};
|
|
3024
|
-
const a =
|
|
3210
|
+
const a = y({
|
|
3025
3211
|
dimensions: r || [],
|
|
3026
3212
|
measures: n || [],
|
|
3027
3213
|
filters: i || []
|
|
@@ -3032,9 +3218,9 @@ function Yn(e) {
|
|
|
3032
3218
|
data: Q(a)
|
|
3033
3219
|
};
|
|
3034
3220
|
}
|
|
3035
|
-
const
|
|
3036
|
-
|
|
3037
|
-
),
|
|
3221
|
+
const Lt = new Set(
|
|
3222
|
+
zr.filter((e) => e !== "image")
|
|
3223
|
+
), rt = Object.freeze([...Lt]), me = /* @__PURE__ */ new Set([
|
|
3038
3224
|
"category",
|
|
3039
3225
|
"value",
|
|
3040
3226
|
"breakBy",
|
|
@@ -3057,7 +3243,7 @@ const It = new Set(
|
|
|
3057
3243
|
"min",
|
|
3058
3244
|
"max",
|
|
3059
3245
|
"seriesToColorMap"
|
|
3060
|
-
]),
|
|
3246
|
+
]), Pn = {
|
|
3061
3247
|
line: {
|
|
3062
3248
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3063
3249
|
requiredAxes: ["category", "value"]
|
|
@@ -3130,7 +3316,7 @@ const It = new Set(
|
|
|
3130
3316
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3131
3317
|
requiredAxes: ["category", "value"]
|
|
3132
3318
|
}
|
|
3133
|
-
},
|
|
3319
|
+
}, kn = /* @__PURE__ */ new Set([
|
|
3134
3320
|
"category",
|
|
3135
3321
|
"breakBy",
|
|
3136
3322
|
"breakByPoint",
|
|
@@ -3138,7 +3324,7 @@ const It = new Set(
|
|
|
3138
3324
|
"geo",
|
|
3139
3325
|
"details",
|
|
3140
3326
|
"date"
|
|
3141
|
-
]),
|
|
3327
|
+
]), Bn = /* @__PURE__ */ new Set([
|
|
3142
3328
|
"value",
|
|
3143
3329
|
"size",
|
|
3144
3330
|
"colorBy",
|
|
@@ -3150,34 +3336,34 @@ const It = new Set(
|
|
|
3150
3336
|
"max",
|
|
3151
3337
|
"color"
|
|
3152
3338
|
]);
|
|
3153
|
-
function
|
|
3154
|
-
const t =
|
|
3339
|
+
function zn(e) {
|
|
3340
|
+
const t = Pn[e];
|
|
3155
3341
|
if (t)
|
|
3156
3342
|
return {
|
|
3157
3343
|
validAxes: new Set(t.validAxes),
|
|
3158
3344
|
requiredAxes: Object.freeze([...t.requiredAxes])
|
|
3159
3345
|
};
|
|
3160
3346
|
}
|
|
3161
|
-
function
|
|
3162
|
-
return typeof e == "string" &&
|
|
3347
|
+
function Ut(e) {
|
|
3348
|
+
return typeof e == "string" && Lt.has(e);
|
|
3163
3349
|
}
|
|
3164
|
-
function
|
|
3165
|
-
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" ||
|
|
3350
|
+
function Ln(e, t, r) {
|
|
3351
|
+
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || kn.has(e))
|
|
3166
3352
|
return !0;
|
|
3167
|
-
if (
|
|
3353
|
+
if (Bn.has(e))
|
|
3168
3354
|
return !1;
|
|
3169
3355
|
const s = Array.isArray(t) ? t[0] : t;
|
|
3170
3356
|
if (!s)
|
|
3171
3357
|
return !0;
|
|
3172
3358
|
let n;
|
|
3173
|
-
return
|
|
3359
|
+
return S(s) && "column" in s && (n = s.column), !(q(s) || n !== void 0 && q(n));
|
|
3174
3360
|
}
|
|
3175
|
-
function
|
|
3361
|
+
function Un(e) {
|
|
3176
3362
|
const t = [], r = {
|
|
3177
3363
|
chartType: "",
|
|
3178
3364
|
dataOptions: {}
|
|
3179
3365
|
};
|
|
3180
|
-
if (!
|
|
3366
|
+
if (!S(e))
|
|
3181
3367
|
return t.push({
|
|
3182
3368
|
category: "chartType",
|
|
3183
3369
|
index: -1,
|
|
@@ -3186,17 +3372,17 @@ function Sn(e) {
|
|
|
3186
3372
|
}), { normalized: r, errors: t };
|
|
3187
3373
|
const s = e.chartType;
|
|
3188
3374
|
if (s === void 0) {
|
|
3189
|
-
const i = Object.keys(e), o =
|
|
3375
|
+
const i = Object.keys(e), o = R("chartType", i, (c) => c), a = o && o.distance <= x ? ` Did you mean 'chartType'? (You may have typed '${o.best}')` : "", u = o && o.distance <= x ? { [o.best]: e[o.best] } : e;
|
|
3190
3376
|
t.push({
|
|
3191
3377
|
category: "chartType",
|
|
3192
3378
|
index: -1,
|
|
3193
3379
|
input: u,
|
|
3194
3380
|
message: `chartType is required.${a}`
|
|
3195
3381
|
});
|
|
3196
|
-
} else if (
|
|
3382
|
+
} else if (Ut(s))
|
|
3197
3383
|
r.chartType = s;
|
|
3198
3384
|
else {
|
|
3199
|
-
const i =
|
|
3385
|
+
const i = R(String(s), rt, (u) => u), o = i && i.distance <= x ? ` Did you mean '${i.best}'?` : "", a = rt.slice(0, 8).join(", ");
|
|
3200
3386
|
t.push({
|
|
3201
3387
|
category: "chartType",
|
|
3202
3388
|
index: -1,
|
|
@@ -3206,7 +3392,7 @@ function Sn(e) {
|
|
|
3206
3392
|
}
|
|
3207
3393
|
const n = e.dataOptions;
|
|
3208
3394
|
if (n === void 0) {
|
|
3209
|
-
const i = Object.keys(e), o =
|
|
3395
|
+
const i = Object.keys(e), o = R("dataOptions", i, (c) => c), a = o && o.distance <= x ? ` Did you mean 'dataOptions'? (You may have typed '${o.best}')` : "", u = o && o.distance <= x ? { [o.best]: e[o.best] } : e;
|
|
3210
3396
|
t.push({
|
|
3211
3397
|
category: "dataOptions",
|
|
3212
3398
|
index: -1,
|
|
@@ -3216,86 +3402,86 @@ function Sn(e) {
|
|
|
3216
3402
|
} else n !== null && typeof n == "object" && (r.dataOptions = n);
|
|
3217
3403
|
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 };
|
|
3218
3404
|
}
|
|
3219
|
-
function
|
|
3405
|
+
function _n(e) {
|
|
3220
3406
|
return e.map(
|
|
3221
|
-
({ attribute: t, style: r }) => r ?
|
|
3407
|
+
({ attribute: t, style: r }) => r ? y({ column: t }, r) : t
|
|
3222
3408
|
);
|
|
3223
3409
|
}
|
|
3224
|
-
function
|
|
3410
|
+
function Vn(e) {
|
|
3225
3411
|
return e.map(
|
|
3226
|
-
({ measure: t, style: r }) => r ?
|
|
3412
|
+
({ measure: t, style: r }) => r ? y({ column: t }, r) : t
|
|
3227
3413
|
);
|
|
3228
3414
|
}
|
|
3229
|
-
function
|
|
3415
|
+
function _t(e) {
|
|
3230
3416
|
return Array.isArray(e) ? e : [e];
|
|
3231
3417
|
}
|
|
3232
|
-
function
|
|
3233
|
-
return (t) => F(
|
|
3418
|
+
function Ae(e) {
|
|
3419
|
+
return (t) => F(y({}, t), {
|
|
3234
3420
|
category: "dataOptions",
|
|
3235
3421
|
index: e
|
|
3236
3422
|
});
|
|
3237
3423
|
}
|
|
3238
|
-
function
|
|
3239
|
-
const i = t ?
|
|
3424
|
+
function re(e, t, r, s, n) {
|
|
3425
|
+
const i = t ? _t(
|
|
3240
3426
|
t
|
|
3241
3427
|
) : [];
|
|
3242
3428
|
if (i.length === 0)
|
|
3243
3429
|
return [];
|
|
3244
3430
|
if (r === "dimension") {
|
|
3245
3431
|
const a = w(
|
|
3246
|
-
() =>
|
|
3432
|
+
() => qt({
|
|
3247
3433
|
data: i,
|
|
3248
3434
|
context: s
|
|
3249
3435
|
}),
|
|
3250
3436
|
n,
|
|
3251
|
-
|
|
3437
|
+
Ae(e)
|
|
3252
3438
|
);
|
|
3253
|
-
return a !== null ?
|
|
3439
|
+
return a !== null ? _n(a) : null;
|
|
3254
3440
|
}
|
|
3255
3441
|
const o = w(
|
|
3256
|
-
() =>
|
|
3442
|
+
() => zt({
|
|
3257
3443
|
data: i,
|
|
3258
3444
|
context: s
|
|
3259
3445
|
}),
|
|
3260
3446
|
n,
|
|
3261
|
-
|
|
3447
|
+
Ae(e)
|
|
3262
3448
|
);
|
|
3263
|
-
return o !== null ?
|
|
3449
|
+
return o !== null ? Vn(o) : null;
|
|
3264
3450
|
}
|
|
3265
|
-
function
|
|
3451
|
+
function st(e, t, r) {
|
|
3266
3452
|
const s = Array.isArray(t) ? t : t != null ? [t] : [];
|
|
3267
3453
|
if (r === "dimension") {
|
|
3268
|
-
const i =
|
|
3454
|
+
const i = ke(
|
|
3269
3455
|
s
|
|
3270
3456
|
);
|
|
3271
3457
|
return i.success ? { success: !0, data: i.data } : {
|
|
3272
3458
|
success: !1,
|
|
3273
|
-
errors: i.errors.map((o) => F(
|
|
3459
|
+
errors: i.errors.map((o) => F(y({}, o), {
|
|
3274
3460
|
category: "dataOptions",
|
|
3275
3461
|
index: e
|
|
3276
3462
|
}))
|
|
3277
3463
|
};
|
|
3278
3464
|
}
|
|
3279
|
-
const n =
|
|
3465
|
+
const n = Le(s);
|
|
3280
3466
|
return n.success ? { success: !0, data: n.data } : {
|
|
3281
3467
|
success: !1,
|
|
3282
|
-
errors: n.errors.map((i) => F(
|
|
3468
|
+
errors: n.errors.map((i) => F(y({}, i), {
|
|
3283
3469
|
category: "dataOptions",
|
|
3284
3470
|
index: e
|
|
3285
3471
|
}))
|
|
3286
3472
|
};
|
|
3287
3473
|
}
|
|
3288
|
-
function
|
|
3474
|
+
function Wn(e, t) {
|
|
3289
3475
|
let r;
|
|
3290
|
-
|
|
3291
|
-
const n = !(
|
|
3476
|
+
S(e) && "column" in e && (r = e.column);
|
|
3477
|
+
const n = !(q(e) || r !== void 0 && q(r)) ? "dimension" : "measure", i = [], o = re("columns", [e], n, t, i);
|
|
3292
3478
|
return o !== null ? { success: !0, data: o } : { success: !1, errors: i };
|
|
3293
3479
|
}
|
|
3294
|
-
function
|
|
3480
|
+
function jn(e, t, r, s) {
|
|
3295
3481
|
const n = [];
|
|
3296
3482
|
for (const i of e) {
|
|
3297
3483
|
const o = w(
|
|
3298
|
-
() =>
|
|
3484
|
+
() => Wn(i, t),
|
|
3299
3485
|
r,
|
|
3300
3486
|
s
|
|
3301
3487
|
);
|
|
@@ -3303,8 +3489,8 @@ function Nn(e, t, r, s) {
|
|
|
3303
3489
|
}
|
|
3304
3490
|
return n;
|
|
3305
3491
|
}
|
|
3306
|
-
function
|
|
3307
|
-
if (!e || !
|
|
3492
|
+
function Kn(e, t, r) {
|
|
3493
|
+
if (!e || !S(e))
|
|
3308
3494
|
return r.push({
|
|
3309
3495
|
category: "dataOptions",
|
|
3310
3496
|
index: -1,
|
|
@@ -3313,25 +3499,25 @@ function Rn(e, t, r) {
|
|
|
3313
3499
|
}), null;
|
|
3314
3500
|
const s = {}, { chartType: n } = t, i = r.length, o = e, a = Object.keys(e), u = /* @__PURE__ */ new Map();
|
|
3315
3501
|
for (const l of a)
|
|
3316
|
-
if (!
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3502
|
+
if (!me.has(l)) {
|
|
3503
|
+
const d = R(l, [...me], (g) => g), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "";
|
|
3504
|
+
d && d.distance <= x && u.set(l, d.best), r.push({
|
|
3319
3505
|
category: "dataOptions",
|
|
3320
3506
|
index: l,
|
|
3321
3507
|
input: o[l],
|
|
3322
|
-
message: `Unknown dataOptions key '${l}'.${
|
|
3508
|
+
message: `Unknown dataOptions key '${l}'.${b}`
|
|
3323
3509
|
});
|
|
3324
3510
|
}
|
|
3325
|
-
const c = n ?
|
|
3511
|
+
const c = n ? zn(n) : void 0;
|
|
3326
3512
|
if (c) {
|
|
3327
3513
|
for (const l of a)
|
|
3328
|
-
if (l !== "seriesToColorMap" && !c.validAxes.has(l) &&
|
|
3329
|
-
const
|
|
3514
|
+
if (l !== "seriesToColorMap" && !c.validAxes.has(l) && me.has(l)) {
|
|
3515
|
+
const d = R(l, [...c.validAxes], (m) => m), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "", g = [...c.validAxes].join(", ");
|
|
3330
3516
|
r.push({
|
|
3331
3517
|
category: "dataOptions",
|
|
3332
3518
|
index: l,
|
|
3333
3519
|
input: o[l],
|
|
3334
|
-
message: `Axis '${l}' is not valid for chart type '${n}'. Valid axes: ${
|
|
3520
|
+
message: `Axis '${l}' is not valid for chart type '${n}'. Valid axes: ${g}.${b}`
|
|
3335
3521
|
});
|
|
3336
3522
|
}
|
|
3337
3523
|
for (const l of c.requiredAxes)
|
|
@@ -3344,7 +3530,7 @@ function Rn(e, t, r) {
|
|
|
3344
3530
|
)}'. Missing: ${l}.`
|
|
3345
3531
|
});
|
|
3346
3532
|
n === "indicator" && (["value", "secondary", "min", "max"].some(
|
|
3347
|
-
(
|
|
3533
|
+
(b) => b in o && o[b] != null
|
|
3348
3534
|
) || r.push({
|
|
3349
3535
|
category: "dataOptions",
|
|
3350
3536
|
index: -1,
|
|
@@ -3359,77 +3545,77 @@ function Rn(e, t, r) {
|
|
|
3359
3545
|
}
|
|
3360
3546
|
if (r.length > i)
|
|
3361
3547
|
return null;
|
|
3362
|
-
const
|
|
3363
|
-
for (const [l,
|
|
3364
|
-
if (!
|
|
3548
|
+
const p = Object.entries(e);
|
|
3549
|
+
for (const [l, d] of p) {
|
|
3550
|
+
if (!d) continue;
|
|
3365
3551
|
if (l === "seriesToColorMap") {
|
|
3366
|
-
s[l] =
|
|
3552
|
+
s[l] = d;
|
|
3367
3553
|
continue;
|
|
3368
3554
|
}
|
|
3369
3555
|
if (l === "columns") {
|
|
3370
|
-
s[l] =
|
|
3371
|
-
|
|
3556
|
+
s[l] = jn(
|
|
3557
|
+
_t(d),
|
|
3372
3558
|
t,
|
|
3373
3559
|
r,
|
|
3374
|
-
|
|
3560
|
+
Ae("columns")
|
|
3375
3561
|
);
|
|
3376
3562
|
continue;
|
|
3377
3563
|
}
|
|
3378
|
-
const
|
|
3564
|
+
const b = Ln(l, d, n) ? "dimension" : "measure", g = re(
|
|
3379
3565
|
l,
|
|
3380
|
-
|
|
3381
|
-
|
|
3566
|
+
d,
|
|
3567
|
+
b,
|
|
3382
3568
|
t,
|
|
3383
3569
|
r
|
|
3384
3570
|
);
|
|
3385
|
-
if (
|
|
3386
|
-
const
|
|
3387
|
-
s[l] =
|
|
3571
|
+
if (g !== null) {
|
|
3572
|
+
const m = n === "calendar-heatmap" && l === "value";
|
|
3573
|
+
s[l] = m || !Array.isArray(d) ? g[0] : g;
|
|
3388
3574
|
}
|
|
3389
3575
|
}
|
|
3390
3576
|
return r.length > i ? null : s;
|
|
3391
3577
|
}
|
|
3392
|
-
function
|
|
3578
|
+
function Gn(e) {
|
|
3393
3579
|
if (typeof e != "string") return "iqr";
|
|
3394
3580
|
const t = e.split("/")[1];
|
|
3395
3581
|
return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
|
|
3396
3582
|
}
|
|
3397
|
-
const
|
|
3398
|
-
var
|
|
3399
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3583
|
+
const ai = (e) => {
|
|
3584
|
+
var m;
|
|
3585
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Un(t);
|
|
3400
3586
|
if (o.length > 0)
|
|
3401
3587
|
return { success: !1, errors: o };
|
|
3402
|
-
const a = i.chartType, u =
|
|
3403
|
-
let
|
|
3588
|
+
const a = i.chartType, u = $e(n), c = [];
|
|
3589
|
+
let p = Kn(
|
|
3404
3590
|
i.dataOptions,
|
|
3405
3591
|
{ dataSource: s, schemaIndex: u, chartType: a },
|
|
3406
3592
|
c
|
|
3407
3593
|
);
|
|
3408
|
-
if (a === "boxplot" &&
|
|
3409
|
-
const
|
|
3410
|
-
|
|
3594
|
+
if (a === "boxplot" && p) {
|
|
3595
|
+
const A = Gn((m = i.styleOptions) == null ? void 0 : m.subtype), C = A === "iqr" || A === "standardDeviation";
|
|
3596
|
+
p = F(y({}, p), { boxType: A, outliersEnabled: C });
|
|
3411
3597
|
}
|
|
3412
3598
|
let l = null;
|
|
3413
3599
|
i.filters && i.filters.length > 0 && (l = w(
|
|
3414
|
-
() =>
|
|
3600
|
+
() => Re({
|
|
3415
3601
|
data: i.filters || [],
|
|
3416
3602
|
context: { dataSource: s, schemaIndex: u }
|
|
3417
3603
|
}),
|
|
3418
3604
|
c
|
|
3419
3605
|
));
|
|
3420
|
-
let
|
|
3421
|
-
if (i.highlights && i.highlights.length > 0 && (
|
|
3422
|
-
() =>
|
|
3606
|
+
let d = null;
|
|
3607
|
+
if (i.highlights && i.highlights.length > 0 && (d = w(
|
|
3608
|
+
() => ve({
|
|
3423
3609
|
data: i.highlights || [],
|
|
3424
3610
|
context: { dataSource: s, schemaIndex: u }
|
|
3425
3611
|
}),
|
|
3426
3612
|
c
|
|
3427
|
-
)), c.length > 0 ||
|
|
3613
|
+
)), c.length > 0 || p === null)
|
|
3428
3614
|
return {
|
|
3429
3615
|
success: !1,
|
|
3430
3616
|
errors: c
|
|
3431
3617
|
};
|
|
3432
|
-
if (!
|
|
3618
|
+
if (!Ut(i.chartType))
|
|
3433
3619
|
return {
|
|
3434
3620
|
success: !1,
|
|
3435
3621
|
errors: [
|
|
@@ -3441,19 +3627,19 @@ const Gn = (e) => {
|
|
|
3441
3627
|
}
|
|
3442
3628
|
]
|
|
3443
3629
|
};
|
|
3444
|
-
const
|
|
3630
|
+
const b = i.chartType;
|
|
3445
3631
|
return {
|
|
3446
3632
|
success: !0,
|
|
3447
|
-
data:
|
|
3448
|
-
dataSet:
|
|
3449
|
-
chartType:
|
|
3450
|
-
dataOptions:
|
|
3633
|
+
data: y(y(y({
|
|
3634
|
+
dataSet: we(s),
|
|
3635
|
+
chartType: b,
|
|
3636
|
+
dataOptions: p
|
|
3451
3637
|
}, i.styleOptions && {
|
|
3452
3638
|
// Pass-through NLQ JSON; shape matches ChartStyleOptions.
|
|
3453
3639
|
styleOptions: i.styleOptions
|
|
3454
|
-
}), l && { filters: l }),
|
|
3640
|
+
}), l && { filters: l }), d && { highlights: d })
|
|
3455
3641
|
};
|
|
3456
|
-
},
|
|
3642
|
+
}, ui = (e) => {
|
|
3457
3643
|
const t = [];
|
|
3458
3644
|
if (!e.chartType)
|
|
3459
3645
|
return {
|
|
@@ -3480,12 +3666,12 @@ const Gn = (e) => {
|
|
|
3480
3666
|
]
|
|
3481
3667
|
};
|
|
3482
3668
|
let r = null;
|
|
3483
|
-
const s =
|
|
3669
|
+
const s = Yn(e.dataOptions);
|
|
3484
3670
|
s.success ? r = s.data : t.push(...s.errors);
|
|
3485
3671
|
let n;
|
|
3486
3672
|
if (e.filters) {
|
|
3487
3673
|
const u = w(
|
|
3488
|
-
() =>
|
|
3674
|
+
() => Be(e.filters),
|
|
3489
3675
|
t
|
|
3490
3676
|
);
|
|
3491
3677
|
n = u != null ? u : void 0;
|
|
@@ -3493,14 +3679,14 @@ const Gn = (e) => {
|
|
|
3493
3679
|
let i;
|
|
3494
3680
|
if (e.highlights && e.highlights.length > 0) {
|
|
3495
3681
|
const u = w(
|
|
3496
|
-
() =>
|
|
3682
|
+
() => ze(e.highlights),
|
|
3497
3683
|
t
|
|
3498
3684
|
);
|
|
3499
3685
|
i = u != null ? u : void 0;
|
|
3500
3686
|
}
|
|
3501
3687
|
if (t.length > 0 || r === null)
|
|
3502
3688
|
return { success: !1, errors: t };
|
|
3503
|
-
const o =
|
|
3689
|
+
const o = y(y(y({
|
|
3504
3690
|
chartType: e.chartType,
|
|
3505
3691
|
dataOptions: r
|
|
3506
3692
|
}, e.styleOptions && {
|
|
@@ -3513,7 +3699,7 @@ const Gn = (e) => {
|
|
|
3513
3699
|
)
|
|
3514
3700
|
};
|
|
3515
3701
|
};
|
|
3516
|
-
function
|
|
3702
|
+
function Yn(e) {
|
|
3517
3703
|
const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
|
|
3518
3704
|
for (const [n, i] of Object.entries(e)) {
|
|
3519
3705
|
if (n === "seriesToColorMap" && i) {
|
|
@@ -3525,13 +3711,13 @@ function kn(e) {
|
|
|
3525
3711
|
continue;
|
|
3526
3712
|
}
|
|
3527
3713
|
const o = Array.isArray(i) ? i : [i], a = Array.isArray(i), u = [], c = [];
|
|
3528
|
-
for (let
|
|
3529
|
-
const l = o[
|
|
3714
|
+
for (let p = 0; p < o.length; p++) {
|
|
3715
|
+
const l = o[p], b = Jn(l) ? ke([
|
|
3530
3716
|
l
|
|
3531
|
-
]) :
|
|
3532
|
-
|
|
3533
|
-
var
|
|
3534
|
-
c.push(F(
|
|
3717
|
+
]) : Le([l]);
|
|
3718
|
+
b.success ? u.push(...b.data) : b.errors.forEach((g) => {
|
|
3719
|
+
var m;
|
|
3720
|
+
c.push(F(y({}, g), { index: p, input: (m = g.input) != null ? m : l }));
|
|
3535
3721
|
});
|
|
3536
3722
|
}
|
|
3537
3723
|
if (c.length > 0) {
|
|
@@ -3542,11 +3728,11 @@ function kn(e) {
|
|
|
3542
3728
|
}
|
|
3543
3729
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3544
3730
|
}
|
|
3545
|
-
function
|
|
3731
|
+
function Jn(e) {
|
|
3546
3732
|
const t = Array.isArray(e) ? e[0] : e;
|
|
3547
|
-
if (!t || !
|
|
3733
|
+
if (!t || !S(t))
|
|
3548
3734
|
return !0;
|
|
3549
|
-
const r = "column" in t && t.column != null &&
|
|
3735
|
+
const r = "column" in t && t.column != null && S(t.column) ? t.column : t;
|
|
3550
3736
|
if ("composeCode" in r) {
|
|
3551
3737
|
const s = r.composeCode;
|
|
3552
3738
|
if (typeof s == "string" && s.startsWith("DM."))
|
|
@@ -3561,17 +3747,17 @@ function Bn(e) {
|
|
|
3561
3747
|
}
|
|
3562
3748
|
return !("aggregation" in r || "attribute" in r && "aggregation" in r);
|
|
3563
3749
|
}
|
|
3564
|
-
const
|
|
3565
|
-
function
|
|
3566
|
-
if (!
|
|
3750
|
+
const nt = ["rows", "columns", "values", "grandTotals"];
|
|
3751
|
+
function Hn(e) {
|
|
3752
|
+
if (!S(e)) return !1;
|
|
3567
3753
|
const t = Object.keys(e);
|
|
3568
3754
|
return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
|
|
3569
3755
|
}
|
|
3570
|
-
function
|
|
3756
|
+
function Qn(e) {
|
|
3571
3757
|
const t = [], r = {
|
|
3572
3758
|
dataOptions: {}
|
|
3573
3759
|
};
|
|
3574
|
-
if (!
|
|
3760
|
+
if (!S(e))
|
|
3575
3761
|
return t.push({
|
|
3576
3762
|
category: "dataOptions",
|
|
3577
3763
|
index: -1,
|
|
@@ -3580,19 +3766,19 @@ function Pn(e) {
|
|
|
3580
3766
|
}), { normalized: r, errors: t };
|
|
3581
3767
|
const s = e.dataOptions;
|
|
3582
3768
|
if (s === void 0) {
|
|
3583
|
-
const n = Object.keys(e), i =
|
|
3769
|
+
const n = Object.keys(e), i = R("dataOptions", n, (u) => u), o = i && i.distance <= x ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", a = i && i.distance <= x ? { [i.best]: e[i.best] } : e;
|
|
3584
3770
|
t.push({
|
|
3585
3771
|
category: "dataOptions",
|
|
3586
3772
|
index: -1,
|
|
3587
3773
|
input: a,
|
|
3588
3774
|
message: `dataOptions is required.${o}`
|
|
3589
3775
|
});
|
|
3590
|
-
} else if (
|
|
3776
|
+
} else if (S(s)) {
|
|
3591
3777
|
const n = s;
|
|
3592
3778
|
r.dataOptions = n;
|
|
3593
3779
|
for (const o of Object.keys(n))
|
|
3594
|
-
if (!
|
|
3595
|
-
const a =
|
|
3780
|
+
if (!nt.includes(o)) {
|
|
3781
|
+
const a = R(o, [...nt], (c) => c), u = a && a.distance <= x ? ` Did you mean '${a.best}'?` : "";
|
|
3596
3782
|
t.push({
|
|
3597
3783
|
category: "dataOptions",
|
|
3598
3784
|
index: o,
|
|
@@ -3610,7 +3796,7 @@ function Pn(e) {
|
|
|
3610
3796
|
});
|
|
3611
3797
|
}
|
|
3612
3798
|
const i = n.grandTotals;
|
|
3613
|
-
i != null && !
|
|
3799
|
+
i != null && !Hn(i) && t.push({
|
|
3614
3800
|
category: "dataOptions",
|
|
3615
3801
|
index: "grandTotals",
|
|
3616
3802
|
input: i,
|
|
@@ -3619,7 +3805,7 @@ function Pn(e) {
|
|
|
3619
3805
|
}
|
|
3620
3806
|
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 };
|
|
3621
3807
|
}
|
|
3622
|
-
function
|
|
3808
|
+
function Xn(e, t, r) {
|
|
3623
3809
|
if (!e || typeof e != "object")
|
|
3624
3810
|
return r.push({
|
|
3625
3811
|
category: "dataOptions",
|
|
@@ -3629,7 +3815,7 @@ function Ln(e, t, r) {
|
|
|
3629
3815
|
}), null;
|
|
3630
3816
|
const s = {}, n = r.length;
|
|
3631
3817
|
for (const o of ["rows", "columns"]) {
|
|
3632
|
-
const a =
|
|
3818
|
+
const a = re(
|
|
3633
3819
|
o,
|
|
3634
3820
|
e[o],
|
|
3635
3821
|
"dimension",
|
|
@@ -3638,7 +3824,7 @@ function Ln(e, t, r) {
|
|
|
3638
3824
|
);
|
|
3639
3825
|
a && (s[o] = a);
|
|
3640
3826
|
}
|
|
3641
|
-
const i =
|
|
3827
|
+
const i = re(
|
|
3642
3828
|
"values",
|
|
3643
3829
|
e.values,
|
|
3644
3830
|
"measure",
|
|
@@ -3647,18 +3833,18 @@ function Ln(e, t, r) {
|
|
|
3647
3833
|
);
|
|
3648
3834
|
return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
|
|
3649
3835
|
}
|
|
3650
|
-
const
|
|
3651
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3836
|
+
const ci = (e) => {
|
|
3837
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Qn(t);
|
|
3652
3838
|
if (o.length > 0)
|
|
3653
3839
|
return { success: !1, errors: o };
|
|
3654
|
-
const a =
|
|
3840
|
+
const a = $e(n), u = [], c = Xn(
|
|
3655
3841
|
i.dataOptions,
|
|
3656
3842
|
{ dataSource: s, schemaIndex: a },
|
|
3657
3843
|
u
|
|
3658
3844
|
);
|
|
3659
|
-
let
|
|
3660
|
-
i.filters && i.filters.length > 0 && (
|
|
3661
|
-
() =>
|
|
3845
|
+
let p = null;
|
|
3846
|
+
i.filters && i.filters.length > 0 && (p = w(
|
|
3847
|
+
() => Re({
|
|
3662
3848
|
data: i.filters || [],
|
|
3663
3849
|
context: { dataSource: s, schemaIndex: a }
|
|
3664
3850
|
}),
|
|
@@ -3666,7 +3852,7 @@ const Hn = (e) => {
|
|
|
3666
3852
|
));
|
|
3667
3853
|
let l = null;
|
|
3668
3854
|
return i.highlights && i.highlights.length > 0 && (l = w(
|
|
3669
|
-
() =>
|
|
3855
|
+
() => ve({
|
|
3670
3856
|
data: i.highlights || [],
|
|
3671
3857
|
context: { dataSource: s, schemaIndex: a }
|
|
3672
3858
|
}),
|
|
@@ -3676,12 +3862,12 @@ const Hn = (e) => {
|
|
|
3676
3862
|
errors: u
|
|
3677
3863
|
} : {
|
|
3678
3864
|
success: !0,
|
|
3679
|
-
data:
|
|
3680
|
-
dataSet:
|
|
3865
|
+
data: y(y(y({
|
|
3866
|
+
dataSet: we(s),
|
|
3681
3867
|
dataOptions: c
|
|
3682
|
-
}, i.styleOptions && { styleOptions: i.styleOptions }),
|
|
3868
|
+
}, i.styleOptions && { styleOptions: i.styleOptions }), p && { filters: p }), l && { highlights: l })
|
|
3683
3869
|
};
|
|
3684
|
-
},
|
|
3870
|
+
}, li = (e) => {
|
|
3685
3871
|
const t = [];
|
|
3686
3872
|
if (!e.dataOptions)
|
|
3687
3873
|
return {
|
|
@@ -3697,22 +3883,22 @@ const Hn = (e) => {
|
|
|
3697
3883
|
};
|
|
3698
3884
|
const r = e.dataOptions, s = {};
|
|
3699
3885
|
for (const c of ["rows", "columns"]) {
|
|
3700
|
-
const
|
|
3701
|
-
if (
|
|
3702
|
-
const l =
|
|
3886
|
+
const p = r[c];
|
|
3887
|
+
if (p && p.length > 0) {
|
|
3888
|
+
const l = st(c, p, "dimension");
|
|
3703
3889
|
l.success ? s[c] = l.data : t.push(...l.errors);
|
|
3704
3890
|
}
|
|
3705
3891
|
}
|
|
3706
3892
|
const n = r.values;
|
|
3707
3893
|
if (n && n.length > 0) {
|
|
3708
|
-
const c =
|
|
3894
|
+
const c = st("values", n, "measure");
|
|
3709
3895
|
c.success ? s.values = c.data : t.push(...c.errors);
|
|
3710
3896
|
}
|
|
3711
3897
|
r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
|
|
3712
3898
|
let i;
|
|
3713
3899
|
if (e.filters) {
|
|
3714
3900
|
const c = w(
|
|
3715
|
-
() =>
|
|
3901
|
+
() => Be(e.filters),
|
|
3716
3902
|
t
|
|
3717
3903
|
);
|
|
3718
3904
|
i = c != null ? c : void 0;
|
|
@@ -3720,14 +3906,14 @@ const Hn = (e) => {
|
|
|
3720
3906
|
let o;
|
|
3721
3907
|
if (e.highlights && e.highlights.length > 0) {
|
|
3722
3908
|
const c = w(
|
|
3723
|
-
() =>
|
|
3909
|
+
() => ze(e.highlights),
|
|
3724
3910
|
t
|
|
3725
3911
|
);
|
|
3726
3912
|
o = c != null ? c : void 0;
|
|
3727
3913
|
}
|
|
3728
3914
|
if (t.length > 0)
|
|
3729
3915
|
return { success: !1, errors: t };
|
|
3730
|
-
const a =
|
|
3916
|
+
const a = y(y(y({
|
|
3731
3917
|
dataOptions: s
|
|
3732
3918
|
}, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), o && o.length > 0 && { highlights: o });
|
|
3733
3919
|
return {
|
|
@@ -3737,8 +3923,8 @@ const Hn = (e) => {
|
|
|
3737
3923
|
)
|
|
3738
3924
|
};
|
|
3739
3925
|
};
|
|
3740
|
-
function
|
|
3741
|
-
const { filters: t, relations: r } =
|
|
3926
|
+
function Zn(e) {
|
|
3927
|
+
const { filters: t, relations: r } = _r(
|
|
3742
3928
|
e.filters || []
|
|
3743
3929
|
);
|
|
3744
3930
|
return {
|
|
@@ -3751,23 +3937,23 @@ function _n(e) {
|
|
|
3751
3937
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
3752
3938
|
};
|
|
3753
3939
|
}
|
|
3754
|
-
function
|
|
3755
|
-
const s =
|
|
3756
|
-
return
|
|
3940
|
+
function fi(e, t, r = !1) {
|
|
3941
|
+
const s = Zn(e), n = Lr(s, t);
|
|
3942
|
+
return Ur(n, r);
|
|
3757
3943
|
}
|
|
3758
3944
|
export {
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3945
|
+
ni as CustomSuperJSON,
|
|
3946
|
+
pi as EMPTY_EXPANDED_QUERY_MODEL,
|
|
3947
|
+
gi as EMPTY_SIMPLE_QUERY_MODEL,
|
|
3948
|
+
yi as isByIdDashboardCodeParams,
|
|
3949
|
+
hi as isByIdWidgetCodeParams,
|
|
3950
|
+
bi as isClientSideDashboardCodeParams,
|
|
3951
|
+
Ai as isClientSideWidgetCodeParams,
|
|
3952
|
+
ai as translateChartFromJSON,
|
|
3953
|
+
ui as translateChartToJSON,
|
|
3954
|
+
ci as translatePivotTableFromJSON,
|
|
3955
|
+
li as translatePivotTableToJSON,
|
|
3956
|
+
ii as translateQueryFromJSON,
|
|
3957
|
+
oi as translateQueryToJSON,
|
|
3958
|
+
fi as translateQueryToJaql
|
|
3773
3959
|
};
|