@box/box-ai-content-answers 1.19.4 → 1.21.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 (48) hide show
  1. package/dist/chunks/clear-conversation-button.js +15 -16
  2. package/dist/chunks/stopResponseButton.js +19 -23
  3. package/dist/chunks/types.js +8 -8
  4. package/dist/chunks/warning-message.js +15 -16
  5. package/dist/esm/lib/components/answer/answer-content.js +15 -15
  6. package/dist/esm/lib/components/answer/answer.js +107 -109
  7. package/dist/esm/lib/components/answer/citation.js +23 -24
  8. package/dist/esm/lib/components/answer/copy-button.js +3 -3
  9. package/dist/esm/lib/components/answer/embed-the-answer-button.js +44 -44
  10. package/dist/esm/lib/components/answer/feedback-tooltip.js +63 -56
  11. package/dist/esm/lib/components/answer/inline-error.js +1 -1
  12. package/dist/esm/lib/components/answer/loading-indicator.js +15 -18
  13. package/dist/esm/lib/components/answer/references.js +30 -30
  14. package/dist/esm/lib/components/answer/thumb-buttons.js +95 -96
  15. package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +166 -167
  16. package/dist/esm/lib/components/api-wrapper/reducer.js +1 -1
  17. package/dist/esm/lib/components/api-wrapper/utils/request.js +8 -8
  18. package/dist/esm/lib/components/api-wrapper/utils/stream.js +24 -25
  19. package/dist/esm/lib/components/chat/chat.js +78 -79
  20. package/dist/esm/lib/components/common/focusInputUtils.js +3 -4
  21. package/dist/esm/lib/components/common/markdown-react.js +91 -93
  22. package/dist/esm/lib/components/common/markdown.js +2666 -2696
  23. package/dist/esm/lib/components/content/content.js +38 -39
  24. package/dist/esm/lib/components/footer/footer-actions.js +3 -3
  25. package/dist/esm/lib/components/footer/footer.js +97 -98
  26. package/dist/esm/lib/components/modal/modal.js +121 -122
  27. package/dist/esm/lib/components/sidebar/content.js +95 -101
  28. package/dist/esm/lib/components/sidebar/sidebar.js +82 -83
  29. package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -1
  30. package/dist/esm/lib/components/suggested-questions/suggestions.js +30 -30
  31. package/dist/esm/lib/components/welcome-message/contextual-items-message.js +36 -38
  32. package/dist/esm/lib/components/welcome-message/items-dropdown.js +27 -27
  33. package/dist/esm/lib/hooks/usePromptFocus.js +13 -14
  34. package/dist/i18n/en-x-pseudo.js +89 -89
  35. package/dist/i18n/en-x-pseudo.properties +89 -89
  36. package/dist/styles/answer-content.css +1 -1
  37. package/dist/styles/answer.css +1 -1
  38. package/dist/styles/box-ai-content-answers.css +1 -1
  39. package/dist/styles/chat.css +1 -1
  40. package/dist/styles/clear-conversation-button.css +1 -1
  41. package/dist/styles/content.css +1 -1
  42. package/dist/styles/content2.css +1 -1
  43. package/dist/styles/markdown2.css +1 -1
  44. package/dist/styles/question.css +1 -1
  45. package/dist/styles/stopResponseButton.css +1 -1
  46. package/dist/styles/warning-message.css +1 -1
  47. package/dist/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +1 -1
  48. package/package.json +11 -11
