@bikdotai/bik-component-library 0.0.868-beta.6 → 0.0.868-beta.8

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 (218) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  3. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  4. package/dist/cjs/components/button/themes.js +2 -2
  5. package/dist/cjs/components/button/themes.js.map +1 -1
  6. package/dist/cjs/components/chip-selector/ChipSelector.js +2 -0
  7. package/dist/cjs/components/chip-selector/ChipSelector.js.map +1 -0
  8. package/dist/cjs/components/chip-selector/ChipSelector.styled.js +36 -0
  9. package/dist/cjs/components/chip-selector/ChipSelector.styled.js.map +1 -0
  10. package/dist/cjs/components/chip-selector/ChipSelectorGroup.js +2 -0
  11. package/dist/cjs/components/chip-selector/ChipSelectorGroup.js.map +1 -0
  12. package/dist/cjs/components/combo-box/ComboBox.js +2 -0
  13. package/dist/cjs/components/combo-box/ComboBox.js.map +1 -0
  14. package/dist/cjs/components/combo-box/ComboBox.styled.js +33 -0
  15. package/dist/cjs/components/combo-box/ComboBox.styled.js.map +1 -0
  16. package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
  17. package/dist/cjs/components/datePicker/DatePickerWrapper.js.map +1 -1
  18. package/dist/cjs/components/schedule-builder/RefreshSegmentToggle.js +2 -0
  19. package/dist/cjs/components/schedule-builder/RefreshSegmentToggle.js.map +1 -0
  20. package/dist/cjs/components/schedule-builder/ScheduleBuilder.js +2 -0
  21. package/dist/cjs/components/schedule-builder/ScheduleBuilder.js.map +1 -0
  22. package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js +138 -0
  23. package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js.map +1 -0
  24. package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js +2 -0
  25. package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js.map +1 -0
  26. package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js +2 -0
  27. package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js.map +1 -0
  28. package/dist/cjs/components/schedule-builder/ScheduleHelper.js +2 -0
  29. package/dist/cjs/components/schedule-builder/ScheduleHelper.js.map +1 -0
  30. package/dist/cjs/components/schedule-builder/SendModeSelector.js +2 -0
  31. package/dist/cjs/components/schedule-builder/SendModeSelector.js.map +1 -0
  32. package/dist/cjs/components/schedule-builder/StartDateTimePicker.js +2 -0
  33. package/dist/cjs/components/schedule-builder/StartDateTimePicker.js.map +1 -0
  34. package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js +2 -0
  35. package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js.map +1 -0
  36. package/dist/cjs/components/schedule-builder/model.js +2 -0
  37. package/dist/cjs/components/schedule-builder/model.js.map +1 -0
  38. package/dist/cjs/index.js +1 -1
  39. package/dist/esm/components/agent-builder/constants/tools.d.ts +0 -1
  40. package/dist/esm/components/agent-builder/constants/tools.js +18 -18
  41. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  42. package/dist/esm/components/button/themes.js +2 -1
  43. package/dist/esm/components/button/themes.js.map +1 -1
  44. package/dist/esm/components/chip-selector/ChipSelector.d.ts +9 -0
  45. package/dist/esm/components/chip-selector/ChipSelector.js +27 -0
  46. package/dist/esm/components/chip-selector/ChipSelector.js.map +1 -0
  47. package/dist/esm/components/chip-selector/ChipSelector.styled.d.ts +10 -0
  48. package/dist/esm/components/chip-selector/ChipSelector.styled.js +48 -0
  49. package/dist/esm/components/chip-selector/ChipSelector.styled.js.map +1 -0
  50. package/dist/esm/components/chip-selector/ChipSelectorGroup.d.ts +10 -0
  51. package/dist/esm/components/chip-selector/ChipSelectorGroup.js +48 -0
  52. package/dist/esm/components/chip-selector/ChipSelectorGroup.js.map +1 -0
  53. package/dist/esm/components/chip-selector/index.d.ts +4 -0
  54. package/dist/esm/components/chip-selector/model.d.ts +106 -0
  55. package/dist/esm/components/combo-box/ComboBox.d.ts +15 -0
  56. package/dist/esm/components/combo-box/ComboBox.js +118 -0
  57. package/dist/esm/components/combo-box/ComboBox.js.map +1 -0
  58. package/dist/esm/components/combo-box/ComboBox.styled.d.ts +12 -0
  59. package/dist/esm/components/combo-box/ComboBox.styled.js +40 -0
  60. package/dist/esm/components/combo-box/ComboBox.styled.js.map +1 -0
  61. package/dist/esm/components/combo-box/index.d.ts +3 -0
  62. package/dist/esm/components/combo-box/model.d.ts +55 -0
  63. package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +7 -0
  64. package/dist/esm/components/datePicker/DatePickerWrapper.js +66 -64
  65. package/dist/esm/components/datePicker/DatePickerWrapper.js.map +1 -1
  66. package/dist/esm/components/datePicker/index.d.ts +1 -0
  67. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.d.ts +22 -0
  68. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js +31 -0
  69. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js.map +1 -0
  70. package/dist/esm/components/schedule-builder/ScheduleBuilder.d.ts +88 -0
  71. package/dist/esm/components/schedule-builder/ScheduleBuilder.js +105 -0
  72. package/dist/esm/components/schedule-builder/ScheduleBuilder.js.map +1 -0
  73. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.d.ts +81 -0
  74. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js +168 -0
  75. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js.map +1 -0
  76. package/dist/esm/components/schedule-builder/ScheduleEndPicker.d.ts +17 -0
  77. package/dist/esm/components/schedule-builder/ScheduleEndPicker.js +105 -0
  78. package/dist/esm/components/schedule-builder/ScheduleEndPicker.js.map +1 -0
  79. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.d.ts +21 -0
  80. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js +136 -0
  81. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js.map +1 -0
  82. package/dist/esm/components/schedule-builder/ScheduleHelper.d.ts +110 -0
  83. package/dist/esm/components/schedule-builder/ScheduleHelper.js +196 -0
  84. package/dist/esm/components/schedule-builder/ScheduleHelper.js.map +1 -0
  85. package/dist/esm/components/schedule-builder/SendModeSelector.d.ts +29 -0
  86. package/dist/esm/components/schedule-builder/SendModeSelector.js +41 -0
  87. package/dist/esm/components/schedule-builder/SendModeSelector.js.map +1 -0
  88. package/dist/esm/components/schedule-builder/StartDateTimePicker.d.ts +51 -0
  89. package/dist/esm/components/schedule-builder/StartDateTimePicker.js +120 -0
  90. package/dist/esm/components/schedule-builder/StartDateTimePicker.js.map +1 -0
  91. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.d.ts +19 -0
  92. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js +44 -0
  93. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js.map +1 -0
  94. package/dist/esm/components/schedule-builder/index.d.ts +18 -0
  95. package/dist/esm/components/schedule-builder/model.d.ts +69 -0
  96. package/dist/esm/components/schedule-builder/model.js +8 -0
  97. package/dist/esm/components/schedule-builder/model.js.map +1 -0
  98. package/dist/esm/index.d.ts +3 -1
  99. package/dist/esm/index.js +828 -844
  100. package/dist/esm/index.js.map +1 -1
  101. package/package.json +1 -1
  102. package/dist/cjs/components/bik-copilot/BIKCopilot.js +0 -2
  103. package/dist/cjs/components/bik-copilot/BIKCopilot.js.map +0 -1
  104. package/dist/cjs/components/bik-copilot/ControlledCopilot.js +0 -2
  105. package/dist/cjs/components/bik-copilot/ControlledCopilot.js.map +0 -1
  106. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js +0 -27
  107. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js.map +0 -1
  108. package/dist/cjs/components/bik-copilot/CopilotBall.js +0 -2
  109. package/dist/cjs/components/bik-copilot/CopilotBall.js.map +0 -1
  110. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js +0 -42
  111. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js.map +0 -1
  112. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.js +0 -2
  113. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.js.map +0 -1
  114. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.styled.js +0 -108
  115. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.styled.js.map +0 -1
  116. package/dist/cjs/components/bik-copilot/CopilotPanel.js +0 -2
  117. package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +0 -1
  118. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js +0 -534
  119. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js.map +0 -1
  120. package/dist/cjs/components/bik-copilot/copilotPlacement.js +0 -2
  121. package/dist/cjs/components/bik-copilot/copilotPlacement.js.map +0 -1
  122. package/dist/cjs/components/bik-copilot/copilotRegenerate.js +0 -2
  123. package/dist/cjs/components/bik-copilot/copilotRegenerate.js.map +0 -1
  124. package/dist/cjs/components/bik-copilot/services/copilotDb.js +0 -2
  125. package/dist/cjs/components/bik-copilot/services/copilotDb.js.map +0 -1
  126. package/dist/cjs/components/bik-copilot/services/copilotFeedbackClient.js +0 -2
  127. package/dist/cjs/components/bik-copilot/services/copilotFeedbackClient.js.map +0 -1
  128. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js +0 -2
  129. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js.map +0 -1
  130. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js +0 -2
  131. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js.map +0 -1
  132. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js +0 -2
  133. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js.map +0 -1
  134. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js +0 -7
  135. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js.map +0 -1
  136. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js +0 -2
  137. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js.map +0 -1
  138. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js +0 -2
  139. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js.map +0 -1
  140. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +0 -2
  141. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js.map +0 -1
  142. package/dist/cjs/components/bik-copilot/useDraggableFloater.js +0 -2
  143. package/dist/cjs/components/bik-copilot/useDraggableFloater.js.map +0 -1
  144. package/dist/cjs/components/bik-copilot/utils/markdown.js +0 -4
  145. package/dist/cjs/components/bik-copilot/utils/markdown.js.map +0 -1
  146. package/dist/cjs/components/bik-copilot/utils/toolCtas.js +0 -2
  147. package/dist/cjs/components/bik-copilot/utils/toolCtas.js.map +0 -1
  148. package/dist/esm/components/bik-copilot/BIKCopilot.d.ts +0 -31
  149. package/dist/esm/components/bik-copilot/BIKCopilot.js +0 -118
  150. package/dist/esm/components/bik-copilot/BIKCopilot.js.map +0 -1
  151. package/dist/esm/components/bik-copilot/ControlledCopilot.d.ts +0 -14
  152. package/dist/esm/components/bik-copilot/ControlledCopilot.js +0 -174
  153. package/dist/esm/components/bik-copilot/ControlledCopilot.js.map +0 -1
  154. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.d.ts +0 -7
  155. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js +0 -31
  156. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js.map +0 -1
  157. package/dist/esm/components/bik-copilot/CopilotBall.d.ts +0 -13
  158. package/dist/esm/components/bik-copilot/CopilotBall.js +0 -50
  159. package/dist/esm/components/bik-copilot/CopilotBall.js.map +0 -1
  160. package/dist/esm/components/bik-copilot/CopilotBall.styled.d.ts +0 -9
  161. package/dist/esm/components/bik-copilot/CopilotBall.styled.js +0 -46
  162. package/dist/esm/components/bik-copilot/CopilotBall.styled.js.map +0 -1
  163. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.d.ts +0 -29
  164. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.js +0 -73
  165. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.js.map +0 -1
  166. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.d.ts +0 -12
  167. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.js +0 -122
  168. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.js.map +0 -1
  169. package/dist/esm/components/bik-copilot/CopilotPanel.d.ts +0 -9
  170. package/dist/esm/components/bik-copilot/CopilotPanel.js +0 -536
  171. package/dist/esm/components/bik-copilot/CopilotPanel.js.map +0 -1
  172. package/dist/esm/components/bik-copilot/CopilotPanel.styled.d.ts +0 -67
  173. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js +0 -573
  174. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js.map +0 -1
  175. package/dist/esm/components/bik-copilot/copilotPlacement.d.ts +0 -24
  176. package/dist/esm/components/bik-copilot/copilotPlacement.js +0 -38
  177. package/dist/esm/components/bik-copilot/copilotPlacement.js.map +0 -1
  178. package/dist/esm/components/bik-copilot/copilotRegenerate.d.ts +0 -22
  179. package/dist/esm/components/bik-copilot/copilotRegenerate.js +0 -6
  180. package/dist/esm/components/bik-copilot/copilotRegenerate.js.map +0 -1
  181. package/dist/esm/components/bik-copilot/index.d.ts +0 -19
  182. package/dist/esm/components/bik-copilot/model.d.ts +0 -804
  183. package/dist/esm/components/bik-copilot/services/copilotDb.d.ts +0 -90
  184. package/dist/esm/components/bik-copilot/services/copilotDb.js +0 -96
  185. package/dist/esm/components/bik-copilot/services/copilotDb.js.map +0 -1
  186. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.d.ts +0 -15
  187. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.js +0 -55
  188. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.js.map +0 -1
  189. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.d.ts +0 -11
  190. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js +0 -54
  191. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js.map +0 -1
  192. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.d.ts +0 -23
  193. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js +0 -78
  194. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js.map +0 -1
  195. package/dist/esm/components/bik-copilot/services/copilotPageSession.d.ts +0 -37
  196. package/dist/esm/components/bik-copilot/services/copilotPageSession.js +0 -35
  197. package/dist/esm/components/bik-copilot/services/copilotPageSession.js.map +0 -1
  198. package/dist/esm/components/bik-copilot/services/copilotSseParser.d.ts +0 -22
  199. package/dist/esm/components/bik-copilot/services/copilotSseParser.js +0 -52
  200. package/dist/esm/components/bik-copilot/services/copilotSseParser.js.map +0 -1
  201. package/dist/esm/components/bik-copilot/services/copilotStreamClient.d.ts +0 -35
  202. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js +0 -110
  203. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js.map +0 -1
  204. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.d.ts +0 -17
  205. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js +0 -60
  206. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js.map +0 -1
  207. package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +0 -20
  208. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +0 -377
  209. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js.map +0 -1
  210. package/dist/esm/components/bik-copilot/useDraggableFloater.d.ts +0 -9
  211. package/dist/esm/components/bik-copilot/useDraggableFloater.js +0 -118
  212. package/dist/esm/components/bik-copilot/useDraggableFloater.js.map +0 -1
  213. package/dist/esm/components/bik-copilot/utils/markdown.d.ts +0 -1
  214. package/dist/esm/components/bik-copilot/utils/markdown.js +0 -48
  215. package/dist/esm/components/bik-copilot/utils/markdown.js.map +0 -1
  216. package/dist/esm/components/bik-copilot/utils/toolCtas.d.ts +0 -6
  217. package/dist/esm/components/bik-copilot/utils/toolCtas.js +0 -27
  218. package/dist/esm/components/bik-copilot/utils/toolCtas.js.map +0 -1
