drizzle-cube 0.3.32 → 0.4.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/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-B2rGcu1X.js → mcp-transport-Bbz3qrIy.js} +4324 -3230
- package/dist/adapters/mcp-transport-CXF4E5QJ.cjs +257 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/adapters/utils.cjs +8 -8
- package/dist/adapters/utils.d.ts +2 -137
- package/dist/adapters/utils.js +1347 -1356
- package/dist/client/chunks/{DashboardEditModal-rLcmZpe_.js → DashboardEditModal-Bv7e3Q7O.js} +2 -2
- package/dist/client/chunks/{DashboardEditModal-rLcmZpe_.js.map → DashboardEditModal-Bv7e3Q7O.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-DCt5C58c.js → analysis-builder-BfH-w92z.js} +2962 -3019
- package/dist/client/chunks/analysis-builder-BfH-w92z.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-ysrRYGiU.js → analysis-builder-shared-DsbdRCzz.js} +361 -361
- package/dist/client/chunks/{analysis-builder-shared-ysrRYGiU.js.map → analysis-builder-shared-DsbdRCzz.js.map} +1 -1
- package/dist/client/chunks/useDirtyStateTracking-CTS_m9mg.js.map +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisResultsPanel.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +18 -6
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/queries/useDryRunQuery.d.ts +14 -48
- package/dist/client/hooks/useAnalysisBuilderHook.d.ts +6 -33
- package/dist/client/hooks/useAnalysisQueryExecution.d.ts +7 -7
- package/dist/client/hooks.js +194 -22
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/shared/types.d.ts +27 -0
- package/dist/client/styles.css +1 -1
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +49 -49
- package/dist/server/index.d.ts +1727 -547
- package/dist/server/index.js +4836 -3715
- package/package.json +1 -1
- package/dist/adapters/mcp-transport-DeD7YevT.cjs +0 -257
- package/dist/client/chunks/analysis-builder-DCt5C58c.js.map +0 -1
- package/dist/client/chunks/hooks-CdyIO1-j.js +0 -236
- package/dist/client/chunks/hooks-CdyIO1-j.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as b, jsx as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { l as
|
|
4
|
-
import { b as
|
|
5
|
-
import { u as
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as
|
|
8
|
-
import { Y as $, Z as we, _ as W, $ as J, a0 as Y, S as
|
|
9
|
-
import { F as
|
|
10
|
-
import { n as
|
|
11
|
-
import { c as
|
|
12
|
-
import {
|
|
13
|
-
function
|
|
2
|
+
import Pe, { useState as Ce, useRef as ae, useEffect as se, memo as kn, useContext as yt, createContext as In, useMemo as A, useCallback as U } from "react";
|
|
3
|
+
import { l as qn, g as Bn } from "./syntaxHighlighting-DAT9C6Ss.js";
|
|
4
|
+
import { b as nt } from "./icons-DRreo6m8.js";
|
|
5
|
+
import { u as Nn, g as Vn } from "./providers-D2xswCYu.js";
|
|
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
|
+
import { d as _n, R as Ln, a as Kn, g as $n, D as Gn } from "./retention-CzCo8262.js";
|
|
8
|
+
import { Y as $, Z as we, _ as W, $ as J, a0 as Y, S as Hn, K as ht, a1 as On } from "./DashboardEditModal-Bv7e3Q7O.js";
|
|
9
|
+
import { F as at, b as ot } from "./flow-utils-CjQZG5qq.js";
|
|
10
|
+
import { n as jn, u as zn, a as Wn, b as Jn, d as Yn, o as Xn } from "./useDirtyStateTracking-CTS_m9mg.js";
|
|
11
|
+
import { c as Zn, a as pt } from "./funnel-utils-CyonoNeC.js";
|
|
12
|
+
import { useDryRunQueries as er, useDryRunQuery as Ne } from "../hooks.js";
|
|
13
|
+
function tr(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,27 +90,27 @@ function rr(t) {
|
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function nr(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 tr(t);
|
|
100
100
|
}
|
|
101
101
|
function pe(t) {
|
|
102
102
|
return t.toISOString().split("T")[0];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function rr(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);
|
|
108
108
|
return s.setUTCDate(s.getUTCDate() - n + 1), s.setUTCHours(0, 0, 0, 0), { start: s, end: r };
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Ct(t, i) {
|
|
111
111
|
for (const e of t)
|
|
112
112
|
if ("type" in e && "filters" in e) {
|
|
113
|
-
const r =
|
|
113
|
+
const r = Ct(e.filters, i);
|
|
114
114
|
if (r) return r;
|
|
115
115
|
} else if ("member" in e) {
|
|
116
116
|
const n = e;
|
|
@@ -118,21 +118,21 @@ function pt(t, i) {
|
|
|
118
118
|
return { dateRange: n.dateRange };
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const e =
|
|
121
|
+
function wt(t, i) {
|
|
122
|
+
const e = Ct(i, t);
|
|
123
123
|
if (!e?.dateRange) return;
|
|
124
|
-
const n =
|
|
124
|
+
const n = nr(e.dateRange);
|
|
125
125
|
if (!n) return;
|
|
126
|
-
const r =
|
|
126
|
+
const r = rr(n.start, n.end);
|
|
127
127
|
return [
|
|
128
128
|
[pe(n.start), pe(n.end)],
|
|
129
129
|
[pe(r.start), pe(r.end)]
|
|
130
130
|
];
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function bt(t, i) {
|
|
133
133
|
return t.reduce((e, n) => {
|
|
134
134
|
if ("type" in n && "filters" in n) {
|
|
135
|
-
const r = n, s =
|
|
135
|
+
const r = n, s = bt(r.filters, i);
|
|
136
136
|
s.length > 0 && e.push({ type: r.type, filters: s });
|
|
137
137
|
} else if ("member" in n) {
|
|
138
138
|
const r = n;
|
|
@@ -147,7 +147,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
147
147
|
let o = e;
|
|
148
148
|
if (!r)
|
|
149
149
|
for (const d of s)
|
|
150
|
-
o =
|
|
150
|
+
o = bt(o, d);
|
|
151
151
|
const l = {
|
|
152
152
|
measures: t.map((d) => d.field),
|
|
153
153
|
dimensions: i.filter((d) => !d.isTimeDimension).map((d) => d.field),
|
|
@@ -157,7 +157,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
157
157
|
granularity: d.granularity || "day"
|
|
158
158
|
};
|
|
159
159
|
if (d.enableComparison) {
|
|
160
|
-
const m =
|
|
160
|
+
const m = wt(d.field, e);
|
|
161
161
|
m && (f.compareDateRange = m);
|
|
162
162
|
}
|
|
163
163
|
return f;
|
|
@@ -167,7 +167,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
167
167
|
};
|
|
168
168
|
return l.measures?.length === 0 && delete l.measures, l.dimensions?.length === 0 && delete l.dimensions, l.timeDimensions?.length === 0 && delete l.timeDimensions, l;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const ir = "drizzle-cube-analysis-builder-v3";
|
|
171
171
|
function R() {
|
|
172
172
|
return {
|
|
173
173
|
metrics: [],
|
|
@@ -178,7 +178,7 @@ function R() {
|
|
|
178
178
|
validationError: null
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const Ue = ({
|
|
182
182
|
code: t,
|
|
183
183
|
language: i,
|
|
184
184
|
title: e,
|
|
@@ -187,14 +187,14 @@ const Pe = ({
|
|
|
187
187
|
className: s = "",
|
|
188
188
|
headerRight: o
|
|
189
189
|
}) => {
|
|
190
|
-
const [l, d] = Ce(!1), f = ae(null), m =
|
|
190
|
+
const [l, d] = Ce(!1), f = ae(null), m = nt("copy"), y = nt("check");
|
|
191
191
|
se(() => {
|
|
192
192
|
if (!f.current) return;
|
|
193
193
|
const g = f.current;
|
|
194
194
|
let S = !0;
|
|
195
|
-
return g.textContent = t,
|
|
195
|
+
return g.textContent = t, qn().then(() => {
|
|
196
196
|
if (!S) return;
|
|
197
|
-
const w =
|
|
197
|
+
const w = Bn();
|
|
198
198
|
w && (g.innerHTML = w.highlight(t, { language: i }).value);
|
|
199
199
|
}).catch(() => {
|
|
200
200
|
S && (g.textContent = t);
|
|
@@ -249,23 +249,23 @@ const Pe = ({
|
|
|
249
249
|
)
|
|
250
250
|
] });
|
|
251
251
|
};
|
|
252
|
-
function
|
|
252
|
+
function St(t) {
|
|
253
253
|
return t.isTimeDimension;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
return t.find(
|
|
255
|
+
function sr(t) {
|
|
256
|
+
return t.find(St);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function ar(t) {
|
|
259
259
|
return t.find((i) => !i.isTimeDimension);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function je(t) {
|
|
262
262
|
return t.filter((i) => !i.isTimeDimension);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return t.filter(
|
|
264
|
+
function vt(t) {
|
|
265
|
+
return t.filter(St);
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
const n = i.length, r =
|
|
267
|
+
function ze(t, i, e) {
|
|
268
|
+
const n = i.length, r = je(e).length, s = vt(e).length, o = e.length;
|
|
269
269
|
switch (t) {
|
|
270
270
|
// Always available charts
|
|
271
271
|
case "table":
|
|
@@ -310,7 +310,7 @@ function je(t, i, e) {
|
|
|
310
310
|
return { available: !0 };
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function or(t, i) {
|
|
314
314
|
const e = [
|
|
315
315
|
"activityGrid",
|
|
316
316
|
"area",
|
|
@@ -329,21 +329,21 @@ function cr(t, i) {
|
|
|
329
329
|
"treemap"
|
|
330
330
|
], n = {};
|
|
331
331
|
for (const r of e)
|
|
332
|
-
n[r] =
|
|
332
|
+
n[r] = ze(r, t, i);
|
|
333
333
|
return n;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
if (
|
|
335
|
+
function xt(t, i, e) {
|
|
336
|
+
if (ze(e, t, i).available || t.length === 0 && i.length === 0)
|
|
337
337
|
return e;
|
|
338
|
-
const r =
|
|
338
|
+
const r = vt(i).length > 0, s = je(i).length > 0, o = t.length > 0;
|
|
339
339
|
return r && o ? "line" : s && o ? "bar" : o && !s && !r ? "kpiNumber" : "table";
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const n =
|
|
341
|
+
function Ve(t, i, e) {
|
|
342
|
+
const n = xt(t, i, e), r = lr(n, t, i);
|
|
343
343
|
return { chartType: n, chartConfig: r };
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const n =
|
|
345
|
+
function lr(t, i, e) {
|
|
346
|
+
const n = sr(e), r = ar(e), s = je(e), o = e;
|
|
347
347
|
switch (t) {
|
|
348
348
|
case "line":
|
|
349
349
|
case "area":
|
|
@@ -414,35 +414,35 @@ function dr(t, i, e) {
|
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
if (n &&
|
|
417
|
+
function cr(t, i, e, n) {
|
|
418
|
+
if (n && ze(e, t, i).available)
|
|
419
419
|
return null;
|
|
420
|
-
const r =
|
|
420
|
+
const r = xt(t, i, e);
|
|
421
421
|
return r !== e ? r : null;
|
|
422
422
|
}
|
|
423
423
|
function j(t) {
|
|
424
424
|
return typeof t == "string" ? t : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t ?? "");
|
|
425
425
|
}
|
|
426
|
-
const
|
|
426
|
+
const dr = {
|
|
427
427
|
good: "bg-dc-success-bg text-dc-success border-dc-success",
|
|
428
428
|
warning: "bg-dc-warning-bg text-dc-warning border-dc-warning",
|
|
429
429
|
critical: "bg-dc-danger-bg text-dc-error border-dc-error"
|
|
430
|
-
},
|
|
430
|
+
}, ur = {
|
|
431
431
|
critical: "bg-dc-danger-bg text-dc-error",
|
|
432
432
|
warning: "bg-dc-warning-bg text-dc-warning",
|
|
433
433
|
suggestion: "bg-dc-accent-bg text-dc-accent"
|
|
434
|
-
},
|
|
434
|
+
}, fr = {
|
|
435
435
|
high: "text-dc-error",
|
|
436
436
|
medium: "text-dc-warning",
|
|
437
437
|
low: "text-dc-text-muted"
|
|
438
438
|
};
|
|
439
|
-
function
|
|
439
|
+
function mr({ assessment: t, reason: i }) {
|
|
440
440
|
const e = {
|
|
441
441
|
good: "Good",
|
|
442
442
|
warning: "Warning",
|
|
443
443
|
critical: "Critical"
|
|
444
444
|
};
|
|
445
|
-
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${
|
|
445
|
+
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${dr[t]}`, children: [
|
|
446
446
|
/* @__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
447
|
t === "good" && "✓ ",
|
|
448
448
|
t === "warning" && "⚠ ",
|
|
@@ -452,9 +452,9 @@ function gr({ assessment: t, reason: i }) {
|
|
|
452
452
|
/* @__PURE__ */ p("p", { className: "dc:text-sm", children: j(i) })
|
|
453
453
|
] });
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function yr({ issue: t }) {
|
|
456
456
|
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 ${
|
|
457
|
+
/* @__PURE__ */ b("span", { className: `dc:text-sm ${fr[t.severity]}`, children: [
|
|
458
458
|
t.severity === "high" && "●",
|
|
459
459
|
t.severity === "medium" && "○",
|
|
460
460
|
t.severity === "low" && "○"
|
|
@@ -462,8 +462,8 @@ function hr({ issue: t }) {
|
|
|
462
462
|
/* @__PURE__ */ p("span", { className: "dc:text-sm text-dc-text-secondary", children: j(t.description) })
|
|
463
463
|
] });
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
const [i, e] =
|
|
465
|
+
function lt({ text: t }) {
|
|
466
|
+
const [i, e] = Pe.useState(!1);
|
|
467
467
|
return /* @__PURE__ */ p(
|
|
468
468
|
"button",
|
|
469
469
|
{
|
|
@@ -480,7 +480,7 @@ function ot({ text: t }) {
|
|
|
480
480
|
}
|
|
481
481
|
);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function gr({ rec: t }) {
|
|
484
484
|
const i = {
|
|
485
485
|
index: "INDEX",
|
|
486
486
|
table: "TABLE",
|
|
@@ -492,7 +492,7 @@ function pr({ rec: t }) {
|
|
|
492
492
|
/* @__PURE__ */ p(
|
|
493
493
|
"span",
|
|
494
494
|
{
|
|
495
|
-
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${
|
|
495
|
+
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${ur[t.severity]}`,
|
|
496
496
|
children: i[t.type]
|
|
497
497
|
}
|
|
498
498
|
),
|
|
@@ -500,11 +500,11 @@ function pr({ rec: t }) {
|
|
|
500
500
|
] }),
|
|
501
501
|
/* @__PURE__ */ p("p", { className: "dc:text-sm text-dc-text-secondary dc:mb-3", children: j(t.description) }),
|
|
502
502
|
t.sql && /* @__PURE__ */ p("div", { className: "dc:mt-2", children: /* @__PURE__ */ p(
|
|
503
|
-
|
|
503
|
+
Ue,
|
|
504
504
|
{
|
|
505
505
|
code: t.sql,
|
|
506
506
|
language: "sql",
|
|
507
|
-
headerRight: /* @__PURE__ */ p(
|
|
507
|
+
headerRight: /* @__PURE__ */ p(lt, { text: t.sql })
|
|
508
508
|
}
|
|
509
509
|
) }),
|
|
510
510
|
t.cubeCode && /* @__PURE__ */ b("div", { className: "dc:mt-2", children: [
|
|
@@ -515,7 +515,7 @@ function pr({ rec: t }) {
|
|
|
515
515
|
] }),
|
|
516
516
|
/* @__PURE__ */ b("div", { className: "dc:relative", children: [
|
|
517
517
|
/* @__PURE__ */ p("pre", { className: "dc:p-3 dc:text-xs bg-dc-surface-secondary dc:rounded dc:overflow-x-auto dc:font-mono text-dc-text", children: t.cubeCode }),
|
|
518
|
-
/* @__PURE__ */ p("div", { className: "dc:absolute dc:top-1 dc:right-1", children: /* @__PURE__ */ p(
|
|
518
|
+
/* @__PURE__ */ p("div", { className: "dc:absolute dc:top-1 dc:right-1", children: /* @__PURE__ */ p(lt, { text: t.cubeCode }) })
|
|
519
519
|
] })
|
|
520
520
|
] }),
|
|
521
521
|
t.estimatedImpact && /* @__PURE__ */ b("p", { className: "dc:text-xs text-dc-text-muted dc:mt-2", children: [
|
|
@@ -525,14 +525,14 @@ function pr({ rec: t }) {
|
|
|
525
525
|
] })
|
|
526
526
|
] });
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function hr({ analysis: t, onClose: i, onClear: e }) {
|
|
529
529
|
const n = i || e;
|
|
530
|
-
return
|
|
530
|
+
return Pe.useEffect(() => {
|
|
531
531
|
const r = (s) => {
|
|
532
532
|
s.key === "Escape" && n && n();
|
|
533
533
|
};
|
|
534
534
|
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
535
|
-
}, [n]),
|
|
535
|
+
}, [n]), Pe.useEffect(() => (document.body.style.overflow = "hidden", () => {
|
|
536
536
|
document.body.style.overflow = "";
|
|
537
537
|
}), []), /* @__PURE__ */ b("div", { className: "dc:fixed dc:inset-0 dc:z-50 dc:flex dc:items-center dc:justify-center dc:p-4 bg-black/50", children: [
|
|
538
538
|
/* @__PURE__ */ p(
|
|
@@ -561,7 +561,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
561
561
|
] }),
|
|
562
562
|
/* @__PURE__ */ b("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-6 dc:py-4 dc:space-y-6", children: [
|
|
563
563
|
/* @__PURE__ */ p(
|
|
564
|
-
|
|
564
|
+
mr,
|
|
565
565
|
{
|
|
566
566
|
assessment: t.assessment,
|
|
567
567
|
reason: t.assessmentReason
|
|
@@ -581,7 +581,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
581
581
|
t.issues.length,
|
|
582
582
|
")"
|
|
583
583
|
] }),
|
|
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(
|
|
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(yr, { issue: r }, s)) })
|
|
585
585
|
] }),
|
|
586
586
|
t.recommendations && t.recommendations.length > 0 && /* @__PURE__ */ b("div", { children: [
|
|
587
587
|
/* @__PURE__ */ b("h4", { className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-3", children: [
|
|
@@ -589,7 +589,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
589
589
|
t.recommendations.length,
|
|
590
590
|
")"
|
|
591
591
|
] }),
|
|
592
|
-
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(
|
|
592
|
+
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(gr, { rec: r }, s)) })
|
|
593
593
|
] }),
|
|
594
594
|
(!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
595
|
] }),
|
|
@@ -611,7 +611,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
611
611
|
] })
|
|
612
612
|
] });
|
|
613
613
|
}
|
|
614
|
-
const
|
|
614
|
+
const yi = kn(function({
|
|
615
615
|
sql: i,
|
|
616
616
|
sqlLoading: e = !1,
|
|
617
617
|
sqlError: n,
|
|
@@ -658,7 +658,7 @@ const hi = Rn(function({
|
|
|
658
658
|
/* @__PURE__ */ p("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2", children: v }),
|
|
659
659
|
/* @__PURE__ */ p("div", { className: "text-dc-error dc:text-sm bg-dc-danger-bg dc:p-3 dc:rounded dc:border border-dc-error", style: { height: h }, children: n.message })
|
|
660
660
|
] }) : i ? /* @__PURE__ */ p(
|
|
661
|
-
|
|
661
|
+
Ue,
|
|
662
662
|
{
|
|
663
663
|
code: M,
|
|
664
664
|
language: "sql",
|
|
@@ -731,7 +731,7 @@ const hi = Rn(function({
|
|
|
731
731
|
s.summary.usedIndexes.join(", ")
|
|
732
732
|
] }),
|
|
733
733
|
/* @__PURE__ */ p(
|
|
734
|
-
|
|
734
|
+
Ue,
|
|
735
735
|
{
|
|
736
736
|
code: s.raw,
|
|
737
737
|
language: "sql",
|
|
@@ -747,7 +747,7 @@ const hi = Rn(function({
|
|
|
747
747
|
u.message
|
|
748
748
|
] }),
|
|
749
749
|
_ && m && /* @__PURE__ */ p(
|
|
750
|
-
|
|
750
|
+
hr,
|
|
751
751
|
{
|
|
752
752
|
analysis: m,
|
|
753
753
|
onClose: C
|
|
@@ -755,7 +755,7 @@ const hi = Rn(function({
|
|
|
755
755
|
)
|
|
756
756
|
] });
|
|
757
757
|
});
|
|
758
|
-
function
|
|
758
|
+
function ct() {
|
|
759
759
|
return {
|
|
760
760
|
metrics: [],
|
|
761
761
|
breakdowns: [],
|
|
@@ -765,10 +765,10 @@ function lt() {
|
|
|
765
765
|
validationError: null
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function pr(t) {
|
|
769
769
|
return t.map((i) => i.field);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Cr(t, i) {
|
|
772
772
|
const e = [], n = [];
|
|
773
773
|
for (const r of t)
|
|
774
774
|
if (r.isTimeDimension) {
|
|
@@ -777,7 +777,7 @@ function br(t, i) {
|
|
|
777
777
|
granularity: r.granularity || "day"
|
|
778
778
|
};
|
|
779
779
|
if (r.enableComparison) {
|
|
780
|
-
const o =
|
|
780
|
+
const o = wt(r.field, i);
|
|
781
781
|
o && (s.compareDateRange = o);
|
|
782
782
|
}
|
|
783
783
|
n.push(s);
|
|
@@ -785,24 +785,24 @@ function br(t, i) {
|
|
|
785
785
|
e.push(r.field);
|
|
786
786
|
return { dimensions: e, timeDimensions: n };
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
const { dimensions: i, timeDimensions: e } =
|
|
788
|
+
function wr(t) {
|
|
789
|
+
const { dimensions: i, timeDimensions: e } = Cr(
|
|
790
790
|
t.breakdowns,
|
|
791
791
|
t.filters
|
|
792
792
|
), n = {
|
|
793
|
-
measures:
|
|
793
|
+
measures: pr(t.metrics),
|
|
794
794
|
dimensions: i
|
|
795
795
|
};
|
|
796
796
|
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
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function br(t) {
|
|
799
799
|
return t.map((i, e) => ({
|
|
800
800
|
id: $(),
|
|
801
801
|
field: i,
|
|
802
802
|
label: we(e)
|
|
803
803
|
}));
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Sr(t) {
|
|
806
806
|
const i = [];
|
|
807
807
|
if (t.dimensions)
|
|
808
808
|
for (const e of t.dimensions)
|
|
@@ -824,24 +824,24 @@ function xr(t) {
|
|
|
824
824
|
}
|
|
825
825
|
return i;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function dt(t) {
|
|
828
828
|
return {
|
|
829
|
-
metrics:
|
|
830
|
-
breakdowns:
|
|
829
|
+
metrics: br(t.measures || []),
|
|
830
|
+
breakdowns: Sr(t),
|
|
831
831
|
filters: t.filters || [],
|
|
832
832
|
order: t.order,
|
|
833
833
|
validationStatus: "idle",
|
|
834
834
|
validationError: null
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function vr(t) {
|
|
838
838
|
return typeof t == "object" && t !== null && "queries" in t && Array.isArray(t.queries);
|
|
839
839
|
}
|
|
840
840
|
const K = {
|
|
841
841
|
type: "query",
|
|
842
842
|
createInitial() {
|
|
843
843
|
return {
|
|
844
|
-
queryStates: [
|
|
844
|
+
queryStates: [ct()],
|
|
845
845
|
activeQueryIndex: 0,
|
|
846
846
|
mergeStrategy: "concat"
|
|
847
847
|
};
|
|
@@ -864,22 +864,22 @@ const K = {
|
|
|
864
864
|
`Cannot load ${t.analysisType} config with query adapter`
|
|
865
865
|
);
|
|
866
866
|
const i = t;
|
|
867
|
-
if (
|
|
868
|
-
const e = i.query, n = e.queries.map(
|
|
869
|
-
return n.length === 0 && n.push(
|
|
867
|
+
if (vr(i.query)) {
|
|
868
|
+
const e = i.query, n = e.queries.map(dt);
|
|
869
|
+
return n.length === 0 && n.push(ct()), {
|
|
870
870
|
queryStates: n,
|
|
871
871
|
activeQueryIndex: 0,
|
|
872
872
|
mergeStrategy: e.mergeStrategy || "concat"
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
875
|
return {
|
|
876
|
-
queryStates: [
|
|
876
|
+
queryStates: [dt(i.query)],
|
|
877
877
|
activeQueryIndex: 0,
|
|
878
878
|
mergeStrategy: "concat"
|
|
879
879
|
};
|
|
880
880
|
},
|
|
881
881
|
save(t, i, e) {
|
|
882
|
-
const n = t.queryStates.map(
|
|
882
|
+
const n = t.queryStates.map(wr), s = n.length === 1 && t.mergeStrategy === "concat" ? n[0] : {
|
|
883
883
|
queries: n,
|
|
884
884
|
mergeStrategy: t.mergeStrategy
|
|
885
885
|
};
|
|
@@ -926,9 +926,9 @@ const K = {
|
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
928
|
}, E = /* @__PURE__ */ new Map();
|
|
929
|
-
let
|
|
930
|
-
function
|
|
931
|
-
|
|
929
|
+
let _e = !1;
|
|
930
|
+
function Ee() {
|
|
931
|
+
_e || (E.has("query") || E.set("query", K), E.has("funnel") || E.set("funnel", W), E.has("flow") || E.set("flow", J), E.has("retention") || E.set("retention", Y), _e = !0);
|
|
932
932
|
}
|
|
933
933
|
const L = {
|
|
934
934
|
/**
|
|
@@ -951,7 +951,7 @@ const L = {
|
|
|
951
951
|
* @throws Error if no adapter is registered for the type
|
|
952
952
|
*/
|
|
953
953
|
get(t) {
|
|
954
|
-
|
|
954
|
+
Ee();
|
|
955
955
|
const i = E.get(t);
|
|
956
956
|
if (!i)
|
|
957
957
|
throw new Error(
|
|
@@ -967,7 +967,7 @@ const L = {
|
|
|
967
967
|
* @returns True if an adapter is registered
|
|
968
968
|
*/
|
|
969
969
|
has(t) {
|
|
970
|
-
return
|
|
970
|
+
return Ee(), E.has(t);
|
|
971
971
|
},
|
|
972
972
|
/**
|
|
973
973
|
* Get all registered analysis types.
|
|
@@ -976,7 +976,7 @@ const L = {
|
|
|
976
976
|
* @returns Array of registered types
|
|
977
977
|
*/
|
|
978
978
|
getRegisteredTypes() {
|
|
979
|
-
return
|
|
979
|
+
return Ee(), Array.from(E.keys());
|
|
980
980
|
},
|
|
981
981
|
/**
|
|
982
982
|
* Clear all registered adapters.
|
|
@@ -984,9 +984,9 @@ const L = {
|
|
|
984
984
|
* Note: Built-in adapters will be re-initialized on next access.
|
|
985
985
|
*/
|
|
986
986
|
clear() {
|
|
987
|
-
E.clear(),
|
|
987
|
+
E.clear(), _e = !1;
|
|
988
988
|
}
|
|
989
|
-
},
|
|
989
|
+
}, Dt = () => ({
|
|
990
990
|
analysisType: "query",
|
|
991
991
|
// Use adapter defaults as single source of truth for chart configuration
|
|
992
992
|
charts: {
|
|
@@ -1004,8 +1004,8 @@ const L = {
|
|
|
1004
1004
|
},
|
|
1005
1005
|
userManuallySelectedChart: !1,
|
|
1006
1006
|
localPaletteName: "default"
|
|
1007
|
-
}),
|
|
1008
|
-
...
|
|
1007
|
+
}), xr = (t, i) => ({
|
|
1008
|
+
...Dt(),
|
|
1009
1009
|
setAnalysisType: (e) => {
|
|
1010
1010
|
t((n) => {
|
|
1011
1011
|
const r = { ...n.charts };
|
|
@@ -1224,12 +1224,12 @@ const L = {
|
|
|
1224
1224
|
...m
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
|
-
}),
|
|
1227
|
+
}), Le = () => ({
|
|
1228
1228
|
queryStates: [R()],
|
|
1229
1229
|
activeQueryIndex: 0,
|
|
1230
1230
|
mergeStrategy: "concat"
|
|
1231
|
-
}),
|
|
1232
|
-
...
|
|
1231
|
+
}), Dr = (t, i) => ({
|
|
1232
|
+
...Le(),
|
|
1233
1233
|
// ==========================================================================
|
|
1234
1234
|
// Query State Management
|
|
1235
1235
|
// ==========================================================================
|
|
@@ -1390,7 +1390,7 @@ const L = {
|
|
|
1390
1390
|
member: y.field,
|
|
1391
1391
|
operator: "inDateRange",
|
|
1392
1392
|
values: [],
|
|
1393
|
-
dateRange:
|
|
1393
|
+
dateRange: jn("last_n_months", 3)
|
|
1394
1394
|
};
|
|
1395
1395
|
f[m] = {
|
|
1396
1396
|
...f[m],
|
|
@@ -1499,7 +1499,7 @@ const L = {
|
|
|
1499
1499
|
queryLabels: r.map((s, o) => `Q${o + 1}`)
|
|
1500
1500
|
};
|
|
1501
1501
|
}
|
|
1502
|
-
}),
|
|
1502
|
+
}), Ke = () => ({
|
|
1503
1503
|
funnelCube: null,
|
|
1504
1504
|
funnelSteps: [],
|
|
1505
1505
|
activeFunnelStepIndex: 0,
|
|
@@ -1507,8 +1507,8 @@ const L = {
|
|
|
1507
1507
|
funnelBindingKey: null,
|
|
1508
1508
|
stepTimeToConvert: []
|
|
1509
1509
|
// Deprecated - kept for backward compat
|
|
1510
|
-
}),
|
|
1511
|
-
...
|
|
1510
|
+
}), Tr = (t, i) => ({
|
|
1511
|
+
...Ke(),
|
|
1512
1512
|
addFunnelStep: () => t((e) => {
|
|
1513
1513
|
const n = e.funnelSteps[e.funnelSteps.length - 1], r = {
|
|
1514
1514
|
id: $(),
|
|
@@ -1587,7 +1587,7 @@ const L = {
|
|
|
1587
1587
|
const e = i();
|
|
1588
1588
|
return e.analysisType !== "funnel" || !e.funnelBindingKey || !e.funnelTimeDimension || e.funnelSteps.length < 2 ? !1 : e.funnelSteps.filter((r) => r.cube && r.name).length >= 2;
|
|
1589
1589
|
}
|
|
1590
|
-
}),
|
|
1590
|
+
}), $e = () => ({
|
|
1591
1591
|
flowCube: null,
|
|
1592
1592
|
flowBindingKey: null,
|
|
1593
1593
|
flowTimeDimension: null,
|
|
@@ -1599,8 +1599,8 @@ const L = {
|
|
|
1599
1599
|
stepsAfter: 3,
|
|
1600
1600
|
eventDimension: null,
|
|
1601
1601
|
joinStrategy: "auto"
|
|
1602
|
-
}),
|
|
1603
|
-
|
|
1602
|
+
}), Fr = (t, i) => ({
|
|
1603
|
+
...$e(),
|
|
1604
1604
|
setFlowCube: (e) => t(() => ({
|
|
1605
1605
|
flowCube: e,
|
|
1606
1606
|
// Clear binding key and time dimension since they may not exist in new cube
|
|
@@ -1650,10 +1650,10 @@ const L = {
|
|
|
1650
1650
|
};
|
|
1651
1651
|
}),
|
|
1652
1652
|
setStepsBefore: (e) => t({
|
|
1653
|
-
stepsBefore: Math.max(
|
|
1653
|
+
stepsBefore: Math.max(at, Math.min(ot, e))
|
|
1654
1654
|
}),
|
|
1655
1655
|
setStepsAfter: (e) => t({
|
|
1656
|
-
stepsAfter: Math.max(
|
|
1656
|
+
stepsAfter: Math.max(at, Math.min(ot, e))
|
|
1657
1657
|
}),
|
|
1658
1658
|
setJoinStrategy: (e) => t(() => ({
|
|
1659
1659
|
joinStrategy: e
|
|
@@ -1693,10 +1693,10 @@ const L = {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
|
-
}),
|
|
1697
|
-
...
|
|
1698
|
-
}),
|
|
1699
|
-
|
|
1696
|
+
}), Ge = () => ({
|
|
1697
|
+
..._n
|
|
1698
|
+
}), Ar = (t, i) => ({
|
|
1699
|
+
...Ge(),
|
|
1700
1700
|
setRetentionCube: (e) => t(() => ({
|
|
1701
1701
|
retentionCube: e,
|
|
1702
1702
|
// Clear related fields when cube changes
|
|
@@ -1745,8 +1745,8 @@ const L = {
|
|
|
1745
1745
|
setRetentionViewGranularity: (e) => t({ retentionViewGranularity: e }),
|
|
1746
1746
|
setRetentionPeriods: (e) => t({
|
|
1747
1747
|
retentionPeriods: Math.max(
|
|
1748
|
-
|
|
1749
|
-
Math.min(
|
|
1748
|
+
Ln,
|
|
1749
|
+
Math.min(Kn, e)
|
|
1750
1750
|
)
|
|
1751
1751
|
}),
|
|
1752
1752
|
setRetentionType: (e) => t({ retentionType: e }),
|
|
@@ -1796,22 +1796,22 @@ const L = {
|
|
|
1796
1796
|
warnings: r
|
|
1797
1797
|
};
|
|
1798
1798
|
}
|
|
1799
|
-
}),
|
|
1799
|
+
}), Tt = {
|
|
1800
1800
|
isOpen: !1,
|
|
1801
1801
|
userPrompt: "",
|
|
1802
1802
|
isGenerating: !1,
|
|
1803
1803
|
error: null,
|
|
1804
1804
|
hasGeneratedQuery: !1,
|
|
1805
1805
|
previousState: null
|
|
1806
|
-
},
|
|
1806
|
+
}, Qr = () => ({
|
|
1807
1807
|
activeTab: "query",
|
|
1808
1808
|
activeView: "chart",
|
|
1809
1809
|
displayLimit: 100,
|
|
1810
1810
|
showFieldModal: !1,
|
|
1811
1811
|
fieldModalMode: "metrics",
|
|
1812
|
-
aiState:
|
|
1813
|
-
}),
|
|
1814
|
-
...
|
|
1812
|
+
aiState: Tt
|
|
1813
|
+
}), Mr = (t, i) => ({
|
|
1814
|
+
...Qr(),
|
|
1815
1815
|
// ==========================================================================
|
|
1816
1816
|
// Tab/View Actions
|
|
1817
1817
|
// ==========================================================================
|
|
@@ -1890,11 +1890,11 @@ const L = {
|
|
|
1890
1890
|
displayConfig: n.displayConfig
|
|
1891
1891
|
}
|
|
1892
1892
|
},
|
|
1893
|
-
aiState: { ...
|
|
1893
|
+
aiState: { ...Tt }
|
|
1894
1894
|
};
|
|
1895
1895
|
})
|
|
1896
1896
|
});
|
|
1897
|
-
function
|
|
1897
|
+
function ut(t) {
|
|
1898
1898
|
const i = t.filters ? [...t.filters] : [], e = t.timeDimensions || [], n = [
|
|
1899
1899
|
...(t.dimensions || []).map((s) => ({
|
|
1900
1900
|
id: $(),
|
|
@@ -1943,10 +1943,10 @@ function dt(t) {
|
|
|
1943
1943
|
order: t.order
|
|
1944
1944
|
};
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1946
|
+
function Rr(t) {
|
|
1947
1947
|
return "queries" in t && Array.isArray(t.queries);
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function kr(t) {
|
|
1950
1950
|
if (t.initialAnalysisType === "funnel" && t.initialFunnelState) {
|
|
1951
1951
|
const i = W.getDefaultChartConfig(), e = {
|
|
1952
1952
|
chartType: t.initialChartConfig?.chartType || i.chartType,
|
|
@@ -1991,7 +1991,7 @@ function qr(t) {
|
|
|
1991
1991
|
chartType: t.initialChartConfig?.chartType || i.chartType,
|
|
1992
1992
|
chartConfig: t.initialChartConfig?.chartConfig || i.chartConfig,
|
|
1993
1993
|
displayConfig: t.initialChartConfig?.displayConfig || i.displayConfig
|
|
1994
|
-
}, n =
|
|
1994
|
+
}, n = $n(Gn), r = {
|
|
1995
1995
|
retentionCube: t.initialRetentionState.retentionCube ?? null,
|
|
1996
1996
|
retentionBindingKey: t.initialRetentionState.retentionBindingKey ?? null,
|
|
1997
1997
|
retentionTimeDimension: t.initialRetentionState.retentionTimeDimension ?? null,
|
|
@@ -2012,7 +2012,7 @@ function qr(t) {
|
|
|
2012
2012
|
if (t.initialQuery) {
|
|
2013
2013
|
const i = t.initialQuery;
|
|
2014
2014
|
let e, n = "concat";
|
|
2015
|
-
|
|
2015
|
+
Rr(i) ? (e = i.queries.map(ut), i.mergeStrategy && (n = i.mergeStrategy)) : e = [ut(i)];
|
|
2016
2016
|
const r = K.getDefaultChartConfig(), s = {
|
|
2017
2017
|
chartType: t.initialChartConfig?.chartType || r.chartType,
|
|
2018
2018
|
chartConfig: t.initialChartConfig?.chartConfig || r.chartConfig,
|
|
@@ -2042,15 +2042,15 @@ function qr(t) {
|
|
|
2042
2042
|
t.initialActiveView
|
|
2043
2043
|
) : null;
|
|
2044
2044
|
}
|
|
2045
|
-
function
|
|
2045
|
+
function Ir(t, i) {
|
|
2046
2046
|
return {
|
|
2047
2047
|
reset: () => {
|
|
2048
2048
|
t({
|
|
2049
|
-
...
|
|
2050
|
-
..._e(),
|
|
2049
|
+
...Dt(),
|
|
2051
2050
|
...Le(),
|
|
2052
2051
|
...Ke(),
|
|
2053
2052
|
...$e(),
|
|
2053
|
+
...Ge(),
|
|
2054
2054
|
// Apply adapter defaults for charts (may differ from slice defaults)
|
|
2055
2055
|
charts: {
|
|
2056
2056
|
query: K.getDefaultChartConfig(),
|
|
@@ -2070,7 +2070,7 @@ function Br(t, i) {
|
|
|
2070
2070
|
switch (e.analysisType) {
|
|
2071
2071
|
case "funnel":
|
|
2072
2072
|
return {
|
|
2073
|
-
...
|
|
2073
|
+
...Ke(),
|
|
2074
2074
|
charts: {
|
|
2075
2075
|
...e.charts,
|
|
2076
2076
|
funnel: W.getDefaultChartConfig()
|
|
@@ -2078,7 +2078,7 @@ function Br(t, i) {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
case "flow":
|
|
2080
2080
|
return {
|
|
2081
|
-
|
|
2081
|
+
...$e(),
|
|
2082
2082
|
charts: {
|
|
2083
2083
|
...e.charts,
|
|
2084
2084
|
flow: J.getDefaultChartConfig()
|
|
@@ -2086,7 +2086,7 @@ function Br(t, i) {
|
|
|
2086
2086
|
};
|
|
2087
2087
|
case "retention":
|
|
2088
2088
|
return {
|
|
2089
|
-
|
|
2089
|
+
...Ge(),
|
|
2090
2090
|
charts: {
|
|
2091
2091
|
...e.charts,
|
|
2092
2092
|
retention: Y.getDefaultChartConfig()
|
|
@@ -2094,7 +2094,7 @@ function Br(t, i) {
|
|
|
2094
2094
|
};
|
|
2095
2095
|
default:
|
|
2096
2096
|
return {
|
|
2097
|
-
...
|
|
2097
|
+
...Le(),
|
|
2098
2098
|
userManuallySelectedChart: !1,
|
|
2099
2099
|
charts: {
|
|
2100
2100
|
...e.charts,
|
|
@@ -2120,37 +2120,37 @@ function Br(t, i) {
|
|
|
2120
2120
|
}
|
|
2121
2121
|
};
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const i =
|
|
2123
|
+
function qr(t = {}) {
|
|
2124
|
+
const i = kr(t), e = (n, r, s) => ({
|
|
2125
2125
|
// Compose slices - they provide default state and actions
|
|
2126
|
+
...xr(n, r),
|
|
2127
|
+
...Dr(n, r),
|
|
2126
2128
|
...Tr(n, r),
|
|
2127
2129
|
...Fr(n, r),
|
|
2128
2130
|
...Ar(n, r),
|
|
2129
|
-
...
|
|
2130
|
-
...Mr(n, r),
|
|
2131
|
-
...kr(n),
|
|
2131
|
+
...Mr(n),
|
|
2132
2132
|
// Cross-slice actions
|
|
2133
|
-
...
|
|
2133
|
+
...Ir(n, r)
|
|
2134
2134
|
});
|
|
2135
2135
|
if (t.disableLocalStorage) {
|
|
2136
|
-
const n =
|
|
2137
|
-
|
|
2136
|
+
const n = rt()(
|
|
2137
|
+
it(st(e), {
|
|
2138
2138
|
name: "AnalysisBuilderStore (no-persist)"
|
|
2139
2139
|
})
|
|
2140
2140
|
);
|
|
2141
2141
|
return i && n.getState().load(i), n;
|
|
2142
2142
|
}
|
|
2143
|
-
return
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
name:
|
|
2143
|
+
return rt()(
|
|
2144
|
+
it(
|
|
2145
|
+
st(
|
|
2146
|
+
Pn(e, {
|
|
2147
|
+
name: ir,
|
|
2148
2148
|
// Use workspace format to preserve ALL modes' state
|
|
2149
2149
|
partialize: (n) => n.saveWorkspace(),
|
|
2150
|
-
merge: (n, r) => n &&
|
|
2150
|
+
merge: (n, r) => n && Hn(n) ? {
|
|
2151
2151
|
...r,
|
|
2152
2152
|
_persistedWorkspace: n
|
|
2153
|
-
} : n &&
|
|
2153
|
+
} : n && ht(n) ? {
|
|
2154
2154
|
...r,
|
|
2155
2155
|
_persistedConfig: n
|
|
2156
2156
|
} : i ? {
|
|
@@ -2177,8 +2177,8 @@ function Nr(t = {}) {
|
|
|
2177
2177
|
)
|
|
2178
2178
|
);
|
|
2179
2179
|
}
|
|
2180
|
-
const
|
|
2181
|
-
function
|
|
2180
|
+
const We = In(null);
|
|
2181
|
+
function gi({
|
|
2182
2182
|
children: t,
|
|
2183
2183
|
initialQuery: i,
|
|
2184
2184
|
initialChartConfig: e,
|
|
@@ -2190,7 +2190,7 @@ function pi({
|
|
|
2190
2190
|
initialActiveView: d
|
|
2191
2191
|
}) {
|
|
2192
2192
|
const f = ae(null);
|
|
2193
|
-
return f.current || (f.current =
|
|
2193
|
+
return f.current || (f.current = qr({
|
|
2194
2194
|
initialQuery: i,
|
|
2195
2195
|
initialChartConfig: e,
|
|
2196
2196
|
disableLocalStorage: n,
|
|
@@ -2199,21 +2199,21 @@ function pi({
|
|
|
2199
2199
|
initialFlowState: o,
|
|
2200
2200
|
initialRetentionState: l,
|
|
2201
2201
|
initialActiveView: d
|
|
2202
|
-
})), /* @__PURE__ */ p(
|
|
2202
|
+
})), /* @__PURE__ */ p(We.Provider, { value: f.current, children: t });
|
|
2203
2203
|
}
|
|
2204
2204
|
function c(t) {
|
|
2205
|
-
const i =
|
|
2205
|
+
const i = yt(We);
|
|
2206
2206
|
if (!i)
|
|
2207
2207
|
throw new Error("useAnalysisBuilderStore must be used within AnalysisBuilderStoreProvider");
|
|
2208
|
-
return
|
|
2208
|
+
return En(i, t);
|
|
2209
2209
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const t =
|
|
2210
|
+
function Br() {
|
|
2211
|
+
const t = yt(We);
|
|
2212
2212
|
if (!t)
|
|
2213
2213
|
throw new Error("useAnalysisBuilderStoreApi must be used within AnalysisBuilderStoreProvider");
|
|
2214
2214
|
return t;
|
|
2215
2215
|
}
|
|
2216
|
-
const
|
|
2216
|
+
const Je = (t) => t.queryStates[t.activeQueryIndex] || R(), hi = (t) => Je(t).metrics, pi = (t) => Je(t).breakdowns, Ci = (t) => Je(t).filters, Nr = (t) => {
|
|
2217
2217
|
const i = t.charts[t.analysisType];
|
|
2218
2218
|
return i ? {
|
|
2219
2219
|
chartType: i.chartType,
|
|
@@ -2224,19 +2224,19 @@ const We = (t) => t.queryStates[t.activeQueryIndex] || R(), Ci = (t) => We(t).me
|
|
|
2224
2224
|
chartConfig: {},
|
|
2225
2225
|
displayConfig: { showLegend: !0, showGrid: !0, showTooltip: !0 }
|
|
2226
2226
|
};
|
|
2227
|
-
},
|
|
2227
|
+
}, wi = (t) => ({
|
|
2228
2228
|
activeTab: t.activeTab,
|
|
2229
2229
|
activeView: t.activeView,
|
|
2230
2230
|
displayLimit: t.displayLimit,
|
|
2231
2231
|
showFieldModal: t.showFieldModal,
|
|
2232
2232
|
fieldModalMode: t.fieldModalMode
|
|
2233
|
-
}),
|
|
2233
|
+
}), bi = (t) => ({
|
|
2234
2234
|
queryStates: t.queryStates,
|
|
2235
2235
|
activeQueryIndex: t.activeQueryIndex,
|
|
2236
2236
|
mergeStrategy: t.mergeStrategy,
|
|
2237
2237
|
// Multi-query mode is when we have more than one query in 'query' analysis type
|
|
2238
2238
|
isMultiQueryMode: t.analysisType === "query" && t.queryStates.length > 1
|
|
2239
|
-
}),
|
|
2239
|
+
}), Si = (t) => ({
|
|
2240
2240
|
funnelCube: t.funnelCube,
|
|
2241
2241
|
funnelSteps: t.funnelSteps,
|
|
2242
2242
|
activeFunnelStepIndex: t.activeFunnelStepIndex,
|
|
@@ -2246,16 +2246,16 @@ const We = (t) => t.queryStates[t.activeQueryIndex] || R(), Ci = (t) => We(t).me
|
|
|
2246
2246
|
// Deprecated field kept for backward compat
|
|
2247
2247
|
stepTimeToConvert: t.stepTimeToConvert
|
|
2248
2248
|
});
|
|
2249
|
-
function
|
|
2249
|
+
function ft(t) {
|
|
2250
2250
|
return t.timeDimensions || [];
|
|
2251
2251
|
}
|
|
2252
|
-
function
|
|
2252
|
+
function Vr(t) {
|
|
2253
2253
|
const i = [];
|
|
2254
2254
|
if (t.length < 2) return i;
|
|
2255
|
-
const e =
|
|
2255
|
+
const e = ft(t[0]);
|
|
2256
2256
|
if (e.length === 0) return i;
|
|
2257
2257
|
for (let n = 1; n < t.length; n++) {
|
|
2258
|
-
const r =
|
|
2258
|
+
const r = ft(t[n]);
|
|
2259
2259
|
if (r.length === 0 && e.length > 0) {
|
|
2260
2260
|
i.push({
|
|
2261
2261
|
type: "missing_time_dimension",
|
|
@@ -2281,7 +2281,7 @@ function Pr(t) {
|
|
|
2281
2281
|
}
|
|
2282
2282
|
return i;
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2284
|
+
function Er(t, i) {
|
|
2285
2285
|
const e = [];
|
|
2286
2286
|
if (t.length < 2 || i.length === 0) return e;
|
|
2287
2287
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2299,7 +2299,7 @@ function Ur(t, i) {
|
|
|
2299
2299
|
}
|
|
2300
2300
|
return e;
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Pr(t) {
|
|
2303
2303
|
const i = [];
|
|
2304
2304
|
if (t.length < 2) return i;
|
|
2305
2305
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -2318,7 +2318,7 @@ function _r(t) {
|
|
|
2318
2318
|
affectedMeasures: n
|
|
2319
2319
|
}), i;
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function Ur(t) {
|
|
2322
2322
|
const i = [];
|
|
2323
2323
|
if (t.length < 2) return i;
|
|
2324
2324
|
const e = t.map((r) => r.timeDimensions?.[0]?.dateRange);
|
|
@@ -2328,26 +2328,26 @@ function Lr(t) {
|
|
|
2328
2328
|
message: "Queries have different date ranges - some data points may be missing in merged results"
|
|
2329
2329
|
}), i;
|
|
2330
2330
|
}
|
|
2331
|
-
function
|
|
2331
|
+
function _r(t, i, e = []) {
|
|
2332
2332
|
const n = [], r = [];
|
|
2333
|
-
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...
|
|
2333
|
+
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...Pr(t)), r.push(...Ur(t)), i === "merge" && (n.push(...Vr(t)), e.length > 0 && n.push(...Er(t, e))), {
|
|
2334
2334
|
isValid: n.length === 0,
|
|
2335
2335
|
errors: n,
|
|
2336
2336
|
warnings: r
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2339
|
+
function vi(t) {
|
|
2340
2340
|
return t.filter(
|
|
2341
2341
|
(i) => (i.measures?.length || 0) + (i.dimensions?.length || 0) + (i.timeDimensions?.length || 0) > 0
|
|
2342
2342
|
).length >= 2;
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function xi(t) {
|
|
2345
2345
|
if (t.isValid && t.warnings.length === 0)
|
|
2346
2346
|
return "Configuration is valid";
|
|
2347
2347
|
const i = [];
|
|
2348
2348
|
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
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function Lr() {
|
|
2351
2351
|
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
2352
|
const h = t[i] || m;
|
|
2353
2353
|
return be(h.metrics, h.breakdowns, h.filters, h.order);
|
|
@@ -2366,7 +2366,7 @@ function $r() {
|
|
|
2366
2366
|
mergeKeys: u,
|
|
2367
2367
|
queryLabels: h.map((x, B) => `Q${B + 1}`)
|
|
2368
2368
|
};
|
|
2369
|
-
}, [S, t.length, e, u]), D = A(() => y ?
|
|
2369
|
+
}, [S, t.length, e, u]), D = A(() => y ? _r(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
2370
|
return {
|
|
2371
2371
|
queryState: m,
|
|
2372
2372
|
queryStates: t,
|
|
@@ -2386,7 +2386,7 @@ function $r() {
|
|
|
2386
2386
|
removeQuery: o
|
|
2387
2387
|
};
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2389
|
+
function Kr(t) {
|
|
2390
2390
|
const { queryState: i, queryStates: e, isMultiQueryMode: n, mergeStrategy: r, activeQueryIndex: s } = t, o = A(() => {
|
|
2391
2391
|
if (!n) return i.metrics;
|
|
2392
2392
|
const f = /* @__PURE__ */ new Set(), m = [];
|
|
@@ -2415,7 +2415,7 @@ function Gr(t) {
|
|
|
2415
2415
|
effectiveBreakdowns: d
|
|
2416
2416
|
};
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function $r(t) {
|
|
2419
2419
|
const {
|
|
2420
2420
|
currentQuery: i,
|
|
2421
2421
|
allQueries: e,
|
|
@@ -2431,35 +2431,35 @@ function Hr(t) {
|
|
|
2431
2431
|
serverFlowQuery: y,
|
|
2432
2432
|
serverRetentionQuery: u,
|
|
2433
2433
|
retentionValidation: g
|
|
2434
|
-
} = t, { getFieldLabel: S } =
|
|
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 : Zn(e, l), [B, w, l, e]), Q = zn(i, {
|
|
2435
2435
|
skip: !s || !x,
|
|
2436
2436
|
debounceMs: 300
|
|
2437
|
-
}), M =
|
|
2437
|
+
}), M = Wn(n, {
|
|
2438
2438
|
skip: !n || !h,
|
|
2439
2439
|
debounceMs: 300
|
|
2440
|
-
}), T =
|
|
2440
|
+
}), T = Jn(_, {
|
|
2441
2441
|
skip: !w || !_ && !m,
|
|
2442
2442
|
debounceMs: 300,
|
|
2443
2443
|
prebuiltServerQuery: B ? m : void 0
|
|
2444
|
-
}), C =
|
|
2444
|
+
}), C = Yn(y ?? null, {
|
|
2445
2445
|
skip: !D || !y,
|
|
2446
2446
|
debounceMs: 300
|
|
2447
|
-
}), F =
|
|
2447
|
+
}), F = Xn(u ?? null, {
|
|
2448
2448
|
skip: !v || !u,
|
|
2449
2449
|
debounceMs: 300,
|
|
2450
2450
|
getFieldLabel: S
|
|
2451
2451
|
// Pass label resolver for human-readable binding key display
|
|
2452
|
-
}), P =
|
|
2452
|
+
}), P = er({
|
|
2453
2453
|
queries: r ? e : [i],
|
|
2454
2454
|
isMultiQueryMode: r,
|
|
2455
2455
|
skip: !s || w || D || v
|
|
2456
|
-
}), X =
|
|
2456
|
+
}), X = Ne(
|
|
2457
2457
|
T.serverQuery,
|
|
2458
2458
|
{ skip: !w || !T.serverQuery }
|
|
2459
|
-
), ve =
|
|
2459
|
+
), ve = Ne(
|
|
2460
2460
|
C.serverQuery,
|
|
2461
2461
|
{ skip: !D || !C.serverQuery }
|
|
2462
|
-
), oe =
|
|
2462
|
+
), oe = Ne(
|
|
2463
2463
|
u,
|
|
2464
2464
|
{ skip: !v || !u }
|
|
2465
2465
|
), H = v ? F.isLoading || F.isDebouncing : D ? C.isLoading || C.isDebouncing : w ? T.isExecuting || T.isDebouncing : h ? M.isLoading : Q.isLoading, z = v ? F.isFetching : D ? C.isFetching : w ? T.isExecuting : h ? M.isFetching : Q.isFetching, O = v ? F.error : D ? C.error : w ? T.error : h ? M.error : Q.error, Z = !!(Q.debouncedQuery || M.debouncedConfig || !T.isDebouncing || // Funnel has debounced when not debouncing
|
|
@@ -2503,14 +2503,14 @@ function Hr(t) {
|
|
|
2503
2503
|
warnings: Fe
|
|
2504
2504
|
};
|
|
2505
2505
|
}
|
|
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(
|
|
2506
|
+
function Gr(t) {
|
|
2507
|
+
const { externalColorPalette: i, combinedMetrics: e, combinedBreakdowns: n, hasDebounced: r } = t, s = c((C) => C.analysisType), { chartType: o, chartConfig: l, displayConfig: d } = c(Un(Nr)), 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
2508
|
(C) => {
|
|
2509
2509
|
if (s === "funnel")
|
|
2510
2510
|
S(C);
|
|
2511
2511
|
else {
|
|
2512
2512
|
y(C);
|
|
2513
|
-
const { chartConfig: F } =
|
|
2513
|
+
const { chartConfig: F } = Ve(
|
|
2514
2514
|
e,
|
|
2515
2515
|
n,
|
|
2516
2516
|
C
|
|
@@ -2537,14 +2537,14 @@ function Or(t) {
|
|
|
2537
2537
|
},
|
|
2538
2538
|
[s, D, g]
|
|
2539
2539
|
), Q = A(
|
|
2540
|
-
() =>
|
|
2540
|
+
() => or(e, n),
|
|
2541
2541
|
[e, n]
|
|
2542
2542
|
), M = A(() => i ? Array.isArray(i) && typeof i[0] == "string" ? {
|
|
2543
2543
|
name: "custom",
|
|
2544
2544
|
label: "Custom",
|
|
2545
2545
|
colors: i,
|
|
2546
2546
|
gradient: i
|
|
2547
|
-
} : i :
|
|
2547
|
+
} : i : On(m), [i, m]), T = ae("");
|
|
2548
2548
|
return se(() => {
|
|
2549
2549
|
if (!r || e.length === 0 && n.length === 0) return;
|
|
2550
2550
|
const C = JSON.stringify({
|
|
@@ -2553,21 +2553,21 @@ function Or(t) {
|
|
|
2553
2553
|
});
|
|
2554
2554
|
if (C === T.current) return;
|
|
2555
2555
|
T.current = C;
|
|
2556
|
-
const F =
|
|
2556
|
+
const F = cr(
|
|
2557
2557
|
e,
|
|
2558
2558
|
n,
|
|
2559
2559
|
o,
|
|
2560
2560
|
f
|
|
2561
2561
|
);
|
|
2562
2562
|
if (F) {
|
|
2563
|
-
const { chartConfig: P } =
|
|
2563
|
+
const { chartConfig: P } = Ve(
|
|
2564
2564
|
e,
|
|
2565
2565
|
n,
|
|
2566
2566
|
F
|
|
2567
2567
|
);
|
|
2568
2568
|
x(F), B(P), h(!1);
|
|
2569
2569
|
} else if ((e.length > 0 || n.length > 0) && !l.xAxis?.length && !l.yAxis?.length && !l.series?.length) {
|
|
2570
|
-
const { chartConfig: X } =
|
|
2570
|
+
const { chartConfig: X } = Ve(
|
|
2571
2571
|
e,
|
|
2572
2572
|
n,
|
|
2573
2573
|
o
|
|
@@ -2599,7 +2599,7 @@ function Or(t) {
|
|
|
2599
2599
|
setLocalPaletteName: v
|
|
2600
2600
|
};
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2602
|
+
function Hr() {
|
|
2603
2603
|
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
2604
|
return {
|
|
2605
2605
|
// State
|
|
@@ -2618,31 +2618,31 @@ function jr() {
|
|
|
2618
2618
|
setActiveTableIndex: y
|
|
2619
2619
|
};
|
|
2620
2620
|
}
|
|
2621
|
-
const Se = 1800,
|
|
2622
|
-
function
|
|
2621
|
+
const Se = 1800, He = "share=";
|
|
2622
|
+
function Oe(t) {
|
|
2623
2623
|
const i = JSON.stringify(t);
|
|
2624
|
-
return
|
|
2624
|
+
return gt.compressToEncodedURIComponent(i);
|
|
2625
2625
|
}
|
|
2626
|
-
function
|
|
2626
|
+
function Or(t) {
|
|
2627
2627
|
try {
|
|
2628
|
-
const i =
|
|
2628
|
+
const i = gt.decompressFromEncodedURIComponent(t);
|
|
2629
2629
|
if (!i) return null;
|
|
2630
2630
|
const e = JSON.parse(i);
|
|
2631
|
-
return
|
|
2631
|
+
return ht(e) ? e : (console.warn("[shareUtils] Invalid AnalysisConfig in share URL"), null);
|
|
2632
2632
|
} catch {
|
|
2633
2633
|
return null;
|
|
2634
2634
|
}
|
|
2635
2635
|
}
|
|
2636
|
-
function
|
|
2637
|
-
const i =
|
|
2636
|
+
function Di(t) {
|
|
2637
|
+
const i = Oe(t);
|
|
2638
2638
|
return {
|
|
2639
2639
|
ok: i.length <= Se,
|
|
2640
2640
|
size: i.length,
|
|
2641
2641
|
maxSize: Se
|
|
2642
2642
|
};
|
|
2643
2643
|
}
|
|
2644
|
-
function
|
|
2645
|
-
const i =
|
|
2644
|
+
function jr(t) {
|
|
2645
|
+
const i = Oe(t);
|
|
2646
2646
|
if (i.length <= Se)
|
|
2647
2647
|
return { encoded: i, queryOnly: !1 };
|
|
2648
2648
|
const e = {
|
|
@@ -2652,28 +2652,28 @@ function Wr(t) {
|
|
|
2652
2652
|
charts: {},
|
|
2653
2653
|
// Drop chart config to save space
|
|
2654
2654
|
query: t.query
|
|
2655
|
-
}, n =
|
|
2655
|
+
}, n = Oe(e);
|
|
2656
2656
|
return n.length <= Se ? { encoded: n, queryOnly: !0 } : { encoded: null, queryOnly: !0 };
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2659
|
-
const { encoded: i } =
|
|
2660
|
-
return i ? `${window.location.origin}${window.location.pathname}#${
|
|
2658
|
+
function Ti(t) {
|
|
2659
|
+
const { encoded: i } = jr(t);
|
|
2660
|
+
return i ? `${window.location.origin}${window.location.pathname}#${He}${i}` : null;
|
|
2661
2661
|
}
|
|
2662
|
-
function
|
|
2662
|
+
function zr() {
|
|
2663
2663
|
if (typeof window > "u") return null;
|
|
2664
2664
|
const t = window.location.hash;
|
|
2665
|
-
return !t || !t.startsWith(`#${
|
|
2665
|
+
return !t || !t.startsWith(`#${He}`) ? null : t.slice(He.length + 1);
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function Wr() {
|
|
2668
2668
|
if (typeof window > "u") return;
|
|
2669
2669
|
const t = new URL(window.location.href);
|
|
2670
2670
|
t.hash = "", window.history.replaceState(null, "", t.toString());
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const t =
|
|
2674
|
-
return t ?
|
|
2672
|
+
function Jr() {
|
|
2673
|
+
const t = zr();
|
|
2674
|
+
return t ? Or(t) : null;
|
|
2675
2675
|
}
|
|
2676
|
-
function
|
|
2676
|
+
function Yr(t) {
|
|
2677
2677
|
const {
|
|
2678
2678
|
currentQuery: i,
|
|
2679
2679
|
isValidQuery: e,
|
|
@@ -2686,8 +2686,8 @@ function Zr(t) {
|
|
|
2686
2686
|
se(() => {
|
|
2687
2687
|
if (f.current) return;
|
|
2688
2688
|
f.current = !0;
|
|
2689
|
-
const m =
|
|
2690
|
-
m && (d(m),
|
|
2689
|
+
const m = Jr();
|
|
2690
|
+
m && (d(m), Wr());
|
|
2691
2691
|
}, [d]), se(() => {
|
|
2692
2692
|
o && e && o(i);
|
|
2693
2693
|
}, [i, e, o]), se(() => {
|
|
@@ -2698,8 +2698,8 @@ function Zr(t) {
|
|
|
2698
2698
|
});
|
|
2699
2699
|
}, [n, r, s, l]);
|
|
2700
2700
|
}
|
|
2701
|
-
function
|
|
2702
|
-
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } =
|
|
2701
|
+
function Fi(t = {}) {
|
|
2702
|
+
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } = Vn(), o = Br(), l = Lr(), d = Kr({
|
|
2703
2703
|
queryState: l.queryState,
|
|
2704
2704
|
queryStates: l.queryStates,
|
|
2705
2705
|
isMultiQueryMode: l.isMultiQueryMode,
|
|
@@ -2708,7 +2708,7 @@ function Qi(t = {}) {
|
|
|
2708
2708
|
}), f = c((a) => a.funnelBindingKey), m = c((a) => a.analysisType), y = c((a) => a.funnelCube), u = c((a) => a.funnelSteps), g = c((a) => a.activeFunnelStepIndex), S = c((a) => a.funnelTimeDimension), w = A(() => m !== "funnel" || !f?.dimension || !S || !u || u.length < 2 ? !1 : u.every((a) => a.filters.length > 0), [m, f, S, u]), D = c((a) => a.charts.funnel?.chartType) || "funnel", v = c((a) => a.charts.funnel?.chartConfig), h = A(() => v || {}, [v]), x = c((a) => a.flowCube), B = c((a) => a.flowBindingKey), _ = c((a) => a.flowTimeDimension), Q = c((a) => a.eventDimension), M = c((a) => a.startingStep), T = c((a) => a.stepsBefore), C = c((a) => a.stepsAfter), F = c((a) => a.joinStrategy), P = c((a) => a.charts.flow?.displayConfig), X = A(
|
|
2709
2709
|
() => P || { showLegend: !0, showGrid: !0, showTooltip: !0 },
|
|
2710
2710
|
[P]
|
|
2711
|
-
), ve = c((a) => a.charts.flow?.chartType) || "sankey", oe = c((a) => a.buildFunnelQueryFromSteps), H = A(() => m !== "funnel" ? null : oe(), [m, oe, u]), z = c((a) => a.buildFlowQuery), O = A(() => m !== "flow" ? null : z(), [m, z, x, B, _, Q, M, T, C, ve, F]), Z = c((a) => a.retentionCube), ee = c((a) => a.retentionBindingKey), te = c((a) => a.retentionTimeDimension), ne = c((a) => a.retentionDateRange), le = c((a) => a.retentionCohortFilters), ce = c((a) => a.retentionActivityFilters), de = c((a) => a.retentionBreakdowns), ue = c((a) => a.retentionViewGranularity), fe = c((a) => a.retentionPeriods), me = c((a) => a.retentionType), ye = c((a) => a.buildRetentionQuery), ge = c((a) => a.getRetentionValidation), xe = c((a) => a.charts.retention?.displayConfig), De = c((a) => a.setRetentionCube), Te = c((a) => a.setRetentionBindingKey), Fe = c((a) => a.setRetentionTimeDimension), k = c((a) => a.setRetentionDateRange),
|
|
2711
|
+
), ve = c((a) => a.charts.flow?.chartType) || "sankey", oe = c((a) => a.buildFunnelQueryFromSteps), H = A(() => m !== "funnel" ? null : oe(), [m, oe, u]), z = c((a) => a.buildFlowQuery), O = A(() => m !== "flow" ? null : z(), [m, z, x, B, _, Q, M, T, C, ve, F]), Z = c((a) => a.retentionCube), ee = c((a) => a.retentionBindingKey), te = c((a) => a.retentionTimeDimension), ne = c((a) => a.retentionDateRange), le = c((a) => a.retentionCohortFilters), ce = c((a) => a.retentionActivityFilters), de = c((a) => a.retentionBreakdowns), ue = c((a) => a.retentionViewGranularity), fe = c((a) => a.retentionPeriods), me = c((a) => a.retentionType), ye = c((a) => a.buildRetentionQuery), ge = c((a) => a.getRetentionValidation), xe = c((a) => a.charts.retention?.displayConfig), De = c((a) => a.setRetentionCube), Te = c((a) => a.setRetentionBindingKey), Fe = c((a) => a.setRetentionTimeDimension), k = c((a) => a.setRetentionDateRange), Ft = c((a) => a.setRetentionCohortFilters), At = c((a) => a.setRetentionActivityFilters), Qt = c((a) => a.setRetentionBreakdowns), Ae = c((a) => a.addRetentionBreakdown), Mt = c((a) => a.removeRetentionBreakdown), Rt = c((a) => a.setRetentionViewGranularity), kt = c((a) => a.setRetentionPeriods), It = c((a) => a.setRetentionType), Qe = A(() => m !== "retention" ? null : ye(), [
|
|
2712
2712
|
m,
|
|
2713
2713
|
ye,
|
|
2714
2714
|
Z,
|
|
@@ -2721,14 +2721,14 @@ function Qi(t = {}) {
|
|
|
2721
2721
|
me,
|
|
2722
2722
|
le,
|
|
2723
2723
|
ce
|
|
2724
|
-
]),
|
|
2724
|
+
]), qt = A(() => m !== "retention" ? null : ge(), [
|
|
2725
2725
|
m,
|
|
2726
2726
|
ge,
|
|
2727
2727
|
Z,
|
|
2728
2728
|
ee,
|
|
2729
2729
|
te,
|
|
2730
2730
|
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 =
|
|
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 = $r({
|
|
2732
2732
|
currentQuery: l.currentQuery,
|
|
2733
2733
|
allQueries: l.allQueries,
|
|
2734
2734
|
multiQueryConfig: l.multiQueryConfig,
|
|
@@ -2745,14 +2745,14 @@ function Qi(t = {}) {
|
|
|
2745
2745
|
// Retention mode: pass serverRetentionQuery
|
|
2746
2746
|
serverRetentionQuery: Qe,
|
|
2747
2747
|
// Retention mode: pass validation for debug panel
|
|
2748
|
-
retentionValidation:
|
|
2749
|
-
}), q =
|
|
2748
|
+
retentionValidation: qt
|
|
2749
|
+
}), q = Gr({
|
|
2750
2750
|
externalColorPalette: e,
|
|
2751
2751
|
combinedMetrics: d.combinedMetrics,
|
|
2752
2752
|
combinedBreakdowns: d.combinedBreakdowns,
|
|
2753
2753
|
hasDebounced: I.hasDebounced
|
|
2754
|
-
}), V =
|
|
2755
|
-
|
|
2754
|
+
}), V = Hr();
|
|
2755
|
+
Yr({
|
|
2756
2756
|
currentQuery: l.currentQuery,
|
|
2757
2757
|
isValidQuery: l.isValidQuery ?? !1,
|
|
2758
2758
|
chartType: q.chartType,
|
|
@@ -2761,10 +2761,10 @@ function Qi(t = {}) {
|
|
|
2761
2761
|
onQueryChange: n,
|
|
2762
2762
|
onChartConfigChange: r
|
|
2763
2763
|
});
|
|
2764
|
-
const
|
|
2765
|
-
() =>
|
|
2766
|
-
[
|
|
2767
|
-
),
|
|
2764
|
+
const Bt = c((a) => a.openMetricsModal), Nt = c((a) => a.addMetric), Vt = c((a) => a.removeMetric), Re = c((a) => a.toggleMetric), Et = c((a) => a.reorderMetrics), Pt = c((a) => a.openBreakdownsModal), Ut = c((a) => a.addBreakdown), _t = c((a) => a.removeBreakdown), ke = c((a) => a.toggleBreakdown), Lt = c((a) => a.setBreakdownGranularity), Kt = c((a) => a.toggleBreakdownComparison), $t = c((a) => a.reorderBreakdowns), Gt = c((a) => a.setFilters), Ht = c((a) => a.dropFieldToFilter), Ot = c((a) => a.setOrder), jt = c((a) => a.clearQuery), zt = c((a) => a.clearCurrentMode), Wt = c((a) => a.setFunnelBindingKey), Jt = c((a) => a.setAnalysisType), Yt = c((a) => a.setFunnelCube), Xt = c((a) => a.addFunnelStep), Zt = c((a) => a.removeFunnelStep), en = c((a) => a.updateFunnelStep), tn = c((a) => a.setActiveFunnelStepIndex), nn = c((a) => a.reorderFunnelSteps), rn = c((a) => a.setFunnelTimeDimension), Ye = c((a) => a.charts.funnel?.displayConfig), sn = A(
|
|
2765
|
+
() => Ye || { showLegend: !0, showGrid: !0, showTooltip: !0 },
|
|
2766
|
+
[Ye]
|
|
2767
|
+
), an = c((a) => a.setFunnelDisplayConfig), on = c((a) => a.setFlowCube), ln = c((a) => a.setFlowBindingKey), cn = c((a) => a.setFlowTimeDimension), dn = c((a) => a.setEventDimension), un = c((a) => a.setStartingStepName), fn = c((a) => a.setStartingStepFilters), mn = c((a) => a.setStepsBefore), yn = c((a) => a.setStepsAfter), gn = c((a) => a.setJoinStrategy), hn = U(
|
|
2768
2768
|
(a) => {
|
|
2769
2769
|
o.setState((N) => ({
|
|
2770
2770
|
charts: {
|
|
@@ -2777,7 +2777,7 @@ function Qi(t = {}) {
|
|
|
2777
2777
|
}));
|
|
2778
2778
|
},
|
|
2779
2779
|
[o]
|
|
2780
|
-
),
|
|
2780
|
+
), pn = U(
|
|
2781
2781
|
(a) => {
|
|
2782
2782
|
o.setState((N) => ({
|
|
2783
2783
|
charts: {
|
|
@@ -2790,11 +2790,11 @@ function Qi(t = {}) {
|
|
|
2790
2790
|
}));
|
|
2791
2791
|
},
|
|
2792
2792
|
[o]
|
|
2793
|
-
), re = c((a) => a.aiState),
|
|
2794
|
-
() =>
|
|
2793
|
+
), re = c((a) => a.aiState), Cn = c((a) => a.openAI), ie = c((a) => a.closeAI), wn = c((a) => a.setAIPrompt), Ie = c((a) => a.setAIGenerating), qe = c((a) => a.setAIError), he = c((a) => a.setAIHasGeneratedQuery), Xe = c((a) => a.saveAIPreviousState), Ze = c((a) => a.restoreAIPreviousState), Be = ae("idle"), bn = Me, et = c((a) => a.getValidation), Sn = A(
|
|
2794
|
+
() => et(),
|
|
2795
2795
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2796
2796
|
[
|
|
2797
|
-
|
|
2797
|
+
et,
|
|
2798
2798
|
l.queryStates,
|
|
2799
2799
|
m,
|
|
2800
2800
|
// Funnel deps
|
|
@@ -2811,14 +2811,14 @@ function Qi(t = {}) {
|
|
|
2811
2811
|
C,
|
|
2812
2812
|
F
|
|
2813
2813
|
]
|
|
2814
|
-
),
|
|
2815
|
-
(a, N,
|
|
2816
|
-
V.fieldModalMode === "metrics" && N === "measure" ? Re(a.name) : V.fieldModalMode === "breakdown" && (m === "retention" && N === "dimension" ? Ae({ field: a.name }) : ke(a.name, N === "timeDimension")),
|
|
2814
|
+
), vn = U(
|
|
2815
|
+
(a, N, tt, Rn) => {
|
|
2816
|
+
V.fieldModalMode === "metrics" && N === "measure" ? Re(a.name) : V.fieldModalMode === "breakdown" && (m === "retention" && N === "dimension" ? Ae({ field: a.name }) : ke(a.name, N === "timeDimension")), Rn || V.closeFieldModal();
|
|
2817
2817
|
},
|
|
2818
2818
|
[V, Re, ke, Ae, m]
|
|
2819
|
-
),
|
|
2819
|
+
), xn = U(async () => {
|
|
2820
2820
|
if (s?.aiEndpoint) {
|
|
2821
|
-
|
|
2821
|
+
Xe(), Ie(!0), qe(null);
|
|
2822
2822
|
try {
|
|
2823
2823
|
await new Promise((a) => setTimeout(a, 1e3)), he(!0);
|
|
2824
2824
|
} catch (a) {
|
|
@@ -2827,15 +2827,15 @@ function Qi(t = {}) {
|
|
|
2827
2827
|
Ie(!1);
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
2830
|
-
}, [s?.aiEndpoint,
|
|
2830
|
+
}, [s?.aiEndpoint, Xe, Ie, qe, he]), Dn = U(() => {
|
|
2831
2831
|
ie(), he(!1);
|
|
2832
|
-
}, [ie, he]),
|
|
2833
|
-
|
|
2834
|
-
}, [
|
|
2832
|
+
}, [ie, he]), Tn = U(() => {
|
|
2833
|
+
Ze(), ie();
|
|
2834
|
+
}, [Ze, ie]), Fn = U(async () => {
|
|
2835
2835
|
Be.current = "copied", setTimeout(() => {
|
|
2836
2836
|
Be.current = "idle";
|
|
2837
2837
|
}, 2e3);
|
|
2838
|
-
}, []),
|
|
2838
|
+
}, []), An = U(() => {
|
|
2839
2839
|
const a = o.getState();
|
|
2840
2840
|
if (a.analysisType === "funnel") {
|
|
2841
2841
|
const N = a.buildFunnelQueryFromSteps();
|
|
@@ -2845,12 +2845,12 @@ function Qi(t = {}) {
|
|
|
2845
2845
|
queries: a.buildAllQueries(),
|
|
2846
2846
|
mergeStrategy: a.mergeStrategy,
|
|
2847
2847
|
mergeKeys: a.getMergeKeys(),
|
|
2848
|
-
queryLabels: a.queryStates.map((N,
|
|
2848
|
+
queryLabels: a.queryStates.map((N, tt) => `Q${tt + 1}`),
|
|
2849
2849
|
// Include funnel-specific config when in funnel mode
|
|
2850
2850
|
funnelBindingKey: a.funnelBindingKey,
|
|
2851
2851
|
stepTimeToConvert: a.stepTimeToConvert
|
|
2852
2852
|
} : a.buildCurrentQuery();
|
|
2853
|
-
}, [o]),
|
|
2853
|
+
}, [o]), Qn = U(() => {
|
|
2854
2854
|
const a = o.getState(), N = a.charts[a.analysisType];
|
|
2855
2855
|
return N ? {
|
|
2856
2856
|
chartType: N.chartType,
|
|
@@ -2861,7 +2861,7 @@ function Qi(t = {}) {
|
|
|
2861
2861
|
chartConfig: q.chartConfig,
|
|
2862
2862
|
displayConfig: q.displayConfig
|
|
2863
2863
|
};
|
|
2864
|
-
}, [o, q.chartType, q.chartConfig, q.displayConfig]),
|
|
2864
|
+
}, [o, q.chartType, q.chartConfig, q.displayConfig]), Mn = U(() => o.getState().analysisType, [o]);
|
|
2865
2865
|
return {
|
|
2866
2866
|
// Query state (from queryBuilder)
|
|
2867
2867
|
queryState: l.queryState,
|
|
@@ -2885,7 +2885,7 @@ function Qi(t = {}) {
|
|
|
2885
2885
|
funnelTimeDimension: S,
|
|
2886
2886
|
funnelChartType: D,
|
|
2887
2887
|
funnelChartConfig: h,
|
|
2888
|
-
funnelDisplayConfig:
|
|
2888
|
+
funnelDisplayConfig: sn,
|
|
2889
2889
|
// Flow state (new)
|
|
2890
2890
|
flowCube: x,
|
|
2891
2891
|
flowBindingKey: B,
|
|
@@ -2957,73 +2957,73 @@ function Qi(t = {}) {
|
|
|
2957
2957
|
},
|
|
2958
2958
|
// Share state
|
|
2959
2959
|
shareButtonState: Be.current,
|
|
2960
|
-
canShare:
|
|
2960
|
+
canShare: bn,
|
|
2961
2961
|
// Adapter validation (NEW - Phase 5)
|
|
2962
|
-
adapterValidation:
|
|
2962
|
+
adapterValidation: Sn,
|
|
2963
2963
|
// Actions
|
|
2964
2964
|
actions: {
|
|
2965
2965
|
// Query state (from queryBuilder)
|
|
2966
2966
|
setActiveQueryIndex: l.setActiveQueryIndex,
|
|
2967
2967
|
setMergeStrategy: l.setMergeStrategy,
|
|
2968
2968
|
// Metrics
|
|
2969
|
-
openMetricsModal:
|
|
2970
|
-
addMetric:
|
|
2971
|
-
removeMetric:
|
|
2969
|
+
openMetricsModal: Bt,
|
|
2970
|
+
addMetric: Nt,
|
|
2971
|
+
removeMetric: Vt,
|
|
2972
2972
|
toggleMetric: Re,
|
|
2973
|
-
reorderMetrics:
|
|
2973
|
+
reorderMetrics: Et,
|
|
2974
2974
|
// Breakdowns
|
|
2975
|
-
openBreakdownsModal:
|
|
2976
|
-
addBreakdown:
|
|
2977
|
-
removeBreakdown:
|
|
2975
|
+
openBreakdownsModal: Pt,
|
|
2976
|
+
addBreakdown: Ut,
|
|
2977
|
+
removeBreakdown: _t,
|
|
2978
2978
|
toggleBreakdown: ke,
|
|
2979
|
-
setBreakdownGranularity:
|
|
2980
|
-
toggleBreakdownComparison:
|
|
2981
|
-
reorderBreakdowns:
|
|
2979
|
+
setBreakdownGranularity: Lt,
|
|
2980
|
+
toggleBreakdownComparison: Kt,
|
|
2981
|
+
reorderBreakdowns: $t,
|
|
2982
2982
|
// Filters
|
|
2983
|
-
setFilters:
|
|
2984
|
-
dropFieldToFilter:
|
|
2985
|
-
setOrder:
|
|
2983
|
+
setFilters: Gt,
|
|
2984
|
+
dropFieldToFilter: Ht,
|
|
2985
|
+
setOrder: Ot,
|
|
2986
2986
|
// Multi-query (from queryBuilder)
|
|
2987
2987
|
addQuery: l.addQuery,
|
|
2988
2988
|
removeQuery: l.removeQuery,
|
|
2989
2989
|
// Funnel (legacy)
|
|
2990
|
-
setFunnelBindingKey:
|
|
2990
|
+
setFunnelBindingKey: Wt,
|
|
2991
2991
|
// Analysis Type (new)
|
|
2992
|
-
setAnalysisType:
|
|
2992
|
+
setAnalysisType: Jt,
|
|
2993
2993
|
// Funnel Mode (new dedicated state)
|
|
2994
|
-
setFunnelCube:
|
|
2995
|
-
addFunnelStep:
|
|
2996
|
-
removeFunnelStep:
|
|
2997
|
-
updateFunnelStep:
|
|
2998
|
-
setActiveFunnelStepIndex:
|
|
2999
|
-
reorderFunnelSteps:
|
|
3000
|
-
setFunnelTimeDimension:
|
|
3001
|
-
setFunnelDisplayConfig:
|
|
2994
|
+
setFunnelCube: Yt,
|
|
2995
|
+
addFunnelStep: Xt,
|
|
2996
|
+
removeFunnelStep: Zt,
|
|
2997
|
+
updateFunnelStep: en,
|
|
2998
|
+
setActiveFunnelStepIndex: tn,
|
|
2999
|
+
reorderFunnelSteps: nn,
|
|
3000
|
+
setFunnelTimeDimension: rn,
|
|
3001
|
+
setFunnelDisplayConfig: an,
|
|
3002
3002
|
// Flow Mode actions
|
|
3003
|
-
setFlowCube:
|
|
3004
|
-
setFlowBindingKey:
|
|
3005
|
-
setFlowTimeDimension:
|
|
3006
|
-
setEventDimension:
|
|
3007
|
-
setStartingStepName:
|
|
3008
|
-
setStartingStepFilters:
|
|
3009
|
-
setStepsBefore:
|
|
3010
|
-
setStepsAfter:
|
|
3011
|
-
setJoinStrategy:
|
|
3012
|
-
setFlowDisplayConfig:
|
|
3003
|
+
setFlowCube: on,
|
|
3004
|
+
setFlowBindingKey: ln,
|
|
3005
|
+
setFlowTimeDimension: cn,
|
|
3006
|
+
setEventDimension: dn,
|
|
3007
|
+
setStartingStepName: un,
|
|
3008
|
+
setStartingStepFilters: fn,
|
|
3009
|
+
setStepsBefore: mn,
|
|
3010
|
+
setStepsAfter: yn,
|
|
3011
|
+
setJoinStrategy: gn,
|
|
3012
|
+
setFlowDisplayConfig: hn,
|
|
3013
3013
|
// Retention Mode actions (simplified Mixpanel-style)
|
|
3014
3014
|
setRetentionCube: De,
|
|
3015
3015
|
setRetentionBindingKey: Te,
|
|
3016
3016
|
setRetentionTimeDimension: Fe,
|
|
3017
3017
|
setRetentionDateRange: k,
|
|
3018
|
-
setRetentionCohortFilters:
|
|
3019
|
-
setRetentionActivityFilters:
|
|
3020
|
-
setRetentionBreakdowns:
|
|
3018
|
+
setRetentionCohortFilters: Ft,
|
|
3019
|
+
setRetentionActivityFilters: At,
|
|
3020
|
+
setRetentionBreakdowns: Qt,
|
|
3021
3021
|
addRetentionBreakdown: Ae,
|
|
3022
|
-
removeRetentionBreakdown:
|
|
3023
|
-
setRetentionViewGranularity:
|
|
3024
|
-
setRetentionPeriods:
|
|
3025
|
-
setRetentionType:
|
|
3026
|
-
setRetentionDisplayConfig:
|
|
3022
|
+
removeRetentionBreakdown: Mt,
|
|
3023
|
+
setRetentionViewGranularity: Rt,
|
|
3024
|
+
setRetentionPeriods: kt,
|
|
3025
|
+
setRetentionType: It,
|
|
3026
|
+
setRetentionDisplayConfig: pn,
|
|
3027
3027
|
// Chart (from chartDefaults)
|
|
3028
3028
|
setChartType: q.setChartType,
|
|
3029
3029
|
setChartConfig: q.setChartConfig,
|
|
@@ -3036,27 +3036,27 @@ function Qi(t = {}) {
|
|
|
3036
3036
|
closeFieldModal: V.closeFieldModal,
|
|
3037
3037
|
setActiveTableIndex: V.setActiveTableIndex,
|
|
3038
3038
|
// AI
|
|
3039
|
-
openAI:
|
|
3039
|
+
openAI: Cn,
|
|
3040
3040
|
closeAI: ie,
|
|
3041
|
-
setAIPrompt:
|
|
3042
|
-
generateAI:
|
|
3043
|
-
acceptAI:
|
|
3044
|
-
cancelAI:
|
|
3041
|
+
setAIPrompt: wn,
|
|
3042
|
+
generateAI: xn,
|
|
3043
|
+
acceptAI: Dn,
|
|
3044
|
+
cancelAI: Tn,
|
|
3045
3045
|
// Share
|
|
3046
|
-
share:
|
|
3046
|
+
share: Fn,
|
|
3047
3047
|
// Utility
|
|
3048
|
-
clearQuery:
|
|
3049
|
-
clearCurrentMode:
|
|
3048
|
+
clearQuery: jt,
|
|
3049
|
+
clearCurrentMode: zt,
|
|
3050
3050
|
refetch: I.refetch,
|
|
3051
|
-
handleFieldSelected:
|
|
3051
|
+
handleFieldSelected: vn
|
|
3052
3052
|
},
|
|
3053
3053
|
// Refs
|
|
3054
|
-
getQueryConfig:
|
|
3055
|
-
getChartConfig:
|
|
3056
|
-
getAnalysisType:
|
|
3054
|
+
getQueryConfig: An,
|
|
3055
|
+
getChartConfig: Qn,
|
|
3056
|
+
getAnalysisType: Mn
|
|
3057
3057
|
};
|
|
3058
3058
|
}
|
|
3059
|
-
function
|
|
3059
|
+
function Xr(t, i) {
|
|
3060
3060
|
const e = [];
|
|
3061
3061
|
if (!i?.cubes)
|
|
3062
3062
|
return e;
|
|
@@ -3082,7 +3082,7 @@ function ei(t, i) {
|
|
|
3082
3082
|
}
|
|
3083
3083
|
return e;
|
|
3084
3084
|
}
|
|
3085
|
-
function
|
|
3085
|
+
function Zr(t) {
|
|
3086
3086
|
const i = [];
|
|
3087
3087
|
for (let e = 0; e < t.length; e++) {
|
|
3088
3088
|
const n = t[e], r = n.query;
|
|
@@ -3094,18 +3094,18 @@ function ti(t) {
|
|
|
3094
3094
|
}
|
|
3095
3095
|
return i;
|
|
3096
3096
|
}
|
|
3097
|
-
function
|
|
3097
|
+
function ei(t, i) {
|
|
3098
3098
|
if (typeof t.dimension == "string")
|
|
3099
3099
|
return !0;
|
|
3100
|
-
const e =
|
|
3100
|
+
const e = pt(i);
|
|
3101
3101
|
return e ? t.dimension.some((n) => n.cube === e) : !1;
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function ti(t, i) {
|
|
3104
3104
|
const e = [];
|
|
3105
3105
|
for (let n = 0; n < i.length; n++) {
|
|
3106
3106
|
const r = i[n];
|
|
3107
|
-
if (!
|
|
3108
|
-
const s =
|
|
3107
|
+
if (!ei(t, r.query)) {
|
|
3108
|
+
const s = pt(r.query) || "unknown";
|
|
3109
3109
|
e.push({
|
|
3110
3110
|
type: "cross_cube",
|
|
3111
3111
|
message: `Step ${n + 1} uses cube "${s}" but no binding key mapping exists for it`,
|
|
@@ -3115,26 +3115,26 @@ function ri(t, i) {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
return e;
|
|
3117
3117
|
}
|
|
3118
|
-
function
|
|
3118
|
+
function mt(t) {
|
|
3119
3119
|
return t ? /^P(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/.test(t) ? null : {
|
|
3120
3120
|
type: "time_window",
|
|
3121
3121
|
message: `Invalid time window format "${t}". Expected ISO 8601 duration (e.g., P7D, PT1H)`
|
|
3122
3122
|
} : null;
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function Ai(t, i) {
|
|
3125
3125
|
const e = [], n = [];
|
|
3126
3126
|
t.steps.length < 2 && e.push({
|
|
3127
3127
|
type: "general",
|
|
3128
3128
|
message: "Funnel requires at least 2 steps"
|
|
3129
|
-
}), t.bindingKey?.dimension ? (e.push(...
|
|
3129
|
+
}), t.bindingKey?.dimension ? (e.push(...Xr(t.bindingKey, i)), e.push(...ti(t.bindingKey, t.steps))) : e.push({
|
|
3130
3130
|
type: "binding_key",
|
|
3131
3131
|
message: "Binding key dimension is required"
|
|
3132
|
-
}), e.push(...
|
|
3132
|
+
}), e.push(...Zr(t.steps));
|
|
3133
3133
|
for (let s = 0; s < t.steps.length; s++) {
|
|
3134
|
-
const o = t.steps[s], l =
|
|
3134
|
+
const o = t.steps[s], l = mt(o.timeToConvert);
|
|
3135
3135
|
l && (l.stepIndex = s, e.push(l));
|
|
3136
3136
|
}
|
|
3137
|
-
const r =
|
|
3137
|
+
const r = mt(t.globalTimeWindow);
|
|
3138
3138
|
return r && e.push(r), t.steps.length > 5 && n.push({
|
|
3139
3139
|
type: "general",
|
|
3140
3140
|
message: "Funnels with more than 5 steps may have reduced performance"
|
|
@@ -3144,10 +3144,10 @@ function Mi(t, i) {
|
|
|
3144
3144
|
warnings: n
|
|
3145
3145
|
};
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function Qi(t, i) {
|
|
3148
3148
|
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
3149
|
}
|
|
3150
|
-
function
|
|
3150
|
+
function Mi(t) {
|
|
3151
3151
|
if (!t?.cubes) return [];
|
|
3152
3152
|
const i = [];
|
|
3153
3153
|
for (const e of t.cubes)
|
|
@@ -3160,7 +3160,7 @@ function ki(t) {
|
|
|
3160
3160
|
});
|
|
3161
3161
|
return i;
|
|
3162
3162
|
}
|
|
3163
|
-
function
|
|
3163
|
+
function Ri(t) {
|
|
3164
3164
|
if (!t?.dimension) return "Select binding key...";
|
|
3165
3165
|
if (typeof t.dimension == "string")
|
|
3166
3166
|
return t.dimension.split(".")[1] || t.dimension;
|
|
@@ -3171,41 +3171,41 @@ function Ii(t) {
|
|
|
3171
3171
|
return "Select binding key...";
|
|
3172
3172
|
}
|
|
3173
3173
|
export {
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3174
|
+
ti as A,
|
|
3175
|
+
Qi as B,
|
|
3176
|
+
Mi as C,
|
|
3177
|
+
Ri as D,
|
|
3178
|
+
yi as E,
|
|
3179
|
+
jr as F,
|
|
3180
|
+
Ue as G,
|
|
3181
|
+
zr as H,
|
|
3182
|
+
gi as I,
|
|
3183
|
+
Br as J,
|
|
3184
|
+
hr as a,
|
|
3185
3185
|
c as b,
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3186
|
+
hi as c,
|
|
3187
|
+
pi as d,
|
|
3188
|
+
Ci as e,
|
|
3189
|
+
Nr as f,
|
|
3190
|
+
wi as g,
|
|
3191
|
+
bi as h,
|
|
3192
|
+
Si as i,
|
|
3193
|
+
Vr as j,
|
|
3194
|
+
Er as k,
|
|
3195
|
+
Pr as l,
|
|
3196
|
+
Ur as m,
|
|
3197
|
+
vi as n,
|
|
3198
|
+
xi as o,
|
|
3199
|
+
Oe as p,
|
|
3200
|
+
Or as q,
|
|
3201
|
+
Ti as r,
|
|
3202
|
+
Je as s,
|
|
3203
|
+
Jr as t,
|
|
3204
|
+
Fi as u,
|
|
3205
|
+
_r as v,
|
|
3206
|
+
Di as w,
|
|
3207
|
+
Ai as x,
|
|
3208
|
+
Xr as y,
|
|
3209
|
+
Zr as z
|
|
3210
3210
|
};
|
|
3211
|
-
//# sourceMappingURL=analysis-builder-shared-
|
|
3211
|
+
//# sourceMappingURL=analysis-builder-shared-DsbdRCzz.js.map
|