@@ -1,70 +1,69 @@
1
- import { useBlueprintModernization as Y, useBreakpoint as Z, Breakpoint as ee, Modal as m, TooltipProvider as oe, Tooltip as te } from "@box/blueprint-web";
2
- import { ArrowsCollapse as se } from "@box/blueprint-web-assets/icons/Fill";
3
- import { BoxAiLogo as ae } from "@box/blueprint-web-assets/icons/Logo";
4
- import { ArrowsMinimize as re } from "@box/blueprint-web-assets/icons/Medium";
5
- import { Size8 as S } from "@box/blueprint-web-assets/tokens/tokens";
6
- import { BoxAiAgentSelectorWithApi as le, AgentsProvider as ne } from "@box/box-ai-agent-selector";
7
- import { useState as ie, useMemo as ce, useCallback as x, useEffect as p } from "react";
8
- import { useIntl as de } from "react-intl";
9
- import { BoxAiContentAnswers as me } from "../../box-ai-content-answers.js";
10
- import { A as fe, R as ge } from "../../../../chunks/types.js";
11
- import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ue } from "../common/constants.js";
12
- import { s, C as Ce } from "../../../../chunks/clear-conversation-button.js";
13
- import pe from "./hooks/useStopPropagationOnEsc.js";
14
- import { Title as Me } from "./title.js";
15
- import B from "./messages.js";
1
+ import { useBlueprintModernization as V, useBreakpoint as X, Breakpoint as Y, Modal as c, TooltipProvider as Z, Tooltip as ee } from "@box/blueprint-web";
2
+ import { ArrowsCollapse as oe } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { BoxAiLogo as te } from "@box/blueprint-web-assets/icons/Logo";
4
+ import { ArrowsMinimize as ae } from "@box/blueprint-web-assets/icons/Medium";
5
+ import { Size8 as E } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import { BoxAiAgentSelectorWithApi as se, AgentsProvider as re } from "@box/box-ai-agent-selector";
7
+ import { useState as le, useMemo as ne, useCallback as v, useEffect as C } from "react";
8
+ import { useIntl as ie } from "react-intl";
9
+ import { BoxAiContentAnswers as de } from "../../box-ai-content-answers.js";
10
+ import { A as ce, R as me } from "../../../../chunks/types.js";
11
+ import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ge } from "../common/constants.js";
12
+ import { s as t, C as pe } from "../../../../chunks/clear-conversation-button.js";
13
+ import fe from "./hooks/useStopPropagationOnEsc.js";
14
+ import { Title as ue } from "./title.js";
15
+ import S from "./messages.js";
16
16
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
17
- const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Te = (o) => o ? B.collapseModalAriaLabel : B.closeModalAriaLabel, be = (o, r) => o ? r ? re : se : void 0, Ae = (o, r) => {
18
- const l = o === "collapsible";
17
+ const Ce = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Me = (o) => o ? S.collapseModalAriaLabel : S.closeModalAriaLabel, he = (o, a) => o ? a ? ae : oe : void 0, Te = (o, a) => {
18
+ const s = o === "collapsible";
19
19
  return {
20
- closeModalLabel: Te(l),
21
- closeModalTargetId: he(l),
22
- closeModalIcon: be(l, r)
20
+ closeModalLabel: Me(s),
21
+ closeModalTargetId: Ce(s),
22
+ closeModalIcon: he(s, a)
23
23
  };
24
- }, He = ({
24
+ }, ze = ({
25
25
  children: o,
26
- getAIStudioAgents: r,
27
- hasCustomSuggestedQuestions: l,
28
- hostAppName: f,
26
+ getAIStudioAgents: a,
27
+ hasCustomSuggestedQuestions: s,
28
+ hostAppName: m,
29
29
  isAIStudioAgentSelectorEnabled: g = !1,
30
- isDebugModeEnabled: _,
31
- isStopResponseEnabled: k = !1,
30
+ isDebugModeEnabled: x,
31
+ isStopResponseEnabled: B = !1,
32
32
  itemSize: T,
33
33
  extension: b,
34
- onClearAction: u,
34
+ onClearAction: p,
35
35
  onSelectAgent: P,
36
- onSelectedAgentCallback: q,
37
- promptValue: z,
38
- recordAction: n,
39
- setPromptValue: G,
40
- shouldRenderProviders: H = !0,
41
- shouldShowLandingPage: F = !1,
42
- stopPropagationOnEsc: j,
36
+ onSelectedAgentCallback: _,
37
+ promptValue: k,
38
+ recordAction: r,
39
+ setPromptValue: q,
40
+ shouldRenderProviders: z = !0,
41
+ shouldShowLandingPage: G = !1,
42
+ stopPropagationOnEsc: y,
43
43
  variant: A = "closable",
44
- items: c,
45
- parentItem: d,
46
- ...D
44
+ items: i,
45
+ parentItem: f,
46
+ ...H
47
47
  }) => {
48
- var v, I;
49
48
  const {
50
- enableModernizedComponents: L
51
- } = Y(), {
52
- open: R,
53
- defaultOpen: Q,
54
- onOpenChange: U,
55
- modal: W,
56
- ...a
57
- } = D, O = de(), y = Z() <= ee.Medium;
58
- pe(j, R);
59
- const C = (I = (v = a == null ? void 0 : a.questions) == null ? void 0 : v[a.questions.length - 1]) == null ? void 0 : I.error, [K, w] = ie(!1), {
60
- closeModalLabel: N,
61
- closeModalTargetId: $,
62
- closeModalIcon: J
63
- } = ce(() => Ae(A, L), [A, L]), i = x((t) => {
64
- n && (t.data ?? (t.data = {}), t.data.hostAppName = f, n(t));
65
- }, [f, n]);
66
- p(() => {
67
- c || i({
49
+ enableModernizedComponents: I
50
+ } = V(), {
51
+ open: L,
52
+ defaultOpen: F,
53
+ onOpenChange: j,
54
+ modal: D,
55
+ ...d
56
+ } = H, R = ie(), Q = X() <= Y.Medium;
57
+ fe(y, L);
58
+ const u = d?.questions?.[d.questions.length - 1]?.error, [U, O] = le(!1), {
59
+ closeModalLabel: w,
60
+ closeModalTargetId: W,
61
+ closeModalIcon: K
62
+ } = ne(() => Te(A, I), [A, I]), l = v((n) => {
63
+ r && (n.data ??= {}, n.data.hostAppName = m, r(n));
64
+ }, [m, r]);
65
+ C(() => {
66
+ i || l({
68
67
  ...M,
69
68
  target: "loaded",
70
69
  data: {
@@ -72,100 +71,100 @@ const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
72
71
  fileType: b
73
72
  }
74
73
  });
75
- }, [i, b, T, c, n]), p(() => {
76
- c && i({
74
+ }, [l, b, T, i, r]), C(() => {
75
+ i && l({
77
76
  ...M,
78
77
  target: "loaded",
79
78
  data: {
80
- parentItemType: d == null ? void 0 : d.type,
81
- items: c.map((t) => ({
82
- status: t.status,
83
- fileType: t.fileType
79
+ parentItemType: f?.type,
80
+ items: i.map((n) => ({
81
+ status: n.status,
82
+ fileType: n.fileType
84
83
  }))
85
84
  }
86
85
  });
87
- }, [i, d, n]), p(() => {
88
- C && C === fe.AGENT_NOT_FOUND && w(!0);
89
- }, [C]);
90
- const V = () => {
91
- u && (u(), i({
86
+ }, [l, f, r]), C(() => {
87
+ u && u === ce.AGENT_NOT_FOUND && O(!0);
88
+ }, [u]);
89
+ const $ = () => {
90
+ p && (p(), l({
92
91
  ...M,
93
- action: ue,
92
+ action: ge,
94
93
  target: "clearChat"
95
94
  }));
96
- }, X = x(async () => (w(!1), r()), [r]), E = /* @__PURE__ */ h(m, {
97
- defaultOpen: Q,
98
- modal: W,
99
- onOpenChange: U,
100
- open: R,
101
- children: [/* @__PURE__ */ e(m.Trigger, {
95
+ }, J = v(async () => (O(!1), a()), [a]), N = /* @__PURE__ */ h(c, {
96
+ defaultOpen: F,
97
+ modal: D,
98
+ onOpenChange: j,
99
+ open: L,
100
+ children: [/* @__PURE__ */ e(c.Trigger, {
102
101
  children: o
103
- }), /* @__PURE__ */ h(m.Content, {
104
- className: s.contentAnswersModal,
102
+ }), /* @__PURE__ */ h(c.Content, {
103
+ className: t.contentAnswersModal,
105
104
  "data-testid": "content-answers-modal",
106
105
  size: "xlarge",
107
- children: [/* @__PURE__ */ e(m.Header, {
108
- className: s.modalHeaderContainer,
106
+ children: [/* @__PURE__ */ e(c.Header, {
107
+ className: t.modalHeaderContainer,
109
108
  children: /* @__PURE__ */ h("div", {
110
- className: s.modalHeader,
111
- children: [!y && /* @__PURE__ */ e(ae, {
112
- className: s.BoxAIIconColor,
109
+ className: t.modalHeader,
110
+ children: [!Q && /* @__PURE__ */ e(te, {
111
+ className: t.BoxAIIconColor,
113
112
  "data-testid": "content-answers-icon-color",
114
- height: S,
115
- width: S
116
- }), /* @__PURE__ */ e(Me, {
113
+ height: E,
114
+ width: E
115
+ }), /* @__PURE__ */ e(ue, {
117
116
  isAIStudioAgentSelectorEnabled: g
118
- }), g && /* @__PURE__ */ e(le, {
119
- contentClassName: s.agentSelectorContent,
120
- disabled: a.hasRequestInProgress,
121
- fetcher: X,
122
- hostAppName: f,
117
+ }), g && /* @__PURE__ */ e(se, {
118
+ contentClassName: t.agentSelectorContent,
119
+ disabled: d.hasRequestInProgress,
120
+ fetcher: J,
121
+ hostAppName: m,
123
122
  onSelectAgent: P,
124
- onSelectedAgentCallback: q,
125
- recordAction: n,
126
- requestState: K ? ge.ERROR : void 0,
123
+ onSelectedAgentCallback: _,
124
+ recordAction: r,
125
+ requestState: U ? me.ERROR : void 0,
127
126
  shouldHideAgentSelectorOnLoad: !0,
128
- triggerChipClassName: s.agentSelectorTrigger,
127
+ triggerChipClassName: t.agentSelectorTrigger,
129
128
  useAgentLocalStorage: !0
130
129
  })]
131
130
  })
132
- }), /* @__PURE__ */ e(me, {
133
- className: `box-content-answers-chat-container ${s.boxAiContentAnswers}`,
134
- hasCustomSuggestedQuestions: l,
135
- hostAppName: f,
131
+ }), /* @__PURE__ */ e(de, {
132
+ className: `box-content-answers-chat-container ${t.boxAiContentAnswers}`,
133
+ hasCustomSuggestedQuestions: s,
134
+ hostAppName: m,
136
135
  isAIStudioAgentSelectorEnabled: g,
137
- isDebugModeEnabled: _,
138
- isStopResponseEnabled: k,
139
- items: c,
140
- parentItem: d,
141
- promptValue: z,
142
- recordAction: i,
143
- setPromptValue: G,
144
- shouldShowLandingPage: F,
145
- ...a
146
- }), u && /* @__PURE__ */ e(Ce, {
147
- hasRequestInProgress: a.hasRequestInProgress,
148
- onClick: V
149
- }), /* @__PURE__ */ e(oe, {
150
- children: /* @__PURE__ */ e(te, {
151
- content: O.formatMessage(N),
136
+ isDebugModeEnabled: x,
137
+ isStopResponseEnabled: B,
138
+ items: i,
139
+ parentItem: f,
140
+ promptValue: k,
141
+ recordAction: l,
142
+ setPromptValue: q,
143
+ shouldShowLandingPage: G,
144
+ ...d
145
+ }), p && /* @__PURE__ */ e(pe, {
146
+ hasRequestInProgress: d.hasRequestInProgress,
147
+ onClick: $
148
+ }), /* @__PURE__ */ e(Z, {
149
+ children: /* @__PURE__ */ e(ee, {
150
+ content: R.formatMessage(w),
152
151
  "data-testid": "content-answers-close-modal-tooltip",
153
- children: /* @__PURE__ */ e(m.Close, {
154
- "aria-label": O.formatMessage(N),
155
- className: s["modal-close-button"],
156
- "data-target-id": $,
157
- icon: J,
152
+ children: /* @__PURE__ */ e(c.Close, {
153
+ "aria-label": R.formatMessage(w),
154
+ className: t["modal-close-button"],
155
+ "data-target-id": W,
156
+ icon: K,
158
157
  size: "small"
159
158
  })
160
159
  })
161
160
  })]
162
161
  })]
163
162
  });
164
- return H ? /* @__PURE__ */ e(ne, {
165
- children: E
166
- }) : E;
163
+ return z ? /* @__PURE__ */ e(re, {
164
+ children: N
165
+ }) : N;
167
166
  };
168
167
  export {
169
- He as IntelligenceModal,
170
- He as default
168
+ ze as IntelligenceModal,
169
+ ze as default
171
170
  };
@@ -1,69 +1,63 @@
1
- import { useBlueprintModernization as se, Text as ae, Tooltip as $, IconButton as y } from "@box/blueprint-web";
2
- import { ArrowsExpand as ie, XMark as re } from "@box/blueprint-web-assets/icons/Fill";
1
+ import { useBlueprintModernization as se, Text as ae, Tooltip as Q, IconButton as $ } from "@box/blueprint-web";
2
+ import { ArrowsExpand as re, XMark as ie } from "@box/blueprint-web-assets/icons/Fill";
3
3
  import { ArrowsMaximize as ce } from "@box/blueprint-web-assets/icons/Medium";
4
4
  import { useAgents as de, BoxAiAgentSelectorWithApi as le } from "@box/box-ai-agent-selector";
5
5
  import D from "clsx";
6
- import H from "lodash/isEqual";
6
+ import y from "lodash/isEqual";
7
7
  import * as b from "react";
8
8
  import { useIntl as be } from "react-intl";
9
9
  import { BoxAiContentAnswers as pe } from "../../box-ai-content-answers.js";
10
10
  import { withApiWrapper as Se } from "../api-wrapper/api-wrapper.js";
11
11
  import { ORIGIN_BOXAI_SIDEBAR as Ae, EVENT_JS_READY as me } from "../common/constants.js";
12
- import { mark as he } from "../common/performance.js";
13
- import { C as ue } from "../../../../chunks/clear-conversation-button.js";
14
- import { IntelligenceModal as Ie } from "../modal/modal.js";
15
- import { IntelligenceSidebarContext as _e } from "./context.js";
12
+ import { mark as ue } from "../common/performance.js";
13
+ import { C as Ie } from "../../../../chunks/clear-conversation-button.js";
14
+ import { IntelligenceModal as he } from "../modal/modal.js";
15
+ import { IntelligenceSidebarContext as Ce } from "./context.js";
16
16
  import p from "./messages.js";
17
- import Ce from "./title.js";
18
- import { jsxs as h, Fragment as Q, jsx as e } from "react/jsx-runtime";
19
- import '../../../../styles/content.css';const xe = "_bcsSidebarBase_1kkpe_2", ge = "_bcsContent_1kkpe_2", Be = "_bcsBoxAISidebar_1kkpe_2", fe = "_bcsContentHeader_1kkpe_6", ke = "_bcsTitle_1kkpe_15", we = "_bcsScrollContent_1kkpe_22", Te = "_withModalOpen_1kkpe_32", Ee = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ne = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", Me = "_bcsBoxAISidebarChatActions_1kkpe_43", ve = "_bcsBoxAISidebarContent_1kkpe_47", Pe = "_bcsBoxAISidebarExpand_1kkpe_50", Le = "_bcsBoxAISidebarClear_1kkpe_53", Oe = "_bcsBoxAISidebarTitlePart_1kkpe_56", Re = "_bcsBoxAISidebarClose_1kkpe_77", qe = "_sidebarChip_1kkpe_88", Ue = "_bcsContentSubheader_1kkpe_101", Ve = "_bcsScrollContentWrapper_1kkpe_110", We = "_withSubheader_1kkpe_115", ze = "_expanded_1kkpe_118", t = {
20
- bcsSidebarBase: xe,
21
- bcsContent: ge,
22
- bcsBoxAISidebar: Be,
23
- bcsContentHeader: fe,
24
- bcsTitle: ke,
25
- bcsScrollContent: we,
26
- withModalOpen: Te,
27
- bcsBoxAISidebarAgentSelector: Ee,
28
- bcsBoxAISidebarAgentSelectorContainer: Ne,
29
- bcsBoxAISidebarChatActions: Me,
30
- bcsBoxAISidebarContent: ve,
31
- bcsBoxAISidebarExpand: Pe,
32
- bcsBoxAISidebarClear: Le,
33
- bcsBoxAISidebarTitlePart: Oe,
34
- bcsBoxAISidebarClose: Re,
35
- sidebarChip: qe,
36
- bcsContentSubheader: Ue,
37
- bcsScrollContentWrapper: Ve,
38
- withSubheader: We,
39
- expanded: ze
40
- }, Fe = `${Ae}_${me}`;
41
- he(Fe);
42
- const $e = ({
43
- actions: f,
44
- children: i,
17
+ import ge from "./title.js";
18
+ import { jsxs as u, Fragment as H, jsx as e } from "react/jsx-runtime";
19
+ import '../../../../styles/content.css';const xe = "_bcsContent_1kkpe_2", fe = "_bcsBoxAISidebar_1kkpe_2", _e = "_bcsContentHeader_1kkpe_6", Be = "_bcsTitle_1kkpe_15", ke = "_bcsScrollContent_1kkpe_22", we = "_withModalOpen_1kkpe_32", Te = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ee = "_bcsBoxAISidebarContent_1kkpe_47", Ne = "_bcsBoxAISidebarExpand_1kkpe_50", Me = "_bcsBoxAISidebarClear_1kkpe_53", ve = "_bcsBoxAISidebarTitlePart_1kkpe_56", Pe = "_bcsBoxAISidebarClose_1kkpe_77", Le = "_bcsContentSubheader_1kkpe_101", Oe = "_bcsScrollContentWrapper_1kkpe_110", t = {
20
+ bcsContent: xe,
21
+ bcsBoxAISidebar: fe,
22
+ bcsContentHeader: _e,
23
+ bcsTitle: Be,
24
+ bcsScrollContent: ke,
25
+ withModalOpen: we,
26
+ bcsBoxAISidebarAgentSelector: Te,
27
+ bcsBoxAISidebarContent: Ee,
28
+ bcsBoxAISidebarExpand: Ne,
29
+ bcsBoxAISidebarClear: Me,
30
+ bcsBoxAISidebarTitlePart: ve,
31
+ bcsBoxAISidebarClose: Pe,
32
+ bcsContentSubheader: Le,
33
+ bcsScrollContentWrapper: Oe
34
+ }, Re = `${Ae}_${me}`;
35
+ ue(Re);
36
+ const qe = ({
37
+ actions: B,
38
+ children: r,
45
39
  className: o,
46
40
  elementId: S = "",
47
- sidebarView: u = "",
48
- title: r,
41
+ sidebarView: I = "",
42
+ title: i,
49
43
  subheader: c,
50
44
  ...d
51
45
  }) => {
52
- const A = `${S}${S === "" ? "" : "_"}${u}`, I = `${A}-content`;
53
- return /* @__PURE__ */ h("div", {
46
+ const A = `${S}${S === "" ? "" : "_"}${I}`, h = `${A}-content`;
47
+ return /* @__PURE__ */ u("div", {
54
48
  "aria-labelledby": A,
55
49
  className: D(t.bcsContent, o),
56
50
  "data-testid": "bcs-content",
57
- id: I,
51
+ id: h,
58
52
  role: "tabpanel",
59
53
  ...d,
60
- children: [/* @__PURE__ */ h("div", {
54
+ children: [/* @__PURE__ */ u("div", {
61
55
  className: t.bcsContentHeader,
62
- children: [r && /* @__PURE__ */ e(ae, {
56
+ children: [i && /* @__PURE__ */ e(ae, {
63
57
  as: "h3",
64
58
  className: t.bcsTitle,
65
- children: r
66
- }), f]
59
+ children: i
60
+ }), B]
67
61
  }), c && /* @__PURE__ */ e("div", {
68
62
  className: t.bcsContentSubheader,
69
63
  children: c
@@ -71,35 +65,35 @@ const $e = ({
71
65
  className: t.bcsScrollContentWrapper,
72
66
  children: /* @__PURE__ */ e("div", {
73
67
  className: t.bcsScrollContent,
74
- children: i
68
+ children: r
75
69
  })
76
70
  })]
77
71
  });
78
72
  };
79
- function ye(f) {
73
+ function Ue(B) {
80
74
  const {
81
- createSession: i,
75
+ createSession: r,
82
76
  encodedSession: o,
83
77
  onClearAction: S,
84
- getAIStudioAgents: u,
85
- hasRequestInProgress: r,
78
+ getAIStudioAgents: I,
79
+ hasRequestInProgress: i,
86
80
  hostAppName: c,
87
81
  isAIStudioAgentSelectorEnabled: d,
88
82
  isLoading: A,
89
- onSelectAgent: I,
90
- questions: _,
83
+ onSelectAgent: h,
84
+ questions: C,
91
85
  shouldShowLandingPage: N = !0,
92
- sendQuestion: C,
86
+ sendQuestion: g,
93
87
  stopQuestion: k,
94
88
  embedTheAnswerButtonConfig: j,
95
89
  onClose: M,
96
90
  ...v
97
- } = f, {
91
+ } = B, {
98
92
  formatMessage: l
99
93
  } = be(), {
100
94
  enableModernizedComponents: J
101
95
  } = se(), P = b.useRef(!1), [w, L] = b.useState(!1), {
102
- cache: s,
96
+ cache: n,
103
97
  contentName: O,
104
98
  elementId: X,
105
99
  fileExtension: Y,
@@ -113,57 +107,57 @@ function ye(f) {
113
107
  onSelectedAgentCallback: K,
114
108
  recordAction: m,
115
109
  setCacheValue: x,
116
- shouldPreinitSession: g
117
- } = b.useContext(_e), {
110
+ shouldPreinitSession: f
111
+ } = b.useContext(Ce), {
118
112
  agents: Z,
119
113
  requestState: ee,
120
114
  selectedAgent: E
121
115
  } = de(), {
122
- questions: a
123
- } = s, [z, F] = b.useState("");
124
- s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, _) || x("questions", _), H(s.agents.selectedAgent, E) || x("agents", {
116
+ questions: s
117
+ } = n, [z, F] = b.useState("");
118
+ n.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), n.encodedSession !== o && x("encodedSession", o), y(n.questions, C) || x("questions", C), y(n.agents.selectedAgent, E) || x("agents", {
125
119
  agents: Z,
126
120
  requestState: ee,
127
121
  selectedAgent: E
128
122
  });
129
- const B = (n = !1) => {
130
- !g && !o && !A && i && i(!0, !1), n && W && W();
123
+ const _ = (a = !1) => {
124
+ !f && !o && !A && r && r(!0, !1), a && W && W();
131
125
  }, te = () => {
132
126
  L(!1);
133
127
  }, oe = () => {
134
- B(), L(!0);
128
+ _(), L(!0);
135
129
  };
136
- b.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
137
- prompt: a[a.length - 1].prompt
130
+ b.useEffect(() => (f && !o && r && r(!0, !0), o && s.length > 0 && s[s.length - 1].isCompleted === !1 && g({
131
+ prompt: s[s.length - 1].prompt
138
132
  }), m && m({
139
133
  action: "programmatic",
140
134
  component: "sidebar",
141
135
  feature: "answers",
142
136
  target: "loaded",
143
137
  data: {
144
- items: T.map((n) => ({
145
- status: n.status,
146
- fileType: n.fileType
138
+ items: T.map((a) => ({
139
+ status: a.status,
140
+ fileType: a.fileType
147
141
  }))
148
142
  }
149
143
  }), () => {
150
144
  k();
151
145
  }), []), b.useEffect(() => {
152
- const n = a[a.length - 1];
153
- !g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
146
+ const a = s[s.length - 1];
147
+ !f && !P.current && o && a?.isLoading && (g(a, E, !1), P.current = !0);
154
148
  }, [o]);
155
- const ne = () => /* @__PURE__ */ h("div", {
149
+ const ne = () => /* @__PURE__ */ u("div", {
156
150
  className: t.bcsBoxAISidebarTitlePart,
157
- children: [/* @__PURE__ */ e(Ce, {
151
+ children: [/* @__PURE__ */ e(ge, {
158
152
  isAIStudioAgentSelectorEnabled: d
159
153
  }), d && /* @__PURE__ */ e("div", {
160
154
  className: t.bcsBoxAISidebarAgentSelector,
161
155
  children: /* @__PURE__ */ e(le, {
162
- disabled: r,
163
- fetcher: u,
156
+ disabled: i,
157
+ fetcher: I,
164
158
  hostAppName: c,
165
- onAgentsListOpen: B,
166
- onSelectAgent: I,
159
+ onAgentsListOpen: _,
160
+ onSelectAgent: h,
167
161
  onSelectedAgentCallback: K,
168
162
  recordAction: m,
169
163
  shouldHideAgentSelectorOnLoad: !0,
@@ -172,34 +166,34 @@ function ye(f) {
172
166
  })
173
167
  })]
174
168
  });
175
- return /* @__PURE__ */ h(Q, {
176
- children: [/* @__PURE__ */ e($e, {
177
- actions: /* @__PURE__ */ h(Q, {
178
- children: [ne(), /* @__PURE__ */ e(ue, {
169
+ return /* @__PURE__ */ u(H, {
170
+ children: [/* @__PURE__ */ e(qe, {
171
+ actions: /* @__PURE__ */ u(H, {
172
+ children: [ne(), /* @__PURE__ */ e(Ie, {
179
173
  className: t.bcsBoxAISidebarClear,
180
- hasRequestInProgress: r,
174
+ hasRequestInProgress: i,
181
175
  onClick: S
182
- }), /* @__PURE__ */ e($, {
176
+ }), /* @__PURE__ */ e(Q, {
183
177
  content: l(p.sidebarBoxAISwitchToModalView),
184
178
  "data-testid": "content-answers-open-modal-tooltip",
185
179
  variant: "standard",
186
- children: /* @__PURE__ */ e(y, {
180
+ children: /* @__PURE__ */ e($, {
187
181
  "aria-label": l(p.sidebarBoxAISwitchToModalView),
188
182
  className: t.bcsBoxAISidebarExpand,
189
183
  "data-target-id": "IconButton-expandBoxAISidebar",
190
- icon: J ? ce : ie,
184
+ icon: J ? ce : re,
191
185
  onClick: oe,
192
186
  size: "small"
193
187
  })
194
- }), M && /* @__PURE__ */ e($, {
188
+ }), M && /* @__PURE__ */ e(Q, {
195
189
  content: l(p.sidebarBoxAIClose),
196
190
  "data-testid": "content-answers-close-tooltip",
197
191
  variant: "standard",
198
- children: /* @__PURE__ */ e(y, {
192
+ children: /* @__PURE__ */ e($, {
199
193
  "aria-label": l(p.sidebarBoxAIClose),
200
194
  className: t.bcsBoxAISidebarClose,
201
195
  "data-target-id": "IconButton-closeBoxAISidebar",
202
- icon: re,
196
+ icon: ie,
203
197
  onClick: M,
204
198
  size: "small"
205
199
  })
@@ -224,25 +218,25 @@ function ye(f) {
224
218
  isStopResponseEnabled: U,
225
219
  items: T,
226
220
  onFeedbackFormSubmit: V,
227
- onUserIntentToUseAI: B,
221
+ onUserIntentToUseAI: _,
228
222
  promptValue: z,
229
- questions: _,
223
+ questions: C,
230
224
  recordAction: m,
231
225
  setPromptValue: F,
232
- shouldShowLandingPage: s.shouldShowLandingPage,
233
- showLoadingIndicator: A && g,
226
+ shouldShowLandingPage: n.shouldShowLandingPage,
227
+ showLoadingIndicator: A && f,
234
228
  stopQuestion: k,
235
- submitQuestion: C,
229
+ submitQuestion: g,
236
230
  variant: "sidebar",
237
231
  ...v
238
232
  })
239
233
  })
240
- }), /* @__PURE__ */ e(Ie, {
234
+ }), /* @__PURE__ */ e(he, {
241
235
  contentName: O,
242
236
  contentType: l(p.sidebarBoxAIContent),
243
237
  extension: Y,
244
- getAIStudioAgents: u,
245
- hasRequestInProgress: r,
238
+ getAIStudioAgents: I,
239
+ hasRequestInProgress: i,
246
240
  hostAppName: c,
247
241
  isAIStudioAgentSelectorEnabled: d,
248
242
  isFeedbackEnabled: R,
@@ -253,25 +247,25 @@ function ye(f) {
253
247
  onClearAction: S,
254
248
  onFeedbackFormSubmit: V,
255
249
  onOpenChange: te,
256
- onSelectAgent: I,
257
- onUserIntentToUseAI: B,
250
+ onSelectAgent: h,
251
+ onUserIntentToUseAI: _,
258
252
  open: w,
259
253
  promptValue: z,
260
- questions: _,
254
+ questions: C,
261
255
  recordAction: w ? m : void 0,
262
256
  setPromptValue: F,
263
- shouldShowLandingPage: s.shouldShowLandingPage,
257
+ shouldShowLandingPage: n.shouldShowLandingPage,
264
258
  showLoadingIndicator: !1,
265
259
  stopPropagationOnEsc: !0,
266
260
  stopQuestion: k,
267
- submitQuestion: C,
261
+ submitQuestion: g,
268
262
  variant: "collapsible",
269
263
  ...v,
270
264
  shouldRenderProviders: !1
271
265
  })]
272
266
  });
273
267
  }
274
- const ct = Se(ye);
268
+ const ot = Se(Ue);
275
269
  export {
276
- ct as default
270
+ ot as default
277
271
  };