drizzle-cube 0.4.0 → 0.4.1
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/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/{mcp-transport-Bbz3qrIy.js → mcp-transport-Dmolep14.js} +31 -26
- package/dist/adapters/{mcp-transport-CXF4E5QJ.cjs → mcp-transport-h__yKJm9.cjs} +3 -3
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/client/chunks/{DashboardEditModal-Bv7e3Q7O.js → DashboardEditModal-fg72EPDl.js} +14 -13
- package/dist/client/chunks/DashboardEditModal-fg72EPDl.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-BfH-w92z.js → analysis-builder-C1QDrzgM.js} +101 -101
- package/dist/client/chunks/{analysis-builder-BfH-w92z.js.map → analysis-builder-C1QDrzgM.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-DsbdRCzz.js → analysis-builder-shared-BkwUHObk.js} +160 -159
- package/dist/client/chunks/analysis-builder-shared-BkwUHObk.js.map +1 -0
- package/dist/client/components.js +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/utils/filterUtils.d.ts +6 -0
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +31 -31
- package/dist/server/index.js +1512 -1507
- package/package.json +1 -1
- package/dist/client/chunks/DashboardEditModal-Bv7e3Q7O.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-DsbdRCzz.js.map +0 -1
|
@@ -5,12 +5,12 @@ import { b as nt } from "./icons-DRreo6m8.js";
|
|
|
5
5
|
import { u as Nn, g as Vn } from "./providers-D2xswCYu.js";
|
|
6
6
|
import { c as En, d as rt, e as it, s as st, p as Pn, f as Un, l as gt } from "./vendor-DfDLOfBe.js";
|
|
7
7
|
import { d as _n, R as Ln, a as Kn, g as $n, D as Gn } from "./retention-CzCo8262.js";
|
|
8
|
-
import { Y as
|
|
8
|
+
import { Y as Hn, Z as $, _ as we, $ as W, a0 as J, a1 as Y, S as On, K as ht, a2 as jn } from "./DashboardEditModal-fg72EPDl.js";
|
|
9
9
|
import { F as at, b as ot } from "./flow-utils-CjQZG5qq.js";
|
|
10
|
-
import { n as
|
|
11
|
-
import { c as
|
|
12
|
-
import { useDryRunQueries as
|
|
13
|
-
function
|
|
10
|
+
import { n as zn, u as Wn, a as Jn, b as Yn, d as Xn, o as Zn } from "./useDirtyStateTracking-CTS_m9mg.js";
|
|
11
|
+
import { c as er, a as pt } from "./funnel-utils-CyonoNeC.js";
|
|
12
|
+
import { useDryRunQueries as tr, useDryRunQuery as Ne } from "../hooks.js";
|
|
13
|
+
function nr(t) {
|
|
14
14
|
const i = /* @__PURE__ */ new Date(), e = t.toLowerCase().trim(), n = i.getUTCFullYear(), r = i.getUTCMonth(), s = i.getUTCDate(), o = i.getUTCDay();
|
|
15
15
|
if (e === "today") {
|
|
16
16
|
const y = new Date(i);
|
|
@@ -90,18 +90,18 @@ function tr(t) {
|
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function rr(t) {
|
|
94
94
|
if (Array.isArray(t)) {
|
|
95
95
|
if (t.length < 2) return null;
|
|
96
96
|
const i = new Date(t[0]), e = new Date(t[1]);
|
|
97
97
|
return isNaN(i.getTime()) || isNaN(e.getTime()) ? null : (e.setUTCHours(23, 59, 59, 999), { start: i, end: e });
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return nr(t);
|
|
100
100
|
}
|
|
101
101
|
function pe(t) {
|
|
102
102
|
return t.toISOString().split("T")[0];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ir(t, i) {
|
|
105
105
|
const e = i.getTime() - t.getTime(), n = Math.ceil(e / (1e3 * 60 * 60 * 24)), r = new Date(t);
|
|
106
106
|
r.setUTCDate(r.getUTCDate() - 1), r.setUTCHours(23, 59, 59, 999);
|
|
107
107
|
const s = new Date(r);
|
|
@@ -121,9 +121,9 @@ function Ct(t, i) {
|
|
|
121
121
|
function wt(t, i) {
|
|
122
122
|
const e = Ct(i, t);
|
|
123
123
|
if (!e?.dateRange) return;
|
|
124
|
-
const n =
|
|
124
|
+
const n = rr(e.dateRange);
|
|
125
125
|
if (!n) return;
|
|
126
|
-
const r =
|
|
126
|
+
const r = ir(n.start, n.end);
|
|
127
127
|
return [
|
|
128
128
|
[pe(n.start), pe(n.end)],
|
|
129
129
|
[pe(r.start), pe(r.end)]
|
|
@@ -148,6 +148,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
148
148
|
if (!r)
|
|
149
149
|
for (const d of s)
|
|
150
150
|
o = bt(o, d);
|
|
151
|
+
o = o.filter((d) => Hn(d));
|
|
151
152
|
const l = {
|
|
152
153
|
measures: t.map((d) => d.field),
|
|
153
154
|
dimensions: i.filter((d) => !d.isTimeDimension).map((d) => d.field),
|
|
@@ -167,7 +168,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
167
168
|
};
|
|
168
169
|
return l.measures?.length === 0 && delete l.measures, l.dimensions?.length === 0 && delete l.dimensions, l.timeDimensions?.length === 0 && delete l.timeDimensions, l;
|
|
169
170
|
}
|
|
170
|
-
const
|
|
171
|
+
const sr = "drizzle-cube-analysis-builder-v3";
|
|
171
172
|
function R() {
|
|
172
173
|
return {
|
|
173
174
|
metrics: [],
|
|
@@ -252,10 +253,10 @@ const Ue = ({
|
|
|
252
253
|
function St(t) {
|
|
253
254
|
return t.isTimeDimension;
|
|
254
255
|
}
|
|
255
|
-
function
|
|
256
|
+
function ar(t) {
|
|
256
257
|
return t.find(St);
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
+
function or(t) {
|
|
259
260
|
return t.find((i) => !i.isTimeDimension);
|
|
260
261
|
}
|
|
261
262
|
function je(t) {
|
|
@@ -310,7 +311,7 @@ function ze(t, i, e) {
|
|
|
310
311
|
return { available: !0 };
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function lr(t, i) {
|
|
314
315
|
const e = [
|
|
315
316
|
"activityGrid",
|
|
316
317
|
"area",
|
|
@@ -339,11 +340,11 @@ function xt(t, i, e) {
|
|
|
339
340
|
return r && o ? "line" : s && o ? "bar" : o && !s && !r ? "kpiNumber" : "table";
|
|
340
341
|
}
|
|
341
342
|
function Ve(t, i, e) {
|
|
342
|
-
const n = xt(t, i, e), r =
|
|
343
|
+
const n = xt(t, i, e), r = cr(n, t, i);
|
|
343
344
|
return { chartType: n, chartConfig: r };
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
-
const n =
|
|
346
|
+
function cr(t, i, e) {
|
|
347
|
+
const n = ar(e), r = or(e), s = je(e), o = e;
|
|
347
348
|
switch (t) {
|
|
348
349
|
case "line":
|
|
349
350
|
case "area":
|
|
@@ -414,7 +415,7 @@ function lr(t, i, e) {
|
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function dr(t, i, e, n) {
|
|
418
419
|
if (n && ze(e, t, i).available)
|
|
419
420
|
return null;
|
|
420
421
|
const r = xt(t, i, e);
|
|
@@ -423,26 +424,26 @@ function cr(t, i, e, n) {
|
|
|
423
424
|
function j(t) {
|
|
424
425
|
return typeof t == "string" ? t : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t ?? "");
|
|
425
426
|
}
|
|
426
|
-
const
|
|
427
|
+
const ur = {
|
|
427
428
|
good: "bg-dc-success-bg text-dc-success border-dc-success",
|
|
428
429
|
warning: "bg-dc-warning-bg text-dc-warning border-dc-warning",
|
|
429
430
|
critical: "bg-dc-danger-bg text-dc-error border-dc-error"
|
|
430
|
-
},
|
|
431
|
+
}, fr = {
|
|
431
432
|
critical: "bg-dc-danger-bg text-dc-error",
|
|
432
433
|
warning: "bg-dc-warning-bg text-dc-warning",
|
|
433
434
|
suggestion: "bg-dc-accent-bg text-dc-accent"
|
|
434
|
-
},
|
|
435
|
+
}, mr = {
|
|
435
436
|
high: "text-dc-error",
|
|
436
437
|
medium: "text-dc-warning",
|
|
437
438
|
low: "text-dc-text-muted"
|
|
438
439
|
};
|
|
439
|
-
function
|
|
440
|
+
function yr({ assessment: t, reason: i }) {
|
|
440
441
|
const e = {
|
|
441
442
|
good: "Good",
|
|
442
443
|
warning: "Warning",
|
|
443
444
|
critical: "Critical"
|
|
444
445
|
};
|
|
445
|
-
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${
|
|
446
|
+
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${ur[t]}`, children: [
|
|
446
447
|
/* @__PURE__ */ p("div", { className: "dc:flex dc:items-center dc:gap-2 dc:mb-1", children: /* @__PURE__ */ b("span", { className: "dc:font-semibold dc:uppercase dc:text-base", children: [
|
|
447
448
|
t === "good" && "✓ ",
|
|
448
449
|
t === "warning" && "⚠ ",
|
|
@@ -452,9 +453,9 @@ function mr({ assessment: t, reason: i }) {
|
|
|
452
453
|
/* @__PURE__ */ p("p", { className: "dc:text-sm", children: j(i) })
|
|
453
454
|
] });
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
+
function gr({ issue: t }) {
|
|
456
457
|
return /* @__PURE__ */ b("div", { className: "dc:flex dc:items-start dc:gap-2 dc:py-2", children: [
|
|
457
|
-
/* @__PURE__ */ b("span", { className: `dc:text-sm ${
|
|
458
|
+
/* @__PURE__ */ b("span", { className: `dc:text-sm ${mr[t.severity]}`, children: [
|
|
458
459
|
t.severity === "high" && "●",
|
|
459
460
|
t.severity === "medium" && "○",
|
|
460
461
|
t.severity === "low" && "○"
|
|
@@ -480,7 +481,7 @@ function lt({ text: t }) {
|
|
|
480
481
|
}
|
|
481
482
|
);
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function hr({ rec: t }) {
|
|
484
485
|
const i = {
|
|
485
486
|
index: "INDEX",
|
|
486
487
|
table: "TABLE",
|
|
@@ -492,7 +493,7 @@ function gr({ rec: t }) {
|
|
|
492
493
|
/* @__PURE__ */ p(
|
|
493
494
|
"span",
|
|
494
495
|
{
|
|
495
|
-
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${
|
|
496
|
+
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${fr[t.severity]}`,
|
|
496
497
|
children: i[t.type]
|
|
497
498
|
}
|
|
498
499
|
),
|
|
@@ -525,7 +526,7 @@ function gr({ rec: t }) {
|
|
|
525
526
|
] })
|
|
526
527
|
] });
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
+
function pr({ analysis: t, onClose: i, onClear: e }) {
|
|
529
530
|
const n = i || e;
|
|
530
531
|
return Pe.useEffect(() => {
|
|
531
532
|
const r = (s) => {
|
|
@@ -561,7 +562,7 @@ function hr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
561
562
|
] }),
|
|
562
563
|
/* @__PURE__ */ b("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-6 dc:py-4 dc:space-y-6", children: [
|
|
563
564
|
/* @__PURE__ */ p(
|
|
564
|
-
|
|
565
|
+
yr,
|
|
565
566
|
{
|
|
566
567
|
assessment: t.assessment,
|
|
567
568
|
reason: t.assessmentReason
|
|
@@ -581,7 +582,7 @@ function hr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
581
582
|
t.issues.length,
|
|
582
583
|
")"
|
|
583
584
|
] }),
|
|
584
|
-
/* @__PURE__ */ p("div", { className: "dc:space-y-1 bg-dc-surface-secondary dc:rounded-lg dc:p-3", children: t.issues.map((r, s) => /* @__PURE__ */ p(
|
|
585
|
+
/* @__PURE__ */ p("div", { className: "dc:space-y-1 bg-dc-surface-secondary dc:rounded-lg dc:p-3", children: t.issues.map((r, s) => /* @__PURE__ */ p(gr, { issue: r }, s)) })
|
|
585
586
|
] }),
|
|
586
587
|
t.recommendations && t.recommendations.length > 0 && /* @__PURE__ */ b("div", { children: [
|
|
587
588
|
/* @__PURE__ */ b("h4", { className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-3", children: [
|
|
@@ -589,7 +590,7 @@ function hr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
589
590
|
t.recommendations.length,
|
|
590
591
|
")"
|
|
591
592
|
] }),
|
|
592
|
-
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(
|
|
593
|
+
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(hr, { rec: r }, s)) })
|
|
593
594
|
] }),
|
|
594
595
|
(!t.recommendations || t.recommendations.length === 0) && /* @__PURE__ */ p("div", { className: "text-dc-text-muted dc:italic dc:p-4 bg-dc-surface-secondary dc:rounded-lg", children: "No specific recommendations. The query appears to be well-optimized." })
|
|
595
596
|
] }),
|
|
@@ -611,7 +612,7 @@ function hr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
611
612
|
] })
|
|
612
613
|
] });
|
|
613
614
|
}
|
|
614
|
-
const
|
|
615
|
+
const gi = kn(function({
|
|
615
616
|
sql: i,
|
|
616
617
|
sqlLoading: e = !1,
|
|
617
618
|
sqlError: n,
|
|
@@ -747,7 +748,7 @@ const yi = kn(function({
|
|
|
747
748
|
u.message
|
|
748
749
|
] }),
|
|
749
750
|
_ && m && /* @__PURE__ */ p(
|
|
750
|
-
|
|
751
|
+
pr,
|
|
751
752
|
{
|
|
752
753
|
analysis: m,
|
|
753
754
|
onClose: C
|
|
@@ -765,10 +766,10 @@ function ct() {
|
|
|
765
766
|
validationError: null
|
|
766
767
|
};
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
+
function Cr(t) {
|
|
769
770
|
return t.map((i) => i.field);
|
|
770
771
|
}
|
|
771
|
-
function
|
|
772
|
+
function wr(t, i) {
|
|
772
773
|
const e = [], n = [];
|
|
773
774
|
for (const r of t)
|
|
774
775
|
if (r.isTimeDimension) {
|
|
@@ -785,24 +786,24 @@ function Cr(t, i) {
|
|
|
785
786
|
e.push(r.field);
|
|
786
787
|
return { dimensions: e, timeDimensions: n };
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
const { dimensions: i, timeDimensions: e } =
|
|
789
|
+
function br(t) {
|
|
790
|
+
const { dimensions: i, timeDimensions: e } = wr(
|
|
790
791
|
t.breakdowns,
|
|
791
792
|
t.filters
|
|
792
793
|
), n = {
|
|
793
|
-
measures:
|
|
794
|
+
measures: Cr(t.metrics),
|
|
794
795
|
dimensions: i
|
|
795
796
|
};
|
|
796
797
|
return e.length > 0 && (n.timeDimensions = e), t.filters.length > 0 && (n.filters = t.filters), t.order && Object.keys(t.order).length > 0 && (n.order = t.order), n;
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
+
function Sr(t) {
|
|
799
800
|
return t.map((i, e) => ({
|
|
800
801
|
id: $(),
|
|
801
802
|
field: i,
|
|
802
803
|
label: we(e)
|
|
803
804
|
}));
|
|
804
805
|
}
|
|
805
|
-
function
|
|
806
|
+
function vr(t) {
|
|
806
807
|
const i = [];
|
|
807
808
|
if (t.dimensions)
|
|
808
809
|
for (const e of t.dimensions)
|
|
@@ -826,15 +827,15 @@ function Sr(t) {
|
|
|
826
827
|
}
|
|
827
828
|
function dt(t) {
|
|
828
829
|
return {
|
|
829
|
-
metrics:
|
|
830
|
-
breakdowns:
|
|
830
|
+
metrics: Sr(t.measures || []),
|
|
831
|
+
breakdowns: vr(t),
|
|
831
832
|
filters: t.filters || [],
|
|
832
833
|
order: t.order,
|
|
833
834
|
validationStatus: "idle",
|
|
834
835
|
validationError: null
|
|
835
836
|
};
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
+
function xr(t) {
|
|
838
839
|
return typeof t == "object" && t !== null && "queries" in t && Array.isArray(t.queries);
|
|
839
840
|
}
|
|
840
841
|
const K = {
|
|
@@ -864,7 +865,7 @@ const K = {
|
|
|
864
865
|
`Cannot load ${t.analysisType} config with query adapter`
|
|
865
866
|
);
|
|
866
867
|
const i = t;
|
|
867
|
-
if (
|
|
868
|
+
if (xr(i.query)) {
|
|
868
869
|
const e = i.query, n = e.queries.map(dt);
|
|
869
870
|
return n.length === 0 && n.push(ct()), {
|
|
870
871
|
queryStates: n,
|
|
@@ -879,7 +880,7 @@ const K = {
|
|
|
879
880
|
};
|
|
880
881
|
},
|
|
881
882
|
save(t, i, e) {
|
|
882
|
-
const n = t.queryStates.map(
|
|
883
|
+
const n = t.queryStates.map(br), s = n.length === 1 && t.mergeStrategy === "concat" ? n[0] : {
|
|
883
884
|
queries: n,
|
|
884
885
|
mergeStrategy: t.mergeStrategy
|
|
885
886
|
};
|
|
@@ -1004,7 +1005,7 @@ const L = {
|
|
|
1004
1005
|
},
|
|
1005
1006
|
userManuallySelectedChart: !1,
|
|
1006
1007
|
localPaletteName: "default"
|
|
1007
|
-
}),
|
|
1008
|
+
}), Dr = (t, i) => ({
|
|
1008
1009
|
...Dt(),
|
|
1009
1010
|
setAnalysisType: (e) => {
|
|
1010
1011
|
t((n) => {
|
|
@@ -1228,7 +1229,7 @@ const L = {
|
|
|
1228
1229
|
queryStates: [R()],
|
|
1229
1230
|
activeQueryIndex: 0,
|
|
1230
1231
|
mergeStrategy: "concat"
|
|
1231
|
-
}),
|
|
1232
|
+
}), Tr = (t, i) => ({
|
|
1232
1233
|
...Le(),
|
|
1233
1234
|
// ==========================================================================
|
|
1234
1235
|
// Query State Management
|
|
@@ -1390,7 +1391,7 @@ const L = {
|
|
|
1390
1391
|
member: y.field,
|
|
1391
1392
|
operator: "inDateRange",
|
|
1392
1393
|
values: [],
|
|
1393
|
-
dateRange:
|
|
1394
|
+
dateRange: zn("last_n_months", 3)
|
|
1394
1395
|
};
|
|
1395
1396
|
f[m] = {
|
|
1396
1397
|
...f[m],
|
|
@@ -1507,7 +1508,7 @@ const L = {
|
|
|
1507
1508
|
funnelBindingKey: null,
|
|
1508
1509
|
stepTimeToConvert: []
|
|
1509
1510
|
// Deprecated - kept for backward compat
|
|
1510
|
-
}),
|
|
1511
|
+
}), Fr = (t, i) => ({
|
|
1511
1512
|
...Ke(),
|
|
1512
1513
|
addFunnelStep: () => t((e) => {
|
|
1513
1514
|
const n = e.funnelSteps[e.funnelSteps.length - 1], r = {
|
|
@@ -1599,7 +1600,7 @@ const L = {
|
|
|
1599
1600
|
stepsAfter: 3,
|
|
1600
1601
|
eventDimension: null,
|
|
1601
1602
|
joinStrategy: "auto"
|
|
1602
|
-
}),
|
|
1603
|
+
}), Ar = (t, i) => ({
|
|
1603
1604
|
...$e(),
|
|
1604
1605
|
setFlowCube: (e) => t(() => ({
|
|
1605
1606
|
flowCube: e,
|
|
@@ -1695,7 +1696,7 @@ const L = {
|
|
|
1695
1696
|
}
|
|
1696
1697
|
}), Ge = () => ({
|
|
1697
1698
|
..._n
|
|
1698
|
-
}),
|
|
1699
|
+
}), Qr = (t, i) => ({
|
|
1699
1700
|
...Ge(),
|
|
1700
1701
|
setRetentionCube: (e) => t(() => ({
|
|
1701
1702
|
retentionCube: e,
|
|
@@ -1803,15 +1804,15 @@ const L = {
|
|
|
1803
1804
|
error: null,
|
|
1804
1805
|
hasGeneratedQuery: !1,
|
|
1805
1806
|
previousState: null
|
|
1806
|
-
},
|
|
1807
|
+
}, Mr = () => ({
|
|
1807
1808
|
activeTab: "query",
|
|
1808
1809
|
activeView: "chart",
|
|
1809
1810
|
displayLimit: 100,
|
|
1810
1811
|
showFieldModal: !1,
|
|
1811
1812
|
fieldModalMode: "metrics",
|
|
1812
1813
|
aiState: Tt
|
|
1813
|
-
}),
|
|
1814
|
-
...
|
|
1814
|
+
}), Rr = (t, i) => ({
|
|
1815
|
+
...Mr(),
|
|
1815
1816
|
// ==========================================================================
|
|
1816
1817
|
// Tab/View Actions
|
|
1817
1818
|
// ==========================================================================
|
|
@@ -1943,10 +1944,10 @@ function ut(t) {
|
|
|
1943
1944
|
order: t.order
|
|
1944
1945
|
};
|
|
1945
1946
|
}
|
|
1946
|
-
function
|
|
1947
|
+
function kr(t) {
|
|
1947
1948
|
return "queries" in t && Array.isArray(t.queries);
|
|
1948
1949
|
}
|
|
1949
|
-
function
|
|
1950
|
+
function Ir(t) {
|
|
1950
1951
|
if (t.initialAnalysisType === "funnel" && t.initialFunnelState) {
|
|
1951
1952
|
const i = W.getDefaultChartConfig(), e = {
|
|
1952
1953
|
chartType: t.initialChartConfig?.chartType || i.chartType,
|
|
@@ -2012,7 +2013,7 @@ function kr(t) {
|
|
|
2012
2013
|
if (t.initialQuery) {
|
|
2013
2014
|
const i = t.initialQuery;
|
|
2014
2015
|
let e, n = "concat";
|
|
2015
|
-
|
|
2016
|
+
kr(i) ? (e = i.queries.map(ut), i.mergeStrategy && (n = i.mergeStrategy)) : e = [ut(i)];
|
|
2016
2017
|
const r = K.getDefaultChartConfig(), s = {
|
|
2017
2018
|
chartType: t.initialChartConfig?.chartType || r.chartType,
|
|
2018
2019
|
chartConfig: t.initialChartConfig?.chartConfig || r.chartConfig,
|
|
@@ -2042,7 +2043,7 @@ function kr(t) {
|
|
|
2042
2043
|
t.initialActiveView
|
|
2043
2044
|
) : null;
|
|
2044
2045
|
}
|
|
2045
|
-
function
|
|
2046
|
+
function qr(t, i) {
|
|
2046
2047
|
return {
|
|
2047
2048
|
reset: () => {
|
|
2048
2049
|
t({
|
|
@@ -2120,17 +2121,17 @@ function Ir(t, i) {
|
|
|
2120
2121
|
}
|
|
2121
2122
|
};
|
|
2122
2123
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const i =
|
|
2124
|
+
function Br(t = {}) {
|
|
2125
|
+
const i = Ir(t), e = (n, r, s) => ({
|
|
2125
2126
|
// Compose slices - they provide default state and actions
|
|
2126
|
-
...xr(n, r),
|
|
2127
2127
|
...Dr(n, r),
|
|
2128
2128
|
...Tr(n, r),
|
|
2129
2129
|
...Fr(n, r),
|
|
2130
2130
|
...Ar(n, r),
|
|
2131
|
-
...
|
|
2131
|
+
...Qr(n, r),
|
|
2132
|
+
...Rr(n),
|
|
2132
2133
|
// Cross-slice actions
|
|
2133
|
-
...
|
|
2134
|
+
...qr(n, r)
|
|
2134
2135
|
});
|
|
2135
2136
|
if (t.disableLocalStorage) {
|
|
2136
2137
|
const n = rt()(
|
|
@@ -2144,10 +2145,10 @@ function qr(t = {}) {
|
|
|
2144
2145
|
it(
|
|
2145
2146
|
st(
|
|
2146
2147
|
Pn(e, {
|
|
2147
|
-
name:
|
|
2148
|
+
name: sr,
|
|
2148
2149
|
// Use workspace format to preserve ALL modes' state
|
|
2149
2150
|
partialize: (n) => n.saveWorkspace(),
|
|
2150
|
-
merge: (n, r) => n &&
|
|
2151
|
+
merge: (n, r) => n && On(n) ? {
|
|
2151
2152
|
...r,
|
|
2152
2153
|
_persistedWorkspace: n
|
|
2153
2154
|
} : n && ht(n) ? {
|
|
@@ -2178,7 +2179,7 @@ function qr(t = {}) {
|
|
|
2178
2179
|
);
|
|
2179
2180
|
}
|
|
2180
2181
|
const We = In(null);
|
|
2181
|
-
function
|
|
2182
|
+
function hi({
|
|
2182
2183
|
children: t,
|
|
2183
2184
|
initialQuery: i,
|
|
2184
2185
|
initialChartConfig: e,
|
|
@@ -2190,7 +2191,7 @@ function gi({
|
|
|
2190
2191
|
initialActiveView: d
|
|
2191
2192
|
}) {
|
|
2192
2193
|
const f = ae(null);
|
|
2193
|
-
return f.current || (f.current =
|
|
2194
|
+
return f.current || (f.current = Br({
|
|
2194
2195
|
initialQuery: i,
|
|
2195
2196
|
initialChartConfig: e,
|
|
2196
2197
|
disableLocalStorage: n,
|
|
@@ -2207,13 +2208,13 @@ function c(t) {
|
|
|
2207
2208
|
throw new Error("useAnalysisBuilderStore must be used within AnalysisBuilderStoreProvider");
|
|
2208
2209
|
return En(i, t);
|
|
2209
2210
|
}
|
|
2210
|
-
function
|
|
2211
|
+
function Nr() {
|
|
2211
2212
|
const t = yt(We);
|
|
2212
2213
|
if (!t)
|
|
2213
2214
|
throw new Error("useAnalysisBuilderStoreApi must be used within AnalysisBuilderStoreProvider");
|
|
2214
2215
|
return t;
|
|
2215
2216
|
}
|
|
2216
|
-
const Je = (t) => t.queryStates[t.activeQueryIndex] || R(),
|
|
2217
|
+
const Je = (t) => t.queryStates[t.activeQueryIndex] || R(), pi = (t) => Je(t).metrics, Ci = (t) => Je(t).breakdowns, wi = (t) => Je(t).filters, Vr = (t) => {
|
|
2217
2218
|
const i = t.charts[t.analysisType];
|
|
2218
2219
|
return i ? {
|
|
2219
2220
|
chartType: i.chartType,
|
|
@@ -2224,19 +2225,19 @@ const Je = (t) => t.queryStates[t.activeQueryIndex] || R(), hi = (t) => Je(t).me
|
|
|
2224
2225
|
chartConfig: {},
|
|
2225
2226
|
displayConfig: { showLegend: !0, showGrid: !0, showTooltip: !0 }
|
|
2226
2227
|
};
|
|
2227
|
-
},
|
|
2228
|
+
}, bi = (t) => ({
|
|
2228
2229
|
activeTab: t.activeTab,
|
|
2229
2230
|
activeView: t.activeView,
|
|
2230
2231
|
displayLimit: t.displayLimit,
|
|
2231
2232
|
showFieldModal: t.showFieldModal,
|
|
2232
2233
|
fieldModalMode: t.fieldModalMode
|
|
2233
|
-
}),
|
|
2234
|
+
}), Si = (t) => ({
|
|
2234
2235
|
queryStates: t.queryStates,
|
|
2235
2236
|
activeQueryIndex: t.activeQueryIndex,
|
|
2236
2237
|
mergeStrategy: t.mergeStrategy,
|
|
2237
2238
|
// Multi-query mode is when we have more than one query in 'query' analysis type
|
|
2238
2239
|
isMultiQueryMode: t.analysisType === "query" && t.queryStates.length > 1
|
|
2239
|
-
}),
|
|
2240
|
+
}), vi = (t) => ({
|
|
2240
2241
|
funnelCube: t.funnelCube,
|
|
2241
2242
|
funnelSteps: t.funnelSteps,
|
|
2242
2243
|
activeFunnelStepIndex: t.activeFunnelStepIndex,
|
|
@@ -2249,7 +2250,7 @@ const Je = (t) => t.queryStates[t.activeQueryIndex] || R(), hi = (t) => Je(t).me
|
|
|
2249
2250
|
function ft(t) {
|
|
2250
2251
|
return t.timeDimensions || [];
|
|
2251
2252
|
}
|
|
2252
|
-
function
|
|
2253
|
+
function Er(t) {
|
|
2253
2254
|
const i = [];
|
|
2254
2255
|
if (t.length < 2) return i;
|
|
2255
2256
|
const e = ft(t[0]);
|
|
@@ -2281,7 +2282,7 @@ function Vr(t) {
|
|
|
2281
2282
|
}
|
|
2282
2283
|
return i;
|
|
2283
2284
|
}
|
|
2284
|
-
function
|
|
2285
|
+
function Pr(t, i) {
|
|
2285
2286
|
const e = [];
|
|
2286
2287
|
if (t.length < 2 || i.length === 0) return e;
|
|
2287
2288
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2299,7 +2300,7 @@ function Er(t, i) {
|
|
|
2299
2300
|
}
|
|
2300
2301
|
return e;
|
|
2301
2302
|
}
|
|
2302
|
-
function
|
|
2303
|
+
function Ur(t) {
|
|
2303
2304
|
const i = [];
|
|
2304
2305
|
if (t.length < 2) return i;
|
|
2305
2306
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -2318,7 +2319,7 @@ function Pr(t) {
|
|
|
2318
2319
|
affectedMeasures: n
|
|
2319
2320
|
}), i;
|
|
2320
2321
|
}
|
|
2321
|
-
function
|
|
2322
|
+
function _r(t) {
|
|
2322
2323
|
const i = [];
|
|
2323
2324
|
if (t.length < 2) return i;
|
|
2324
2325
|
const e = t.map((r) => r.timeDimensions?.[0]?.dateRange);
|
|
@@ -2328,26 +2329,26 @@ function Ur(t) {
|
|
|
2328
2329
|
message: "Queries have different date ranges - some data points may be missing in merged results"
|
|
2329
2330
|
}), i;
|
|
2330
2331
|
}
|
|
2331
|
-
function
|
|
2332
|
+
function Lr(t, i, e = []) {
|
|
2332
2333
|
const n = [], r = [];
|
|
2333
|
-
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...
|
|
2334
|
+
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...Ur(t)), r.push(..._r(t)), i === "merge" && (n.push(...Er(t)), e.length > 0 && n.push(...Pr(t, e))), {
|
|
2334
2335
|
isValid: n.length === 0,
|
|
2335
2336
|
errors: n,
|
|
2336
2337
|
warnings: r
|
|
2337
2338
|
});
|
|
2338
2339
|
}
|
|
2339
|
-
function
|
|
2340
|
+
function xi(t) {
|
|
2340
2341
|
return t.filter(
|
|
2341
2342
|
(i) => (i.measures?.length || 0) + (i.dimensions?.length || 0) + (i.timeDimensions?.length || 0) > 0
|
|
2342
2343
|
).length >= 2;
|
|
2343
2344
|
}
|
|
2344
|
-
function
|
|
2345
|
+
function Di(t) {
|
|
2345
2346
|
if (t.isValid && t.warnings.length === 0)
|
|
2346
2347
|
return "Configuration is valid";
|
|
2347
2348
|
const i = [];
|
|
2348
2349
|
return t.errors.length > 0 && i.push(`${t.errors.length} error${t.errors.length > 1 ? "s" : ""}`), t.warnings.length > 0 && i.push(`${t.warnings.length} warning${t.warnings.length > 1 ? "s" : ""}`), i.join(", ");
|
|
2349
2350
|
}
|
|
2350
|
-
function
|
|
2351
|
+
function Kr() {
|
|
2351
2352
|
const t = c((h) => h.queryStates), i = c((h) => h.activeQueryIndex), e = c((h) => h.mergeStrategy), n = c((h) => h.setActiveQueryIndex), r = c((h) => h.setMergeStrategy), s = c((h) => h.addQuery), o = c((h) => h.removeQuery), l = c((h) => h.getCurrentState), d = c((h) => h.getMergeKeys), f = c((h) => h.isMultiQueryMode), m = l(), y = f(), u = d(), g = A(() => {
|
|
2352
2353
|
const h = t[i] || m;
|
|
2353
2354
|
return be(h.metrics, h.breakdowns, h.filters, h.order);
|
|
@@ -2366,7 +2367,7 @@ function Lr() {
|
|
|
2366
2367
|
mergeKeys: u,
|
|
2367
2368
|
queryLabels: h.map((x, B) => `Q${B + 1}`)
|
|
2368
2369
|
};
|
|
2369
|
-
}, [S, t.length, e, u]), D = A(() => y ?
|
|
2370
|
+
}, [S, t.length, e, u]), D = A(() => y ? Lr(S, e, u || []) : null, [y, S, e, u]), v = A(() => g.measures && g.measures.length > 0 || g.dimensions && g.dimensions.length > 0 || g.timeDimensions && g.timeDimensions.length > 0, [g]);
|
|
2370
2371
|
return {
|
|
2371
2372
|
queryState: m,
|
|
2372
2373
|
queryStates: t,
|
|
@@ -2386,7 +2387,7 @@ function Lr() {
|
|
|
2386
2387
|
removeQuery: o
|
|
2387
2388
|
};
|
|
2388
2389
|
}
|
|
2389
|
-
function
|
|
2390
|
+
function $r(t) {
|
|
2390
2391
|
const { queryState: i, queryStates: e, isMultiQueryMode: n, mergeStrategy: r, activeQueryIndex: s } = t, o = A(() => {
|
|
2391
2392
|
if (!n) return i.metrics;
|
|
2392
2393
|
const f = /* @__PURE__ */ new Set(), m = [];
|
|
@@ -2415,7 +2416,7 @@ function Kr(t) {
|
|
|
2415
2416
|
effectiveBreakdowns: d
|
|
2416
2417
|
};
|
|
2417
2418
|
}
|
|
2418
|
-
function
|
|
2419
|
+
function Gr(t) {
|
|
2419
2420
|
const {
|
|
2420
2421
|
currentQuery: i,
|
|
2421
2422
|
allQueries: e,
|
|
@@ -2431,25 +2432,25 @@ function $r(t) {
|
|
|
2431
2432
|
serverFlowQuery: y,
|
|
2432
2433
|
serverRetentionQuery: u,
|
|
2433
2434
|
retentionValidation: g
|
|
2434
|
-
} = t, { getFieldLabel: S } = Nn(), w = f === "funnel" || d, D = f === "flow", v = f === "retention", h = f === "query" && r, x = f === "query" && !r, B = f === "funnel" && !!m, _ = A(() => B || !w || !l || e.length < 2 ? null :
|
|
2435
|
+
} = t, { getFieldLabel: S } = Nn(), w = f === "funnel" || d, D = f === "flow", v = f === "retention", h = f === "query" && r, x = f === "query" && !r, B = f === "funnel" && !!m, _ = A(() => B || !w || !l || e.length < 2 ? null : er(e, l), [B, w, l, e]), Q = Wn(i, {
|
|
2435
2436
|
skip: !s || !x,
|
|
2436
2437
|
debounceMs: 300
|
|
2437
|
-
}), M =
|
|
2438
|
+
}), M = Jn(n, {
|
|
2438
2439
|
skip: !n || !h,
|
|
2439
2440
|
debounceMs: 300
|
|
2440
|
-
}), T =
|
|
2441
|
+
}), T = Yn(_, {
|
|
2441
2442
|
skip: !w || !_ && !m,
|
|
2442
2443
|
debounceMs: 300,
|
|
2443
2444
|
prebuiltServerQuery: B ? m : void 0
|
|
2444
|
-
}), C =
|
|
2445
|
+
}), C = Xn(y ?? null, {
|
|
2445
2446
|
skip: !D || !y,
|
|
2446
2447
|
debounceMs: 300
|
|
2447
|
-
}), F =
|
|
2448
|
+
}), F = Zn(u ?? null, {
|
|
2448
2449
|
skip: !v || !u,
|
|
2449
2450
|
debounceMs: 300,
|
|
2450
2451
|
getFieldLabel: S
|
|
2451
2452
|
// Pass label resolver for human-readable binding key display
|
|
2452
|
-
}), P =
|
|
2453
|
+
}), P = tr({
|
|
2453
2454
|
queries: r ? e : [i],
|
|
2454
2455
|
isMultiQueryMode: r,
|
|
2455
2456
|
skip: !s || w || D || v
|
|
@@ -2503,8 +2504,8 @@ function $r(t) {
|
|
|
2503
2504
|
warnings: Fe
|
|
2504
2505
|
};
|
|
2505
2506
|
}
|
|
2506
|
-
function
|
|
2507
|
-
const { externalColorPalette: i, combinedMetrics: e, combinedBreakdowns: n, hasDebounced: r } = t, s = c((C) => C.analysisType), { chartType: o, chartConfig: l, displayConfig: d } = c(Un(
|
|
2507
|
+
function Hr(t) {
|
|
2508
|
+
const { externalColorPalette: i, combinedMetrics: e, combinedBreakdowns: n, hasDebounced: r } = t, s = c((C) => C.analysisType), { chartType: o, chartConfig: l, displayConfig: d } = c(Un(Vr)), f = c((C) => C.userManuallySelectedChart), m = c((C) => C.localPaletteName), y = c((C) => C.setChartTypeManual), u = c((C) => C.setChartConfig), g = c((C) => C.setDisplayConfig), S = c((C) => C.setFunnelChartType), w = c((C) => C.setFunnelChartConfig), D = c((C) => C.setFunnelDisplayConfig), v = c((C) => C.setLocalPaletteName), h = c((C) => C.setUserManuallySelectedChart), x = U(
|
|
2508
2509
|
(C) => {
|
|
2509
2510
|
if (s === "funnel")
|
|
2510
2511
|
S(C);
|
|
@@ -2537,14 +2538,14 @@ function Gr(t) {
|
|
|
2537
2538
|
},
|
|
2538
2539
|
[s, D, g]
|
|
2539
2540
|
), Q = A(
|
|
2540
|
-
() =>
|
|
2541
|
+
() => lr(e, n),
|
|
2541
2542
|
[e, n]
|
|
2542
2543
|
), M = A(() => i ? Array.isArray(i) && typeof i[0] == "string" ? {
|
|
2543
2544
|
name: "custom",
|
|
2544
2545
|
label: "Custom",
|
|
2545
2546
|
colors: i,
|
|
2546
2547
|
gradient: i
|
|
2547
|
-
} : i :
|
|
2548
|
+
} : i : jn(m), [i, m]), T = ae("");
|
|
2548
2549
|
return se(() => {
|
|
2549
2550
|
if (!r || e.length === 0 && n.length === 0) return;
|
|
2550
2551
|
const C = JSON.stringify({
|
|
@@ -2553,7 +2554,7 @@ function Gr(t) {
|
|
|
2553
2554
|
});
|
|
2554
2555
|
if (C === T.current) return;
|
|
2555
2556
|
T.current = C;
|
|
2556
|
-
const F =
|
|
2557
|
+
const F = dr(
|
|
2557
2558
|
e,
|
|
2558
2559
|
n,
|
|
2559
2560
|
o,
|
|
@@ -2599,7 +2600,7 @@ function Gr(t) {
|
|
|
2599
2600
|
setLocalPaletteName: v
|
|
2600
2601
|
};
|
|
2601
2602
|
}
|
|
2602
|
-
function
|
|
2603
|
+
function Or() {
|
|
2603
2604
|
const t = c((u) => u.activeTab), i = c((u) => u.activeView), e = c((u) => u.displayLimit), n = c((u) => u.showFieldModal), r = c((u) => u.fieldModalMode), s = c((u) => u.userManuallySelectedChart), o = c((u) => u.setActiveTab), l = c((u) => u.setActiveView), d = c((u) => u.setDisplayLimit), f = c((u) => u.closeFieldModal), [m, y] = Ce(0);
|
|
2604
2605
|
return {
|
|
2605
2606
|
// State
|
|
@@ -2623,7 +2624,7 @@ function Oe(t) {
|
|
|
2623
2624
|
const i = JSON.stringify(t);
|
|
2624
2625
|
return gt.compressToEncodedURIComponent(i);
|
|
2625
2626
|
}
|
|
2626
|
-
function
|
|
2627
|
+
function jr(t) {
|
|
2627
2628
|
try {
|
|
2628
2629
|
const i = gt.decompressFromEncodedURIComponent(t);
|
|
2629
2630
|
if (!i) return null;
|
|
@@ -2633,7 +2634,7 @@ function Or(t) {
|
|
|
2633
2634
|
return null;
|
|
2634
2635
|
}
|
|
2635
2636
|
}
|
|
2636
|
-
function
|
|
2637
|
+
function Ti(t) {
|
|
2637
2638
|
const i = Oe(t);
|
|
2638
2639
|
return {
|
|
2639
2640
|
ok: i.length <= Se,
|
|
@@ -2641,7 +2642,7 @@ function Di(t) {
|
|
|
2641
2642
|
maxSize: Se
|
|
2642
2643
|
};
|
|
2643
2644
|
}
|
|
2644
|
-
function
|
|
2645
|
+
function zr(t) {
|
|
2645
2646
|
const i = Oe(t);
|
|
2646
2647
|
if (i.length <= Se)
|
|
2647
2648
|
return { encoded: i, queryOnly: !1 };
|
|
@@ -2655,25 +2656,25 @@ function jr(t) {
|
|
|
2655
2656
|
}, n = Oe(e);
|
|
2656
2657
|
return n.length <= Se ? { encoded: n, queryOnly: !0 } : { encoded: null, queryOnly: !0 };
|
|
2657
2658
|
}
|
|
2658
|
-
function
|
|
2659
|
-
const { encoded: i } =
|
|
2659
|
+
function Fi(t) {
|
|
2660
|
+
const { encoded: i } = zr(t);
|
|
2660
2661
|
return i ? `${window.location.origin}${window.location.pathname}#${He}${i}` : null;
|
|
2661
2662
|
}
|
|
2662
|
-
function
|
|
2663
|
+
function Wr() {
|
|
2663
2664
|
if (typeof window > "u") return null;
|
|
2664
2665
|
const t = window.location.hash;
|
|
2665
2666
|
return !t || !t.startsWith(`#${He}`) ? null : t.slice(He.length + 1);
|
|
2666
2667
|
}
|
|
2667
|
-
function
|
|
2668
|
+
function Jr() {
|
|
2668
2669
|
if (typeof window > "u") return;
|
|
2669
2670
|
const t = new URL(window.location.href);
|
|
2670
2671
|
t.hash = "", window.history.replaceState(null, "", t.toString());
|
|
2671
2672
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const t =
|
|
2674
|
-
return t ?
|
|
2673
|
+
function Yr() {
|
|
2674
|
+
const t = Wr();
|
|
2675
|
+
return t ? jr(t) : null;
|
|
2675
2676
|
}
|
|
2676
|
-
function
|
|
2677
|
+
function Xr(t) {
|
|
2677
2678
|
const {
|
|
2678
2679
|
currentQuery: i,
|
|
2679
2680
|
isValidQuery: e,
|
|
@@ -2686,8 +2687,8 @@ function Yr(t) {
|
|
|
2686
2687
|
se(() => {
|
|
2687
2688
|
if (f.current) return;
|
|
2688
2689
|
f.current = !0;
|
|
2689
|
-
const m =
|
|
2690
|
-
m && (d(m),
|
|
2690
|
+
const m = Yr();
|
|
2691
|
+
m && (d(m), Jr());
|
|
2691
2692
|
}, [d]), se(() => {
|
|
2692
2693
|
o && e && o(i);
|
|
2693
2694
|
}, [i, e, o]), se(() => {
|
|
@@ -2698,8 +2699,8 @@ function Yr(t) {
|
|
|
2698
2699
|
});
|
|
2699
2700
|
}, [n, r, s, l]);
|
|
2700
2701
|
}
|
|
2701
|
-
function
|
|
2702
|
-
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } = Vn(), o =
|
|
2702
|
+
function Ai(t = {}) {
|
|
2703
|
+
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } = Vn(), o = Nr(), l = Kr(), d = $r({
|
|
2703
2704
|
queryState: l.queryState,
|
|
2704
2705
|
queryStates: l.queryStates,
|
|
2705
2706
|
isMultiQueryMode: l.isMultiQueryMode,
|
|
@@ -2728,7 +2729,7 @@ function Fi(t = {}) {
|
|
|
2728
2729
|
ee,
|
|
2729
2730
|
te,
|
|
2730
2731
|
ne
|
|
2731
|
-
]), Me = A(() => m === "retention" ? Qe !== null : m === "flow" ? O !== null : m === "funnel" ? H !== null : l.isValidQuery ?? !1, [m, Qe, O, H, l.isValidQuery]), I =
|
|
2732
|
+
]), Me = A(() => m === "retention" ? Qe !== null : m === "flow" ? O !== null : m === "funnel" ? H !== null : l.isValidQuery ?? !1, [m, Qe, O, H, l.isValidQuery]), I = Gr({
|
|
2732
2733
|
currentQuery: l.currentQuery,
|
|
2733
2734
|
allQueries: l.allQueries,
|
|
2734
2735
|
multiQueryConfig: l.multiQueryConfig,
|
|
@@ -2746,13 +2747,13 @@ function Fi(t = {}) {
|
|
|
2746
2747
|
serverRetentionQuery: Qe,
|
|
2747
2748
|
// Retention mode: pass validation for debug panel
|
|
2748
2749
|
retentionValidation: qt
|
|
2749
|
-
}), q =
|
|
2750
|
+
}), q = Hr({
|
|
2750
2751
|
externalColorPalette: e,
|
|
2751
2752
|
combinedMetrics: d.combinedMetrics,
|
|
2752
2753
|
combinedBreakdowns: d.combinedBreakdowns,
|
|
2753
2754
|
hasDebounced: I.hasDebounced
|
|
2754
|
-
}), V =
|
|
2755
|
-
|
|
2755
|
+
}), V = Or();
|
|
2756
|
+
Xr({
|
|
2756
2757
|
currentQuery: l.currentQuery,
|
|
2757
2758
|
isValidQuery: l.isValidQuery ?? !1,
|
|
2758
2759
|
chartType: q.chartType,
|
|
@@ -3056,7 +3057,7 @@ function Fi(t = {}) {
|
|
|
3056
3057
|
getAnalysisType: Mn
|
|
3057
3058
|
};
|
|
3058
3059
|
}
|
|
3059
|
-
function
|
|
3060
|
+
function Zr(t, i) {
|
|
3060
3061
|
const e = [];
|
|
3061
3062
|
if (!i?.cubes)
|
|
3062
3063
|
return e;
|
|
@@ -3082,7 +3083,7 @@ function Xr(t, i) {
|
|
|
3082
3083
|
}
|
|
3083
3084
|
return e;
|
|
3084
3085
|
}
|
|
3085
|
-
function
|
|
3086
|
+
function ei(t) {
|
|
3086
3087
|
const i = [];
|
|
3087
3088
|
for (let e = 0; e < t.length; e++) {
|
|
3088
3089
|
const n = t[e], r = n.query;
|
|
@@ -3094,17 +3095,17 @@ function Zr(t) {
|
|
|
3094
3095
|
}
|
|
3095
3096
|
return i;
|
|
3096
3097
|
}
|
|
3097
|
-
function
|
|
3098
|
+
function ti(t, i) {
|
|
3098
3099
|
if (typeof t.dimension == "string")
|
|
3099
3100
|
return !0;
|
|
3100
3101
|
const e = pt(i);
|
|
3101
3102
|
return e ? t.dimension.some((n) => n.cube === e) : !1;
|
|
3102
3103
|
}
|
|
3103
|
-
function
|
|
3104
|
+
function ni(t, i) {
|
|
3104
3105
|
const e = [];
|
|
3105
3106
|
for (let n = 0; n < i.length; n++) {
|
|
3106
3107
|
const r = i[n];
|
|
3107
|
-
if (!
|
|
3108
|
+
if (!ti(t, r.query)) {
|
|
3108
3109
|
const s = pt(r.query) || "unknown";
|
|
3109
3110
|
e.push({
|
|
3110
3111
|
type: "cross_cube",
|
|
@@ -3121,15 +3122,15 @@ function mt(t) {
|
|
|
3121
3122
|
message: `Invalid time window format "${t}". Expected ISO 8601 duration (e.g., P7D, PT1H)`
|
|
3122
3123
|
} : null;
|
|
3123
3124
|
}
|
|
3124
|
-
function
|
|
3125
|
+
function Qi(t, i) {
|
|
3125
3126
|
const e = [], n = [];
|
|
3126
3127
|
t.steps.length < 2 && e.push({
|
|
3127
3128
|
type: "general",
|
|
3128
3129
|
message: "Funnel requires at least 2 steps"
|
|
3129
|
-
}), t.bindingKey?.dimension ? (e.push(...
|
|
3130
|
+
}), t.bindingKey?.dimension ? (e.push(...Zr(t.bindingKey, i)), e.push(...ni(t.bindingKey, t.steps))) : e.push({
|
|
3130
3131
|
type: "binding_key",
|
|
3131
3132
|
message: "Binding key dimension is required"
|
|
3132
|
-
}), e.push(...
|
|
3133
|
+
}), e.push(...ei(t.steps));
|
|
3133
3134
|
for (let s = 0; s < t.steps.length; s++) {
|
|
3134
3135
|
const o = t.steps[s], l = mt(o.timeToConvert);
|
|
3135
3136
|
l && (l.stepIndex = s, e.push(l));
|
|
@@ -3144,10 +3145,10 @@ function Ai(t, i) {
|
|
|
3144
3145
|
warnings: n
|
|
3145
3146
|
};
|
|
3146
3147
|
}
|
|
3147
|
-
function
|
|
3148
|
+
function Mi(t, i) {
|
|
3148
3149
|
return i < 2 ? { isValid: !1, message: "Add at least 2 steps for funnel" } : t?.dimension ? typeof t.dimension == "string" && !t.dimension ? { isValid: !1, message: "Select a binding key dimension" } : Array.isArray(t.dimension) && t.dimension.length === 0 ? { isValid: !1, message: "Select a binding key dimension" } : { isValid: !0 } : { isValid: !1, message: "Select a binding key dimension" };
|
|
3149
3150
|
}
|
|
3150
|
-
function
|
|
3151
|
+
function Ri(t) {
|
|
3151
3152
|
if (!t?.cubes) return [];
|
|
3152
3153
|
const i = [];
|
|
3153
3154
|
for (const e of t.cubes)
|
|
@@ -3160,7 +3161,7 @@ function Mi(t) {
|
|
|
3160
3161
|
});
|
|
3161
3162
|
return i;
|
|
3162
3163
|
}
|
|
3163
|
-
function
|
|
3164
|
+
function ki(t) {
|
|
3164
3165
|
if (!t?.dimension) return "Select binding key...";
|
|
3165
3166
|
if (typeof t.dimension == "string")
|
|
3166
3167
|
return t.dimension.split(".")[1] || t.dimension;
|
|
@@ -3171,41 +3172,41 @@ function Ri(t) {
|
|
|
3171
3172
|
return "Select binding key...";
|
|
3172
3173
|
}
|
|
3173
3174
|
export {
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3175
|
+
ni as A,
|
|
3176
|
+
Mi as B,
|
|
3177
|
+
Ri as C,
|
|
3178
|
+
ki as D,
|
|
3179
|
+
gi as E,
|
|
3180
|
+
zr as F,
|
|
3180
3181
|
Ue as G,
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3182
|
+
Wr as H,
|
|
3183
|
+
hi as I,
|
|
3184
|
+
Nr as J,
|
|
3185
|
+
pr as a,
|
|
3185
3186
|
c as b,
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3187
|
+
pi as c,
|
|
3188
|
+
Ci as d,
|
|
3189
|
+
wi as e,
|
|
3190
|
+
Vr as f,
|
|
3191
|
+
bi as g,
|
|
3192
|
+
Si as h,
|
|
3193
|
+
vi as i,
|
|
3194
|
+
Er as j,
|
|
3195
|
+
Pr as k,
|
|
3196
|
+
Ur as l,
|
|
3197
|
+
_r as m,
|
|
3198
|
+
xi as n,
|
|
3199
|
+
Di as o,
|
|
3199
3200
|
Oe as p,
|
|
3200
|
-
|
|
3201
|
-
|
|
3201
|
+
jr as q,
|
|
3202
|
+
Fi as r,
|
|
3202
3203
|
Je as s,
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3204
|
+
Yr as t,
|
|
3205
|
+
Ai as u,
|
|
3206
|
+
Lr as v,
|
|
3207
|
+
Ti as w,
|
|
3208
|
+
Qi as x,
|
|
3209
|
+
Zr as y,
|
|
3210
|
+
ei as z
|
|
3210
3211
|
};
|
|
3211
|
-
//# sourceMappingURL=analysis-builder-shared-
|
|
3212
|
+
//# sourceMappingURL=analysis-builder-shared-BkwUHObk.js.map
|