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