@@ -1,536 +0,0 @@
1
- import { jsxs as o, jsx as t, Fragment as je } from "react/jsx-runtime";
2
- import Ne from "../../assets/icons/arrow_down.svg.js";
3
- import g from "../../assets/icons/bik_ai_stars_icon.svg.js";
4
- import $e from "../../assets/icons/cross.svg.js";
5
- import Oe from "../../assets/icons/refresh.svg.js";
6
- import Ue, { useState as h, useRef as u, useEffect as j } from "react";
7
- import { COLORS as k } from "../../constants/Theme.js";
8
- import { TitleSmall as Ve, BodyCaption as le, BodySecondary as De } from "../TypographyStyle.js";
9
- import { CopilotFeedbackModal as Ke } from "./CopilotFeedbackModal.js";
10
- import { PanelContainer as Xe, PanelHeader as Ge, HeaderAvatar as ze, HeaderText as Je, HeaderTitleRow as Ze, HeaderBadge as qe, HeaderActions as Qe, IconAction as ce, MessagesViewport as Ye, MessagesArea as et, EmptyState as tt, EmptyStateIcon as rt, SuggestionList as ot, SuggestionChip as nt, HistoryLoader as it, MessageBubble as lt, ToolCtaList as ct, ToolCtaLink as dt, MessageTimestamp as at, InterruptedNote as st, MessageActions as ht, MessageAction as T, FollowUpList as ut, FollowUpsLabel as pt, FollowUpChip as ft, ThinkingBubble as kt, ThinkingLabel as wt, ScrollFade as Ct, JumpToLatestButton as mt, ErrorBanner as yt, InputArea as bt, InputWrapper as vt, MessageInput as gt, SendButton as Tt, Disclaimer as St } from "./CopilotPanel.styled.js";
11
- import { isCopilotRegeneratePrompt as Mt } from "./copilotRegenerate.js";
12
- import { renderCopilotMarkdown as It } from "./utils/markdown.js";
13
- import { toolResultCtas as xt } from "./utils/toolCtas.js";
14
- import { DotPulse as de } from "../dot-pulse/DotPulse.js";
15
- const At = 96, Lt = 24, Bt = 1800, Ht = async (n) => {
16
- try {
17
- if (navigator.clipboard?.writeText)
18
- return await navigator.clipboard.writeText(n), !0;
19
- } catch {
20
- }
21
- try {
22
- const i = document.createElement("textarea");
23
- i.value = n, i.setAttribute("readonly", ""), i.style.position = "fixed", i.style.top = "-1000px", i.style.opacity = "0", document.body.appendChild(i), i.select();
24
- const S = document.execCommand("copy");
25
- return document.body.removeChild(i), S;
26
- } catch {
27
- return !1;
28
- }
29
- }, Rt = 48, Ft = (n) => {
30
- if (!n || !Number.isFinite(n))
31
- return "";
32
- const i = new Date(n);
33
- return Number.isNaN(i.getTime()) ? "" : i.toLocaleTimeString("en-US", {
34
- hour: "numeric",
35
- minute: "2-digit"
36
- });
37
- }, Et = () => /* @__PURE__ */ o(
38
- "svg",
39
- {
40
- viewBox: "0 0 24 24",
41
- width: "16",
42
- height: "16",
43
- fill: "none",
44
- stroke: "currentColor",
45
- strokeWidth: "2",
46
- strokeLinecap: "round",
47
- strokeLinejoin: "round",
48
- "aria-hidden": "true",
49
- children: [
50
- /* @__PURE__ */ t("path", { d: "M12 19V5" }),
51
- /* @__PURE__ */ t("path", { d: "M6 11l6-6 6 6" })
52
- ]
53
- }
54
- ), _t = () => /* @__PURE__ */ o(
55
- "svg",
56
- {
57
- viewBox: "0 0 24 24",
58
- width: "14",
59
- height: "14",
60
- fill: "none",
61
- stroke: "currentColor",
62
- strokeWidth: "2",
63
- strokeLinecap: "round",
64
- strokeLinejoin: "round",
65
- "aria-hidden": "true",
66
- children: [
67
- /* @__PURE__ */ t("path", { d: "M5 12h14" }),
68
- /* @__PURE__ */ t("path", { d: "M13 6l6 6-6 6" })
69
- ]
70
- }
71
- ), ae = ({ size: n = 16 }) => /* @__PURE__ */ t(
72
- "svg",
73
- {
74
- viewBox: "0 0 24 24",
75
- width: n,
76
- height: n,
77
- fill: "currentColor",
78
- "aria-hidden": "true",
79
- children: /* @__PURE__ */ t("rect", { x: "7", y: "7", width: "10", height: "10", rx: "2" })
80
- }
81
- ), Pt = () => /* @__PURE__ */ o(
82
- "svg",
83
- {
84
- viewBox: "0 0 24 24",
85
- width: "14",
86
- height: "14",
87
- fill: "none",
88
- stroke: "currentColor",
89
- strokeWidth: "1.8",
90
- strokeLinecap: "round",
91
- strokeLinejoin: "round",
92
- "aria-hidden": "true",
93
- children: [
94
- /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
95
- /* @__PURE__ */ t("path", { d: "M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15" })
96
- ]
97
- }
98
- ), Wt = () => /* @__PURE__ */ t(
99
- "svg",
100
- {
101
- viewBox: "0 0 24 24",
102
- width: "14",
103
- height: "14",
104
- fill: "none",
105
- stroke: "currentColor",
106
- strokeWidth: "2.2",
107
- strokeLinecap: "round",
108
- strokeLinejoin: "round",
109
- "aria-hidden": "true",
110
- children: /* @__PURE__ */ t("path", { d: "M5 13l4 4L19 7" })
111
- }
112
- ), jt = () => /* @__PURE__ */ o(
113
- "svg",
114
- {
115
- viewBox: "0 0 24 24",
116
- width: "14",
117
- height: "14",
118
- fill: "none",
119
- stroke: "currentColor",
120
- strokeWidth: "1.8",
121
- strokeLinecap: "round",
122
- strokeLinejoin: "round",
123
- "aria-hidden": "true",
124
- children: [
125
- /* @__PURE__ */ t("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
126
- /* @__PURE__ */ t("path", { d: "M20 4v4h-4" })
127
- ]
128
- }
129
- ), Nt = ({ filled: n = !1 }) => /* @__PURE__ */ o(
130
- "svg",
131
- {
132
- viewBox: "0 0 24 24",
133
- width: "14",
134
- height: "14",
135
- fill: n ? "currentColor" : "none",
136
- stroke: "currentColor",
137
- strokeWidth: "1.8",
138
- strokeLinecap: "round",
139
- strokeLinejoin: "round",
140
- "aria-hidden": "true",
141
- children: [
142
- /* @__PURE__ */ t("path", { d: "M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3Z" }),
143
- /* @__PURE__ */ t("path", { d: "M7 10l4.5-7a2 2 0 0 1 3.7 1.3L14.5 9H19a2 2 0 0 1 2 2.3l-1.1 7A2 2 0 0 1 18 20H7" })
144
- ]
145
- }
146
- ), $t = ({ filled: n = !1 }) => /* @__PURE__ */ o(
147
- "svg",
148
- {
149
- viewBox: "0 0 24 24",
150
- width: "14",
151
- height: "14",
152
- fill: n ? "currentColor" : "none",
153
- stroke: "currentColor",
154
- strokeWidth: "1.8",
155
- strokeLinecap: "round",
156
- strokeLinejoin: "round",
157
- "aria-hidden": "true",
158
- children: [
159
- /* @__PURE__ */ t("path", { d: "M7 14V3H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3Z" }),
160
- /* @__PURE__ */ t("path", { d: "M7 14l4.5 7a2 2 0 0 0 3.7-1.3L14.5 15H19a2 2 0 0 0 2-2.3l-1.1-7A2 2 0 0 0 18 4H7" })
161
- ]
162
- }
163
- ), tr = ({
164
- messages: n,
165
- onSend: i,
166
- onClose: S,
167
- title: w = "Copilot",
168
- badge: N,
169
- subtitle: $,
170
- avatar: se,
171
- placeholder: he = "Write your message...",
172
- disclaimer: O = "AI can make mistakes, Verify the responses.",
173
- emptyStateTitle: ue,
174
- emptyStateSubtitle: U = "Here are some things you can try",
175
- suggestions: M,
176
- onSuggestionClick: pe,
177
- showRefresh: fe = !0,
178
- onRefresh: V,
179
- onRegenerate: D,
180
- onFeedback: I,
181
- dislikeTitle: ke,
182
- dislikeSubtitle: we,
183
- dislikeReasons: Ce,
184
- dislikeNotePlaceholder: me,
185
- dislikeSubmitLabel: ye,
186
- isThinking: C = !1,
187
- thinkingLabel: K = "Thinking",
188
- isStreaming: be = !1,
189
- onStop: X,
190
- interruptedLabel: G = "This message was interrupted",
191
- followUpsLabel: z = "Follow ups",
192
- onToolCtaClick: ve,
193
- hasMoreHistory: ge = !1,
194
- isLoadingHistory: m = !1,
195
- onLoadOlderMessages: J,
196
- historyLoadingLabel: Te = "Loading earlier messages",
197
- inputDisabled: d = !1,
198
- errorMessage: Z,
199
- width: Se,
200
- height: Me,
201
- className: Ie,
202
- style: xe
203
- }) => {
204
- const [x, q] = h(""), [Ae, Q] = h(!1), [A, L] = h(!0), [y, Y] = h(null), [s, Le] = h({}), [b, B] = h(null), ee = u(null), p = u(null), H = u(null), R = u(null), F = u(0), E = u(null), v = n.filter(
205
- (e) => (e.content.length > 0 || e.wasInterrupted) && !Mt(e.content)
206
- ), te = v.length === 0 && !C, a = C || be, re = !d && !a && x.trim().length > 0, f = a && !!X, _ = v[v.length - 1], P = !a && _?.role === "assistant" ? _.followUps : void 0, W = !te && !A;
207
- j(() => {
208
- A && H.current?.scrollIntoView({ behavior: "smooth" });
209
- }, [n, C, A]), j(() => {
210
- const e = R.current, r = E.current;
211
- !e || r === null || m || (E.current = null, e.scrollTop = e.scrollHeight - r, F.current = e.scrollTop);
212
- }, [n, m]);
213
- const Be = () => {
214
- const e = R.current;
215
- if (!e)
216
- return;
217
- const r = e.scrollHeight - e.scrollTop - e.clientHeight;
218
- e.scrollTop <= Rt && ge && !m && J && (E.current = e.scrollHeight - e.scrollTop, J());
219
- const c = e.scrollTop < F.current - 1;
220
- if (F.current = e.scrollTop, r <= Lt) {
221
- L(!0);
222
- return;
223
- }
224
- c && L(!1);
225
- }, He = () => {
226
- L(!0), H.current?.scrollIntoView({ behavior: "smooth" });
227
- };
228
- j(
229
- () => () => {
230
- p.current && window.clearTimeout(p.current);
231
- },
232
- []
233
- );
234
- const Re = async (e) => {
235
- await Ht(e.content) && (p.current && window.clearTimeout(p.current), Y(e.id), p.current = window.setTimeout(
236
- () => Y(null),
237
- Bt
238
- ));
239
- }, oe = (e, r) => {
240
- const c = s[e] === r;
241
- if (Le((l) => ({
242
- ...l,
243
- [e]: l[e] === r ? void 0 : r
244
- })), c) {
245
- r === "dislike" && B(
246
- (l) => l === e ? null : l
247
- );
248
- return;
249
- }
250
- if (r === "like") {
251
- I?.(e, "like");
252
- return;
253
- }
254
- b && b !== e && I?.(b, "dislike"), B(e);
255
- }, ne = (e, r) => {
256
- B((c) => c === e ? null : c), I?.(e, "dislike", r);
257
- }, Fe = () => {
258
- d || a || D?.();
259
- }, ie = () => {
260
- const e = x.trim();
261
- if (!e || d || a)
262
- return;
263
- i(e), q("");
264
- const r = ee.current;
265
- r && (r.style.height = "auto");
266
- }, Ee = (e) => {
267
- q(e.target.value);
268
- const r = e.target;
269
- r.style.height = "auto", r.style.height = `${Math.min(
270
- r.scrollHeight,
271
- At
272
- )}px`;
273
- }, _e = (e) => {
274
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ie());
275
- }, Pe = (e) => {
276
- d || a || (pe?.(e), i(e.text));
277
- }, We = (e) => {
278
- d || a || i(e);
279
- };
280
- return /* @__PURE__ */ o(
281
- Xe,
282
- {
283
- className: Ie,
284
- style: { width: Se, height: Me, ...xe },
285
- role: "dialog",
286
- "aria-label": w,
287
- children: [
288
- /* @__PURE__ */ o(Ge, { children: [
289
- /* @__PURE__ */ t(ze, { children: se ?? /* @__PURE__ */ t(g, { width: 18, height: 18 }) }),
290
- /* @__PURE__ */ o(Je, { children: [
291
- /* @__PURE__ */ o(Ze, { children: [
292
- /* @__PURE__ */ t(Ve, { children: w }),
293
- N && /* @__PURE__ */ t(qe, { children: N })
294
- ] }),
295
- $ && /* @__PURE__ */ t(le, { color: k.content.secondary, children: $ })
296
- ] }),
297
- /* @__PURE__ */ o(Qe, { children: [
298
- fe && V && /* @__PURE__ */ t(
299
- ce,
300
- {
301
- type: "button",
302
- onClick: V,
303
- "aria-label": "Start a new conversation",
304
- children: /* @__PURE__ */ t(Oe, { width: 16, height: 16 })
305
- }
306
- ),
307
- /* @__PURE__ */ t(
308
- ce,
309
- {
310
- type: "button",
311
- onClick: S,
312
- "aria-label": "Close copilot",
313
- children: /* @__PURE__ */ t($e, { width: 18, height: 18 })
314
- }
315
- )
316
- ] })
317
- ] }),
318
- /* @__PURE__ */ o(Ye, { children: [
319
- /* @__PURE__ */ t(
320
- et,
321
- {
322
- ref: R,
323
- onScroll: Be,
324
- role: "region",
325
- "aria-label": "Conversation",
326
- children: te ? /* @__PURE__ */ o(tt, { children: [
327
- /* @__PURE__ */ t(rt, { children: /* @__PURE__ */ t(g, { width: 28, height: 28 }) }),
328
- /* @__PURE__ */ t(De, { style: { fontWeight: 600 }, children: ue || w }),
329
- U && /* @__PURE__ */ t(le, { color: k.content.secondary, children: U }),
330
- M && M.length > 0 && /* @__PURE__ */ t(ot, { children: M.map((e) => /* @__PURE__ */ o(
331
- nt,
332
- {
333
- type: "button",
334
- disabled: d || a,
335
- onClick: () => Pe(e),
336
- children: [
337
- /* @__PURE__ */ t(g, { width: 14, height: 14 }),
338
- e.text
339
- ]
340
- },
341
- e.id
342
- )) })
343
- ] }) : /* @__PURE__ */ o(je, { children: [
344
- m && /* @__PURE__ */ o(it, { role: "status", "aria-live": "polite", children: [
345
- /* @__PURE__ */ t(de, { color: k.content.placeholder, size: 4 }),
346
- Te
347
- ] }),
348
- v.map((e) => {
349
- const r = e.role === "user" ? Ft(e.timestamp) : "";
350
- return /* @__PURE__ */ o(Ue.Fragment, { children: [
351
- e.content.length > 0 && /* @__PURE__ */ t(lt, { $role: e.role, children: e.role === "assistant" ? /* @__PURE__ */ t(
352
- "div",
353
- {
354
- dangerouslySetInnerHTML: {
355
- __html: It(e.content)
356
- }
357
- }
358
- ) : /* @__PURE__ */ t("div", { style: { whiteSpace: "pre-wrap" }, children: e.content }) }),
359
- e.role === "assistant" && !e.isStreaming && (() => {
360
- const c = xt(e.toolResults);
361
- return c.length === 0 ? null : /* @__PURE__ */ t(ct, { children: c.map((l) => /* @__PURE__ */ t(
362
- dt,
363
- {
364
- href: l.url,
365
- target: "_blank",
366
- rel: "noopener noreferrer",
367
- onClick: () => ve?.({
368
- tool: l.tool,
369
- url: l.url
370
- }),
371
- children: l.label
372
- },
373
- `${l.tool}-${l.url}`
374
- )) });
375
- })(),
376
- r && /* @__PURE__ */ t(at, { children: r }),
377
- e.wasInterrupted && G && /* @__PURE__ */ o(st, { children: [
378
- /* @__PURE__ */ t(ae, { size: 12 }),
379
- G
380
- ] }),
381
- e.role === "assistant" && e.content.length > 0 && !e.isStreaming && /* @__PURE__ */ o(ht, { children: [
382
- /* @__PURE__ */ t(
383
- T,
384
- {
385
- type: "button",
386
- onClick: () => {
387
- Re(e);
388
- },
389
- "data-copied": y === e.id,
390
- title: y === e.id ? "Copied" : "Copy",
391
- "aria-label": y === e.id ? "Response copied to clipboard" : "Copy response",
392
- children: y === e.id ? /* @__PURE__ */ t(Wt, {}) : /* @__PURE__ */ t(Pt, {})
393
- }
394
- ),
395
- D && e.id === _?.id && /* @__PURE__ */ t(
396
- T,
397
- {
398
- type: "button",
399
- onClick: Fe,
400
- disabled: d || a,
401
- title: "Regenerate",
402
- "aria-label": "Regenerate response",
403
- children: /* @__PURE__ */ t(jt, {})
404
- }
405
- ),
406
- /* @__PURE__ */ t(
407
- T,
408
- {
409
- type: "button",
410
- onClick: () => oe(e.id, "like"),
411
- "data-selected": s[e.id] === "like",
412
- "aria-pressed": s[e.id] === "like",
413
- title: "Good response",
414
- "aria-label": "Good response",
415
- children: /* @__PURE__ */ t(
416
- Nt,
417
- {
418
- filled: s[e.id] === "like"
419
- }
420
- )
421
- }
422
- ),
423
- /* @__PURE__ */ t(
424
- T,
425
- {
426
- type: "button",
427
- onClick: () => oe(e.id, "dislike"),
428
- "data-selected": s[e.id] === "dislike",
429
- "aria-pressed": s[e.id] === "dislike",
430
- title: "Bad response",
431
- "aria-label": "Bad response",
432
- children: /* @__PURE__ */ t(
433
- $t,
434
- {
435
- filled: s[e.id] === "dislike"
436
- }
437
- )
438
- }
439
- )
440
- ] }),
441
- b === e.id && /* @__PURE__ */ t(
442
- Ke,
443
- {
444
- title: ke,
445
- subtitle: we ?? `Help us improve ${w}`,
446
- reasons: Ce,
447
- notePlaceholder: me,
448
- submitLabel: ye,
449
- onSubmit: (c) => ne(e.id, c),
450
- onDismiss: () => ne(e.id)
451
- }
452
- )
453
- ] }, e.id);
454
- }),
455
- P && P.length > 0 && /* @__PURE__ */ o(ut, { children: [
456
- z && /* @__PURE__ */ t(pt, { children: z }),
457
- P.map((e) => /* @__PURE__ */ o(
458
- ft,
459
- {
460
- type: "button",
461
- disabled: d,
462
- onClick: () => We(e),
463
- children: [
464
- /* @__PURE__ */ t(_t, {}),
465
- e
466
- ]
467
- },
468
- e
469
- ))
470
- ] }),
471
- C && /* @__PURE__ */ o(kt, { role: "status", "aria-live": "polite", children: [
472
- /* @__PURE__ */ t(
473
- g,
474
- {
475
- width: 14,
476
- height: 14,
477
- color: k.content.brand
478
- }
479
- ),
480
- K && /* @__PURE__ */ t(wt, { children: K }),
481
- /* @__PURE__ */ t(de, { color: k.background.brand, size: 5 })
482
- ] }),
483
- /* @__PURE__ */ t("div", { ref: H })
484
- ] })
485
- }
486
- ),
487
- /* @__PURE__ */ t(Ct, { $visible: W, "aria-hidden": "true" }),
488
- /* @__PURE__ */ t(
489
- mt,
490
- {
491
- type: "button",
492
- $visible: W,
493
- onClick: He,
494
- tabIndex: W ? 0 : -1,
495
- "aria-label": "Scroll to the latest message",
496
- children: /* @__PURE__ */ t(Ne, { width: 16, height: 16 })
497
- }
498
- )
499
- ] }),
500
- Z && /* @__PURE__ */ t(yt, { role: "alert", children: Z }),
501
- /* @__PURE__ */ t(bt, { children: /* @__PURE__ */ o(vt, { $focused: Ae, children: [
502
- /* @__PURE__ */ t(
503
- gt,
504
- {
505
- ref: ee,
506
- rows: 1,
507
- value: x,
508
- placeholder: he,
509
- disabled: d,
510
- onChange: Ee,
511
- onKeyDown: _e,
512
- onFocus: () => Q(!0),
513
- onBlur: () => Q(!1)
514
- }
515
- ),
516
- /* @__PURE__ */ t(
517
- Tt,
518
- {
519
- type: "button",
520
- $active: f || re,
521
- disabled: !f && !re,
522
- onClick: f ? X : ie,
523
- "aria-label": f ? "Stop generating" : "Send message",
524
- children: f ? /* @__PURE__ */ t(ae, {}) : /* @__PURE__ */ t(Et, {})
525
- }
526
- )
527
- ] }) }),
528
- O && /* @__PURE__ */ t(St, { children: O })
529
- ]
530
- }
531
- );
532
- };
533
- export {
534
- tr as CopilotPanel
535
- };
536
- //# sourceMappingURL=CopilotPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopilotPanel.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.tsx"],"sourcesContent":["import ArrowDownIcon from '@src/assets/icons/arrow_down.svg';\nimport AiStarsIcon from '@src/assets/icons/bik_ai_stars_icon.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport RefreshIcon from '@src/assets/icons/refresh.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { DotPulse } from '../dot-pulse';\nimport { BodyCaption, BodySecondary, TitleSmall } from '../TypographyStyle';\nimport { CopilotFeedbackModal } from './CopilotFeedbackModal';\nimport {\n\tDisclaimer,\n\tEmptyState,\n\tEmptyStateIcon,\n\tErrorBanner,\n\tFollowUpChip,\n\tFollowUpList,\n\tFollowUpsLabel,\n\tHeaderActions,\n\tHeaderAvatar,\n\tHeaderBadge,\n\tHeaderText,\n\tHeaderTitleRow,\n\tHistoryLoader,\n\tIconAction,\n\tInputArea,\n\tInputWrapper,\n\tInterruptedNote,\n\tJumpToLatestButton,\n\tMessageAction,\n\tMessageActions,\n\tMessageBubble,\n\tMessageInput,\n\tMessagesArea,\n\tMessagesViewport,\n\tMessageTimestamp,\n\tPanelContainer,\n\tPanelHeader,\n\tScrollFade,\n\tSendButton,\n\tSuggestionChip,\n\tSuggestionList,\n\tThinkingBubble,\n\tThinkingLabel,\n\tToolCtaLink,\n\tToolCtaList,\n} from './CopilotPanel.styled';\nimport { isCopilotRegeneratePrompt } from './copilotRegenerate';\nimport { CopilotFeedbackDetail, CopilotPanelProps } from './model';\nimport { renderCopilotMarkdown } from './utils/markdown';\nimport { toolResultCtas } from './utils/toolCtas';\n\nconst MAX_INPUT_HEIGHT_PX = 96;\n\n/** Slack at the bottom of the scroller that still counts as \"at the latest\". */\nconst AT_BOTTOM_TOLERANCE_PX = 24;\n\n/** How long the copy button shows its confirmation before reverting. */\nconst COPIED_FEEDBACK_MS = 1800;\n\n/**\n * Writes text to the clipboard.\n *\n * `navigator.clipboard` is missing outside a secure context and can reject when\n * the document is not focused, so a hidden-textarea `execCommand` fallback keeps\n * the button working there rather than failing silently.\n */\nconst writeToClipboard = async (text: string): Promise<boolean> => {\n\ttry {\n\t\tif (navigator.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\treturn true;\n\t\t}\n\t} catch {\n\t\t// Fall through to the legacy path.\n\t}\n\n\ttry {\n\t\tconst textarea = document.createElement('textarea');\n\t\ttextarea.value = text;\n\t\t// Off-screen rather than hidden: `display: none` cannot be selected.\n\t\ttextarea.setAttribute('readonly', '');\n\t\ttextarea.style.position = 'fixed';\n\t\ttextarea.style.top = '-1000px';\n\t\ttextarea.style.opacity = '0';\n\t\tdocument.body.appendChild(textarea);\n\t\ttextarea.select();\n\t\tconst copied = document.execCommand('copy');\n\t\tdocument.body.removeChild(textarea);\n\t\treturn copied;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** How close to the top counts as asking for the previous page. */\nconst NEAR_TOP_TOLERANCE_PX = 48;\n\nconst formatMessageTime = (timestamp: number): string => {\n\tif (!timestamp || !Number.isFinite(timestamp)) {\n\t\treturn '';\n\t}\n\tconst date = new Date(timestamp);\n\tif (Number.isNaN(date.getTime())) {\n\t\treturn '';\n\t}\n\treturn date.toLocaleTimeString('en-US', {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t});\n};\n\nconst SendArrowIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M12 19V5\" />\n\t\t<path d=\"M6 11l6-6 6 6\" />\n\t</svg>\n);\n\nconst ArrowRightIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 12h14\" />\n\t\t<path d=\"M13 6l6 6-6 6\" />\n\t</svg>\n);\n\nconst StopIcon = ({ size = 16 }: { size?: number }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth={size}\n\t\theight={size}\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n\t</svg>\n);\n\nconst CopyIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n\t\t<path d=\"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15\" />\n\t</svg>\n);\n\nconst CheckIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2.2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 13l4 4L19 7\" />\n\t</svg>\n);\n\nconst RegenerateIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M20 12a8 8 0 1 1-2.34-5.66\" />\n\t\t<path d=\"M20 4v4h-4\" />\n\t</svg>\n);\n\nconst ThumbUpIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3Z\" />\n\t\t<path d=\"M7 10l4.5-7a2 2 0 0 1 3.7 1.3L14.5 9H19a2 2 0 0 1 2 2.3l-1.1 7A2 2 0 0 1 18 20H7\" />\n\t</svg>\n);\n\nconst ThumbDownIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 14V3H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3Z\" />\n\t\t<path d=\"M7 14l4.5 7a2 2 0 0 0 3.7-1.3L14.5 15H19a2 2 0 0 0 2-2.3l-1.1-7A2 2 0 0 0 18 4H7\" />\n\t</svg>\n);\n\n/**\n * Chat panel used by the copilot. Fully presentational: it renders the\n * transcript it is given and reports user intent through callbacks, so it works\n * against any backend.\n */\nexport const CopilotPanel: React.FC<CopilotPanelProps> = ({\n\tmessages,\n\tonSend,\n\tonClose,\n\ttitle = 'Copilot',\n\tbadge,\n\tsubtitle,\n\tavatar,\n\tplaceholder = 'Write your message...',\n\tdisclaimer = 'AI can make mistakes, Verify the responses.',\n\temptyStateTitle,\n\temptyStateSubtitle = 'Here are some things you can try',\n\tsuggestions,\n\tonSuggestionClick,\n\tshowRefresh = true,\n\tonRefresh,\n\tonRegenerate,\n\tonFeedback,\n\tdislikeTitle,\n\tdislikeSubtitle,\n\tdislikeReasons,\n\tdislikeNotePlaceholder,\n\tdislikeSubmitLabel,\n\tisThinking = false,\n\tthinkingLabel = 'Thinking',\n\tisStreaming = false,\n\tonStop,\n\tinterruptedLabel = 'This message was interrupted',\n\tfollowUpsLabel = 'Follow ups',\n\tonToolCtaClick,\n\thasMoreHistory = false,\n\tisLoadingHistory = false,\n\tonLoadOlderMessages,\n\thistoryLoadingLabel = 'Loading earlier messages',\n\tinputDisabled = false,\n\terrorMessage,\n\twidth,\n\theight,\n\tclassName,\n\tstyle,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [isInputFocused, setIsInputFocused] = useState(false);\n\tconst [isAtLatest, setIsAtLatest] = useState(true);\n\t// Which reply is showing \"Copied\" — per message, so copying one does not tick\n\t// the button under another.\n\tconst [copiedMessageId, setCopiedMessageId] = useState<string | null>(null);\n\n\tconst [feedback, setFeedback] = useState<\n\t\tRecord<string, 'like' | 'dislike' | undefined>\n\t>({});\n\t// Which reply is being asked about. A thumbs-down opens the prompt and the\n\t// rating is reported once it is answered or dismissed -- so pressing the\n\t// thumb is never lost, and one thumb never becomes two ratings.\n\tconst [dislikePromptId, setDislikePromptId] = useState<string | null>(null);\n\tconst inputRef = useRef<HTMLTextAreaElement>(null);\n\tconst copiedTimeoutRef = useRef<number | null>(null);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst scrollerRef = useRef<HTMLDivElement>(null);\n\tconst lastScrollTopRef = useRef(0);\n\t// Distance from the bottom at the moment an older page was asked for. Older\n\t// messages land *above* the viewport, so without restoring against this the\n\t// content under the reader jumps down by the height of what arrived.\n\tconst anchorFromBottomRef = useRef<number | null>(null);\n\n\t// An assistant bubble is pushed the moment a turn starts, before any text has\n\t// arrived; the thinking indicator stands in for it until then, so rendering it\n\t// too would show an empty balloon next to the dots. A turn stopped before its\n\t// first token keeps its place, carrying only the interrupted note.\n\tconst visibleMessages = messages.filter(\n\t\t(message) =>\n\t\t\t(message.content.length > 0 || message.wasInterrupted) &&\n\t\t\t!isCopilotRegeneratePrompt(message.content),\n\t);\n\tconst isEmpty = visibleMessages.length === 0 && !isThinking;\n\tconst isTurnInFlight = isThinking || isStreaming;\n\tconst canSend = !inputDisabled && !isTurnInFlight && input.trim().length > 0;\n\t// Stopping is the only thing the button can do mid-answer, so it becomes the\n\t// stop button rather than sitting there disabled.\n\tconst canStop = isTurnInFlight && Boolean(onStop);\n\t// Only the newest reply's suggestions are on offer — older ones answer a\n\t// question the conversation has already moved past.\n\tconst newestMessage = visibleMessages[visibleMessages.length - 1];\n\tconst followUps =\n\t\t!isTurnInFlight && newestMessage?.role === 'assistant'\n\t\t\t? newestMessage.followUps\n\t\t\t: undefined;\n\t// A long answer that the reader has scrolled up from: the tail is clipped, so\n\t// the fade and the arrow say there is more below.\n\tconst showScrollAffordance = !isEmpty && !isAtLatest;\n\n\t// Following the conversation is the default, but a reader who has scrolled up\n\t// mid-answer must not be yanked back down by the next chunk.\n\tuseEffect(() => {\n\t\tif (!isAtLatest) {\n\t\t\treturn;\n\t\t}\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, isThinking, isAtLatest]);\n\n\t// Older messages have landed: put the reader back on the message they were\n\t// looking at, which is now that much further down.\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tconst anchor = anchorFromBottomRef.current;\n\t\tif (!scroller || anchor === null || isLoadingHistory) {\n\t\t\treturn;\n\t\t}\n\t\tanchorFromBottomRef.current = null;\n\t\tscroller.scrollTop = scroller.scrollHeight - anchor;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\t}, [messages, isLoadingHistory]);\n\n\tconst handleScroll = () => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst distanceFromBottom =\n\t\t\tscroller.scrollHeight - scroller.scrollTop - scroller.clientHeight;\n\n\t\t// Reaching the top asks for the page before this one. The threshold gives\n\t\t// the request a head start, so the page is usually there by the time the\n\t\t// reader arrives.\n\t\tif (\n\t\t\tscroller.scrollTop <= NEAR_TOP_TOLERANCE_PX &&\n\t\t\thasMoreHistory &&\n\t\t\t!isLoadingHistory &&\n\t\t\tonLoadOlderMessages\n\t\t) {\n\t\t\tanchorFromBottomRef.current = scroller.scrollHeight - scroller.scrollTop;\n\t\t\tonLoadOlderMessages();\n\t\t}\n\t\t// Scrolling *up* is the only thing that detaches from the latest message:\n\t\t// growing content also pushes the bottom away, and auto-scroll itself only\n\t\t// ever moves down, so distance alone would flap mid-stream.\n\t\tconst scrolledUp = scroller.scrollTop < lastScrollTopRef.current - 1;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\n\t\tif (distanceFromBottom <= AT_BOTTOM_TOLERANCE_PX) {\n\t\t\tsetIsAtLatest(true);\n\t\t\treturn;\n\t\t}\n\t\tif (scrolledUp) {\n\t\t\tsetIsAtLatest(false);\n\t\t}\n\t};\n\n\tconst handleJumpToLatest = () => {\n\t\tsetIsAtLatest(true);\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tif (copiedTimeoutRef.current) {\n\t\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst handleCopyMessage = async (\n\t\tmessage: CopilotPanelProps['messages'][number],\n\t) => {\n\t\t// The raw markdown, not the rendered HTML — that is what a reader wants to\n\t\t// paste into a doc or a ticket.\n\t\tconst copied = await writeToClipboard(message.content);\n\t\tif (!copied) {\n\t\t\treturn;\n\t\t}\n\t\tif (copiedTimeoutRef.current) {\n\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t}\n\t\tsetCopiedMessageId(message.id);\n\t\tcopiedTimeoutRef.current = window.setTimeout(\n\t\t\t() => setCopiedMessageId(null),\n\t\t\tCOPIED_FEEDBACK_MS,\n\t\t);\n\t};\n\n\tconst handleFeedback = (messageId: string, vote: 'like' | 'dislike') => {\n\t\t// Pressing the same thumb again clears the vote. Nothing is reported for\n\t\t// that: the backend records ratings, not their absence.\n\t\tconst cleared = feedback[messageId] === vote;\n\t\tsetFeedback((previous) => ({\n\t\t\t...previous,\n\t\t\t[messageId]: previous[messageId] === vote ? undefined : vote,\n\t\t}));\n\t\t// Everything below sits outside the updater on purpose: React may run an\n\t\t// updater twice, which would report the same vote twice.\n\t\tif (cleared) {\n\t\t\tif (vote === 'dislike') {\n\t\t\t\tsetDislikePromptId((current) =>\n\t\t\t\t\tcurrent === messageId ? null : current,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (vote === 'like') {\n\t\t\tonFeedback?.(messageId, 'like');\n\t\t\treturn;\n\t\t}\n\t\t// A thumbs-down asks what went wrong first. Moving the prompt to another\n\t\t// reply still records the one it is leaving.\n\t\tif (dislikePromptId && dislikePromptId !== messageId) {\n\t\t\tonFeedback?.(dislikePromptId, 'dislike');\n\t\t}\n\t\tsetDislikePromptId(messageId);\n\t};\n\n\tconst reportDislike = (messageId: string, detail?: CopilotFeedbackDetail) => {\n\t\tsetDislikePromptId((current) => (current === messageId ? null : current));\n\t\tonFeedback?.(messageId, 'dislike', detail);\n\t};\n\n\tconst handleRegenerate = () => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonRegenerate?.();\n\t};\n\n\tconst handleSend = () => {\n\t\tconst trimmed = input.trim();\n\t\tif (!trimmed || inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(trimmed);\n\t\tsetInput('');\n\t\tconst textarea = inputRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t}\n\t};\n\n\tconst handleInputChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tsetInput(event.target.value);\n\t\tconst textarea = event.target;\n\t\ttextarea.style.height = 'auto';\n\t\ttextarea.style.height = `${Math.min(\n\t\t\ttextarea.scrollHeight,\n\t\t\tMAX_INPUT_HEIGHT_PX,\n\t\t)}px`;\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\tif (event.key === 'Enter' && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSend();\n\t\t}\n\t};\n\n\tconst handleSuggestionClick = (\n\t\tsuggestion: NonNullable<CopilotPanelProps['suggestions']>[number],\n\t) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSuggestionClick?.(suggestion);\n\t\tonSend(suggestion.text);\n\t};\n\n\tconst handleFollowUpClick = (followUp: string) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(followUp);\n\t};\n\n\treturn (\n\t\t<PanelContainer\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, height, ...style }}\n\t\t\trole=\"dialog\"\n\t\t\taria-label={title}\n\t\t>\n\t\t\t<PanelHeader>\n\t\t\t\t<HeaderAvatar>\n\t\t\t\t\t{avatar ?? <AiStarsIcon width={18} height={18} />}\n\t\t\t\t</HeaderAvatar>\n\t\t\t\t<HeaderText>\n\t\t\t\t\t<HeaderTitleRow>\n\t\t\t\t\t\t<TitleSmall>{title}</TitleSmall>\n\t\t\t\t\t\t{badge && <HeaderBadge>{badge}</HeaderBadge>}\n\t\t\t\t\t</HeaderTitleRow>\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t</HeaderText>\n\t\t\t\t<HeaderActions>\n\t\t\t\t\t{showRefresh && onRefresh && (\n\t\t\t\t\t\t<IconAction\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={onRefresh}\n\t\t\t\t\t\t\taria-label=\"Start a new conversation\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RefreshIcon width={16} height={16} />\n\t\t\t\t\t\t</IconAction>\n\t\t\t\t\t)}\n\t\t\t\t\t<IconAction\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close copilot\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CrossIcon width={18} height={18} />\n\t\t\t\t\t</IconAction>\n\t\t\t\t</HeaderActions>\n\t\t\t</PanelHeader>\n\n\t\t\t<MessagesViewport>\n\t\t\t\t<MessagesArea\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tonScroll={handleScroll}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Conversation\"\n\t\t\t\t>\n\t\t\t\t\t{isEmpty ? (\n\t\t\t\t\t\t<EmptyState>\n\t\t\t\t\t\t\t<EmptyStateIcon>\n\t\t\t\t\t\t\t\t<AiStarsIcon width={28} height={28} />\n\t\t\t\t\t\t\t</EmptyStateIcon>\n\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 600 }}>\n\t\t\t\t\t\t\t\t{emptyStateTitle || title}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t{emptyStateSubtitle && (\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{emptyStateSubtitle}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{suggestions && suggestions.length > 0 && (\n\t\t\t\t\t\t\t\t<SuggestionList>\n\t\t\t\t\t\t\t\t\t{suggestions.map((suggestion) => (\n\t\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\t\tkey={suggestion.id}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleSuggestionClick(suggestion)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<AiStarsIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t{suggestion.text}\n\t\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</SuggestionList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</EmptyState>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{isLoadingHistory && (\n\t\t\t\t\t\t\t\t<HistoryLoader role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.content.placeholder} size={4} />\n\t\t\t\t\t\t\t\t\t{historyLoadingLabel}\n\t\t\t\t\t\t\t\t</HistoryLoader>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{visibleMessages.map((message) => {\n\t\t\t\t\t\t\t\tconst sentAt =\n\t\t\t\t\t\t\t\t\tmessage.role === 'user'\n\t\t\t\t\t\t\t\t\t\t? formatMessageTime(message.timestamp)\n\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<React.Fragment key={message.id}>\n\t\t\t\t\t\t\t\t\t\t{message.content.length > 0 && (\n\t\t\t\t\t\t\t\t\t\t\t<MessageBubble $role={message.role}>\n\t\t\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t__html: renderCopilotMarkdown(message.content),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ whiteSpace: 'pre-wrap' }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{message.content}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</MessageBubble>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Tool CTAs (e.g. the support-portal link) — only once the\n\t\t\t\t\t\t\t\t\t\t reply has finished, so a button cannot flash mid-stream. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming &&\n\t\t\t\t\t\t\t\t\t\t\t(() => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst ctas = toolResultCtas(message.toolResults);\n\t\t\t\t\t\t\t\t\t\t\t\tif (ctas.length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ctas.map((cta) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`${cta.tool}-${cta.url}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref={cta.url}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonToolCtaClick?.({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttool: cta.tool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: cta.url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{cta.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaLink>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t})()}\n\t\t\t\t\t\t\t\t\t\t{sentAt && <MessageTimestamp>{sentAt}</MessageTimestamp>}\n\t\t\t\t\t\t\t\t\t\t{message.wasInterrupted && interruptedLabel && (\n\t\t\t\t\t\t\t\t\t\t\t<InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t\t\t<StopIcon size={12} />\n\t\t\t\t\t\t\t\t\t\t\t\t{interruptedLabel}\n\t\t\t\t\t\t\t\t\t\t\t</InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Only under a finished reply: mid-stream the text is still\n\t\t\t\t\t\t\t\t\t\t changing, so copying it would capture a partial answer. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\tmessage.content.length > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming && (\n\t\t\t\t\t\t\t\t\t\t\t\t<MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => void handleCopyMessage(message)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-copied={copiedMessageId === message.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id ? 'Copied' : 'Copy'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'Response copied to clipboard'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'Copy response'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{copiedMessageId === message.id ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CopyIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/* Only under the newest reply: regenerating appends a\n\t\t\t\t\t\t\t\t\t\t\t\t\t fresh turn at the end, so offering it against an\n\t\t\t\t\t\t\t\t\t\t\t\t\t older answer would not replace that answer. */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{onRegenerate && message.id === newestMessage?.id && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={handleRegenerate}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Regenerate\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Regenerate response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<RegenerateIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFeedback(message.id, 'like')}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbUpIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleFeedback(message.id, 'dislike')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbDownIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t</MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{dislikePromptId === message.id && (\n\t\t\t\t\t\t\t\t\t\t\t<CopilotFeedbackModal\n\t\t\t\t\t\t\t\t\t\t\t\ttitle={dislikeTitle}\n\t\t\t\t\t\t\t\t\t\t\t\tsubtitle={dislikeSubtitle ?? `Help us improve ${title}`}\n\t\t\t\t\t\t\t\t\t\t\t\treasons={dislikeReasons}\n\t\t\t\t\t\t\t\t\t\t\t\tnotePlaceholder={dislikeNotePlaceholder}\n\t\t\t\t\t\t\t\t\t\t\t\tsubmitLabel={dislikeSubmitLabel}\n\t\t\t\t\t\t\t\t\t\t\t\tonSubmit={(detail) => reportDislike(message.id, detail)}\n\t\t\t\t\t\t\t\t\t\t\t\tonDismiss={() => reportDislike(message.id)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{followUps && followUps.length > 0 && (\n\t\t\t\t\t\t\t\t<FollowUpList>\n\t\t\t\t\t\t\t\t\t{followUpsLabel && (\n\t\t\t\t\t\t\t\t\t\t<FollowUpsLabel>{followUpsLabel}</FollowUpsLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{followUps.map((followUp) => (\n\t\t\t\t\t\t\t\t\t\t<FollowUpChip\n\t\t\t\t\t\t\t\t\t\t\tkey={followUp}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFollowUpClick(followUp)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowRightIcon />\n\t\t\t\t\t\t\t\t\t\t\t{followUp}\n\t\t\t\t\t\t\t\t\t\t</FollowUpChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</FollowUpList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{isThinking && (\n\t\t\t\t\t\t\t\t<ThinkingBubble role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<AiStarsIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.brand}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{thinkingLabel && (\n\t\t\t\t\t\t\t\t\t\t<ThinkingLabel>{thinkingLabel}</ThinkingLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.background.brand} size={5} />\n\t\t\t\t\t\t\t\t</ThinkingBubble>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MessagesArea>\n\n\t\t\t\t<ScrollFade $visible={showScrollAffordance} aria-hidden=\"true\" />\n\t\t\t\t<JumpToLatestButton\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t$visible={showScrollAffordance}\n\t\t\t\t\tonClick={handleJumpToLatest}\n\t\t\t\t\ttabIndex={showScrollAffordance ? 0 : -1}\n\t\t\t\t\taria-label=\"Scroll to the latest message\"\n\t\t\t\t>\n\t\t\t\t\t<ArrowDownIcon width={16} height={16} />\n\t\t\t\t</JumpToLatestButton>\n\t\t\t</MessagesViewport>\n\n\t\t\t{errorMessage && <ErrorBanner role=\"alert\">{errorMessage}</ErrorBanner>}\n\n\t\t\t<InputArea>\n\t\t\t\t<InputWrapper $focused={isInputFocused}>\n\t\t\t\t\t<MessageInput\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\trows={1}\n\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tonFocus={() => setIsInputFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsInputFocused(false)}\n\t\t\t\t\t/>\n\t\t\t\t\t<SendButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t$active={canStop || canSend}\n\t\t\t\t\t\tdisabled={!canStop && !canSend}\n\t\t\t\t\t\tonClick={canStop ? onStop : handleSend}\n\t\t\t\t\t\taria-label={canStop ? 'Stop generating' : 'Send message'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{canStop ? <StopIcon /> : <SendArrowIcon />}\n\t\t\t\t\t</SendButton>\n\t\t\t\t</InputWrapper>\n\t\t\t</InputArea>\n\n\t\t\t{disclaimer && <Disclaimer>{disclaimer}</Disclaimer>}\n\t\t</PanelContainer>\n\t);\n};\n\nexport default CopilotPanel;\n"],"names":["MAX_INPUT_HEIGHT_PX","AT_BOTTOM_TOLERANCE_PX","COPIED_FEEDBACK_MS","writeToClipboard","text","textarea","copied","NEAR_TOP_TOLERANCE_PX","formatMessageTime","timestamp","date","SendArrowIcon","jsxs","jsx","ArrowRightIcon","StopIcon","size","CopyIcon","CheckIcon","RegenerateIcon","ThumbUpIcon","filled","ThumbDownIcon","CopilotPanel","messages","onSend","onClose","title","badge","subtitle","avatar","placeholder","disclaimer","emptyStateTitle","emptyStateSubtitle","suggestions","onSuggestionClick","showRefresh","onRefresh","onRegenerate","onFeedback","dislikeTitle","dislikeSubtitle","dislikeReasons","dislikeNotePlaceholder","dislikeSubmitLabel","isThinking","thinkingLabel","isStreaming","onStop","interruptedLabel","followUpsLabel","onToolCtaClick","hasMoreHistory","isLoadingHistory","onLoadOlderMessages","historyLoadingLabel","inputDisabled","errorMessage","width","height","className","style","input","setInput","useState","isInputFocused","setIsInputFocused","isAtLatest","setIsAtLatest","copiedMessageId","setCopiedMessageId","feedback","setFeedback","dislikePromptId","setDislikePromptId","inputRef","useRef","copiedTimeoutRef","bottomRef","scrollerRef","lastScrollTopRef","anchorFromBottomRef","visibleMessages","message","isCopilotRegeneratePrompt","isEmpty","isTurnInFlight","canSend","canStop","newestMessage","followUps","showScrollAffordance","useEffect","scroller","anchor","handleScroll","distanceFromBottom","scrolledUp","handleJumpToLatest","handleCopyMessage","handleFeedback","messageId","vote","cleared","previous","current","reportDislike","detail","handleRegenerate","handleSend","trimmed","handleInputChange","event","handleKeyDown","handleSuggestionClick","suggestion","handleFollowUpClick","followUp","PanelContainer","PanelHeader","HeaderAvatar","AiStarsIcon","HeaderText","HeaderTitleRow","TitleSmall","HeaderBadge","BodyCaption","COLORS","HeaderActions","IconAction","RefreshIcon","CrossIcon","MessagesViewport","MessagesArea","EmptyState","EmptyStateIcon","BodySecondary","SuggestionList","SuggestionChip","Fragment","HistoryLoader","DotPulse","sentAt","React","MessageBubble","renderCopilotMarkdown","ctas","toolResultCtas","ToolCtaList","cta","ToolCtaLink","MessageTimestamp","InterruptedNote","MessageActions","MessageAction","CopilotFeedbackModal","FollowUpList","FollowUpsLabel","FollowUpChip","ThinkingBubble","ThinkingLabel","ScrollFade","JumpToLatestButton","ArrowDownIcon","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