@sisense/sdk-ui 1.28.0 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/ai.cjs +32 -32
  2. package/dist/ai.js +567 -554
  3. package/dist/analytics-composer.cjs +1 -1
  4. package/dist/analytics-composer.js +3 -3
  5. package/dist/{derive-chart-family-BYdyoe8O.js → derive-chart-family-Cy3hlluo.js} +15251 -15392
  6. package/dist/{derive-chart-family-BNu7PP-p.cjs → derive-chart-family-DWCXp57c.cjs} +102 -102
  7. package/dist/index.cjs +253 -120
  8. package/dist/index.js +10677 -8687
  9. package/dist/packages/sdk-ui/src/ai/api/hooks.d.ts +2 -1
  10. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +9 -1
  11. package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +3 -2
  12. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +0 -1
  13. package/dist/packages/sdk-ui/src/area-chart.d.ts +1 -1
  14. package/dist/packages/sdk-ui/src/areamap-chart.d.ts +1 -1
  15. package/dist/packages/sdk-ui/src/boxplot-utils.d.ts +3 -2
  16. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +1 -1
  17. package/dist/packages/sdk-ui/src/chart-options-processor/subtype-to-design-options.d.ts +1 -1
  18. package/dist/packages/sdk-ui/src/chart-options-processor/translations/axis-section.d.ts +5 -2
  19. package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -0
  20. package/dist/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.d.ts +3 -1
  21. package/dist/packages/sdk-ui/src/common/components/button.d.ts +10 -0
  22. package/dist/packages/sdk-ui/src/common/components/popover.d.ts +23 -0
  23. package/dist/packages/sdk-ui/src/common/components/radio.d.ts +8 -0
  24. package/dist/packages/sdk-ui/src/common/hooks/use-combined-menu.d.ts +3 -4
  25. package/dist/packages/sdk-ui/src/const.d.ts +1 -0
  26. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  27. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +6 -0
  28. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/index.d.ts +4 -0
  29. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/input.d.ts +5 -0
  30. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/search-input.d.ts +8 -0
  31. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/base.d.ts +14 -0
  32. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/index.d.ts +3 -0
  33. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/multi-select-item.d.ts +7 -0
  34. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-multi-select.d.ts +12 -0
  35. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-single-select.d.ts +12 -0
  36. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select-item.d.ts +7 -0
  37. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select.d.ts +12 -0
  38. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/types.d.ts +7 -0
  39. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/utils.d.ts +4 -0
  40. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/selectable-section.d.ts +11 -0
  41. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-popover.d.ts +12 -0
  42. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor.d.ts +8 -0
  43. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/multi-select-control.d.ts +7 -0
  44. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/include-all-section.d.ts +9 -0
  45. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/members-section.d.ts +11 -0
  46. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/text-condition-section.d.ts +11 -0
  47. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/utils.d.ts +5 -0
  48. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +2 -0
  49. package/dist/packages/sdk-ui/src/filters/components/icons/arrow-down-icon.d.ts +1 -1
  50. package/dist/packages/sdk-ui/src/filters/components/icons/check-icon.d.ts +2 -0
  51. package/dist/packages/sdk-ui/src/filters/components/icons/index.d.ts +1 -0
  52. package/dist/packages/sdk-ui/src/filters/components/icons/search-icon.d.ts +1 -1
  53. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -1
  54. package/dist/packages/sdk-ui/src/filters/helpers.d.ts +1 -122
  55. package/dist/packages/sdk-ui/src/filters/index.d.ts +0 -1
  56. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-totals-formatter.d.ts +4 -0
  57. package/dist/packages/sdk-ui/src/props.d.ts +15 -15
  58. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +29 -0
  59. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +58 -0
  60. package/dist/packages/sdk-ui/src/types.d.ts +27 -2
  61. package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +30 -72
  62. package/dist/packages/sdk-ui/src/widget-by-id/dashboard-widget.d.ts +1 -1
  63. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +1 -2
  64. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +14 -0
  65. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +2 -57
  66. package/dist/useQuery-CRu7WcYd.cjs +916 -0
  67. package/dist/{useQuery-CwqhrvKr.js → useQuery-CdtycPOg.js} +17019 -16985
  68. package/dist/{widget-composer-BvJFwTM1.cjs → widget-composer-DyY3yi_b.cjs} +8 -8
  69. package/dist/{widget-composer-CAmaQCTo.js → widget-composer-G4mPX-JO.js} +112 -110
  70. package/package.json +7 -7
  71. package/dist/useQuery-7UcSPq8U.cjs +0 -915
package/dist/ai.js CHANGED
@@ -1,10 +1,10 @@
1
1
  var ut = Object.defineProperty, ht = Object.defineProperties;
2
2
  var pt = Object.getOwnPropertyDescriptors;
3
3
  var ae = Object.getOwnPropertySymbols;
