@sisense/sdk-ui-preact 1.27.1 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.cjs +68 -68
- package/dist/ai.js +1013 -944
- package/dist/index.cjs +217 -84
- package/dist/index.js +6596 -5660
- package/dist/{useQuery-DOgANgSI-6bbcaeca.js → useQuery-CdtycPOg-6bf8b29e.js} +33957 -34051
- package/dist/useQuery-CdtycPOg-fc2a0f4a.cjs +1186 -0
- package/package.json +3 -3
- package/dist/useQuery-DOgANgSI-665e9a0c.cjs +0 -1185
package/dist/ai.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
1
|
+
import { a$ as ke, aG as Ze, d_ as ft, bg as kt, b8 as Oe, aM as wt, d$ as _t, bK as Ct, g as yt, d as pe, e0 as vt, e1 as Mt, C as F, u as B, e2 as Be, P as m, a7 as It, G as De, z as g, I as S, aH as $e, e3 as Dt, B as Pe, E as Fe, j as Ae, Y as f, k as a, V as _, n as N, a as At, e4 as St, aj as Lt, F as $, e5 as Nt, q as z, M as we, e6 as Tt, ax as jt, ah as zt, br as P, x as M, au as ge, p as I, _ as V, W as Ce, e7 as Et, e8 as Zt, a1 as Ot, a4 as ye, e9 as Rt, a5 as K, bG as Wt, ea as Gt, aF as Ve, X as qt, cN as Yt, eb as ee, co as le, ec as Ht, ed as Ut, ee as Qe, ef as Bt, eg as $t, bS as Pt, bT as Ft, eh as Vt, dA as Qt, ei as Jt, ej as Xt, ek as Kt, c7 as ea, ck as ta, el as aa, ci as Je, N as ra, Z as ia, em as oa, cg as na } from "./useQuery-CdtycPOg-6bf8b29e.js";
|
|
2
|
+
var la = Object.defineProperty, Re = Object.getOwnPropertySymbols, ca = Object.prototype.hasOwnProperty, da = Object.prototype.propertyIsEnumerable, We = (e, t, r) => t in e ? la(e, t, {
|
|
3
3
|
enumerable: !0,
|
|
4
4
|
configurable: !0,
|
|
5
5
|
writable: !0,
|
|
6
6
|
value: r
|
|
7
|
-
}) : e[t] = r,
|
|
7
|
+
}) : e[t] = r, ce = (e, t) => {
|
|
8
8
|
for (var r in t || (t = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var r of
|
|
12
|
-
|
|
9
|
+
ca.call(t, r) && We(e, r, t[r]);
|
|
10
|
+
if (Re)
|
|
11
|
+
for (var r of Re(t))
|
|
12
|
+
da.call(t, r) && We(e, r, t[r]);
|
|
13
13
|
return e;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
class sa extends _t {
|
|
16
16
|
constructor(t, r) {
|
|
17
17
|
var i;
|
|
18
|
-
super((i = t.jaql.title) !== null && i !== void 0 ? i : "", r), this.expression = t.jaql.dim || t.jaql.formula, this.metadataItem = t, t.jaql.agg ? this.aggregation = t.jaql.agg : delete this.aggregation, t.jaql.formula ? this.formula = t.jaql.formula : delete this.formula, t.jaql.sort ? this.sortType =
|
|
18
|
+
super((i = t.jaql.title) !== null && i !== void 0 ? i : "", r), this.expression = t.jaql.dim || t.jaql.formula, this.metadataItem = t, t.jaql.agg ? this.aggregation = t.jaql.agg : delete this.aggregation, t.jaql.formula ? this.formula = t.jaql.formula : delete this.formula, t.jaql.sort ? this.sortType = Ct(t.jaql.sort) : delete this.sortType, this.skipValidation = !0;
|
|
19
19
|
}
|
|
20
20
|
get id() {
|
|
21
21
|
return this.expression;
|
|
@@ -23,24 +23,24 @@ let na = class extends kt {
|
|
|
23
23
|
jaql() {
|
|
24
24
|
return this.metadataItem;
|
|
25
25
|
}
|
|
26
|
+
}
|
|
27
|
+
const pa = {
|
|
28
|
+
text: ke.TextAttribute,
|
|
29
|
+
numeric: ke.NumericAttribute,
|
|
30
|
+
datetime: ke.DateLevel
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
text: be.TextAttribute,
|
|
29
|
-
numeric: be.NumericAttribute,
|
|
30
|
-
datetime: be.DateLevel
|
|
31
|
-
};
|
|
32
|
-
function Ve(e) {
|
|
32
|
+
function Xe(e) {
|
|
33
33
|
var t;
|
|
34
|
-
return new
|
|
34
|
+
return new sa(e, (t = pa[e.jaql.datatype]) !== null && t !== void 0 ? t : "numeric");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function ga(e) {
|
|
37
37
|
return !e || !e.jaql.datasource.title || !e.jaql.metadata.length;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const ua = (e) => ({
|
|
40
40
|
dataOptions: {
|
|
41
|
-
columns: e.map(
|
|
41
|
+
columns: e.map(Xe)
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
43
|
+
}), ha = Object.freeze({
|
|
44
44
|
convolution: {
|
|
45
45
|
enabled: !0,
|
|
46
46
|
selectedConvolutionType: "bySlicesCount",
|
|
@@ -61,80 +61,80 @@ const da = (e) => ({
|
|
|
61
61
|
xAxis: {
|
|
62
62
|
gridLines: !1
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
64
|
+
}), Ge = Object.freeze({
|
|
65
65
|
line: "line/spline",
|
|
66
66
|
pie: "pie/donut",
|
|
67
67
|
bar: "bar/stacked",
|
|
68
68
|
column: "column/stackedcolumn"
|
|
69
|
-
}),
|
|
69
|
+
}), ba = (e, t) => {
|
|
70
70
|
const {
|
|
71
71
|
axesMapping: r = {},
|
|
72
72
|
chartFamily: i
|
|
73
|
-
} = t, o = e.reduce((
|
|
73
|
+
} = t, o = e.reduce((l, d) => (l[d.jaql.title] = d, l), {}), n = Object.entries(r).reduce((l, d) => {
|
|
74
74
|
const [c, s] = d;
|
|
75
|
-
return
|
|
76
|
-
var
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
75
|
+
return l[`${c}`] = Array.isArray(s) ? s.map((u) => {
|
|
76
|
+
var p, h;
|
|
77
|
+
const b = o[u.name];
|
|
78
|
+
if (!b)
|
|
79
79
|
return {
|
|
80
80
|
column: {
|
|
81
81
|
type: "",
|
|
82
|
-
name:
|
|
82
|
+
name: u.name
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
85
|
+
const w = Xe(b);
|
|
86
|
+
if (b.panel === "measures")
|
|
87
87
|
return {
|
|
88
|
-
column:
|
|
88
|
+
column: w,
|
|
89
89
|
sortType: "sortNone"
|
|
90
90
|
};
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
91
|
+
if (wt(w.type)) {
|
|
92
|
+
const k = (h = (p = b.format) == null ? void 0 : p.mask) == null ? void 0 : h[b.jaql.level];
|
|
93
|
+
if (k)
|
|
94
94
|
return {
|
|
95
|
-
column:
|
|
96
|
-
dateFormat:
|
|
95
|
+
column: w,
|
|
96
|
+
dateFormat: k
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
return
|
|
100
|
-
}) : s,
|
|
99
|
+
return w;
|
|
100
|
+
}) : s, l;
|
|
101
101
|
}, {});
|
|
102
102
|
switch (i) {
|
|
103
103
|
case "cartesian":
|
|
104
|
-
return
|
|
104
|
+
return ce({
|
|
105
105
|
category: [],
|
|
106
106
|
value: [],
|
|
107
107
|
breakBy: []
|
|
108
|
-
},
|
|
108
|
+
}, n);
|
|
109
109
|
case "categorical":
|
|
110
|
-
return
|
|
110
|
+
return ce({
|
|
111
111
|
category: [],
|
|
112
112
|
value: []
|
|
113
|
-
},
|
|
113
|
+
}, n);
|
|
114
114
|
case "scatter":
|
|
115
|
-
return Object.keys(
|
|
116
|
-
|
|
117
|
-
}),
|
|
115
|
+
return Object.keys(n).forEach((l) => {
|
|
116
|
+
n[`${l}`] = n[`${l}`][0];
|
|
117
|
+
}), n;
|
|
118
118
|
case "scattermap":
|
|
119
|
-
return Object.keys(
|
|
120
|
-
|
|
121
|
-
}),
|
|
119
|
+
return Object.keys(n).forEach((l) => {
|
|
120
|
+
l !== "geo" && (n[`${l}`] = n[`${l}`][0]);
|
|
121
|
+
}), n;
|
|
122
122
|
case "table":
|
|
123
|
-
return Object.keys(
|
|
123
|
+
return Object.keys(n).length === 0 ? ua(e).dataOptions : n;
|
|
124
124
|
case "boxplot":
|
|
125
125
|
case "areamap":
|
|
126
126
|
case "indicator":
|
|
127
127
|
default:
|
|
128
|
-
return
|
|
128
|
+
return n;
|
|
129
129
|
}
|
|
130
|
-
},
|
|
131
|
-
var r, i, o,
|
|
132
|
-
return t === "x" ? (i = (r = e.axesMapping.category) != null ? r : e.axesMapping.x) == null ? void 0 : i.map((
|
|
133
|
-
},
|
|
134
|
-
const i =
|
|
130
|
+
}, qe = (e, t) => {
|
|
131
|
+
var r, i, o, n;
|
|
132
|
+
return t === "x" ? (i = (r = e.axesMapping.category) != null ? r : e.axesMapping.x) == null ? void 0 : i.map((l) => l.name).join(", ") : (n = (o = e.axesMapping.value) != null ? o : e.axesMapping.y) == null ? void 0 : n.map((l) => l.name).join(", ");
|
|
133
|
+
}, ma = (e, t, r = !0) => {
|
|
134
|
+
const i = ba(e, t);
|
|
135
135
|
let o;
|
|
136
|
-
return r && t.chartType in
|
|
137
|
-
subtype:
|
|
136
|
+
return r && t.chartType in Ge ? o = Ze(Ze(ha, {
|
|
137
|
+
subtype: Ge[t.chartType]
|
|
138
138
|
}), {
|
|
139
139
|
legend: {
|
|
140
140
|
enabled: !0,
|
|
@@ -143,142 +143,142 @@ const da = (e) => ({
|
|
|
143
143
|
yAxis: {
|
|
144
144
|
title: {
|
|
145
145
|
enabled: !0,
|
|
146
|
-
text:
|
|
146
|
+
text: qe(t, "y")
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
xAxis: {
|
|
150
150
|
title: {
|
|
151
151
|
enabled: !0,
|
|
152
|
-
text:
|
|
152
|
+
text: qe(t, "x")
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
}) : o =
|
|
155
|
+
}) : o = ft(), {
|
|
156
156
|
dataOptions: i,
|
|
157
157
|
chartStyleOptions: o
|
|
158
158
|
};
|
|
159
|
-
},
|
|
159
|
+
}, xa = (e) => "chartType" in e ? e : {
|
|
160
160
|
chartType: "table",
|
|
161
161
|
chartFamily: "table",
|
|
162
162
|
axesMapping: {}
|
|
163
|
-
},
|
|
164
|
-
if ((r.panel === "scope" || r.jaql.filter) && t.metadataFilters.push(
|
|
165
|
-
const i =
|
|
163
|
+
}, fa = (e) => e.map((t) => kt(t.jaql)), ka = (e) => e.reduce((t, r) => {
|
|
164
|
+
if ((r.panel === "scope" || r.jaql.filter) && t.metadataFilters.push(Oe(r)), r.panel !== "scope") {
|
|
165
|
+
const i = Oe(r);
|
|
166
166
|
delete i.jaql.filter, t.metadataColumns.push(i);
|
|
167
167
|
}
|
|
168
168
|
return t;
|
|
169
169
|
}, {
|
|
170
170
|
metadataColumns: [],
|
|
171
171
|
metadataFilters: []
|
|
172
|
-
}),
|
|
173
|
-
if (!
|
|
172
|
+
}), wa = (e, t) => {
|
|
173
|
+
if (!ga(e))
|
|
174
174
|
try {
|
|
175
175
|
const {
|
|
176
176
|
useCustomizedStyleOptions: r = !1
|
|
177
177
|
} = t || {}, {
|
|
178
178
|
jaql: i,
|
|
179
179
|
chartRecommendations: o,
|
|
180
|
-
queryTitle:
|
|
180
|
+
queryTitle: n
|
|
181
181
|
} = e, {
|
|
182
|
-
metadata:
|
|
182
|
+
metadata: l,
|
|
183
183
|
datasource: {
|
|
184
184
|
title: d,
|
|
185
185
|
id: c,
|
|
186
186
|
type: s = "elasticube"
|
|
187
187
|
}
|
|
188
|
-
} = i,
|
|
188
|
+
} = i, u = xa(o), p = u.chartType.toLowerCase(), h = {
|
|
189
189
|
cornerRadius: "Small",
|
|
190
190
|
header: {
|
|
191
191
|
// remove info button and render empty toolbar instead
|
|
192
192
|
renderToolbar: () => null
|
|
193
193
|
}
|
|
194
194
|
}, {
|
|
195
|
-
metadataColumns:
|
|
196
|
-
metadataFilters:
|
|
197
|
-
} =
|
|
198
|
-
dataOptions:
|
|
199
|
-
chartStyleOptions:
|
|
200
|
-
} =
|
|
195
|
+
metadataColumns: b,
|
|
196
|
+
metadataFilters: w
|
|
197
|
+
} = ka(l), k = fa(w), {
|
|
198
|
+
dataOptions: x,
|
|
199
|
+
chartStyleOptions: E
|
|
200
|
+
} = ma(b, u, r), A = ce(ce({}, E), h);
|
|
201
201
|
return {
|
|
202
202
|
widgetType: "chart",
|
|
203
|
-
id:
|
|
204
|
-
title:
|
|
205
|
-
chartType:
|
|
203
|
+
id: n,
|
|
204
|
+
title: n,
|
|
205
|
+
chartType: p,
|
|
206
206
|
dataSource: {
|
|
207
207
|
title: d,
|
|
208
208
|
id: c,
|
|
209
209
|
type: s
|
|
210
210
|
},
|
|
211
|
-
dataOptions:
|
|
212
|
-
filters:
|
|
213
|
-
styleOptions:
|
|
211
|
+
dataOptions: x,
|
|
212
|
+
filters: k,
|
|
213
|
+
styleOptions: A
|
|
214
214
|
};
|
|
215
215
|
} catch (r) {
|
|
216
216
|
console.error(r);
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
},
|
|
220
|
-
var
|
|
219
|
+
}, ue = (e, t) => wa(e, t);
|
|
220
|
+
var _a = Object.defineProperty, Ca = Object.defineProperties, ya = Object.getOwnPropertyDescriptors, de = Object.getOwnPropertySymbols, Ke = Object.prototype.hasOwnProperty, et = Object.prototype.propertyIsEnumerable, ve = (e, t, r) => t in e ? _a(e, t, {
|
|
221
221
|
enumerable: !0,
|
|
222
222
|
configurable: !0,
|
|
223
223
|
writable: !0,
|
|
224
224
|
value: r
|
|
225
|
-
}) : e[t] = r,
|
|
225
|
+
}) : e[t] = r, C = (e, t) => {
|
|
226
226
|
for (var r in t || (t = {}))
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
for (var r of
|
|
230
|
-
|
|
227
|
+
Ke.call(t, r) && ve(e, r, t[r]);
|
|
228
|
+
if (de)
|
|
229
|
+
for (var r of de(t))
|
|
230
|
+
et.call(t, r) && ve(e, r, t[r]);
|
|
231
231
|
return e;
|
|
232
|
-
},
|
|
232
|
+
}, v = (e, t) => Ca(e, ya(t)), va = (e, t) => {
|
|
233
233
|
var r = {};
|
|
234
234
|
for (var i in e)
|
|
235
|
-
|
|
236
|
-
if (e != null &&
|
|
237
|
-
for (var i of
|
|
238
|
-
t.indexOf(i) < 0 &&
|
|
235
|
+
Ke.call(e, i) && t.indexOf(i) < 0 && (r[i] = e[i]);
|
|
236
|
+
if (e != null && de)
|
|
237
|
+
for (var i of de(e))
|
|
238
|
+
t.indexOf(i) < 0 && et.call(e, i) && (r[i] = e[i]);
|
|
239
239
|
return r;
|
|
240
|
-
},
|
|
241
|
-
var
|
|
240
|
+
}, L = (e, t, r) => (ve(e, typeof t != "symbol" ? t + "" : t, r), r), Q = (e, t, r) => new Promise((i, o) => {
|
|
241
|
+
var n = (c) => {
|
|
242
242
|
try {
|
|
243
243
|
d(r.next(c));
|
|
244
244
|
} catch (s) {
|
|
245
245
|
o(s);
|
|
246
246
|
}
|
|
247
|
-
},
|
|
247
|
+
}, l = (c) => {
|
|
248
248
|
try {
|
|
249
249
|
d(r.throw(c));
|
|
250
250
|
} catch (s) {
|
|
251
251
|
o(s);
|
|
252
252
|
}
|
|
253
|
-
}, d = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(
|
|
253
|
+
}, d = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(n, l);
|
|
254
254
|
d((r = r.apply(e, t)).next());
|
|
255
|
-
});
|
|
256
|
-
function
|
|
257
|
-
return
|
|
255
|
+
}), Ma = Vt("toLowerCase");
|
|
256
|
+
function Ia(e) {
|
|
257
|
+
return Qt("MuiDialog", e);
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
process.env.NODE_ENV !== "production" && (
|
|
261
|
-
const
|
|
259
|
+
const _e = yt("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), tt = /* @__PURE__ */ De({});
|
|
260
|
+
process.env.NODE_ENV !== "production" && (tt.displayName = "DialogContext");
|
|
261
|
+
const Da = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"], Aa = pe(vt, {
|
|
262
262
|
name: "MuiDialog",
|
|
263
263
|
slot: "Backdrop",
|
|
264
264
|
overrides: (e, t) => t.backdrop
|
|
265
265
|
})({
|
|
266
266
|
// Improve scrollable dialog support.
|
|
267
267
|
zIndex: -1
|
|
268
|
-
}),
|
|
268
|
+
}), Sa = (e) => {
|
|
269
269
|
const {
|
|
270
270
|
classes: t,
|
|
271
271
|
scroll: r,
|
|
272
272
|
maxWidth: i,
|
|
273
273
|
fullWidth: o,
|
|
274
|
-
fullScreen:
|
|
275
|
-
} = e,
|
|
274
|
+
fullScreen: n
|
|
275
|
+
} = e, l = {
|
|
276
276
|
root: ["root"],
|
|
277
|
-
container: ["container", `scroll${
|
|
278
|
-
paper: ["paper", `paperScroll${
|
|
277
|
+
container: ["container", `scroll${F(r)}`],
|
|
278
|
+
paper: ["paper", `paperScroll${F(r)}`, `paperWidth${F(String(i))}`, o && "paperFullWidth", n && "paperFullScreen"]
|
|
279
279
|
};
|
|
280
|
-
return
|
|
281
|
-
},
|
|
280
|
+
return Wt(l, Ia, t);
|
|
281
|
+
}, La = pe(Mt, {
|
|
282
282
|
name: "MuiDialog",
|
|
283
283
|
slot: "Root",
|
|
284
284
|
overridesResolver: (e, t) => t.root
|
|
@@ -287,18 +287,18 @@ const Ca = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
287
287
|
// Use !important to override the Modal inline-style.
|
|
288
288
|
position: "absolute !important"
|
|
289
289
|
}
|
|
290
|
-
}),
|
|
290
|
+
}), Na = pe("div", {
|
|
291
291
|
name: "MuiDialog",
|
|
292
292
|
slot: "Container",
|
|
293
293
|
overridesResolver: (e, t) => {
|
|
294
294
|
const {
|
|
295
295
|
ownerState: r
|
|
296
296
|
} = e;
|
|
297
|
-
return [t.container, t[`scroll${
|
|
297
|
+
return [t.container, t[`scroll${F(r.scroll)}`]];
|
|
298
298
|
}
|
|
299
299
|
})(({
|
|
300
300
|
ownerState: e
|
|
301
|
-
}) =>
|
|
301
|
+
}) => B({
|
|
302
302
|
height: "100%",
|
|
303
303
|
"@media print": {
|
|
304
304
|
height: "auto"
|
|
@@ -320,19 +320,19 @@ const Ca = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
320
320
|
height: "100%",
|
|
321
321
|
width: "0"
|
|
322
322
|
}
|
|
323
|
-
})),
|
|
323
|
+
})), Ta = pe(Be, {
|
|
324
324
|
name: "MuiDialog",
|
|
325
325
|
slot: "Paper",
|
|
326
326
|
overridesResolver: (e, t) => {
|
|
327
327
|
const {
|
|
328
328
|
ownerState: r
|
|
329
329
|
} = e;
|
|
330
|
-
return [t.paper, t[`scrollPaper${
|
|
330
|
+
return [t.paper, t[`scrollPaper${F(r.scroll)}`], t[`paperWidth${F(String(r.maxWidth))}`], r.fullWidth && t.paperFullWidth, r.fullScreen && t.paperFullScreen];
|
|
331
331
|
}
|
|
332
332
|
})(({
|
|
333
333
|
theme: e,
|
|
334
334
|
ownerState: t
|
|
335
|
-
}) =>
|
|
335
|
+
}) => B({
|
|
336
336
|
margin: 32,
|
|
337
337
|
position: "relative",
|
|
338
338
|
overflowY: "auto",
|
|
@@ -354,14 +354,14 @@ const Ca = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
354
354
|
maxWidth: "calc(100% - 64px)"
|
|
355
355
|
}, t.maxWidth === "xs" && {
|
|
356
356
|
maxWidth: e.breakpoints.unit === "px" ? Math.max(e.breakpoints.values.xs, 444) : `max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,
|
|
357
|
-
[`&.${
|
|
357
|
+
[`&.${_e.paperScrollBody}`]: {
|
|
358
358
|
[e.breakpoints.down(Math.max(e.breakpoints.values.xs, 444) + 32 * 2)]: {
|
|
359
359
|
maxWidth: "calc(100% - 64px)"
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
}, t.maxWidth && t.maxWidth !== "xs" && {
|
|
363
363
|
maxWidth: `${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`,
|
|
364
|
-
[`&.${
|
|
364
|
+
[`&.${_e.paperScrollBody}`]: {
|
|
365
365
|
[e.breakpoints.down(e.breakpoints.values[t.maxWidth] + 32 * 2)]: {
|
|
366
366
|
maxWidth: "calc(100% - 64px)"
|
|
367
367
|
}
|
|
@@ -375,91 +375,91 @@ const Ca = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
375
375
|
height: "100%",
|
|
376
376
|
maxHeight: "none",
|
|
377
377
|
borderRadius: 0,
|
|
378
|
-
[`&.${
|
|
378
|
+
[`&.${_e.paperScrollBody}`]: {
|
|
379
379
|
margin: 0,
|
|
380
380
|
maxWidth: "100%"
|
|
381
381
|
}
|
|
382
|
-
})),
|
|
383
|
-
const r =
|
|
382
|
+
})), at = /* @__PURE__ */ Pe(function(e, t) {
|
|
383
|
+
const r = At({
|
|
384
384
|
props: e,
|
|
385
385
|
name: "MuiDialog"
|
|
386
|
-
}), i =
|
|
386
|
+
}), i = St(), o = {
|
|
387
387
|
enter: i.transitions.duration.enteringScreen,
|
|
388
388
|
exit: i.transitions.duration.leavingScreen
|
|
389
389
|
}, {
|
|
390
|
-
"aria-describedby":
|
|
391
|
-
"aria-labelledby":
|
|
390
|
+
"aria-describedby": n,
|
|
391
|
+
"aria-labelledby": l,
|
|
392
392
|
BackdropComponent: d,
|
|
393
393
|
BackdropProps: c,
|
|
394
394
|
children: s,
|
|
395
|
-
className:
|
|
396
|
-
disableEscapeKeyDown:
|
|
397
|
-
fullScreen:
|
|
398
|
-
fullWidth:
|
|
399
|
-
maxWidth:
|
|
400
|
-
onBackdropClick:
|
|
401
|
-
onClick:
|
|
402
|
-
onClose:
|
|
403
|
-
open:
|
|
404
|
-
PaperComponent: y =
|
|
405
|
-
PaperProps:
|
|
406
|
-
scroll:
|
|
407
|
-
TransitionComponent:
|
|
408
|
-
transitionDuration:
|
|
409
|
-
TransitionProps:
|
|
410
|
-
} = r,
|
|
411
|
-
disableEscapeKeyDown:
|
|
412
|
-
fullScreen:
|
|
413
|
-
fullWidth:
|
|
414
|
-
maxWidth:
|
|
415
|
-
scroll:
|
|
416
|
-
}),
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
titleId:
|
|
422
|
-
}), [
|
|
423
|
-
return /* @__PURE__ */ a(
|
|
424
|
-
className:
|
|
395
|
+
className: u,
|
|
396
|
+
disableEscapeKeyDown: p = !1,
|
|
397
|
+
fullScreen: h = !1,
|
|
398
|
+
fullWidth: b = !1,
|
|
399
|
+
maxWidth: w = "sm",
|
|
400
|
+
onBackdropClick: k,
|
|
401
|
+
onClick: x,
|
|
402
|
+
onClose: E,
|
|
403
|
+
open: A,
|
|
404
|
+
PaperComponent: y = Be,
|
|
405
|
+
PaperProps: R = {},
|
|
406
|
+
scroll: Z = "paper",
|
|
407
|
+
TransitionComponent: T = Gt,
|
|
408
|
+
transitionDuration: G = o,
|
|
409
|
+
TransitionProps: me
|
|
410
|
+
} = r, xe = Lt(r, Da), q = B({}, r, {
|
|
411
|
+
disableEscapeKeyDown: p,
|
|
412
|
+
fullScreen: h,
|
|
413
|
+
fullWidth: b,
|
|
414
|
+
maxWidth: w,
|
|
415
|
+
scroll: Z
|
|
416
|
+
}), J = Sa(q), j = $(), ie = (Y) => {
|
|
417
|
+
j.current = Y.target === Y.currentTarget;
|
|
418
|
+
}, fe = (Y) => {
|
|
419
|
+
x && x(Y), j.current && (j.current = null, k && k(Y), E && E(Y, "backdropClick"));
|
|
420
|
+
}, X = Nt(l), oe = z(() => ({
|
|
421
|
+
titleId: X
|
|
422
|
+
}), [X]);
|
|
423
|
+
return /* @__PURE__ */ a(La, B({
|
|
424
|
+
className: we(J.root, u),
|
|
425
425
|
closeAfterTransition: !0,
|
|
426
426
|
components: {
|
|
427
|
-
Backdrop:
|
|
427
|
+
Backdrop: Aa
|
|
428
428
|
},
|
|
429
429
|
componentsProps: {
|
|
430
|
-
backdrop:
|
|
431
|
-
transitionDuration:
|
|
430
|
+
backdrop: B({
|
|
431
|
+
transitionDuration: G,
|
|
432
432
|
as: d
|
|
433
433
|
}, c)
|
|
434
434
|
},
|
|
435
|
-
disableEscapeKeyDown:
|
|
436
|
-
onClose:
|
|
437
|
-
open:
|
|
435
|
+
disableEscapeKeyDown: p,
|
|
436
|
+
onClose: E,
|
|
437
|
+
open: A,
|
|
438
438
|
ref: t,
|
|
439
|
-
onClick:
|
|
440
|
-
ownerState:
|
|
441
|
-
},
|
|
442
|
-
children: /* @__PURE__ */ a(
|
|
439
|
+
onClick: fe,
|
|
440
|
+
ownerState: q
|
|
441
|
+
}, xe, {
|
|
442
|
+
children: /* @__PURE__ */ a(T, B({
|
|
443
443
|
appear: !0,
|
|
444
|
-
in:
|
|
445
|
-
timeout:
|
|
444
|
+
in: A,
|
|
445
|
+
timeout: G,
|
|
446
446
|
role: "presentation"
|
|
447
|
-
},
|
|
448
|
-
children: /* @__PURE__ */ a(
|
|
449
|
-
className:
|
|
447
|
+
}, me, {
|
|
448
|
+
children: /* @__PURE__ */ a(Na, {
|
|
449
|
+
className: we(J.container),
|
|
450
450
|
onMouseDown: ie,
|
|
451
|
-
ownerState:
|
|
452
|
-
children: /* @__PURE__ */ a(
|
|
451
|
+
ownerState: q,
|
|
452
|
+
children: /* @__PURE__ */ a(Ta, B({
|
|
453
453
|
as: y,
|
|
454
454
|
elevation: 24,
|
|
455
455
|
role: "dialog",
|
|
456
|
-
"aria-describedby":
|
|
457
|
-
"aria-labelledby":
|
|
458
|
-
},
|
|
459
|
-
className:
|
|
460
|
-
ownerState:
|
|
461
|
-
children: /* @__PURE__ */ a(
|
|
462
|
-
value:
|
|
456
|
+
"aria-describedby": n,
|
|
457
|
+
"aria-labelledby": X
|
|
458
|
+
}, R, {
|
|
459
|
+
className: we(J.paper, R.className),
|
|
460
|
+
ownerState: q,
|
|
461
|
+
children: /* @__PURE__ */ a(tt.Provider, {
|
|
462
|
+
value: oe,
|
|
463
463
|
children: s
|
|
464
464
|
})
|
|
465
465
|
}))
|
|
@@ -467,7 +467,7 @@ const Ca = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
|
|
|
467
467
|
}))
|
|
468
468
|
}));
|
|
469
469
|
});
|
|
470
|
-
process.env.NODE_ENV !== "production" && (
|
|
470
|
+
process.env.NODE_ENV !== "production" && (at.propTypes = {
|
|
471
471
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
472
472
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
473
473
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -475,11 +475,11 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
|
|
|
475
475
|
/**
|
|
476
476
|
* The id(s) of the element(s) that describe the dialog.
|
|
477
477
|
*/
|
|
478
|
-
"aria-describedby":
|
|
478
|
+
"aria-describedby": m.string,
|
|
479
479
|
/**
|
|
480
480
|
* The id(s) of the element(s) that label the dialog.
|
|
481
481
|
*/
|
|
482
|
-
"aria-labelledby":
|
|
482
|
+
"aria-labelledby": m.string,
|
|
483
483
|
/**
|
|
484
484
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
485
485
|
* @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
|
|
@@ -494,92 +494,92 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
|
|
|
494
494
|
* zIndex: -1,
|
|
495
495
|
* })
|
|
496
496
|
*/
|
|
497
|
-
BackdropComponent:
|
|
497
|
+
BackdropComponent: m.elementType,
|
|
498
498
|
/**
|
|
499
499
|
* @ignore
|
|
500
500
|
*/
|
|
501
|
-
BackdropProps:
|
|
501
|
+
BackdropProps: m.object,
|
|
502
502
|
/**
|
|
503
503
|
* Dialog children, usually the included sub-components.
|
|
504
504
|
*/
|
|
505
|
-
children:
|
|
505
|
+
children: m.node,
|
|
506
506
|
/**
|
|
507
507
|
* Override or extend the styles applied to the component.
|
|
508
508
|
*/
|
|
509
|
-
classes:
|
|
509
|
+
classes: m.object,
|
|
510
510
|
/**
|
|
511
511
|
* @ignore
|
|
512
512
|
*/
|
|
513
|
-
className:
|
|
513
|
+
className: m.string,
|
|
514
514
|
/**
|
|
515
515
|
* If `true`, hitting escape will not fire the `onClose` callback.
|
|
516
516
|
* @default false
|
|
517
517
|
*/
|
|
518
|
-
disableEscapeKeyDown:
|
|
518
|
+
disableEscapeKeyDown: m.bool,
|
|
519
519
|
/**
|
|
520
520
|
* If `true`, the dialog is full-screen.
|
|
521
521
|
* @default false
|
|
522
522
|
*/
|
|
523
|
-
fullScreen:
|
|
523
|
+
fullScreen: m.bool,
|
|
524
524
|
/**
|
|
525
525
|
* If `true`, the dialog stretches to `maxWidth`.
|
|
526
526
|
*
|
|
527
527
|
* Notice that the dialog width grow is limited by the default margin.
|
|
528
528
|
* @default false
|
|
529
529
|
*/
|
|
530
|
-
fullWidth:
|
|
530
|
+
fullWidth: m.bool,
|
|
531
531
|
/**
|
|
532
532
|
* Determine the max-width of the dialog.
|
|
533
533
|
* The dialog width grows with the size of the screen.
|
|
534
534
|
* Set to `false` to disable `maxWidth`.
|
|
535
535
|
* @default 'sm'
|
|
536
536
|
*/
|
|
537
|
-
maxWidth:
|
|
537
|
+
maxWidth: m.oneOfType([m.oneOf(["xs", "sm", "md", "lg", "xl", !1]), m.string]),
|
|
538
538
|
/**
|
|
539
539
|
* Callback fired when the backdrop is clicked.
|
|
540
540
|
* @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
|
|
541
541
|
*/
|
|
542
|
-
onBackdropClick:
|
|
542
|
+
onBackdropClick: m.func,
|
|
543
543
|
/**
|
|
544
544
|
* @ignore
|
|
545
545
|
*/
|
|
546
|
-
onClick:
|
|
546
|
+
onClick: m.func,
|
|
547
547
|
/**
|
|
548
548
|
* Callback fired when the component requests to be closed.
|
|
549
549
|
*
|
|
550
550
|
* @param {object} event The event source of the callback.
|
|
551
551
|
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
|
|
552
552
|
*/
|
|
553
|
-
onClose:
|
|
553
|
+
onClose: m.func,
|
|
554
554
|
/**
|
|
555
555
|
* If `true`, the component is shown.
|
|
556
556
|
*/
|
|
557
|
-
open:
|
|
557
|
+
open: m.bool.isRequired,
|
|
558
558
|
/**
|
|
559
559
|
* The component used to render the body of the dialog.
|
|
560
560
|
* @default Paper
|
|
561
561
|
*/
|
|
562
|
-
PaperComponent:
|
|
562
|
+
PaperComponent: m.elementType,
|
|
563
563
|
/**
|
|
564
564
|
* Props applied to the [`Paper`](/material-ui/api/paper/) element.
|
|
565
565
|
* @default {}
|
|
566
566
|
*/
|
|
567
|
-
PaperProps:
|
|
567
|
+
PaperProps: m.object,
|
|
568
568
|
/**
|
|
569
569
|
* Determine the container for scrolling the dialog.
|
|
570
570
|
* @default 'paper'
|
|
571
571
|
*/
|
|
572
|
-
scroll:
|
|
572
|
+
scroll: m.oneOf(["body", "paper"]),
|
|
573
573
|
/**
|
|
574
574
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
575
575
|
*/
|
|
576
|
-
sx:
|
|
576
|
+
sx: m.oneOfType([m.arrayOf(m.oneOfType([m.func, m.object, m.bool])), m.func, m.object]),
|
|
577
577
|
/**
|
|
578
578
|
* The component used for the transition.
|
|
579
579
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
580
580
|
* @default Fade
|
|
581
581
|
*/
|
|
582
|
-
TransitionComponent:
|
|
582
|
+
TransitionComponent: m.elementType,
|
|
583
583
|
/**
|
|
584
584
|
* The duration for the transition, in milliseconds.
|
|
585
585
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
@@ -588,18 +588,18 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
|
|
|
588
588
|
* exit: theme.transitions.duration.leavingScreen,
|
|
589
589
|
* }
|
|
590
590
|
*/
|
|
591
|
-
transitionDuration:
|
|
592
|
-
appear:
|
|
593
|
-
enter:
|
|
594
|
-
exit:
|
|
591
|
+
transitionDuration: m.oneOfType([m.number, m.shape({
|
|
592
|
+
appear: m.number,
|
|
593
|
+
enter: m.number,
|
|
594
|
+
exit: m.number
|
|
595
595
|
})]),
|
|
596
596
|
/**
|
|
597
597
|
* Props applied to the transition element.
|
|
598
598
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
599
599
|
*/
|
|
600
|
-
TransitionProps:
|
|
600
|
+
TransitionProps: m.object
|
|
601
601
|
});
|
|
602
|
-
class
|
|
602
|
+
class ja extends Jt {
|
|
603
603
|
constructor(t, r) {
|
|
604
604
|
super(), this.client = t, this.setOptions(r), this.bindMethods(), this.updateResult();
|
|
605
605
|
}
|
|
@@ -609,7 +609,7 @@ class Aa extends $t {
|
|
|
609
609
|
setOptions(t) {
|
|
610
610
|
var r;
|
|
611
611
|
const i = this.options;
|
|
612
|
-
this.options = this.client.defaultMutationOptions(t),
|
|
612
|
+
this.options = this.client.defaultMutationOptions(t), Xt(i, this.options) || this.client.getMutationCache().notify({
|
|
613
613
|
type: "observerOptionsUpdated",
|
|
614
614
|
mutation: this.currentMutation,
|
|
615
615
|
observer: this
|
|
@@ -637,12 +637,12 @@ class Aa extends $t {
|
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
639
|
mutate(t, r) {
|
|
640
|
-
return this.mutateOptions = r, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client,
|
|
640
|
+
return this.mutateOptions = r, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, v(C({}, this.options), {
|
|
641
641
|
variables: typeof t < "u" ? t : this.options.variables
|
|
642
642
|
})), this.currentMutation.addObserver(this), this.currentMutation.execute();
|
|
643
643
|
}
|
|
644
644
|
updateResult() {
|
|
645
|
-
const t = this.currentMutation ? this.currentMutation.state :
|
|
645
|
+
const t = this.currentMutation ? this.currentMutation.state : Kt(), r = v(C({}, t), {
|
|
646
646
|
isLoading: t.status === "loading",
|
|
647
647
|
isSuccess: t.status === "success",
|
|
648
648
|
isError: t.status === "error",
|
|
@@ -656,53 +656,54 @@ class Aa extends $t {
|
|
|
656
656
|
Qe.batch(() => {
|
|
657
657
|
if (this.mutateOptions && this.hasListeners()) {
|
|
658
658
|
if (t.onSuccess) {
|
|
659
|
-
var r, i, o,
|
|
660
|
-
(r = (i = this.mutateOptions).onSuccess) == null || r.call(i, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (o = (
|
|
659
|
+
var r, i, o, n;
|
|
660
|
+
(r = (i = this.mutateOptions).onSuccess) == null || r.call(i, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (o = (n = this.mutateOptions).onSettled) == null || o.call(n, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
|
|
661
661
|
} else if (t.onError) {
|
|
662
|
-
var
|
|
663
|
-
(
|
|
662
|
+
var l, d, c, s;
|
|
663
|
+
(l = (d = this.mutateOptions).onError) == null || l.call(d, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (c = (s = this.mutateOptions).onSettled) == null || c.call(s, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
t.listeners && this.listeners.forEach(({
|
|
667
|
-
listener:
|
|
667
|
+
listener: u
|
|
668
668
|
}) => {
|
|
669
|
-
|
|
669
|
+
u(this.currentResult);
|
|
670
670
|
});
|
|
671
671
|
});
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
const i =
|
|
674
|
+
function Se(e, t, r) {
|
|
675
|
+
const i = Ht(e, t), o = ee({
|
|
676
676
|
context: i.context
|
|
677
|
-
}), [
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}, [
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
}, [
|
|
684
|
-
if (
|
|
685
|
-
throw
|
|
686
|
-
return
|
|
677
|
+
}), [n] = I(() => new ja(o, i));
|
|
678
|
+
V(() => {
|
|
679
|
+
n.setOptions(i);
|
|
680
|
+
}, [n, i]);
|
|
681
|
+
const l = Ut(M((c) => n.subscribe(Qe.batchCalls(c)), [n]), () => n.getCurrentResult(), () => n.getCurrentResult()), d = M((c, s) => {
|
|
682
|
+
n.mutate(c, s).catch(za);
|
|
683
|
+
}, [n]);
|
|
684
|
+
if (l.error && Bt(n.options.useErrorBoundary, [l.error]))
|
|
685
|
+
throw l.error;
|
|
686
|
+
return v(C({}, l), {
|
|
687
687
|
mutate: d,
|
|
688
|
-
mutateAsync:
|
|
688
|
+
mutateAsync: l.mutate
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function za() {
|
|
692
692
|
}
|
|
693
|
-
class
|
|
693
|
+
class Ea {
|
|
694
694
|
constructor(t) {
|
|
695
|
-
|
|
695
|
+
L(this, "httpClient"), L(this, "getChatContexts", () => Q(this, null, function* () {
|
|
696
696
|
return (yield this.httpClient.get("api/datasources//")) || [];
|
|
697
|
-
})),
|
|
697
|
+
})), L(this, "getNlgInsights", (r) => this.httpClient.post("api/v2/ai/nlg/queryResult", r)), L(this, "getQueryRecommendations", (r, i) => this.httpClient.get(`api/v2/ai/recommendations/query/${r}/${i.numOfRecommendations}`)), L(this, "getNlqResult", (r, i) => this.httpClient.post(`api/v2/ai/nlq/query/${r}`, i)), L(this, "setLlmConfig", (r) => this.httpClient.post("api/v2/settings/ai/llmProvider", r).catch((i) => {
|
|
698
698
|
console.error("Unable to set llm config", i);
|
|
699
|
-
})),
|
|
699
|
+
})), L(this, "getAllChats", () => this.httpClient.get("api/v2/ai/chats")), L(this, "getChatById", (r) => this.httpClient.get(`api/v2/ai/chats/${r}`)), L(this, "createChat", (r) => this.httpClient.post("api/v2/ai/chats", {
|
|
700
700
|
sourceId: r
|
|
701
|
-
})),
|
|
701
|
+
})), L(this, "postChat", (r, i) => this.httpClient.post(`api/v2/ai/chats/${r}`, i)), L(this, "deleteChatHistory", (r) => this.httpClient.delete(`api/v2/ai/chats/${r}/history`)), L(this, "sendFeedback", (r) => this.httpClient.post("api/v2/ai/feedback", r)), L(this, "getDataSourceFields", (r) => this.httpClient.post(`api/datasources/${encodeURIComponent(r)}/fields/search`, {
|
|
702
702
|
offset: 0,
|
|
703
703
|
count: 9999
|
|
704
|
-
})),
|
|
705
|
-
|
|
704
|
+
})), L(this, "ai", {
|
|
705
|
+
getNlgInsights: this.getNlgInsights,
|
|
706
|
+
getNlqResult: this.getNlqResult,
|
|
706
707
|
getQueryRecommendations: this.getQueryRecommendations,
|
|
707
708
|
setLlmConfig: this.setLlmConfig,
|
|
708
709
|
sendFeedback: this.sendFeedback,
|
|
@@ -717,151 +718,189 @@ class La {
|
|
|
717
718
|
}), this.httpClient = t;
|
|
718
719
|
}
|
|
719
720
|
}
|
|
720
|
-
const
|
|
721
|
+
const Za = new It({
|
|
721
722
|
defaultOptions: {
|
|
722
723
|
queries: {
|
|
723
724
|
refetchOnWindowFocus: !1,
|
|
724
725
|
refetchOnMount: !1
|
|
725
726
|
}
|
|
726
727
|
}
|
|
727
|
-
}),
|
|
728
|
+
}), rt = De(void 0), O = () => Ve(rt), Oa = ({
|
|
728
729
|
children: e
|
|
729
730
|
}) => {
|
|
730
731
|
const {
|
|
731
732
|
app: t
|
|
732
|
-
} =
|
|
733
|
-
return /* @__PURE__ */ a(
|
|
733
|
+
} = qt(), r = z(() => t ? new Ea(t.httpClient) : void 0, [t]);
|
|
734
|
+
return /* @__PURE__ */ a(rt.Provider, {
|
|
734
735
|
value: r,
|
|
735
|
-
children: /* @__PURE__ */ a(
|
|
736
|
-
client:
|
|
736
|
+
children: /* @__PURE__ */ a(Yt, {
|
|
737
|
+
client: Za,
|
|
737
738
|
children: e
|
|
738
739
|
})
|
|
739
740
|
});
|
|
740
741
|
};
|
|
741
|
-
function
|
|
742
|
+
function qi({
|
|
742
743
|
children: e
|
|
743
744
|
}) {
|
|
744
|
-
return /* @__PURE__ */ a(
|
|
745
|
+
return /* @__PURE__ */ a(Oa, {
|
|
745
746
|
children: e
|
|
746
747
|
});
|
|
747
748
|
}
|
|
748
|
-
const
|
|
749
|
+
const te = (e, t = !0) => {
|
|
749
750
|
const r = z(() => {
|
|
750
|
-
var
|
|
751
|
+
var u, p;
|
|
751
752
|
if ("jaql" in e)
|
|
752
753
|
return e;
|
|
753
754
|
{
|
|
754
|
-
const
|
|
755
|
-
filters:
|
|
756
|
-
relations:
|
|
757
|
-
} =
|
|
758
|
-
metadata:
|
|
759
|
-
filterRelations:
|
|
760
|
-
} =
|
|
755
|
+
const h = Tt(e.dataSource), {
|
|
756
|
+
filters: b = [],
|
|
757
|
+
relations: w
|
|
758
|
+
} = jt(e.filters), {
|
|
759
|
+
metadata: k,
|
|
760
|
+
filterRelations: x
|
|
761
|
+
} = zt({
|
|
761
762
|
dataSource: e.dataSource,
|
|
762
|
-
attributes: (
|
|
763
|
-
measures: (
|
|
764
|
-
filters:
|
|
765
|
-
filterRelations:
|
|
763
|
+
attributes: (u = e.dimensions) != null ? u : [],
|
|
764
|
+
measures: (p = e.measures) != null ? p : [],
|
|
765
|
+
filters: b,
|
|
766
|
+
filterRelations: w,
|
|
766
767
|
highlights: []
|
|
767
768
|
}, !0);
|
|
768
769
|
return {
|
|
769
770
|
jaql: {
|
|
770
|
-
datasource:
|
|
771
|
-
metadata:
|
|
772
|
-
filterRelations:
|
|
771
|
+
datasource: h,
|
|
772
|
+
metadata: k,
|
|
773
|
+
filterRelations: x
|
|
773
774
|
}
|
|
774
775
|
};
|
|
775
776
|
}
|
|
776
|
-
}, [e]), i =
|
|
777
|
+
}, [e]), i = O(), {
|
|
777
778
|
data: o,
|
|
778
|
-
error:
|
|
779
|
-
isError:
|
|
779
|
+
error: n,
|
|
780
|
+
isError: l,
|
|
780
781
|
isLoading: d,
|
|
781
782
|
isSuccess: c,
|
|
782
783
|
refetch: s
|
|
783
|
-
} =
|
|
784
|
-
queryKey: ["
|
|
785
|
-
queryFn: () => i == null ? void 0 : i.ai.
|
|
786
|
-
select: (
|
|
787
|
-
var
|
|
788
|
-
return (
|
|
784
|
+
} = P({
|
|
785
|
+
queryKey: ["getNlgInsights", r, i],
|
|
786
|
+
queryFn: () => i == null ? void 0 : i.ai.getNlgInsights(r),
|
|
787
|
+
select: (u) => {
|
|
788
|
+
var p;
|
|
789
|
+
return (p = u == null ? void 0 : u.data) == null ? void 0 : p.answer;
|
|
789
790
|
},
|
|
790
791
|
enabled: !!i && t
|
|
791
792
|
});
|
|
792
793
|
return {
|
|
793
794
|
isLoading: d,
|
|
794
|
-
isError:
|
|
795
|
+
isError: l,
|
|
795
796
|
isSuccess: c,
|
|
796
797
|
data: o,
|
|
797
|
-
error:
|
|
798
|
-
refetch:
|
|
798
|
+
error: n,
|
|
799
|
+
refetch: M(() => {
|
|
799
800
|
s();
|
|
800
801
|
}, [s])
|
|
801
802
|
};
|
|
802
|
-
},
|
|
803
|
+
}, it = (e) => {
|
|
803
804
|
const t = e, {
|
|
804
805
|
enabled: r
|
|
805
|
-
} = t, i =
|
|
806
|
-
return
|
|
807
|
-
},
|
|
806
|
+
} = t, i = va(t, ["enabled"]);
|
|
807
|
+
return te(i, r);
|
|
808
|
+
}, Yi = ge("useGetNlgInsights")(it), Hi = ge("useGetNlgQueryResult")(it), Ra = ["indicator", "column", "line", "table", "pie", "bar"], Wa = (e) => {
|
|
809
|
+
const {
|
|
810
|
+
dataSource: t,
|
|
811
|
+
query: r,
|
|
812
|
+
chartTypes: i
|
|
813
|
+
} = e, o = typeof t == "string" ? t : t.title, n = O(), {
|
|
814
|
+
isLoading: l,
|
|
815
|
+
isError: d,
|
|
816
|
+
isSuccess: c,
|
|
817
|
+
data: s,
|
|
818
|
+
error: u,
|
|
819
|
+
refetch: p
|
|
820
|
+
} = P({
|
|
821
|
+
queryKey: ["getNlqResult", t, r, i, n],
|
|
822
|
+
queryFn: () => n == null ? void 0 : n.ai.getNlqResult(o, {
|
|
823
|
+
text: r,
|
|
824
|
+
// Per @Einat Shusterman: Timezone is not used by AI API, but it is currently required by the endpoint
|
|
825
|
+
timezone: "UTC",
|
|
826
|
+
chartTypes: i ?? [...Ra]
|
|
827
|
+
}),
|
|
828
|
+
enabled: !!n && e.enabled
|
|
829
|
+
}), h = s ? ue(s, {
|
|
830
|
+
useCustomizedStyleOptions: e.enableAxisTitlesInWidgetProps || !1
|
|
831
|
+
}) : void 0;
|
|
832
|
+
return {
|
|
833
|
+
isLoading: l,
|
|
834
|
+
isError: d,
|
|
835
|
+
isSuccess: c,
|
|
836
|
+
data: h,
|
|
837
|
+
error: u,
|
|
838
|
+
refetch: M(() => {
|
|
839
|
+
p();
|
|
840
|
+
}, [p])
|
|
841
|
+
};
|
|
842
|
+
}, Ui = ge("useGetNlqResult")(Wa), ot = (e) => {
|
|
843
|
+
const {
|
|
844
|
+
contextTitle: t,
|
|
845
|
+
count: r,
|
|
846
|
+
enableAxisTitlesInWidgetProps: i,
|
|
847
|
+
enabled: o
|
|
848
|
+
} = e, n = O(), l = r ?? 4, d = (o === void 0 || o === !0) && l > 0, {
|
|
849
|
+
isLoading: c,
|
|
850
|
+
isError: s,
|
|
851
|
+
isSuccess: u,
|
|
852
|
+
data: p,
|
|
853
|
+
error: h,
|
|
854
|
+
refetch: b
|
|
855
|
+
} = P({
|
|
856
|
+
queryKey: ["getQueryRecommendations", t, l, n],
|
|
857
|
+
queryFn: () => n == null ? void 0 : n.ai.getQueryRecommendations(t, {
|
|
858
|
+
numOfRecommendations: l
|
|
859
|
+
}),
|
|
860
|
+
enabled: !!n && d
|
|
861
|
+
});
|
|
862
|
+
return p == null || p.map((w) => {
|
|
863
|
+
w.widgetProps = w.jaql ? ue(w, {
|
|
864
|
+
useCustomizedStyleOptions: i
|
|
865
|
+
}) : void 0;
|
|
866
|
+
}), {
|
|
867
|
+
isLoading: d ? c : !1,
|
|
868
|
+
isError: s,
|
|
869
|
+
isSuccess: u,
|
|
870
|
+
data: p ?? void 0,
|
|
871
|
+
error: h,
|
|
872
|
+
refetch: M(() => {
|
|
873
|
+
b();
|
|
874
|
+
}, [b])
|
|
875
|
+
};
|
|
876
|
+
}, Bi = ge("useGetQueryRecommendations")(ot), nt = Object.freeze({
|
|
808
877
|
enableFollowupQuestions: !1,
|
|
809
878
|
enableHeader: !0,
|
|
810
879
|
enableInsights: !0,
|
|
811
880
|
numOfRecommendations: 4,
|
|
812
881
|
numOfRecentPrompts: 5
|
|
813
|
-
}),
|
|
882
|
+
}), lt = De(C({}, nt)), W = () => Ve(lt), Ga = ({
|
|
814
883
|
children: e,
|
|
815
884
|
value: t
|
|
816
885
|
}) => {
|
|
817
886
|
const {
|
|
818
887
|
t: r
|
|
819
|
-
} = _(), i = Object.entries(t).reduce((o, [
|
|
888
|
+
} = _(), i = Object.entries(t).reduce((o, [n, l]) => (l !== void 0 && (o[n] = l), o), v(C({}, nt), {
|
|
820
889
|
inputPromptText: r("ai.config.inputPromptText"),
|
|
821
890
|
welcomeText: r("ai.config.welcomeText"),
|
|
822
891
|
suggestionsWelcomeText: r("ai.config.suggestionsWelcomeText")
|
|
823
892
|
}));
|
|
824
|
-
return /* @__PURE__ */ a(
|
|
893
|
+
return /* @__PURE__ */ a(lt.Provider, {
|
|
825
894
|
value: i,
|
|
826
895
|
children: e
|
|
827
896
|
});
|
|
828
|
-
},
|
|
829
|
-
const {
|
|
830
|
-
contextTitle: t,
|
|
831
|
-
count: r
|
|
832
|
-
} = e, i = Z(), {
|
|
833
|
-
numOfRecommendations: o
|
|
834
|
-
} = R(), l = r ?? o, n = l > 0, {
|
|
835
|
-
isLoading: d,
|
|
836
|
-
isError: c,
|
|
837
|
-
isSuccess: s,
|
|
838
|
-
data: p,
|
|
839
|
-
error: g,
|
|
840
|
-
refetch: u
|
|
841
|
-
} = Q({
|
|
842
|
-
queryKey: ["getQueryRecommendations", t, l, i],
|
|
843
|
-
queryFn: () => i == null ? void 0 : i.ai.getQueryRecommendations(t, {
|
|
844
|
-
numOfRecommendations: l
|
|
845
|
-
}),
|
|
846
|
-
enabled: !!i && n
|
|
847
|
-
});
|
|
848
|
-
return {
|
|
849
|
-
isLoading: n ? d : !1,
|
|
850
|
-
isError: n ? c : !1,
|
|
851
|
-
isSuccess: n ? s : !1,
|
|
852
|
-
data: n && p ? p : [],
|
|
853
|
-
error: n ? g : null,
|
|
854
|
-
refetch: I(() => {
|
|
855
|
-
n && u();
|
|
856
|
-
}, [u, n])
|
|
857
|
-
};
|
|
858
|
-
}, Oi = Pe("useGetQueryRecommendations")(ot), Me = "chatHistory", Ea = (e) => {
|
|
859
|
-
const t = Z(), {
|
|
897
|
+
}, Le = "chatHistory", qa = (e) => {
|
|
898
|
+
const t = O(), {
|
|
860
899
|
hideHistory: r
|
|
861
|
-
} =
|
|
862
|
-
return
|
|
863
|
-
queryKey: [
|
|
864
|
-
queryFn: () =>
|
|
900
|
+
} = W();
|
|
901
|
+
return P({
|
|
902
|
+
queryKey: [Le, e, t],
|
|
903
|
+
queryFn: () => Q(void 0, null, function* () {
|
|
865
904
|
if (!t || !e)
|
|
866
905
|
return;
|
|
867
906
|
if (r)
|
|
@@ -871,10 +910,10 @@ const pe = (e, t = !0) => {
|
|
|
871
910
|
}),
|
|
872
911
|
enabled: !!t && !!e
|
|
873
912
|
});
|
|
874
|
-
},
|
|
875
|
-
const t =
|
|
876
|
-
return
|
|
877
|
-
mutationFn: () =>
|
|
913
|
+
}, ct = (e) => {
|
|
914
|
+
const t = O(), r = ee();
|
|
915
|
+
return Se({
|
|
916
|
+
mutationFn: () => Q(void 0, null, function* () {
|
|
878
917
|
if (!(!t || !e))
|
|
879
918
|
return t.ai.chat.clearHistory(e);
|
|
880
919
|
}),
|
|
@@ -882,32 +921,32 @@ const pe = (e, t = !0) => {
|
|
|
882
921
|
console.error("Error when clearing history:", i);
|
|
883
922
|
},
|
|
884
923
|
onSettled: () => {
|
|
885
|
-
e && r.setQueriesData([
|
|
924
|
+
e && r.setQueriesData([Le, e], []);
|
|
886
925
|
}
|
|
887
926
|
});
|
|
888
|
-
},
|
|
927
|
+
}, dt = (e) => {
|
|
889
928
|
const {
|
|
890
929
|
data: t,
|
|
891
930
|
isLoading: r,
|
|
892
931
|
isError: i
|
|
893
|
-
} =
|
|
932
|
+
} = qa(e), {
|
|
894
933
|
mutate: o
|
|
895
|
-
} =
|
|
896
|
-
return
|
|
934
|
+
} = ct(e);
|
|
935
|
+
return V(() => {
|
|
897
936
|
i && o();
|
|
898
937
|
}, [i, o]), {
|
|
899
938
|
history: t,
|
|
900
939
|
isLoading: r,
|
|
901
940
|
isError: i
|
|
902
941
|
};
|
|
903
|
-
},
|
|
904
|
-
const e =
|
|
942
|
+
}, st = () => {
|
|
943
|
+
const e = O(), {
|
|
905
944
|
data: t,
|
|
906
945
|
isLoading: r,
|
|
907
946
|
fetchStatus: i
|
|
908
|
-
} =
|
|
947
|
+
} = P({
|
|
909
948
|
queryKey: ["getDataTopics", e],
|
|
910
|
-
queryFn: () =>
|
|
949
|
+
queryFn: () => Q(void 0, null, function* () {
|
|
911
950
|
if (e)
|
|
912
951
|
return e.getChatContexts();
|
|
913
952
|
}),
|
|
@@ -918,11 +957,11 @@ const pe = (e, t = !0) => {
|
|
|
918
957
|
isLoading: r,
|
|
919
958
|
fetchStatus: i
|
|
920
959
|
};
|
|
921
|
-
},
|
|
922
|
-
const e =
|
|
960
|
+
}, pt = () => {
|
|
961
|
+
const e = O(), {
|
|
923
962
|
data: t,
|
|
924
963
|
isLoading: r
|
|
925
|
-
} =
|
|
964
|
+
} = P({
|
|
926
965
|
queryKey: ["getAllChats", e],
|
|
927
966
|
queryFn: () => e == null ? void 0 : e.ai.chat.getAll(),
|
|
928
967
|
enabled: !!e
|
|
@@ -931,18 +970,18 @@ const pe = (e, t = !0) => {
|
|
|
931
970
|
data: t ?? [],
|
|
932
971
|
isLoading: r
|
|
933
972
|
};
|
|
934
|
-
},
|
|
935
|
-
const r = ee(), i =
|
|
936
|
-
mutationFn: () =>
|
|
973
|
+
}, Ya = (e, t) => {
|
|
974
|
+
const r = ee(), i = O(), o = Se({
|
|
975
|
+
mutationFn: () => Q(void 0, null, function* () {
|
|
937
976
|
if (!(!i || !e))
|
|
938
977
|
return i.ai.chat.create(e);
|
|
939
978
|
}),
|
|
940
979
|
onSuccess: () => r.invalidateQueries(["getAllChats"])
|
|
941
980
|
});
|
|
942
|
-
return
|
|
981
|
+
return V(() => {
|
|
943
982
|
t && o.isIdle && o.mutate();
|
|
944
983
|
}, [t, o]), o;
|
|
945
|
-
},
|
|
984
|
+
}, Ha = (e, t) => {
|
|
946
985
|
switch (e.responseType = e.responseType.toLowerCase(), e.responseType) {
|
|
947
986
|
case "nlq":
|
|
948
987
|
return {
|
|
@@ -959,35 +998,35 @@ const pe = (e, t = !0) => {
|
|
|
959
998
|
default:
|
|
960
999
|
throw Error(`${t}${JSON.stringify(e)}`);
|
|
961
1000
|
}
|
|
962
|
-
},
|
|
963
|
-
const
|
|
964
|
-
e &&
|
|
965
|
-
}, [
|
|
966
|
-
enableFollowupQuestions: i
|
|
967
|
-
} = R(), {
|
|
1001
|
+
}, Ua = (e, t) => {
|
|
1002
|
+
const r = ee(), i = M((c) => {
|
|
1003
|
+
e && r.setQueriesData([Le, e], (s) => s && [...s, c]);
|
|
1004
|
+
}, [r, e]), {
|
|
968
1005
|
t: o
|
|
969
|
-
} = _(),
|
|
970
|
-
mutate:
|
|
1006
|
+
} = _(), n = O(), {
|
|
1007
|
+
mutate: l,
|
|
971
1008
|
isLoading: d
|
|
972
|
-
} =
|
|
973
|
-
mutationFn: (c) =>
|
|
974
|
-
if (!(!
|
|
975
|
-
return
|
|
1009
|
+
} = Se({
|
|
1010
|
+
mutationFn: (c) => Q(void 0, null, function* () {
|
|
1011
|
+
if (!(!n || !e))
|
|
1012
|
+
return n.ai.chat.post(e, {
|
|
976
1013
|
text: c,
|
|
977
1014
|
options: {
|
|
978
|
-
enableFollowup:
|
|
1015
|
+
enableFollowup: t
|
|
979
1016
|
}
|
|
980
1017
|
});
|
|
981
1018
|
}),
|
|
982
1019
|
onMutate: (c) => {
|
|
983
|
-
|
|
1020
|
+
i({
|
|
984
1021
|
content: c,
|
|
985
1022
|
role: "user"
|
|
986
1023
|
});
|
|
987
1024
|
},
|
|
988
1025
|
onError: (c) => {
|
|
989
|
-
c instanceof Error && (console.error("Error when sending message:", c.message),
|
|
990
|
-
content: o(
|
|
1026
|
+
c instanceof Error && (console.error("Error when sending message:", c.message), i({
|
|
1027
|
+
content: o(`ai.errors.${c.interpolationOptions.errorCode}`, {
|
|
1028
|
+
defaultValue: o("ai.errors.unexpectedChatResponse")
|
|
1029
|
+
}),
|
|
991
1030
|
role: "assistant"
|
|
992
1031
|
}));
|
|
993
1032
|
},
|
|
@@ -995,75 +1034,77 @@ const pe = (e, t = !0) => {
|
|
|
995
1034
|
if (!c)
|
|
996
1035
|
return;
|
|
997
1036
|
const s = o("ai.errors.unknownResponse");
|
|
998
|
-
|
|
1037
|
+
i(Ha(c, s));
|
|
999
1038
|
}
|
|
1000
1039
|
});
|
|
1001
1040
|
return {
|
|
1002
|
-
mutate:
|
|
1041
|
+
mutate: l,
|
|
1003
1042
|
isLoading: d
|
|
1004
1043
|
};
|
|
1005
|
-
},
|
|
1044
|
+
}, Ne = (e) => !!e && "type" in e && e.type === "nlq", Ba = (e) => !!e && "type" in e && e.type === "text", $a = (e) => {
|
|
1006
1045
|
var t, r;
|
|
1007
1046
|
const {
|
|
1008
1047
|
t: i
|
|
1009
1048
|
} = _(), {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
} = ct(), {
|
|
1049
|
+
enableFollowupQuestions: o
|
|
1050
|
+
} = W(), {
|
|
1013
1051
|
data: n,
|
|
1014
|
-
isLoading:
|
|
1015
|
-
} =
|
|
1016
|
-
|
|
1017
|
-
|
|
1052
|
+
isLoading: l
|
|
1053
|
+
} = st(), {
|
|
1054
|
+
data: d,
|
|
1055
|
+
isLoading: c
|
|
1056
|
+
} = pt(), s = (t = n == null ? void 0 : n.find((T) => T.title === e)) == null ? void 0 : t.title, u = (r = d.find((T) => T.contextTitle === s)) == null ? void 0 : r.chatId, p = l || !!s, h = c || !!u, [b, w] = I(null), {
|
|
1057
|
+
isError: k
|
|
1058
|
+
} = Ya(s, p && !h), {
|
|
1018
1059
|
history: x,
|
|
1019
|
-
isLoading:
|
|
1020
|
-
isError:
|
|
1021
|
-
} =
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
}, [
|
|
1060
|
+
isLoading: E,
|
|
1061
|
+
isError: A
|
|
1062
|
+
} = dt(u);
|
|
1063
|
+
V(() => {
|
|
1064
|
+
k ? w(new Ce("ai.errors.chatUnavailable")) : A && w(new Ce("ai.errors.fetchHistory"));
|
|
1065
|
+
}, [k, A, i]);
|
|
1025
1066
|
const {
|
|
1026
|
-
mutate:
|
|
1027
|
-
isLoading:
|
|
1028
|
-
} =
|
|
1067
|
+
mutate: y,
|
|
1068
|
+
isLoading: R
|
|
1069
|
+
} = Ua(u, o), Z = z(() => {
|
|
1029
1070
|
if (x != null && x.length) {
|
|
1030
|
-
const
|
|
1031
|
-
if (
|
|
1032
|
-
return JSON.parse(
|
|
1071
|
+
const T = x[x.length - 1];
|
|
1072
|
+
if (Ne(T))
|
|
1073
|
+
return JSON.parse(T.content);
|
|
1033
1074
|
}
|
|
1034
1075
|
return null;
|
|
1035
1076
|
}, [x]);
|
|
1036
1077
|
return {
|
|
1037
|
-
chatId:
|
|
1078
|
+
chatId: u,
|
|
1038
1079
|
history: x ?? [],
|
|
1039
|
-
lastNlqResponse:
|
|
1040
|
-
sendMessage:
|
|
1041
|
-
isAwaitingResponse:
|
|
1042
|
-
isLoading:
|
|
1043
|
-
lastError:
|
|
1080
|
+
lastNlqResponse: Z,
|
|
1081
|
+
sendMessage: y,
|
|
1082
|
+
isAwaitingResponse: R,
|
|
1083
|
+
isLoading: E,
|
|
1084
|
+
lastError: b
|
|
1044
1085
|
};
|
|
1045
|
-
},
|
|
1086
|
+
}, $i = ({
|
|
1046
1087
|
contextTitle: e
|
|
1047
1088
|
}) => {
|
|
1048
1089
|
var t;
|
|
1049
1090
|
const {
|
|
1050
1091
|
data: r
|
|
1051
|
-
} =
|
|
1092
|
+
} = pt(), i = (t = r.find((n) => n.contextTitle === e)) == null ? void 0 : t.chatId, {
|
|
1052
1093
|
history: o
|
|
1053
|
-
} =
|
|
1094
|
+
} = dt(i);
|
|
1054
1095
|
return z(() => {
|
|
1055
1096
|
if (o != null && o.length) {
|
|
1056
|
-
const
|
|
1057
|
-
if (
|
|
1058
|
-
return JSON.parse(
|
|
1097
|
+
const n = o[o.length - 1];
|
|
1098
|
+
if (Ne(n))
|
|
1099
|
+
return JSON.parse(n.content);
|
|
1059
1100
|
}
|
|
1060
1101
|
return null;
|
|
1061
1102
|
}, [o]);
|
|
1062
|
-
},
|
|
1063
|
-
const t =
|
|
1103
|
+
}, Pi = (e) => {
|
|
1104
|
+
const t = O(), {
|
|
1064
1105
|
data: r,
|
|
1065
1106
|
isLoading: i
|
|
1066
|
-
} =
|
|
1107
|
+
} = P({
|
|
1067
1108
|
queryKey: ["getDataSourceFields", e, t],
|
|
1068
1109
|
queryFn: () => e ? t == null ? void 0 : t.ai.getDataSourceFields(e) : void 0,
|
|
1069
1110
|
select: (o) => o,
|
|
@@ -1073,7 +1114,7 @@ const pe = (e, t = !0) => {
|
|
|
1073
1114
|
data: r,
|
|
1074
1115
|
isLoading: i
|
|
1075
1116
|
};
|
|
1076
|
-
},
|
|
1117
|
+
}, Pa = 500, Fa = 500, Va = 500, Qa = 900, Ja = g.div`
|
|
1077
1118
|
box-sizing: border-box;
|
|
1078
1119
|
position: relative;
|
|
1079
1120
|
display: flex;
|
|
@@ -1087,18 +1128,18 @@ const pe = (e, t = !0) => {
|
|
|
1087
1128
|
}) => e.aiChat.backgroundColor};
|
|
1088
1129
|
overflow: hidden;
|
|
1089
1130
|
|
|
1090
|
-
min-width: ${
|
|
1091
|
-
min-height: ${
|
|
1131
|
+
min-width: ${Pa}px;
|
|
1132
|
+
min-height: ${Fa}px;
|
|
1092
1133
|
width: ${({
|
|
1093
1134
|
width: e
|
|
1094
|
-
}) => e ?
|
|
1135
|
+
}) => e ? Ye(e) : `${Va}px`};
|
|
1095
1136
|
height: ${({
|
|
1096
1137
|
height: e
|
|
1097
|
-
}) => e ?
|
|
1138
|
+
}) => e ? Ye(e) : `${Qa}px`};
|
|
1098
1139
|
|
|
1099
1140
|
${({
|
|
1100
1141
|
theme: e
|
|
1101
|
-
}) =>
|
|
1142
|
+
}) => S`
|
|
1102
1143
|
font-size: ${e.aiChat.primaryFontSize[0]};
|
|
1103
1144
|
line-height: ${e.aiChat.primaryFontSize[1]};
|
|
1104
1145
|
`}
|
|
@@ -1106,10 +1147,10 @@ const pe = (e, t = !0) => {
|
|
|
1106
1147
|
theme: e
|
|
1107
1148
|
}) => e.aiChat.border === !1 ? "none" : e.aiChat.border};
|
|
1108
1149
|
`;
|
|
1109
|
-
function
|
|
1150
|
+
function Ye(e) {
|
|
1110
1151
|
return typeof e == "number" ? `${e}px` : e;
|
|
1111
1152
|
}
|
|
1112
|
-
function
|
|
1153
|
+
function Xa({
|
|
1113
1154
|
spin: e
|
|
1114
1155
|
}) {
|
|
1115
1156
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -1133,16 +1174,16 @@ function Pa({
|
|
|
1133
1174
|
})]
|
|
1134
1175
|
});
|
|
1135
1176
|
}
|
|
1136
|
-
function
|
|
1177
|
+
function he() {
|
|
1137
1178
|
return /* @__PURE__ */ a("div", {
|
|
1138
1179
|
className: "csdk-m-auto",
|
|
1139
1180
|
"aria-label": "loading spinner",
|
|
1140
|
-
children: /* @__PURE__ */ a(
|
|
1181
|
+
children: /* @__PURE__ */ a(Xa, {
|
|
1141
1182
|
spin: !0
|
|
1142
1183
|
})
|
|
1143
1184
|
});
|
|
1144
1185
|
}
|
|
1145
|
-
function
|
|
1186
|
+
function Ka({
|
|
1146
1187
|
theme: e
|
|
1147
1188
|
}) {
|
|
1148
1189
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -1157,7 +1198,7 @@ function $a({
|
|
|
1157
1198
|
})
|
|
1158
1199
|
});
|
|
1159
1200
|
}
|
|
1160
|
-
function
|
|
1201
|
+
function er({
|
|
1161
1202
|
theme: e
|
|
1162
1203
|
}) {
|
|
1163
1204
|
const t = e.aiChat.icons.color;
|
|
@@ -1179,11 +1220,11 @@ function Qa({
|
|
|
1179
1220
|
})]
|
|
1180
1221
|
});
|
|
1181
1222
|
}
|
|
1182
|
-
const
|
|
1223
|
+
const tr = g.div`
|
|
1183
1224
|
display: flex;
|
|
1184
1225
|
flex-direction: column;
|
|
1185
1226
|
row-gap: 4px;
|
|
1186
|
-
`,
|
|
1227
|
+
`, ar = g.div`
|
|
1187
1228
|
font-size: 11px;
|
|
1188
1229
|
line-height: 18px;
|
|
1189
1230
|
font-weight: 300;
|
|
@@ -1197,7 +1238,7 @@ const Fa = h.div`
|
|
|
1197
1238
|
theme: e
|
|
1198
1239
|
}) => e.aiChat.dropup.headers.hover.backgroundColor};
|
|
1199
1240
|
}
|
|
1200
|
-
`,
|
|
1241
|
+
`, rr = g.div`
|
|
1201
1242
|
font-size: ${({
|
|
1202
1243
|
theme: e
|
|
1203
1244
|
}) => e.aiChat.primaryFontSize[0]};
|
|
@@ -1215,28 +1256,28 @@ const Fa = h.div`
|
|
|
1215
1256
|
}) => e.aiChat.dropup.items.hover.backgroundColor};
|
|
1216
1257
|
}
|
|
1217
1258
|
`;
|
|
1218
|
-
function
|
|
1259
|
+
function ir({
|
|
1219
1260
|
title: e,
|
|
1220
1261
|
items: t,
|
|
1221
1262
|
onSelect: r,
|
|
1222
1263
|
alwaysExpanded: i = !1
|
|
1223
1264
|
}) {
|
|
1224
|
-
const [o,
|
|
1225
|
-
themeSettings:
|
|
1265
|
+
const [o, n] = I(!1), {
|
|
1266
|
+
themeSettings: l
|
|
1226
1267
|
} = f();
|
|
1227
|
-
return /* @__PURE__ */ a(
|
|
1228
|
-
children: [/* @__PURE__ */ a(
|
|
1229
|
-
onClick: () =>
|
|
1230
|
-
theme:
|
|
1268
|
+
return /* @__PURE__ */ a(tr, {
|
|
1269
|
+
children: [/* @__PURE__ */ a(ar, {
|
|
1270
|
+
onClick: () => n((d) => !d),
|
|
1271
|
+
theme: l,
|
|
1231
1272
|
children: e.toUpperCase()
|
|
1232
|
-
}), (o || i) && t.map((d, c) => /* @__PURE__ */ a(
|
|
1273
|
+
}), (o || i) && t.map((d, c) => /* @__PURE__ */ a(rr, {
|
|
1233
1274
|
onClick: () => r(d),
|
|
1234
|
-
theme:
|
|
1275
|
+
theme: l,
|
|
1235
1276
|
children: d
|
|
1236
1277
|
}, c))]
|
|
1237
1278
|
});
|
|
1238
1279
|
}
|
|
1239
|
-
const
|
|
1280
|
+
const or = g.div`
|
|
1240
1281
|
font-family: ${({
|
|
1241
1282
|
theme: e
|
|
1242
1283
|
}) => e.typography.fontFamily};
|
|
@@ -1260,7 +1301,7 @@ const Ka = h.div`
|
|
|
1260
1301
|
display: flex;
|
|
1261
1302
|
flex-direction: column;
|
|
1262
1303
|
row-gap: 4px;
|
|
1263
|
-
`,
|
|
1304
|
+
`, nr = g.div`
|
|
1264
1305
|
font-size: ${({
|
|
1265
1306
|
theme: e
|
|
1266
1307
|
}) => e.aiChat.primaryFontSize[0]};
|
|
@@ -1271,15 +1312,15 @@ const Ka = h.div`
|
|
|
1271
1312
|
theme: e
|
|
1272
1313
|
}) => e.aiChat.dropup.items.textColor};
|
|
1273
1314
|
padding: 4px 12px;
|
|
1274
|
-
`,
|
|
1275
|
-
function
|
|
1315
|
+
`, Me = (e) => e.startsWith("/");
|
|
1316
|
+
function lr({
|
|
1276
1317
|
recentPrompts: e,
|
|
1277
1318
|
suggestions: t,
|
|
1278
1319
|
isLoading: r,
|
|
1279
1320
|
onSelection: i,
|
|
1280
1321
|
anchorEl: o,
|
|
1281
|
-
text:
|
|
1282
|
-
recommendationsError:
|
|
1322
|
+
text: n,
|
|
1323
|
+
recommendationsError: l
|
|
1283
1324
|
}) {
|
|
1284
1325
|
const d = [{
|
|
1285
1326
|
title: "/recent searches",
|
|
@@ -1289,13 +1330,13 @@ function tr({
|
|
|
1289
1330
|
title: "/ai recommendations",
|
|
1290
1331
|
items: t,
|
|
1291
1332
|
onSelect: i
|
|
1292
|
-
}].filter((
|
|
1333
|
+
}].filter((p) => p.title.slice(0, n.length) === n), {
|
|
1293
1334
|
themeSettings: c
|
|
1294
1335
|
} = f(), {
|
|
1295
1336
|
t: s
|
|
1296
|
-
} = _(),
|
|
1297
|
-
return /* @__PURE__ */ a(
|
|
1298
|
-
open:
|
|
1337
|
+
} = _(), u = d.length === 1;
|
|
1338
|
+
return /* @__PURE__ */ a(Je, {
|
|
1339
|
+
open: Me(n) && d.length > 0,
|
|
1299
1340
|
anchorEl: o,
|
|
1300
1341
|
placement: "top-start",
|
|
1301
1342
|
modifiers: [{
|
|
@@ -1307,21 +1348,21 @@ function tr({
|
|
|
1307
1348
|
sx: {
|
|
1308
1349
|
zIndex: 3
|
|
1309
1350
|
},
|
|
1310
|
-
children: /* @__PURE__ */ a(
|
|
1351
|
+
children: /* @__PURE__ */ a(or, {
|
|
1311
1352
|
style: {
|
|
1312
1353
|
width: o == null ? void 0 : o.offsetWidth
|
|
1313
1354
|
},
|
|
1314
1355
|
theme: c,
|
|
1315
|
-
children: [r && /* @__PURE__ */ a(
|
|
1316
|
-
alwaysExpanded:
|
|
1317
|
-
}),
|
|
1356
|
+
children: [r && /* @__PURE__ */ a(he, {}), !r && !l && d.map((p) => /* @__PURE__ */ a(ir, v(C({}, p), {
|
|
1357
|
+
alwaysExpanded: u
|
|
1358
|
+
}), p.title)), l && /* @__PURE__ */ a(nr, {
|
|
1318
1359
|
theme: c,
|
|
1319
1360
|
children: s("ai.errors.recommendationsNotAvailable")
|
|
1320
1361
|
})]
|
|
1321
1362
|
})
|
|
1322
1363
|
});
|
|
1323
1364
|
}
|
|
1324
|
-
function
|
|
1365
|
+
function ae({
|
|
1325
1366
|
title: e,
|
|
1326
1367
|
placement: t = "top",
|
|
1327
1368
|
children: r
|
|
@@ -1329,7 +1370,7 @@ function te({
|
|
|
1329
1370
|
const {
|
|
1330
1371
|
themeSettings: i
|
|
1331
1372
|
} = f();
|
|
1332
|
-
return /* @__PURE__ */ a(
|
|
1373
|
+
return /* @__PURE__ */ a(ia, {
|
|
1333
1374
|
title: e,
|
|
1334
1375
|
placement: t,
|
|
1335
1376
|
disableInteractive: !0,
|
|
@@ -1357,7 +1398,7 @@ function te({
|
|
|
1357
1398
|
children: r
|
|
1358
1399
|
});
|
|
1359
1400
|
}
|
|
1360
|
-
const
|
|
1401
|
+
const cr = 500, dr = g.div`
|
|
1361
1402
|
display: flex;
|
|
1362
1403
|
flex-direction: row;
|
|
1363
1404
|
align-items: flex-end;
|
|
@@ -1366,12 +1407,12 @@ const ar = 500, rr = h.div`
|
|
|
1366
1407
|
background-color: ${({
|
|
1367
1408
|
theme: e
|
|
1368
1409
|
}) => e.aiChat.backgroundColor};
|
|
1369
|
-
`,
|
|
1410
|
+
`, sr = g.button`
|
|
1370
1411
|
height: 34px;
|
|
1371
1412
|
background-color: inherit;
|
|
1372
1413
|
cursor: pointer;
|
|
1373
1414
|
border: none;
|
|
1374
|
-
`,
|
|
1415
|
+
`, pr = g.textarea`
|
|
1375
1416
|
font-size: inherit;
|
|
1376
1417
|
line-height: inherit;
|
|
1377
1418
|
resize: none;
|
|
@@ -1405,7 +1446,7 @@ const ar = 500, rr = h.div`
|
|
|
1405
1446
|
background-color: ${({
|
|
1406
1447
|
theme: e
|
|
1407
1448
|
}) => e.aiChat.input.backgroundColor};
|
|
1408
|
-
`,
|
|
1449
|
+
`, gr = g.button`
|
|
1409
1450
|
height: 34px;
|
|
1410
1451
|
background-color: inherit;
|
|
1411
1452
|
border-style: none;
|
|
@@ -1416,126 +1457,126 @@ const ar = 500, rr = h.div`
|
|
|
1416
1457
|
|
|
1417
1458
|
${({
|
|
1418
1459
|
disabled: e
|
|
1419
|
-
}) => e ?
|
|
1460
|
+
}) => e ? S`
|
|
1420
1461
|
opacity: 0.3;
|
|
1421
1462
|
cursor: not-allowed;
|
|
1422
|
-
` :
|
|
1463
|
+
` : S`
|
|
1423
1464
|
opacity: 1;
|
|
1424
1465
|
cursor: pointer;
|
|
1425
1466
|
`}
|
|
1426
|
-
`,
|
|
1427
|
-
function
|
|
1467
|
+
`, ur = 34;
|
|
1468
|
+
function hr({
|
|
1428
1469
|
onSendMessage: e,
|
|
1429
1470
|
onClearHistoryClick: t,
|
|
1430
1471
|
disabled: r,
|
|
1431
1472
|
recentPrompts: i,
|
|
1432
1473
|
suggestions: o,
|
|
1433
|
-
isLoading:
|
|
1434
|
-
recommendationsError:
|
|
1474
|
+
isLoading: n,
|
|
1475
|
+
recommendationsError: l,
|
|
1435
1476
|
onChange: d
|
|
1436
1477
|
}) {
|
|
1437
|
-
const [c, s] =
|
|
1438
|
-
inputPromptText:
|
|
1439
|
-
} =
|
|
1478
|
+
const [c, s] = I(""), {
|
|
1479
|
+
inputPromptText: u
|
|
1480
|
+
} = W(), p = M(() => {
|
|
1440
1481
|
if (r)
|
|
1441
1482
|
return;
|
|
1442
|
-
if (
|
|
1483
|
+
if (Me(c)) {
|
|
1443
1484
|
s("");
|
|
1444
1485
|
return;
|
|
1445
1486
|
}
|
|
1446
1487
|
const y = c.trim();
|
|
1447
1488
|
y.length !== 0 && (e(y), s(""));
|
|
1448
|
-
}, [r, e, c]),
|
|
1489
|
+
}, [r, e, c]), h = M((y) => {
|
|
1449
1490
|
e(y), s("");
|
|
1450
|
-
}, [e]),
|
|
1451
|
-
y.key === "Enter" ? (y.preventDefault(),
|
|
1452
|
-
}, [
|
|
1491
|
+
}, [e]), b = M((y) => {
|
|
1492
|
+
y.key === "Enter" ? (y.preventDefault(), p()) : y.key === "Escape" && Me(c) && s("");
|
|
1493
|
+
}, [p, c]), w = M((y) => {
|
|
1453
1494
|
d == null || d(y.target.value), s(y.target.value);
|
|
1454
|
-
}, [d]),
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1495
|
+
}, [d]), k = $(null);
|
|
1496
|
+
le(() => {
|
|
1497
|
+
k.current && (k.current.style.height = "inherit", k.current.style.height = `${Math.max(
|
|
1498
|
+
k.current.scrollHeight + 2,
|
|
1458
1499
|
// account for 1px top/bottom border
|
|
1459
|
-
|
|
1500
|
+
ur
|
|
1460
1501
|
)}px`);
|
|
1461
|
-
}, [c]),
|
|
1462
|
-
|
|
1502
|
+
}, [c]), le(() => {
|
|
1503
|
+
k.current && k.current.focus({
|
|
1463
1504
|
preventScroll: !0
|
|
1464
1505
|
});
|
|
1465
1506
|
}, []);
|
|
1466
1507
|
const {
|
|
1467
|
-
themeSettings:
|
|
1508
|
+
themeSettings: x
|
|
1468
1509
|
} = f(), {
|
|
1469
|
-
t:
|
|
1470
|
-
} = _(),
|
|
1471
|
-
var
|
|
1472
|
-
if ((
|
|
1473
|
-
const
|
|
1474
|
-
var
|
|
1475
|
-
document.removeEventListener("mouseup",
|
|
1510
|
+
t: E
|
|
1511
|
+
} = _(), A = M((y) => {
|
|
1512
|
+
var R;
|
|
1513
|
+
if ((R = document.getElementById("csdk-chatbot-frame")) != null && R.contains(y.relatedTarget)) {
|
|
1514
|
+
const Z = (T) => {
|
|
1515
|
+
var G;
|
|
1516
|
+
document.removeEventListener("mouseup", Z), document.removeEventListener("keyup", Z), T.type === "mouseup" && ((G = document.getSelection()) == null ? void 0 : G.type) !== "Range" && y.target.focus({
|
|
1476
1517
|
preventScroll: !0
|
|
1477
1518
|
});
|
|
1478
1519
|
};
|
|
1479
|
-
document.addEventListener("mouseup",
|
|
1520
|
+
document.addEventListener("mouseup", Z), document.addEventListener("keyup", Z);
|
|
1480
1521
|
}
|
|
1481
1522
|
}, []);
|
|
1482
|
-
return /* @__PURE__ */ a(
|
|
1483
|
-
theme:
|
|
1484
|
-
children: [/* @__PURE__ */ a(
|
|
1523
|
+
return /* @__PURE__ */ a(dr, {
|
|
1524
|
+
theme: x,
|
|
1525
|
+
children: [/* @__PURE__ */ a(lr, {
|
|
1485
1526
|
recentPrompts: i,
|
|
1486
1527
|
suggestions: o,
|
|
1487
|
-
isLoading:
|
|
1488
|
-
onSelection:
|
|
1489
|
-
anchorEl:
|
|
1528
|
+
isLoading: n,
|
|
1529
|
+
onSelection: h,
|
|
1530
|
+
anchorEl: k.current,
|
|
1490
1531
|
text: c,
|
|
1491
|
-
recommendationsError:
|
|
1492
|
-
}), t && /* @__PURE__ */ a(
|
|
1493
|
-
title:
|
|
1532
|
+
recommendationsError: l
|
|
1533
|
+
}), t && /* @__PURE__ */ a(ae, {
|
|
1534
|
+
title: E("ai.buttons.clearChat"),
|
|
1494
1535
|
placement: "bottom-start",
|
|
1495
|
-
children: /* @__PURE__ */ a(
|
|
1536
|
+
children: /* @__PURE__ */ a(sr, {
|
|
1496
1537
|
"aria-label": "clear history",
|
|
1497
1538
|
onClick: t,
|
|
1498
|
-
children: /* @__PURE__ */ a(
|
|
1499
|
-
theme:
|
|
1539
|
+
children: /* @__PURE__ */ a(er, {
|
|
1540
|
+
theme: x
|
|
1500
1541
|
})
|
|
1501
1542
|
})
|
|
1502
|
-
}), /* @__PURE__ */ a(
|
|
1543
|
+
}), /* @__PURE__ */ a(pr, {
|
|
1503
1544
|
"aria-label": "chat input",
|
|
1504
|
-
onBlur:
|
|
1505
|
-
maxLength:
|
|
1506
|
-
ref:
|
|
1545
|
+
onBlur: A,
|
|
1546
|
+
maxLength: cr,
|
|
1547
|
+
ref: k,
|
|
1507
1548
|
rows: 1,
|
|
1508
|
-
onChange:
|
|
1549
|
+
onChange: w,
|
|
1509
1550
|
spellCheck: "true",
|
|
1510
|
-
placeholder:
|
|
1551
|
+
placeholder: u,
|
|
1511
1552
|
value: c,
|
|
1512
|
-
onKeyDown:
|
|
1513
|
-
theme:
|
|
1514
|
-
}), /* @__PURE__ */ a(
|
|
1553
|
+
onKeyDown: b,
|
|
1554
|
+
theme: x
|
|
1555
|
+
}), /* @__PURE__ */ a(gr, {
|
|
1515
1556
|
"aria-label": "send chat message",
|
|
1516
1557
|
disabled: r || c.length === 0,
|
|
1517
|
-
onClick:
|
|
1518
|
-
theme:
|
|
1558
|
+
onClick: p,
|
|
1559
|
+
theme: x,
|
|
1519
1560
|
children: /* @__PURE__ */ a("span", {
|
|
1520
1561
|
"data-state": "closed",
|
|
1521
|
-
children: /* @__PURE__ */ a(
|
|
1522
|
-
theme:
|
|
1562
|
+
children: /* @__PURE__ */ a(Ka, {
|
|
1563
|
+
theme: x
|
|
1523
1564
|
})
|
|
1524
1565
|
})
|
|
1525
1566
|
})]
|
|
1526
1567
|
});
|
|
1527
1568
|
}
|
|
1528
|
-
const
|
|
1569
|
+
const br = g.div`
|
|
1529
1570
|
display: flex;
|
|
1530
1571
|
|
|
1531
1572
|
${({
|
|
1532
1573
|
align: e
|
|
1533
|
-
}) => e === "right" ?
|
|
1574
|
+
}) => e === "right" ? S`
|
|
1534
1575
|
justify-content: flex-end;
|
|
1535
|
-
` :
|
|
1576
|
+
` : S`
|
|
1536
1577
|
justify-content: flex-start;
|
|
1537
1578
|
`}
|
|
1538
|
-
`,
|
|
1579
|
+
`, gt = g.div`
|
|
1539
1580
|
font-size: inherit;
|
|
1540
1581
|
line-height: inherit;
|
|
1541
1582
|
padding-top: 8.5px;
|
|
@@ -1548,17 +1589,17 @@ const dr = h.div`
|
|
|
1548
1589
|
|
|
1549
1590
|
${({
|
|
1550
1591
|
align: e
|
|
1551
|
-
}) => e === "right" ?
|
|
1592
|
+
}) => e === "right" ? S`
|
|
1552
1593
|
text-align: right;
|
|
1553
1594
|
border-radius: 10px 10px 0px 10px;
|
|
1554
|
-
` :
|
|
1595
|
+
` : S`
|
|
1555
1596
|
text-align: left;
|
|
1556
1597
|
border-radius: 10px 10px 10px 0px;
|
|
1557
1598
|
`}
|
|
1558
1599
|
|
|
1559
1600
|
${({
|
|
1560
1601
|
align: e
|
|
1561
|
-
}) => e !== "full" ?
|
|
1602
|
+
}) => e !== "full" ? S`
|
|
1562
1603
|
max-width: 85%;
|
|
1563
1604
|
` : ""}
|
|
1564
1605
|
|
|
@@ -1569,66 +1610,66 @@ const dr = h.div`
|
|
|
1569
1610
|
theme: e,
|
|
1570
1611
|
align: t
|
|
1571
1612
|
}) => t === "right" ? e.aiChat.userMessages.backgroundColor : e.aiChat.systemMessages.backgroundColor};
|
|
1572
|
-
`,
|
|
1613
|
+
`, U = ({
|
|
1573
1614
|
align: e,
|
|
1574
1615
|
children: t
|
|
1575
1616
|
}) => {
|
|
1576
1617
|
const {
|
|
1577
1618
|
themeSettings: r
|
|
1578
1619
|
} = f();
|
|
1579
|
-
return /* @__PURE__ */ a(
|
|
1620
|
+
return /* @__PURE__ */ a(br, {
|
|
1580
1621
|
theme: r,
|
|
1581
1622
|
align: e,
|
|
1582
|
-
children: /* @__PURE__ */ a(
|
|
1623
|
+
children: /* @__PURE__ */ a(gt, {
|
|
1583
1624
|
theme: r,
|
|
1584
1625
|
align: e,
|
|
1585
1626
|
children: t
|
|
1586
1627
|
})
|
|
1587
1628
|
});
|
|
1588
1629
|
};
|
|
1589
|
-
function
|
|
1630
|
+
function mr() {
|
|
1590
1631
|
const {
|
|
1591
1632
|
welcomeText: e
|
|
1592
|
-
} =
|
|
1593
|
-
return e === !1 ? null : /* @__PURE__ */ a(
|
|
1633
|
+
} = W();
|
|
1634
|
+
return e === !1 ? null : /* @__PURE__ */ a(U, {
|
|
1594
1635
|
align: "left",
|
|
1595
1636
|
children: e
|
|
1596
1637
|
});
|
|
1597
1638
|
}
|
|
1598
|
-
const
|
|
1639
|
+
const xr = g.div`
|
|
1599
1640
|
margin: auto;
|
|
1600
1641
|
display: flex;
|
|
1601
1642
|
flex-direction: column;
|
|
1602
1643
|
align-items: center;
|
|
1603
1644
|
row-gap: 21px;
|
|
1604
|
-
`,
|
|
1645
|
+
`, fr = g.div`
|
|
1605
1646
|
color: ${({
|
|
1606
1647
|
theme: e
|
|
1607
1648
|
}) => e.aiChat.primaryTextColor};
|
|
1608
1649
|
text-align: center;
|
|
1609
1650
|
font-weight: 600;
|
|
1610
|
-
`,
|
|
1651
|
+
`, kr = g.div`
|
|
1611
1652
|
color: rgba(54, 163, 217, 1);
|
|
1612
1653
|
cursor: pointer;
|
|
1613
1654
|
`;
|
|
1614
|
-
function
|
|
1655
|
+
function ut({
|
|
1615
1656
|
text: e,
|
|
1616
1657
|
action: t
|
|
1617
1658
|
}) {
|
|
1618
1659
|
const {
|
|
1619
1660
|
themeSettings: r
|
|
1620
1661
|
} = f();
|
|
1621
|
-
return /* @__PURE__ */ a(
|
|
1622
|
-
children: [/* @__PURE__ */ a(
|
|
1662
|
+
return /* @__PURE__ */ a(xr, {
|
|
1663
|
+
children: [/* @__PURE__ */ a(fr, {
|
|
1623
1664
|
theme: r,
|
|
1624
1665
|
children: e
|
|
1625
|
-
}), /* @__PURE__ */ a(
|
|
1666
|
+
}), /* @__PURE__ */ a($t, {}), t && /* @__PURE__ */ a(kr, {
|
|
1626
1667
|
onClick: t.onClick,
|
|
1627
1668
|
children: t.text
|
|
1628
1669
|
})]
|
|
1629
1670
|
});
|
|
1630
1671
|
}
|
|
1631
|
-
const
|
|
1672
|
+
const ne = g.div`
|
|
1632
1673
|
width: 5px;
|
|
1633
1674
|
height: 5px;
|
|
1634
1675
|
border-radius: 50%;
|
|
@@ -1657,35 +1698,35 @@ const oe = h.div`
|
|
|
1657
1698
|
}
|
|
1658
1699
|
}
|
|
1659
1700
|
`;
|
|
1660
|
-
function
|
|
1701
|
+
function Te() {
|
|
1661
1702
|
const {
|
|
1662
1703
|
themeSettings: e
|
|
1663
1704
|
} = f(), t = e.aiChat.icons.color;
|
|
1664
1705
|
return /* @__PURE__ */ a("div", {
|
|
1665
1706
|
className: "csdk-flex csdk-justify-between csdk-w-[28px] csdk-py-[14.5px]",
|
|
1666
1707
|
"aria-label": "loading dots",
|
|
1667
|
-
children: [/* @__PURE__ */ a(
|
|
1708
|
+
children: [/* @__PURE__ */ a(ne, {
|
|
1668
1709
|
color: t
|
|
1669
|
-
}), /* @__PURE__ */ a(
|
|
1710
|
+
}), /* @__PURE__ */ a(ne, {
|
|
1670
1711
|
color: t
|
|
1671
|
-
}), /* @__PURE__ */ a(
|
|
1712
|
+
}), /* @__PURE__ */ a(ne, {
|
|
1672
1713
|
color: t
|
|
1673
|
-
}), /* @__PURE__ */ a(
|
|
1714
|
+
}), /* @__PURE__ */ a(ne, {
|
|
1674
1715
|
color: t
|
|
1675
1716
|
})]
|
|
1676
1717
|
});
|
|
1677
1718
|
}
|
|
1678
|
-
const
|
|
1719
|
+
const wr = g.div`
|
|
1679
1720
|
display: flex;
|
|
1680
1721
|
|
|
1681
1722
|
${({
|
|
1682
1723
|
align: e
|
|
1683
|
-
}) => e === "right" ?
|
|
1724
|
+
}) => e === "right" ? S`
|
|
1684
1725
|
justify-content: flex-end;
|
|
1685
|
-
` :
|
|
1726
|
+
` : S`
|
|
1686
1727
|
justify-content: flex-start;
|
|
1687
1728
|
`}
|
|
1688
|
-
`,
|
|
1729
|
+
`, _r = g.button`
|
|
1689
1730
|
font-family: inherit;
|
|
1690
1731
|
font-size: inherit;
|
|
1691
1732
|
line-height: inherit;
|
|
@@ -1713,15 +1754,15 @@ const ur = h.div`
|
|
|
1713
1754
|
|
|
1714
1755
|
${({
|
|
1715
1756
|
align: e
|
|
1716
|
-
}) => e === "right" ?
|
|
1757
|
+
}) => e === "right" ? S`
|
|
1717
1758
|
text-align: right;
|
|
1718
|
-
` :
|
|
1759
|
+
` : S`
|
|
1719
1760
|
text-align: left;
|
|
1720
1761
|
`}
|
|
1721
1762
|
|
|
1722
1763
|
${({
|
|
1723
1764
|
align: e
|
|
1724
|
-
}) => e !== "full" ?
|
|
1765
|
+
}) => e !== "full" ? S`
|
|
1725
1766
|
max-width: 382px;
|
|
1726
1767
|
` : ""}
|
|
1727
1768
|
|
|
@@ -1734,7 +1775,7 @@ const ur = h.div`
|
|
|
1734
1775
|
} = e.aiChat.suggestions;
|
|
1735
1776
|
if (t) {
|
|
1736
1777
|
const [i, o] = t;
|
|
1737
|
-
return
|
|
1778
|
+
return S`
|
|
1738
1779
|
border: none;
|
|
1739
1780
|
position: relative;
|
|
1740
1781
|
border-radius: ${r};
|
|
@@ -1757,22 +1798,22 @@ const ur = h.div`
|
|
|
1757
1798
|
return "";
|
|
1758
1799
|
}}
|
|
1759
1800
|
`;
|
|
1760
|
-
function
|
|
1801
|
+
function se({
|
|
1761
1802
|
children: e,
|
|
1762
1803
|
align: t,
|
|
1763
1804
|
onClick: r,
|
|
1764
1805
|
onMouseEnter: i,
|
|
1765
1806
|
onMouseLeave: o,
|
|
1766
|
-
accessibleName:
|
|
1807
|
+
accessibleName: n
|
|
1767
1808
|
}) {
|
|
1768
1809
|
const {
|
|
1769
|
-
themeSettings:
|
|
1810
|
+
themeSettings: l
|
|
1770
1811
|
} = f();
|
|
1771
|
-
return /* @__PURE__ */ a(
|
|
1812
|
+
return /* @__PURE__ */ a(wr, {
|
|
1772
1813
|
align: t,
|
|
1773
|
-
children: /* @__PURE__ */ a(
|
|
1774
|
-
"aria-label":
|
|
1775
|
-
theme:
|
|
1814
|
+
children: /* @__PURE__ */ a(_r, {
|
|
1815
|
+
"aria-label": n,
|
|
1816
|
+
theme: l,
|
|
1776
1817
|
onClick: r,
|
|
1777
1818
|
align: t,
|
|
1778
1819
|
onMouseEnter: i,
|
|
@@ -1781,20 +1822,20 @@ function de({
|
|
|
1781
1822
|
})
|
|
1782
1823
|
});
|
|
1783
1824
|
}
|
|
1784
|
-
function
|
|
1825
|
+
function Cr({
|
|
1785
1826
|
onCancel: e,
|
|
1786
1827
|
onConfirm: t
|
|
1787
1828
|
}) {
|
|
1788
1829
|
const {
|
|
1789
1830
|
t: r
|
|
1790
1831
|
} = _();
|
|
1791
|
-
return /* @__PURE__ */ a(
|
|
1792
|
-
children: [/* @__PURE__ */ a(
|
|
1832
|
+
return /* @__PURE__ */ a(N, {
|
|
1833
|
+
children: [/* @__PURE__ */ a(U, {
|
|
1793
1834
|
align: "left",
|
|
1794
1835
|
children: r("ai.clearHistoryPrompt")
|
|
1795
1836
|
}), /* @__PURE__ */ a("div", {
|
|
1796
1837
|
className: "csdk-flex csdk-gap-x-2",
|
|
1797
|
-
children: [/* @__PURE__ */ a(
|
|
1838
|
+
children: [/* @__PURE__ */ a(se, {
|
|
1798
1839
|
align: "right",
|
|
1799
1840
|
onClick: t,
|
|
1800
1841
|
accessibleName: "confirm clear chat",
|
|
@@ -1802,7 +1843,7 @@ function mr({
|
|
|
1802
1843
|
className: "csdk-py-[6px] csdk-px-[20px]",
|
|
1803
1844
|
children: r("ai.buttons.yes")
|
|
1804
1845
|
})
|
|
1805
|
-
}), /* @__PURE__ */ a(
|
|
1846
|
+
}), /* @__PURE__ */ a(se, {
|
|
1806
1847
|
align: "right",
|
|
1807
1848
|
onClick: e,
|
|
1808
1849
|
accessibleName: "cancel clear chat",
|
|
@@ -1814,7 +1855,7 @@ function mr({
|
|
|
1814
1855
|
})]
|
|
1815
1856
|
});
|
|
1816
1857
|
}
|
|
1817
|
-
function
|
|
1858
|
+
function yr({
|
|
1818
1859
|
fillColor: e = "#262E3D"
|
|
1819
1860
|
}) {
|
|
1820
1861
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -1838,7 +1879,7 @@ function xr({
|
|
|
1838
1879
|
})]
|
|
1839
1880
|
});
|
|
1840
1881
|
}
|
|
1841
|
-
const
|
|
1882
|
+
const ht = {
|
|
1842
1883
|
row: {
|
|
1843
1884
|
hover: "rgba(224, 224, 224, 0.3)"
|
|
1844
1885
|
},
|
|
@@ -1923,17 +1964,17 @@ const gt = {
|
|
|
1923
1964
|
errorBG: "rgba(231, 71, 39, 0.1)"
|
|
1924
1965
|
}
|
|
1925
1966
|
}
|
|
1926
|
-
},
|
|
1967
|
+
}, vr = {
|
|
1927
1968
|
shouldForwardProp: (e) => !e.startsWith("$")
|
|
1928
|
-
},
|
|
1969
|
+
}, re = g($e, vr)(({
|
|
1929
1970
|
$hoverColor: e
|
|
1930
1971
|
}) => ({
|
|
1931
1972
|
padding: 2,
|
|
1932
1973
|
"&.MuiIconButton-root:hover": {
|
|
1933
|
-
backgroundColor: e ??
|
|
1974
|
+
backgroundColor: e ?? ht.interaction.defaultHover
|
|
1934
1975
|
}
|
|
1935
1976
|
}));
|
|
1936
|
-
function
|
|
1977
|
+
function Mr({
|
|
1937
1978
|
fill: e = "rgba(38, 46, 61, 0.67)"
|
|
1938
1979
|
}) {
|
|
1939
1980
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -1950,7 +1991,7 @@ function kr({
|
|
|
1950
1991
|
})
|
|
1951
1992
|
});
|
|
1952
1993
|
}
|
|
1953
|
-
function
|
|
1994
|
+
function Ir({
|
|
1954
1995
|
fill: e = "rgba(38, 46, 61, 0.67)"
|
|
1955
1996
|
}) {
|
|
1956
1997
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -1967,7 +2008,7 @@ function wr({
|
|
|
1967
2008
|
})
|
|
1968
2009
|
});
|
|
1969
2010
|
}
|
|
1970
|
-
function
|
|
2011
|
+
function Dr() {
|
|
1971
2012
|
return /* @__PURE__ */ a("svg", {
|
|
1972
2013
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1973
2014
|
width: "24",
|
|
@@ -1983,7 +2024,7 @@ function _r() {
|
|
|
1983
2024
|
})
|
|
1984
2025
|
});
|
|
1985
2026
|
}
|
|
1986
|
-
function
|
|
2027
|
+
function Ar({
|
|
1987
2028
|
fill: e = "rgba(38, 46, 61, 0.67)"
|
|
1988
2029
|
}) {
|
|
1989
2030
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -2000,41 +2041,41 @@ function Cr({
|
|
|
2000
2041
|
})
|
|
2001
2042
|
});
|
|
2002
2043
|
}
|
|
2003
|
-
const
|
|
2044
|
+
const je = (e) => Fe(e.chart.backgroundColor), Sr = ({
|
|
2004
2045
|
title: e
|
|
2005
2046
|
}) => {
|
|
2006
2047
|
const {
|
|
2007
2048
|
themeSettings: t
|
|
2008
2049
|
} = f();
|
|
2009
|
-
return /* @__PURE__ */ a(
|
|
2050
|
+
return /* @__PURE__ */ a(ae, {
|
|
2010
2051
|
title: e,
|
|
2011
|
-
children: /* @__PURE__ */ a(
|
|
2052
|
+
children: /* @__PURE__ */ a(re, {
|
|
2012
2053
|
disableTouchRipple: !0,
|
|
2013
|
-
$hoverColor:
|
|
2014
|
-
children: /* @__PURE__ */ a(
|
|
2054
|
+
$hoverColor: je(t),
|
|
2055
|
+
children: /* @__PURE__ */ a(Ir, {
|
|
2015
2056
|
fill: t.chart.textColor
|
|
2016
2057
|
})
|
|
2017
2058
|
})
|
|
2018
2059
|
});
|
|
2019
|
-
},
|
|
2060
|
+
}, Lr = ({
|
|
2020
2061
|
items: e
|
|
2021
2062
|
}) => {
|
|
2022
|
-
const [t, r] =
|
|
2023
|
-
r(
|
|
2063
|
+
const [t, r] = I(null), i = (l) => {
|
|
2064
|
+
r(l.currentTarget);
|
|
2024
2065
|
}, o = () => {
|
|
2025
2066
|
r(null);
|
|
2026
2067
|
}, {
|
|
2027
|
-
themeSettings:
|
|
2068
|
+
themeSettings: n
|
|
2028
2069
|
} = f();
|
|
2029
|
-
return /* @__PURE__ */ a(
|
|
2030
|
-
children: [/* @__PURE__ */ a(
|
|
2070
|
+
return /* @__PURE__ */ a(N, {
|
|
2071
|
+
children: [/* @__PURE__ */ a(re, {
|
|
2031
2072
|
onClick: i,
|
|
2032
|
-
$hoverColor:
|
|
2073
|
+
$hoverColor: je(n),
|
|
2033
2074
|
"aria-label": "three dots button",
|
|
2034
|
-
children: /* @__PURE__ */ a(
|
|
2035
|
-
fill:
|
|
2075
|
+
children: /* @__PURE__ */ a(Ar, {
|
|
2076
|
+
fill: n.chart.textColor
|
|
2036
2077
|
})
|
|
2037
|
-
}), /* @__PURE__ */ a(
|
|
2078
|
+
}), /* @__PURE__ */ a(oa, {
|
|
2038
2079
|
anchorEl: t,
|
|
2039
2080
|
anchorOrigin: {
|
|
2040
2081
|
vertical: "bottom",
|
|
@@ -2046,24 +2087,24 @@ const Ae = (e) => Ue(e.chart.backgroundColor), yr = ({
|
|
|
2046
2087
|
},
|
|
2047
2088
|
open: !!t,
|
|
2048
2089
|
onClose: o,
|
|
2049
|
-
children: e.map((
|
|
2090
|
+
children: e.map((l) => /* @__PURE__ */ a(na, {
|
|
2050
2091
|
onClick: () => {
|
|
2051
|
-
|
|
2092
|
+
l.onClick(), o();
|
|
2052
2093
|
},
|
|
2053
2094
|
sx: {
|
|
2054
2095
|
fontSize: "13px",
|
|
2055
|
-
fontFamily:
|
|
2056
|
-
color:
|
|
2096
|
+
fontFamily: n.typography.fontFamily,
|
|
2097
|
+
color: ht.text.content
|
|
2057
2098
|
},
|
|
2058
2099
|
disableRipple: !0,
|
|
2059
|
-
children: [
|
|
2100
|
+
children: [l.icon, /* @__PURE__ */ a("div", {
|
|
2060
2101
|
className: "csdk-ml-1",
|
|
2061
|
-
children:
|
|
2102
|
+
children: l.title
|
|
2062
2103
|
})]
|
|
2063
|
-
},
|
|
2104
|
+
}, l.title))
|
|
2064
2105
|
})]
|
|
2065
2106
|
});
|
|
2066
|
-
},
|
|
2107
|
+
}, Nr = ({
|
|
2067
2108
|
onClick: e
|
|
2068
2109
|
}) => {
|
|
2069
2110
|
const {
|
|
@@ -2071,22 +2112,22 @@ const Ae = (e) => Ue(e.chart.backgroundColor), yr = ({
|
|
|
2071
2112
|
} = f(), {
|
|
2072
2113
|
t: r
|
|
2073
2114
|
} = _();
|
|
2074
|
-
return /* @__PURE__ */ a(
|
|
2115
|
+
return /* @__PURE__ */ a(ae, {
|
|
2075
2116
|
title: r("ai.preview"),
|
|
2076
|
-
children: /* @__PURE__ */ a(
|
|
2117
|
+
children: /* @__PURE__ */ a(re, {
|
|
2077
2118
|
onClick: e,
|
|
2078
|
-
$hoverColor:
|
|
2079
|
-
children: /* @__PURE__ */ a(
|
|
2119
|
+
$hoverColor: je(t),
|
|
2120
|
+
children: /* @__PURE__ */ a(Mr, {
|
|
2080
2121
|
fill: t.chart.textColor
|
|
2081
2122
|
})
|
|
2082
2123
|
})
|
|
2083
2124
|
});
|
|
2084
|
-
},
|
|
2125
|
+
}, Tr = g.div`
|
|
2085
2126
|
display: flex;
|
|
2086
2127
|
padding-top: 6px;
|
|
2087
2128
|
padding-bottom: 6px;
|
|
2088
2129
|
`;
|
|
2089
|
-
function
|
|
2130
|
+
function jr({
|
|
2090
2131
|
infoTooltipText: e,
|
|
2091
2132
|
onRefresh: t,
|
|
2092
2133
|
onExpand: r
|
|
@@ -2094,55 +2135,55 @@ function Ir({
|
|
|
2094
2135
|
const i = z(() => [{
|
|
2095
2136
|
title: "Refresh",
|
|
2096
2137
|
onClick: t,
|
|
2097
|
-
icon: /* @__PURE__ */ a(
|
|
2138
|
+
icon: /* @__PURE__ */ a(Dr, {})
|
|
2098
2139
|
}], [t]);
|
|
2099
|
-
return /* @__PURE__ */ a(
|
|
2140
|
+
return /* @__PURE__ */ a(Tr, {
|
|
2100
2141
|
"aria-label": "chatbot chart toolbar",
|
|
2101
|
-
children: [/* @__PURE__ */ a(
|
|
2142
|
+
children: [/* @__PURE__ */ a(Sr, {
|
|
2102
2143
|
title: e ?? ""
|
|
2103
|
-
}), /* @__PURE__ */ a(
|
|
2144
|
+
}), /* @__PURE__ */ a(Lr, {
|
|
2104
2145
|
items: i
|
|
2105
|
-
}), /* @__PURE__ */ a(
|
|
2146
|
+
}), /* @__PURE__ */ a(Nr, {
|
|
2106
2147
|
onClick: r
|
|
2107
2148
|
})]
|
|
2108
2149
|
});
|
|
2109
2150
|
}
|
|
2110
|
-
function
|
|
2151
|
+
function zr({
|
|
2111
2152
|
content: e
|
|
2112
2153
|
}) {
|
|
2113
|
-
const [t, r] =
|
|
2154
|
+
const [t, r] = I(!1), {
|
|
2114
2155
|
themeSettings: i
|
|
2115
2156
|
} = f(), {
|
|
2116
2157
|
inlineElement: o,
|
|
2117
|
-
expandedElement:
|
|
2158
|
+
expandedElement: n
|
|
2118
2159
|
} = z(() => {
|
|
2119
|
-
const
|
|
2160
|
+
const l = ue(e, {
|
|
2120
2161
|
useCustomizedStyleOptions: !0
|
|
2121
2162
|
});
|
|
2122
|
-
if (
|
|
2123
|
-
throw new
|
|
2163
|
+
if (l === void 0 || !ye(l))
|
|
2164
|
+
throw new Ce("errors.otherWidgetTypesNotSupported");
|
|
2124
2165
|
const {
|
|
2125
2166
|
detailedDescription: d
|
|
2126
2167
|
} = e, {
|
|
2127
2168
|
styleOptions: c
|
|
2128
|
-
} =
|
|
2169
|
+
} = l, s = {
|
|
2129
2170
|
cornerRadius: "Small",
|
|
2130
2171
|
header: {
|
|
2131
|
-
renderToolbar: (
|
|
2172
|
+
renderToolbar: (h) => /* @__PURE__ */ a(jr, {
|
|
2132
2173
|
infoTooltipText: d,
|
|
2133
|
-
onRefresh:
|
|
2174
|
+
onRefresh: h,
|
|
2134
2175
|
onExpand: () => r(!0)
|
|
2135
2176
|
})
|
|
2136
2177
|
}
|
|
2137
2178
|
};
|
|
2138
|
-
let
|
|
2139
|
-
if (
|
|
2140
|
-
|
|
2179
|
+
let u, p;
|
|
2180
|
+
if (ea(l.chartType))
|
|
2181
|
+
u = /* @__PURE__ */ a("div", {
|
|
2141
2182
|
className: "csdk-h-[245px]",
|
|
2142
|
-
children: /* @__PURE__ */ a(K,
|
|
2183
|
+
children: /* @__PURE__ */ a(K, v(C({}, l), {
|
|
2143
2184
|
styleOptions: s
|
|
2144
2185
|
}))
|
|
2145
|
-
}),
|
|
2186
|
+
}), p = /* @__PURE__ */ a(K, v(C({}, l), {
|
|
2146
2187
|
styleOptions: {
|
|
2147
2188
|
header: {
|
|
2148
2189
|
hidden: !0
|
|
@@ -2150,32 +2191,32 @@ function Ar({
|
|
|
2150
2191
|
}
|
|
2151
2192
|
}));
|
|
2152
2193
|
else {
|
|
2153
|
-
const
|
|
2194
|
+
const h = v(C({}, c), {
|
|
2154
2195
|
header: {
|
|
2155
2196
|
hidden: !0
|
|
2156
2197
|
}
|
|
2157
|
-
}),
|
|
2198
|
+
}), b = C(v(C({}, c), {
|
|
2158
2199
|
legend: void 0,
|
|
2159
2200
|
xAxis: void 0,
|
|
2160
2201
|
yAxis: void 0
|
|
2161
2202
|
}), s);
|
|
2162
|
-
delete
|
|
2163
|
-
children: /* @__PURE__ */ a(K,
|
|
2164
|
-
styleOptions:
|
|
2203
|
+
delete b.legend, delete b.xAxis, delete b.yAxis, u = /* @__PURE__ */ a("div", {
|
|
2204
|
+
children: /* @__PURE__ */ a(K, v(C({}, l), {
|
|
2205
|
+
styleOptions: b
|
|
2165
2206
|
}))
|
|
2166
|
-
}),
|
|
2167
|
-
styleOptions:
|
|
2207
|
+
}), p = /* @__PURE__ */ a(K, v(C({}, l), {
|
|
2208
|
+
styleOptions: C({
|
|
2168
2209
|
cornerRadius: "None"
|
|
2169
|
-
},
|
|
2210
|
+
}, h)
|
|
2170
2211
|
}));
|
|
2171
2212
|
}
|
|
2172
2213
|
return {
|
|
2173
|
-
inlineElement:
|
|
2174
|
-
expandedElement:
|
|
2214
|
+
inlineElement: u,
|
|
2215
|
+
expandedElement: p
|
|
2175
2216
|
};
|
|
2176
2217
|
}, [e]);
|
|
2177
|
-
return /* @__PURE__ */ a(
|
|
2178
|
-
children: [o, /* @__PURE__ */ a(
|
|
2218
|
+
return /* @__PURE__ */ a(N, {
|
|
2219
|
+
children: [o, /* @__PURE__ */ a(at, {
|
|
2179
2220
|
open: t,
|
|
2180
2221
|
onClose: () => r(!1),
|
|
2181
2222
|
maxWidth: "xl",
|
|
@@ -2191,21 +2232,21 @@ function Ar({
|
|
|
2191
2232
|
children: [/* @__PURE__ */ a("div", {
|
|
2192
2233
|
className: "csdk-text-ai-lg csdk-semibold",
|
|
2193
2234
|
children: e.queryTitle
|
|
2194
|
-
}), /* @__PURE__ */ a(
|
|
2235
|
+
}), /* @__PURE__ */ a($e, {
|
|
2195
2236
|
onClick: () => r(!1),
|
|
2196
2237
|
"aria-label": "close expanded chart",
|
|
2197
|
-
children: /* @__PURE__ */ a(
|
|
2238
|
+
children: /* @__PURE__ */ a(yr, {
|
|
2198
2239
|
fillColor: i.aiChat.primaryTextColor
|
|
2199
2240
|
})
|
|
2200
2241
|
})]
|
|
2201
2242
|
}), /* @__PURE__ */ a("div", {
|
|
2202
2243
|
className: "csdk-h-screen csdk-mt-[8px] csdk-mb-[24px] csdk-mx-[16px]",
|
|
2203
|
-
children:
|
|
2244
|
+
children: n
|
|
2204
2245
|
})]
|
|
2205
2246
|
})]
|
|
2206
2247
|
});
|
|
2207
2248
|
}
|
|
2208
|
-
function
|
|
2249
|
+
function Er({
|
|
2209
2250
|
theme: e
|
|
2210
2251
|
}) {
|
|
2211
2252
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -2222,7 +2263,7 @@ function Sr({
|
|
|
2222
2263
|
})
|
|
2223
2264
|
});
|
|
2224
2265
|
}
|
|
2225
|
-
function
|
|
2266
|
+
function Zr({
|
|
2226
2267
|
onClick: e,
|
|
2227
2268
|
disabled: t
|
|
2228
2269
|
}) {
|
|
@@ -2231,20 +2272,20 @@ function Lr({
|
|
|
2231
2272
|
} = f(), {
|
|
2232
2273
|
t: i
|
|
2233
2274
|
} = _();
|
|
2234
|
-
return /* @__PURE__ */ a(
|
|
2275
|
+
return /* @__PURE__ */ a(ae, {
|
|
2235
2276
|
title: i("ai.buttons.incorrectResponse"),
|
|
2236
|
-
children: /* @__PURE__ */ a(
|
|
2277
|
+
children: /* @__PURE__ */ a(re, {
|
|
2237
2278
|
"aria-label": "thumbs-down",
|
|
2238
2279
|
onClick: e,
|
|
2239
2280
|
$hoverColor: r.aiChat.icons.feedbackIcons.hoverColor,
|
|
2240
2281
|
disabled: t,
|
|
2241
|
-
children: /* @__PURE__ */ a(
|
|
2282
|
+
children: /* @__PURE__ */ a(Er, {
|
|
2242
2283
|
theme: r
|
|
2243
2284
|
})
|
|
2244
2285
|
})
|
|
2245
2286
|
});
|
|
2246
2287
|
}
|
|
2247
|
-
function
|
|
2288
|
+
function Or({
|
|
2248
2289
|
theme: e
|
|
2249
2290
|
}) {
|
|
2250
2291
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -2261,7 +2302,7 @@ function Nr({
|
|
|
2261
2302
|
})
|
|
2262
2303
|
});
|
|
2263
2304
|
}
|
|
2264
|
-
function
|
|
2305
|
+
function Rr({
|
|
2265
2306
|
onClick: e,
|
|
2266
2307
|
disabled: t
|
|
2267
2308
|
}) {
|
|
@@ -2270,92 +2311,92 @@ function jr({
|
|
|
2270
2311
|
} = f(), {
|
|
2271
2312
|
t: i
|
|
2272
2313
|
} = _();
|
|
2273
|
-
return /* @__PURE__ */ a(
|
|
2314
|
+
return /* @__PURE__ */ a(ae, {
|
|
2274
2315
|
title: i("ai.buttons.correctResponse"),
|
|
2275
|
-
children: /* @__PURE__ */ a(
|
|
2316
|
+
children: /* @__PURE__ */ a(re, {
|
|
2276
2317
|
"aria-label": "thumbs-up",
|
|
2277
2318
|
onClick: e,
|
|
2278
2319
|
$hoverColor: r.aiChat.icons.feedbackIcons.hoverColor,
|
|
2279
2320
|
disabled: t,
|
|
2280
|
-
children: /* @__PURE__ */ a(
|
|
2321
|
+
children: /* @__PURE__ */ a(Or, {
|
|
2281
2322
|
theme: r
|
|
2282
2323
|
})
|
|
2283
2324
|
})
|
|
2284
2325
|
});
|
|
2285
2326
|
}
|
|
2286
|
-
const
|
|
2287
|
-
const [e, t] =
|
|
2327
|
+
const Wr = () => {
|
|
2328
|
+
const [e, t] = I(!1), r = $(null), i = M(() => {
|
|
2288
2329
|
t(!0);
|
|
2289
|
-
}, []), o =
|
|
2330
|
+
}, []), o = M(() => {
|
|
2290
2331
|
t(!1);
|
|
2291
2332
|
}, []);
|
|
2292
|
-
return [
|
|
2293
|
-
var
|
|
2294
|
-
((
|
|
2333
|
+
return [M((n) => {
|
|
2334
|
+
var l;
|
|
2335
|
+
((l = r.current) == null ? void 0 : l.nodeType) === Node.ELEMENT_NODE && (r.current.removeEventListener("mouseenter", i), r.current.removeEventListener("mouseleave", o)), (n == null ? void 0 : n.nodeType) === Node.ELEMENT_NODE && (n.addEventListener("mouseenter", i), n.addEventListener("mouseleave", o)), r.current = n;
|
|
2295
2336
|
}, [i, o]), e];
|
|
2296
|
-
},
|
|
2337
|
+
}, Gr = g.div`
|
|
2297
2338
|
display: flex;
|
|
2298
2339
|
flex-direction: column;
|
|
2299
2340
|
row-gap: ${({
|
|
2300
2341
|
theme: e
|
|
2301
2342
|
}) => e.aiChat.body.gapBetweenMessages};
|
|
2302
2343
|
`;
|
|
2303
|
-
function
|
|
2344
|
+
function qr({
|
|
2304
2345
|
visible: e,
|
|
2305
2346
|
onSend: t
|
|
2306
2347
|
}) {
|
|
2307
|
-
const [r, i] =
|
|
2308
|
-
i(!0), t(
|
|
2348
|
+
const [r, i] = I(!1), o = M((l) => {
|
|
2349
|
+
i(!0), t(l === "up" ? 1 : -1);
|
|
2309
2350
|
}, [t]);
|
|
2310
2351
|
return e ? /* @__PURE__ */ a("div", {
|
|
2311
2352
|
className: `csdk-flex csdk-items-center ${`csdk-transition-opacity csdk-delay-150 csdk-duration-500 ${r ? "csdk-opacity-0" : "csdk-opacity-100"}`}`,
|
|
2312
|
-
children: [/* @__PURE__ */ a(
|
|
2353
|
+
children: [/* @__PURE__ */ a(Rr, {
|
|
2313
2354
|
onClick: () => o("up"),
|
|
2314
2355
|
disabled: r
|
|
2315
|
-
}), /* @__PURE__ */ a(
|
|
2356
|
+
}), /* @__PURE__ */ a(Zr, {
|
|
2316
2357
|
onClick: () => o("down"),
|
|
2317
2358
|
disabled: r
|
|
2318
2359
|
})]
|
|
2319
2360
|
}) : null;
|
|
2320
2361
|
}
|
|
2321
|
-
function
|
|
2362
|
+
function Ie({
|
|
2322
2363
|
sourceId: e,
|
|
2323
2364
|
data: t,
|
|
2324
2365
|
type: r,
|
|
2325
2366
|
buttonVisibility: i = "onHover",
|
|
2326
2367
|
renderContent: o
|
|
2327
2368
|
}) {
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2369
|
+
const n = O(), l = ta(M((p) => {
|
|
2370
|
+
n && n.ai.sendFeedback({
|
|
2330
2371
|
sourceId: e,
|
|
2331
2372
|
type: r,
|
|
2332
2373
|
data: t,
|
|
2333
|
-
rating:
|
|
2374
|
+
rating: p
|
|
2334
2375
|
});
|
|
2335
|
-
}, [
|
|
2336
|
-
themeSettings:
|
|
2376
|
+
}, [n, e, t, r]), 200), [d, c] = Wr(), s = z(() => i === "onHover" ? c : i !== "never", [c, i]), {
|
|
2377
|
+
themeSettings: u
|
|
2337
2378
|
} = f();
|
|
2338
|
-
return /* @__PURE__ */ a(
|
|
2379
|
+
return /* @__PURE__ */ a(Gr, {
|
|
2339
2380
|
ref: d,
|
|
2340
|
-
theme:
|
|
2341
|
-
children: o(/* @__PURE__ */ a(
|
|
2342
|
-
onSend:
|
|
2381
|
+
theme: u,
|
|
2382
|
+
children: o(/* @__PURE__ */ a(qr, {
|
|
2383
|
+
onSend: l,
|
|
2343
2384
|
visible: s
|
|
2344
2385
|
}))
|
|
2345
2386
|
});
|
|
2346
2387
|
}
|
|
2347
|
-
const
|
|
2348
|
-
function
|
|
2388
|
+
const Yr = 18 * 5;
|
|
2389
|
+
function be({
|
|
2349
2390
|
text: e
|
|
2350
2391
|
}) {
|
|
2351
|
-
const [t, r] =
|
|
2352
|
-
t:
|
|
2353
|
-
} = _(),
|
|
2354
|
-
return
|
|
2355
|
-
|
|
2392
|
+
const [t, r] = I(!0), [i, o] = I(!1), {
|
|
2393
|
+
t: n
|
|
2394
|
+
} = _(), l = $(null);
|
|
2395
|
+
return le(() => {
|
|
2396
|
+
l.current && l.current.scrollHeight > Yr && o(!0);
|
|
2356
2397
|
}, [e]), /* @__PURE__ */ a("div", {
|
|
2357
2398
|
children: [/* @__PURE__ */ a("div", {
|
|
2358
|
-
ref:
|
|
2399
|
+
ref: l,
|
|
2359
2400
|
className: `${t ? "csdk-line-clamp-5" : ""} csdk-whitespace-pre-wrap`,
|
|
2360
2401
|
children: e
|
|
2361
2402
|
}), i && /* @__PURE__ */ a("div", {
|
|
@@ -2363,32 +2404,32 @@ function Se({
|
|
|
2363
2404
|
children: /* @__PURE__ */ a("div", {
|
|
2364
2405
|
className: "csdk-text-ai-xs csdk-text-text-link csdk-cursor-pointer",
|
|
2365
2406
|
onClick: () => r((d) => !d),
|
|
2366
|
-
children:
|
|
2407
|
+
children: n(t ? "ai.buttons.readMore" : "ai.buttons.collapse")
|
|
2367
2408
|
})
|
|
2368
2409
|
})]
|
|
2369
2410
|
});
|
|
2370
2411
|
}
|
|
2371
|
-
function
|
|
2412
|
+
function Hr({
|
|
2372
2413
|
nlgRequest: e
|
|
2373
2414
|
}) {
|
|
2374
2415
|
const {
|
|
2375
2416
|
data: t,
|
|
2376
2417
|
isLoading: r,
|
|
2377
2418
|
isError: i
|
|
2378
|
-
} =
|
|
2419
|
+
} = te(e), {
|
|
2379
2420
|
t: o
|
|
2380
2421
|
} = _();
|
|
2381
|
-
return r ? /* @__PURE__ */ a(
|
|
2422
|
+
return r ? /* @__PURE__ */ a(Te, {}) : i ? /* @__PURE__ */ a(U, {
|
|
2382
2423
|
align: "left",
|
|
2383
2424
|
children: o("ai.errors.unexpected")
|
|
2384
|
-
}) : /* @__PURE__ */ a(
|
|
2425
|
+
}) : /* @__PURE__ */ a(U, {
|
|
2385
2426
|
align: "full",
|
|
2386
|
-
children: /* @__PURE__ */ a(
|
|
2427
|
+
children: /* @__PURE__ */ a(be, {
|
|
2387
2428
|
text: t ?? o("ai.errors.insightsNotAvailable")
|
|
2388
2429
|
})
|
|
2389
2430
|
});
|
|
2390
2431
|
}
|
|
2391
|
-
function
|
|
2432
|
+
function Ur() {
|
|
2392
2433
|
const {
|
|
2393
2434
|
themeSettings: e
|
|
2394
2435
|
} = f();
|
|
@@ -2406,129 +2447,129 @@ function Or() {
|
|
|
2406
2447
|
})
|
|
2407
2448
|
});
|
|
2408
2449
|
}
|
|
2409
|
-
function
|
|
2450
|
+
function Br({
|
|
2410
2451
|
onClick: e
|
|
2411
2452
|
}) {
|
|
2412
2453
|
const {
|
|
2413
2454
|
t
|
|
2414
2455
|
} = _();
|
|
2415
|
-
return /* @__PURE__ */ a(
|
|
2456
|
+
return /* @__PURE__ */ a(se, {
|
|
2416
2457
|
align: "left",
|
|
2417
2458
|
onClick: e,
|
|
2418
2459
|
children: /* @__PURE__ */ a("div", {
|
|
2419
2460
|
className: "csdk-py-[5px] csdk-px-2 csdk-flex csdk-items-center csdk-gap-x-1 csdk-select-none",
|
|
2420
|
-
children: [/* @__PURE__ */ a(
|
|
2461
|
+
children: [/* @__PURE__ */ a(Ur, {}), t("ai.buttons.insights")]
|
|
2421
2462
|
})
|
|
2422
2463
|
});
|
|
2423
2464
|
}
|
|
2424
|
-
const
|
|
2465
|
+
const He = g.div`
|
|
2425
2466
|
display: flex;
|
|
2426
2467
|
align-items: center;
|
|
2427
2468
|
column-gap: 10px;
|
|
2428
|
-
`,
|
|
2429
|
-
function
|
|
2469
|
+
`, $r = (e) => !!e && "aeiou".includes(e[0]);
|
|
2470
|
+
function Pr({
|
|
2430
2471
|
data: e,
|
|
2431
2472
|
alwaysShowFeedback: t
|
|
2432
2473
|
}) {
|
|
2433
2474
|
const {
|
|
2434
2475
|
chatMode: r = "analyze",
|
|
2435
2476
|
enableInsights: i
|
|
2436
|
-
} =
|
|
2477
|
+
} = W(), {
|
|
2437
2478
|
themeSettings: o
|
|
2438
2479
|
} = f(), {
|
|
2439
|
-
queryTitle:
|
|
2440
|
-
chartRecommendations:
|
|
2480
|
+
queryTitle: n,
|
|
2481
|
+
chartRecommendations: l,
|
|
2441
2482
|
jaql: d
|
|
2442
2483
|
} = e;
|
|
2443
|
-
console.debug(`JAQL for ${
|
|
2444
|
-
const c = "chartType" in
|
|
2484
|
+
console.debug(`JAQL for ${n}`, d), console.debug(`chart recommendations for ${n}`, l);
|
|
2485
|
+
const c = "chartType" in l ? l.chartType : "table";
|
|
2445
2486
|
let s;
|
|
2446
|
-
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2449
|
-
}, []),
|
|
2487
|
+
$r(c) ? s = `an ${c}` : s = `a ${c}`, c !== "table" && (s += " chart");
|
|
2488
|
+
const u = d.datasource.title, [p, h] = I(!1), b = M(() => {
|
|
2489
|
+
h((x) => !x);
|
|
2490
|
+
}, []), w = {
|
|
2450
2491
|
jaql: {
|
|
2451
2492
|
datasource: d.datasource,
|
|
2452
2493
|
metadata: d.metadata
|
|
2453
2494
|
}
|
|
2454
|
-
},
|
|
2455
|
-
return /* @__PURE__ */ a(
|
|
2456
|
-
children: [/* @__PURE__ */ a(
|
|
2457
|
-
sourceId:
|
|
2495
|
+
}, k = r === "analyze";
|
|
2496
|
+
return /* @__PURE__ */ a(N, {
|
|
2497
|
+
children: [/* @__PURE__ */ a(Ie, {
|
|
2498
|
+
sourceId: u,
|
|
2458
2499
|
data: e,
|
|
2459
2500
|
type: "chats/nlq",
|
|
2460
2501
|
buttonVisibility: t ? "always" : "onHover",
|
|
2461
|
-
renderContent: (
|
|
2462
|
-
children: [/* @__PURE__ */ a(
|
|
2463
|
-
children: [/* @__PURE__ */ a(
|
|
2502
|
+
renderContent: (x) => /* @__PURE__ */ a(N, {
|
|
2503
|
+
children: [/* @__PURE__ */ a(He, {
|
|
2504
|
+
children: [/* @__PURE__ */ a(gt, {
|
|
2464
2505
|
align: "left",
|
|
2465
2506
|
theme: o,
|
|
2466
|
-
children: `Here's ${s} showing ${
|
|
2467
|
-
}),
|
|
2468
|
-
}),
|
|
2507
|
+
children: `Here's ${s} showing ${Ma(n)}.`
|
|
2508
|
+
}), x]
|
|
2509
|
+
}), k && /* @__PURE__ */ a(zr, {
|
|
2469
2510
|
content: e
|
|
2470
2511
|
})]
|
|
2471
2512
|
})
|
|
2472
|
-
}), i && /* @__PURE__ */ a(
|
|
2473
|
-
sourceId:
|
|
2474
|
-
data:
|
|
2513
|
+
}), i && /* @__PURE__ */ a(Ie, {
|
|
2514
|
+
sourceId: u,
|
|
2515
|
+
data: w,
|
|
2475
2516
|
type: "nlg/queryResult",
|
|
2476
|
-
buttonVisibility:
|
|
2477
|
-
renderContent: (
|
|
2478
|
-
children: [/* @__PURE__ */ a(
|
|
2479
|
-
children: [/* @__PURE__ */ a(
|
|
2480
|
-
onClick:
|
|
2481
|
-
}),
|
|
2482
|
-
}),
|
|
2483
|
-
nlgRequest:
|
|
2517
|
+
buttonVisibility: p ? "onHover" : "never",
|
|
2518
|
+
renderContent: (x) => /* @__PURE__ */ a(N, {
|
|
2519
|
+
children: [/* @__PURE__ */ a(He, {
|
|
2520
|
+
children: [/* @__PURE__ */ a(Br, {
|
|
2521
|
+
onClick: b
|
|
2522
|
+
}), x]
|
|
2523
|
+
}), p && /* @__PURE__ */ a(Hr, {
|
|
2524
|
+
nlgRequest: w
|
|
2484
2525
|
})]
|
|
2485
2526
|
})
|
|
2486
2527
|
})]
|
|
2487
2528
|
});
|
|
2488
2529
|
}
|
|
2489
|
-
function
|
|
2530
|
+
function Fr({
|
|
2490
2531
|
message: e,
|
|
2491
2532
|
isLastMessage: t
|
|
2492
2533
|
}) {
|
|
2493
|
-
if (
|
|
2534
|
+
if (Ne(e)) {
|
|
2494
2535
|
const i = JSON.parse(e.content);
|
|
2495
|
-
return /* @__PURE__ */ a(
|
|
2536
|
+
return /* @__PURE__ */ a(Pr, {
|
|
2496
2537
|
data: i,
|
|
2497
2538
|
alwaysShowFeedback: t
|
|
2498
2539
|
});
|
|
2499
2540
|
}
|
|
2500
|
-
const r =
|
|
2501
|
-
return /* @__PURE__ */ a(
|
|
2541
|
+
const r = Ba(e) ? JSON.parse(e.content).answer : e.content;
|
|
2542
|
+
return /* @__PURE__ */ a(U, {
|
|
2502
2543
|
align: e.role === "user" ? "right" : "left",
|
|
2503
2544
|
children: r
|
|
2504
2545
|
});
|
|
2505
2546
|
}
|
|
2506
|
-
const
|
|
2547
|
+
const Vr = Dt(Fr), Qr = ({
|
|
2507
2548
|
error: e,
|
|
2508
2549
|
displayMessage: t
|
|
2509
|
-
}) => (console.debug("Unexpected error occurred when resolving a chat message:", e), /* @__PURE__ */ a(
|
|
2550
|
+
}) => (console.debug("Unexpected error occurred when resolving a chat message:", e), /* @__PURE__ */ a(U, {
|
|
2510
2551
|
align: "left",
|
|
2511
2552
|
children: t
|
|
2512
2553
|
}));
|
|
2513
|
-
function
|
|
2554
|
+
function Jr({
|
|
2514
2555
|
messages: e
|
|
2515
2556
|
}) {
|
|
2516
2557
|
const {
|
|
2517
2558
|
t
|
|
2518
2559
|
} = _();
|
|
2519
|
-
return /* @__PURE__ */ a(
|
|
2520
|
-
children: e.map((r, i) => /* @__PURE__ */ a(
|
|
2521
|
-
fallbackRender: (o) =>
|
|
2560
|
+
return /* @__PURE__ */ a(N, {
|
|
2561
|
+
children: e.map((r, i) => /* @__PURE__ */ a(aa, {
|
|
2562
|
+
fallbackRender: (o) => Qr(v(C({}, o), {
|
|
2522
2563
|
displayMessage: t("ai.errors.unexpected")
|
|
2523
2564
|
})),
|
|
2524
|
-
children: /* @__PURE__ */ a(
|
|
2565
|
+
children: /* @__PURE__ */ a(Vr, {
|
|
2525
2566
|
message: r,
|
|
2526
2567
|
isLastMessage: i === e.length - 1
|
|
2527
2568
|
}, i)
|
|
2528
2569
|
}, i))
|
|
2529
2570
|
});
|
|
2530
2571
|
}
|
|
2531
|
-
function
|
|
2572
|
+
function bt({
|
|
2532
2573
|
color: e
|
|
2533
2574
|
}) {
|
|
2534
2575
|
return /* @__PURE__ */ a("svg", {
|
|
@@ -2543,7 +2584,7 @@ function ht({
|
|
|
2543
2584
|
})
|
|
2544
2585
|
});
|
|
2545
2586
|
}
|
|
2546
|
-
function
|
|
2587
|
+
function Xr({
|
|
2547
2588
|
onClick: e,
|
|
2548
2589
|
color: t
|
|
2549
2590
|
}) {
|
|
@@ -2551,12 +2592,12 @@ function Pr({
|
|
|
2551
2592
|
"aria-label": "go back",
|
|
2552
2593
|
className: "csdk-w-5 csdk-h-5 csdk-flex csdk-p-[4px] csdk-ml-[6px] csdk-cursor-pointer",
|
|
2553
2594
|
onClick: e,
|
|
2554
|
-
children: /* @__PURE__ */ a(
|
|
2595
|
+
children: /* @__PURE__ */ a(bt, {
|
|
2555
2596
|
color: t
|
|
2556
2597
|
})
|
|
2557
2598
|
});
|
|
2558
2599
|
}
|
|
2559
|
-
const
|
|
2600
|
+
const Kr = g.button`
|
|
2560
2601
|
font-size: inherit;
|
|
2561
2602
|
line-height: inherit;
|
|
2562
2603
|
box-sizing: border-box;
|
|
@@ -2602,7 +2643,7 @@ const $r = h.button`
|
|
|
2602
2643
|
} = e.aiChat.suggestions;
|
|
2603
2644
|
if (t) {
|
|
2604
2645
|
const [i, o] = t;
|
|
2605
|
-
return
|
|
2646
|
+
return S`
|
|
2606
2647
|
border: none;
|
|
2607
2648
|
position: relative;
|
|
2608
2649
|
border-radius: ${r};
|
|
@@ -2625,20 +2666,20 @@ const $r = h.button`
|
|
|
2625
2666
|
return "";
|
|
2626
2667
|
}}
|
|
2627
2668
|
`;
|
|
2628
|
-
function
|
|
2669
|
+
function Ue({
|
|
2629
2670
|
question: e,
|
|
2630
2671
|
onClick: t
|
|
2631
2672
|
}) {
|
|
2632
2673
|
const {
|
|
2633
2674
|
themeSettings: r
|
|
2634
2675
|
} = f();
|
|
2635
|
-
return /* @__PURE__ */ a(
|
|
2676
|
+
return /* @__PURE__ */ a(Kr, {
|
|
2636
2677
|
onClick: t,
|
|
2637
2678
|
theme: r,
|
|
2638
2679
|
children: e
|
|
2639
2680
|
});
|
|
2640
2681
|
}
|
|
2641
|
-
const
|
|
2682
|
+
const ei = g.div`
|
|
2642
2683
|
display: flex;
|
|
2643
2684
|
flex-direction: column;
|
|
2644
2685
|
align-items: flex-start;
|
|
@@ -2646,28 +2687,28 @@ const Qr = h.div`
|
|
|
2646
2687
|
theme: e
|
|
2647
2688
|
}) => e.aiChat.suggestions.gap};
|
|
2648
2689
|
`;
|
|
2649
|
-
function
|
|
2690
|
+
function ti({
|
|
2650
2691
|
questions: e,
|
|
2651
2692
|
onSelection: t
|
|
2652
2693
|
}) {
|
|
2653
2694
|
const {
|
|
2654
2695
|
t: r
|
|
2655
|
-
} = _(), [i, o] =
|
|
2656
|
-
themeSettings:
|
|
2696
|
+
} = _(), [i, o] = I(!0), n = z(() => i && e.length > 5 ? e.slice(0, 4) : e, [e, i]), {
|
|
2697
|
+
themeSettings: l
|
|
2657
2698
|
} = f();
|
|
2658
|
-
return /* @__PURE__ */ a(
|
|
2699
|
+
return /* @__PURE__ */ a(ei, {
|
|
2659
2700
|
"aria-label": "list of suggested questions",
|
|
2660
|
-
theme:
|
|
2661
|
-
children: [
|
|
2701
|
+
theme: l,
|
|
2702
|
+
children: [n.map((d) => /* @__PURE__ */ a(Ue, {
|
|
2662
2703
|
question: d,
|
|
2663
2704
|
onClick: () => t(d)
|
|
2664
|
-
}, d)),
|
|
2705
|
+
}, d)), n.length < e.length && /* @__PURE__ */ a(Ue, {
|
|
2665
2706
|
question: r("ai.buttons.seeMore"),
|
|
2666
2707
|
onClick: () => o(!1)
|
|
2667
2708
|
})]
|
|
2668
2709
|
});
|
|
2669
2710
|
}
|
|
2670
|
-
const
|
|
2711
|
+
const ai = g.div`
|
|
2671
2712
|
width: 283px;
|
|
2672
2713
|
height: 32px;
|
|
2673
2714
|
border-radius: 10px;
|
|
@@ -2693,42 +2734,42 @@ const Vr = h.div`
|
|
|
2693
2734
|
background-position: -200% 0;
|
|
2694
2735
|
}
|
|
2695
2736
|
}
|
|
2696
|
-
`,
|
|
2737
|
+
`, ri = g.div`
|
|
2697
2738
|
display: flex;
|
|
2698
2739
|
flex-direction: column;
|
|
2699
2740
|
row-gap: 1rem;
|
|
2700
2741
|
`;
|
|
2701
|
-
function
|
|
2742
|
+
function ii() {
|
|
2702
2743
|
const {
|
|
2703
2744
|
themeSettings: e
|
|
2704
2745
|
} = f();
|
|
2705
|
-
return /* @__PURE__ */ a(
|
|
2746
|
+
return /* @__PURE__ */ a(ri, {
|
|
2706
2747
|
children: Array.from({
|
|
2707
2748
|
length: 3
|
|
2708
|
-
}, (t, r) => /* @__PURE__ */ a(
|
|
2749
|
+
}, (t, r) => /* @__PURE__ */ a(ai, {
|
|
2709
2750
|
theme: e
|
|
2710
2751
|
}, r))
|
|
2711
2752
|
});
|
|
2712
2753
|
}
|
|
2713
|
-
function
|
|
2754
|
+
function oi({
|
|
2714
2755
|
questions: e,
|
|
2715
2756
|
isLoading: t,
|
|
2716
2757
|
onSelection: r
|
|
2717
2758
|
}) {
|
|
2718
2759
|
const i = e.length > 0, {
|
|
2719
2760
|
suggestionsWelcomeText: o
|
|
2720
|
-
} =
|
|
2721
|
-
return t ? /* @__PURE__ */ a(
|
|
2722
|
-
children: [o && /* @__PURE__ */ a(
|
|
2761
|
+
} = W();
|
|
2762
|
+
return t ? /* @__PURE__ */ a(ii, {}) : i ? /* @__PURE__ */ a(N, {
|
|
2763
|
+
children: [o && /* @__PURE__ */ a(U, {
|
|
2723
2764
|
align: "left",
|
|
2724
2765
|
children: o
|
|
2725
|
-
}), /* @__PURE__ */ a(
|
|
2766
|
+
}), /* @__PURE__ */ a(ti, {
|
|
2726
2767
|
onSelection: r,
|
|
2727
2768
|
questions: e
|
|
2728
2769
|
})]
|
|
2729
2770
|
}) : null;
|
|
2730
2771
|
}
|
|
2731
|
-
const
|
|
2772
|
+
const ni = g.div`
|
|
2732
2773
|
flex: 0 0 80px;
|
|
2733
2774
|
padding-left: 14px;
|
|
2734
2775
|
padding-right: 14px;
|
|
@@ -2739,7 +2780,7 @@ const ei = h.div`
|
|
|
2739
2780
|
background-color: ${({
|
|
2740
2781
|
style: e
|
|
2741
2782
|
}) => e.backgroundColor};
|
|
2742
|
-
`,
|
|
2783
|
+
`, li = g.div`
|
|
2743
2784
|
font-size: 18px;
|
|
2744
2785
|
line-height: 22px;
|
|
2745
2786
|
font-weight: 600;
|
|
@@ -2748,16 +2789,16 @@ const ei = h.div`
|
|
|
2748
2789
|
color: ${({
|
|
2749
2790
|
style: e
|
|
2750
2791
|
}) => e.textColor};
|
|
2751
|
-
`,
|
|
2792
|
+
`, mt = Pe(function({
|
|
2752
2793
|
title: e,
|
|
2753
2794
|
leftNav: t,
|
|
2754
2795
|
rightNav: r,
|
|
2755
2796
|
style: i
|
|
2756
2797
|
}, o) {
|
|
2757
|
-
return /* @__PURE__ */ a(
|
|
2798
|
+
return /* @__PURE__ */ a(ni, {
|
|
2758
2799
|
ref: o,
|
|
2759
2800
|
style: i,
|
|
2760
|
-
children: [t, /* @__PURE__ */ a(
|
|
2801
|
+
children: [t, /* @__PURE__ */ a(li, {
|
|
2761
2802
|
style: i,
|
|
2762
2803
|
children: e
|
|
2763
2804
|
}), r && /* @__PURE__ */ a("div", {
|
|
@@ -2765,7 +2806,7 @@ const ei = h.div`
|
|
|
2765
2806
|
children: r
|
|
2766
2807
|
})]
|
|
2767
2808
|
});
|
|
2768
|
-
}),
|
|
2809
|
+
}), ci = g.div`
|
|
2769
2810
|
text-align: center;
|
|
2770
2811
|
font-size: 11px;
|
|
2771
2812
|
line-height: 18px;
|
|
@@ -2781,13 +2822,13 @@ const ei = h.div`
|
|
|
2781
2822
|
theme: e
|
|
2782
2823
|
}) => e.aiChat.secondaryTextColor};
|
|
2783
2824
|
`;
|
|
2784
|
-
function
|
|
2825
|
+
function di({
|
|
2785
2826
|
theme: e
|
|
2786
2827
|
}) {
|
|
2787
2828
|
const {
|
|
2788
2829
|
t
|
|
2789
2830
|
} = _();
|
|
2790
|
-
return /* @__PURE__ */ a(
|
|
2831
|
+
return /* @__PURE__ */ a(ci, {
|
|
2791
2832
|
theme: e,
|
|
2792
2833
|
children: [/* @__PURE__ */ a("div", {
|
|
2793
2834
|
children: t("ai.disclaimer.poweredByAi")
|
|
@@ -2796,7 +2837,7 @@ function ri({
|
|
|
2796
2837
|
})]
|
|
2797
2838
|
});
|
|
2798
2839
|
}
|
|
2799
|
-
const
|
|
2840
|
+
const si = g.div`
|
|
2800
2841
|
font-size: inherit;
|
|
2801
2842
|
line-height: inherit;
|
|
2802
2843
|
padding-left: 16px;
|
|
@@ -2811,18 +2852,18 @@ const ii = h.div`
|
|
|
2811
2852
|
background-color: ${({
|
|
2812
2853
|
theme: e
|
|
2813
2854
|
}) => e.aiChat.suggestions.backgroundColor};
|
|
2814
|
-
`,
|
|
2855
|
+
`, xt = () => {
|
|
2815
2856
|
const {
|
|
2816
2857
|
t: e
|
|
2817
2858
|
} = _(), {
|
|
2818
2859
|
themeSettings: t
|
|
2819
2860
|
} = f();
|
|
2820
|
-
return /* @__PURE__ */ a(
|
|
2861
|
+
return /* @__PURE__ */ a(si, {
|
|
2821
2862
|
theme: t,
|
|
2822
2863
|
children: e("ai.betaLabel")
|
|
2823
2864
|
});
|
|
2824
2865
|
};
|
|
2825
|
-
function
|
|
2866
|
+
function pi() {
|
|
2826
2867
|
const {
|
|
2827
2868
|
themeSettings: e
|
|
2828
2869
|
} = f();
|
|
@@ -2840,10 +2881,10 @@ function oi() {
|
|
|
2840
2881
|
})
|
|
2841
2882
|
});
|
|
2842
2883
|
}
|
|
2843
|
-
const
|
|
2844
|
-
const r = new
|
|
2884
|
+
const gi = (e, t) => {
|
|
2885
|
+
const r = new Et(e);
|
|
2845
2886
|
return r.alpha = t, r;
|
|
2846
|
-
},
|
|
2887
|
+
}, ui = g.div`
|
|
2847
2888
|
font-size: inherit;
|
|
2848
2889
|
line-height: inherit;
|
|
2849
2890
|
padding-left: 8px;
|
|
@@ -2853,7 +2894,7 @@ const ni = (e, t) => {
|
|
|
2853
2894
|
margin-bottom: 4px;
|
|
2854
2895
|
box-shadow: ${({
|
|
2855
2896
|
theme: e
|
|
2856
|
-
}) => `0 4px 8px 0 ${
|
|
2897
|
+
}) => `0 4px 8px 0 ${gi(e.aiChat.primaryTextColor, 0.2)}`};
|
|
2857
2898
|
cursor: pointer;
|
|
2858
2899
|
color: ${({
|
|
2859
2900
|
theme: e
|
|
@@ -2870,32 +2911,32 @@ const ni = (e, t) => {
|
|
|
2870
2911
|
theme: e
|
|
2871
2912
|
}) => e.aiChat.clickableMessages.hover.backgroundColor};
|
|
2872
2913
|
box-shadow: none;
|
|
2873
|
-
`,
|
|
2914
|
+
`, hi = ({
|
|
2874
2915
|
onClick: e
|
|
2875
2916
|
}) => {
|
|
2876
2917
|
const {
|
|
2877
2918
|
themeSettings: t
|
|
2878
2919
|
} = f();
|
|
2879
|
-
return /* @__PURE__ */ a(
|
|
2920
|
+
return /* @__PURE__ */ a(ui, {
|
|
2880
2921
|
theme: t,
|
|
2881
2922
|
onClick: e,
|
|
2882
|
-
children: /* @__PURE__ */ a(
|
|
2923
|
+
children: /* @__PURE__ */ a(pi, {})
|
|
2883
2924
|
});
|
|
2884
|
-
},
|
|
2925
|
+
}, bi = ({
|
|
2885
2926
|
isVisible: e,
|
|
2886
2927
|
onClick: t,
|
|
2887
2928
|
anchorElement: r
|
|
2888
|
-
}) => /* @__PURE__ */ a(
|
|
2929
|
+
}) => /* @__PURE__ */ a(Je, {
|
|
2889
2930
|
anchorEl: r,
|
|
2890
2931
|
open: e,
|
|
2891
2932
|
placement: "top",
|
|
2892
2933
|
sx: {
|
|
2893
2934
|
zIndex: 2
|
|
2894
2935
|
},
|
|
2895
|
-
children: /* @__PURE__ */ a(
|
|
2936
|
+
children: /* @__PURE__ */ a(hi, {
|
|
2896
2937
|
onClick: t
|
|
2897
2938
|
})
|
|
2898
|
-
}),
|
|
2939
|
+
}), mi = g.div`
|
|
2899
2940
|
display: flex;
|
|
2900
2941
|
flex-direction: column;
|
|
2901
2942
|
row-gap: ${({
|
|
@@ -2916,7 +2957,7 @@ const ni = (e, t) => {
|
|
|
2916
2957
|
}) => e.aiChat.body.paddingBottom};
|
|
2917
2958
|
flex: initial;
|
|
2918
2959
|
height: 100%;
|
|
2919
|
-
`,
|
|
2960
|
+
`, xi = g.div`
|
|
2920
2961
|
padding-left: ${({
|
|
2921
2962
|
theme: e
|
|
2922
2963
|
}) => e.aiChat.footer.paddingLeft};
|
|
@@ -2932,133 +2973,135 @@ const ni = (e, t) => {
|
|
|
2932
2973
|
display: flex;
|
|
2933
2974
|
flex-direction: column;
|
|
2934
2975
|
row-gap: 6px;
|
|
2935
|
-
`,
|
|
2976
|
+
`, fi = g.div`
|
|
2936
2977
|
display: flex;
|
|
2937
2978
|
flex-direction: column;
|
|
2938
2979
|
row-gap: ${({
|
|
2939
2980
|
theme: e
|
|
2940
2981
|
}) => e.aiChat.suggestions.gap};
|
|
2941
2982
|
`;
|
|
2942
|
-
function
|
|
2983
|
+
function ki({
|
|
2943
2984
|
contextTitle: e,
|
|
2944
2985
|
onGoBack: t
|
|
2945
2986
|
}) {
|
|
2946
2987
|
const {
|
|
2947
2988
|
t: r
|
|
2948
2989
|
} = _(), {
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2990
|
+
enableFollowupQuestions: i,
|
|
2991
|
+
enableHeader: o,
|
|
2992
|
+
numOfRecentPrompts: n,
|
|
2993
|
+
numOfRecommendations: l
|
|
2994
|
+
} = W(), {
|
|
2995
|
+
themeSettings: d
|
|
2996
|
+
} = f(), {
|
|
2997
|
+
data: c,
|
|
2998
|
+
isLoading: s,
|
|
2999
|
+
isError: u
|
|
2952
3000
|
} = ot({
|
|
2953
|
-
contextTitle: e
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3001
|
+
contextTitle: e,
|
|
3002
|
+
count: l
|
|
3003
|
+
}), p = z(() => c == null ? void 0 : c.map((D) => D.nlqPrompt), [c]), {
|
|
3004
|
+
history: h,
|
|
3005
|
+
lastNlqResponse: b,
|
|
3006
|
+
isAwaitingResponse: w,
|
|
3007
|
+
sendMessage: k,
|
|
3008
|
+
isLoading: x,
|
|
3009
|
+
chatId: E,
|
|
3010
|
+
lastError: A
|
|
3011
|
+
} = $a(e), {
|
|
3012
|
+
mutate: y,
|
|
3013
|
+
isLoading: R
|
|
3014
|
+
} = ct(E), [Z, T] = I(!1), [G, me] = I(!1), xe = () => T(!0), q = () => T(!1), J = () => {
|
|
3015
|
+
y(), q();
|
|
3016
|
+
}, j = $(null), ie = $(null), fe = () => {
|
|
3017
|
+
if (!(j != null && j.current))
|
|
2969
3018
|
return;
|
|
2970
3019
|
const {
|
|
2971
|
-
scrollTop:
|
|
2972
|
-
clientHeight:
|
|
2973
|
-
scrollHeight:
|
|
2974
|
-
} =
|
|
2975
|
-
if (
|
|
3020
|
+
scrollTop: D,
|
|
3021
|
+
clientHeight: H,
|
|
3022
|
+
scrollHeight: ze
|
|
3023
|
+
} = j.current;
|
|
3024
|
+
if (D === void 0 || H === void 0 || ze === void 0)
|
|
2976
3025
|
return;
|
|
2977
|
-
const
|
|
2978
|
-
|
|
3026
|
+
const Ee = ze - D - H > H / 2;
|
|
3027
|
+
G !== Ee && me(Ee);
|
|
2979
3028
|
};
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
}, [
|
|
2983
|
-
const
|
|
2984
|
-
|
|
2985
|
-
enableHeader: B,
|
|
2986
|
-
numOfRecentPrompts: ie
|
|
2987
|
-
} = R(), {
|
|
2988
|
-
themeSettings: W
|
|
2989
|
-
} = f(), P = B ? /* @__PURE__ */ a(ut, {
|
|
2990
|
-
ref: U,
|
|
3029
|
+
le(() => {
|
|
3030
|
+
j.current && (j.current.scrollTop = j.current.scrollHeight);
|
|
3031
|
+
}, [h, Z, w]);
|
|
3032
|
+
const X = $(null), oe = o ? /* @__PURE__ */ a(mt, {
|
|
3033
|
+
ref: X,
|
|
2991
3034
|
title: e,
|
|
2992
|
-
leftNav: t && /* @__PURE__ */ a(
|
|
3035
|
+
leftNav: t && /* @__PURE__ */ a(Xr, {
|
|
2993
3036
|
onClick: t,
|
|
2994
|
-
color:
|
|
3037
|
+
color: d.aiChat.header.textColor
|
|
2995
3038
|
}),
|
|
2996
|
-
rightNav: /* @__PURE__ */ a(
|
|
2997
|
-
style:
|
|
2998
|
-
}) : null,
|
|
2999
|
-
return (
|
|
3000
|
-
children: [
|
|
3001
|
-
text:
|
|
3039
|
+
rightNav: /* @__PURE__ */ a(xt, {}),
|
|
3040
|
+
style: d.aiChat.header
|
|
3041
|
+
}) : null, Y = z(() => [...new Set(h.filter((D) => D.role === "user").filter((D) => !(p != null && p.includes(D.content))).map((D) => D.content).reverse())].slice(0, n), [h, n, p]);
|
|
3042
|
+
return (A == null ? void 0 : A.message) === r("ai.errors.chatUnavailable") ? /* @__PURE__ */ a(N, {
|
|
3043
|
+
children: [o && oe, /* @__PURE__ */ a(ut, {
|
|
3044
|
+
text: A.message
|
|
3002
3045
|
})]
|
|
3003
|
-
}) : /* @__PURE__ */ a(
|
|
3004
|
-
children: [
|
|
3005
|
-
ref:
|
|
3006
|
-
theme:
|
|
3007
|
-
onScroll:
|
|
3008
|
-
children: [/* @__PURE__ */ a(
|
|
3009
|
-
isVisible:
|
|
3010
|
-
anchorElement:
|
|
3046
|
+
}) : /* @__PURE__ */ a(N, {
|
|
3047
|
+
children: [oe, /* @__PURE__ */ a(mi, {
|
|
3048
|
+
ref: j,
|
|
3049
|
+
theme: d,
|
|
3050
|
+
onScroll: fe,
|
|
3051
|
+
children: [/* @__PURE__ */ a(bi, {
|
|
3052
|
+
isVisible: G,
|
|
3053
|
+
anchorElement: ie.current,
|
|
3011
3054
|
onClick: () => {
|
|
3012
|
-
var
|
|
3013
|
-
(
|
|
3014
|
-
top: (
|
|
3055
|
+
var D, H;
|
|
3056
|
+
(H = j.current) == null || H.scroll({
|
|
3057
|
+
top: (D = j.current) == null ? void 0 : D.scrollHeight,
|
|
3015
3058
|
behavior: "smooth"
|
|
3016
3059
|
});
|
|
3017
3060
|
}
|
|
3018
|
-
}), /* @__PURE__ */ a(
|
|
3019
|
-
questions:
|
|
3020
|
-
isLoading:
|
|
3021
|
-
onSelection:
|
|
3022
|
-
}),
|
|
3061
|
+
}), /* @__PURE__ */ a(mr, {}), /* @__PURE__ */ a(oi, {
|
|
3062
|
+
questions: p || [],
|
|
3063
|
+
isLoading: s,
|
|
3064
|
+
onSelection: k
|
|
3065
|
+
}), A && /* @__PURE__ */ a(U, {
|
|
3023
3066
|
align: "left",
|
|
3024
|
-
children:
|
|
3025
|
-
}),
|
|
3026
|
-
messages:
|
|
3027
|
-
}),
|
|
3028
|
-
theme:
|
|
3029
|
-
children:
|
|
3067
|
+
children: A.message
|
|
3068
|
+
}), x ? /* @__PURE__ */ a(he, {}) : /* @__PURE__ */ a(Jr, {
|
|
3069
|
+
messages: h
|
|
3070
|
+
}), i && b && /* @__PURE__ */ a(fi, {
|
|
3071
|
+
theme: d,
|
|
3072
|
+
children: b.followupQuestions.slice(0, 2).map((D, H) => /* @__PURE__ */ a(se, {
|
|
3030
3073
|
align: "left",
|
|
3031
3074
|
onClick: () => {
|
|
3032
|
-
|
|
3075
|
+
k(D);
|
|
3033
3076
|
},
|
|
3034
3077
|
children: /* @__PURE__ */ a("div", {
|
|
3035
3078
|
className: "csdk-py-[7px] csdk-px-4",
|
|
3036
|
-
children:
|
|
3079
|
+
children: D
|
|
3037
3080
|
})
|
|
3038
|
-
},
|
|
3039
|
-
}), (
|
|
3040
|
-
onCancel:
|
|
3081
|
+
}, H))
|
|
3082
|
+
}), (w || R) && /* @__PURE__ */ a(Te, {}), Z && /* @__PURE__ */ a(Cr, {
|
|
3083
|
+
onCancel: q,
|
|
3041
3084
|
onConfirm: J
|
|
3042
3085
|
})]
|
|
3043
|
-
}), /* @__PURE__ */ a(
|
|
3044
|
-
ref:
|
|
3045
|
-
theme:
|
|
3046
|
-
children: [/* @__PURE__ */ a(
|
|
3047
|
-
onSendMessage:
|
|
3048
|
-
disabled:
|
|
3049
|
-
onClearHistoryClick:
|
|
3050
|
-
suggestions:
|
|
3051
|
-
recentPrompts:
|
|
3052
|
-
isLoading:
|
|
3053
|
-
recommendationsError:
|
|
3054
|
-
onChange:
|
|
3055
|
-
}), /* @__PURE__ */ a(
|
|
3056
|
-
theme:
|
|
3086
|
+
}), /* @__PURE__ */ a(xi, {
|
|
3087
|
+
ref: ie,
|
|
3088
|
+
theme: d,
|
|
3089
|
+
children: [/* @__PURE__ */ a(hr, {
|
|
3090
|
+
onSendMessage: k,
|
|
3091
|
+
disabled: w || x,
|
|
3092
|
+
onClearHistoryClick: xe,
|
|
3093
|
+
suggestions: p || [],
|
|
3094
|
+
recentPrompts: Y,
|
|
3095
|
+
isLoading: s || x,
|
|
3096
|
+
recommendationsError: u,
|
|
3097
|
+
onChange: q
|
|
3098
|
+
}), /* @__PURE__ */ a(di, {
|
|
3099
|
+
theme: d
|
|
3057
3100
|
})]
|
|
3058
3101
|
})]
|
|
3059
3102
|
});
|
|
3060
3103
|
}
|
|
3061
|
-
const
|
|
3104
|
+
const wi = g.button`
|
|
3062
3105
|
font-family: ${({
|
|
3063
3106
|
theme: e
|
|
3064
3107
|
}) => e.typography.fontFamily};
|
|
@@ -3075,14 +3118,14 @@ const ui = h.button`
|
|
|
3075
3118
|
background-color: ${({
|
|
3076
3119
|
theme: e
|
|
3077
3120
|
}) => e.aiChat.dataTopics.items.backgroundColor};
|
|
3078
|
-
`,
|
|
3121
|
+
`, _i = g.div`
|
|
3079
3122
|
font-size: 1.05rem;
|
|
3080
3123
|
line-height: 28px;
|
|
3081
3124
|
|
|
3082
3125
|
color: ${({
|
|
3083
3126
|
theme: e
|
|
3084
3127
|
}) => e.aiChat.dataTopics.items.textColor};
|
|
3085
|
-
`,
|
|
3128
|
+
`, Ci = g.div`
|
|
3086
3129
|
font-size: ${({
|
|
3087
3130
|
theme: e
|
|
3088
3131
|
}) => e.aiChat.primaryFontSize[0]};
|
|
@@ -3092,13 +3135,13 @@ const ui = h.button`
|
|
|
3092
3135
|
|
|
3093
3136
|
color: ${({
|
|
3094
3137
|
theme: e
|
|
3095
|
-
}) =>
|
|
3096
|
-
`,
|
|
3138
|
+
}) => Fe(e.aiChat.dataTopics.items.textColor, 0, 0.5)};
|
|
3139
|
+
`, yi = g.div`
|
|
3097
3140
|
width: 16px;
|
|
3098
3141
|
height: 16px;
|
|
3099
3142
|
transform: rotate(180deg);
|
|
3100
3143
|
`;
|
|
3101
|
-
function
|
|
3144
|
+
function vi(e) {
|
|
3102
3145
|
const {
|
|
3103
3146
|
title: t,
|
|
3104
3147
|
description: r,
|
|
@@ -3106,31 +3149,31 @@ function fi(e) {
|
|
|
3106
3149
|
} = e, {
|
|
3107
3150
|
themeSettings: o
|
|
3108
3151
|
} = f();
|
|
3109
|
-
return /* @__PURE__ */ a(
|
|
3152
|
+
return /* @__PURE__ */ a(wi, {
|
|
3110
3153
|
onClick: i,
|
|
3111
3154
|
theme: o,
|
|
3112
3155
|
children: [/* @__PURE__ */ a("div", {
|
|
3113
|
-
children: [/* @__PURE__ */ a(
|
|
3156
|
+
children: [/* @__PURE__ */ a(_i, {
|
|
3114
3157
|
theme: o,
|
|
3115
3158
|
children: t
|
|
3116
|
-
}), /* @__PURE__ */ a(
|
|
3159
|
+
}), /* @__PURE__ */ a(Ci, {
|
|
3117
3160
|
theme: o,
|
|
3118
3161
|
children: r
|
|
3119
3162
|
})]
|
|
3120
|
-
}), /* @__PURE__ */ a(
|
|
3121
|
-
children: /* @__PURE__ */ a(
|
|
3163
|
+
}), /* @__PURE__ */ a(yi, {
|
|
3164
|
+
children: /* @__PURE__ */ a(bt, {
|
|
3122
3165
|
color: o.aiChat.icons.color
|
|
3123
3166
|
})
|
|
3124
3167
|
})]
|
|
3125
3168
|
});
|
|
3126
3169
|
}
|
|
3127
|
-
const
|
|
3170
|
+
const Mi = g.div`
|
|
3128
3171
|
padding: 20px;
|
|
3129
3172
|
display: flex;
|
|
3130
3173
|
flex-direction: column;
|
|
3131
3174
|
gap: 20px;
|
|
3132
3175
|
overflow: auto;
|
|
3133
|
-
`,
|
|
3176
|
+
`, Ii = g.div`
|
|
3134
3177
|
font-size: 24px;
|
|
3135
3178
|
line-height: 32px;
|
|
3136
3179
|
font-weight: 600;
|
|
@@ -3140,7 +3183,7 @@ const ki = h.div`
|
|
|
3140
3183
|
color: ${({
|
|
3141
3184
|
theme: e
|
|
3142
3185
|
}) => e.aiChat.primaryTextColor};
|
|
3143
|
-
`,
|
|
3186
|
+
`, Di = g.div`
|
|
3144
3187
|
font-size: 15px;
|
|
3145
3188
|
line-height: 22px;
|
|
3146
3189
|
|
|
@@ -3148,7 +3191,7 @@ const ki = h.div`
|
|
|
3148
3191
|
theme: e
|
|
3149
3192
|
}) => e.aiChat.primaryTextColor};
|
|
3150
3193
|
`;
|
|
3151
|
-
function
|
|
3194
|
+
function Ai(e) {
|
|
3152
3195
|
const {
|
|
3153
3196
|
dataTopics: t
|
|
3154
3197
|
} = e, {
|
|
@@ -3156,23 +3199,23 @@ function Ci(e) {
|
|
|
3156
3199
|
} = f(), {
|
|
3157
3200
|
t: i
|
|
3158
3201
|
} = _();
|
|
3159
|
-
return /* @__PURE__ */ a(
|
|
3160
|
-
children: [/* @__PURE__ */ a(
|
|
3202
|
+
return /* @__PURE__ */ a(Mi, {
|
|
3203
|
+
children: [/* @__PURE__ */ a(Ii, {
|
|
3161
3204
|
theme: r,
|
|
3162
3205
|
children: i("ai.dataTopics")
|
|
3163
|
-
}), /* @__PURE__ */ a(
|
|
3206
|
+
}), /* @__PURE__ */ a(Di, {
|
|
3164
3207
|
theme: r,
|
|
3165
3208
|
children: [i("ai.chatbotDescription"), /* @__PURE__ */ a("br", {}), /* @__PURE__ */ a("br", {}), i("ai.topicSelectPrompt")]
|
|
3166
|
-
}), t.map((o) => /* @__PURE__ */
|
|
3209
|
+
}), t.map((o) => /* @__PURE__ */ ra(vi, v(C({}, o), {
|
|
3167
3210
|
key: o.title
|
|
3168
3211
|
})))]
|
|
3169
3212
|
});
|
|
3170
3213
|
}
|
|
3171
|
-
const
|
|
3172
|
-
function
|
|
3214
|
+
const Si = "#000000", Li = "#FFFFFF";
|
|
3215
|
+
function Ni({
|
|
3173
3216
|
isDarkBackground: e = !1
|
|
3174
3217
|
}) {
|
|
3175
|
-
const t = e ?
|
|
3218
|
+
const t = e ? Li : Si;
|
|
3176
3219
|
return /* @__PURE__ */ a("svg", {
|
|
3177
3220
|
width: "32",
|
|
3178
3221
|
height: "32",
|
|
@@ -3230,10 +3273,10 @@ function Mi({
|
|
|
3230
3273
|
})]
|
|
3231
3274
|
});
|
|
3232
3275
|
}
|
|
3233
|
-
const
|
|
3276
|
+
const Ti = g.div`
|
|
3234
3277
|
margin-left: 14px;
|
|
3235
3278
|
margin-top: 3px;
|
|
3236
|
-
`,
|
|
3279
|
+
`, ji = g.div`
|
|
3237
3280
|
display: flex;
|
|
3238
3281
|
flex-direction: column;
|
|
3239
3282
|
justify-content: top;
|
|
@@ -3244,71 +3287,71 @@ const Di = h.div`
|
|
|
3244
3287
|
theme: e
|
|
3245
3288
|
}) => e.aiChat.dataTopics.backgroundColor};
|
|
3246
3289
|
`;
|
|
3247
|
-
function
|
|
3290
|
+
function zi({
|
|
3248
3291
|
dataTopicsList: e,
|
|
3249
3292
|
onDataTopicClick: t
|
|
3250
3293
|
}) {
|
|
3251
3294
|
const {
|
|
3252
3295
|
enableHeader: r
|
|
3253
|
-
} =
|
|
3296
|
+
} = W(), {
|
|
3254
3297
|
themeSettings: i
|
|
3255
3298
|
} = f(), {
|
|
3256
3299
|
t: o
|
|
3257
|
-
} = _(),
|
|
3300
|
+
} = _(), n = z(() => e == null ? void 0 : e.map((d) => ({
|
|
3258
3301
|
title: d,
|
|
3259
3302
|
onClick: () => t(d)
|
|
3260
|
-
})), [e, t]),
|
|
3261
|
-
return /* @__PURE__ */ a(
|
|
3262
|
-
children: [r ? /* @__PURE__ */ a(
|
|
3303
|
+
})), [e, t]), l = Pt(Ft(i.aiChat.header.backgroundColor)) > 0.5;
|
|
3304
|
+
return /* @__PURE__ */ a(N, {
|
|
3305
|
+
children: [r ? /* @__PURE__ */ a(mt, {
|
|
3263
3306
|
title: o("ai.analyticsChatbot"),
|
|
3264
|
-
leftNav: /* @__PURE__ */ a(
|
|
3265
|
-
children: /* @__PURE__ */ a(
|
|
3266
|
-
isDarkBackground:
|
|
3307
|
+
leftNav: /* @__PURE__ */ a(Ti, {
|
|
3308
|
+
children: /* @__PURE__ */ a(Ni, {
|
|
3309
|
+
isDarkBackground: l
|
|
3267
3310
|
})
|
|
3268
3311
|
}),
|
|
3269
|
-
rightNav: /* @__PURE__ */ a(
|
|
3312
|
+
rightNav: /* @__PURE__ */ a(xt, {}),
|
|
3270
3313
|
style: i.aiChat.header
|
|
3271
|
-
}) : null, /* @__PURE__ */ a(
|
|
3314
|
+
}) : null, /* @__PURE__ */ a(ji, {
|
|
3272
3315
|
theme: i,
|
|
3273
|
-
children: [!
|
|
3274
|
-
dataTopics:
|
|
3316
|
+
children: [!n && /* @__PURE__ */ a(he, {}), n && /* @__PURE__ */ a(Ai, {
|
|
3317
|
+
dataTopics: n
|
|
3275
3318
|
})]
|
|
3276
3319
|
})]
|
|
3277
3320
|
});
|
|
3278
3321
|
}
|
|
3279
|
-
function
|
|
3280
|
-
const [e, t] =
|
|
3281
|
-
data:
|
|
3322
|
+
function Ei() {
|
|
3323
|
+
const [e, t] = I([]), [r, i] = I(), [o, n] = I(), {
|
|
3324
|
+
data: l,
|
|
3282
3325
|
fetchStatus: d
|
|
3283
|
-
} =
|
|
3326
|
+
} = st(), {
|
|
3284
3327
|
dataTopicsList: c
|
|
3285
|
-
} =
|
|
3328
|
+
} = W(), {
|
|
3286
3329
|
t: s
|
|
3287
3330
|
} = _();
|
|
3288
|
-
|
|
3289
|
-
if (
|
|
3290
|
-
let
|
|
3291
|
-
c && c.length && (
|
|
3331
|
+
V(() => {
|
|
3332
|
+
if (l && d === "idle") {
|
|
3333
|
+
let h = l;
|
|
3334
|
+
c && c.length && (h = l == null ? void 0 : l.filter((b) => c == null ? void 0 : c.includes(b.title))), t(h.map((b) => b.title)), h.length ? h.length === 1 && (n(void 0), i(h[0].title)) : n(s("ai.errors.noAvailableDataTopics"));
|
|
3292
3335
|
}
|
|
3293
|
-
}, [
|
|
3294
|
-
const
|
|
3295
|
-
|
|
3296
|
-
}, [
|
|
3297
|
-
return o ? /* @__PURE__ */ a(
|
|
3336
|
+
}, [l, c, d, s]);
|
|
3337
|
+
const u = ee(), p = M(() => {
|
|
3338
|
+
n(void 0), u.invalidateQueries(["getDataTopics"]);
|
|
3339
|
+
}, [u]);
|
|
3340
|
+
return o ? /* @__PURE__ */ a(ut, {
|
|
3298
3341
|
text: o,
|
|
3299
3342
|
action: {
|
|
3300
3343
|
text: s("ai.buttons.refresh"),
|
|
3301
|
-
onClick:
|
|
3344
|
+
onClick: p
|
|
3302
3345
|
}
|
|
3303
|
-
}) : e.length === 1 && !r ? /* @__PURE__ */ a(
|
|
3346
|
+
}) : e.length === 1 && !r ? /* @__PURE__ */ a(he, {}) : r ? /* @__PURE__ */ a(ki, {
|
|
3304
3347
|
contextTitle: r,
|
|
3305
3348
|
onGoBack: e.length === 1 ? void 0 : () => i(void 0)
|
|
3306
|
-
}) : /* @__PURE__ */ a(
|
|
3349
|
+
}) : /* @__PURE__ */ a(zi, {
|
|
3307
3350
|
dataTopicsList: e,
|
|
3308
|
-
onDataTopicClick: (
|
|
3351
|
+
onDataTopicClick: (h) => i(h)
|
|
3309
3352
|
});
|
|
3310
3353
|
}
|
|
3311
|
-
const
|
|
3354
|
+
const Fi = Ae({
|
|
3312
3355
|
componentName: "Chatbot"
|
|
3313
3356
|
})((e) => {
|
|
3314
3357
|
const {
|
|
@@ -3318,34 +3361,49 @@ const Hi = Be({
|
|
|
3318
3361
|
} = e, {
|
|
3319
3362
|
themeSettings: o
|
|
3320
3363
|
} = f();
|
|
3321
|
-
return /* @__PURE__ */ a(
|
|
3364
|
+
return /* @__PURE__ */ a(Ga, {
|
|
3322
3365
|
value: i ?? {},
|
|
3323
|
-
children: /* @__PURE__ */ a(
|
|
3366
|
+
children: /* @__PURE__ */ a(Ja, {
|
|
3324
3367
|
id: "csdk-chatbot-frame",
|
|
3325
3368
|
width: t,
|
|
3326
3369
|
height: r,
|
|
3327
3370
|
theme: o,
|
|
3328
3371
|
tabIndex: 0,
|
|
3329
|
-
children: /* @__PURE__ */ a(
|
|
3372
|
+
children: /* @__PURE__ */ a(Ei, {})
|
|
3330
3373
|
})
|
|
3331
3374
|
});
|
|
3332
|
-
}),
|
|
3375
|
+
}), Vi = Ae({
|
|
3376
|
+
componentName: "GetNlgInsights"
|
|
3377
|
+
})(function(e) {
|
|
3378
|
+
const {
|
|
3379
|
+
data: t,
|
|
3380
|
+
isLoading: r,
|
|
3381
|
+
isError: i
|
|
3382
|
+
} = te(e), {
|
|
3383
|
+
t: o
|
|
3384
|
+
} = _();
|
|
3385
|
+
return i ? /* @__PURE__ */ a(N, {
|
|
3386
|
+
children: o("ai.errors.unexpected")
|
|
3387
|
+
}) : /* @__PURE__ */ a(be, {
|
|
3388
|
+
text: r ? "Loading..." : t ?? "Oops, no data came back for that."
|
|
3389
|
+
});
|
|
3390
|
+
}), Qi = Ae({
|
|
3333
3391
|
componentName: "GetNlgQueryResult"
|
|
3334
3392
|
})(function(e) {
|
|
3335
3393
|
const {
|
|
3336
3394
|
data: t,
|
|
3337
3395
|
isLoading: r,
|
|
3338
3396
|
isError: i
|
|
3339
|
-
} =
|
|
3397
|
+
} = te(e), {
|
|
3340
3398
|
t: o
|
|
3341
3399
|
} = _();
|
|
3342
|
-
return i ? /* @__PURE__ */ a(
|
|
3400
|
+
return i ? /* @__PURE__ */ a(N, {
|
|
3343
3401
|
children: o("ai.errors.unexpected")
|
|
3344
|
-
}) : /* @__PURE__ */ a(
|
|
3402
|
+
}) : /* @__PURE__ */ a(be, {
|
|
3345
3403
|
text: r ? "Loading..." : t ?? "Oops, no data came back for that."
|
|
3346
3404
|
});
|
|
3347
3405
|
});
|
|
3348
|
-
function
|
|
3406
|
+
function Zi({
|
|
3349
3407
|
theme: e
|
|
3350
3408
|
}) {
|
|
3351
3409
|
const t = e.general.brandColor;
|
|
@@ -3373,83 +3431,91 @@ function Li({
|
|
|
3373
3431
|
})]
|
|
3374
3432
|
});
|
|
3375
3433
|
}
|
|
3376
|
-
const
|
|
3434
|
+
const Oi = g.div`
|
|
3377
3435
|
display: flex;
|
|
3378
3436
|
flex-direction: row;
|
|
3379
3437
|
align-items: center;
|
|
3380
3438
|
gap: 10px;
|
|
3381
3439
|
margin: 24px 0;
|
|
3382
3440
|
max-width: 640px;
|
|
3383
|
-
`,
|
|
3441
|
+
`, Ri = g.div`
|
|
3384
3442
|
align-self: flex-start;
|
|
3385
|
-
`,
|
|
3443
|
+
`, Wi = ({
|
|
3386
3444
|
summary: e,
|
|
3387
3445
|
nlgRequest: t
|
|
3388
3446
|
}) => {
|
|
3389
3447
|
const {
|
|
3390
3448
|
themeSettings: r
|
|
3391
3449
|
} = f();
|
|
3392
|
-
return /* @__PURE__ */ a(
|
|
3450
|
+
return /* @__PURE__ */ a(Ie, {
|
|
3393
3451
|
sourceId: t.jaql.datasource.title,
|
|
3394
3452
|
data: t,
|
|
3395
3453
|
type: "chart/insights",
|
|
3396
3454
|
buttonVisibility: "always",
|
|
3397
|
-
renderContent: (i) => /* @__PURE__ */ a(
|
|
3455
|
+
renderContent: (i) => /* @__PURE__ */ a(Oi, {
|
|
3398
3456
|
theme: r,
|
|
3399
|
-
children: [/* @__PURE__ */ a(
|
|
3457
|
+
children: [/* @__PURE__ */ a(Ri, {
|
|
3400
3458
|
theme: r,
|
|
3401
|
-
children: /* @__PURE__ */ a(
|
|
3459
|
+
children: /* @__PURE__ */ a(Zi, {
|
|
3402
3460
|
theme: r
|
|
3403
3461
|
})
|
|
3404
|
-
}), /* @__PURE__ */ a(
|
|
3462
|
+
}), /* @__PURE__ */ a(be, {
|
|
3405
3463
|
text: e
|
|
3406
3464
|
}), i]
|
|
3407
3465
|
})
|
|
3408
3466
|
});
|
|
3409
|
-
},
|
|
3467
|
+
}, Ji = ({
|
|
3410
3468
|
nlqResponse: e,
|
|
3411
3469
|
onDataReady: t,
|
|
3412
|
-
filters: r = []
|
|
3470
|
+
filters: r = [],
|
|
3471
|
+
enableHeader: i = !0
|
|
3413
3472
|
}) => {
|
|
3473
|
+
e.queryTitle = Zt(e.queryTitle);
|
|
3414
3474
|
const {
|
|
3415
|
-
connectToWidgetProps:
|
|
3416
|
-
} =
|
|
3475
|
+
connectToWidgetProps: o
|
|
3476
|
+
} = Ot({
|
|
3417
3477
|
initialFilters: r
|
|
3418
|
-
}), [
|
|
3419
|
-
|
|
3420
|
-
|
|
3478
|
+
}), [n, l] = I(null);
|
|
3479
|
+
V(() => {
|
|
3480
|
+
var p;
|
|
3481
|
+
const h = ue(e, {
|
|
3421
3482
|
useCustomizedStyleOptions: !0
|
|
3422
3483
|
});
|
|
3423
|
-
if (!
|
|
3484
|
+
if (!h)
|
|
3424
3485
|
l(null);
|
|
3425
3486
|
else {
|
|
3426
|
-
|
|
3487
|
+
i || (h.styleOptions = v(C({}, h.styleOptions), {
|
|
3488
|
+
header: v(C({}, (p = h.styleOptions) == null ? void 0 : p.header), {
|
|
3489
|
+
hidden: !0
|
|
3490
|
+
})
|
|
3491
|
+
}));
|
|
3492
|
+
const b = o(h, {
|
|
3427
3493
|
shouldAffectFilters: !1,
|
|
3428
3494
|
applyMode: "filter"
|
|
3429
3495
|
});
|
|
3430
|
-
l(
|
|
3496
|
+
l(b);
|
|
3431
3497
|
}
|
|
3432
|
-
}, [e, i]);
|
|
3433
|
-
const
|
|
3434
|
-
const p =
|
|
3435
|
-
return
|
|
3436
|
-
jaql:
|
|
3437
|
-
metadata:
|
|
3498
|
+
}, [e, o, i]);
|
|
3499
|
+
const d = z(() => {
|
|
3500
|
+
const p = n && ye(n) ? Rt(n == null ? void 0 : n.filters) : [], h = e.jaql.metadata.filter((b) => !b.jaql.filter).concat(p.filter((b) => !b.config.disabled).map((b) => b.jaql()));
|
|
3501
|
+
return v(C({}, e), {
|
|
3502
|
+
jaql: v(C({}, e.jaql), {
|
|
3503
|
+
metadata: h
|
|
3438
3504
|
})
|
|
3439
3505
|
});
|
|
3440
|
-
}, [e,
|
|
3441
|
-
data:
|
|
3442
|
-
isLoading:
|
|
3443
|
-
isError:
|
|
3444
|
-
} =
|
|
3445
|
-
return
|
|
3506
|
+
}, [e, n]), {
|
|
3507
|
+
data: c,
|
|
3508
|
+
isLoading: s,
|
|
3509
|
+
isError: u
|
|
3510
|
+
} = te(d);
|
|
3511
|
+
return s || !n ? /* @__PURE__ */ a(Te, {}) : ye(n) ? /* @__PURE__ */ a(K, v(C({}, n), {
|
|
3446
3512
|
highlightSelectionDisabled: !0,
|
|
3447
3513
|
onDataReady: t,
|
|
3448
|
-
topSlot:
|
|
3449
|
-
nlgRequest:
|
|
3450
|
-
summary:
|
|
3514
|
+
topSlot: c && !u && /* @__PURE__ */ a(Wi, {
|
|
3515
|
+
nlgRequest: d,
|
|
3516
|
+
summary: c
|
|
3451
3517
|
})
|
|
3452
|
-
})) : /* @__PURE__ */ a(
|
|
3518
|
+
})) : /* @__PURE__ */ a(N, {});
|
|
3453
3519
|
};
|
|
3454
3520
|
(function() {
|
|
3455
3521
|
try {
|
|
@@ -3462,13 +3528,16 @@ const Ni = h.div`
|
|
|
3462
3528
|
}
|
|
3463
3529
|
})();
|
|
3464
3530
|
export {
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3531
|
+
qi as AiContextProvider,
|
|
3532
|
+
Fi as Chatbot,
|
|
3533
|
+
Vi as GetNlgInsights,
|
|
3534
|
+
Qi as GetNlgQueryResult,
|
|
3535
|
+
Ji as NlqChartWidget,
|
|
3536
|
+
$a as useChatSession,
|
|
3537
|
+
Pi as useGetDataSourceFields,
|
|
3538
|
+
Yi as useGetNlgInsights,
|
|
3539
|
+
Hi as useGetNlgQueryResult,
|
|
3540
|
+
Ui as useGetNlqResult,
|
|
3541
|
+
Bi as useGetQueryRecommendations,
|
|
3542
|
+
$i as useLastNlqResponse
|
|
3474
3543
|
};
|