@sisense/sdk-ui 1.10.0 → 1.10.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/ai.js +138 -138
- package/dist/{debounce-2yQ2123W.js → debounce-CVvJ1016.js} +32517 -32554
- package/dist/index.js +34300 -23762
- package/package.json +7 -7
package/dist/ai.js
CHANGED
|
@@ -9,7 +9,7 @@ var c1 = (e, t, n) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var n of t1(t))
|
|
10
10
|
S1.call(t, n) && c1(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, D = (e, t) => ae(e, le(t));
|
|
13
13
|
var R1 = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var o in e)
|
|
@@ -36,10 +36,10 @@ var k = (e, t, n) => new Promise((o, s) => {
|
|
|
36
36
|
}, l = (c) => c.done ? o(c.value) : Promise.resolve(c.value).then(a, i);
|
|
37
37
|
l((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import {
|
|
39
|
+
import { cn as ce, co as de, cp as O1, cq as ue, cr as K, cs as he, ct as pe, cu as Ce, aZ as ge, V as fe, a_ as me, X as be, b as xe, cd as Q, S as I1, cv as ye, n as m, f as H, aJ as v, bA as ve, cw as ke, bd as we, bc as Le, be as o1, cx as Me, cy as Se, bn as Z, bg as W, cz as F1, bp as Re, cA as Ee, bi as He, cB as Te, bk as d1, bl as C, bo as $e, cC as De, cD as A1, aG as Ne, ba as Be, cE as Oe, by as Ie, cF as Fe, a1 as Ae, M as u1, B as E1, cG as Pe, cH as qe, cI as We, cJ as je, cK as Ve, cL as Ze, cM as Qe, aT as H1, aU as T1, bC as ze, aE as Ge, aF as Ue, aI as P1 } from "./debounce-CVvJ1016.js";
|
|
40
40
|
import { jsx as r, jsxs as u, Fragment as T } from "react/jsx-runtime";
|
|
41
|
-
import * as
|
|
42
|
-
import { createContext as f1, useMemo as
|
|
41
|
+
import * as P from "react";
|
|
42
|
+
import { createContext as f1, useMemo as B, useContext as q1, useEffect as Y, useCallback as E, useState as L, useRef as _, useLayoutEffect as m1, Component as _e, createElement as C1, isValidElement as Ke, Children as Ye, memo as Je, forwardRef as Xe } from "react";
|
|
43
43
|
class et extends ce {
|
|
44
44
|
constructor(t, n) {
|
|
45
45
|
super(), this.client = t, this.setOptions(n), this.bindMethods(), this.updateResult();
|
|
@@ -78,12 +78,12 @@ class et extends ce {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
mutate(t, n) {
|
|
81
|
-
return this.mutateOptions = n, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client,
|
|
81
|
+
return this.mutateOptions = n, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, D(w({}, this.options), {
|
|
82
82
|
variables: typeof t != "undefined" ? t : this.options.variables
|
|
83
83
|
})), this.currentMutation.addObserver(this), this.currentMutation.execute();
|
|
84
84
|
}
|
|
85
85
|
updateResult() {
|
|
86
|
-
const t = this.currentMutation ? this.currentMutation.state : ue(), n =
|
|
86
|
+
const t = this.currentMutation ? this.currentMutation.state : ue(), n = D(w({}, t), {
|
|
87
87
|
isLoading: t.status === "loading",
|
|
88
88
|
isSuccess: t.status === "success",
|
|
89
89
|
isError: t.status === "error",
|
|
@@ -94,7 +94,7 @@ class et extends ce {
|
|
|
94
94
|
this.currentResult = n;
|
|
95
95
|
}
|
|
96
96
|
notify(t) {
|
|
97
|
-
|
|
97
|
+
O1.batch(() => {
|
|
98
98
|
if (this.mutateOptions && this.hasListeners()) {
|
|
99
99
|
if (t.onSuccess) {
|
|
100
100
|
var n, o, s, a;
|
|
@@ -115,16 +115,16 @@ class et extends ce {
|
|
|
115
115
|
function b1(e, t, n) {
|
|
116
116
|
const o = Ce(e, t), s = K({
|
|
117
117
|
context: o.context
|
|
118
|
-
}), [a] =
|
|
119
|
-
|
|
118
|
+
}), [a] = P.useState(() => new et(s, o));
|
|
119
|
+
P.useEffect(() => {
|
|
120
120
|
a.setOptions(o);
|
|
121
121
|
}, [a, o]);
|
|
122
|
-
const i = he(
|
|
122
|
+
const i = he(P.useCallback((c) => a.subscribe(O1.batchCalls(c)), [a]), () => a.getCurrentResult(), () => a.getCurrentResult()), l = P.useCallback((c, d) => {
|
|
123
123
|
a.mutate(c, d).catch(tt);
|
|
124
124
|
}, [a]);
|
|
125
125
|
if (i.error && pe(a.options.useErrorBoundary, [i.error]))
|
|
126
126
|
throw i.error;
|
|
127
|
-
return
|
|
127
|
+
return D(w({}, i), {
|
|
128
128
|
mutate: l,
|
|
129
129
|
mutateAsync: i.mutate
|
|
130
130
|
});
|
|
@@ -206,9 +206,9 @@ const rt = new ge({
|
|
|
206
206
|
refetchOnMount: !1
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
}),
|
|
210
|
-
const { app: t } = fe(), n =
|
|
211
|
-
return /* @__PURE__ */ r(
|
|
209
|
+
}), W1 = f1(void 0), O = () => q1(W1), ot = ({ children: e }) => {
|
|
210
|
+
const { app: t } = fe(), n = B(() => t ? new nt(t.httpClient) : void 0, [t]);
|
|
211
|
+
return /* @__PURE__ */ r(W1.Provider, { value: n, children: /* @__PURE__ */ r(me, { client: rt, children: e }) });
|
|
212
212
|
}, st = `
|
|
213
213
|
=================================================================
|
|
214
214
|
WARNING: You are importing a component from @sisense/sdk-ui/ai.
|
|
@@ -224,7 +224,7 @@ function Cn({ children: e }) {
|
|
|
224
224
|
}, []), /* @__PURE__ */ r(ot, { children: e });
|
|
225
225
|
}
|
|
226
226
|
const x1 = (e, t = !0) => {
|
|
227
|
-
const n =
|
|
227
|
+
const n = B(() => {
|
|
228
228
|
var h, p;
|
|
229
229
|
if ("jaql" in e)
|
|
230
230
|
return e;
|
|
@@ -250,7 +250,7 @@ const x1 = (e, t = !0) => {
|
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
}, [e]), o =
|
|
253
|
+
}, [e]), o = O(), { data: s, error: a, isError: i, isLoading: l, isSuccess: c, refetch: d } = Q({
|
|
254
254
|
queryKey: ["getNlgQueryResult", n, o],
|
|
255
255
|
queryFn: () => o == null ? void 0 : o.ai.getNlgQueryResult(n),
|
|
256
256
|
select: (h) => {
|
|
@@ -281,14 +281,14 @@ const x1 = (e, t = !0) => {
|
|
|
281
281
|
numOfRecommendations: 4,
|
|
282
282
|
numOfRecentPrompts: 5,
|
|
283
283
|
inputPromptText: "Ask a question"
|
|
284
|
-
}), V1 = f1(w({}, j1)),
|
|
284
|
+
}), V1 = f1(w({}, j1)), q = () => q1(V1), at = ({ children: e, value: t }) => {
|
|
285
285
|
const n = Object.entries(t).reduce(
|
|
286
286
|
(o, [s, a]) => (a !== void 0 && (o[s] = a), o),
|
|
287
287
|
w({}, j1)
|
|
288
288
|
);
|
|
289
289
|
return /* @__PURE__ */ r(V1.Provider, { value: n, children: e });
|
|
290
290
|
}, Z1 = (e) => {
|
|
291
|
-
const { contextTitle: t, count: n } = e, o =
|
|
291
|
+
const { contextTitle: t, count: n } = e, o = O(), { numOfRecommendations: s } = q(), a = n != null ? n : s, { isLoading: i, isError: l, isSuccess: c, data: d, error: h, refetch: p } = Q({
|
|
292
292
|
queryKey: ["getQueryRecommendations", t, a, o],
|
|
293
293
|
queryFn: () => o == null ? void 0 : o.ai.getQueryRecommendations(t, {
|
|
294
294
|
numOfRecommendations: a
|
|
@@ -308,7 +308,7 @@ const x1 = (e, t = !0) => {
|
|
|
308
308
|
}, fn = I1("useGetQueryRecommendations")(
|
|
309
309
|
Z1
|
|
310
310
|
), y1 = "Oh snap, something went wrong. Please try again later.", lt = "Oh snap, something went wrong. Please try again later or try asking a different question.", ct = "Something went wrong and we were unable to retrieve the chat thread. Let's start over!", Q1 = "Chat unavailable. Please try again later.", v1 = "chatHistory", dt = (e) => {
|
|
311
|
-
const t =
|
|
311
|
+
const t = O();
|
|
312
312
|
return Q({
|
|
313
313
|
queryKey: [v1, e, t],
|
|
314
314
|
queryFn: () => k(void 0, null, function* () {
|
|
@@ -317,7 +317,7 @@ const x1 = (e, t = !0) => {
|
|
|
317
317
|
enabled: !!t && !!e
|
|
318
318
|
});
|
|
319
319
|
}, z1 = (e) => {
|
|
320
|
-
const t =
|
|
320
|
+
const t = O(), n = K();
|
|
321
321
|
return b1({
|
|
322
322
|
mutationFn: () => k(void 0, null, function* () {
|
|
323
323
|
if (!(!t || !e))
|
|
@@ -340,7 +340,7 @@ const x1 = (e, t = !0) => {
|
|
|
340
340
|
isError: o
|
|
341
341
|
};
|
|
342
342
|
}, k1 = () => {
|
|
343
|
-
const e =
|
|
343
|
+
const e = O(), { data: t, isLoading: n, fetchStatus: o } = Q({
|
|
344
344
|
queryKey: ["getDataTopics", e],
|
|
345
345
|
queryFn: () => k(void 0, null, function* () {
|
|
346
346
|
if (!e)
|
|
@@ -368,7 +368,7 @@ const x1 = (e, t = !0) => {
|
|
|
368
368
|
});
|
|
369
369
|
return { data: t, isLoading: n, fetchStatus: o };
|
|
370
370
|
}, ht = () => {
|
|
371
|
-
const e =
|
|
371
|
+
const e = O(), { data: t, isLoading: n } = Q({
|
|
372
372
|
queryKey: ["getAllChats", e],
|
|
373
373
|
queryFn: () => e == null ? void 0 : e.ai.chat.getAll(),
|
|
374
374
|
enabled: !!e
|
|
@@ -378,7 +378,7 @@ const x1 = (e, t = !0) => {
|
|
|
378
378
|
isLoading: n
|
|
379
379
|
};
|
|
380
380
|
}, pt = (e, t) => {
|
|
381
|
-
const n = K(), o =
|
|
381
|
+
const n = K(), o = O(), s = b1({
|
|
382
382
|
mutationFn: () => k(void 0, null, function* () {
|
|
383
383
|
if (!(!o || !e))
|
|
384
384
|
return o.ai.chat.create(e);
|
|
@@ -411,7 +411,7 @@ const x1 = (e, t = !0) => {
|
|
|
411
411
|
e && t.setQueriesData([v1, e], (c) => c && [...c, l]);
|
|
412
412
|
},
|
|
413
413
|
[t, e]
|
|
414
|
-
), { enableFollowupQuestions: o } =
|
|
414
|
+
), { enableFollowupQuestions: o } = q(), s = O(), { mutate: a, isLoading: i } = b1({
|
|
415
415
|
mutationFn: (l) => k(void 0, null, function* () {
|
|
416
416
|
if (!(!s || !e))
|
|
417
417
|
return s.ai.chat.post(e, {
|
|
@@ -437,15 +437,15 @@ const x1 = (e, t = !0) => {
|
|
|
437
437
|
});
|
|
438
438
|
return { mutate: a, isLoading: i };
|
|
439
439
|
}, G1 = (e) => !!e && "type" in e && e.type === "nlq", ft = (e) => {
|
|
440
|
-
var $,
|
|
441
|
-
const { data: t, isLoading: n } = k1(), { data: o, isLoading: s } = ht(), a = ($ = t == null ? void 0 : t.find((M) => M.name === e)) == null ? void 0 : $.id, i = (
|
|
440
|
+
var $, N;
|
|
441
|
+
const { data: t, isLoading: n } = k1(), { data: o, isLoading: s } = ht(), a = ($ = t == null ? void 0 : t.find((M) => M.name === e)) == null ? void 0 : $.id, i = (N = o.find((M) => M.contextId === a)) == null ? void 0 : N.chatId, l = n || !!a, c = s || !!i, [d, h] = L(null), { isError: p } = pt(
|
|
442
442
|
a,
|
|
443
443
|
l && !c
|
|
444
444
|
), { history: f, isLoading: b, isError: x } = ut(i);
|
|
445
445
|
Y(() => {
|
|
446
446
|
p ? h(new Error(Q1)) : x && h(new Error(ct));
|
|
447
447
|
}, [p, x]);
|
|
448
|
-
const { mutate: g, isLoading: S } = gt(i),
|
|
448
|
+
const { mutate: g, isLoading: S } = gt(i), A = B(() => {
|
|
449
449
|
if (f != null && f.length) {
|
|
450
450
|
const M = f[f.length - 1];
|
|
451
451
|
if (G1(M))
|
|
@@ -456,14 +456,14 @@ const x1 = (e, t = !0) => {
|
|
|
456
456
|
return {
|
|
457
457
|
chatId: i,
|
|
458
458
|
history: f != null ? f : [],
|
|
459
|
-
lastNlqResponse:
|
|
459
|
+
lastNlqResponse: A,
|
|
460
460
|
sendMessage: g,
|
|
461
461
|
isAwaitingResponse: S,
|
|
462
462
|
isLoading: b,
|
|
463
463
|
lastError: d
|
|
464
464
|
};
|
|
465
465
|
}, mn = (e) => {
|
|
466
|
-
const t =
|
|
466
|
+
const t = O(), { data: n, isLoading: o } = Q({
|
|
467
467
|
queryKey: ["getDataSourceFields", e, t],
|
|
468
468
|
queryFn: () => e ? t == null ? void 0 : t.ai.getDataSourceFields(e) : void 0,
|
|
469
469
|
select: (s) => s,
|
|
@@ -653,13 +653,13 @@ function Tt({
|
|
|
653
653
|
],
|
|
654
654
|
children: /* @__PURE__ */ u(Ht, { style: { width: s == null ? void 0 : s.offsetWidth }, theme: c, children: [
|
|
655
655
|
n && /* @__PURE__ */ r(s1, {}),
|
|
656
|
-
!n && l.map((h) => /* @__PURE__ */ r(Et,
|
|
656
|
+
!n && l.map((h) => /* @__PURE__ */ r(Et, D(w({}, h), { alwaysExpanded: d }), h.title))
|
|
657
657
|
] })
|
|
658
658
|
}
|
|
659
659
|
);
|
|
660
660
|
}
|
|
661
661
|
const $t = 34;
|
|
662
|
-
function
|
|
662
|
+
function Dt({
|
|
663
663
|
onSendMessage: e,
|
|
664
664
|
onClearHistoryClick: t,
|
|
665
665
|
disabled: n,
|
|
@@ -667,7 +667,7 @@ function Nt({
|
|
|
667
667
|
suggestions: s,
|
|
668
668
|
isLoading: a
|
|
669
669
|
}) {
|
|
670
|
-
const [i, l] = L(""), { inputPromptText: c } =
|
|
670
|
+
const [i, l] = L(""), { inputPromptText: c } = q(), d = E(() => {
|
|
671
671
|
if (n)
|
|
672
672
|
return;
|
|
673
673
|
if (g1(i)) {
|
|
@@ -697,7 +697,7 @@ function Nt({
|
|
|
697
697
|
)}px`);
|
|
698
698
|
}, [i]);
|
|
699
699
|
const { themeSettings: x } = v();
|
|
700
|
-
return /* @__PURE__ */ u(
|
|
700
|
+
return /* @__PURE__ */ u(Nt, { theme: x, children: [
|
|
701
701
|
/* @__PURE__ */ r(
|
|
702
702
|
Tt,
|
|
703
703
|
{
|
|
@@ -709,9 +709,9 @@ function Nt({
|
|
|
709
709
|
text: i
|
|
710
710
|
}
|
|
711
711
|
),
|
|
712
|
-
t && /* @__PURE__ */ r(
|
|
712
|
+
t && /* @__PURE__ */ r(Bt, { "aria-label": "clear history", onClick: t, children: /* @__PURE__ */ r(Lt, { theme: x }) }),
|
|
713
713
|
/* @__PURE__ */ r(
|
|
714
|
-
|
|
714
|
+
Ot,
|
|
715
715
|
{
|
|
716
716
|
ref: b,
|
|
717
717
|
rows: 1,
|
|
@@ -735,19 +735,19 @@ function Nt({
|
|
|
735
735
|
)
|
|
736
736
|
] });
|
|
737
737
|
}
|
|
738
|
-
const
|
|
738
|
+
const Nt = m.div`
|
|
739
739
|
display: flex;
|
|
740
740
|
flex-direction: row;
|
|
741
741
|
align-items: flex-end;
|
|
742
742
|
justify-content: space-between;
|
|
743
743
|
|
|
744
744
|
background-color: ${({ theme: e }) => e.aiChat.backgroundColor};
|
|
745
|
-
`,
|
|
745
|
+
`, Bt = m.button`
|
|
746
746
|
height: 34px;
|
|
747
747
|
background-color: inherit;
|
|
748
748
|
cursor: pointer;
|
|
749
749
|
border: none;
|
|
750
|
-
`,
|
|
750
|
+
`, Ot = m.textarea`
|
|
751
751
|
font-size: inherit;
|
|
752
752
|
line-height: inherit;
|
|
753
753
|
resize: none;
|
|
@@ -797,7 +797,7 @@ const Dt = m.div`
|
|
|
797
797
|
` : H`
|
|
798
798
|
justify-content: flex-start;
|
|
799
799
|
`}
|
|
800
|
-
`,
|
|
800
|
+
`, At = m.div`
|
|
801
801
|
font-size: inherit;
|
|
802
802
|
line-height: inherit;
|
|
803
803
|
padding-top: 8.5px;
|
|
@@ -824,10 +824,10 @@ const Dt = m.div`
|
|
|
824
824
|
background-color: ${({ theme: e, align: t }) => t === "right" ? e.aiChat.userMessages.backgroundColor : e.aiChat.systemMessages.backgroundColor};
|
|
825
825
|
`, F = ({ align: e, children: t }) => {
|
|
826
826
|
const { themeSettings: n } = v();
|
|
827
|
-
return /* @__PURE__ */ r(Ft, { theme: n, align: e, children: /* @__PURE__ */ r(
|
|
827
|
+
return /* @__PURE__ */ r(Ft, { theme: n, align: e, children: /* @__PURE__ */ r(At, { theme: n, align: e, children: t }) });
|
|
828
828
|
};
|
|
829
|
-
function
|
|
830
|
-
const { welcomeText: e } =
|
|
829
|
+
function Pt() {
|
|
830
|
+
const { welcomeText: e } = q();
|
|
831
831
|
return e === !1 ? null : /* @__PURE__ */ r(F, { align: "left", children: e != null ? e : /* @__PURE__ */ u(T, { children: [
|
|
832
832
|
/* @__PURE__ */ r("div", { className: "csdk-font-semibold", children: "Welcome to the Query Assistant!" }),
|
|
833
833
|
/* @__PURE__ */ r("br", {}),
|
|
@@ -893,7 +893,7 @@ function _1() {
|
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
895
|
}
|
|
896
|
-
const
|
|
896
|
+
const qt = m.div`
|
|
897
897
|
display: flex;
|
|
898
898
|
|
|
899
899
|
${({ align: e }) => e === "right" ? H`
|
|
@@ -901,7 +901,7 @@ const Wt = m.div`
|
|
|
901
901
|
` : H`
|
|
902
902
|
justify-content: flex-start;
|
|
903
903
|
`}
|
|
904
|
-
`,
|
|
904
|
+
`, Wt = m.div`
|
|
905
905
|
font-size: inherit;
|
|
906
906
|
line-height: inherit;
|
|
907
907
|
border: ${({ theme: e }) => e.aiChat.clickableMessages.border};
|
|
@@ -935,8 +935,8 @@ function r1({
|
|
|
935
935
|
onMouseLeave: s
|
|
936
936
|
}) {
|
|
937
937
|
const { themeSettings: a } = v();
|
|
938
|
-
return /* @__PURE__ */ r(
|
|
939
|
-
|
|
938
|
+
return /* @__PURE__ */ r(qt, { align: t, children: /* @__PURE__ */ r(
|
|
939
|
+
Wt,
|
|
940
940
|
{
|
|
941
941
|
theme: a,
|
|
942
942
|
onClick: n,
|
|
@@ -1043,7 +1043,7 @@ function zt() {
|
|
|
1043
1043
|
function Gt(e) {
|
|
1044
1044
|
return Le("MuiDialog", e);
|
|
1045
1045
|
}
|
|
1046
|
-
const p1 = we("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), K1 = /* @__PURE__ */
|
|
1046
|
+
const p1 = we("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), K1 = /* @__PURE__ */ P.createContext({});
|
|
1047
1047
|
process.env.NODE_ENV !== "production" && (K1.displayName = "DialogContext");
|
|
1048
1048
|
const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"], _t = o1(Me, {
|
|
1049
1049
|
name: "MuiDialog",
|
|
@@ -1074,7 +1074,7 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1074
1074
|
// Use !important to override the Modal inline-style.
|
|
1075
1075
|
position: "absolute !important"
|
|
1076
1076
|
}
|
|
1077
|
-
}),
|
|
1077
|
+
}), Jt = o1("div", {
|
|
1078
1078
|
name: "MuiDialog",
|
|
1079
1079
|
slot: "Container",
|
|
1080
1080
|
overridesResolver: (e, t) => {
|
|
@@ -1085,7 +1085,7 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1085
1085
|
}
|
|
1086
1086
|
})(({
|
|
1087
1087
|
ownerState: e
|
|
1088
|
-
}) =>
|
|
1088
|
+
}) => W({
|
|
1089
1089
|
height: "100%",
|
|
1090
1090
|
"@media print": {
|
|
1091
1091
|
height: "auto"
|
|
@@ -1107,7 +1107,7 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1107
1107
|
height: "100%",
|
|
1108
1108
|
width: "0"
|
|
1109
1109
|
}
|
|
1110
|
-
})),
|
|
1110
|
+
})), Xt = o1(F1, {
|
|
1111
1111
|
name: "MuiDialog",
|
|
1112
1112
|
slot: "Paper",
|
|
1113
1113
|
overridesResolver: (e, t) => {
|
|
@@ -1119,7 +1119,7 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1119
1119
|
})(({
|
|
1120
1120
|
theme: e,
|
|
1121
1121
|
ownerState: t
|
|
1122
|
-
}) =>
|
|
1122
|
+
}) => W({
|
|
1123
1123
|
margin: 32,
|
|
1124
1124
|
position: "relative",
|
|
1125
1125
|
overflowY: "auto",
|
|
@@ -1166,7 +1166,7 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1166
1166
|
margin: 0,
|
|
1167
1167
|
maxWidth: "100%"
|
|
1168
1168
|
}
|
|
1169
|
-
})), Y1 = /* @__PURE__ */
|
|
1169
|
+
})), Y1 = /* @__PURE__ */ P.forwardRef(function(t, n) {
|
|
1170
1170
|
const o = Re({
|
|
1171
1171
|
props: t,
|
|
1172
1172
|
name: "MuiDialog"
|
|
@@ -1185,65 +1185,65 @@ const Ut = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
1185
1185
|
fullWidth: x = !1,
|
|
1186
1186
|
maxWidth: g = "sm",
|
|
1187
1187
|
onBackdropClick: S,
|
|
1188
|
-
onClick:
|
|
1188
|
+
onClick: A,
|
|
1189
1189
|
onClose: $,
|
|
1190
|
-
open:
|
|
1190
|
+
open: N,
|
|
1191
1191
|
PaperComponent: M = F1,
|
|
1192
|
-
PaperProps:
|
|
1192
|
+
PaperProps: J = {},
|
|
1193
1193
|
scroll: a1 = "paper",
|
|
1194
|
-
TransitionComponent:
|
|
1194
|
+
TransitionComponent: X = De,
|
|
1195
1195
|
transitionDuration: z = a,
|
|
1196
1196
|
TransitionProps: I
|
|
1197
|
-
} = o, e1 = He(o, Ut), j =
|
|
1197
|
+
} = o, e1 = He(o, Ut), j = W({}, o, {
|
|
1198
1198
|
disableEscapeKeyDown: f,
|
|
1199
1199
|
fullScreen: b,
|
|
1200
1200
|
fullWidth: x,
|
|
1201
1201
|
maxWidth: g,
|
|
1202
1202
|
scroll: a1
|
|
1203
|
-
}), R = Kt(j), G =
|
|
1203
|
+
}), R = Kt(j), G = P.useRef(), re = (V) => {
|
|
1204
1204
|
G.current = V.target === V.currentTarget;
|
|
1205
1205
|
}, oe = (V) => {
|
|
1206
|
-
|
|
1207
|
-
}, l1 = Te(l), se =
|
|
1206
|
+
A && A(V), G.current && (G.current = null, S && S(V), $ && $(V, "backdropClick"));
|
|
1207
|
+
}, l1 = Te(l), se = P.useMemo(() => ({
|
|
1208
1208
|
titleId: l1
|
|
1209
1209
|
}), [l1]);
|
|
1210
|
-
return /* @__PURE__ */ r(Yt,
|
|
1210
|
+
return /* @__PURE__ */ r(Yt, W({
|
|
1211
1211
|
className: d1(R.root, p),
|
|
1212
1212
|
closeAfterTransition: !0,
|
|
1213
1213
|
components: {
|
|
1214
1214
|
Backdrop: _t
|
|
1215
1215
|
},
|
|
1216
1216
|
componentsProps: {
|
|
1217
|
-
backdrop:
|
|
1217
|
+
backdrop: W({
|
|
1218
1218
|
transitionDuration: z,
|
|
1219
1219
|
as: c
|
|
1220
1220
|
}, d)
|
|
1221
1221
|
},
|
|
1222
1222
|
disableEscapeKeyDown: f,
|
|
1223
1223
|
onClose: $,
|
|
1224
|
-
open:
|
|
1224
|
+
open: N,
|
|
1225
1225
|
ref: n,
|
|
1226
1226
|
onClick: oe,
|
|
1227
1227
|
ownerState: j
|
|
1228
1228
|
}, e1, {
|
|
1229
|
-
children: /* @__PURE__ */ r(
|
|
1229
|
+
children: /* @__PURE__ */ r(X, W({
|
|
1230
1230
|
appear: !0,
|
|
1231
|
-
in:
|
|
1231
|
+
in: N,
|
|
1232
1232
|
timeout: z,
|
|
1233
1233
|
role: "presentation"
|
|
1234
1234
|
}, I, {
|
|
1235
|
-
children: /* @__PURE__ */ r(
|
|
1235
|
+
children: /* @__PURE__ */ r(Jt, {
|
|
1236
1236
|
className: d1(R.container),
|
|
1237
1237
|
onMouseDown: re,
|
|
1238
1238
|
ownerState: j,
|
|
1239
|
-
children: /* @__PURE__ */ r(
|
|
1239
|
+
children: /* @__PURE__ */ r(Xt, W({
|
|
1240
1240
|
as: M,
|
|
1241
1241
|
elevation: 24,
|
|
1242
1242
|
role: "dialog",
|
|
1243
1243
|
"aria-describedby": i,
|
|
1244
1244
|
"aria-labelledby": l1
|
|
1245
|
-
},
|
|
1246
|
-
className: d1(R.paper,
|
|
1245
|
+
}, J, {
|
|
1246
|
+
className: d1(R.paper, J.className),
|
|
1247
1247
|
ownerState: j,
|
|
1248
1248
|
children: /* @__PURE__ */ r(K1.Provider, {
|
|
1249
1249
|
value: se,
|
|
@@ -1488,17 +1488,17 @@ const U = {
|
|
|
1488
1488
|
}, t2 = {
|
|
1489
1489
|
shouldForwardProp: (e) => !e.startsWith("$")
|
|
1490
1490
|
}, w1 = m(
|
|
1491
|
-
|
|
1491
|
+
A1,
|
|
1492
1492
|
t2
|
|
1493
1493
|
)(({ $themeSettings: e }) => ({
|
|
1494
1494
|
padding: 2,
|
|
1495
1495
|
"&.MuiIconButton-root:hover": {
|
|
1496
|
-
backgroundColor: e ?
|
|
1496
|
+
backgroundColor: e ? Ne(e.chart.backgroundColor) : U.interaction.defaultHover
|
|
1497
1497
|
}
|
|
1498
1498
|
}));
|
|
1499
1499
|
function i1({ title: e, children: t }) {
|
|
1500
1500
|
return /* @__PURE__ */ r(
|
|
1501
|
-
|
|
1501
|
+
Be,
|
|
1502
1502
|
{
|
|
1503
1503
|
title: e,
|
|
1504
1504
|
placement: "top",
|
|
@@ -1592,7 +1592,7 @@ const i2 = ({ title: e }) => {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
),
|
|
1594
1594
|
/* @__PURE__ */ r(
|
|
1595
|
-
|
|
1595
|
+
Oe,
|
|
1596
1596
|
{
|
|
1597
1597
|
anchorEl: t,
|
|
1598
1598
|
anchorOrigin: {
|
|
@@ -1640,7 +1640,7 @@ function d2({
|
|
|
1640
1640
|
onRefresh: t,
|
|
1641
1641
|
onExpand: n
|
|
1642
1642
|
}) {
|
|
1643
|
-
const o =
|
|
1643
|
+
const o = B(
|
|
1644
1644
|
() => [
|
|
1645
1645
|
{
|
|
1646
1646
|
title: "Refresh",
|
|
@@ -1669,7 +1669,7 @@ class u2 extends Fe {
|
|
|
1669
1669
|
y(this, "aggregation");
|
|
1670
1670
|
y(this, "formula");
|
|
1671
1671
|
y(this, "sortType");
|
|
1672
|
-
this.expression = n.jaql.dim || n.jaql.formula, this.metadataItem = n, n.jaql.agg ? this.aggregation = n.jaql.agg : delete this.aggregation, n.jaql.formula ? this.formula = n.jaql.formula : delete this.formula, n.jaql.sort ? this.sortType =
|
|
1672
|
+
this.expression = n.jaql.dim || n.jaql.formula, this.metadataItem = n, n.jaql.agg ? this.aggregation = n.jaql.agg : delete this.aggregation, n.jaql.formula ? this.formula = n.jaql.formula : delete this.formula, n.jaql.sort ? this.sortType = Ae(n.jaql.sort) : delete this.sortType, this.skipValidation = !0;
|
|
1673
1673
|
}
|
|
1674
1674
|
get id() {
|
|
1675
1675
|
return this.expression;
|
|
@@ -1758,7 +1758,7 @@ const p2 = (e) => "chartType" in e.chartRecommendations ? e.chartRecommendations
|
|
|
1758
1758
|
default:
|
|
1759
1759
|
return a;
|
|
1760
1760
|
}
|
|
1761
|
-
},
|
|
1761
|
+
}, D1 = (e, t) => {
|
|
1762
1762
|
var n, o, s, a;
|
|
1763
1763
|
return t === "x" ? (o = (n = e.axesMapping.category) != null ? n : e.axesMapping.x) == null ? void 0 : o.map((i) => i.name).join(", ") : (a = (s = e.axesMapping.value) != null ? s : e.axesMapping.y) == null ? void 0 : a.map((i) => i.name).join(", ");
|
|
1764
1764
|
}, b2 = (e, t) => {
|
|
@@ -1772,13 +1772,13 @@ const p2 = (e) => "chartType" in e.chartRecommendations ? e.chartRecommendations
|
|
|
1772
1772
|
yAxis: {
|
|
1773
1773
|
title: {
|
|
1774
1774
|
enabled: !0,
|
|
1775
|
-
text:
|
|
1775
|
+
text: D1(t, "y")
|
|
1776
1776
|
}
|
|
1777
1777
|
},
|
|
1778
1778
|
xAxis: {
|
|
1779
1779
|
title: {
|
|
1780
1780
|
enabled: !0,
|
|
1781
|
-
text:
|
|
1781
|
+
text: D1(t, "x")
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
1784
1784
|
});
|
|
@@ -1787,9 +1787,9 @@ const p2 = (e) => "chartType" in e.chartRecommendations ? e.chartRecommendations
|
|
|
1787
1787
|
chartStyleOptions: o,
|
|
1788
1788
|
expandedChartStyleOptions: s
|
|
1789
1789
|
};
|
|
1790
|
-
}, bn = (e) =>
|
|
1790
|
+
}, bn = (e) => Pe(e) ? "cartesian" : qe(e) ? "categorical" : We(e) ? "scatter" : je(e) ? "scattermap" : Ve(e) ? "indicator" : Ze(e) ? "areamap" : Qe(e) ? "boxplot" : "table";
|
|
1791
1791
|
function x2({ content: e, dataSource: t }) {
|
|
1792
|
-
const [n, o] = L(!1), { chartElement: s, expandedElement: a } =
|
|
1792
|
+
const [n, o] = L(!1), { chartElement: s, expandedElement: a } = B(() => {
|
|
1793
1793
|
const { detailedDescription: i, jaql: l } = e, c = p2(e), d = c.chartType.toLowerCase(), h = {
|
|
1794
1794
|
cornerRadius: "Small",
|
|
1795
1795
|
header: {
|
|
@@ -1810,22 +1810,22 @@ function x2({ content: e, dataSource: t }) {
|
|
|
1810
1810
|
dataSource: t,
|
|
1811
1811
|
filters: p
|
|
1812
1812
|
};
|
|
1813
|
-
b = /* @__PURE__ */ r("div", { className: "csdk-h-[245px]", children: /* @__PURE__ */ r(H1,
|
|
1813
|
+
b = /* @__PURE__ */ r("div", { className: "csdk-h-[245px]", children: /* @__PURE__ */ r(H1, D(w({}, S), { styleOptions: h })) }), x = /* @__PURE__ */ r(H1, D(w({}, S), { styleOptions: { header: { hidden: !0 } } }));
|
|
1814
1814
|
} else {
|
|
1815
|
-
const { dataOptions: g, chartStyleOptions: S, expandedChartStyleOptions:
|
|
1815
|
+
const { dataOptions: g, chartStyleOptions: S, expandedChartStyleOptions: A } = b2(
|
|
1816
1816
|
f,
|
|
1817
1817
|
c
|
|
1818
|
-
), $ = w(w({}, S), h),
|
|
1818
|
+
), $ = w(w({}, S), h), N = {
|
|
1819
1819
|
chartType: d,
|
|
1820
1820
|
dataOptions: g,
|
|
1821
1821
|
dataSource: t,
|
|
1822
1822
|
filters: p
|
|
1823
1823
|
};
|
|
1824
|
-
b = /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(T1,
|
|
1825
|
-
const M =
|
|
1824
|
+
b = /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(T1, D(w({}, N), { styleOptions: $ })) });
|
|
1825
|
+
const M = D(w({}, A), {
|
|
1826
1826
|
header: { hidden: !0 }
|
|
1827
1827
|
});
|
|
1828
|
-
x = /* @__PURE__ */ r(T1,
|
|
1828
|
+
x = /* @__PURE__ */ r(T1, D(w({}, N), { styleOptions: M }));
|
|
1829
1829
|
}
|
|
1830
1830
|
return { chartElement: b, expandedElement: x };
|
|
1831
1831
|
}, [e, t]);
|
|
@@ -1834,7 +1834,7 @@ function x2({ content: e, dataSource: t }) {
|
|
|
1834
1834
|
/* @__PURE__ */ u(Y1, { open: n, onClose: () => o(!1), maxWidth: "xl", fullWidth: !0, children: [
|
|
1835
1835
|
/* @__PURE__ */ u("div", { className: "csdk-flex csdk-items-center csdk-justify-between csdk-py-[30px] csdk-px-[40px]", children: [
|
|
1836
1836
|
/* @__PURE__ */ r("div", { className: "csdk-text-ai-lg csdk-semibold csdk-text-text-active", children: e.queryTitle }),
|
|
1837
|
-
/* @__PURE__ */ r(
|
|
1837
|
+
/* @__PURE__ */ r(A1, { onClick: () => o(!1), "aria-label": "close expanded chart", children: /* @__PURE__ */ r(e2, {}) })
|
|
1838
1838
|
] }),
|
|
1839
1839
|
/* @__PURE__ */ r("div", { className: "csdk-h-screen", children: a })
|
|
1840
1840
|
] })
|
|
@@ -1871,7 +1871,7 @@ function y2({ theme: e }) {
|
|
|
1871
1871
|
)
|
|
1872
1872
|
] });
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function J1({ theme: e }) {
|
|
1875
1875
|
return /* @__PURE__ */ r("svg", { xmlns: "http://www.w3.org/2000/svg", width: "34", height: "35", viewBox: "0 0 34 35", fill: "none", children: /* @__PURE__ */ r(
|
|
1876
1876
|
"path",
|
|
1877
1877
|
{
|
|
@@ -1893,7 +1893,7 @@ function v2({ onClick: e }) {
|
|
|
1893
1893
|
onMouseLeave: () => n(!1),
|
|
1894
1894
|
onClick: e,
|
|
1895
1895
|
children: [
|
|
1896
|
-
!t && /* @__PURE__ */ r(
|
|
1896
|
+
!t && /* @__PURE__ */ r(J1, { theme: o }),
|
|
1897
1897
|
t && /* @__PURE__ */ r(y2, { theme: o })
|
|
1898
1898
|
]
|
|
1899
1899
|
}
|
|
@@ -1930,7 +1930,7 @@ function k2({ theme: e }) {
|
|
|
1930
1930
|
)
|
|
1931
1931
|
] });
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function X1({ theme: e }) {
|
|
1934
1934
|
return /* @__PURE__ */ r("svg", { xmlns: "http://www.w3.org/2000/svg", width: "34", height: "35", viewBox: "0 0 34 35", fill: "none", children: /* @__PURE__ */ r(
|
|
1935
1935
|
"path",
|
|
1936
1936
|
{
|
|
@@ -1952,7 +1952,7 @@ function w2({ onClick: e }) {
|
|
|
1952
1952
|
onMouseLeave: () => n(!1),
|
|
1953
1953
|
onClick: e,
|
|
1954
1954
|
children: [
|
|
1955
|
-
!t && /* @__PURE__ */ r(
|
|
1955
|
+
!t && /* @__PURE__ */ r(X1, { theme: o }),
|
|
1956
1956
|
t && /* @__PURE__ */ r(k2, { theme: o })
|
|
1957
1957
|
]
|
|
1958
1958
|
}
|
|
@@ -1985,8 +1985,8 @@ function S2({ visible: e, onSend: t }) {
|
|
|
1985
1985
|
), i = `csdk-transition-opacity csdk-delay-150 csdk-duration-500 ${n ? "csdk-opacity-0" : "csdk-opacity-100"}`;
|
|
1986
1986
|
return e ? /* @__PURE__ */ u("div", { className: `csdk-flex ${i}`, children: [
|
|
1987
1987
|
n && /* @__PURE__ */ u(T, { children: [
|
|
1988
|
-
/* @__PURE__ */ r(
|
|
1989
|
-
/* @__PURE__ */ r(
|
|
1988
|
+
/* @__PURE__ */ r(X1, { theme: s }),
|
|
1989
|
+
/* @__PURE__ */ r(J1, { theme: s })
|
|
1990
1990
|
] }),
|
|
1991
1991
|
!n && /* @__PURE__ */ u(T, { children: [
|
|
1992
1992
|
/* @__PURE__ */ r(w2, { onClick: () => a("up") }),
|
|
@@ -1994,14 +1994,14 @@ function S2({ visible: e, onSend: t }) {
|
|
|
1994
1994
|
] })
|
|
1995
1995
|
] }) : null;
|
|
1996
1996
|
}
|
|
1997
|
-
function
|
|
1997
|
+
function N1({
|
|
1998
1998
|
sourceId: e,
|
|
1999
1999
|
data: t,
|
|
2000
2000
|
type: n,
|
|
2001
2001
|
buttonVisibility: o = "onHover",
|
|
2002
2002
|
children: s
|
|
2003
2003
|
}) {
|
|
2004
|
-
const a =
|
|
2004
|
+
const a = O(), i = ze(
|
|
2005
2005
|
E(
|
|
2006
2006
|
(p) => {
|
|
2007
2007
|
a && a.ai.sendFeedback({
|
|
@@ -2014,7 +2014,7 @@ function D1({
|
|
|
2014
2014
|
[a, e, t, n]
|
|
2015
2015
|
),
|
|
2016
2016
|
200
|
|
2017
|
-
), [l, c] = L2(), d =
|
|
2017
|
+
), [l, c] = L2(), d = B(() => o === "onHover" ? c : o !== "never", [c, o]), { themeSettings: h } = v();
|
|
2018
2018
|
return /* @__PURE__ */ r(M2, { ref: l, theme: h, children: Ye.map(s, (p, f) => f === 0 ? /* @__PURE__ */ u("div", { className: "csdk-flex csdk-items-center csdk-gap-x-2.5", children: [
|
|
2019
2019
|
p,
|
|
2020
2020
|
/* @__PURE__ */ r(S2, { onSend: i, visible: d })
|
|
@@ -2079,13 +2079,13 @@ function $2({ onClick: e }) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
);
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2083
|
-
function
|
|
2084
|
-
const { chatMode: n = "analyze", enableInsights: o } =
|
|
2082
|
+
const D2 = (e) => !!e && "aeiou".includes(e[0]);
|
|
2083
|
+
function N2({ data: e, alwaysShowFeedback: t }) {
|
|
2084
|
+
const { chatMode: n = "analyze", enableInsights: o } = q(), { queryTitle: s, chartRecommendations: a, jaql: i } = e;
|
|
2085
2085
|
console.debug(`JAQL for ${s}`, i), console.debug(`chart recommendations for ${s}`, a);
|
|
2086
2086
|
const l = "chartType" in a ? a.chartType : "table";
|
|
2087
2087
|
let c;
|
|
2088
|
-
|
|
2088
|
+
D2(l) ? c = `an ${l}` : c = `a ${l}`, l !== "table" && (c += " chart");
|
|
2089
2089
|
const d = i.datasource.title, [h, p] = L(!1), f = E(() => {
|
|
2090
2090
|
p((g) => !g);
|
|
2091
2091
|
}, []), b = {
|
|
@@ -2096,7 +2096,7 @@ function D2({ data: e, alwaysShowFeedback: t }) {
|
|
|
2096
2096
|
}, x = n === "analyze";
|
|
2097
2097
|
return /* @__PURE__ */ u(T, { children: [
|
|
2098
2098
|
/* @__PURE__ */ u(
|
|
2099
|
-
|
|
2099
|
+
N1,
|
|
2100
2100
|
{
|
|
2101
2101
|
sourceId: d,
|
|
2102
2102
|
data: e,
|
|
@@ -2109,7 +2109,7 @@ function D2({ data: e, alwaysShowFeedback: t }) {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
),
|
|
2111
2111
|
o && /* @__PURE__ */ u(
|
|
2112
|
-
|
|
2112
|
+
N1,
|
|
2113
2113
|
{
|
|
2114
2114
|
sourceId: d,
|
|
2115
2115
|
data: b,
|
|
@@ -2123,16 +2123,16 @@ function D2({ data: e, alwaysShowFeedback: t }) {
|
|
|
2123
2123
|
)
|
|
2124
2124
|
] });
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function B2({ message: e, isLastMessage: t }) {
|
|
2127
2127
|
if (G1(e)) {
|
|
2128
2128
|
const n = JSON.parse(e.content);
|
|
2129
|
-
return /* @__PURE__ */ r(
|
|
2129
|
+
return /* @__PURE__ */ r(N2, { data: n, alwaysShowFeedback: t });
|
|
2130
2130
|
}
|
|
2131
2131
|
return /* @__PURE__ */ r(F, { align: e.role === "user" ? "right" : "left", children: e.content });
|
|
2132
2132
|
}
|
|
2133
|
-
const
|
|
2133
|
+
const O2 = Je(B2), I2 = ({ error: e }) => (console.debug("Unexpected error occurred when resolving a chat message:", e), /* @__PURE__ */ r(F, { align: "left", children: y1 }));
|
|
2134
2134
|
function F2({ messages: e }) {
|
|
2135
|
-
return /* @__PURE__ */ r(T, { children: e.map((t, n) => /* @__PURE__ */ r(Qt, { fallbackRender: I2, children: /* @__PURE__ */ r(
|
|
2135
|
+
return /* @__PURE__ */ r(T, { children: e.map((t, n) => /* @__PURE__ */ r(Qt, { fallbackRender: I2, children: /* @__PURE__ */ r(O2, { message: t, isLastMessage: n === e.length - 1 }, n) }, n)) });
|
|
2136
2136
|
}
|
|
2137
2137
|
function te({ color: e }) {
|
|
2138
2138
|
return /* @__PURE__ */ r(
|
|
@@ -2153,7 +2153,7 @@ function te({ color: e }) {
|
|
|
2153
2153
|
}
|
|
2154
2154
|
);
|
|
2155
2155
|
}
|
|
2156
|
-
function
|
|
2156
|
+
function A2({ onClick: e, color: t }) {
|
|
2157
2157
|
return /* @__PURE__ */ r(
|
|
2158
2158
|
"div",
|
|
2159
2159
|
{
|
|
@@ -2164,7 +2164,7 @@ function P2({ onClick: e, color: t }) {
|
|
|
2164
2164
|
}
|
|
2165
2165
|
);
|
|
2166
2166
|
}
|
|
2167
|
-
const
|
|
2167
|
+
const P2 = m.button`
|
|
2168
2168
|
font-size: inherit;
|
|
2169
2169
|
line-height: inherit;
|
|
2170
2170
|
box-sizing: border-box;
|
|
@@ -2212,21 +2212,21 @@ const A2 = m.button`
|
|
|
2212
2212
|
return "";
|
|
2213
2213
|
}}
|
|
2214
2214
|
`;
|
|
2215
|
-
function
|
|
2215
|
+
function B1({ question: e, onClick: t }) {
|
|
2216
2216
|
const { themeSettings: n } = v();
|
|
2217
|
-
return /* @__PURE__ */ r(
|
|
2217
|
+
return /* @__PURE__ */ r(P2, { onClick: t, theme: n, children: e });
|
|
2218
2218
|
}
|
|
2219
|
-
const
|
|
2219
|
+
const q2 = m.div`
|
|
2220
2220
|
display: flex;
|
|
2221
2221
|
flex-direction: column;
|
|
2222
2222
|
align-items: flex-start;
|
|
2223
2223
|
row-gap: ${({ theme: e }) => e.aiChat.suggestions.gap};
|
|
2224
2224
|
`;
|
|
2225
|
-
function
|
|
2226
|
-
const [n, o] = L(!0), s =
|
|
2227
|
-
return /* @__PURE__ */ u(
|
|
2228
|
-
s.map((i) => /* @__PURE__ */ r(
|
|
2229
|
-
s.length < e.length && /* @__PURE__ */ r(
|
|
2225
|
+
function W2({ questions: e, onSelection: t }) {
|
|
2226
|
+
const [n, o] = L(!0), s = B(() => n && e.length > 5 ? e.slice(0, 4) : e, [e, n]), { themeSettings: a } = v();
|
|
2227
|
+
return /* @__PURE__ */ u(q2, { "aria-label": "list of suggested questions", theme: a, children: [
|
|
2228
|
+
s.map((i) => /* @__PURE__ */ r(B1, { question: i, onClick: () => t(i) }, i)),
|
|
2229
|
+
s.length < e.length && /* @__PURE__ */ r(B1, { question: "See more", onClick: () => o(!1) })
|
|
2230
2230
|
] });
|
|
2231
2231
|
}
|
|
2232
2232
|
const j2 = m.div`
|
|
@@ -2266,7 +2266,7 @@ function Q2({ questions: e, isLoading: t, onSelection: n }) {
|
|
|
2266
2266
|
const o = e.length > 0;
|
|
2267
2267
|
return t ? /* @__PURE__ */ r(Z2, {}) : o ? /* @__PURE__ */ u(T, { children: [
|
|
2268
2268
|
/* @__PURE__ */ r(F, { align: "left", children: "Some things to ask about this dataset:" }),
|
|
2269
|
-
/* @__PURE__ */ r(
|
|
2269
|
+
/* @__PURE__ */ r(W2, { onSelection: n, questions: e })
|
|
2270
2270
|
] }) : null;
|
|
2271
2271
|
}
|
|
2272
2272
|
const z2 = m.div`
|
|
@@ -2286,7 +2286,7 @@ const z2 = m.div`
|
|
|
2286
2286
|
margin-left: 20px;
|
|
2287
2287
|
|
|
2288
2288
|
color: ${({ style: e }) => e.textColor};
|
|
2289
|
-
`, ne =
|
|
2289
|
+
`, ne = Xe(function({ title: t, leftNav: n, rightNav: o, style: s }, a) {
|
|
2290
2290
|
return /* @__PURE__ */ u(z2, { ref: a, style: s, children: [
|
|
2291
2291
|
n,
|
|
2292
2292
|
/* @__PURE__ */ r(G2, { style: s, children: t }),
|
|
@@ -2333,7 +2333,7 @@ const K2 = m.div`
|
|
|
2333
2333
|
padding-bottom: ${({ theme: e }) => e.aiChat.body.paddingBottom};
|
|
2334
2334
|
flex: initial;
|
|
2335
2335
|
height: 100%;
|
|
2336
|
-
`,
|
|
2336
|
+
`, J2 = m.div`
|
|
2337
2337
|
padding-left: ${({ theme: e }) => e.aiChat.footer.paddingLeft};
|
|
2338
2338
|
padding-right: ${({ theme: e }) => e.aiChat.footer.paddingRight};
|
|
2339
2339
|
padding-top: ${({ theme: e }) => e.aiChat.footer.paddingTop};
|
|
@@ -2341,7 +2341,7 @@ const K2 = m.div`
|
|
|
2341
2341
|
display: flex;
|
|
2342
2342
|
flex-direction: column;
|
|
2343
2343
|
row-gap: 6px;
|
|
2344
|
-
`,
|
|
2344
|
+
`, X2 = m.div`
|
|
2345
2345
|
display: flex;
|
|
2346
2346
|
flex-direction: column;
|
|
2347
2347
|
row-gap: ${({ theme: e }) => e.aiChat.suggestions.gap};
|
|
@@ -2349,7 +2349,7 @@ const K2 = m.div`
|
|
|
2349
2349
|
function en({ contextTitle: e, onGoBack: t }) {
|
|
2350
2350
|
const { data: n, isLoading: o } = Z1({
|
|
2351
2351
|
contextTitle: e
|
|
2352
|
-
}), s =
|
|
2352
|
+
}), s = B(
|
|
2353
2353
|
() => n.map((R) => R.nlqPrompt),
|
|
2354
2354
|
[n]
|
|
2355
2355
|
), {
|
|
@@ -2364,21 +2364,21 @@ function en({ contextTitle: e, onGoBack: t }) {
|
|
|
2364
2364
|
mutate: f,
|
|
2365
2365
|
isLoading: b,
|
|
2366
2366
|
isSuccess: x
|
|
2367
|
-
} = z1(h), [g, S] = L(!1),
|
|
2367
|
+
} = z1(h), [g, S] = L(!1), A = () => S(!0), $ = () => S(!1), N = () => {
|
|
2368
2368
|
f(), $();
|
|
2369
2369
|
}, M = _(null);
|
|
2370
2370
|
m1(() => {
|
|
2371
2371
|
M.current && (M.current.scrollTop = M.current.scrollHeight);
|
|
2372
2372
|
}, [a, g, l]);
|
|
2373
|
-
const
|
|
2373
|
+
const J = _(null), { enableFollowupQuestions: a1, enableHeader: X, numOfRecentPrompts: z } = q(), { themeSettings: I } = v(), e1 = X ? /* @__PURE__ */ r(
|
|
2374
2374
|
ne,
|
|
2375
2375
|
{
|
|
2376
|
-
ref:
|
|
2376
|
+
ref: J,
|
|
2377
2377
|
title: e,
|
|
2378
|
-
leftNav: t && /* @__PURE__ */ r(
|
|
2378
|
+
leftNav: t && /* @__PURE__ */ r(A2, { onClick: t, color: I.aiChat.header.textColor }),
|
|
2379
2379
|
style: I.aiChat.header
|
|
2380
2380
|
}
|
|
2381
|
-
) : null, j =
|
|
2381
|
+
) : null, j = B(
|
|
2382
2382
|
() => [
|
|
2383
2383
|
...new Set(
|
|
2384
2384
|
a.filter((R) => R.role === "user").filter((R) => !s.includes(R.content)).map((R) => R.content).reverse()
|
|
@@ -2387,13 +2387,13 @@ function en({ contextTitle: e, onGoBack: t }) {
|
|
|
2387
2387
|
[a, z, s]
|
|
2388
2388
|
);
|
|
2389
2389
|
return (p == null ? void 0 : p.message) === Q1 ? /* @__PURE__ */ u(T, { children: [
|
|
2390
|
-
|
|
2390
|
+
X && e1,
|
|
2391
2391
|
/* @__PURE__ */ r(U1, { text: p.message })
|
|
2392
2392
|
] }) : /* @__PURE__ */ u(T, { children: [
|
|
2393
2393
|
e1,
|
|
2394
2394
|
/* @__PURE__ */ u(K2, { theme: I, children: [
|
|
2395
2395
|
/* @__PURE__ */ u(Y2, { ref: M, theme: I, children: [
|
|
2396
|
-
/* @__PURE__ */ r(
|
|
2396
|
+
/* @__PURE__ */ r(Pt, {}),
|
|
2397
2397
|
/* @__PURE__ */ r(
|
|
2398
2398
|
Q2,
|
|
2399
2399
|
{
|
|
@@ -2406,7 +2406,7 @@ function en({ contextTitle: e, onGoBack: t }) {
|
|
|
2406
2406
|
x && /* @__PURE__ */ r(Vt, {}),
|
|
2407
2407
|
d && /* @__PURE__ */ r(s1, {}),
|
|
2408
2408
|
!d && /* @__PURE__ */ r(F2, { messages: a }),
|
|
2409
|
-
a1 && i && /* @__PURE__ */ r(
|
|
2409
|
+
a1 && i && /* @__PURE__ */ r(X2, { theme: I, children: i.followupQuestions.slice(0, 2).map((R, G) => /* @__PURE__ */ r(
|
|
2410
2410
|
r1,
|
|
2411
2411
|
{
|
|
2412
2412
|
align: "left",
|
|
@@ -2422,17 +2422,17 @@ function en({ contextTitle: e, onGoBack: t }) {
|
|
|
2422
2422
|
jt,
|
|
2423
2423
|
{
|
|
2424
2424
|
onCancel: $,
|
|
2425
|
-
onConfirm:
|
|
2425
|
+
onConfirm: N
|
|
2426
2426
|
}
|
|
2427
2427
|
)
|
|
2428
2428
|
] }),
|
|
2429
|
-
/* @__PURE__ */ u(
|
|
2429
|
+
/* @__PURE__ */ u(J2, { theme: I, children: [
|
|
2430
2430
|
/* @__PURE__ */ r(
|
|
2431
|
-
|
|
2431
|
+
Dt,
|
|
2432
2432
|
{
|
|
2433
2433
|
onSendMessage: c,
|
|
2434
2434
|
disabled: l || d,
|
|
2435
|
-
onClearHistoryClick:
|
|
2435
|
+
onClearHistoryClick: A,
|
|
2436
2436
|
suggestions: s,
|
|
2437
2437
|
recentPrompts: j,
|
|
2438
2438
|
isLoading: o || d
|
|
@@ -2470,7 +2470,7 @@ function nn(e) {
|
|
|
2470
2470
|
/* @__PURE__ */ r("br", {}),
|
|
2471
2471
|
"Pick a topic you would like to explore:"
|
|
2472
2472
|
] }),
|
|
2473
|
-
t.map((n) => /* @__PURE__ */ C1(tn,
|
|
2473
|
+
t.map((n) => /* @__PURE__ */ C1(tn, D(w({}, n), { key: n.title })))
|
|
2474
2474
|
] });
|
|
2475
2475
|
}
|
|
2476
2476
|
const rn = "#FFCB05", on = "#000000", sn = "#FFFFFF";
|
|
@@ -2493,7 +2493,7 @@ function an({ colorSchema: e }) {
|
|
|
2493
2493
|
] });
|
|
2494
2494
|
}
|
|
2495
2495
|
function ln({ onDataTopicClick: e }) {
|
|
2496
|
-
const { data: t } = k1(), n =
|
|
2496
|
+
const { data: t } = k1(), n = q(), { themeSettings: o } = v(), s = B(
|
|
2497
2497
|
() => t == null ? void 0 : t.map(
|
|
2498
2498
|
(i) => ({
|
|
2499
2499
|
title: i.name,
|
|
@@ -2519,7 +2519,7 @@ function ln({ onDataTopicClick: e }) {
|
|
|
2519
2519
|
] });
|
|
2520
2520
|
}
|
|
2521
2521
|
function cn() {
|
|
2522
|
-
const [e, t] = L(), [n, o] = L(), { data: s, fetchStatus: a } = k1(), { defaultContextTitle: i } =
|
|
2522
|
+
const [e, t] = L(), [n, o] = L(), { data: s, fetchStatus: a } = k1(), { defaultContextTitle: i } = q();
|
|
2523
2523
|
Y(() => {
|
|
2524
2524
|
if (i && s && a === "idle") {
|
|
2525
2525
|
const d = s.find((h) => h.name === i);
|
|
@@ -2537,12 +2537,12 @@ function cn() {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
) : /* @__PURE__ */ r(ln, { onDataTopicClick: (d) => t(d) });
|
|
2539
2539
|
}
|
|
2540
|
-
const xn =
|
|
2540
|
+
const xn = P1({
|
|
2541
2541
|
componentName: "Chatbot"
|
|
2542
2542
|
})((e) => {
|
|
2543
2543
|
const { width: t, height: n, config: o } = e, { themeSettings: s } = v();
|
|
2544
2544
|
return /* @__PURE__ */ r(at, { value: o != null ? o : {}, children: /* @__PURE__ */ r(vt, { width: t, height: n, theme: s, children: /* @__PURE__ */ r(cn, {}) }) });
|
|
2545
|
-
}), yn =
|
|
2545
|
+
}), yn = P1({
|
|
2546
2546
|
componentName: "GetNlgQueryResult"
|
|
2547
2547
|
})(function(t) {
|
|
2548
2548
|
const { data: n, isLoading: o, isError: s } = x1(t);
|