4
- var Be = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable;
5
- var ye = (e, t, o) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, M = (e, t) => {
4
+ var Fe = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable;
5
+ var ye = (e, t, o) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, w = (e, t) => {
6
6
  for (var o in t || (t = {}))
7
- Be.call(t, o) && ye(e, o, t[o]);
7
+ Fe.call(t, o) && ye(e, o, t[o]);
8
8
  if (ae)
9
9
  for (var o of ae(t))
10
10
  De.call(t, o) && ye(e, o, t[o]);
@@ -13,61 +13,62 @@ var ye = (e, t, o) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writ
13
13
  var Pe = (e, t) => {
14
14
  var o = {};
15
15
  for (var r in e)
16
- Be.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
16
+ Fe.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
17
17
  if (e != null && ae)
18
18
  for (var r of ae(e))
19
19
  t.indexOf(r) < 0 && De.call(e, r) && (o[r] = e[r]);
20
20
  return o;
21
21
  };
22
22
  var R = (e, t, o) => (ye(e, typeof t != "symbol" ? t + "" : t, o), o);
23
- var V = (e, t, o) => new Promise((r, i) => {
24
- var a = (l) => {
23
+ var G = (e, t, o) => new Promise((r, i) => {
24
+ var s = (l) => {
25
25
  try {
26
26
  c(o.next(l));
27
27
  } catch (d) {
28
28
  i(d);
29
29
  }
30
- }, s = (l) => {
30
+ }, a = (l) => {
31
31
  try {
32
32
  c(o.throw(l));
33
33
  } catch (d) {
34
34
  i(d);
35
35
  }
36
- }, c = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, s);
36
+ }, c = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(s, a);
37
37
  c((o = o.apply(e, t)).next());
38
38
  });
39
- import { k as gt, j as Ct, s as ue, be as ft, bf as mt, o as Y, _ as j, bg as Ae, D as bt, bh as xt, l as yt, bi as vt, m as ve, P as f, p as wt, bj as kt, bk as St, bl as Mt, bm as Ze, bn as Lt, bo as te, bp as $t, bq as Tt, br as Rt, aQ as Et, M as Nt, aR as Ht, g as It, b2 as Q, T as he, an as u, ax as E, Z as m, av as ze, ar as Ft, bs as Bt, ay as Ge, bt as Dt, at as Pt, aq as ee, aA as qt, bu as Wt, bv as Ot, Y as $e, bw as At, aM as Zt } from "./useQuery-CwqhrvKr.js";
40
- import { jsx as n, jsxs as g, Fragment as I } from "react/jsx-runtime";
39
+ import { bO as gt, J as Ct, I as ft, K as ue, bP as mt, bQ as bt, Q as Y, q as j, bR as Ae, X as xt, bS as yt, _ as vt, bT as wt, G as ve, P as f, R as kt, bU as St, bV as Mt, bW as Lt, bX as Ze, bY as $t, bZ as te, b_ as Tt, b$ as Rt, c0 as Et, bp as Nt, ab as It, bq as Ht, d as Bt, bC as Q, ah as he, aS as h, b0 as E, an as b, a_ as ze, aW as Ft, c1 as Dt, b1 as Ve, c2 as Pt, aY as Ot, aV as ee, b3 as Wt, c3 as qt, am as $e, c4 as At, bj as Zt, c5 as zt } from "./useQuery-CdtycPOg.js";
40
+ import { jsx as n, jsxs as g, Fragment as H } from "react/jsx-runtime";
41
41
  import * as Z from "react";
42
- import { createContext as Ve, useMemo as D, useContext as je, useCallback as T, useEffect as oe, useState as $, useRef as J, useLayoutEffect as ce, memo as zt, forwardRef as Gt, createElement as Vt } from "react";
43
- import { n as jt, bc as Qt, ad as w, T as ke, u as Qe, V as Se, Z as Ut, bd as _t, q as Kt, r as Yt, b1 as Jt } from "./derive-chart-family-BYdyoe8O.js";
44
- import { t as pe } from "./widget-composer-CAmaQCTo.js";
45
- function Xt(e) {
46
- return Ct("MuiDialog", e);
42
+ import { createContext as Ge, useMemo as D, useContext as je, useCallback as T, useEffect as oe, useState as $, useRef as J, useLayoutEffect as ce, memo as Vt, forwardRef as Gt, createElement as jt } from "react";
43
+ import { x as Qt, a$ as Ut, v as k, T as ke, E as Qe, Y as Se, a0 as _t, b0 as Kt, B as Yt, D as Jt } from "./derive-chart-family-Cy3hlluo.js";
44
+ import { t as pe } from "./widget-composer-G4mPX-JO.js";
45
+ var Xt = gt("toLowerCase");
46
+ function e1(e) {
47
+ return ft("MuiDialog", e);
47
48
  }
48
- const we = gt("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), Ue = /* @__PURE__ */ Z.createContext({});
49
+ const we = Ct("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), Ue = /* @__PURE__ */ Z.createContext({});
49
50
  process.env.NODE_ENV !== "production" && (Ue.displayName = "DialogContext");
50
- const e1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"], t1 = ue(ft, {
51
+ const t1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"], o1 = ue(mt, {
51
52
  name: "MuiDialog",
52
53
  slot: "Backdrop",
53
54
  overrides: (e, t) => t.backdrop
54
55
  })({
55
56
  // Improve scrollable dialog support.
56
57
  zIndex: -1
57
- }), o1 = (e) => {
58
+ }), n1 = (e) => {
58
59
  const {
59
60
  classes: t,
60
61
  scroll: o,
61
62
  maxWidth: r,
62
63
  fullWidth: i,
63
- fullScreen: a
64
- } = e, s = {
64
+ fullScreen: s
65
+ } = e, a = {
65
66
  root: ["root"],
66
67
  container: ["container", `scroll${Y(o)}`],
67
- paper: ["paper", `paperScroll${Y(o)}`, `paperWidth${Y(String(r))}`, i && "paperFullWidth", a && "paperFullScreen"]
68
+ paper: ["paper", `paperScroll${Y(o)}`, `paperWidth${Y(String(r))}`, i && "paperFullWidth", s && "paperFullScreen"]
68
69
  };
69
- return wt(s, Xt, t);
70
- }, n1 = ue(mt, {
70
+ return kt(a, e1, t);
71
+ }, r1 = ue(bt, {
71
72
  name: "MuiDialog",
72
73
  slot: "Root",
73
74
  overridesResolver: (e, t) => t.root
@@ -76,7 +77,7 @@ const e1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
76
77
  // Use !important to override the Modal inline-style.
77
78
  position: "absolute !important"
78
79
  }
79
- }), r1 = ue("div", {
80
+ }), i1 = ue("div", {
80
81
  name: "MuiDialog",
81
82
  slot: "Container",
82
83
  overridesResolver: (e, t) => {
@@ -109,7 +110,7 @@ const e1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
109
110
  height: "100%",
110
111
  width: "0"
111
112
  }
112
- })), i1 = ue(Ae, {
113
+ })), s1 = ue(Ae, {
113
114
  name: "MuiDialog",
114
115
  slot: "Paper",
115
116
  overridesResolver: (e, t) => {
@@ -169,51 +170,51 @@ const e1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
169
170
  maxWidth: "100%"
170
171
  }
171
172
  })), _e = /* @__PURE__ */ Z.forwardRef(function(t, o) {
172
- const r = bt({
173
+ const r = xt({
173
174
  props: t,
174
175
  name: "MuiDialog"
175
- }), i = xt(), a = {
176
+ }), i = yt(), s = {
176
177
  enter: i.transitions.duration.enteringScreen,
177
178
  exit: i.transitions.duration.leavingScreen
178
179
  }, {
179
- "aria-describedby": s,
180
+ "aria-describedby": a,
180
181
  "aria-labelledby": c,
181
182
  BackdropComponent: l,
182
183
  BackdropProps: d,
183
- children: p,
184
- className: C,
185
- disableEscapeKeyDown: h = !1,
186
- fullScreen: b = !1,
187
- fullWidth: v = !1,
188
- maxWidth: S = "sm",
189
- onBackdropClick: x,
190
- onClick: O,
184
+ children: C,
185
+ className: u,
186
+ disableEscapeKeyDown: p = !1,
187
+ fullScreen: m = !1,
188
+ fullWidth: x = !1,
189
+ maxWidth: M = "sm",
190
+ onBackdropClick: y,
191
+ onClick: q,
191
192
  onClose: N,
192
- open: k,
193
- PaperComponent: q = Ae,
194
- PaperProps: F = {},
195
- scroll: B = "paper",
196
- TransitionComponent: G = kt,
197
- transitionDuration: se = a,
193
+ open: S,
194
+ PaperComponent: O = Ae,
195
+ PaperProps: B = {},
196
+ scroll: F = "paper",
197
+ TransitionComponent: V = St,
198
+ transitionDuration: se = s,
198
199
  TransitionProps: fe
199
- } = r, X = yt(r, e1), U = j({}, r, {
200
- disableEscapeKeyDown: h,
201
- fullScreen: b,
202
- fullWidth: v,
203
- maxWidth: S,
204
- scroll: B
205
- }), H = o1(U), _ = Z.useRef(), me = (y) => {
206
- _.current = y.target === y.currentTarget;
207
- }, be = (y) => {
208
- O && O(y), _.current && (_.current = null, x && x(y), N && N(y, "backdropClick"));
209
- }, K = vt(c), xe = Z.useMemo(() => ({
200
+ } = r, X = vt(r, t1), U = j({}, r, {
201
+ disableEscapeKeyDown: p,
202
+ fullScreen: m,
203
+ fullWidth: x,
204
+ maxWidth: M,
205
+ scroll: F
206
+ }), I = n1(U), _ = Z.useRef(), me = (v) => {
207
+ _.current = v.target === v.currentTarget;
208
+ }, be = (v) => {
209
+ q && q(v), _.current && (_.current = null, y && y(v), N && N(v, "backdropClick"));
210
+ }, K = wt(c), xe = Z.useMemo(() => ({
210
211
  titleId: K
211
212
  }), [K]);
212
- return /* @__PURE__ */ n(n1, j({
213
- className: ve(H.root, C),
213
+ return /* @__PURE__ */ n(r1, j({
214
+ className: ve(I.root, u),
214
215
  closeAfterTransition: !0,
215
216
  components: {
216
- Backdrop: t1
217
+ Backdrop: o1
217
218
  },
218
219
  componentsProps: {
219
220
  backdrop: j({
@@ -221,35 +222,35 @@ const e1 = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
221
222
  as: l
222
223
  }, d)
223
224
  },
224
- disableEscapeKeyDown: h,
225
+ disableEscapeKeyDown: p,
225
226
  onClose: N,
226
- open: k,
227
+ open: S,
227
228
  ref: o,
228
229
  onClick: be,
229
230
  ownerState: U
230
231
  }, X, {
231
- children: /* @__PURE__ */ n(G, j({
232
+ children: /* @__PURE__ */ n(V, j({
232
233
  appear: !0,
233
- in: k,
234
+ in: S,
234
235
  timeout: se,
235
236
  role: "presentation"
236
237
  }, fe, {
237
- children: /* @__PURE__ */ n(r1, {
238
- className: ve(H.container),
238
+ children: /* @__PURE__ */ n(i1, {
239
+ className: ve(I.container),
239
240
  onMouseDown: me,
240
241
  ownerState: U,
241
- children: /* @__PURE__ */ n(i1, j({
242
- as: q,
242
+ children: /* @__PURE__ */ n(s1, j({
243
+ as: O,
243
244
  elevation: 24,
244
245
  role: "dialog",
245
- "aria-describedby": s,
246
+ "aria-describedby": a,
246
247
  "aria-labelledby": K
247
- }, F, {
248
- className: ve(H.paper, F.className),
248
+ }, B, {
249
+ className: ve(I.paper, B.className),
249
250
  ownerState: U,
250
251
  children: /* @__PURE__ */ n(Ue.Provider, {
251
252
  value: xe,
252
- children: p
253
+ children: C
253
254
  })
254
255
  }))
255
256
  })
@@ -388,7 +389,7 @@ process.env.NODE_ENV !== "production" && (_e.propTypes = {
388
389
  */
389
390
  TransitionProps: f.object
390
391
  });
391
- class s1 extends St {
392
+ class a1 extends Mt {
392
393
  constructor(t, o) {
393
394
  super(), this.client = t, this.setOptions(o), this.bindMethods(), this.updateResult();
394
395
  }
@@ -398,7 +399,7 @@ class s1 extends St {
398
399
  setOptions(t) {
399
400
  var o;
400
401
  const r = this.options;
401
- this.options = this.client.defaultMutationOptions(t), Mt(r, this.options) || this.client.getMutationCache().notify({
402
+ this.options = this.client.defaultMutationOptions(t), Lt(r, this.options) || this.client.getMutationCache().notify({
402
403
  type: "observerOptionsUpdated",
403
404
  mutation: this.currentMutation,
404
405
  observer: this
@@ -426,12 +427,12 @@ class s1 extends St {
426
427
  });
427
428
  }
428
429
  mutate(t, o) {
429
- return this.mutateOptions = o, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, L(M({}, this.options), {
430
+ return this.mutateOptions = o, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, L(w({}, this.options), {
430
431
  variables: typeof t != "undefined" ? t : this.options.variables
431
432
  })), this.currentMutation.addObserver(this), this.currentMutation.execute();
432
433
  }
433
434
  updateResult() {
434
- const t = this.currentMutation ? this.currentMutation.state : Lt(), o = L(M({}, t), {
435
+ const t = this.currentMutation ? this.currentMutation.state : $t(), o = L(w({}, t), {
435
436
  isLoading: t.status === "loading",
436
437
  isSuccess: t.status === "success",
437
438
  isError: t.status === "error",
@@ -445,44 +446,44 @@ class s1 extends St {
445
446
  Ze.batch(() => {
446
447
  if (this.mutateOptions && this.hasListeners()) {
447
448
  if (t.onSuccess) {
448
- var o, r, i, a;
449
- (o = (r = this.mutateOptions).onSuccess) == null || o.call(r, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (i = (a = this.mutateOptions).onSettled) == null || i.call(a, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
449
+ var o, r, i, s;
450
+ (o = (r = this.mutateOptions).onSuccess) == null || o.call(r, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (i = (s = this.mutateOptions).onSettled) == null || i.call(s, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
450
451
  } else if (t.onError) {
451
- var s, c, l, d;
452
- (s = (c = this.mutateOptions).onError) == null || s.call(c, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (l = (d = this.mutateOptions).onSettled) == null || l.call(d, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
452
+ var a, c, l, d;
453
+ (a = (c = this.mutateOptions).onError) == null || a.call(c, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (l = (d = this.mutateOptions).onSettled) == null || l.call(d, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
453
454
  }
454
455
  }
455
456
  t.listeners && this.listeners.forEach(({
456
- listener: p
457
+ listener: C
457
458
  }) => {
458
- p(this.currentResult);
459
+ C(this.currentResult);
459
460
  });
460
461
  });
461
462
  }
462
463
  }
463
464
  function Te(e, t, o) {
464
- const r = Rt(e, t), i = te({
465
+ const r = Et(e, t), i = te({
465
466
  context: r.context
466
- }), [a] = Z.useState(() => new s1(i, r));
467
+ }), [s] = Z.useState(() => new a1(i, r));
467
468
  Z.useEffect(() => {
468
- a.setOptions(r);
469
- }, [a, r]);
470
- const s = $t(Z.useCallback((l) => a.subscribe(Ze.batchCalls(l)), [a]), () => a.getCurrentResult(), () => a.getCurrentResult()), c = Z.useCallback((l, d) => {
471
- a.mutate(l, d).catch(a1);
472
- }, [a]);
473
- if (s.error && Tt(a.options.useErrorBoundary, [s.error]))
474
- throw s.error;
475
- return L(M({}, s), {
469
+ s.setOptions(r);
470
+ }, [s, r]);
471
+ const a = Tt(Z.useCallback((l) => s.subscribe(Ze.batchCalls(l)), [s]), () => s.getCurrentResult(), () => s.getCurrentResult()), c = Z.useCallback((l, d) => {
472
+ s.mutate(l, d).catch(l1);
473
+ }, [s]);
474
+ if (a.error && Rt(s.options.useErrorBoundary, [a.error]))
475
+ throw a.error;
476
+ return L(w({}, a), {
476
477
  mutate: c,
477
- mutateAsync: s.mutate
478
+ mutateAsync: a.mutate
478
479
  });
479
480
  }
480
- function a1() {
481
+ function l1() {
481
482
  }
482
- class l1 {
483
+ class c1 {
483
484
  constructor(t) {
484
485
  R(this, "httpClient");
485
- R(this, "getChatContexts", () => V(this, null, function* () {
486
+ R(this, "getChatContexts", () => G(this, null, function* () {
486
487
  return (yield this.httpClient.get("api/datasources//")) || [];
487
488
  }));
488
489
  // ==== /v2/ai endpoints ====
@@ -527,60 +528,60 @@ class l1 {
527
528
  this.httpClient = t;
528
529
  }
529
530
  }
530
- const c1 = new Et({
531
+ const d1 = new Nt({
531
532
  defaultOptions: {
532
533
  queries: {
533
534
  refetchOnWindowFocus: !1,
534
535
  refetchOnMount: !1
535
536
  }
536
537
  }
537
- }), Ke = Ve(void 0), P = () => je(Ke), d1 = ({ children: e }) => {
538
- const { app: t } = Nt(), o = D(() => t ? new l1(t.httpClient) : void 0, [t]);
539
- return /* @__PURE__ */ n(Ke.Provider, { value: o, children: /* @__PURE__ */ n(Ht, { client: c1, children: e }) });
538
+ }), Ke = Ge(void 0), P = () => je(Ke), u1 = ({ children: e }) => {
539
+ const { app: t } = It(), o = D(() => t ? new c1(t.httpClient) : void 0, [t]);
540
+ return /* @__PURE__ */ n(Ke.Provider, { value: o, children: /* @__PURE__ */ n(Ht, { client: d1, children: e }) });
540
541
  };
541
542
  function kn({ children: e }) {
542
- return /* @__PURE__ */ n(d1, { children: e });
543
+ return /* @__PURE__ */ n(u1, { children: e });
543
544
  }
544
545
  const ne = (e, t = !0) => {
545
546
  const o = D(() => {
546
- var p, C;
547
+ var C, u;
547
548
  if ("jaql" in e)
548
549
  return e;
549
550
  {
550
- const h = Qt(e.dataSource), { filters: b = [], relations: v } = jt(e.filters), { metadata: S, filterRelations: x } = It(
551
+ const p = Ut(e.dataSource), { filters: m = [], relations: x } = Qt(e.filters), { metadata: M, filterRelations: y } = Bt(
551
552
  {
552
553
  dataSource: e.dataSource,
553
- attributes: (p = e.dimensions) != null ? p : [],
554
- measures: (C = e.measures) != null ? C : [],
555
- filters: b,
556
- filterRelations: v,
554
+ attributes: (C = e.dimensions) != null ? C : [],
555
+ measures: (u = e.measures) != null ? u : [],
556
+ filters: m,
557
+ filterRelations: x,
557
558
  highlights: []
558
559
  },
559
560
  !0
560
561
  );
561
562
  return {
562
563
  jaql: {
563
- datasource: h,
564
- metadata: S,
565
- filterRelations: x
564
+ datasource: p,
565
+ metadata: M,
566
+ filterRelations: y
566
567
  }
567
568
  };
568
569
  }
569
- }, [e]), r = P(), { data: i, error: a, isError: s, isLoading: c, isSuccess: l, refetch: d } = Q({
570
+ }, [e]), r = P(), { data: i, error: s, isError: a, isLoading: c, isSuccess: l, refetch: d } = Q({
570
571
  queryKey: ["getNlgInsights", o, r],
571
572
  queryFn: () => r == null ? void 0 : r.ai.getNlgInsights(o),
572
- select: (p) => {
573
- var C;
574
- return (C = p == null ? void 0 : p.data) == null ? void 0 : C.answer;
573
+ select: (C) => {
574
+ var u;
575
+ return (u = C == null ? void 0 : C.data) == null ? void 0 : u.answer;
575
576
  },
576
577
  enabled: !!r && t
577
578
  });
578
579
  return {
579
580
  isLoading: c,
580
- isError: s,
581
+ isError: a,
581
582
  isSuccess: l,
582
583
  data: i,
583
- error: a,
584
+ error: s,
584
585
  refetch: T(() => {
585
586
  d();
586
587
  }, [d])
@@ -592,57 +593,57 @@ const ne = (e, t = !0) => {
592
593
  Ye
593
594
  ), Mn = he("useGetNlgQueryResult")(
594
595
  Ye
595
- ), u1 = [
596
+ ), h1 = [
596
597
  "indicator",
597
598
  "column",
598
599
  "line",
599
600
  "table",
600
601
  "pie",
601
602
  "bar"
602
- ], h1 = (e) => {
603
- const { dataSource: t, query: o, chartTypes: r } = e, i = typeof t == "string" ? t : t.title, a = P(), { isLoading: s, isError: c, isSuccess: l, data: d, error: p, refetch: C } = Q({
604
- queryKey: ["getNlqResult", t, o, r, a],
605
- queryFn: () => a == null ? void 0 : a.ai.getNlqResult(i, {
603
+ ], p1 = (e) => {
604
+ const { dataSource: t, query: o, chartTypes: r } = e, i = typeof t == "string" ? t : t.title, s = P(), { isLoading: a, isError: c, isSuccess: l, data: d, error: C, refetch: u } = Q({
605
+ queryKey: ["getNlqResult", t, o, r, s],
606
+ queryFn: () => s == null ? void 0 : s.ai.getNlqResult(i, {
606
607
  text: o,
607
608
  // Per @Einat Shusterman: Timezone is not used by AI API, but it is currently required by the endpoint
608
609
  timezone: "UTC",
609
- chartTypes: r != null ? r : [...u1]
610
+ chartTypes: r != null ? r : [...h1]
610
611
  }),
611
- enabled: !!a && e.enabled
612
- }), h = d ? pe(d, {
612
+ enabled: !!s && e.enabled
613
+ }), p = d ? pe(d, {
613
614
  useCustomizedStyleOptions: e.enableAxisTitlesInWidgetProps || !1
614
615
  }) : void 0;
615
616
  return {
616
- isLoading: s,
617
+ isLoading: a,
617
618
  isError: c,
618
619
  isSuccess: l,
619
- data: h,
620
- error: p,
620
+ data: p,
621
+ error: C,
621
622
  refetch: T(() => {
622
- C();
623
- }, [C])
623
+ u();
624
+ }, [u])
624
625
  };
625
- }, Ln = he("useGetNlqResult")(h1), Je = (e) => {
626
- const { contextTitle: t, count: o, enableAxisTitlesInWidgetProps: r } = e, i = P(), a = o != null ? o : 4, s = a > 0, { isLoading: c, isError: l, isSuccess: d, data: p, error: C, refetch: h } = Q({
627
- queryKey: ["getQueryRecommendations", t, a, i],
628
- queryFn: () => i == null ? void 0 : i.ai.getQueryRecommendations(t, {
626
+ }, Ln = he("useGetNlqResult")(p1), Je = (e) => {
627
+ const { contextTitle: t, count: o, enableAxisTitlesInWidgetProps: r, enabled: i } = e, s = P(), a = o != null ? o : 4, c = (i === void 0 || i === !0) && a > 0, { isLoading: l, isError: d, isSuccess: C, data: u, error: p, refetch: m } = Q({
628
+ queryKey: ["getQueryRecommendations", t, a, s],
629
+ queryFn: () => s == null ? void 0 : s.ai.getQueryRecommendations(t, {
629
630
  numOfRecommendations: a
630
631
  }),
631
- enabled: !!i && s
632
+ enabled: !!s && c
632
633
  });
633
- return p == null || p.map((b) => {
634
- b.widgetProps = b.jaql ? pe(b, {
634
+ return u == null || u.map((x) => {
635
+ x.widgetProps = x.jaql ? pe(x, {
635
636
  useCustomizedStyleOptions: r
636
637
  }) : void 0;
637
638
  }), {
638
- isLoading: s ? c : !1,
639
- isError: s ? l : !1,
640
- isSuccess: s ? d : !1,
641
- data: s && p ? p : [],
642
- error: s ? C : null,
639
+ isLoading: c ? l : !1,
640
+ isError: d,
641
+ isSuccess: C,
642
+ data: u != null ? u : void 0,
643
+ error: p,
643
644
  refetch: T(() => {
644
- s && h();
645
- }, [h, s])
645
+ m();
646
+ }, [m])
646
647
  };
647
648
  }, $n = he("useGetQueryRecommendations")(
648
649
  Je
@@ -652,21 +653,21 @@ const ne = (e, t = !0) => {
652
653
  enableInsights: !0,
653
654
  numOfRecommendations: 4,
654
655
  numOfRecentPrompts: 5
655
- }), et = Ve(M({}, Xe)), W = () => je(et), p1 = ({ children: e, value: t }) => {
656
- const { t: o } = w(), r = Object.entries(t).reduce(
657
- (i, [a, s]) => (s !== void 0 && (i[a] = s), i),
658
- L(M({}, Xe), {
656
+ }), et = Ge(w({}, Xe)), W = () => je(et), g1 = ({ children: e, value: t }) => {
657
+ const { t: o } = k(), r = Object.entries(t).reduce(
658
+ (i, [s, a]) => (a !== void 0 && (i[s] = a), i),
659
+ L(w({}, Xe), {
659
660
  inputPromptText: o("ai.config.inputPromptText"),
660
661
  welcomeText: o("ai.config.welcomeText"),
661
662
  suggestionsWelcomeText: o("ai.config.suggestionsWelcomeText")
662
663
  })
663
664
  );
664
665
  return /* @__PURE__ */ n(et.Provider, { value: r, children: e });
665
- }, Re = "chatHistory", g1 = (e) => {
666
+ }, Re = "chatHistory", C1 = (e) => {
666
667
  const t = P(), { hideHistory: o } = W();
667
668
  return Q({
668
669
  queryKey: [Re, e, t],
669
- queryFn: () => V(void 0, null, function* () {
670
+ queryFn: () => G(void 0, null, function* () {
670
671
  if (!t || !e)
671
672
  return;
672
673
  if (o)
@@ -679,7 +680,7 @@ const ne = (e, t = !0) => {
679
680
  }, tt = (e) => {
680
681
  const t = P(), o = te();
681
682
  return Te({
682
- mutationFn: () => V(void 0, null, function* () {
683
+ mutationFn: () => G(void 0, null, function* () {
683
684
  if (!(!t || !e))
684
685
  return t.ai.chat.clearHistory(e);
685
686
  }),
@@ -691,7 +692,7 @@ const ne = (e, t = !0) => {
691
692
  }
692
693
  });
693
694
  }, ot = (e) => {
694
- const { data: t, isLoading: o, isError: r } = g1(e), { mutate: i } = tt(e);
695
+ const { data: t, isLoading: o, isError: r } = C1(e), { mutate: i } = tt(e);
695
696
  return oe(() => {
696
697
  r && i();
697
698
  }, [r, i]), {
@@ -702,7 +703,7 @@ const ne = (e, t = !0) => {
702
703
  }, nt = () => {
703
704
  const e = P(), { data: t, isLoading: o, fetchStatus: r } = Q({
704
705
  queryKey: ["getDataTopics", e],
705
- queryFn: () => V(void 0, null, function* () {
706
+ queryFn: () => G(void 0, null, function* () {
706
707
  if (e)
707
708
  return e.getChatContexts();
708
709
  }),
@@ -719,9 +720,9 @@ const ne = (e, t = !0) => {
719
720
  data: t != null ? t : [],
720
721
  isLoading: o
721
722
  };
722
- }, C1 = (e, t) => {
723
+ }, f1 = (e, t) => {
723
724
  const o = te(), r = P(), i = Te({
724
- mutationFn: () => V(void 0, null, function* () {
725
+ mutationFn: () => G(void 0, null, function* () {
725
726
  if (!(!r || !e))
726
727
  return r.ai.chat.create(e);
727
728
  }),
@@ -730,7 +731,7 @@ const ne = (e, t = !0) => {
730
731
  return oe(() => {
731
732
  t && i.isIdle && i.mutate();
732
733
  }, [t, i]), i;
733
- }, f1 = (e, t) => {
734
+ }, m1 = (e, t) => {
734
735
  switch (e.responseType = e.responseType.toLowerCase(), e.responseType) {
735
736
  case "nlq":
736
737
  return {
@@ -747,16 +748,16 @@ const ne = (e, t = !0) => {
747
748
  default:
748
749
  throw Error(`${t}${JSON.stringify(e)}`);
749
750
  }
750
- }, m1 = (e, t) => {
751
+ }, b1 = (e, t) => {
751
752
  const o = te(), r = T(
752
753
  (l) => {
753
754
  e && o.setQueriesData([Re, e], (d) => d && [...d, l]);
754
755
  },
755
756
  [o, e]
756
- ), { t: i } = w(), a = P(), { mutate: s, isLoading: c } = Te({
757
- mutationFn: (l) => V(void 0, null, function* () {
758
- if (!(!a || !e))
759
- return a.ai.chat.post(e, {
757
+ ), { t: i } = k(), s = P(), { mutate: a, isLoading: c } = Te({
758
+ mutationFn: (l) => G(void 0, null, function* () {
759
+ if (!(!s || !e))
760
+ return s.ai.chat.post(e, {
760
761
  text: l,
761
762
  options: { enableFollowup: t }
762
763
  });
@@ -769,7 +770,9 @@ const ne = (e, t = !0) => {
769
770
  },
770
771
  onError: (l) => {
771
772
  l instanceof Error && (console.error("Error when sending message:", l.message), r({
772
- content: i("errors.unexpectedChatResponse"),
773
+ content: i(`ai.errors.${l.interpolationOptions.errorCode}`, {
774
+ defaultValue: i("ai.errors.unexpectedChatResponse")
775
+ }),
773
776
  role: "assistant"
774
777
  }));
775
778
  },
@@ -777,49 +780,49 @@ const ne = (e, t = !0) => {
777
780
  if (!l)
778
781
  return;
779
782
  const d = i("ai.errors.unknownResponse");
780
- r(f1(l, d));
783
+ r(m1(l, d));
781
784
  }
782
785
  });
783
- return { mutate: s, isLoading: c };
784
- }, Ee = (e) => !!e && "type" in e && e.type === "nlq", b1 = (e) => !!e && "type" in e && e.type === "text", x1 = (e) => {
785
- var q, F;
786
- const { t } = w(), { enableFollowupQuestions: o } = W(), { data: r, isLoading: i } = nt(), { data: a, isLoading: s } = rt(), c = (q = r == null ? void 0 : r.find((B) => B.title === e)) == null ? void 0 : q.title, l = (F = a.find((B) => B.contextTitle === c)) == null ? void 0 : F.chatId, d = i || !!c, p = s || !!l, [C, h] = $(null), { isError: b } = C1(
786
+ return { mutate: a, isLoading: c };
787
+ }, Ee = (e) => !!e && "type" in e && e.type === "nlq", x1 = (e) => !!e && "type" in e && e.type === "text", y1 = (e) => {
788
+ var O, B;
789
+ const { t } = k(), { enableFollowupQuestions: o } = W(), { data: r, isLoading: i } = nt(), { data: s, isLoading: a } = rt(), c = (O = r == null ? void 0 : r.find((F) => F.title === e)) == null ? void 0 : O.title, l = (B = s.find((F) => F.contextTitle === c)) == null ? void 0 : B.chatId, d = i || !!c, C = a || !!l, [u, p] = $(null), { isError: m } = f1(
787
790
  c,
788
- d && !p
789
- ), { history: v, isLoading: S, isError: x } = ot(l);
791
+ d && !C
792
+ ), { history: x, isLoading: M, isError: y } = ot(l);
790
793
  oe(() => {
791
- b ? h(new ke("ai.errors.chatUnavailable")) : x && h(new ke("ai.errors.fetchHistory"));
792
- }, [b, x, t]);
793
- const { mutate: O, isLoading: N } = m1(
794
+ m ? p(new ke("ai.errors.chatUnavailable")) : y && p(new ke("ai.errors.fetchHistory"));
795
+ }, [m, y, t]);
796
+ const { mutate: q, isLoading: N } = b1(
794
797
  l,
795
798
  o
796
- ), k = D(() => {
797
- if (v != null && v.length) {
798
- const B = v[v.length - 1];
799
- if (Ee(B))
800
- return JSON.parse(B.content);
799
+ ), S = D(() => {
800
+ if (x != null && x.length) {
801
+ const F = x[x.length - 1];
802
+ if (Ee(F))
803
+ return JSON.parse(F.content);
801
804
  }
802
805
  return null;
803
- }, [v]);
806
+ }, [x]);
804
807
  return {
805
808
  chatId: l,
806
- history: v != null ? v : [],
807
- lastNlqResponse: k,
808
- sendMessage: O,
809
+ history: x != null ? x : [],
810
+ lastNlqResponse: S,
811
+ sendMessage: q,
809
812
  isAwaitingResponse: N,
810
- isLoading: S,
811
- lastError: C
813
+ isLoading: M,
814
+ lastError: u
812
815
  };
813
816
  }, Tn = ({
814
817
  contextTitle: e
815
818
  }) => {
816
819
  var i;
817
- const { data: t } = rt(), o = (i = t.find((a) => a.contextTitle === e)) == null ? void 0 : i.chatId, { history: r } = ot(o);
820
+ const { data: t } = rt(), o = (i = t.find((s) => s.contextTitle === e)) == null ? void 0 : i.chatId, { history: r } = ot(o);
818
821
  return D(() => {
819
822
  if (r != null && r.length) {
820
- const a = r[r.length - 1];
821
- if (Ee(a))
822
- return JSON.parse(a.content);
823
+ const s = r[r.length - 1];
824
+ if (Ee(s))
825
+ return JSON.parse(s.content);
823
826
  }
824
827
  return null;
825
828
  }, [r]);
@@ -834,7 +837,7 @@ const ne = (e, t = !0) => {
834
837
  data: o,
835
838
  isLoading: r
836
839
  };
837
- }, y1 = 500, v1 = 500, w1 = 500, k1 = 900, S1 = u.div`
840
+ }, v1 = 500, w1 = 500, k1 = 500, S1 = 900, M1 = h.div`
838
841
  box-sizing: border-box;
839
842
  position: relative;
840
843
  display: flex;
@@ -844,10 +847,10 @@ const ne = (e, t = !0) => {
844
847
  background-color: ${({ theme: e }) => e.aiChat.backgroundColor};
845
848
  overflow: hidden;
846
849
 
847
- min-width: ${y1}px;
848
- min-height: ${v1}px;
849
- width: ${({ width: e }) => e ? qe(e) : `${w1}px`};
850
- height: ${({ height: e }) => e ? qe(e) : `${k1}px`};
850
+ min-width: ${v1}px;
851
+ min-height: ${w1}px;
852
+ width: ${({ width: e }) => e ? Oe(e) : `${k1}px`};
853
+ height: ${({ height: e }) => e ? Oe(e) : `${S1}px`};
851
854
 
852
855
  ${({ theme: e }) => E`
853
856
  font-size: ${e.aiChat.primaryFontSize[0]};
@@ -855,10 +858,10 @@ const ne = (e, t = !0) => {
855
858
  `}
856
859
  border: ${({ theme: e }) => e.aiChat.border === !1 ? "none" : e.aiChat.border};
857
860
  `;
858
- function qe(e) {
861
+ function Oe(e) {
859
862
  return typeof e == "number" ? `${e}px` : e;
860
863
  }
861
- function M1({ spin: e }) {
864
+ function L1({ spin: e }) {
862
865
  return /* @__PURE__ */ g(
863
866
  "svg",
864
867
  {
@@ -893,9 +896,9 @@ function M1({ spin: e }) {
893
896
  );
894
897
  }
895
898
  function ge() {
896
- return /* @__PURE__ */ n("div", { className: "csdk-m-auto", "aria-label": "loading spinner", children: /* @__PURE__ */ n(M1, { spin: !0 }) });
899
+ return /* @__PURE__ */ n("div", { className: "csdk-m-auto", "aria-label": "loading spinner", children: /* @__PURE__ */ n(L1, { spin: !0 }) });
897
900
  }
898
- function L1({ theme: e }) {
901
+ function $1({ theme: e }) {
899
902
  return /* @__PURE__ */ n("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n(
900
903
  "path",
901
904
  {
@@ -904,7 +907,7 @@ function L1({ theme: e }) {
904
907
  }
905
908
  ) });
906
909
  }
907
- function $1({ theme: e }) {
910
+ function T1({ theme: e }) {
908
911
  const t = e.aiChat.icons.color;
909
912
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: [
910
913
  /* @__PURE__ */ n(
@@ -930,11 +933,11 @@ function $1({ theme: e }) {
930
933
  )
931
934
  ] });
932
935
  }
933
- const T1 = u.div`
936
+ const R1 = h.div`
934
937
  display: flex;
935
938
  flex-direction: column;
936
939
  row-gap: 4px;
937
- `, R1 = u.div`
940
+ `, E1 = h.div`
938
941
  font-size: 11px;
939
942
  line-height: 18px;
940
943
  font-weight: 300;
@@ -944,7 +947,7 @@ const T1 = u.div`
944
947
  &:hover {
945
948
  background-color: ${({ theme: e }) => e.aiChat.dropup.headers.hover.backgroundColor};
946
949
  }
947
- `, E1 = u.div`
950
+ `, N1 = h.div`
948
951
  font-size: ${({ theme: e }) => e.aiChat.primaryFontSize[0]};
949
952
  line-height: ${({ theme: e }) => e.aiChat.primaryFontSize[1]};
950
953
  color: ${({ theme: e }) => e.aiChat.dropup.items.textColor};
@@ -954,19 +957,19 @@ const T1 = u.div`
954
957
  background-color: ${({ theme: e }) => e.aiChat.dropup.items.hover.backgroundColor};
955
958
  }
956
959
  `;
957
- function N1({
960
+ function I1({
958
961
  title: e,
959
962
  items: t,
960
963
  onSelect: o,
961
964
  alwaysExpanded: r = !1
962
965
  }) {
963
- const [i, a] = $(!1), { themeSettings: s } = m();
964
- return /* @__PURE__ */ g(T1, { children: [
965
- /* @__PURE__ */ n(R1, { onClick: () => a((c) => !c), theme: s, children: e.toUpperCase() }),
966
- (i || r) && t.map((c, l) => /* @__PURE__ */ n(E1, { onClick: () => o(c), theme: s, children: c }, l))
966
+ const [i, s] = $(!1), { themeSettings: a } = b();
967
+ return /* @__PURE__ */ g(R1, { children: [
968
+ /* @__PURE__ */ n(E1, { onClick: () => s((c) => !c), theme: a, children: e.toUpperCase() }),
969
+ (i || r) && t.map((c, l) => /* @__PURE__ */ n(N1, { onClick: () => o(c), theme: a, children: c }, l))
967
970
  ] });
968
971
  }
969
- const H1 = u.div`
972
+ const H1 = h.div`
970
973
  font-family: ${({ theme: e }) => e.typography.fontFamily};
971
974
  font-size: ${({ theme: e }) => e.aiChat.primaryFontSize[0]};
972
975
  line-height: ${({ theme: e }) => e.aiChat.primaryFontSize[1]};
@@ -978,7 +981,7 @@ const H1 = u.div`
978
981
  display: flex;
979
982
  flex-direction: column;
980
983
  row-gap: 4px;
981
- `, I1 = u.div`
984
+ `, B1 = h.div`
982
985
  font-size: ${({ theme: e }) => e.aiChat.primaryFontSize[0]};
983
986
  line-height: ${({ theme: e }) => e.aiChat.primaryFontSize[1]};
984
987
  color: ${({ theme: e }) => e.aiChat.dropup.items.textColor};
@@ -990,8 +993,8 @@ function F1({
990
993
  isLoading: o,
991
994
  onSelection: r,
992
995
  anchorEl: i,
993
- text: a,
994
- recommendationsError: s
996
+ text: s,
997
+ recommendationsError: a
995
998
  }) {
996
999
  const l = [
997
1000
  {
@@ -1005,12 +1008,12 @@ function F1({
1005
1008
  onSelect: r
1006
1009
  }
1007
1010
  ].filter(
1008
- (h) => h.title.slice(0, a.length) === a
1009
- ), { themeSettings: d } = m(), { t: p } = w(), C = l.length === 1;
1011
+ (p) => p.title.slice(0, s.length) === s
1012
+ ), { themeSettings: d } = b(), { t: C } = k(), u = l.length === 1;
1010
1013
  return /* @__PURE__ */ n(
1011
1014
  ze,
1012
1015
  {
1013
- open: Me(a) && l.length > 0,
1016
+ open: Me(s) && l.length > 0,
1014
1017
  anchorEl: i,
1015
1018
  placement: "top-start",
1016
1019
  modifiers: [
@@ -1024,14 +1027,14 @@ function F1({
1024
1027
  sx: { zIndex: 3 },
1025
1028
  children: /* @__PURE__ */ g(H1, { style: { width: i == null ? void 0 : i.offsetWidth }, theme: d, children: [
1026
1029
  o && /* @__PURE__ */ n(ge, {}),
1027
- !o && !s && l.map((h) => /* @__PURE__ */ n(N1, L(M({}, h), { alwaysExpanded: C }), h.title)),
1028
- s && /* @__PURE__ */ n(I1, { theme: d, children: p("ai.errors.recommendationsNotAvailable") })
1030
+ !o && !a && l.map((p) => /* @__PURE__ */ n(I1, L(w({}, p), { alwaysExpanded: u }), p.title)),
1031
+ a && /* @__PURE__ */ n(B1, { theme: d, children: C("ai.errors.recommendationsNotAvailable") })
1029
1032
  ] })
1030
1033
  }
1031
1034
  );
1032
1035
  }
1033
1036
  function re({ title: e, placement: t = "top", children: o }) {
1034
- const { themeSettings: r } = m();
1037
+ const { themeSettings: r } = b();
1035
1038
  return /* @__PURE__ */ n(
1036
1039
  Ft,
1037
1040
  {
@@ -1063,19 +1066,19 @@ function re({ title: e, placement: t = "top", children: o }) {
1063
1066
  }
1064
1067
  );
1065
1068
  }
1066
- const B1 = 500, D1 = u.div`
1069
+ const D1 = 500, P1 = h.div`
1067
1070
  display: flex;
1068
1071
  flex-direction: row;
1069
1072
  align-items: flex-end;
1070
1073
  justify-content: space-between;
1071
1074
 
1072
1075
  background-color: ${({ theme: e }) => e.aiChat.backgroundColor};
1073
- `, P1 = u.button`
1076
+ `, O1 = h.button`
1074
1077
  height: 34px;
1075
1078
  background-color: inherit;
1076
1079
  cursor: pointer;
1077
1080
  border: none;
1078
- `, q1 = u.textarea`
1081
+ `, W1 = h.textarea`
1079
1082
  font-size: inherit;
1080
1083
  line-height: inherit;
1081
1084
  resize: none;
@@ -1103,7 +1106,7 @@ const B1 = 500, D1 = u.div`
1103
1106
  color: ${({ theme: e }) => e.aiChat.primaryTextColor};
1104
1107
 
1105
1108
  background-color: ${({ theme: e }) => e.aiChat.input.backgroundColor};
1106
- `, W1 = u.button`
1109
+ `, q1 = h.button`
1107
1110
  height: 34px;
1108
1111
  background-color: inherit;
1109
1112
  border-style: none;
@@ -1117,104 +1120,104 @@ const B1 = 500, D1 = u.div`
1117
1120
  opacity: 1;
1118
1121
  cursor: pointer;
1119
1122
  `}
1120
- `, O1 = 34;
1121
- function A1({
1123
+ `, A1 = 34;
1124
+ function Z1({
1122
1125
  onSendMessage: e,
1123
1126
  onClearHistoryClick: t,
1124
1127
  disabled: o,
1125
1128
  recentPrompts: r,
1126
1129
  suggestions: i,
1127
- isLoading: a,
1128
- recommendationsError: s,
1130
+ isLoading: s,
1131
+ recommendationsError: a,
1129
1132
  onChange: c
1130
1133
  }) {
1131
- const [l, d] = $(""), { inputPromptText: p } = W(), C = T(() => {
1134
+ const [l, d] = $(""), { inputPromptText: C } = W(), u = T(() => {
1132
1135
  if (o)
1133
1136
  return;
1134
1137
  if (Me(l)) {
1135
1138
  d("");
1136
1139
  return;
1137
1140
  }
1138
- const k = l.trim();
1139
- k.length !== 0 && (e(k), d(""));
1140
- }, [o, e, l]), h = T(
1141
- (k) => {
1142
- e(k), d("");
1141
+ const S = l.trim();
1142
+ S.length !== 0 && (e(S), d(""));
1143
+ }, [o, e, l]), p = T(
1144
+ (S) => {
1145
+ e(S), d("");
1143
1146
  },
1144
1147
  [e]
1145
- ), b = T(
1146
- (k) => {
1147
- k.key === "Enter" ? (k.preventDefault(), C()) : k.key === "Escape" && Me(l) && d("");
1148
+ ), m = T(
1149
+ (S) => {
1150
+ S.key === "Enter" ? (S.preventDefault(), u()) : S.key === "Escape" && Me(l) && d("");
1148
1151
  },
1149
- [C, l]
1150
- ), v = T(
1151
- (k) => {
1152
- c == null || c(k.target.value), d(k.target.value);
1152
+ [u, l]
1153
+ ), x = T(
1154
+ (S) => {
1155
+ c == null || c(S.target.value), d(S.target.value);
1153
1156
  },
1154
1157
  [c]
1155
- ), S = J(null);
1158
+ ), M = J(null);
1156
1159
  ce(() => {
1157
- S.current && (S.current.style.height = "inherit", S.current.style.height = `${Math.max(
1158
- S.current.scrollHeight + 2,
1160
+ M.current && (M.current.style.height = "inherit", M.current.style.height = `${Math.max(
1161
+ M.current.scrollHeight + 2,
1159
1162
  // account for 1px top/bottom border
1160
- O1
1163
+ A1
1161
1164
  )}px`);
1162
1165
  }, [l]), ce(() => {
1163
- S.current && S.current.focus({ preventScroll: !0 });
1166
+ M.current && M.current.focus({ preventScroll: !0 });
1164
1167
  }, []);
1165
- const { themeSettings: x } = m(), { t: O } = w(), N = T((k) => {
1166
- var q;
1167
- if ((q = document.getElementById("csdk-chatbot-frame")) != null && q.contains(k.relatedTarget)) {
1168
- const F = (B) => {
1169
- var G;
1170
- document.removeEventListener("mouseup", F), document.removeEventListener("keyup", F), B.type === "mouseup" && ((G = document.getSelection()) == null ? void 0 : G.type) !== "Range" && k.target.focus({ preventScroll: !0 });
1168
+ const { themeSettings: y } = b(), { t: q } = k(), N = T((S) => {
1169
+ var O;
1170
+ if ((O = document.getElementById("csdk-chatbot-frame")) != null && O.contains(S.relatedTarget)) {
1171
+ const B = (F) => {
1172
+ var V;
1173
+ document.removeEventListener("mouseup", B), document.removeEventListener("keyup", B), F.type === "mouseup" && ((V = document.getSelection()) == null ? void 0 : V.type) !== "Range" && S.target.focus({ preventScroll: !0 });
1171
1174
  };
1172
- document.addEventListener("mouseup", F), document.addEventListener("keyup", F);
1175
+ document.addEventListener("mouseup", B), document.addEventListener("keyup", B);
1173
1176
  }
1174
1177
  }, []);
1175
- return /* @__PURE__ */ g(D1, { theme: x, children: [
1178
+ return /* @__PURE__ */ g(P1, { theme: y, children: [
1176
1179
  /* @__PURE__ */ n(
1177
1180
  F1,
1178
1181
  {
1179
1182
  recentPrompts: r,
1180
1183
  suggestions: i,
1181
- isLoading: a,
1182
- onSelection: h,
1183
- anchorEl: S.current,
1184
+ isLoading: s,
1185
+ onSelection: p,
1186
+ anchorEl: M.current,
1184
1187
  text: l,
1185
- recommendationsError: s
1188
+ recommendationsError: a
1186
1189
  }
1187
1190
  ),
1188
- t && /* @__PURE__ */ n(re, { title: O("ai.buttons.clearChat"), placement: "bottom-start", children: /* @__PURE__ */ n(P1, { "aria-label": "clear history", onClick: t, children: /* @__PURE__ */ n($1, { theme: x }) }) }),
1191
+ t && /* @__PURE__ */ n(re, { title: q("ai.buttons.clearChat"), placement: "bottom-start", children: /* @__PURE__ */ n(O1, { "aria-label": "clear history", onClick: t, children: /* @__PURE__ */ n(T1, { theme: y }) }) }),
1189
1192
  /* @__PURE__ */ n(
1190
- q1,
1193
+ W1,
1191
1194
  {
1192
1195
  "aria-label": "chat input",
1193
1196
  onBlur: N,
1194
- maxLength: B1,
1195
- ref: S,
1197
+ maxLength: D1,
1198
+ ref: M,
1196
1199
  rows: 1,
1197
- onChange: v,
1200
+ onChange: x,
1198
1201
  spellCheck: "true",
1199
- placeholder: p,
1202
+ placeholder: C,
1200
1203
  value: l,
1201
- onKeyDown: b,
1202
- theme: x
1204
+ onKeyDown: m,
1205
+ theme: y
1203
1206
  }
1204
1207
  ),
1205
1208
  /* @__PURE__ */ n(
1206
- W1,
1209
+ q1,
1207
1210
  {
1208
1211
  "aria-label": "send chat message",
1209
1212
  disabled: o || l.length === 0,
1210
- onClick: C,
1211
- theme: x,
1212
- children: /* @__PURE__ */ n("span", { "data-state": "closed", children: /* @__PURE__ */ n(L1, { theme: x }) })
1213
+ onClick: u,
1214
+ theme: y,
1215
+ children: /* @__PURE__ */ n("span", { "data-state": "closed", children: /* @__PURE__ */ n($1, { theme: y }) })
1213
1216
  }
1214
1217
  )
1215
1218
  ] });
1216
1219
  }
1217
- const Z1 = u.div`
1220
+ const z1 = h.div`
1218
1221
  display: flex;
1219
1222
 
1220
1223
  ${({ align: e }) => e === "right" ? E`
@@ -1222,7 +1225,7 @@ const Z1 = u.div`
1222
1225
  ` : E`
1223
1226
  justify-content: flex-start;
1224
1227
  `}
1225
- `, it = u.div`
1228
+ `, it = h.div`
1226
1229
  font-size: inherit;
1227
1230
  line-height: inherit;
1228
1231
  padding-top: 8.5px;
@@ -1248,36 +1251,36 @@ const Z1 = u.div`
1248
1251
  color: ${({ theme: e }) => e.aiChat.primaryTextColor};
1249
1252
  background-color: ${({ theme: e, align: t }) => t === "right" ? e.aiChat.userMessages.backgroundColor : e.aiChat.systemMessages.backgroundColor};
1250
1253
  `, z = ({ align: e, children: t }) => {
1251
- const { themeSettings: o } = m();
1252
- return /* @__PURE__ */ n(Z1, { theme: o, align: e, children: /* @__PURE__ */ n(it, { theme: o, align: e, children: t }) });
1254
+ const { themeSettings: o } = b();
1255
+ return /* @__PURE__ */ n(z1, { theme: o, align: e, children: /* @__PURE__ */ n(it, { theme: o, align: e, children: t }) });
1253
1256
  };
1254
- function z1() {
1257
+ function V1() {
1255
1258
  const { welcomeText: e } = W();
1256
1259
  return e === !1 ? null : /* @__PURE__ */ n(z, { align: "left", children: e });
1257
1260
  }
1258
- const G1 = u.div`
1261
+ const G1 = h.div`
1259
1262
  margin: auto;
1260
1263
  display: flex;
1261
1264
  flex-direction: column;
1262
1265
  align-items: center;
1263
1266
  row-gap: 21px;
1264
- `, V1 = u.div`
1267
+ `, j1 = h.div`
1265
1268
  color: ${({ theme: e }) => e.aiChat.primaryTextColor};
1266
1269
  text-align: center;
1267
1270
  font-weight: 600;
1268
- `, j1 = u.div`
1271
+ `, Q1 = h.div`
1269
1272
  color: rgba(54, 163, 217, 1);
1270
1273
  cursor: pointer;
1271
1274
  `;
1272
1275
  function st({ text: e, action: t }) {
1273
- const { themeSettings: o } = m();
1276
+ const { themeSettings: o } = b();
1274
1277
  return /* @__PURE__ */ g(G1, { children: [
1275
- /* @__PURE__ */ n(V1, { theme: o, children: e }),
1276
- /* @__PURE__ */ n(Bt, {}),
1277
- t && /* @__PURE__ */ n(j1, { onClick: t.onClick, children: t.text })
1278
+ /* @__PURE__ */ n(j1, { theme: o, children: e }),
1279
+ /* @__PURE__ */ n(Dt, {}),
1280
+ t && /* @__PURE__ */ n(Q1, { onClick: t.onClick, children: t.text })
1278
1281
  ] });
1279
1282
  }
1280
- const le = u.div`
1283
+ const le = h.div`
1281
1284
  width: 5px;
1282
1285
  height: 5px;
1283
1286
  border-radius: 50%;
@@ -1307,7 +1310,7 @@ const le = u.div`
1307
1310
  }
1308
1311
  `;
1309
1312
  function Ne() {
1310
- const { themeSettings: e } = m(), t = e.aiChat.icons.color;
1313
+ const { themeSettings: e } = b(), t = e.aiChat.icons.color;
1311
1314
  return /* @__PURE__ */ g(
1312
1315
  "div",
1313
1316
  {
@@ -1322,7 +1325,7 @@ function Ne() {
1322
1325
  }
1323
1326
  );
1324
1327
  }
1325
- const Q1 = u.div`
1328
+ const U1 = h.div`
1326
1329
  display: flex;
1327
1330
 
1328
1331
  ${({ align: e }) => e === "right" ? E`
@@ -1330,7 +1333,7 @@ const Q1 = u.div`
1330
1333
  ` : E`
1331
1334
  justify-content: flex-start;
1332
1335
  `}
1333
- `, U1 = u.button`
1336
+ `, _1 = h.button`
1334
1337
  font-family: inherit;
1335
1338
  font-size: inherit;
1336
1339
  line-height: inherit;
@@ -1389,14 +1392,14 @@ function de({
1389
1392
  onClick: o,
1390
1393
  onMouseEnter: r,
1391
1394
  onMouseLeave: i,
1392
- accessibleName: a
1395
+ accessibleName: s
1393
1396
  }) {
1394
- const { themeSettings: s } = m();
1395
- return /* @__PURE__ */ n(Q1, { align: t, children: /* @__PURE__ */ n(
1396
- U1,
1397
+ const { themeSettings: a } = b();
1398
+ return /* @__PURE__ */ n(U1, { align: t, children: /* @__PURE__ */ n(
1399
+ _1,
1397
1400
  {
1398
- "aria-label": a,
1399
- theme: s,
1401
+ "aria-label": s,
1402
+ theme: a,
1400
1403
  onClick: o,
1401
1404
  align: t,
1402
1405
  onMouseEnter: r,
@@ -1405,9 +1408,9 @@ function de({
1405
1408
  }
1406
1409
  ) });
1407
1410
  }
1408
- function _1({ onCancel: e, onConfirm: t }) {
1409
- const { t: o } = w();
1410
- return /* @__PURE__ */ g(I, { children: [
1411
+ function K1({ onCancel: e, onConfirm: t }) {
1412
+ const { t: o } = k();
1413
+ return /* @__PURE__ */ g(H, { children: [
1411
1414
  /* @__PURE__ */ n(z, { align: "left", children: o("ai.clearHistoryPrompt") }),
1412
1415
  /* @__PURE__ */ g("div", { className: "csdk-flex csdk-gap-x-2", children: [
1413
1416
  /* @__PURE__ */ n(de, { align: "right", onClick: t, accessibleName: "confirm clear chat", children: /* @__PURE__ */ n("div", { className: "csdk-py-[6px] csdk-px-[20px]", children: o("ai.buttons.yes") }) }),
@@ -1415,7 +1418,7 @@ function _1({ onCancel: e, onConfirm: t }) {
1415
1418
  ] })
1416
1419
  ] });
1417
1420
  }
1418
- function K1({ fillColor: e = "#262E3D" }) {
1421
+ function Y1({ fillColor: e = "#262E3D" }) {
1419
1422
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [
1420
1423
  /* @__PURE__ */ n("rect", { x: "1", y: "1", width: "28", height: "28", rx: "14", stroke: "#9EA2AB" }),
1421
1424
  /* @__PURE__ */ n(
@@ -1514,18 +1517,18 @@ const at = {
1514
1517
  errorBG: "rgba(231, 71, 39, 0.1)"
1515
1518
  }
1516
1519
  }
1517
- }, Y1 = {
1520
+ }, J1 = {
1518
1521
  shouldForwardProp: (e) => !e.startsWith("$")
1519
- }, ie = u(
1520
- Ge,
1521
- Y1
1522
+ }, ie = h(
1523
+ Ve,
1524
+ J1
1522
1525
  )(({ $hoverColor: e }) => ({
1523
1526
  padding: 2,
1524
1527
  "&.MuiIconButton-root:hover": {
1525
1528
  backgroundColor: e != null ? e : at.interaction.defaultHover
1526
1529
  }
1527
1530
  }));
1528
- function J1({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1531
+ function X1({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1529
1532
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1530
1533
  "path",
1531
1534
  {
@@ -1536,7 +1539,7 @@ function J1({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1536
1539
  }
1537
1540
  ) });
1538
1541
  }
1539
- function X1({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1542
+ function eo({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1540
1543
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1541
1544
  "path",
1542
1545
  {
@@ -1547,7 +1550,7 @@ function X1({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1547
1550
  }
1548
1551
  ) });
1549
1552
  }
1550
- function eo() {
1553
+ function to() {
1551
1554
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1552
1555
  "path",
1553
1556
  {
@@ -1559,7 +1562,7 @@ function eo() {
1559
1562
  }
1560
1563
  ) });
1561
1564
  }
1562
- function to({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1565
+ function oo({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1563
1566
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1564
1567
  "path",
1565
1568
  {
@@ -1570,27 +1573,27 @@ function to({ fill: e = "rgba(38, 46, 61, 0.67)" }) {
1570
1573
  }
1571
1574
  ) });
1572
1575
  }
1573
- const He = (e) => Qe(e.chart.backgroundColor), oo = ({ title: e }) => {
1574
- const { themeSettings: t } = m();
1575
- return /* @__PURE__ */ n(re, { title: e, children: /* @__PURE__ */ n(ie, { disableTouchRipple: !0, $hoverColor: He(t), children: /* @__PURE__ */ n(X1, { fill: t.chart.textColor }) }) });
1576
- }, no = ({ items: e }) => {
1577
- const [t, o] = $(null), r = (s) => {
1578
- o(s.currentTarget);
1576
+ const Ie = (e) => Qe(e.chart.backgroundColor), no = ({ title: e }) => {
1577
+ const { themeSettings: t } = b();
1578
+ return /* @__PURE__ */ n(re, { title: e, children: /* @__PURE__ */ n(ie, { disableTouchRipple: !0, $hoverColor: Ie(t), children: /* @__PURE__ */ n(eo, { fill: t.chart.textColor }) }) });
1579
+ }, ro = ({ items: e }) => {
1580
+ const [t, o] = $(null), r = (a) => {
1581
+ o(a.currentTarget);
1579
1582
  }, i = () => {
1580
1583
  o(null);
1581
- }, { themeSettings: a } = m();
1582
- return /* @__PURE__ */ g(I, { children: [
1584
+ }, { themeSettings: s } = b();
1585
+ return /* @__PURE__ */ g(H, { children: [
1583
1586
  /* @__PURE__ */ n(
1584
1587
  ie,
1585
1588
  {
1586
1589
  onClick: r,
1587
- $hoverColor: He(a),
1590
+ $hoverColor: Ie(s),
1588
1591
  "aria-label": "three dots button",
1589
- children: /* @__PURE__ */ n(to, { fill: a.chart.textColor })
1592
+ children: /* @__PURE__ */ n(oo, { fill: s.chart.textColor })
1590
1593
  }
1591
1594
  ),
1592
1595
  /* @__PURE__ */ n(
1593
- Dt,
1596
+ Pt,
1594
1597
  {
1595
1598
  anchorEl: t,
1596
1599
  anchorOrigin: {
@@ -1603,37 +1606,37 @@ const He = (e) => Qe(e.chart.backgroundColor), oo = ({ title: e }) => {
1603
1606
  },
1604
1607
  open: !!t,
1605
1608
  onClose: i,
1606
- children: e.map((s) => /* @__PURE__ */ g(
1607
- Pt,
1609
+ children: e.map((a) => /* @__PURE__ */ g(
1610
+ Ot,
1608
1611
  {
1609
1612
  onClick: () => {
1610
- s.onClick(), i();
1613
+ a.onClick(), i();
1611
1614
  },
1612
1615
  sx: {
1613
1616
  fontSize: "13px",
1614
- fontFamily: a.typography.fontFamily,
1617
+ fontFamily: s.typography.fontFamily,
1615
1618
  color: at.text.content
1616
1619
  },
1617
1620
  disableRipple: !0,
1618
1621
  children: [
1619
- s.icon,
1620
- /* @__PURE__ */ n("div", { className: "csdk-ml-1", children: s.title })
1622
+ a.icon,
1623
+ /* @__PURE__ */ n("div", { className: "csdk-ml-1", children: a.title })
1621
1624
  ]
1622
1625
  },
1623
- s.title
1626
+ a.title
1624
1627
  ))
1625
1628
  }
1626
1629
  )
1627
1630
  ] });
1628
- }, ro = ({ onClick: e }) => {
1629
- const { themeSettings: t } = m(), { t: o } = w();
1630
- return /* @__PURE__ */ n(re, { title: o("ai.preview"), children: /* @__PURE__ */ n(ie, { onClick: e, $hoverColor: He(t), children: /* @__PURE__ */ n(J1, { fill: t.chart.textColor }) }) });
1631
- }, io = u.div`
1631
+ }, io = ({ onClick: e }) => {
1632
+ const { themeSettings: t } = b(), { t: o } = k();
1633
+ return /* @__PURE__ */ n(re, { title: o("ai.preview"), children: /* @__PURE__ */ n(ie, { onClick: e, $hoverColor: Ie(t), children: /* @__PURE__ */ n(X1, { fill: t.chart.textColor }) }) });
1634
+ }, so = h.div`
1632
1635
  display: flex;
1633
1636
  padding-top: 6px;
1634
1637
  padding-bottom: 6px;
1635
1638
  `;
1636
- function so({
1639
+ function ao({
1637
1640
  infoTooltipText: e,
1638
1641
  onRefresh: t,
1639
1642
  onExpand: o
@@ -1643,56 +1646,56 @@ function so({
1643
1646
  {
1644
1647
  title: "Refresh",
1645
1648
  onClick: t,
1646
- icon: /* @__PURE__ */ n(eo, {})
1649
+ icon: /* @__PURE__ */ n(to, {})
1647
1650
  }
1648
1651
  ],
1649
1652
  [t]
1650
1653
  );
1651
- return /* @__PURE__ */ g(io, { "aria-label": "chatbot chart toolbar", children: [
1652
- /* @__PURE__ */ n(oo, { title: e != null ? e : "" }),
1653
- /* @__PURE__ */ n(no, { items: r }),
1654
- /* @__PURE__ */ n(ro, { onClick: o })
1654
+ return /* @__PURE__ */ g(so, { "aria-label": "chatbot chart toolbar", children: [
1655
+ /* @__PURE__ */ n(no, { title: e != null ? e : "" }),
1656
+ /* @__PURE__ */ n(ro, { items: r }),
1657
+ /* @__PURE__ */ n(io, { onClick: o })
1655
1658
  ] });
1656
1659
  }
1657
- function ao({ content: e }) {
1658
- const [t, o] = $(!1), { themeSettings: r } = m(), { inlineElement: i, expandedElement: a } = D(() => {
1659
- const s = pe(e, { useCustomizedStyleOptions: !0 });
1660
- if (s === void 0 || !Se(s))
1660
+ function lo({ content: e }) {
1661
+ const [t, o] = $(!1), { themeSettings: r } = b(), { inlineElement: i, expandedElement: s } = D(() => {
1662
+ const a = pe(e, { useCustomizedStyleOptions: !0 });
1663
+ if (a === void 0 || !Se(a))
1661
1664
  throw new ke("errors.otherWidgetTypesNotSupported");
1662
- const { detailedDescription: c } = e, { styleOptions: l } = s, d = {
1665
+ const { detailedDescription: c } = e, { styleOptions: l } = a, d = {
1663
1666
  cornerRadius: "Small",
1664
1667
  header: {
1665
- renderToolbar: (h) => /* @__PURE__ */ n(
1666
- so,
1668
+ renderToolbar: (p) => /* @__PURE__ */ n(
1669
+ ao,
1667
1670
  {
1668
1671
  infoTooltipText: c,
1669
- onRefresh: h,
1672
+ onRefresh: p,
1670
1673
  onExpand: () => o(!0)
1671
1674
  }
1672
1675
  )
1673
1676
  }
1674
1677
  };
1675
- let p, C;
1676
- if (Ut(s.chartType))
1677
- p = /* @__PURE__ */ n("div", { className: "csdk-h-[245px]", children: /* @__PURE__ */ n(ee, L(M({}, s), { styleOptions: d })) }), C = /* @__PURE__ */ n(ee, L(M({}, s), { styleOptions: { header: { hidden: !0 } } }));
1678
+ let C, u;
1679
+ if (_t(a.chartType))
1680
+ C = /* @__PURE__ */ n("div", { className: "csdk-h-[245px]", children: /* @__PURE__ */ n(ee, L(w({}, a), { styleOptions: d })) }), u = /* @__PURE__ */ n(ee, L(w({}, a), { styleOptions: { header: { hidden: !0 } } }));
1678
1681
  else {
1679
- const h = L(M({}, l), {
1682
+ const p = L(w({}, l), {
1680
1683
  header: { hidden: !0 }
1681
- }), b = M(L(M({}, l), {
1684
+ }), m = w(L(w({}, l), {
1682
1685
  legend: void 0,
1683
1686
  xAxis: void 0,
1684
1687
  yAxis: void 0
1685
1688
  }), d);
1686
- delete b.legend, delete b.xAxis, delete b.yAxis, p = /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(ee, L(M({}, s), { styleOptions: b })) }), C = /* @__PURE__ */ n(
1689
+ delete m.legend, delete m.xAxis, delete m.yAxis, C = /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(ee, L(w({}, a), { styleOptions: m })) }), u = /* @__PURE__ */ n(
1687
1690
  ee,
1688
- L(M({}, s), {
1689
- styleOptions: M({ cornerRadius: "None" }, h)
1691
+ L(w({}, a), {
1692
+ styleOptions: w({ cornerRadius: "None" }, p)
1690
1693
  })
1691
1694
  );
1692
1695
  }
1693
- return { inlineElement: p, expandedElement: C };
1696
+ return { inlineElement: C, expandedElement: u };
1694
1697
  }, [e]);
1695
- return /* @__PURE__ */ g(I, { children: [
1698
+ return /* @__PURE__ */ g(H, { children: [
1696
1699
  i,
1697
1700
  /* @__PURE__ */ g(
1698
1701
  _e,
@@ -1710,15 +1713,15 @@ function ao({ content: e }) {
1710
1713
  children: [
1711
1714
  /* @__PURE__ */ g("div", { className: "csdk-flex csdk-items-center csdk-justify-between csdk-mt-[16px] csdk-mx-[16px] csdk-pl-[20px]", children: [
1712
1715
  /* @__PURE__ */ n("div", { className: "csdk-text-ai-lg csdk-semibold", children: e.queryTitle }),
1713
- /* @__PURE__ */ n(Ge, { onClick: () => o(!1), "aria-label": "close expanded chart", children: /* @__PURE__ */ n(K1, { fillColor: r.aiChat.primaryTextColor }) })
1716
+ /* @__PURE__ */ n(Ve, { onClick: () => o(!1), "aria-label": "close expanded chart", children: /* @__PURE__ */ n(Y1, { fillColor: r.aiChat.primaryTextColor }) })
1714
1717
  ] }),
1715
- /* @__PURE__ */ n("div", { className: "csdk-h-screen csdk-mt-[8px] csdk-mb-[24px] csdk-mx-[16px]", children: a })
1718
+ /* @__PURE__ */ n("div", { className: "csdk-h-screen csdk-mt-[8px] csdk-mb-[24px] csdk-mx-[16px]", children: s })
1716
1719
  ]
1717
1720
  }
1718
1721
  )
1719
1722
  ] });
1720
1723
  }
1721
- function lo({ theme: e }) {
1724
+ function co({ theme: e }) {
1722
1725
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1723
1726
  "path",
1724
1727
  {
@@ -1729,8 +1732,8 @@ function lo({ theme: e }) {
1729
1732
  }
1730
1733
  ) });
1731
1734
  }
1732
- function co({ onClick: e, disabled: t }) {
1733
- const { themeSettings: o } = m(), { t: r } = w();
1735
+ function uo({ onClick: e, disabled: t }) {
1736
+ const { themeSettings: o } = b(), { t: r } = k();
1734
1737
  return /* @__PURE__ */ n(re, { title: r("ai.buttons.incorrectResponse"), children: /* @__PURE__ */ n(
1735
1738
  ie,
1736
1739
  {
@@ -1738,11 +1741,11 @@ function co({ onClick: e, disabled: t }) {
1738
1741
  onClick: e,
1739
1742
  $hoverColor: o.aiChat.icons.feedbackIcons.hoverColor,
1740
1743
  disabled: t,
1741
- children: /* @__PURE__ */ n(lo, { theme: o })
1744
+ children: /* @__PURE__ */ n(co, { theme: o })
1742
1745
  }
1743
1746
  ) });
1744
1747
  }
1745
- function uo({ theme: e }) {
1748
+ function ho({ theme: e }) {
1746
1749
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n(
1747
1750
  "path",
1748
1751
  {
@@ -1753,8 +1756,8 @@ function uo({ theme: e }) {
1753
1756
  }
1754
1757
  ) });
1755
1758
  }
1756
- function ho({ onClick: e, disabled: t }) {
1757
- const { themeSettings: o } = m(), { t: r } = w();
1759
+ function po({ onClick: e, disabled: t }) {
1760
+ const { themeSettings: o } = b(), { t: r } = k();
1758
1761
  return /* @__PURE__ */ n(re, { title: r("ai.buttons.correctResponse"), children: /* @__PURE__ */ n(
1759
1762
  ie,
1760
1763
  {
@@ -1762,38 +1765,38 @@ function ho({ onClick: e, disabled: t }) {
1762
1765
  onClick: e,
1763
1766
  $hoverColor: o.aiChat.icons.feedbackIcons.hoverColor,
1764
1767
  disabled: t,
1765
- children: /* @__PURE__ */ n(uo, { theme: o })
1768
+ children: /* @__PURE__ */ n(ho, { theme: o })
1766
1769
  }
1767
1770
  ) });
1768
1771
  }
1769
- const po = () => {
1772
+ const go = () => {
1770
1773
  const [e, t] = $(!1), o = J(null), r = T(() => {
1771
1774
  t(!0);
1772
1775
  }, []), i = T(() => {
1773
1776
  t(!1);
1774
1777
  }, []);
1775
1778
  return [T(
1776
- (s) => {
1779
+ (a) => {
1777
1780
  var c;
1778
- ((c = o.current) == null ? void 0 : c.nodeType) === Node.ELEMENT_NODE && (o.current.removeEventListener("mouseenter", r), o.current.removeEventListener("mouseleave", i)), (s == null ? void 0 : s.nodeType) === Node.ELEMENT_NODE && (s.addEventListener("mouseenter", r), s.addEventListener("mouseleave", i)), o.current = s;
1781
+ ((c = o.current) == null ? void 0 : c.nodeType) === Node.ELEMENT_NODE && (o.current.removeEventListener("mouseenter", r), o.current.removeEventListener("mouseleave", i)), (a == null ? void 0 : a.nodeType) === Node.ELEMENT_NODE && (a.addEventListener("mouseenter", r), a.addEventListener("mouseleave", i)), o.current = a;
1779
1782
  },
1780
1783
  [r, i]
1781
1784
  ), e];
1782
- }, go = u.div`
1785
+ }, Co = h.div`
1783
1786
  display: flex;
1784
1787
  flex-direction: column;
1785
1788
  row-gap: ${({ theme: e }) => e.aiChat.body.gapBetweenMessages};
1786
1789
  `;
1787
- function Co({ visible: e, onSend: t }) {
1790
+ function fo({ visible: e, onSend: t }) {
1788
1791
  const [o, r] = $(!1), i = T(
1789
- (s) => {
1790
- r(!0), t(s === "up" ? 1 : -1);
1792
+ (a) => {
1793
+ r(!0), t(a === "up" ? 1 : -1);
1791
1794
  },
1792
1795
  [t]
1793
- ), a = `csdk-transition-opacity csdk-delay-150 csdk-duration-500 ${o ? "csdk-opacity-0" : "csdk-opacity-100"}`;
1794
- return e ? /* @__PURE__ */ g("div", { className: `csdk-flex csdk-items-center ${a}`, children: [
1795
- /* @__PURE__ */ n(ho, { onClick: () => i("up"), disabled: o }),
1796
- /* @__PURE__ */ n(co, { onClick: () => i("down"), disabled: o })
1796
+ ), s = `csdk-transition-opacity csdk-delay-150 csdk-duration-500 ${o ? "csdk-opacity-0" : "csdk-opacity-100"}`;
1797
+ return e ? /* @__PURE__ */ g("div", { className: `csdk-flex csdk-items-center ${s}`, children: [
1798
+ /* @__PURE__ */ n(po, { onClick: () => i("up"), disabled: o }),
1799
+ /* @__PURE__ */ n(uo, { onClick: () => i("down"), disabled: o })
1797
1800
  ] }) : null;
1798
1801
  }
1799
1802
  function Le({
@@ -1803,45 +1806,45 @@ function Le({
1803
1806
  buttonVisibility: r = "onHover",
1804
1807
  renderContent: i
1805
1808
  }) {
1806
- const a = P(), s = qt(
1809
+ const s = P(), a = Wt(
1807
1810
  T(
1808
- (C) => {
1809
- a && a.ai.sendFeedback({
1811
+ (u) => {
1812
+ s && s.ai.sendFeedback({
1810
1813
  sourceId: e,
1811
1814
  type: o,
1812
1815
  data: t,
1813
- rating: C
1816
+ rating: u
1814
1817
  });
1815
1818
  },
1816
- [a, e, t, o]
1819
+ [s, e, t, o]
1817
1820
  ),
1818
1821
  200
1819
- ), [c, l] = po(), d = D(() => r === "onHover" ? l : r !== "never", [l, r]), { themeSettings: p } = m();
1820
- return /* @__PURE__ */ n(go, { ref: c, theme: p, children: i(/* @__PURE__ */ n(Co, { onSend: s, visible: d })) });
1822
+ ), [c, l] = go(), d = D(() => r === "onHover" ? l : r !== "never", [l, r]), { themeSettings: C } = b();
1823
+ return /* @__PURE__ */ n(Co, { ref: c, theme: C, children: i(/* @__PURE__ */ n(fo, { onSend: a, visible: d })) });
1821
1824
  }
1822
- const fo = 18 * 5;
1825
+ const mo = 18 * 5;
1823
1826
  function Ce({ text: e }) {
1824
- const [t, o] = $(!0), [r, i] = $(!1), { t: a } = w(), s = J(null);
1827
+ const [t, o] = $(!0), [r, i] = $(!1), { t: s } = k(), a = J(null);
1825
1828
  return ce(() => {
1826
- s.current && s.current.scrollHeight > fo && i(!0);
1829
+ a.current && a.current.scrollHeight > mo && i(!0);
1827
1830
  }, [e]), /* @__PURE__ */ g("div", { children: [
1828
- /* @__PURE__ */ n("div", { ref: s, className: `${t ? "csdk-line-clamp-5" : ""} csdk-whitespace-pre-wrap`, children: e }),
1831
+ /* @__PURE__ */ n("div", { ref: a, className: `${t ? "csdk-line-clamp-5" : ""} csdk-whitespace-pre-wrap`, children: e }),
1829
1832
  r && /* @__PURE__ */ n("div", { className: "csdk-mt-3 csdk-flex csdk-justify-end", children: /* @__PURE__ */ n(
1830
1833
  "div",
1831
1834
  {
1832
1835
  className: "csdk-text-ai-xs csdk-text-text-link csdk-cursor-pointer",
1833
1836
  onClick: () => o((c) => !c),
1834
- children: a(t ? "ai.buttons.readMore" : "ai.buttons.collapse")
1837
+ children: s(t ? "ai.buttons.readMore" : "ai.buttons.collapse")
1835
1838
  }
1836
1839
  ) })
1837
1840
  ] });
1838
1841
  }
1839
- function mo({ nlgRequest: e }) {
1840
- const { data: t, isLoading: o, isError: r } = ne(e), { t: i } = w();
1842
+ function bo({ nlgRequest: e }) {
1843
+ const { data: t, isLoading: o, isError: r } = ne(e), { t: i } = k();
1841
1844
  return o ? /* @__PURE__ */ n(Ne, {}) : r ? /* @__PURE__ */ n(z, { align: "left", children: i("ai.errors.unexpected") }) : /* @__PURE__ */ n(z, { align: "full", children: /* @__PURE__ */ n(Ce, { text: t != null ? t : i("ai.errors.insightsNotAvailable") }) });
1842
1845
  }
1843
- function bo() {
1844
- const { themeSettings: e } = m();
1846
+ function xo() {
1847
+ const { themeSettings: e } = b();
1845
1848
  return /* @__PURE__ */ n("svg", { width: "24", height: "25", viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n(
1846
1849
  "path",
1847
1850
  {
@@ -1852,69 +1855,68 @@ function bo() {
1852
1855
  }
1853
1856
  ) });
1854
1857
  }
1855
- function xo({ onClick: e }) {
1856
- const { t } = w();
1858
+ function yo({ onClick: e }) {
1859
+ const { t } = k();
1857
1860
  return /* @__PURE__ */ n(de, { align: "left", onClick: e, children: /* @__PURE__ */ g(
1858
1861
  "div",
1859
1862
  {
1860
1863
  className: "csdk-py-[5px] csdk-px-2 csdk-flex csdk-items-center csdk-gap-x-1 csdk-select-none",
1861
1864
  children: [
1862
- /* @__PURE__ */ n(bo, {}),
1865
+ /* @__PURE__ */ n(xo, {}),
1863
1866
  t("ai.buttons.insights")
1864
1867
  ]
1865
1868
  }
1866
1869
  ) });
1867
1870
  }
1868
- var yo = Wt("toLowerCase");
1869
- const We = u.div`
1871
+ const We = h.div`
1870
1872
  display: flex;
1871
1873
  align-items: center;
1872
1874
  column-gap: 10px;
1873
1875
  `, vo = (e) => !!e && "aeiou".includes(e[0]);
1874
1876
  function wo({ data: e, alwaysShowFeedback: t }) {
1875
- const { chatMode: o = "analyze", enableInsights: r } = W(), { themeSettings: i } = m(), { queryTitle: a, chartRecommendations: s, jaql: c } = e;
1876
- console.debug(`JAQL for ${a}`, c), console.debug(`chart recommendations for ${a}`, s);
1877
- const l = "chartType" in s ? s.chartType : "table";
1877
+ const { chatMode: o = "analyze", enableInsights: r } = W(), { themeSettings: i } = b(), { queryTitle: s, chartRecommendations: a, jaql: c } = e;
1878
+ console.debug(`JAQL for ${s}`, c), console.debug(`chart recommendations for ${s}`, a);
1879
+ const l = "chartType" in a ? a.chartType : "table";
1878
1880
  let d;
1879
1881
  vo(l) ? d = `an ${l}` : d = `a ${l}`, l !== "table" && (d += " chart");
1880
- const p = c.datasource.title, [C, h] = $(!1), b = T(() => {
1881
- h((x) => !x);
1882
- }, []), v = {
1882
+ const C = c.datasource.title, [u, p] = $(!1), m = T(() => {
1883
+ p((y) => !y);
1884
+ }, []), x = {
1883
1885
  jaql: {
1884
1886
  datasource: c.datasource,
1885
1887
  metadata: c.metadata
1886
1888
  }
1887
- }, S = o === "analyze";
1888
- return /* @__PURE__ */ g(I, { children: [
1889
+ }, M = o === "analyze";
1890
+ return /* @__PURE__ */ g(H, { children: [
1889
1891
  /* @__PURE__ */ n(
1890
1892
  Le,
1891
1893
  {
1892
- sourceId: p,
1894
+ sourceId: C,
1893
1895
  data: e,
1894
1896
  type: "chats/nlq",
1895
1897
  buttonVisibility: t ? "always" : "onHover",
1896
- renderContent: (x) => /* @__PURE__ */ g(I, { children: [
1898
+ renderContent: (y) => /* @__PURE__ */ g(H, { children: [
1897
1899
  /* @__PURE__ */ g(We, { children: [
1898
- /* @__PURE__ */ n(it, { align: "left", theme: i, children: `Here's ${d} showing ${yo(a)}.` }),
1899
- x
1900
+ /* @__PURE__ */ n(it, { align: "left", theme: i, children: `Here's ${d} showing ${Xt(s)}.` }),
1901
+ y
1900
1902
  ] }),
1901
- S && /* @__PURE__ */ n(ao, { content: e })
1903
+ M && /* @__PURE__ */ n(lo, { content: e })
1902
1904
  ] })
1903
1905
  }
1904
1906
  ),
1905
1907
  r && /* @__PURE__ */ n(
1906
1908
  Le,
1907
1909
  {
1908
- sourceId: p,
1909
- data: v,
1910
+ sourceId: C,
1911
+ data: x,
1910
1912
  type: "nlg/queryResult",
1911
- buttonVisibility: C ? "onHover" : "never",
1912
- renderContent: (x) => /* @__PURE__ */ g(I, { children: [
1913
+ buttonVisibility: u ? "onHover" : "never",
1914
+ renderContent: (y) => /* @__PURE__ */ g(H, { children: [
1913
1915
  /* @__PURE__ */ g(We, { children: [
1914
- /* @__PURE__ */ n(xo, { onClick: b }),
1915
- x
1916
+ /* @__PURE__ */ n(yo, { onClick: m }),
1917
+ y
1916
1918
  ] }),
1917
- C && /* @__PURE__ */ n(mo, { nlgRequest: v })
1919
+ u && /* @__PURE__ */ n(bo, { nlgRequest: x })
1918
1920
  ] })
1919
1921
  }
1920
1922
  )
@@ -1925,19 +1927,19 @@ function ko({ message: e, isLastMessage: t }) {
1925
1927
  const r = JSON.parse(e.content);
1926
1928
  return /* @__PURE__ */ n(wo, { data: r, alwaysShowFeedback: t });
1927
1929
  }
1928
- const o = b1(e) ? JSON.parse(e.content).answer : e.content;
1930
+ const o = x1(e) ? JSON.parse(e.content).answer : e.content;
1929
1931
  return /* @__PURE__ */ n(z, { align: e.role === "user" ? "right" : "left", children: o });
1930
1932
  }
1931
- const So = zt(ko), Mo = ({
1933
+ const So = Vt(ko), Mo = ({
1932
1934
  error: e,
1933
1935
  displayMessage: t
1934
1936
  }) => (console.debug("Unexpected error occurred when resolving a chat message:", e), /* @__PURE__ */ n(z, { align: "left", children: t }));
1935
1937
  function Lo({ messages: e }) {
1936
- const { t } = w();
1937
- return /* @__PURE__ */ n(I, { children: e.map((o, r) => /* @__PURE__ */ n(
1938
- Ot,
1938
+ const { t } = k();
1939
+ return /* @__PURE__ */ n(H, { children: e.map((o, r) => /* @__PURE__ */ n(
1940
+ qt,
1939
1941
  {
1940
- fallbackRender: (i) => Mo(L(M({}, i), {
1942
+ fallbackRender: (i) => Mo(L(w({}, i), {
1941
1943
  displayMessage: t("ai.errors.unexpected")
1942
1944
  })),
1943
1945
  children: /* @__PURE__ */ n(So, { message: o, isLastMessage: r === e.length - 1 }, r)
@@ -1975,7 +1977,7 @@ function $o({ onClick: e, color: t }) {
1975
1977
  }
1976
1978
  );
1977
1979
  }
1978
- const To = u.button`
1980
+ const To = h.button`
1979
1981
  font-size: inherit;
1980
1982
  line-height: inherit;
1981
1983
  box-sizing: border-box;
@@ -2025,24 +2027,24 @@ const To = u.button`
2025
2027
  return "";
2026
2028
  }}
2027
2029
  `;
2028
- function Oe({ question: e, onClick: t }) {
2029
- const { themeSettings: o } = m();
2030
+ function qe({ question: e, onClick: t }) {
2031
+ const { themeSettings: o } = b();
2030
2032
  return /* @__PURE__ */ n(To, { onClick: t, theme: o, children: e });
2031
2033
  }
2032
- const Ro = u.div`
2034
+ const Ro = h.div`
2033
2035
  display: flex;
2034
2036
  flex-direction: column;
2035
2037
  align-items: flex-start;
2036
2038
  row-gap: ${({ theme: e }) => e.aiChat.suggestions.gap};
2037
2039
  `;
2038
2040
  function Eo({ questions: e, onSelection: t }) {
2039
- const { t: o } = w(), [r, i] = $(!0), a = D(() => r && e.length > 5 ? e.slice(0, 4) : e, [e, r]), { themeSettings: s } = m();
2040
- return /* @__PURE__ */ g(Ro, { "aria-label": "list of suggested questions", theme: s, children: [
2041
- a.map((c) => /* @__PURE__ */ n(Oe, { question: c, onClick: () => t(c) }, c)),
2042
- a.length < e.length && /* @__PURE__ */ n(Oe, { question: o("ai.buttons.seeMore"), onClick: () => i(!1) })
2041
+ const { t: o } = k(), [r, i] = $(!0), s = D(() => r && e.length > 5 ? e.slice(0, 4) : e, [e, r]), { themeSettings: a } = b();
2042
+ return /* @__PURE__ */ g(Ro, { "aria-label": "list of suggested questions", theme: a, children: [
2043
+ s.map((c) => /* @__PURE__ */ n(qe, { question: c, onClick: () => t(c) }, c)),
2044
+ s.length < e.length && /* @__PURE__ */ n(qe, { question: o("ai.buttons.seeMore"), onClick: () => i(!1) })
2043
2045
  ] });
2044
2046
  }
2045
- const No = u.div`
2047
+ const No = h.div`
2046
2048
  width: 283px;
2047
2049
  height: 32px;
2048
2050
  border-radius: 10px;
@@ -2066,23 +2068,23 @@ const No = u.div`
2066
2068
  background-position: -200% 0;
2067
2069
  }
2068
2070
  }
2069
- `, Ho = u.div`
2071
+ `, Io = h.div`
2070
2072
  display: flex;
2071
2073
  flex-direction: column;
2072
2074
  row-gap: 1rem;
2073
2075
  `;
2074
- function Io() {
2075
- const { themeSettings: e } = m();
2076
- return /* @__PURE__ */ n(Ho, { children: Array.from({ length: 3 }, (t, o) => /* @__PURE__ */ n(No, { theme: e }, o)) });
2076
+ function Ho() {
2077
+ const { themeSettings: e } = b();
2078
+ return /* @__PURE__ */ n(Io, { children: Array.from({ length: 3 }, (t, o) => /* @__PURE__ */ n(No, { theme: e }, o)) });
2077
2079
  }
2078
- function Fo({ questions: e, isLoading: t, onSelection: o }) {
2080
+ function Bo({ questions: e, isLoading: t, onSelection: o }) {
2079
2081
  const r = e.length > 0, { suggestionsWelcomeText: i } = W();
2080
- return t ? /* @__PURE__ */ n(Io, {}) : r ? /* @__PURE__ */ g(I, { children: [
2082
+ return t ? /* @__PURE__ */ n(Ho, {}) : r ? /* @__PURE__ */ g(H, { children: [
2081
2083
  i && /* @__PURE__ */ n(z, { align: "left", children: i }),
2082
2084
  /* @__PURE__ */ n(Eo, { onSelection: o, questions: e })
2083
2085
  ] }) : null;
2084
2086
  }
2085
- const Bo = u.div`
2087
+ const Fo = h.div`
2086
2088
  flex: 0 0 80px;
2087
2089
  padding-left: 14px;
2088
2090
  padding-right: 14px;
@@ -2091,20 +2093,20 @@ const Bo = u.div`
2091
2093
  position: relative;
2092
2094
 
2093
2095
  background-color: ${({ style: e }) => e.backgroundColor};
2094
- `, Do = u.div`
2096
+ `, Do = h.div`
2095
2097
  font-size: 18px;
2096
2098
  line-height: 22px;
2097
2099
  font-weight: 600;
2098
2100
  margin-left: 20px;
2099
2101
 
2100
2102
  color: ${({ style: e }) => e.textColor};
2101
- `, ct = Gt(function({ title: t, leftNav: o, rightNav: r, style: i }, a) {
2102
- return /* @__PURE__ */ g(Bo, { ref: a, style: i, children: [
2103
+ `, ct = Gt(function({ title: t, leftNav: o, rightNav: r, style: i }, s) {
2104
+ return /* @__PURE__ */ g(Fo, { ref: s, style: i, children: [
2103
2105
  o,
2104
2106
  /* @__PURE__ */ n(Do, { style: i, children: t }),
2105
2107
  r && /* @__PURE__ */ n("div", { className: "csdk-ml-auto", children: r })
2106
2108
  ] });
2107
- }), Po = u.div`
2109
+ }), Po = h.div`
2108
2110
  text-align: center;
2109
2111
  font-size: 11px;
2110
2112
  line-height: 18px;
@@ -2118,8 +2120,8 @@ const Bo = u.div`
2118
2120
 
2119
2121
  color: ${({ theme: e }) => e.aiChat.secondaryTextColor};
2120
2122
  `;
2121
- function qo({ theme: e }) {
2122
- const { t } = w();
2123
+ function Oo({ theme: e }) {
2124
+ const { t } = k();
2123
2125
  return /* @__PURE__ */ g(Po, { theme: e, children: [
2124
2126
  /* @__PURE__ */ n("div", { children: t("ai.disclaimer.poweredByAi") }),
2125
2127
  /* @__PURE__ */ g("div", { children: [
@@ -2128,7 +2130,7 @@ function qo({ theme: e }) {
2128
2130
  ] })
2129
2131
  ] });
2130
2132
  }
2131
- const Wo = u.div`
2133
+ const Wo = h.div`
2132
2134
  font-size: inherit;
2133
2135
  line-height: inherit;
2134
2136
  padding-left: 16px;
@@ -2140,11 +2142,11 @@ const Wo = u.div`
2140
2142
  color: ${({ theme: e }) => e.aiChat.suggestions.textColor};
2141
2143
  background-color: ${({ theme: e }) => e.aiChat.suggestions.backgroundColor};
2142
2144
  `, dt = () => {
2143
- const { t: e } = w(), { themeSettings: t } = m();
2145
+ const { t: e } = k(), { themeSettings: t } = b();
2144
2146
  return /* @__PURE__ */ n(Wo, { theme: t, children: e("ai.betaLabel") });
2145
2147
  };
2146
- function Oo() {
2147
- const { themeSettings: e } = m();
2148
+ function qo() {
2149
+ const { themeSettings: e } = b();
2148
2150
  return /* @__PURE__ */ n("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n(
2149
2151
  "path",
2150
2152
  {
@@ -2156,9 +2158,9 @@ function Oo() {
2156
2158
  ) });
2157
2159
  }
2158
2160
  const Ao = (e, t) => {
2159
- const o = new _t(e);
2161
+ const o = new Kt(e);
2160
2162
  return o.alpha = t, o;
2161
- }, Zo = u.div`
2163
+ }, Zo = h.div`
2162
2164
  font-size: inherit;
2163
2165
  line-height: inherit;
2164
2166
  padding-left: 8px;
@@ -2176,9 +2178,9 @@ const Ao = (e, t) => {
2176
2178
  background-color: ${({ theme: e }) => e.aiChat.clickableMessages.hover.backgroundColor};
2177
2179
  box-shadow: none;
2178
2180
  `, zo = ({ onClick: e }) => {
2179
- const { themeSettings: t } = m();
2180
- return /* @__PURE__ */ n(Zo, { theme: t, onClick: e, children: /* @__PURE__ */ n(Oo, {}) });
2181
- }, Go = ({ isVisible: e, onClick: t, anchorElement: o }) => /* @__PURE__ */ n(ze, { anchorEl: o, open: e, placement: "top", sx: { zIndex: 2 }, children: /* @__PURE__ */ n(zo, { onClick: t }) }), Vo = u.div`
2181
+ const { themeSettings: t } = b();
2182
+ return /* @__PURE__ */ n(Zo, { theme: t, onClick: e, children: /* @__PURE__ */ n(qo, {}) });
2183
+ }, Vo = ({ isVisible: e, onClick: t, anchorElement: o }) => /* @__PURE__ */ n(ze, { anchorEl: o, open: e, placement: "top", sx: { zIndex: 2 }, children: /* @__PURE__ */ n(zo, { onClick: t }) }), Go = h.div`
2182
2184
  display: flex;
2183
2185
  flex-direction: column;
2184
2186
  row-gap: ${({ theme: e }) => e.aiChat.body.gapBetweenMessages};
@@ -2189,7 +2191,7 @@ const Ao = (e, t) => {
2189
2191
  padding-bottom: ${({ theme: e }) => e.aiChat.body.paddingBottom};
2190
2192
  flex: initial;
2191
2193
  height: 100%;
2192
- `, jo = u.div`
2194
+ `, jo = h.div`
2193
2195
  padding-left: ${({ theme: e }) => e.aiChat.footer.paddingLeft};
2194
2196
  padding-right: ${({ theme: e }) => e.aiChat.footer.paddingRight};
2195
2197
  padding-top: ${({ theme: e }) => e.aiChat.footer.paddingTop};
@@ -2197,44 +2199,44 @@ const Ao = (e, t) => {
2197
2199
  display: flex;
2198
2200
  flex-direction: column;
2199
2201
  row-gap: 6px;
2200
- `, Qo = u.div`
2202
+ `, Qo = h.div`
2201
2203
  display: flex;
2202
2204
  flex-direction: column;
2203
2205
  row-gap: ${({ theme: e }) => e.aiChat.suggestions.gap};
2204
2206
  `;
2205
2207
  function Uo({ contextTitle: e, onGoBack: t }) {
2206
- const { t: o } = w(), { enableFollowupQuestions: r, enableHeader: i, numOfRecentPrompts: a, numOfRecommendations: s } = W(), { themeSettings: c } = m(), {
2208
+ const { t: o } = k(), { enableFollowupQuestions: r, enableHeader: i, numOfRecentPrompts: s, numOfRecommendations: a } = W(), { themeSettings: c } = b(), {
2207
2209
  data: l,
2208
2210
  isLoading: d,
2209
- isError: p
2211
+ isError: C
2210
2212
  } = Je({
2211
2213
  contextTitle: e,
2212
- count: s
2213
- }), C = D(
2214
- () => l.map((y) => y.nlqPrompt),
2214
+ count: a
2215
+ }), u = D(
2216
+ () => l == null ? void 0 : l.map((v) => v.nlqPrompt),
2215
2217
  [l]
2216
2218
  ), {
2217
- history: h,
2218
- lastNlqResponse: b,
2219
- isAwaitingResponse: v,
2220
- sendMessage: S,
2221
- isLoading: x,
2222
- chatId: O,
2219
+ history: p,
2220
+ lastNlqResponse: m,
2221
+ isAwaitingResponse: x,
2222
+ sendMessage: M,
2223
+ isLoading: y,
2224
+ chatId: q,
2223
2225
  lastError: N
2224
- } = x1(e), { mutate: k, isLoading: q } = tt(O), [F, B] = $(!1), [G, se] = $(!1), fe = () => B(!0), X = () => B(!1), U = () => {
2225
- k(), X();
2226
- }, H = J(null), _ = J(null), me = () => {
2227
- if (!(H != null && H.current))
2226
+ } = y1(e), { mutate: S, isLoading: O } = tt(q), [B, F] = $(!1), [V, se] = $(!1), fe = () => F(!0), X = () => F(!1), U = () => {
2227
+ S(), X();
2228
+ }, I = J(null), _ = J(null), me = () => {
2229
+ if (!(I != null && I.current))
2228
2230
  return;
2229
- const { scrollTop: y, clientHeight: A, scrollHeight: Ie } = H.current;
2230
- if (y === void 0 || A === void 0 || Ie === void 0)
2231
+ const { scrollTop: v, clientHeight: A, scrollHeight: He } = I.current;
2232
+ if (v === void 0 || A === void 0 || He === void 0)
2231
2233
  return;
2232
- const Fe = Ie - y - A > A / 2;
2233
- G !== Fe && se(Fe);
2234
+ const Be = He - v - A > A / 2;
2235
+ V !== Be && se(Be);
2234
2236
  };
2235
2237
  ce(() => {
2236
- H.current && (H.current.scrollTop = H.current.scrollHeight);
2237
- }, [h, F, v]);
2238
+ I.current && (I.current.scrollTop = I.current.scrollHeight);
2239
+ }, [p, B, x]);
2238
2240
  const be = J(null), K = i ? /* @__PURE__ */ n(
2239
2241
  ct,
2240
2242
  {
@@ -2247,56 +2249,56 @@ function Uo({ contextTitle: e, onGoBack: t }) {
2247
2249
  ) : null, xe = D(
2248
2250
  () => [
2249
2251
  ...new Set(
2250
- h.filter((y) => y.role === "user").filter((y) => !C.includes(y.content)).map((y) => y.content).reverse()
2252
+ p.filter((v) => v.role === "user").filter((v) => !(u != null && u.includes(v.content))).map((v) => v.content).reverse()
2251
2253
  )
2252
- ].slice(0, a),
2253
- [h, a, C]
2254
+ ].slice(0, s),
2255
+ [p, s, u]
2254
2256
  );
2255
- return (N == null ? void 0 : N.message) === o("ai.errors.chatUnavailable") ? /* @__PURE__ */ g(I, { children: [
2257
+ return (N == null ? void 0 : N.message) === o("ai.errors.chatUnavailable") ? /* @__PURE__ */ g(H, { children: [
2256
2258
  i && K,
2257
2259
  /* @__PURE__ */ n(st, { text: N.message })
2258
- ] }) : /* @__PURE__ */ g(I, { children: [
2260
+ ] }) : /* @__PURE__ */ g(H, { children: [
2259
2261
  K,
2260
- /* @__PURE__ */ g(Vo, { ref: H, theme: c, onScroll: me, children: [
2262
+ /* @__PURE__ */ g(Go, { ref: I, theme: c, onScroll: me, children: [
2261
2263
  /* @__PURE__ */ n(
2262
- Go,
2264
+ Vo,
2263
2265
  {
2264
- isVisible: G,
2266
+ isVisible: V,
2265
2267
  anchorElement: _.current,
2266
2268
  onClick: () => {
2267
- var y, A;
2268
- (A = H.current) == null || A.scroll({
2269
- top: (y = H.current) == null ? void 0 : y.scrollHeight,
2269
+ var v, A;
2270
+ (A = I.current) == null || A.scroll({
2271
+ top: (v = I.current) == null ? void 0 : v.scrollHeight,
2270
2272
  behavior: "smooth"
2271
2273
  });
2272
2274
  }
2273
2275
  }
2274
2276
  ),
2275
- /* @__PURE__ */ n(z1, {}),
2277
+ /* @__PURE__ */ n(V1, {}),
2276
2278
  /* @__PURE__ */ n(
2277
- Fo,
2279
+ Bo,
2278
2280
  {
2279
- questions: C,
2281
+ questions: u || [],
2280
2282
  isLoading: d,
2281
- onSelection: S
2283
+ onSelection: M
2282
2284
  }
2283
2285
  ),
2284
2286
  N && /* @__PURE__ */ n(z, { align: "left", children: N.message }),
2285
- x ? /* @__PURE__ */ n(ge, {}) : /* @__PURE__ */ n(Lo, { messages: h }),
2286
- r && b && /* @__PURE__ */ n(Qo, { theme: c, children: b.followupQuestions.slice(0, 2).map((y, A) => /* @__PURE__ */ n(
2287
+ y ? /* @__PURE__ */ n(ge, {}) : /* @__PURE__ */ n(Lo, { messages: p }),
2288
+ r && m && /* @__PURE__ */ n(Qo, { theme: c, children: m.followupQuestions.slice(0, 2).map((v, A) => /* @__PURE__ */ n(
2287
2289
  de,
2288
2290
  {
2289
2291
  align: "left",
2290
2292
  onClick: () => {
2291
- S(y);
2293
+ M(v);
2292
2294
  },
2293
- children: /* @__PURE__ */ n("div", { className: "csdk-py-[7px] csdk-px-4", children: y })
2295
+ children: /* @__PURE__ */ n("div", { className: "csdk-py-[7px] csdk-px-4", children: v })
2294
2296
  },
2295
2297
  A
2296
2298
  )) }),
2297
- (v || q) && /* @__PURE__ */ n(Ne, {}),
2298
- F && /* @__PURE__ */ n(
2299
- _1,
2299
+ (x || O) && /* @__PURE__ */ n(Ne, {}),
2300
+ B && /* @__PURE__ */ n(
2301
+ K1,
2300
2302
  {
2301
2303
  onCancel: X,
2302
2304
  onConfirm: U
@@ -2305,23 +2307,23 @@ function Uo({ contextTitle: e, onGoBack: t }) {
2305
2307
  ] }),
2306
2308
  /* @__PURE__ */ g(jo, { ref: _, theme: c, children: [
2307
2309
  /* @__PURE__ */ n(
2308
- A1,
2310
+ Z1,
2309
2311
  {
2310
- onSendMessage: S,
2311
- disabled: v || x,
2312
+ onSendMessage: M,
2313
+ disabled: x || y,
2312
2314
  onClearHistoryClick: fe,
2313
- suggestions: C,
2315
+ suggestions: u || [],
2314
2316
  recentPrompts: xe,
2315
- isLoading: d || x,
2316
- recommendationsError: p,
2317
+ isLoading: d || y,
2318
+ recommendationsError: C,
2317
2319
  onChange: X
2318
2320
  }
2319
2321
  ),
2320
- /* @__PURE__ */ n(qo, { theme: c })
2322
+ /* @__PURE__ */ n(Oo, { theme: c })
2321
2323
  ] })
2322
2324
  ] });
2323
2325
  }
2324
- const _o = u.button`
2326
+ const _o = h.button`
2325
2327
  font-family: ${({ theme: e }) => e.typography.fontFamily};
2326
2328
  padding: 20px;
2327
2329
  border: none;
@@ -2334,23 +2336,23 @@ const _o = u.button`
2334
2336
  cursor: pointer;
2335
2337
 
2336
2338
  background-color: ${({ theme: e }) => e.aiChat.dataTopics.items.backgroundColor};
2337
- `, Ko = u.div`
2339
+ `, Ko = h.div`
2338
2340
  font-size: 1.05rem;
2339
2341
  line-height: 28px;
2340
2342
 
2341
2343
  color: ${({ theme: e }) => e.aiChat.dataTopics.items.textColor};
2342
- `, Yo = u.div`
2344
+ `, Yo = h.div`
2343
2345
  font-size: ${({ theme: e }) => e.aiChat.primaryFontSize[0]};
2344
2346
  line-height: ${({ theme: e }) => e.aiChat.primaryFontSize[1]};
2345
2347
 
2346
2348
  color: ${({ theme: e }) => Qe(e.aiChat.dataTopics.items.textColor, 0, 0.5)};
2347
- `, Jo = u.div`
2349
+ `, Jo = h.div`
2348
2350
  width: 16px;
2349
2351
  height: 16px;
2350
2352
  transform: rotate(180deg);
2351
2353
  `;
2352
2354
  function Xo(e) {
2353
- const { title: t, description: o, onClick: r } = e, { themeSettings: i } = m();
2355
+ const { title: t, description: o, onClick: r } = e, { themeSettings: i } = b();
2354
2356
  return /* @__PURE__ */ g(_o, { onClick: r, theme: i, children: [
2355
2357
  /* @__PURE__ */ g("div", { children: [
2356
2358
  /* @__PURE__ */ n(Ko, { theme: i, children: t }),
@@ -2359,13 +2361,13 @@ function Xo(e) {
2359
2361
  /* @__PURE__ */ n(Jo, { children: /* @__PURE__ */ n(lt, { color: i.aiChat.icons.color }) })
2360
2362
  ] });
2361
2363
  }
2362
- const en = u.div`
2364
+ const en = h.div`
2363
2365
  padding: 20px;
2364
2366
  display: flex;
2365
2367
  flex-direction: column;
2366
2368
  gap: 20px;
2367
2369
  overflow: auto;
2368
- `, tn = u.div`
2370
+ `, tn = h.div`
2369
2371
  font-size: 24px;
2370
2372
  line-height: 32px;
2371
2373
  font-weight: 600;
@@ -2373,14 +2375,14 @@ const en = u.div`
2373
2375
  padding-bottom: 4px;
2374
2376
 
2375
2377
  color: ${({ theme: e }) => e.aiChat.primaryTextColor};
2376
- `, on = u.div`
2378
+ `, on = h.div`
2377
2379
  font-size: 15px;
2378
2380
  line-height: 22px;
2379
2381
 
2380
2382
  color: ${({ theme: e }) => e.aiChat.primaryTextColor};
2381
2383
  `;
2382
2384
  function nn(e) {
2383
- const { dataTopics: t } = e, { themeSettings: o } = m(), { t: r } = w();
2385
+ const { dataTopics: t } = e, { themeSettings: o } = b(), { t: r } = k();
2384
2386
  return /* @__PURE__ */ g(en, { children: [
2385
2387
  /* @__PURE__ */ n(tn, { theme: o, children: r("ai.dataTopics") }),
2386
2388
  /* @__PURE__ */ g(on, { theme: o, children: [
@@ -2389,7 +2391,7 @@ function nn(e) {
2389
2391
  /* @__PURE__ */ n("br", {}),
2390
2392
  r("ai.topicSelectPrompt")
2391
2393
  ] }),
2392
- t.map((i) => /* @__PURE__ */ Vt(Xo, L(M({}, i), { key: i.title })))
2394
+ t.map((i) => /* @__PURE__ */ jt(Xo, L(w({}, i), { key: i.title })))
2393
2395
  ] });
2394
2396
  }
2395
2397
  const rn = "#000000", sn = "#FFFFFF";
@@ -2520,10 +2522,10 @@ function an({ isDarkBackground: e = !1 }) {
2520
2522
  }
2521
2523
  );
2522
2524
  }
2523
- const ln = u.div`
2525
+ const ln = h.div`
2524
2526
  margin-left: 14px;
2525
2527
  margin-top: 3px;
2526
- `, cn = u.div`
2528
+ `, cn = h.div`
2527
2529
  display: flex;
2528
2530
  flex-direction: column;
2529
2531
  justify-content: top;
@@ -2533,42 +2535,42 @@ const ln = u.div`
2533
2535
  background-color: ${({ theme: e }) => e.aiChat.dataTopics.backgroundColor};
2534
2536
  `;
2535
2537
  function dn({ dataTopicsList: e, onDataTopicClick: t }) {
2536
- const { enableHeader: o } = W(), { themeSettings: r } = m(), { t: i } = w(), a = D(() => e == null ? void 0 : e.map((c) => ({
2538
+ const { enableHeader: o } = W(), { themeSettings: r } = b(), { t: i } = k(), s = D(() => e == null ? void 0 : e.map((c) => ({
2537
2539
  title: c,
2538
2540
  onClick: () => t(c)
2539
- })), [e, t]), s = Kt(Yt(r.aiChat.header.backgroundColor)) > 0.5;
2540
- return /* @__PURE__ */ g(I, { children: [
2541
+ })), [e, t]), a = Yt(Jt(r.aiChat.header.backgroundColor)) > 0.5;
2542
+ return /* @__PURE__ */ g(H, { children: [
2541
2543
  o ? /* @__PURE__ */ n(
2542
2544
  ct,
2543
2545
  {
2544
2546
  title: i("ai.analyticsChatbot"),
2545
- leftNav: /* @__PURE__ */ n(ln, { children: /* @__PURE__ */ n(an, { isDarkBackground: s }) }),
2547
+ leftNav: /* @__PURE__ */ n(ln, { children: /* @__PURE__ */ n(an, { isDarkBackground: a }) }),
2546
2548
  rightNav: /* @__PURE__ */ n(dt, {}),
2547
2549
  style: r.aiChat.header
2548
2550
  }
2549
2551
  ) : null,
2550
2552
  /* @__PURE__ */ g(cn, { theme: r, children: [
2551
- !a && /* @__PURE__ */ n(ge, {}),
2552
- a && /* @__PURE__ */ n(nn, { dataTopics: a })
2553
+ !s && /* @__PURE__ */ n(ge, {}),
2554
+ s && /* @__PURE__ */ n(nn, { dataTopics: s })
2553
2555
  ] })
2554
2556
  ] });
2555
2557
  }
2556
2558
  function un() {
2557
- const [e, t] = $([]), [o, r] = $(), [i, a] = $(), { data: s, fetchStatus: c } = nt(), { dataTopicsList: l } = W(), { t: d } = w();
2559
+ const [e, t] = $([]), [o, r] = $(), [i, s] = $(), { data: a, fetchStatus: c } = nt(), { dataTopicsList: l } = W(), { t: d } = k();
2558
2560
  oe(() => {
2559
- if (s && c === "idle") {
2560
- let h = s;
2561
- l && l.length && (h = s == null ? void 0 : s.filter((b) => l == null ? void 0 : l.includes(b.title))), t(h.map((b) => b.title)), h.length ? h.length === 1 && (a(void 0), r(h[0].title)) : a(d("ai.errors.noAvailableDataTopics"));
2561
+ if (a && c === "idle") {
2562
+ let p = a;
2563
+ l && l.length && (p = a == null ? void 0 : a.filter((m) => l == null ? void 0 : l.includes(m.title))), t(p.map((m) => m.title)), p.length ? p.length === 1 && (s(void 0), r(p[0].title)) : s(d("ai.errors.noAvailableDataTopics"));
2562
2564
  }
2563
- }, [s, l, c, d]);
2564
- const p = te(), C = T(() => {
2565
- a(void 0), p.invalidateQueries(["getDataTopics"]);
2566
- }, [p]);
2565
+ }, [a, l, c, d]);
2566
+ const C = te(), u = T(() => {
2567
+ s(void 0), C.invalidateQueries(["getDataTopics"]);
2568
+ }, [C]);
2567
2569
  return i ? /* @__PURE__ */ n(
2568
2570
  st,
2569
2571
  {
2570
2572
  text: i,
2571
- action: { text: d("ai.buttons.refresh"), onClick: C }
2573
+ action: { text: d("ai.buttons.refresh"), onClick: u }
2572
2574
  }
2573
2575
  ) : e.length === 1 && !o ? /* @__PURE__ */ n(ge, {}) : o ? /* @__PURE__ */ n(
2574
2576
  Uo,
@@ -2580,16 +2582,16 @@ function un() {
2580
2582
  dn,
2581
2583
  {
2582
2584
  dataTopicsList: e,
2583
- onDataTopicClick: (h) => r(h)
2585
+ onDataTopicClick: (p) => r(p)
2584
2586
  }
2585
2587
  );
2586
2588
  }
2587
2589
  const En = $e({
2588
2590
  componentName: "Chatbot"
2589
2591
  })((e) => {
2590
- const { width: t, height: o, config: r } = e, { themeSettings: i } = m();
2591
- return /* @__PURE__ */ n(p1, { value: r != null ? r : {}, children: /* @__PURE__ */ n(
2592
- S1,
2592
+ const { width: t, height: o, config: r } = e, { themeSettings: i } = b();
2593
+ return /* @__PURE__ */ n(g1, { value: r != null ? r : {}, children: /* @__PURE__ */ n(
2594
+ M1,
2593
2595
  {
2594
2596
  id: "csdk-chatbot-frame",
2595
2597
  width: t,
@@ -2602,19 +2604,19 @@ const En = $e({
2602
2604
  }), Nn = $e({
2603
2605
  componentName: "GetNlgInsights"
2604
2606
  })(function(t) {
2605
- const { data: o, isLoading: r, isError: i } = ne(t), { t: a } = w();
2607
+ const { data: o, isLoading: r, isError: i } = ne(t), { t: s } = k();
2606
2608
  if (i)
2607
- return /* @__PURE__ */ n(I, { children: a("ai.errors.unexpected") });
2608
- const s = o != null ? o : "Oops, no data came back for that.";
2609
- return /* @__PURE__ */ n(Ce, { text: r ? "Loading..." : s });
2610
- }), Hn = $e({
2609
+ return /* @__PURE__ */ n(H, { children: s("ai.errors.unexpected") });
2610
+ const a = o != null ? o : "Oops, no data came back for that.";
2611
+ return /* @__PURE__ */ n(Ce, { text: r ? "Loading..." : a });
2612
+ }), In = $e({
2611
2613
  componentName: "GetNlgQueryResult"
2612
2614
  })(function(t) {
2613
- const { data: o, isLoading: r, isError: i } = ne(t), { t: a } = w();
2615
+ const { data: o, isLoading: r, isError: i } = ne(t), { t: s } = k();
2614
2616
  if (i)
2615
- return /* @__PURE__ */ n(I, { children: a("ai.errors.unexpected") });
2616
- const s = o != null ? o : "Oops, no data came back for that.";
2617
- return /* @__PURE__ */ n(Ce, { text: r ? "Loading..." : s });
2617
+ return /* @__PURE__ */ n(H, { children: s("ai.errors.unexpected") });
2618
+ const a = o != null ? o : "Oops, no data came back for that.";
2619
+ return /* @__PURE__ */ n(Ce, { text: r ? "Loading..." : a });
2618
2620
  });
2619
2621
  function hn({ theme: e }) {
2620
2622
  const t = e.general.brandColor;
@@ -2658,17 +2660,17 @@ function hn({ theme: e }) {
2658
2660
  }
2659
2661
  );
2660
2662
  }
2661
- const pn = u.div`
2663
+ const pn = h.div`
2662
2664
  display: flex;
2663
2665
  flex-direction: row;
2664
2666
  align-items: center;
2665
2667
  gap: 10px;
2666
2668
  margin: 24px 0;
2667
2669
  max-width: 640px;
2668
- `, gn = u.div`
2670
+ `, gn = h.div`
2669
2671
  align-self: flex-start;
2670
2672
  `, Cn = ({ summary: e, nlgRequest: t }) => {
2671
- const { themeSettings: o } = m();
2673
+ const { themeSettings: o } = b();
2672
2674
  return /* @__PURE__ */ n(
2673
2675
  Le,
2674
2676
  {
@@ -2683,47 +2685,58 @@ const pn = u.div`
2683
2685
  ] })
2684
2686
  }
2685
2687
  );
2686
- }, In = ({ nlqResponse: e, onDataReady: t, filters: o = [] }) => {
2688
+ }, Hn = ({
2689
+ nlqResponse: e,
2690
+ onDataReady: t,
2691
+ filters: o = [],
2692
+ enableHeader: r = !0
2693
+ }) => {
2687
2694
  e.queryTitle = At(e.queryTitle);
2688
- const { connectToWidgetProps: r } = Zt({
2695
+ const { connectToWidgetProps: i } = Zt({
2689
2696
  initialFilters: o
2690
- }), [i, a] = $(null);
2697
+ }), [s, a] = $(null);
2691
2698
  oe(() => {
2692
- const p = pe(e, {
2699
+ var p;
2700
+ const u = pe(e, {
2693
2701
  useCustomizedStyleOptions: !0
2694
2702
  });
2695
- if (!p)
2703
+ if (!u)
2696
2704
  a(null);
2697
2705
  else {
2698
- const C = r(p, {
2706
+ r || (u.styleOptions = L(w({}, u.styleOptions), {
2707
+ header: L(w({}, (p = u.styleOptions) == null ? void 0 : p.header), {
2708
+ hidden: !0
2709
+ })
2710
+ }));
2711
+ const m = i(u, {
2699
2712
  shouldAffectFilters: !1,
2700
2713
  applyMode: "filter"
2701
2714
  });
2702
- a(C);
2715
+ a(m);
2703
2716
  }
2704
- }, [e, r]);
2705
- const s = D(() => {
2706
- const p = i && Se(i) ? Jt(i == null ? void 0 : i.filters) : [], C = e.jaql.metadata.filter((h) => !h.jaql.filter).concat(
2707
- p.filter((h) => !h.config.disabled).map((h) => h.jaql())
2717
+ }, [e, i, r]);
2718
+ const c = D(() => {
2719
+ const u = s && Se(s) ? zt(s == null ? void 0 : s.filters) : [], p = e.jaql.metadata.filter((m) => !m.jaql.filter).concat(
2720
+ u.filter((m) => !m.config.disabled).map((m) => m.jaql())
2708
2721
  );
2709
- return L(M({}, e), { jaql: L(M({}, e.jaql), { metadata: C }) });
2710
- }, [e, i]), { data: c, isLoading: l, isError: d } = ne(s);
2711
- return l || !i ? /* @__PURE__ */ n(Ne, {}) : Se(i) ? /* @__PURE__ */ n(
2722
+ return L(w({}, e), { jaql: L(w({}, e.jaql), { metadata: p }) });
2723
+ }, [e, s]), { data: l, isLoading: d, isError: C } = ne(c);
2724
+ return d || !s ? /* @__PURE__ */ n(Ne, {}) : Se(s) ? /* @__PURE__ */ n(
2712
2725
  ee,
2713
- L(M({}, i), {
2726
+ L(w({}, s), {
2714
2727
  highlightSelectionDisabled: !0,
2715
2728
  onDataReady: t,
2716
- topSlot: c && !d && /* @__PURE__ */ n(Cn, { nlgRequest: s, summary: c })
2729
+ topSlot: l && !C && /* @__PURE__ */ n(Cn, { nlgRequest: c, summary: l })
2717
2730
  })
2718
- ) : /* @__PURE__ */ n(I, {});
2731
+ ) : /* @__PURE__ */ n(H, {});
2719
2732
  };
2720
2733
  export {
2721
2734
  kn as AiContextProvider,
2722
2735
  En as Chatbot,
2723
2736
  Nn as GetNlgInsights,
2724
- Hn as GetNlgQueryResult,
2725
- In as NlqChartWidget,
2726
- x1 as useChatSession,
2737
+ In as GetNlgQueryResult,
2738
+ Hn as NlqChartWidget,
2739
+ y1 as useChatSession,
2727
2740
  Rn as useGetDataSourceFields,
2728
2741
  Sn as useGetNlgInsights,
2729
2742
  Mn as useGetNlgQueryResult,