@hualinge/relay-web 1.0.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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/dist/assets/AgentsPage-2u2kFBCH.js +68 -0
  4. package/dist/assets/AgentsPage-2u2kFBCH.js.map +1 -0
  5. package/dist/assets/AgentsPage-BGbbVmeL.css +1 -0
  6. package/dist/assets/Alert-D88Fk6to.js +2 -0
  7. package/dist/assets/Alert-D88Fk6to.js.map +1 -0
  8. package/dist/assets/AppModal-BYZTSuch.js +2 -0
  9. package/dist/assets/AppModal-BYZTSuch.js.map +1 -0
  10. package/dist/assets/CenteredLoadingState-DHor-9vF.js +2 -0
  11. package/dist/assets/CenteredLoadingState-DHor-9vF.js.map +1 -0
  12. package/dist/assets/ChannelsPage-CbI0kqkd.js +2 -0
  13. package/dist/assets/ChannelsPage-CbI0kqkd.js.map +1 -0
  14. package/dist/assets/EmptyDataState-6mNx2Xhl.js +2 -0
  15. package/dist/assets/EmptyDataState-6mNx2Xhl.js.map +1 -0
  16. package/dist/assets/HelpPrompt-BPzDcC8F.js +2 -0
  17. package/dist/assets/HelpPrompt-BPzDcC8F.js.map +1 -0
  18. package/dist/assets/HomePage-t78sDDUj.js +2 -0
  19. package/dist/assets/HomePage-t78sDDUj.js.map +1 -0
  20. package/dist/assets/InspirationPage-BTqLpcHY.js +3 -0
  21. package/dist/assets/InspirationPage-BTqLpcHY.js.map +1 -0
  22. package/dist/assets/ModelsPage-YF0gpUxy.js +2 -0
  23. package/dist/assets/ModelsPage-YF0gpUxy.js.map +1 -0
  24. package/dist/assets/NameInitialIcon-DP-6_HQY.js +7 -0
  25. package/dist/assets/NameInitialIcon-DP-6_HQY.js.map +1 -0
  26. package/dist/assets/NoSearchResultsState-BiiYdZ_Z.js +2 -0
  27. package/dist/assets/NoSearchResultsState-BiiYdZ_Z.js.map +1 -0
  28. package/dist/assets/OverflowTooltip-CE5PjAb-.js +2 -0
  29. package/dist/assets/OverflowTooltip-CE5PjAb-.js.map +1 -0
  30. package/dist/assets/PasswordField-DmzjtnCg.js +2 -0
  31. package/dist/assets/PasswordField-DmzjtnCg.js.map +1 -0
  32. package/dist/assets/RefreshButton-BzYzeo5A.js +2 -0
  33. package/dist/assets/RefreshButton-BzYzeo5A.js.map +1 -0
  34. package/dist/assets/RightContentHeader-DoNDQ9Lo.js +3 -0
  35. package/dist/assets/RightContentHeader-DoNDQ9Lo.js.map +1 -0
  36. package/dist/assets/SchedulePage-CfW6lZVI.js +2 -0
  37. package/dist/assets/SchedulePage-CfW6lZVI.js.map +1 -0
  38. package/dist/assets/SearchInput-tux8xXH1.js +2 -0
  39. package/dist/assets/SearchInput-tux8xXH1.js.map +1 -0
  40. package/dist/assets/SkillAvatar-DwGvsY4f.js +2 -0
  41. package/dist/assets/SkillAvatar-DwGvsY4f.js.map +1 -0
  42. package/dist/assets/SkillsPage-ppqwKMvj.js +2 -0
  43. package/dist/assets/SkillsPage-ppqwKMvj.js.map +1 -0
  44. package/dist/assets/SkillsTab-c_As1DIr.css +1 -0
  45. package/dist/assets/SkillsTab-kY7MNdxy.js +2 -0
  46. package/dist/assets/SkillsTab-kY7MNdxy.js.map +1 -0
  47. package/dist/assets/Tab-FE0F2EQP.js +2 -0
  48. package/dist/assets/Tab-FE0F2EQP.js.map +1 -0
  49. package/dist/assets/ThreadPage-B0jElW5R.js +53 -0
  50. package/dist/assets/ThreadPage-B0jElW5R.js.map +1 -0
  51. package/dist/assets/UploadSkillModal-DHZL12vm.js +8 -0
  52. package/dist/assets/UploadSkillModal-DHZL12vm.js.map +1 -0
  53. package/dist/assets/XlsxDocumentPreview-BY-ht09K.js +5 -0
  54. package/dist/assets/XlsxDocumentPreview-BY-ht09K.js.map +1 -0
  55. package/dist/assets/_commonjs-dynamic-modules-TDtrdbi3.js +2 -0
  56. package/dist/assets/_commonjs-dynamic-modules-TDtrdbi3.js.map +1 -0
  57. package/dist/assets/chat-input-options-CpkOtPgQ.js +2 -0
  58. package/dist/assets/chat-input-options-CpkOtPgQ.js.map +1 -0
  59. package/dist/assets/docx-preview-zfB-orwa.js +28 -0
  60. package/dist/assets/docx-preview-zfB-orwa.js.map +1 -0
  61. package/dist/assets/exceljs.min-BY7KKJsM.js +58 -0
  62. package/dist/assets/exceljs.min-BY7KKJsM.js.map +1 -0
  63. package/dist/assets/helpers-CCilgpNy.js +2 -0
  64. package/dist/assets/helpers-CCilgpNy.js.map +1 -0
  65. package/dist/assets/hub-agent-editor.client-2DmCRGuY.js +2 -0
  66. package/dist/assets/hub-agent-editor.client-2DmCRGuY.js.map +1 -0
  67. package/dist/assets/hub-agent-editor.payload-D4sgJRSH.js +4 -0
  68. package/dist/assets/hub-agent-editor.payload-D4sgJRSH.js.map +1 -0
  69. package/dist/assets/hub-tag-editor-BBdd-aHK.js +2 -0
  70. package/dist/assets/hub-tag-editor-BBdd-aHK.js.map +1 -0
  71. package/dist/assets/index-Bed0I5IL.css +1 -0
  72. package/dist/assets/index-Bxf2_cvh.js +2 -0
  73. package/dist/assets/index-Bxf2_cvh.js.map +1 -0
  74. package/dist/assets/index-Cb4fQgom.js +103 -0
  75. package/dist/assets/index-Cb4fQgom.js.map +1 -0
  76. package/dist/assets/index-DQ2vVjmV.js +30 -0
  77. package/dist/assets/index-DQ2vVjmV.js.map +1 -0
  78. package/dist/assets/index-UBJEdbMO.js +2 -0
  79. package/dist/assets/index-UBJEdbMO.js.map +1 -0
  80. package/dist/assets/jszip.min-DPdj3o0t.js +13 -0
  81. package/dist/assets/jszip.min-DPdj3o0t.js.map +1 -0
  82. package/dist/assets/quick-actions-DzZE-zyP.js +2 -0
  83. package/dist/assets/quick-actions-DzZE-zyP.js.map +1 -0
  84. package/dist/assets/skill-options-cache-D1BJGTCU.js +2 -0
  85. package/dist/assets/skill-options-cache-D1BJGTCU.js.map +1 -0
  86. package/dist/assets/status-helpers-BILdm2MI.js +2 -0
  87. package/dist/assets/status-helpers-BILdm2MI.js.map +1 -0
  88. package/dist/assets/thread-title-Cerb2mHa.js +2 -0
  89. package/dist/assets/thread-title-Cerb2mHa.js.map +1 -0
  90. package/dist/assets/thread-utils-Ct3yp4R3.js +2 -0
  91. package/dist/assets/thread-utils-Ct3yp4R3.js.map +1 -0
  92. package/dist/assets/useAgentData-D-k9cXfg.js +2 -0
  93. package/dist/assets/useAgentData-D-k9cXfg.js.map +1 -0
  94. package/dist/assets/useEscapeKey-CEQ6-8GR.js +2 -0
  95. package/dist/assets/useEscapeKey-CEQ6-8GR.js.map +1 -0
  96. package/dist/assets/useExpertCatalog-BZdw1CYs.js +2 -0
  97. package/dist/assets/useExpertCatalog-BZdw1CYs.js.map +1 -0
  98. package/dist/assets/usePromptBlocks-5sz8Qh51.js +2 -0
  99. package/dist/assets/usePromptBlocks-5sz8Qh51.js.map +1 -0
  100. package/dist/assets/useSocket-YigidotN.css +1 -0
  101. package/dist/assets/useSocket-y3-zWhVL.js +11 -0
  102. package/dist/assets/useSocket-y3-zWhVL.js.map +1 -0
  103. package/dist/assets/utils--_pbLpCq.js +2 -0
  104. package/dist/assets/utils--_pbLpCq.js.map +1 -0
  105. package/dist/assets/vad-web-C_R267y1.js +2 -0
  106. package/dist/assets/vad-web-C_R267y1.js.map +1 -0
  107. package/dist/avatars/agent-avatar-1.png +0 -0
  108. package/dist/avatars/agent-avatar-2.png +0 -0
  109. package/dist/avatars/agent-avatar-3.png +0 -0
  110. package/dist/avatars/agent-avatar-4.png +0 -0
  111. package/dist/avatars/agent-avatar-5.png +0 -0
  112. package/dist/avatars/agent-avatar-6.png +0 -0
  113. package/dist/avatars/agent-avatar-7.png +0 -0
  114. package/dist/avatars/agent-avatar-8.png +0 -0
  115. package/dist/avatars/agent-avatar-9.png +0 -0
  116. package/dist/avatars/agentteams.png +0 -0
  117. package/dist/avatars/antig-opus.png +0 -0
  118. package/dist/avatars/antigravity.png +0 -0
  119. package/dist/avatars/assistant.svg +17 -0
  120. package/dist/avatars/codex-kawaii.png +0 -0
  121. package/dist/avatars/codex.png +0 -0
  122. package/dist/avatars/codex_box.png +0 -0
  123. package/dist/avatars/codex_iquid.png +0 -0
  124. package/dist/avatars/dare.png +0 -0
  125. package/dist/avatars/gemini-kawaii.png +0 -0
  126. package/dist/avatars/gemini.png +0 -0
  127. package/dist/avatars/gemini25.png +0 -0
  128. package/dist/avatars/gpt52.png +0 -0
  129. package/dist/avatars/jiuwenclaw.png +0 -0
  130. package/dist/avatars/office.svg +17 -0
  131. package/dist/avatars/opencode.png +0 -0
  132. package/dist/avatars/opus-45.png +0 -0
  133. package/dist/avatars/opus-kawaii.png +0 -0
  134. package/dist/avatars/opus.png +0 -0
  135. package/dist/avatars/sonnet.png +0 -0
  136. package/dist/favicon.ico +0 -0
  137. package/dist/icons/arrow-left.svg +3 -0
  138. package/dist/icons/arrow-right.svg +3 -0
  139. package/dist/icons/attach.svg +9 -0
  140. package/dist/icons/chart/dislike.svg +3 -0
  141. package/dist/icons/chart/disliked.svg +3 -0
  142. package/dist/icons/chart/folder.svg +15 -0
  143. package/dist/icons/chart/home-loading.webp +0 -0
  144. package/dist/icons/chart/like.svg +3 -0
  145. package/dist/icons/chart/liked.svg +5 -0
  146. package/dist/icons/chart/loading.svg +26 -0
  147. package/dist/icons/chart/success.svg +7 -0
  148. package/dist/icons/check-line.svg +3 -0
  149. package/dist/icons/chevron-left.svg +3 -0
  150. package/dist/icons/chevron-right.svg +3 -0
  151. package/dist/icons/collapse.svg +14 -0
  152. package/dist/icons/common-delete.svg +4 -0
  153. package/dist/icons/common-folder.svg +4 -0
  154. package/dist/icons/copy.svg +4 -0
  155. package/dist/icons/cross-line.svg +4 -0
  156. package/dist/icons/data-analysis.svg +7 -0
  157. package/dist/icons/data-visualization.svg +10 -0
  158. package/dist/icons/deep-research.svg +4 -0
  159. package/dist/icons/document-processing.svg +5 -0
  160. package/dist/icons/edit.svg +4 -0
  161. package/dist/icons/expand.svg +6 -0
  162. package/dist/icons/expert-debate.svg +4 -0
  163. package/dist/icons/eye.svg +4 -0
  164. package/dist/icons/favicon.svg +7 -0
  165. package/dist/icons/file-docx.svg +60 -0
  166. package/dist/icons/file-folder.svg +4 -0
  167. package/dist/icons/file-gitignore.svg +35 -0
  168. package/dist/icons/file-html.svg +6 -0
  169. package/dist/icons/file-ini.svg +63 -0
  170. package/dist/icons/file-json.svg +4 -0
  171. package/dist/icons/file-md.svg +68 -0
  172. package/dist/icons/file-py.svg +4 -0
  173. package/dist/icons/file-sh.svg +7 -0
  174. package/dist/icons/file-txt.svg +37 -0
  175. package/dist/icons/file-zip.svg +21 -0
  176. package/dist/icons/file.svg +4 -0
  177. package/dist/icons/files-csv.svg +14 -0
  178. package/dist/icons/files-docx.svg +10 -0
  179. package/dist/icons/files-pdf.svg +14 -0
  180. package/dist/icons/files-ppt.svg +14 -0
  181. package/dist/icons/files-txt.svg +16 -0
  182. package/dist/icons/files-xlsx.svg +14 -0
  183. package/dist/icons/financial-services.svg +8 -0
  184. package/dist/icons/flie-html.svg +60 -0
  185. package/dist/icons/guided-mode.svg +9 -0
  186. package/dist/icons/icon-192x192.png +0 -0
  187. package/dist/icons/icon-512x512.png +0 -0
  188. package/dist/icons/icon-arrow-down.svg +4 -0
  189. package/dist/icons/icon-arrow-up.svg +4 -0
  190. package/dist/icons/icon-clear-all.svg +3 -0
  191. package/dist/icons/icon-close.svg +4 -0
  192. package/dist/icons/icon-code.svg +38 -0
  193. package/dist/icons/icon-drag-file.svg +26 -0
  194. package/dist/icons/icon-help.svg +4 -0
  195. package/dist/icons/icon-md.svg +53 -0
  196. package/dist/icons/icon-refresh.svg +4 -0
  197. package/dist/icons/icon-toggle.svg +6 -0
  198. package/dist/icons/icon-top.svg +7 -0
  199. package/dist/icons/icon-upload.svg +5 -0
  200. package/dist/icons/information.svg +6 -0
  201. package/dist/icons/inspiration/icon-excel.svg +14 -0
  202. package/dist/icons/inspiration/icon-inspiration.svg +5 -0
  203. package/dist/icons/inspiration/icon-markdown.svg +12 -0
  204. package/dist/icons/inspiration/icon-word.svg +10 -0
  205. package/dist/icons/link.svg +6 -0
  206. package/dist/icons/lock.svg +4 -0
  207. package/dist/icons/menu/agents.svg +39 -0
  208. package/dist/icons/menu/channels.svg +4 -0
  209. package/dist/icons/menu/icon-inspiration.svg +5 -0
  210. package/dist/icons/menu/models.svg +4 -0
  211. package/dist/icons/menu/new-chat.svg +59 -0
  212. package/dist/icons/menu/schedule.svg +4 -0
  213. package/dist/icons/menu/skills.svg +4 -0
  214. package/dist/icons/message-error.svg +6 -0
  215. package/dist/icons/message-prompt.svg +9 -0
  216. package/dist/icons/message-success.svg +6 -0
  217. package/dist/icons/message-warn.svg +8 -0
  218. package/dist/icons/more-trigger.svg +4 -0
  219. package/dist/icons/nss/1.svg +14 -0
  220. package/dist/icons/nss/2.svg +14 -0
  221. package/dist/icons/nss/3.svg +14 -0
  222. package/dist/icons/outline.svg +6 -0
  223. package/dist/icons/query_the_optical_power_border.svg +99 -0
  224. package/dist/icons/schedule.svg +4 -0
  225. package/dist/icons/settings-feedback/feedback-bug.svg +20 -0
  226. package/dist/icons/settings-feedback/feedback-file.svg +4 -0
  227. package/dist/icons/settings-feedback/feedback-idea.svg +14 -0
  228. package/dist/icons/settings-feedback/settings-gear.svg +4 -0
  229. package/dist/icons/settings-feedback/settings-link.svg +4 -0
  230. package/dist/icons/settings-feedback/settings-memory.svg +7 -0
  231. package/dist/icons/settings-feedback/settings-privacy.svg +37 -0
  232. package/dist/icons/settings-feedback/settings-search.svg +2 -0
  233. package/dist/icons/slides.svg +4 -0
  234. package/dist/icons/status/info-error.svg +9 -0
  235. package/dist/icons/style-template.svg +11 -0
  236. package/dist/icons/tool-error.svg +4 -0
  237. package/dist/icons/userprofile/help.svg +5 -0
  238. package/dist/icons/userprofile/keep-awake.svg +4 -0
  239. package/dist/icons/userprofile/question.svg +4 -0
  240. package/dist/icons/userprofile/security.svg +7 -0
  241. package/dist/icons/userprofile/style-template.svg +11 -0
  242. package/dist/icons/userprofile/theme.svg +14 -0
  243. package/dist/icons/userprofile/usage.svg +4 -0
  244. package/dist/icons/userprofile/version.svg +85 -0
  245. package/dist/icons/video-generation.svg +4 -0
  246. package/dist/images/OfficeClaw.svg +21 -0
  247. package/dist/images/add.svg +4 -0
  248. package/dist/images/agent-management-icons/agent-check.svg +23 -0
  249. package/dist/images/agent-management-icons/agent-close.svg +4 -0
  250. package/dist/images/agent-management-icons/agent-collab.svg +4 -0
  251. package/dist/images/agent-management-icons/agent-delete.svg +18 -0
  252. package/dist/images/agent-management-icons/agent-edit.svg +18 -0
  253. package/dist/images/agent-management-icons/agent-more.svg +4 -0
  254. package/dist/images/agent-management-icons/agent-persona.svg +4 -0
  255. package/dist/images/agent-management-icons/agent-random-avatar.svg +39 -0
  256. package/dist/images/agent-management-icons/agent-refresh.svg +4 -0
  257. package/dist/images/agent-management-icons/agent-skills.svg +4 -0
  258. package/dist/images/agent-management-icons/agent-template.svg +12 -0
  259. package/dist/images/agent-management-icons/anchor-current.svg +5 -0
  260. package/dist/images/agent-management-icons/anchor-other.svg +4 -0
  261. package/dist/images/chat-empty-agent.svg +12 -0
  262. package/dist/images/chat-empty-im.svg +14 -0
  263. package/dist/images/connectors/dingtalk.png +0 -0
  264. package/dist/images/connectors/dingtalk.svg +18 -0
  265. package/dist/images/connectors/feishu.png +0 -0
  266. package/dist/images/connectors/feishu.svg +12 -0
  267. package/dist/images/connectors/imessage.png +0 -0
  268. package/dist/images/connectors/wecom-agent.png +0 -0
  269. package/dist/images/connectors/wecom-bot.png +0 -0
  270. package/dist/images/connectors/weixin.png +0 -0
  271. package/dist/images/connectors/weixin.svg +19 -0
  272. package/dist/images/connectors/xiaoyi.png +0 -0
  273. package/dist/images/connectors/xiaoyi.svg +12 -0
  274. package/dist/images/create-agent-random-avatar.svg +39 -0
  275. package/dist/images/deepseek.svg +1 -0
  276. package/dist/images/default-ppt-template.png +0 -0
  277. package/dist/images/file-browser-tree/code.svg +60 -0
  278. package/dist/images/file-browser-tree/gitignore.svg +35 -0
  279. package/dist/images/file-browser-tree/image.svg +12 -0
  280. package/dist/images/file-browser-tree/markdown.svg +68 -0
  281. package/dist/images/file-browser-tree/pdf.svg +4 -0
  282. package/dist/images/file-browser-tree/ppt.svg +4 -0
  283. package/dist/images/file-browser-tree/public-file.svg +37 -0
  284. package/dist/images/file-browser-tree/word.svg +60 -0
  285. package/dist/images/file-browser-tree/xlsx.svg +4 -0
  286. package/dist/images/html-preview-toolbar/copy.svg +4 -0
  287. package/dist/images/html-preview-toolbar/open-external.svg +4 -0
  288. package/dist/images/html-preview-toolbar/refresh.svg +4 -0
  289. package/dist/images/information.svg +4 -0
  290. package/dist/images/inspiration/blue-bg.png +0 -0
  291. package/dist/images/inspiration/doc-example.png +0 -0
  292. package/dist/images/inspiration/excel-example.png +0 -0
  293. package/dist/images/inspiration/green-bg.png +0 -0
  294. package/dist/images/inspiration/markdown-example.png +0 -0
  295. package/dist/images/inspiration/orange-bg.png +0 -0
  296. package/dist/images/inspiration/purple-bg.png +0 -0
  297. package/dist/images/inspiration/task-bg.png +0 -0
  298. package/dist/images/inspiration-bg.png +0 -0
  299. package/dist/images/inspiration-products/default.svg +11 -0
  300. package/dist/images/invitation-background-4x.png +0 -0
  301. package/dist/images/kimi.svg +1 -0
  302. package/dist/images/link-blue.svg +4 -0
  303. package/dist/images/link.svg +4 -0
  304. package/dist/images/lobster.svg +118 -0
  305. package/dist/images/login1.svg +93 -0
  306. package/dist/images/login2.svg +80 -0
  307. package/dist/images/login3.svg +44 -0
  308. package/dist/images/login4.svg +18 -0
  309. package/dist/images/mode-default-icon.svg +22 -0
  310. package/dist/images/no-data.svg +26 -0
  311. package/dist/images/no-search-results.svg +25 -0
  312. package/dist/images/ppt-preview/placeholder-main.webp +0 -0
  313. package/dist/images/ppt-preview/placeholder-thumb.webp +0 -0
  314. package/dist/images/ppt-template/dark-tech.png +0 -0
  315. package/dist/images/ppt-template/huawei.png +0 -0
  316. package/dist/images/ppt-template/light-tech.png +0 -0
  317. package/dist/images/ppt-template/paper-humanities.png +0 -0
  318. package/dist/images/ppt-template/template-default.png +0 -0
  319. package/dist/images/ppt-template/template-error.png +0 -0
  320. package/dist/images/ppt-template/template-generate-bg.svg +9639 -0
  321. package/dist/images/qwen.svg +1 -0
  322. package/dist/images/task-list/empty-state.svg +4 -0
  323. package/dist/images/task-list.svg +1 -0
  324. package/dist/images/vendor.svg +4 -0
  325. package/dist/images/version-bg.svg +85 -0
  326. package/dist/images/version.svg +9 -0
  327. package/dist/images/zhipu.svg +1 -0
  328. package/dist/index.html +74 -0
  329. package/dist/loading-point-style.webp +0 -0
  330. package/dist/loading-small.webp +0 -0
  331. package/dist/manifest.json +25 -0
  332. package/package.json +126 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverflowTooltip-CE5PjAb-.js","sources":["../../src/utils/client-env.ts","../../src/utils/userId.ts","../../src/utils/api-client.ts","../../src/components/shared/OverflowTooltip.tsx"],"sourcesContent":["/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n/**\n * Reads client-safe env vars. In Vitest, `vi.stubEnv` updates `process.env` first so\n * per-test overrides work; in Vite builds, values come from `import.meta.env`.\n */\nfunction getImportMetaEnv(): Record<string, string | undefined> {\n try {\n return (import.meta as unknown as { env?: Record<string, string | undefined> }).env ?? {};\n } catch {\n return {};\n }\n}\n\nexport function readPublicEnv(key: string): string | undefined {\n if (typeof process !== 'undefined' && process.env.VITEST) {\n const stubbed = process.env[key];\n if (stubbed !== undefined) return stubbed;\n }\n return getImportMetaEnv()[key];\n}\n\nexport function readBuildEnv(key: 'API_CLOWDER_HOST' | 'DEFAULT_API_CLIENT_URL' | 'CAN_CREATE_MODEL'): string {\n if (typeof process !== 'undefined' && process.env.VITEST) {\n const stubbed = process.env[key];\n if (stubbed !== undefined) return stubbed;\n }\n const env = getImportMetaEnv();\n if (key === 'API_CLOWDER_HOST') return env.API_CLOWDER_HOST ?? '';\n if (key === 'DEFAULT_API_CLIENT_URL') {\n return env.DEFAULT_API_CLIENT_URL ?? 'http://127.0.0.1:3004';\n }\n return env.CAN_CREATE_MODEL ?? '0';\n}\n","/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n/**\n * Unified userId source for the frontend.\n * Priority: URL ?userId= > localStorage > 'default-user'\n *\n * Storage keys use `office-claw-*` with read-time fallback from legacy `cat-cafe-*` keys (F140 merge D1).\n */\n\nconst STORAGE_KEY = 'office-claw-userId';\nconst LEGACY_STORAGE_KEY = 'cat-cafe-userId';\nconst SKIP_AUTH_KEY = 'office-claw-isskip';\nconst LEGACY_SKIP_AUTH_KEY = 'cat-cafe-isskip';\nconst CAN_CREATE_MODEL_KEY = 'can-create-model';\nconst USER_NAME_KEY = 'office-claw-userName';\nconst LEGACY_USER_NAME_KEY = 'cat-cafe-userName';\nconst DEFAULT_USER = 'default-user';\n\nfunction readStorage(primary: string, legacy: string): string | null {\n if (typeof window === 'undefined') return null;\n return window.localStorage.getItem(primary) ?? window.localStorage.getItem(legacy);\n}\n\nfunction writeStorage(primary: string, legacy: string, value: string): void {\n if (typeof window === 'undefined') return;\n window.localStorage.setItem(primary, value);\n try {\n window.localStorage.removeItem(legacy);\n } catch {\n /* ignore */\n }\n}\n\nfunction removeStoragePair(primary: string, legacy: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.removeItem(primary);\n window.localStorage.removeItem(legacy);\n } catch {\n /* ignore */\n }\n}\n\nexport function getUserId(): string {\n if (typeof window === 'undefined') return DEFAULT_USER;\n\n const url = new URL(window.location.href);\n const fromUrl = url.searchParams.get('userId');\n if (fromUrl) {\n writeStorage(STORAGE_KEY, LEGACY_STORAGE_KEY, fromUrl);\n return fromUrl;\n }\n\n const stored = readStorage(STORAGE_KEY, LEGACY_STORAGE_KEY);\n if (stored !== null && stored !== '') {\n if (window.localStorage.getItem(STORAGE_KEY) === null && window.localStorage.getItem(LEGACY_STORAGE_KEY) !== null) {\n writeStorage(STORAGE_KEY, LEGACY_STORAGE_KEY, stored);\n }\n return stored;\n }\n\n return DEFAULT_USER;\n}\n\nexport function setUserId(id: string): void {\n writeStorage(STORAGE_KEY, LEGACY_STORAGE_KEY, id);\n}\n\nexport function getUserName(): string {\n if (typeof window === 'undefined') return '';\n const stored = readStorage(USER_NAME_KEY, LEGACY_USER_NAME_KEY);\n if (stored) {\n if (window.localStorage.getItem(USER_NAME_KEY) === null && window.localStorage.getItem(LEGACY_USER_NAME_KEY) !== null) {\n writeStorage(USER_NAME_KEY, LEGACY_USER_NAME_KEY, stored);\n }\n return stored;\n }\n\n const userId = readStorage(STORAGE_KEY, LEGACY_STORAGE_KEY) ?? '';\n const parts = userId.split(':');\n return parts.length > 1 ? parts[1] || parts[0] : userId;\n}\n\nexport function getDomainId(): string {\n const userId = getUserId();\n const separatorIndex = userId.indexOf(':');\n return separatorIndex > 0 ? userId.slice(0, separatorIndex) : '';\n}\n\nexport function setUserName(name: string): void {\n if (typeof window === 'undefined') return;\n if (name.trim()) {\n writeStorage(USER_NAME_KEY, LEGACY_USER_NAME_KEY, name.trim());\n } else {\n removeStoragePair(USER_NAME_KEY, LEGACY_USER_NAME_KEY);\n }\n}\n\nexport function setAuthIdentity({ userId, userName }: { userId: string; userName?: string }): void {\n setUserId(userId);\n if (typeof userName === 'string') {\n setUserName(userName);\n }\n}\n\nexport function clearAuthIdentity(): void {\n removeStoragePair(STORAGE_KEY, LEGACY_STORAGE_KEY);\n removeStoragePair(USER_NAME_KEY, LEGACY_USER_NAME_KEY);\n}\n\nexport function getIsSkipAuth(): boolean {\n if (typeof window === 'undefined') return false;\n const raw = readStorage(SKIP_AUTH_KEY, LEGACY_SKIP_AUTH_KEY);\n if (raw === null) return false;\n if (window.localStorage.getItem(SKIP_AUTH_KEY) === null && window.localStorage.getItem(LEGACY_SKIP_AUTH_KEY) !== null) {\n writeStorage(SKIP_AUTH_KEY, LEGACY_SKIP_AUTH_KEY, raw);\n }\n return raw === '1' || raw === 'true';\n}\n\nexport function setIsSkipAuth(value: boolean): void {\n writeStorage(SKIP_AUTH_KEY, LEGACY_SKIP_AUTH_KEY, value ? '1' : '0');\n}\n\nexport function getCanCreateModel(): boolean {\n if (typeof window === 'undefined') return false;\n const raw = localStorage.getItem(CAN_CREATE_MODEL_KEY);\n return raw === '1' || raw === 'true';\n}\n\nexport function setCanCreateModel(value: boolean): void {\n if (typeof window !== 'undefined') {\n localStorage.setItem(CAN_CREATE_MODEL_KEY, value ? '1' : '0');\n }\n}\n","/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n/**\n * Unified API client for OfficeClaw frontend.\n *\n * - Uses NEXT_PUBLIC_API_URL / VITE_API_URL (via import.meta.env) when set\n * - Auto-injects X-Office-Claw-User identity header on every request\n * - Configurable request timeout (default: 1 hour to match backend CLI timeout)\n */\n\nimport { readBuildEnv, readPublicEnv } from './client-env';\nimport { getUserId } from './userId';\n\n/** Default API request timeout: 1 hour (matching backend CLI_TIMEOUT_MS) */\nconst DEFAULT_API_TIMEOUT_MS = 60 * 60 * 1000;\n\nfunction getBrowserLocation(): Location | null {\n if (typeof globalThis !== 'object' || globalThis === null) return null;\n const candidate = (globalThis as { location?: Location }).location;\n return candidate ?? null;\n}\n\nfunction isLoopbackHost(hostname: string | undefined): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1';\n}\n\nconst PROD_TUNNEL_API_URL = readPublicEnv('NEXT_PUBLIC_PROD_API_URL') ?? '';\nconst PROD_TUNNEL_FRONTEND_HOST = readPublicEnv('NEXT_PUBLIC_PROD_FRONTEND_HOST') ?? '';\n/** Cloud / tunnel API origin (Vite: `API_CLOWDER_HOST` in env; name retained for compatibility). */\nconst OFFICE_CLAW_CLOUD_API_HOST = readBuildEnv('API_CLOWDER_HOST');\nconst DEFAULT_API_CLIENT_URL = readBuildEnv('DEFAULT_API_CLIENT_URL');\n\nfunction resolveApiUrl(): string {\n const location = getBrowserLocation();\n\n // Cloudflare Tunnel: API 与前端分域名时,Access cookie 在共享父域上生效\n if (location?.hostname === PROD_TUNNEL_FRONTEND_HOST) {\n return OFFICE_CLAW_CLOUD_API_HOST;\n }\n if (isLoopbackHost(location?.hostname)) {\n const frontendPort = Number(location?.port ?? '') || 3003;\n const apiPort = frontendPort + 1;\n const protocol = location?.protocol ?? 'http:';\n const hostname = location?.hostname ?? '127.0.0.1';\n return `${protocol}//${hostname}:${apiPort}`;\n }\n const explicitPublic = readPublicEnv('NEXT_PUBLIC_API_URL') || readPublicEnv('VITE_API_URL');\n if (explicitPublic) return explicitPublic.replace(/\\/+$/, '');\n if (typeof window === 'undefined') return DEFAULT_API_CLIENT_URL;\n // Derive API port from frontend port: convention is frontend + 1 = API\n // (runtime: 3001→3002, alpha: 3011→3012). Fallback to +1 of current port.\n const frontendPort = Number(location?.port ?? '') || 3001;\n const apiPort = frontendPort + 1;\n const protocol = location?.protocol ?? 'http:';\n const hostname = location?.hostname ?? 'localhost';\n return `${protocol}//${hostname}:${apiPort}`;\n}\nexport const API_URL = resolveApiUrl();\n\nexport interface ApiFetchOptions extends RequestInit {\n /** Custom timeout in milliseconds (default: 1 hour) */\n timeoutMs?: number;\n /** @deprecated packages/web no longer owns login redirects; callers handle 401 locally. */\n suppressAuthRedirect?: boolean;\n}\n\nfunction resolveRequestCredentials(explicitCredentials?: RequestCredentials): RequestCredentials {\n if (explicitCredentials) return explicitCredentials;\n\n const location = getBrowserLocation();\n if (!location) {\n return API_URL.includes(PROD_TUNNEL_API_URL) ? 'include' : 'same-origin';\n }\n\n try {\n const apiOrigin = new URL(API_URL, location.href).origin;\n return apiOrigin === location.origin ? 'same-origin' : 'include';\n } catch {\n return API_URL.includes(PROD_TUNNEL_API_URL) ? 'include' : 'same-origin';\n }\n}\n\n/**\n * Fetch wrapper that injects identity header and supports timeout.\n * @param path - API path starting with '/' (e.g. '/api/messages')\n * @param init - Standard RequestInit options plus optional timeoutMs\n */\nexport async function apiFetch(path: string, init?: ApiFetchOptions): Promise<Response> {\n const headers = new Headers(init?.headers);\n headers.set('X-Office-Claw-User', getUserId());\n if (!headers.has('X-Trace-Id')) {\n headers.set('X-Trace-Id', crypto.randomUUID());\n }\n\n const timeoutMs = init?.timeoutMs ?? DEFAULT_API_TIMEOUT_MS;\n // Use AbortController for timeout support\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeoutMs);\n const externalSignal = init?.signal;\n const abortFromExternalSignal = () => controller.abort();\n if (externalSignal) {\n if (externalSignal.aborted) {\n controller.abort();\n } else {\n externalSignal.addEventListener('abort', abortFromExternalSignal, { once: true });\n }\n }\n\n try {\n const response = await fetch(`${API_URL}${path}`, {\n ...init,\n headers,\n signal: controller.signal,\n // Cookie auth requires credentials on cross-origin frontend→API hops\n credentials: resolveRequestCredentials(init?.credentials),\n });\n\n return response;\n } finally {\n clearTimeout(timeoutId);\n externalSignal?.removeEventListener('abort', abortFromExternalSignal);\n }\n}\n","/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n'use client';\n\nimport {\n cloneElement,\n type CSSProperties,\n type ElementType,\n type Ref,\n type ReactNode,\n isValidElement,\n type ReactElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nconst VIEWPORT_PADDING = 12;\nconst TOOLTIP_GAP = 10;\nconst TOOLTIP_ARROW_SIZE = 6;\nconst TOOLTIP_MAX_WIDTH = 328;\n\ntype TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\ntype TooltipPosition = {\n top: number;\n left: number;\n maxWidth: number;\n placement: TooltipPlacement;\n};\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction useTooltipPositioning(content: string, gap: number, preferredPlacement: TooltipPlacement) {\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const tooltipRef = useRef<HTMLDivElement | null>(null);\n const tooltipId = useId();\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<TooltipPosition | null>(null);\n\n useLayoutEffect(() => {\n if (!open) return;\n\n const updatePosition = () => {\n const trigger = triggerRef.current;\n const tooltip = tooltipRef.current;\n if (!trigger || !tooltip) return;\n\n const triggerRect = trigger.getBoundingClientRect();\n const tooltipRect = tooltip.getBoundingClientRect();\n const maxWidth = Math.max(160, Math.min(TOOLTIP_MAX_WIDTH, window.innerWidth - VIEWPORT_PADDING * 2));\n const tooltipWidth = Math.min(tooltipRect.width || maxWidth, maxWidth);\n const tooltipHeight = tooltipRect.height;\n\n const centeredLeft = clamp(\n triggerRect.left + triggerRect.width / 2 - tooltipWidth / 2,\n VIEWPORT_PADDING,\n window.innerWidth - tooltipWidth - VIEWPORT_PADDING,\n );\n const centeredTop = clamp(\n triggerRect.top + triggerRect.height / 2 - tooltipHeight / 2,\n VIEWPORT_PADDING,\n window.innerHeight - tooltipHeight - VIEWPORT_PADDING,\n );\n\n const topAbove = triggerRect.top - tooltipHeight - gap - TOOLTIP_ARROW_SIZE;\n const topBelow = triggerRect.bottom + gap + TOOLTIP_ARROW_SIZE;\n const leftOf = triggerRect.left - tooltipWidth - gap - TOOLTIP_ARROW_SIZE;\n const rightOf = triggerRect.right + gap + TOOLTIP_ARROW_SIZE;\n\n const canTop = topAbove >= VIEWPORT_PADDING;\n const canBottom = topBelow + tooltipHeight <= window.innerHeight - VIEWPORT_PADDING;\n const canLeft = leftOf >= VIEWPORT_PADDING;\n const canRight = rightOf + tooltipWidth <= window.innerWidth - VIEWPORT_PADDING;\n\n const verticalFallback = (): TooltipPosition => {\n const placeTop = canTop || !canBottom;\n return {\n top: placeTop ? Math.max(VIEWPORT_PADDING, topAbove) : topBelow,\n left: centeredLeft,\n maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH),\n placement: placeTop ? 'top' : 'bottom',\n };\n };\n\n const horizontalFallback = (): TooltipPosition => {\n const placeRight = canRight || !canLeft;\n return {\n top: centeredTop,\n left: placeRight ? rightOf : Math.max(VIEWPORT_PADDING, leftOf),\n maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH),\n placement: placeRight ? 'right' : 'left',\n };\n };\n\n if (preferredPlacement === 'right') {\n setPosition(canRight ? { top: centeredTop, left: rightOf, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'right' } : canLeft ? { top: centeredTop, left: Math.max(VIEWPORT_PADDING, leftOf), maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'left' } : verticalFallback());\n return;\n }\n if (preferredPlacement === 'left') {\n setPosition(canLeft ? { top: centeredTop, left: Math.max(VIEWPORT_PADDING, leftOf), maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'left' } : canRight ? { top: centeredTop, left: rightOf, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'right' } : verticalFallback());\n return;\n }\n if (preferredPlacement === 'bottom') {\n setPosition(canBottom ? { top: topBelow, left: centeredLeft, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'bottom' } : canTop ? { top: Math.max(VIEWPORT_PADDING, topAbove), left: centeredLeft, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'top' } : horizontalFallback());\n return;\n }\n if (preferredPlacement === 'top') {\n setPosition(canTop ? { top: Math.max(VIEWPORT_PADDING, topAbove), left: centeredLeft, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'top' } : canBottom ? { top: topBelow, left: centeredLeft, maxWidth: Math.min(maxWidth, TOOLTIP_MAX_WIDTH), placement: 'bottom' } : horizontalFallback());\n }\n };\n\n updatePosition();\n window.addEventListener('resize', updatePosition);\n window.addEventListener('scroll', updatePosition, true);\n return () => {\n window.removeEventListener('resize', updatePosition);\n window.removeEventListener('scroll', updatePosition, true);\n };\n }, [content, gap, open, preferredPlacement]);\n\n useEffect(() => {\n if (!open) {\n setPosition(null);\n }\n }, [open]);\n\n const tooltipStyle: CSSProperties | undefined = position\n ? {\n position: 'fixed',\n top: `${position.top}px`,\n left: `${position.left}px`,\n maxWidth: `${position.maxWidth}px`,\n }\n : {\n position: 'fixed',\n top: '-9999px',\n left: '-9999px',\n maxWidth: `min(${TOOLTIP_MAX_WIDTH}px, calc(100vw - ${VIEWPORT_PADDING * 2}px))`,\n };\n\n return {\n triggerRef,\n tooltipRef,\n tooltipId,\n open,\n setOpen,\n tooltipStyle,\n placement: position?.placement ?? 'top',\n };\n}\n\nfunction TooltipPortal({\n open,\n tooltipId,\n tooltipRef,\n tooltipStyle,\n content,\n customContent,\n placement,\n interactive,\n copyable,\n copied,\n onTooltipEnter,\n onTooltipLeave,\n onCopy,\n}: {\n open: boolean;\n tooltipId: string;\n tooltipRef: React.MutableRefObject<HTMLDivElement | null>;\n tooltipStyle: CSSProperties | undefined;\n content: string;\n customContent?: ReactNode;\n placement: TooltipPlacement;\n interactive: boolean;\n copyable: boolean;\n copied: boolean;\n onTooltipEnter: () => void;\n onTooltipLeave: () => void;\n onCopy: () => void;\n}) {\n if (!open) return null;\n\n const arrowClass =\n placement === 'top'\n ? 'absolute left-1/2 top-full h-0 w-0 -translate-x-1/2 border-x-[6px] border-t-[6px] border-x-transparent border-t-[var(--tooltip-surface)]'\n : placement === 'bottom'\n ? 'absolute bottom-full left-1/2 h-0 w-0 -translate-x-1/2 border-x-[6px] border-b-[6px] border-x-transparent border-b-[var(--tooltip-surface)]'\n : placement === 'right'\n ? 'absolute right-full top-1/2 h-0 w-0 -translate-y-1/2 border-y-[6px] border-r-[6px] border-y-transparent border-r-[var(--tooltip-surface)]'\n : 'absolute left-full top-1/2 h-0 w-0 -translate-y-1/2 border-y-[6px] border-l-[6px] border-y-transparent border-l-[var(--tooltip-surface)]';\n\n return createPortal(\n <div\n ref={tooltipRef}\n id={tooltipId}\n role=\"tooltip\"\n data-placement={placement}\n className={`${interactive ? 'pointer-events-auto' : 'pointer-events-none'} z-[1000]`}\n style={tooltipStyle}\n onMouseEnter={onTooltipEnter}\n onMouseLeave={onTooltipLeave}\n >\n <div className=\"relative whitespace-normal break-all rounded-lg bg-[var(--tooltip-surface)] px-3 py-2 text-xs leading-5 text-[var(--tooltip-text)] overflow-tooltip shadow-[var(--tooltip-shadow)]\">\n {customContent ? (\n customContent\n ) : (\n <div className=\"flex items-center gap-1.5\">\n <span className={`min-w-0 flex-1 ${copyable ? 'select-text' : ''}`}>{content}</span>\n {copyable && (\n <button\n type=\"button\"\n onClick={onCopy}\n aria-label=\"复制\"\n title=\"复制\"\n className=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--tooltip-icon)] transition-colors hover:text-[var(--tooltip-icon-hover)]\"\n >\n {copied ? (\n <svg viewBox=\"0 0 20 20\" className=\"h-3.5 w-3.5\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M4.5 10.5L8 14l7.5-7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : (\n <svg className=\"h-3.5 w-3.5\" viewBox=\"0 0 1024 1024\" version=\"1.1\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M337.28 138.688a27.968 27.968 0 0 0-27.968 27.968v78.72h377.344c50.816 0 92.032 41.152 92.032 91.968v377.344h78.656a28.032 28.032 0 0 0 27.968-28.032V166.656a28.032 28.032 0 0 0-27.968-27.968H337.28z m441.408 640v78.656c0 50.816-41.216 91.968-92.032 91.968H166.656a92.032 92.032 0 0 1-91.968-91.968V337.28c0-50.816 41.152-92.032 91.968-92.032h78.72V166.656c0-50.816 41.152-91.968 91.968-91.968h520c50.816 0 91.968 41.152 91.968 91.968v520c0 50.816-41.152 92.032-91.968 92.032h-78.72zM166.656 309.312a27.968 27.968 0 0 0-27.968 28.032v520c0 15.424 12.544 27.968 27.968 27.968h520a28.032 28.032 0 0 0 28.032-27.968V337.28a28.032 28.032 0 0 0-28.032-28.032H166.656z\" p-id=\"5039\"></path>\n </svg>\n )}\n </button>\n )}\n </div>\n )}\n <span data-testid=\"overflow-tooltip-arrow\" className={arrowClass} aria-hidden=\"true\" />\n </div>\n </div >,\n document.body,\n );\n}\n\nfunction isOverflowed(node: HTMLElement): boolean {\n return node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight;\n}\n\nexport function OverflowTooltip({\n content,\n customContent,\n className,\n textClassName,\n as: Component = 'span',\n children,\n forceShow = false,\n copyable = false,\n gap = TOOLTIP_GAP,\n placement = 'top',\n}: {\n content: string;\n customContent?: ReactNode;\n className?: string;\n textClassName?: string;\n as?: ElementType;\n children?: ReactElement;\n forceShow?: boolean;\n copyable?: boolean;\n gap?: number;\n placement?: TooltipPlacement;\n}) {\n const contentRef = useRef<HTMLElement | null>(null);\n const { triggerRef, tooltipRef, tooltipId, open, setOpen, tooltipStyle, placement: actualPlacement } = useTooltipPositioning(\n content,\n gap,\n placement,\n );\n const interactive = copyable || !!customContent;\n const [copied, setCopied] = useState(false);\n const closeTimerRef = useRef<number | null>(null);\n const openTimerRef = useRef<number | null>(null);\n\n const clearCloseTimer = useCallback(() => {\n if (closeTimerRef.current !== null) {\n window.clearTimeout(closeTimerRef.current);\n closeTimerRef.current = null;\n }\n }, []);\n\n const clearOpenTimer = useCallback(() => {\n if (openTimerRef.current !== null) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }\n }, []);\n\n const scheduleClose = useCallback(() => {\n clearCloseTimer();\n closeTimerRef.current = window.setTimeout(() => {\n setOpen(false);\n closeTimerRef.current = null;\n }, 300);\n }, [clearCloseTimer, setOpen]);\n\n const handleOpen = useCallback(() => {\n const node = contentRef.current;\n if (!node) return;\n\n clearCloseTimer();\n const shouldOpen = forceShow || isOverflowed(node);\n\n if (shouldOpen) {\n clearOpenTimer();\n openTimerRef.current = window.setTimeout(() => {\n setOpen(true);\n openTimerRef.current = null;\n }, 150);\n }\n }, [clearCloseTimer, clearOpenTimer, forceShow, setOpen]);\n\n const handleClose = useCallback(() => {\n clearOpenTimer();\n if (interactive) {\n scheduleClose();\n } else {\n setOpen(false);\n }\n }, [clearOpenTimer, interactive, scheduleClose, setOpen]);\n\n const handleCopy = useCallback(async () => {\n if (!copyable || !content.trim()) return;\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n setOpen(true);\n window.setTimeout(() => setCopied(false), 1200);\n } catch {\n // no-op\n }\n }, [content, copyable, setOpen]);\n\n useEffect(() => () => {\n clearCloseTimer();\n clearOpenTimer();\n }, [clearCloseTimer, clearOpenTimer]);\n\n const setRef = <T,>(ref: Ref<T> | undefined, value: T) => {\n if (!ref) return;\n if (typeof ref === 'function') {\n ref(value);\n return;\n }\n (ref as { current: T }).current = value;\n };\n\n const renderedContent = children\n ? isValidElement(children)\n ? cloneElement(children, {\n ref: (value: HTMLElement | null) => {\n setRef((children as ReactElement & { ref?: Ref<HTMLElement | null> }).ref, value);\n contentRef.current = value;\n },\n } as { ref: (value: HTMLElement | null) => void })\n : children\n : cloneElement(<Component className={textClassName}>{content}</Component>, { ref: contentRef } as {\n ref: typeof contentRef;\n });\n\n return (\n <div\n ref={triggerRef}\n className={className}\n onMouseEnter={handleOpen}\n onMouseLeave={handleClose}\n onFocus={handleOpen}\n onBlur={handleClose}\n aria-describedby={open ? tooltipId : undefined}\n >\n {renderedContent}\n <TooltipPortal\n open={open}\n tooltipId={tooltipId}\n tooltipRef={tooltipRef}\n tooltipStyle={tooltipStyle}\n content={content}\n customContent={customContent}\n placement={actualPlacement}\n interactive={interactive}\n copyable={copyable}\n copied={copied}\n onTooltipEnter={clearCloseTimer}\n onTooltipLeave={scheduleClose}\n onCopy={() => void handleCopy()}\n />\n </div>\n );\n}\n"],"names":["getImportMetaEnv","__vite_import_meta_env__","readPublicEnv","key","define_process_env_default","stubbed","readBuildEnv","env","STORAGE_KEY","LEGACY_STORAGE_KEY","SKIP_AUTH_KEY","LEGACY_SKIP_AUTH_KEY","CAN_CREATE_MODEL_KEY","USER_NAME_KEY","LEGACY_USER_NAME_KEY","DEFAULT_USER","readStorage","primary","legacy","writeStorage","value","removeStoragePair","getUserId","fromUrl","stored","getUserName","userId","parts","getDomainId","separatorIndex","clearAuthIdentity","getIsSkipAuth","raw","getCanCreateModel","DEFAULT_API_TIMEOUT_MS","getBrowserLocation","isLoopbackHost","hostname","PROD_TUNNEL_API_URL","PROD_TUNNEL_FRONTEND_HOST","OFFICE_CLAW_CLOUD_API_HOST","DEFAULT_API_CLIENT_URL","resolveApiUrl","location","apiPort","protocol","explicitPublic","API_URL","resolveRequestCredentials","explicitCredentials","apiFetch","path","init","headers","timeoutMs","controller","timeoutId","externalSignal","abortFromExternalSignal","VIEWPORT_PADDING","TOOLTIP_GAP","TOOLTIP_ARROW_SIZE","TOOLTIP_MAX_WIDTH","clamp","min","max","useTooltipPositioning","content","gap","preferredPlacement","triggerRef","useRef","tooltipRef","tooltipId","useId","open","setOpen","useState","position","setPosition","useLayoutEffect","updatePosition","trigger","tooltip","triggerRect","tooltipRect","maxWidth","tooltipWidth","tooltipHeight","centeredLeft","centeredTop","topAbove","topBelow","leftOf","rightOf","canTop","canBottom","canLeft","canRight","verticalFallback","placeTop","horizontalFallback","placeRight","useEffect","tooltipStyle","TooltipPortal","customContent","placement","interactive","copyable","copied","onTooltipEnter","onTooltipLeave","onCopy","arrowClass","createPortal","jsx","jsxs","isOverflowed","node","OverflowTooltip","className","textClassName","Component","children","forceShow","contentRef","actualPlacement","setCopied","closeTimerRef","openTimerRef","clearCloseTimer","useCallback","clearOpenTimer","scheduleClose","handleOpen","handleClose","handleCopy","setRef","ref","renderedContent","isValidElement","cloneElement"],"mappings":"saAUA,SAASA,GAAuD,CAC9D,GAAI,CACF,OAAQC,IAA+E,CAAA,CACzF,MAAQ,CACN,MAAO,CAAA,CACT,CACF,CAEO,SAASC,EAAcC,EAAiC,CAC7D,GAAI,OAAO,QAAY,KAAeC,EAAY,OAAQ,CACxD,MAAMC,EAAUD,EAAYD,CAAG,EAC/B,GAAIE,IAAY,OAAW,OA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AAO,EAC3C6D,EAAU,EAAI,EACdpD,EAAQ,EAAI,EACZ,OAAO,WAAW,IAAMoD,EAAU,EAAK,EAAG,IAAI,CAChD,MAAQ,CAER,CACF,EAAG,CAAC7D,EAAS0C,EAAUjC,CAAO,CAAC,EAE/B2B,EAAAA,UAAU,IAAM,IAAM,CACpB4B,EAAA,EACAE,EAAA,CACF,EAAG,CAACF,EAAiBE,CAAc,CAAC,EAEpC,MAAMK,EAAS,CAAKC,EAAyBvH,IAAa,CACxD,GAAKuH,EACL,IAAI,OAAOA,GAAQ,WAAY,CAC7BA,EAAIvH,CAAK,EACT,MACF,CACCuH,EAAuB,QAAUvH,EACpC,EAEMwH,EAAkBhB,EACpBiB,EAAAA,eAAejB,CAAQ,EACrBkB,EAAAA,aAAalB,EAAU,CACrB,IAAMxG,GAA8B,CAClCsH,EAAQd,EAA8D,IAAKxG,CAAK,EAChF0G,EAAW,QAAU1G,CACvB,CAAA,CAC+C,EACjDwG,EACFkB,EAAAA,aAAa1B,EAAAA,IAACO,EAAA,CAAU,UAAWD,EAAgB,SAAAvD,CAAA,CAAQ,EAAc,CAAE,IAAK2D,EAEjF,EAEH,OACET,EAAAA,KAAC,MAAA,CACC,IAAK/C,EACL,UAAAmD,EACA,aAAcc,EACd,aAAcC,EACd,QAASD,EACT,OAAQC,EACR,mBAAkB7D,EAAOF,EAAY,OAEpC,SAAA,CAAAmE,EACDxB,EAAAA,IAACX,GAAA,CACC,KAAA9B,EACA,UAAAF,EACA,WAAAD,EACA,aAAAgC,EACA,QAAArC,EACA,cAAAuC,EACA,UAAWqB,EACX,YAAAnB,EACA,SAAAC,EACA,OAAAC,EACA,eAAgBqB,EAChB,eAAgBG,EAChB,OAAQ,IAAM,KAAKG,EAAA,CAAW,CAAA,CAChC,CAAA,CAAA,CAGN"}
@@ -0,0 +1,2 @@
1
+ import{r as o,j as e}from"./index-Cb4fQgom.js";function h({visible:n}){return n?e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[e.jsx("path",{d:"M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[e.jsx("path",{d:"M3 3l18 18",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10.6 6.2A11.1 11.1 0 0 1 12 6c6.5 0 10 6 10 6a18.8 18.8 0 0 1-3.3 4.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6.7 6.8C4.1 8.2 2 12 2 12s3.5 6 10 6c1 0 1.9-.1 2.8-.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9.9 9.9A3 3 0 0 0 14.1 14.1",strokeLinecap:"round",strokeLinejoin:"round"})]})}const k=o.forwardRef(function({className:a,value:s,toggleTestId:d,wrapperClassName:c,iconClassName:l="h-4 w-4",inputPaddingRightClassName:u="pr-10",...x},p){const[r,i]=o.useState(!1),t=typeof s=="string"?s.length>0:!!s;return o.useEffect(()=>{t||i(!1)},[t]),e.jsxs("div",{className:c??"relative",children:[e.jsx("input",{...x,ref:p,value:s,type:r?"text":"password",className:["password-field-input",a,u].filter(Boolean).join(" ")}),t?e.jsx("button",{type:"button","data-testid":d,"aria-label":r?"隐藏密码":"显示密码",onClick:()=>i(j=>!j),className:"absolute inset-y-0 right-0 flex items-center justify-center px-3 text-[#8C95A6] transition-colors hover:text-[#4B5563]",children:e.jsx("span",{className:l,children:e.jsx(h,{visible:r})})}):null]})});export{k as P};
2
+ //# sourceMappingURL=PasswordField-DmzjtnCg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordField-DmzjtnCg.js","sources":["../../src/components/shared/PasswordField.tsx"],"sourcesContent":["/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\nimport { forwardRef, useEffect, useState, type InputHTMLAttributes } from 'react';\n\nfunction PasswordEyeIcon({ visible }: { visible: boolean }) {\n if (visible) {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" aria-hidden=\"true\">\n <path d=\"M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n }\n\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" aria-hidden=\"true\">\n <path d=\"M3 3l18 18\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path\n d=\"M10.6 6.2A11.1 11.1 0 0 1 12 6c6.5 0 10 6 10 6a18.8 18.8 0 0 1-3.3 4.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path d=\"M6.7 6.8C4.1 8.2 2 12 2 12s3.5 6 10 6c1 0 1.9-.1 2.8-.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M9.9 9.9A3 3 0 0 0 14.1 14.1\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nexport interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n toggleTestId?: string;\n wrapperClassName?: string;\n iconClassName?: string;\n inputPaddingRightClassName?: string;\n}\n\nexport const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(function PasswordField(\n {\n className,\n value,\n toggleTestId,\n wrapperClassName,\n iconClassName = 'h-4 w-4',\n inputPaddingRightClassName = 'pr-10',\n ...props\n },\n ref,\n) {\n const [showPassword, setShowPassword] = useState(false);\n const hasValue = typeof value === 'string' ? value.length > 0 : !!value;\n\n useEffect(() => {\n if (!hasValue) {\n setShowPassword(false);\n }\n }, [hasValue]);\n\n return (\n <div className={wrapperClassName ?? 'relative'}>\n <input\n {...props}\n ref={ref}\n value={value}\n type={showPassword ? 'text' : 'password'}\n className={['password-field-input', className, inputPaddingRightClassName].filter(Boolean).join(' ')}\n />\n {hasValue ? (\n <button\n type=\"button\"\n data-testid={toggleTestId}\n aria-label={showPassword ? '隐藏密码' : '显示密码'}\n onClick={() => setShowPassword((prev) => !prev)}\n className=\"absolute inset-y-0 right-0 flex items-center justify-center px-3 text-[#8C95A6] transition-colors hover:text-[#4B5563]\"\n >\n <span className={iconClassName}>\n <PasswordEyeIcon visible={showPassword} />\n </span>\n </button>\n ) : null}\n </div>\n );\n});\n"],"names":["PasswordEyeIcon","visible","jsxs","jsx","PasswordField","forwardRef","className","value","toggleTestId","wrapperClassName","iconClassName","inputPaddingRightClassName","props","ref","showPassword","setShowPassword","useState","hasValue","useEffect","prev"],"mappings":"+CAQA,SAASA,EAAgB,CAAE,QAAAC,GAAiC,CAC1D,OAAIA,EAEAC,EAAAA,KAAC,MAAA,CAAI,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,MAAM,cAAY,OACvF,SAAA,CAAAC,MAAC,QAAK,EAAE,mDAAmD,cAAc,QAAQ,eAAe,QAAQ,QACvG,SAAA,CAAO,GAAG,KAAK,GAAG,KAAK,EAAE,GAAA,CAAI,CAAA,EAChC,EAKFD,EAAAA,KAAC,MAAA,CAAI,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,MAAM,cAAY,OACvF,SAAA,CAAAC,MAAC,QAAK,EAAE,aAAa,cAAc,QAAQ,eAAe,QAAQ,EAClEA,EAAAA,IAAC,OAAA,CACC,EAAE,yEACF,cAAc,QACd,eAAe,OAAA,CAAA,QAEhB,OAAA,CAAK,EAAE,0DAA0D,cAAc,QAAQ,eAAe,QAAQ,QAC9G,OAAA,CAAK,EAAE,+BAA+B,cAAc,QAAQ,eAAe,OAAA,CAAQ,CAAA,EACtF,CAEJ,CASO,MAAMC,EAAgBC,EAAAA,WAAiD,SAC5E,CACE,UAAAC,EACA,MAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,cAAAC,EAAgB,UAChB,2BAAAC,EAA6B,QAC7B,GAAGC,CACL,EACAC,EACA,CACA,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAChDC,EAAW,OAAOV,GAAU,SAAWA,EAAM,OAAS,EAAI,CAAC,CAACA,EAElEW,OAAAA,EAAAA,UAAU,IAAM,CACTD,GACHF,EAAgB,EAAK,CAEzB,EAAG,CAACE,CAAQ,CAAC,EAGXf,EAAAA,KAAC,MAAA,CAAI,UAAWO,GAAoB,WAClC,SAAA,CAAAN,EAAAA,IAAC,QAAA,CACE,GAAGS,EACJ,IAAAC,EACA,MAAAN,EACA,KAAMO,EAAe,OAAS,WAC9B,UAAW,CAAC,uBAAwBR,EAAWK,CAA0B,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,CAAA,CAAA,EAEpGM,EACCd,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,cAAaK,EACb,aAAYM,EAAe,OAAS,OACpC,QAAS,IAAMC,EAAiBI,GAAS,CAACA,CAAI,EAC9C,UAAU,yHAEV,SAAAhB,EAAAA,IAAC,QAAK,UAAWO,EACf,eAACV,EAAA,CAAgB,QAASc,EAAc,CAAA,CAC1C,CAAA,CAAA,EAEA,IAAA,EACN,CAEJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{j as e,M as l}from"./index-Cb4fQgom.js";function d({bordered:r=!0,children:t,className:a="","aria-label":o="刷新",title:s="刷新",...n}){const i=[r?"inline-flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-[6px] border border-[var(--border-secondary)] bg-[var(--surface-panel)] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-hover)] hover:border-[var(--refresh-button-border-hover)] disabled:cursor-not-allowed disabled:opacity-50":"inline-flex items-center justify-center text-[var(--text-secondary)] disabled:cursor-not-allowed disabled:opacity-50",a].filter(Boolean).join(" ");return e.jsx("button",{type:"button","aria-label":o,title:s,className:i,...n,children:t??e.jsx(l,{name:"refresh",className:"h-4 w-4"})})}export{d as R};
2
+ //# sourceMappingURL=RefreshButton-BzYzeo5A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefreshButton-BzYzeo5A.js","sources":["../../src/components/shared/RefreshButton.tsx"],"sourcesContent":["/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { MaskIcon } from '@/components/shared/MaskIcon';\n\ninterface RefreshButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'children'> {\n bordered?: boolean;\n children?: ReactNode;\n}\n\nexport function RefreshButton({\n bordered = true,\n children,\n className = '',\n 'aria-label': ariaLabel = '刷新',\n title = '刷新',\n ...props\n}: RefreshButtonProps) {\n const classes = [\n bordered\n ? 'inline-flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-[6px] border border-[var(--border-secondary)] bg-[var(--surface-panel)] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-hover)] hover:border-[var(--refresh-button-border-hover)] disabled:cursor-not-allowed disabled:opacity-50'\n : 'inline-flex items-center justify-center text-[var(--text-secondary)] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button type=\"button\" aria-label={ariaLabel} title={title} className={classes} {...props}>\n {children ?? <MaskIcon name=\"refresh\" className=\"h-4 w-4\" />}\n </button>\n );\n}\n"],"names":["RefreshButton","bordered","children","className","ariaLabel","title","props","classes","jsx","MaskIcon"],"mappings":"+CAgBO,SAASA,EAAc,CAC5B,SAAAC,EAAW,GACX,SAAAC,EACA,UAAAC,EAAY,GACZ,aAAcC,EAAY,KAC1B,MAAAC,EAAQ,KACR,GAAGC,CACL,EAAuB,CACrB,MAAMC,EAAU,CACdN,EACI,sUACA,uHACJE,CAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,aACG,SAAA,CAAO,KAAK,SAAS,aAAYC,EAAW,MAAAC,EAAc,UAAWE,EAAU,GAAGD,EAChF,YAAYE,EAAAA,IAACC,EAAA,CAAS,KAAK,UAAU,UAAU,UAAU,EAC5D,CAEJ"}
@@ -0,0 +1,3 @@
1
+ import{t as Bt,z as Ut,N as Ht,c as C,r as o,u as yt,j as t,B as We}from"./index-Cb4fQgom.js";import{a as Wt,g as Vt,c as D,O as Ve,e as nt}from"./OverflowTooltip-CE5PjAb-.js";import{a as Kt}from"./thread-title-Cerb2mHa.js";function Ke(r,s){return typeof r=="function"?r(s):r}const h=Bt(r=>({isFeedbackOpen:!1,isAutoOpenedFeedback:!1,selectedScore:null,lowScoreSelectedIssues:[],highScoreSelectedIssues:[],lowScoreDetail:"",lowScoreOtherIssueDetail:"",highScoreOtherIssueDetail:"",setFeedbackPopoverState:s=>r(s),resetFeedbackPopoverState:()=>r({isFeedbackOpen:!1,isAutoOpenedFeedback:!1}),setSelectedScore:s=>r({selectedScore:s}),setLowScoreSelectedIssues:s=>r(a=>({lowScoreSelectedIssues:Ke(s,a.lowScoreSelectedIssues)})),setHighScoreSelectedIssues:s=>r(a=>({highScoreSelectedIssues:Ke(s,a.highScoreSelectedIssues)})),setLowScoreDetail:s=>r({lowScoreDetail:s}),setLowScoreOtherIssueDetail:s=>r({lowScoreOtherIssueDetail:s}),setHighScoreOtherIssueDetail:s=>r({highScoreOtherIssueDetail:s}),resetFeedbackFormState:()=>r({selectedScore:null,lowScoreSelectedIssues:[],highScoreSelectedIssues:[],lowScoreDetail:"",lowScoreOtherIssueDetail:"",highScoreOtherIssueDetail:""})}));let me=!1;function Yt(){return t.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"5.5",stroke:"currentColor",strokeWidth:"1.2"}),t.jsx("circle",{cx:"6.1",cy:"6.6",r:"0.7",fill:"currentColor"}),t.jsx("circle",{cx:"9.9",cy:"6.6",r:"0.7",fill:"currentColor"}),t.jsx("path",{d:"M5.5 9.2C6.1 10.1 7 10.6 8 10.6C9 10.6 9.9 10.1 10.5 9.2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Xt(){return t.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:t.jsx("path",{d:"M4 8H12",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})})}function qt(){return t.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:t.jsx("rect",{x:"4.25",y:"4.25",width:"7.5",height:"7.5",rx:"0.9",stroke:"currentColor",strokeWidth:"1.2"})})}function Gt(){return t.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:[t.jsx("path",{d:"M5.75 4.25H10.1C10.984 4.25 11.7 4.966 11.7 5.85V10.2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.25 5.75H5.9C5.016 5.75 4.3 6.466 4.3 7.35V11.1C4.3 11.984 5.016 12.7 5.9 12.7H10.25C11.134 12.7 11.85 11.984 11.85 11.1V7.35C11.85 6.466 11.134 5.75 10.25 5.75Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]})}function zt(){return t.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:[t.jsx("path",{d:"M5 5L11 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),t.jsx("path",{d:"M11 5L5 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function $t(){return t.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4","aria-hidden":"true",children:[t.jsx("path",{d:"M4.75 4.75L11.25 11.25",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),t.jsx("path",{d:"M11.25 4.75L4.75 11.25",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Qt(){return t.jsx("img",{"data-testid":"thread-workspace-icon",src:"/icons/chart/folder.svg",alt:"","aria-hidden":"true",className:"h-4 w-4 shrink-0"})}function q({title:r,children:s,buttonRef:a,...v}){return t.jsx("button",{ref:a,type:"button",className:"ui-content-header-action",title:r,"aria-label":r,...v,children:s})}function Jt({isOpen:r}){return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`transition-transform ${r?"":"rotate-180"}`,"aria-hidden":!0,children:[t.jsx("rect",{x:"2.5",y:"2.5",width:"15",height:"15",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"14",y1:"2.75",x2:"14",y2:"17.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}const Zt=Array.from({length:11},(r,s)=>s),es=[{id:"ai_output_inaccurate",label:"AI输出不准确"},{id:"ui_unattractive",label:"界面不美观"},{id:"ai_intent_understanding_weak",label:"AI意图理解不到位"},{id:"operation_inconvenient",label:"操作不便利"},{id:"features_or_tools_limited",label:"功能/工具不丰富"},{id:"security_reliability_low",label:"安全可靠性低"},{id:"slow_and_laggy",label:"运行缓慢卡顿"},{id:"other_issue",label:"其他问题"}],ts=[{id:"ai_output_accurate",label:"AI输出准确无误"},{id:"ui_beautiful",label:"界面美观"},{id:"ai_intent_understanding_strong",label:"AI意图理解能力强"},{id:"operation_convenient_and_smooth",label:"操作便捷流畅"},{id:"features_or_tools_rich",label:"功能/工具丰富"},{id:"secure_and_reliable",label:"安全可靠"},{id:"efficient_and_stable",label:"运行高效稳定"},{id:"other_issue",label:"其他问题"}],ss="https://voc.huaweicloud.com/survey-api/api/get/commit/date",ns="https://voc.huaweicloud.com/survey-api/api/save",Ye="feedbackCloseTime",rs=30,os=120,cs=6e4,is=120,Xe="hwcloudbusurvey_key_fbd25bdbdb87",qe="OfficeClaw",Ge="global.cf",as="question_0",ls="question_1",us="question_2",ds="question_99",he="0",hs="null",fs="0",ze=400,$e="请将内容控制在400字以内",ms=1e3,Qe="请将内容控制在1000字符以内",se=`【使用场景】:
2
+ 【优化意见】:`,bs="选择不能为空",Je="输入不能为空",Ss="您在使用过程中遇到了哪些问题?",_s="您感到满意的原因是?",Es="(选择您最关注的三项)",ks="请您反馈遇到的具体问题,帮助我们准确评估并优化",rt="您还有其它意见和建议吗?",ps=rt,gs="(可选)";function fe(r){const s=r.trim();return s?s!==se.trim():!1}function Is(r){return r<=6?"/icons/nss/1.svg":r<=8?"/icons/nss/2.svg":r<=10?"/icons/nss/3.svg":null}function ws(r){const s=r.trim();if(!s)return null;const a=new Date(s.replace(" ","T")).getTime();return Number.isNaN(a)?null:a}function Ze(r,s){return Date.now()-r<=s*24*60*60*1e3}function et(r){const s=r.match(/^\/thread\/([^/?#]+)/);return s!=null&&s[1]?decodeURIComponent(s[1]):null}function xs(r){if(!r)return null;const s=r.replace(/[\\/]+$/,""),a=s.split(/[/\\]/).filter(Boolean);return a[a.length-1]??s??null}function Cs(r){let s=!1,a=!1;for(const v of r)if(v.type==="user"&&(s=!0),v.type==="assistant"&&(a=!0),s&&a)return!0;return!1}function tt(){var r;return((r=D("NEXT_PUBLIC_FEEDBACK_SAVE_W3ACCOUNT"))==null?void 0:r.trim())||nt()}function st(){var s;const r=(s=nt())==null?void 0:s.trim();return r?`${Ye}:${r}`:Ye}function Os(){me=!1}function js(){const r=h.getState();r.resetFeedbackPopoverState(),r.resetFeedbackFormState()}function Ns({leftContent:r,panelToggle:s}={}){var Fe;const{isMaximized:a,canMaximize:v,minimize:ot,toggleMaximize:ne,close:ct,startDrag:be}=Ut(),{pathname:re}=Ht(),G=C(e=>e.currentThreadId),it=C(e=>e.threads),at=C(e=>e.rightPanelMode),Se=C(e=>e.openFileBrowserPanel),_e=C(e=>e.setRightPanelMode),z=at==="fileBrowser",lt=o.useCallback(()=>{z?_e("status"):Se()},[z,Se,_e]),Ee=C(e=>e.isLoadingHistory),ke=C(e=>e.messages),T=h(e=>e.isFeedbackOpen),pe=h(e=>e.isAutoOpenedFeedback),m=h(e=>e.selectedScore),ut=h(e=>e.lowScoreSelectedIssues),dt=h(e=>e.highScoreSelectedIssues),S=h(e=>e.lowScoreDetail),ht=h(e=>e.lowScoreOtherIssueDetail),ft=h(e=>e.highScoreOtherIssueDetail),w=h(e=>e.setFeedbackPopoverState),mt=h(e=>e.setSelectedScore),bt=h(e=>e.setLowScoreSelectedIssues),St=h(e=>e.setHighScoreSelectedIssues),O=h(e=>e.setLowScoreDetail),ge=h(e=>e.setLowScoreOtherIssueDetail),Ie=h(e=>e.setHighScoreOtherIssueDetail),we=h(e=>e.resetFeedbackFormState),[xe,Ce]=o.useState(null),[_t,M]=o.useState(!1),[Et,P]=o.useState(!1),[kt,j]=o.useState(!1),[pt,N]=o.useState(!1),[$,oe]=o.useState(!1),p=yt(e=>e.addToast),gt=o.useRef(null),De=o.useRef(null),It=o.useRef(null),_=o.useRef(null),E=o.useRef(null),Q=o.useRef(null),ve=o.useId(),wt=m==null,b=m!=null&&m<=8,l=m!=null&&m>=9,J=l?ts:es,g=l?dt:ut,A=l?ft:ht,Te=et(re??""),B=Te===G?it.find(e=>e.id===G):null,ce=B?Kt(B.title):null,L=((Fe=B==null?void 0:B.projectPath)==null?void 0:Fe.trim())??"",Z=!!(L&&L!=="default"),ie=Z?xs(L)||L:null,xt=o.useCallback(async()=>{if(Z)try{const e=await Wt("/api/projects/open-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:L})});if(!e.ok){const c=await e.json().catch(()=>null),i=typeof(c==null?void 0:c.error)=="string"&&c.error.trim()?c.error.trim():`无法打开当前会话的工作空间目录(状态码 ${e.status})`;throw new Error(i)}}catch(e){console.error("Failed to open workspace directory:",e),p({type:"error",title:"打开工作空间失败",message:e instanceof Error&&e.message.trim()?e.message:"无法打开当前会话的工作空间目录",duration:2400})}},[p,Z,L]),Oe=g.includes("other_issue"),Ct=Oe&&A.length>ze,je="您的使用体验如何?我们期待倾听",ae=l?_s:Ss,Dt=Es,vt=l?ps:ks,Ne=l?gs:null,U=ms,Tt=se,Ae=b,F=o.useCallback(()=>{we(),M(!1),P(!1),j(!1),N(!1),oe(!1)},[we]),I=o.useCallback(()=>{_.current!=null&&(window.clearTimeout(_.current),_.current=null),E.current!=null&&(window.clearTimeout(E.current),E.current=null),w({isFeedbackOpen:!1,isAutoOpenedFeedback:!1}),Ce(null),F()},[F,w]),Ot=o.useCallback(()=>{typeof window<"u"&&window.localStorage.setItem(st(),String(Date.now())),I()},[I]),Le=o.useCallback(()=>{_.current!=null&&(window.clearTimeout(_.current),_.current=null),E.current!=null&&(window.clearTimeout(E.current),E.current=null),w({isFeedbackOpen:!0,isAutoOpenedFeedback:!1})},[w]),le=o.useCallback(()=>{E.current!=null&&(window.clearTimeout(E.current),E.current=null)},[]),jt=o.useCallback(()=>{Q.current==null&&(le(),E.current=window.setTimeout(()=>{E.current=null,Q.current==null&&I()},is))},[le,I]);o.useEffect(()=>{Q.current=m},[m]),o.useEffect(()=>{var te,W,V;if(typeof window>"u"||Vt()||me)return;const e=et(re??"");if(!e||e!==G||Ee||!Cs(ke))return;me=!0;const c=window.localStorage.getItem(st()),i=c?Number(c):Number.NaN;if(Number.isFinite(i)&&Ze(i,rs))return;const u=((te=D("NEXT_PUBLIC_FEEDBACK_SAVE_SURVEY_ID"))==null?void 0:te.trim())||Xe,k=((W=D("NEXT_PUBLIC_FEEDBACK_SAVE_SERVICE_ID"))==null?void 0:W.trim())||qe,H=((V=D("NEXT_PUBLIC_FEEDBACK_SAVE_CONTACT_ID"))==null?void 0:V.trim())||Ge,de=tt(),ee=new URLSearchParams({userId:de,surveyId:u,serviceId:k,contactId:H});let y=!1;return(async()=>{var K;try{const x=await fetch(`${ss}?${ee.toString()}`,{method:"GET"});if(y)return;if(!x.ok){F(),w({isFeedbackOpen:!0,isAutoOpenedFeedback:!0});return}const f=await x.json();if(y)return;const Y=typeof(f==null?void 0:f.latest_feedback_date)=="string"?f.latest_feedback_date:typeof(f==null?void 0:f.data)=="string"?f.data:typeof((K=f==null?void 0:f.data)==null?void 0:K.latest_feedback_date)=="string"?f.data.latest_feedback_date:"",X=Y?ws(Y):null;(!X||!Ze(X,os))&&(F(),w({isFeedbackOpen:!0,isAutoOpenedFeedback:!0}))}catch(x){if(x instanceof DOMException&&x.name==="AbortError")return;F(),w({isFeedbackOpen:!0,isAutoOpenedFeedback:!0})}})(),()=>{y=!0}},[G,Ee,ke,re,F,w]),o.useEffect(()=>{b||(P(!1),j(!1))},[b]),o.useEffect(()=>{if((b||l)&&!S.trim()){O(se),M(!1),N(!1);return}b||N(!1)},[l,b,S,O]),o.useEffect(()=>{if(!T)return;const e=()=>{var k;const c=(k=De.current)==null?void 0:k.getBoundingClientRect();if(!c)return;const i=window.innerHeight,u=Math.max(0,Math.floor(i-(c.bottom+12)-32));Ce(u)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[T]),o.useEffect(()=>{if(!(!T||!pe))return _.current=window.setTimeout(()=>{_.current=null,Q.current==null&&I()},cs),()=>{_.current!=null&&(window.clearTimeout(_.current),_.current=null)}},[I,pe,T]);const Nt=e=>{(l?St:bt)(i=>{let u=i;return i.includes(e)?u=i.filter(k=>k!==e):i.length<3&&(u=[...i,e]),u.includes("other_issue")||j(!1),u.length>0&&P(!1),u})},At=o.useCallback(e=>{if(e.length>U){M(!0);return}M(!1),fe(e)&&N(!1),O(e)},[U,O]),Lt=o.useCallback(()=>{!b&&!l||S.trim().length>0||(O(se),M(!1),N(!1))},[l,b,S,O]),Ft=o.useCallback(e=>{l?Ie(e):ge(e),e.trim().length>0&&j(!1)},[l,Ie,ge]),Rt=o.useCallback(async()=>{var W,V,K,x,f,Y,X,Me,Pe,Be,Ue,He;if(b||(P(!1),j(!1)),$)return;if(m==null){p({type:"error",title:"提交失败",message:"请先选择满意度评分",duration:3200});return}if(b||l){const d=g.length>0,n=g.includes("other_issue"),R=A.trim().length>0,ye=Ae&&!fe(S);if(P(!d),j(n&&!R),N(ye),!d||n&&!R||ye)return}if(g.includes("other_issue")&&A.length>ze){p({type:"error",title:"提交失败",message:$e,duration:3200});return}if(S.length>U){p({type:"error",title:"提交失败",message:Qe,duration:3200});return}const e=((W=D("NEXT_PUBLIC_FEEDBACK_SAVE_SURVEY_ID"))==null?void 0:W.trim())||Xe,c=((V=D("NEXT_PUBLIC_FEEDBACK_SAVE_SERVICE_ID"))==null?void 0:V.trim())||qe,i=((K=D("NEXT_PUBLIC_FEEDBACK_SAVE_CONTACT_ID"))==null?void 0:K.trim())||Ge,u=tt(),k=String(m),H=J.map((d,n)=>g.includes(d.id)?String(n):"").filter(Boolean).join(","),de=J.filter(d=>g.includes(d.id)).map(d=>d.label).join(","),ee=fe(S)?S.trim():"",y=g.includes("other_issue")?A.trim():he,Re=m>=9?us:ls,te=[{questionId:as,subQuestionId:null,subName:je,answer:k,subRemark:k,reason:he},{questionId:Re,subQuestionId:null,subName:ae,answer:H,subRemark:de,reason:y||he},{questionId:ds,subQuestionId:null,subName:rt,answer:ee,subRemark:ee?hs:"",reason:fs}];oe(!0);try{const d=await fetch(ns,{method:"POST",headers:{"Content-Type":"application/json;charset=utf8"},body:JSON.stringify({data:{surveyId:e,serviceId:c,contactId:i,w3account:u,answers:te}})});let n=null;try{n=await d.json()}catch{n=null}if(!d.ok){const R=((x=n==null?void 0:n.error_msg)==null?void 0:x.trim())||((f=n==null?void 0:n.errorMsg)==null?void 0:f.trim())||((Y=n==null?void 0:n.message)==null?void 0:Y.trim())||((X=n==null?void 0:n.msg)==null?void 0:X.trim())||((Me=n==null?void 0:n.error)==null?void 0:Me.trim())||`提交失败(HTTP ${d.status})`;p({type:"error",title:"提交失败",message:R,duration:4200});return}if(n!=null&&n.error_code||n!=null&&n.errorCode){const R=((Pe=n==null?void 0:n.error_msg)==null?void 0:Pe.trim())||((Be=n==null?void 0:n.errorMsg)==null?void 0:Be.trim())||((Ue=n==null?void 0:n.message)==null?void 0:Ue.trim())||((He=n==null?void 0:n.msg)==null?void 0:He.trim())||(n==null?void 0:n.error_code)||(n==null?void 0:n.errorCode)||"";p({type:"error",title:"提交失败",message:R,duration:4200});return}p({type:"success",title:"提交成功",message:"感谢您的反馈",duration:2600}),I()}catch(d){const n=d instanceof Error&&d.message?d.message:"网络异常";p({type:"error",title:"提交失败",message:n,duration:4200})}finally{oe(!1)}},[p,U,J,g,ae,I,Ae,l,b,$,S,A,m]),ue=o.useRef({isDragging:!1,startX:0,startY:0}),Mt=o.useCallback(e=>{e.button===0&&(e.target.closest(".ui-content-header-action")||e.target.closest(".ui-content-header-feedback-popover")||e.target.closest(".ui-content-header-feedback-anchor")||(ue.current={isDragging:!1,startX:e.clientX,startY:e.clientY}))},[]),Pt=o.useCallback(e=>{e.target.closest(".ui-content-header-action")||e.target.closest(".ui-content-header-feedback-popover")||e.target.closest(".ui-content-header-feedback-anchor")||ne()},[ne]);return o.useEffect(()=>{const e=i=>{const u=ue.current;if(u.startX!==0&&!u.isDragging){const k=Math.abs(i.clientX-u.startX),H=Math.abs(i.clientY-u.startY);(k>5||H>5)&&(u.isDragging=!0,be())}},c=()=>{ue.current={isDragging:!1,startX:0,startY:0}};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",c)}},[be]),t.jsxs("div",{ref:gt,className:"ui-content-header","data-testid":"right-content-header",onMouseDown:Mt,onDoubleClick:Pt,children:[t.jsx("div",{className:"flex h-full min-w-0 flex-1 items-center",children:r??t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[ce&&t.jsx(Ve,{content:ce,className:"min-w-0 max-w-full self-center h-full inline-flex items-center overflow-hidden",placement:"bottom",children:t.jsx("span",{"data-testid":"thread-title-label",className:"block w-full truncate whitespace-nowrap text-ellipsis text-[14px] font-medium leading-[2] text-[rgba(25,25,25,1)]",children:ce})}),Z&&ie&&t.jsx(Ve,{content:"点击打开会话工作空间目录",className:"min-w-0 max-w-full self-center h-full inline-flex items-center shrink-0",placement:"bottom",forceShow:!0,children:t.jsxs("button",{type:"button","data-testid":"thread-workspace-open-button",onClick:xt,onMouseDown:e=>e.stopPropagation(),"aria-label":`打开工作空间 ${ie}`,className:"inline-flex h-6 max-w-full min-w-0 items-center gap-1.5 rounded bg-[rgba(245,245,245,1)] px-2 text-sm leading-none text-[var(--text-primary)] shadow-none outline-none transition-colors hover:text-[var(--text-accent)] focus-visible:ring-2 focus-visible:ring-[var(--text-accent)]",children:[t.jsx(Qt,{}),t.jsx("span",{className:"leading-[2] max-[600px]:hidden truncate",children:ie})]})})]})}),t.jsxs("div",{className:"ui-content-header-actions",children:[Te!==null&&t.jsxs(t.Fragment,{children:[t.jsx(q,{title:s?s.isOpen?s.closeLabel:s.openLabel:z?"关闭文件浏览":"打开文件浏览",onClick:s?s.onToggle:lt,children:t.jsx(Jt,{isOpen:s?s.isOpen:z})}),t.jsx("div",{className:"ui-content-header-divider","aria-hidden":"true"})]}),t.jsxs("div",{className:"ui-content-header-feedback-anchor",onMouseEnter:le,onMouseLeave:jt,children:[t.jsx(q,{title:"笑脸",buttonRef:De,"aria-expanded":T,"aria-controls":ve,"aria-haspopup":"dialog",onClick:Le,onMouseEnter:Le,children:t.jsx(Yt,{})}),T?t.jsxs("div",{ref:It,id:ve,role:"dialog","aria-modal":"false","aria-label":"满意度评分",style:{height:"auto"},className:wt?"ui-content-header-feedback-popover ui-content-header-feedback-popover-compact":"ui-content-header-feedback-popover",children:[t.jsxs("div",{className:"ui-content-header-feedback-popover-content",style:{maxHeight:xe!=null?`${xe}px`:void 0},children:[t.jsxs("div",{className:"ui-content-header-feedback-popover-header",children:[t.jsx("p",{className:"ui-content-header-feedback-popover-title",children:je}),t.jsx("button",{type:"button","aria-label":"关闭满意度评价弹窗",className:"ui-content-header-feedback-popover-close",onClick:Ot,children:t.jsx($t,{})})]}),t.jsxs("div",{className:"ui-content-header-feedback-popover-body",children:[t.jsx("div",{className:"ui-content-header-feedback-score-row",children:Zt.map(e=>t.jsx("button",{type:"button",onClick:()=>mt(e),"aria-label":`评分 ${e}`,"aria-pressed":m===e,className:m===e?"ui-content-header-feedback-score ui-content-header-feedback-score-selected":"ui-content-header-feedback-score",children:m===e?t.jsx("span",{className:"flex h-full w-full items-center justify-center",children:t.jsx("img",{src:Is(e)??"",alt:"","aria-hidden":"true",width:24,height:24,className:"h-6 w-6 object-contain"})}):e},e))}),b||l?t.jsxs("div",{className:"ui-content-header-feedback-low-score",children:[t.jsxs("div",{className:"ui-content-header-feedback-low-score-section",children:[t.jsxs("p",{className:"ui-content-header-feedback-low-score-title",children:[ae,t.jsx("span",{className:"ui-content-header-feedback-low-score-subtitle",children:Dt})]}),t.jsx("div",{className:"ui-content-header-feedback-low-score-options",children:J.map(e=>{const c=g.includes(e.id),i=!c&&g.length>=3;return t.jsxs("label",{className:i?"ui-content-header-feedback-low-score-option ui-content-header-feedback-low-score-option-disabled":"ui-content-header-feedback-low-score-option",children:[t.jsx("input",{type:"checkbox",checked:c,disabled:i,onChange:()=>Nt(e.id)}),t.jsxs("span",{className:"ui-content-header-feedback-low-score-option-content",children:[t.jsx("span",{className:"ui-content-header-feedback-low-score-option-label",children:e.label}),e.hint?t.jsx("span",{className:"ui-content-header-feedback-low-score-option-hint",children:e.hint}):null]})]},e.id)})}),Oe?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",className:"ui-input",placeholder:"是什么问题呢?请简要说明",value:A,onChange:e=>Ft(e.target.value)}),kt?t.jsx("p",{className:"ui-content-header-feedback-other-error",children:Je}):Ct?t.jsx("p",{className:"ui-content-header-feedback-other-error",children:$e}):null]}):null,Et?t.jsx("p",{className:"ui-content-header-feedback-other-error",children:bs}):null]}),t.jsxs("div",{className:"ui-content-header-feedback-low-score-section",children:[t.jsxs("p",{className:"ui-content-header-feedback-low-score-title",children:[vt,Ne?t.jsx("span",{className:"ui-content-header-feedback-low-score-subtitle",children:Ne}):null]}),t.jsxs("div",{className:"ui-content-header-feedback-detail-shell",children:[t.jsx("textarea",{className:"ui-textarea ui-content-header-feedback-detail-input",placeholder:Tt,value:S,onFocus:Lt,onChange:e=>At(e.target.value)}),t.jsxs("span",{className:"ui-content-header-feedback-detail-counter",children:[S.length,"/",U]})]}),pt?t.jsx("p",{className:"ui-content-header-feedback-detail-error",children:Je}):_t?t.jsx("p",{className:"ui-content-header-feedback-detail-error",children:Qe}):null]})]}):null]}),b||l?t.jsxs("div",{className:"ui-content-header-feedback-low-score-actions",children:[t.jsx(We,{variant:"default",onClick:I,children:"取消"}),t.jsx(We,{variant:"major",onClick:()=>void Rt(),disabled:$,children:$?"提交中...":"提交"})]}):null]}),t.jsx("div",{className:"ui-content-header-feedback-popover-arrow","aria-hidden":"true"})]}):null]}),t.jsx("div",{className:"ui-content-header-divider","data-testid":"right-content-header-divider","aria-hidden":"true"}),t.jsx(q,{title:"最小化",onClick:ot,children:t.jsx(Xt,{})}),t.jsx(q,{title:a?"还原":"最大化",onClick:ne,disabled:!v,children:a?t.jsx(Gt,{}):t.jsx(qt,{})}),t.jsx(q,{title:"关闭",onClick:ct,children:t.jsx(zt,{})})]})]})}export{Ns as RightContentHeader,Os as __resetFeedbackAutoOpenSessionForTests,js as __resetFeedbackPopoverStateForTests};
3
+ //# sourceMappingURL=RightContentHeader-DoNDQ9Lo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RightContentHeader-DoNDQ9Lo.js","sources":["../../src/stores/feedbackPopoverStore.ts","../../src/components/RightContentHeader.tsx"],"sourcesContent":["/*\n * *\n * * Copyright (C) Huawei Technologies Co., Ltd. 2026. All rights reserved.\n *\n */\n\n'use client';\n\nimport { create } from 'zustand';\n\ntype Updater<T> = T | ((prev: T) => T);\n\nfunction resolveUpdater<T>(updater: Updater<T>, prev: T): T {\n return typeof updater === 'function' ? (updater as (prev: T) => T)(prev) : updater;\n}\n\ninterface FeedbackPopoverState {\n isFeedbackOpen: boolean;\n isAutoOpenedFeedback: boolean;\n selectedScore: number | null;\n lowScoreSelectedIssues: string[];\n highScoreSelectedIssues: string[];\n lowScoreDetail: string;\n lowScoreOtherIssueDetail: string;\n highScoreOtherIssueDetail: string;\n setFeedbackPopoverState: (next: Pick<FeedbackPopoverState, 'isFeedbackOpen' | 'isAutoOpenedFeedback'>) => void;\n resetFeedbackPopoverState: () => void;\n setSelectedScore: (next: number | null) => void;\n setLowScoreSelectedIssues: (next: Updater<string[]>) => void;\n setHighScoreSelectedIssues: (next: Updater<string[]>) => void;\n setLowScoreDetail: (next: string) => void;\n setLowScoreOtherIssueDetail: (next: string) => void;\n setHighScoreOtherIssueDetail: (next: string) => void;\n resetFeedbackFormState: () => void;\n}\n\nexport const useFeedbackPopoverStore = create<FeedbackPopoverState>((set) => ({\n isFeedbackOpen: false,\n isAutoOpenedFeedback: false,\n selectedScore: null,\n lowScoreSelectedIssues: [],\n highScoreSelectedIssues: [],\n lowScoreDetail: '',\n lowScoreOtherIssueDetail: '',\n highScoreOtherIssueDetail: '',\n setFeedbackPopoverState: (next) => set(next),\n resetFeedbackPopoverState: () =>\n set({\n isFeedbackOpen: false,\n isAutoOpenedFeedback: false,\n }),\n setSelectedScore: (selectedScore) => set({ selectedScore }),\n setLowScoreSelectedIssues: (next) =>\n set((state) => ({ lowScoreSelectedIssues: resolveUpdater(next, state.lowScoreSelectedIssues) })),\n setHighScoreSelectedIssues: (next) =>\n set((state) => ({ highScoreSelectedIssues: resolveUpdater(next, state.highScoreSelectedIssues) })),\n setLowScoreDetail: (lowScoreDetail) => set({ lowScoreDetail }),\n setLowScoreOtherIssueDetail: (lowScoreOtherIssueDetail) => set({ lowScoreOtherIssueDetail }),\n setHighScoreOtherIssueDetail: (highScoreOtherIssueDetail) => set({ highScoreOtherIssueDetail }),\n resetFeedbackFormState: () =>\n set({\n selectedScore: null,\n lowScoreSelectedIssues: [],\n highScoreSelectedIssues: [],\n lowScoreDetail: '',\n lowScoreOtherIssueDetail: '',\n highScoreOtherIssueDetail: '',\n }),\n}));\n","'use client';\n\nimport { useCallback, useEffect, useId, useRef, useState } from 'react';\nimport type { ButtonHTMLAttributes, ReactNode, RefObject } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { useDesktopWindowControls } from '@/hooks/useDesktopWindowControls';\nimport { useChatStore, type ChatMessage } from '@/stores/chatStore';\nimport { useFeedbackPopoverStore } from '@/stores/feedbackPopoverStore';\nimport { useToastStore } from '@/stores/toastStore';\nimport { apiFetch } from '@/utils/api-client';\nimport { readPublicEnv } from '@/utils/client-env';\nimport { getDomainId, getIsSkipAuth } from '@/utils/userId';\nimport { normalizeStoredThreadTitle } from './thread-sidebar/thread-title';\nimport { Button } from './shared/Button';\nimport { OverflowTooltip } from './shared/OverflowTooltip';\n\nlet hasAttemptedFeedbackAutoOpenThisSession = false;\n\nfunction WindowSmileIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-5 w-5\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <circle cx=\"6.1\" cy=\"6.6\" r=\"0.7\" fill=\"currentColor\" />\n <circle cx=\"9.9\" cy=\"6.6\" r=\"0.7\" fill=\"currentColor\" />\n <path\n d=\"M5.5 9.2C6.1 10.1 7 10.6 8 10.6C9 10.6 9.9 10.1 10.5 9.2\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction WindowMinimizeIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-5 w-5\" aria-hidden=\"true\">\n <path d=\"M4 8H12\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nfunction WindowMaximizeIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-5 w-5\" aria-hidden=\"true\">\n <rect x=\"4.25\" y=\"4.25\" width=\"7.5\" height=\"7.5\" rx=\"0.9\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n </svg>\n );\n}\n\nfunction WindowRestoreIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-5 w-5\" aria-hidden=\"true\">\n <path d=\"M5.75 4.25H10.1C10.984 4.25 11.7 4.966 11.7 5.85V10.2\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M10.25 5.75H5.9C5.016 5.75 4.3 6.466 4.3 7.35V11.1C4.3 11.984 5.016 12.7 5.9 12.7H10.25C11.134 12.7 11.85 11.984 11.85 11.1V7.35C11.85 6.466 11.134 5.75 10.25 5.75Z\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nfunction WindowCloseIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-5 w-5\" aria-hidden=\"true\">\n <path d=\"M5 5L11 11\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n <path d=\"M11 5L5 11\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nfunction PopoverCloseIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"h-4 w-4\" aria-hidden=\"true\">\n <path d=\"M4.75 4.75L11.25 11.25\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n <path d=\"M11.25 4.75L4.75 11.25\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nfunction HeaderWorkspaceIcon() {\n return (\n <img\n data-testid=\"thread-workspace-icon\"\n src=\"/icons/chart/folder.svg\"\n alt=\"\"\n aria-hidden=\"true\"\n className=\"h-4 w-4 shrink-0\"\n />\n );\n}\n\ntype HeaderActionProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'title' | 'type'> & {\n title: string;\n children: ReactNode;\n buttonRef?: RefObject<HTMLButtonElement>;\n};\n\nfunction HeaderAction({ title, children, buttonRef, ...buttonProps }: HeaderActionProps) {\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className=\"ui-content-header-action\"\n title={title}\n aria-label={title}\n {...buttonProps}\n >\n {children}\n </button>\n );\n}\n\nfunction RightPanelToggleIcon({ isOpen }: { isOpen: boolean }) {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={`transition-transform ${isOpen ? '' : 'rotate-180'}`}\n aria-hidden\n >\n <rect\n x=\"2.5\"\n y=\"2.5\"\n width=\"15\"\n height=\"15\"\n rx=\"2.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <line\n x1=\"14\"\n y1=\"2.75\"\n x2=\"14\"\n y2=\"17.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nexport interface RightContentHeaderPanelToggle {\n isOpen: boolean;\n onToggle: () => void;\n openLabel: string;\n closeLabel: string;\n}\n\nexport interface RightContentHeaderProps {\n leftContent?: ReactNode;\n panelToggle?: RightContentHeaderPanelToggle;\n}\n\ntype IssueOption = {\n id: string;\n label: string;\n hint?: string;\n};\n\nconst SATISFACTION_SCORES = Array.from({ length: 11 }, (_, index) => index);\nconst LOW_SCORE_ISSUE_OPTIONS: IssueOption[] = [\n {\n id: 'ai_output_inaccurate',\n label: 'AI输出不准确',\n },\n {\n id: 'ui_unattractive',\n label: '界面不美观',\n },\n {\n id: 'ai_intent_understanding_weak',\n label: 'AI意图理解不到位',\n },\n {\n id: 'operation_inconvenient',\n label: '操作不便利',\n },\n {\n id: 'features_or_tools_limited',\n label: '功能/工具不丰富',\n },\n {\n id: 'security_reliability_low',\n label: '安全可靠性低',\n },\n {\n id: 'slow_and_laggy',\n label: '运行缓慢卡顿',\n },\n {\n id: 'other_issue',\n label: '其他问题',\n },\n];\nconst HIGH_SCORE_ISSUE_OPTIONS: IssueOption[] = [\n {\n id: 'ai_output_accurate',\n label: 'AI输出准确无误',\n },\n {\n id: 'ui_beautiful',\n label: '界面美观',\n },\n {\n id: 'ai_intent_understanding_strong',\n label: 'AI意图理解能力强',\n },\n {\n id: 'operation_convenient_and_smooth',\n label: '操作便捷流畅',\n },\n {\n id: 'features_or_tools_rich',\n label: '功能/工具丰富',\n },\n {\n id: 'secure_and_reliable',\n label: '安全可靠',\n },\n {\n id: 'efficient_and_stable',\n label: '运行高效稳定',\n },\n {\n id: 'other_issue',\n label: '其他问题',\n },\n];\nconst FEEDBACK_DATE_ENDPOINT = 'https://voc.huaweicloud.com/survey-api/api/get/commit/date';\nconst FEEDBACK_SAVE_ENDPOINT = 'https://voc.huaweicloud.com/survey-api/api/save';\nconst FEEDBACK_CLOSE_TIME_KEY = 'feedbackCloseTime';\nconst FEEDBACK_CLOSE_SUPPRESS_DAYS = 30;\nconst FEEDBACK_RESURFACE_DAYS = 120;\nconst FEEDBACK_AUTO_CLOSE_DELAY_MS = 60_000;\nconst FEEDBACK_MOUSE_LEAVE_CLOSE_DELAY_MS = 120;\nconst DEFAULT_FEEDBACK_SAVE_SURVEY_ID = 'hwcloudbusurvey_key_fbd25bdbdb87';\nconst DEFAULT_FEEDBACK_SAVE_SERVICE_ID = 'OfficeClaw';\nconst DEFAULT_FEEDBACK_SAVE_CONTACT_ID = 'global.cf';\nconst SCORE_QUESTION_ID = 'question_0';\nconst LOW_SCORE_REASON_QUESTION_ID = 'question_1';\nconst HIGH_SCORE_REASON_QUESTION_ID = 'question_2';\nconst DETAIL_QUESTION_ID = 'question_99';\nconst SCORE_REASON_DEFAULT_REASON = '0';\nconst DETAIL_DEFAULT_SUB_REMARK = 'null';\nconst DETAIL_DEFAULT_REASON = '0';\nconst OTHER_ISSUE_MAX_LENGTH = 400;\nconst OTHER_ISSUE_LENGTH_ERROR_MESSAGE = '\\u8bf7\\u5c06\\u5185\\u5bb9\\u63a7\\u5236\\u5728400\\u5b57\\u4ee5\\u5185';\nconst DETAIL_MAX_LENGTH = 1000;\nconst DETAIL_LENGTH_ERROR_MESSAGE = '\\u8bf7\\u5c06\\u5185\\u5bb9\\u63a7\\u5236\\u57281000\\u5b57\\u7b26\\u4ee5\\u5185';\nconst DETAIL_PREFILL_TEMPLATE = '\\u3010\\u4f7f\\u7528\\u573a\\u666f\\u3011\\uff1a\\n\\u3010\\u4f18\\u5316\\u610f\\u89c1\\u3011\\uff1a';\nconst REQUIRED_SELECT_ERROR_MESSAGE = '\\u9009\\u62e9\\u4e0d\\u80fd\\u4e3a\\u7a7a';\nconst REQUIRED_INPUT_ERROR_MESSAGE = '\\u8f93\\u5165\\u4e0d\\u80fd\\u4e3a\\u7a7a';\nconst LOW_SCORE_PRIMARY_TITLE = '您在使用过程中遇到了哪些问题?';\nconst HIGH_SCORE_PRIMARY_TITLE = '您感到满意的原因是?';\nconst PRIMARY_SUBTITLE = '(选择您最关注的三项)';\nconst LOW_SCORE_DETAIL_TITLE = '请您反馈遇到的具体问题,帮助我们准确评估并优化';\nconst DETAIL_SUBMIT_TITLE = '您还有其它意见和建议吗?';\nconst HIGH_SCORE_DETAIL_TITLE = DETAIL_SUBMIT_TITLE;\nconst HIGH_SCORE_DETAIL_SUBTITLE = '(可选)';\n\nfunction hasMeaningfulDetail(value: string): boolean {\n const normalizedValue = value.trim();\n if (!normalizedValue) return false;\n\n return normalizedValue !== DETAIL_PREFILL_TEMPLATE.trim();\n}\n\nfunction getSelectedScoreIconSrc(score: number): string | null {\n if (score <= 6) return '/icons/nss/1.svg';\n if (score <= 8) return '/icons/nss/2.svg';\n if (score <= 10) return '/icons/nss/3.svg';\n return null;\n}\n\nfunction parseFeedbackDate(value: string): number | null {\n const normalized = value.trim();\n if (!normalized) return null;\n\n const timestamp = new Date(normalized.replace(' ', 'T')).getTime();\n return Number.isNaN(timestamp) ? null : timestamp;\n}\n\nfunction isWithinDays(timestamp: number, days: number): boolean {\n return Date.now() - timestamp <= days * 24 * 60 * 60 * 1000;\n}\n\nfunction getThreadIdFromPathname(pathname: string): string | null {\n const match = pathname.match(/^\\/thread\\/([^/?#]+)/);\n return match?.[1] ? decodeURIComponent(match[1]) : null;\n}\n\nfunction getFolderNameFromPath(path: string | null | undefined): string | null {\n if (!path) return null;\n const normalized = path.replace(/[\\\\/]+$/, '');\n const segments = normalized.split(/[/\\\\]/).filter(Boolean);\n return segments[segments.length - 1] ?? normalized ?? null;\n}\n\nfunction hasCompletedOneDialogueRound(messages: ChatMessage[]): boolean {\n let hasUserMessage = false;\n let hasAssistantMessage = false;\n\n for (const message of messages) {\n if (message.type === 'user') hasUserMessage = true;\n if (message.type === 'assistant') hasAssistantMessage = true;\n if (hasUserMessage && hasAssistantMessage) return true;\n }\n\n return false;\n}\n\nfunction getFeedbackUserId(): string {\n return readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_W3ACCOUNT')?.trim() || getDomainId();\n}\n\nfunction getFeedbackCloseStorageKey(): string {\n const domainId = getDomainId()?.trim();\n return domainId ? `${FEEDBACK_CLOSE_TIME_KEY}:${domainId}` : FEEDBACK_CLOSE_TIME_KEY;\n}\n\nexport function __resetFeedbackAutoOpenSessionForTests() {\n hasAttemptedFeedbackAutoOpenThisSession = false;\n}\n\nexport function __resetFeedbackPopoverStateForTests() {\n const state = useFeedbackPopoverStore.getState();\n state.resetFeedbackPopoverState();\n state.resetFeedbackFormState();\n}\n\ntype FeedbackDateResponse = {\n data?: string | { latest_feedback_date?: string };\n latest_feedback_date?: string;\n};\n\ntype FeedbackSubmitAnswer = {\n questionId: string;\n subQuestionId: string | null;\n subName: string;\n answer: string;\n subRemark?: string;\n reason?: string;\n};\n\ntype FeedbackSubmitResponse = {\n error_code?: string;\n error_msg?: string;\n errorCode?: string;\n errorMsg?: string;\n msg?: string;\n code?: string | number;\n feedback_data?: string;\n message?: string;\n error?: string;\n};\n\nexport function RightContentHeader({ leftContent, panelToggle }: RightContentHeaderProps = {}) {\n const { isMaximized, canMaximize, minimize, toggleMaximize, close, startDrag } = useDesktopWindowControls();\n const { pathname } = useLocation();\n const currentThreadId = useChatStore((s) => s.currentThreadId);\n const threads = useChatStore((s) => s.threads);\n const rightPanelMode = useChatStore((s) => s.rightPanelMode);\n const openFileBrowserPanel = useChatStore((s) => s.openFileBrowserPanel);\n const setRightPanelMode = useChatStore((s) => s.setRightPanelMode);\n const isFileBrowserOpen = rightPanelMode === 'fileBrowser';\n\n const handleToggleFileBrowser = useCallback(() => {\n if (isFileBrowserOpen) {\n setRightPanelMode('status');\n } else {\n openFileBrowserPanel();\n }\n }, [isFileBrowserOpen, openFileBrowserPanel, setRightPanelMode]);\n const isLoadingHistory = useChatStore((s) => s.isLoadingHistory);\n const messages = useChatStore((s) => s.messages);\n const isFeedbackOpen = useFeedbackPopoverStore((s) => s.isFeedbackOpen);\n const isAutoOpenedFeedback = useFeedbackPopoverStore((s) => s.isAutoOpenedFeedback);\n const selectedScore = useFeedbackPopoverStore((s) => s.selectedScore);\n const lowScoreSelectedIssues = useFeedbackPopoverStore((s) => s.lowScoreSelectedIssues);\n const highScoreSelectedIssues = useFeedbackPopoverStore((s) => s.highScoreSelectedIssues);\n const lowScoreDetail = useFeedbackPopoverStore((s) => s.lowScoreDetail);\n const lowScoreOtherIssueDetail = useFeedbackPopoverStore((s) => s.lowScoreOtherIssueDetail);\n const highScoreOtherIssueDetail = useFeedbackPopoverStore((s) => s.highScoreOtherIssueDetail);\n const setFeedbackPopoverState = useFeedbackPopoverStore((s) => s.setFeedbackPopoverState);\n const setSelectedScore = useFeedbackPopoverStore((s) => s.setSelectedScore);\n const setLowScoreSelectedIssues = useFeedbackPopoverStore((s) => s.setLowScoreSelectedIssues);\n const setHighScoreSelectedIssues = useFeedbackPopoverStore((s) => s.setHighScoreSelectedIssues);\n const setLowScoreDetail = useFeedbackPopoverStore((s) => s.setLowScoreDetail);\n const setLowScoreOtherIssueDetail = useFeedbackPopoverStore((s) => s.setLowScoreOtherIssueDetail);\n const setHighScoreOtherIssueDetail = useFeedbackPopoverStore((s) => s.setHighScoreOtherIssueDetail);\n const resetFeedbackFormState = useFeedbackPopoverStore((s) => s.resetFeedbackFormState);\n const [feedbackPopoverMaxHeight, setFeedbackPopoverMaxHeight] = useState<number | null>(null);\n const [isDetailTooLong, setIsDetailTooLong] = useState(false);\n const [isIssueRequiredError, setIsIssueRequiredError] = useState(false);\n const [isOtherIssueRequiredError, setIsOtherIssueRequiredError] = useState(false);\n const [isDetailRequiredError, setIsDetailRequiredError] = useState(false);\n const [isSubmittingFeedback, setIsSubmittingFeedback] = useState(false);\n const addToast = useToastStore((s) => s.addToast);\n const headerRef = useRef<HTMLDivElement>(null);\n const smileActionRef = useRef<HTMLButtonElement>(null);\n const feedbackPopoverRef = useRef<HTMLDivElement | null>(null);\n const autoCloseFeedbackTimerRef = useRef<number | null>(null);\n const mouseLeaveCloseTimerRef = useRef<number | null>(null);\n const selectedScoreRef = useRef<number | null>(null);\n const feedbackPopoverId = useId();\n const isScoreUnselected = selectedScore == null;\n const isVeryLowScoreDetailVisible = selectedScore != null && selectedScore <= 6;\n const isLowScoreDetailVisible = selectedScore != null && selectedScore <= 8;\n const isHighScoreDetailVisible = selectedScore != null && selectedScore >= 9;\n const currentIssueOptions = isHighScoreDetailVisible ? HIGH_SCORE_ISSUE_OPTIONS : LOW_SCORE_ISSUE_OPTIONS;\n const currentSelectedIssues = isHighScoreDetailVisible ? highScoreSelectedIssues : lowScoreSelectedIssues;\n const currentOtherIssueDetail = isHighScoreDetailVisible ? highScoreOtherIssueDetail : lowScoreOtherIssueDetail;\n const routeThreadId = getThreadIdFromPathname(pathname ?? '');\n const currentThread = routeThreadId === currentThreadId ? threads.find((thread) => thread.id === currentThreadId) : null;\n const threadTitle = currentThread ? normalizeStoredThreadTitle(currentThread.title) : null;\n const workspacePath = currentThread?.projectPath?.trim() ?? '';\n const shouldShowWorkspace = Boolean(workspacePath && workspacePath !== 'default');\n const workspaceLabel = shouldShowWorkspace ? getFolderNameFromPath(workspacePath) || workspacePath : null;\n\n const handleOpenWorkspace = useCallback(async () => {\n if (!shouldShowWorkspace) return;\n try {\n const res = await apiFetch('/api/projects/open-directory', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ path: workspacePath }),\n });\n if (!res.ok) {\n const data = (await res.json().catch(() => null)) as { error?: unknown } | null;\n const message =\n typeof data?.error === 'string' && data.error.trim() ? data.error.trim() : `无法打开当前会话的工作空间目录(状态码 ${res.status})`;\n throw new Error(message);\n }\n } catch (error) {\n console.error('Failed to open workspace directory:', error);\n addToast({\n type: 'error',\n title: '打开工作空间失败',\n message: error instanceof Error && error.message.trim() ? error.message : '无法打开当前会话的工作空间目录',\n duration: 2400,\n });\n }\n }, [addToast, shouldShowWorkspace, workspacePath]);\n const isOtherIssueSelected = currentSelectedIssues.includes('other_issue');\n const isOtherIssueTooLong = isOtherIssueSelected && currentOtherIssueDetail.length > OTHER_ISSUE_MAX_LENGTH;\n const currentSurveyTitle = '\\u60a8\\u7684\\u4f7f\\u7528\\u4f53\\u9a8c\\u5982\\u4f55\\uff1f\\u6211\\u4eec\\u671f\\u5f85\\u503e\\u542c';\n const currentPrimaryTitle = isHighScoreDetailVisible ? HIGH_SCORE_PRIMARY_TITLE : LOW_SCORE_PRIMARY_TITLE;\n const currentPrimarySubtitle = PRIMARY_SUBTITLE;\n const currentDetailTitle = isHighScoreDetailVisible ? HIGH_SCORE_DETAIL_TITLE : LOW_SCORE_DETAIL_TITLE;\n const currentDetailSubtitle = isHighScoreDetailVisible ? HIGH_SCORE_DETAIL_SUBTITLE : null;\n const currentDetailMaxLength = DETAIL_MAX_LENGTH;\n const currentDetailPlaceholder = DETAIL_PREFILL_TEMPLATE;\n const isDetailRequired = isLowScoreDetailVisible;\n const resetFeedbackState = useCallback(() => {\n resetFeedbackFormState();\n setIsDetailTooLong(false);\n setIsIssueRequiredError(false);\n setIsOtherIssueRequiredError(false);\n setIsDetailRequiredError(false);\n setIsSubmittingFeedback(false);\n }, [resetFeedbackFormState]);\n const closeFeedbackPopover = useCallback(() => {\n if (autoCloseFeedbackTimerRef.current != null) {\n window.clearTimeout(autoCloseFeedbackTimerRef.current);\n autoCloseFeedbackTimerRef.current = null;\n }\n if (mouseLeaveCloseTimerRef.current != null) {\n window.clearTimeout(mouseLeaveCloseTimerRef.current);\n mouseLeaveCloseTimerRef.current = null;\n }\n setFeedbackPopoverState({ isFeedbackOpen: false, isAutoOpenedFeedback: false });\n setFeedbackPopoverMaxHeight(null);\n resetFeedbackState();\n }, [resetFeedbackState, setFeedbackPopoverState]);\n const dismissFeedbackPopover = useCallback(() => {\n if (typeof window !== 'undefined') {\n window.localStorage.setItem(getFeedbackCloseStorageKey(), String(Date.now()));\n }\n closeFeedbackPopover();\n }, [closeFeedbackPopover]);\n const openFeedbackPopoverManually = useCallback(() => {\n if (autoCloseFeedbackTimerRef.current != null) {\n window.clearTimeout(autoCloseFeedbackTimerRef.current);\n autoCloseFeedbackTimerRef.current = null;\n }\n if (mouseLeaveCloseTimerRef.current != null) {\n window.clearTimeout(mouseLeaveCloseTimerRef.current);\n mouseLeaveCloseTimerRef.current = null;\n }\n setFeedbackPopoverState({ isFeedbackOpen: true, isAutoOpenedFeedback: false });\n }, [setFeedbackPopoverState]);\n const cancelMouseLeaveClose = useCallback(() => {\n if (mouseLeaveCloseTimerRef.current != null) {\n window.clearTimeout(mouseLeaveCloseTimerRef.current);\n mouseLeaveCloseTimerRef.current = null;\n }\n }, []);\n const scheduleMouseLeaveClose = useCallback(() => {\n if (selectedScoreRef.current != null) return;\n cancelMouseLeaveClose();\n mouseLeaveCloseTimerRef.current = window.setTimeout(() => {\n mouseLeaveCloseTimerRef.current = null;\n if (selectedScoreRef.current == null) {\n closeFeedbackPopover();\n }\n }, FEEDBACK_MOUSE_LEAVE_CLOSE_DELAY_MS);\n }, [cancelMouseLeaveClose, closeFeedbackPopover]);\n\n useEffect(() => {\n selectedScoreRef.current = selectedScore;\n }, [selectedScore]);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n if (getIsSkipAuth()) return;\n if (hasAttemptedFeedbackAutoOpenThisSession) return;\n\n const routeThreadId = getThreadIdFromPathname(pathname ?? '');\n if (!routeThreadId || routeThreadId !== currentThreadId) return;\n if (isLoadingHistory) return;\n if (!hasCompletedOneDialogueRound(messages)) return;\n\n hasAttemptedFeedbackAutoOpenThisSession = true;\n\n const dismissedAtRaw = window.localStorage.getItem(getFeedbackCloseStorageKey());\n const dismissedAt = dismissedAtRaw ? Number(dismissedAtRaw) : Number.NaN;\n if (Number.isFinite(dismissedAt) && isWithinDays(dismissedAt, FEEDBACK_CLOSE_SUPPRESS_DAYS)) {\n return;\n }\n\n const surveyId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_SURVEY_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_SURVEY_ID;\n const serviceId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_SERVICE_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_SERVICE_ID;\n const contactId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_CONTACT_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_CONTACT_ID;\n const userId = getFeedbackUserId();\n const query = new URLSearchParams({\n userId,\n surveyId,\n serviceId,\n contactId,\n });\n let cancelled = false;\n\n const fetchLatestFeedbackDate = async () => {\n try {\n const response = await fetch(`${FEEDBACK_DATE_ENDPOINT}?${query.toString()}`, {\n method: 'GET',\n });\n if (cancelled) return;\n if (!response.ok) {\n resetFeedbackState();\n setFeedbackPopoverState({ isFeedbackOpen: true, isAutoOpenedFeedback: true });\n return;\n }\n\n const payload = (await response.json()) as FeedbackDateResponse;\n if (cancelled) return;\n const latestFeedbackDate =\n typeof payload?.latest_feedback_date === 'string'\n ? payload.latest_feedback_date\n : typeof payload?.data === 'string'\n ? payload.data\n : typeof payload?.data?.latest_feedback_date === 'string'\n ? payload.data.latest_feedback_date\n : '';\n const latestFeedbackTimestamp = latestFeedbackDate ? parseFeedbackDate(latestFeedbackDate) : null;\n\n if (!latestFeedbackTimestamp || !isWithinDays(latestFeedbackTimestamp, FEEDBACK_RESURFACE_DAYS)) {\n resetFeedbackState();\n setFeedbackPopoverState({ isFeedbackOpen: true, isAutoOpenedFeedback: true });\n }\n } catch (error) {\n if (error instanceof DOMException && error.name === 'AbortError') {\n return;\n }\n resetFeedbackState();\n setFeedbackPopoverState({ isFeedbackOpen: true, isAutoOpenedFeedback: true });\n }\n };\n\n void fetchLatestFeedbackDate();\n\n return () => {\n cancelled = true;\n };\n }, [currentThreadId, isLoadingHistory, messages, pathname, resetFeedbackState, setFeedbackPopoverState]);\n\n useEffect(() => {\n if (isLowScoreDetailVisible) return;\n setIsIssueRequiredError(false);\n setIsOtherIssueRequiredError(false);\n }, [isLowScoreDetailVisible]);\n\n useEffect(() => {\n if ((isLowScoreDetailVisible || isHighScoreDetailVisible) && !lowScoreDetail.trim()) {\n setLowScoreDetail(DETAIL_PREFILL_TEMPLATE);\n setIsDetailTooLong(false);\n setIsDetailRequiredError(false);\n return;\n }\n\n if (!isLowScoreDetailVisible) {\n setIsDetailRequiredError(false);\n }\n }, [isHighScoreDetailVisible, isLowScoreDetailVisible, lowScoreDetail, setLowScoreDetail]);\n\n useEffect(() => {\n if (!isFeedbackOpen) return;\n\n const updatePopoverMaxHeight = () => {\n const buttonRect = smileActionRef.current?.getBoundingClientRect();\n if (!buttonRect) return;\n\n const contentBottom = window.innerHeight;\n const nextMaxHeight = Math.max(0, Math.floor(contentBottom - (buttonRect.bottom + 12) - 32));\n setFeedbackPopoverMaxHeight(nextMaxHeight);\n };\n\n updatePopoverMaxHeight();\n window.addEventListener('resize', updatePopoverMaxHeight);\n\n return () => {\n window.removeEventListener('resize', updatePopoverMaxHeight);\n };\n }, [isFeedbackOpen]);\n\n useEffect(() => {\n if (!isFeedbackOpen || !isAutoOpenedFeedback) return;\n\n autoCloseFeedbackTimerRef.current = window.setTimeout(() => {\n autoCloseFeedbackTimerRef.current = null;\n if (selectedScoreRef.current == null) {\n closeFeedbackPopover();\n }\n }, FEEDBACK_AUTO_CLOSE_DELAY_MS);\n\n return () => {\n if (autoCloseFeedbackTimerRef.current != null) {\n window.clearTimeout(autoCloseFeedbackTimerRef.current);\n autoCloseFeedbackTimerRef.current = null;\n }\n };\n }, [closeFeedbackPopover, isAutoOpenedFeedback, isFeedbackOpen]);\n\n const handleToggleIssue = (issue: string) => {\n const setCurrentIssues = isHighScoreDetailVisible ? setHighScoreSelectedIssues : setLowScoreSelectedIssues;\n setCurrentIssues((prev) => {\n let nextIssues = prev;\n if (prev.includes(issue)) {\n nextIssues = prev.filter((item) => item !== issue);\n } else if (prev.length < 3) {\n nextIssues = [...prev, issue];\n }\n\n if (!nextIssues.includes('other_issue')) {\n setIsOtherIssueRequiredError(false);\n }\n if (nextIssues.length > 0) {\n setIsIssueRequiredError(false);\n }\n\n return nextIssues;\n });\n };\n\n const handleDetailChange = useCallback(\n (value: string) => {\n if (value.length > currentDetailMaxLength) {\n setIsDetailTooLong(true);\n return;\n }\n setIsDetailTooLong(false);\n if (hasMeaningfulDetail(value)) {\n setIsDetailRequiredError(false);\n }\n setLowScoreDetail(value);\n },\n [currentDetailMaxLength, setLowScoreDetail],\n );\n\n const handleDetailFocus = useCallback(() => {\n if (!isLowScoreDetailVisible && !isHighScoreDetailVisible) return;\n if (lowScoreDetail.trim().length > 0) return;\n setLowScoreDetail(DETAIL_PREFILL_TEMPLATE);\n setIsDetailTooLong(false);\n setIsDetailRequiredError(false);\n }, [isHighScoreDetailVisible, isLowScoreDetailVisible, lowScoreDetail, setLowScoreDetail]);\n\n const handleOtherIssueDetailChange = useCallback((value: string) => {\n if (isHighScoreDetailVisible) {\n setHighScoreOtherIssueDetail(value);\n } else {\n setLowScoreOtherIssueDetail(value);\n }\n if (value.trim().length > 0) {\n setIsOtherIssueRequiredError(false);\n }\n }, [isHighScoreDetailVisible, setHighScoreOtherIssueDetail, setLowScoreOtherIssueDetail]);\n\n const handleSubmitFeedback = useCallback(async () => {\n if (!isLowScoreDetailVisible) {\n setIsIssueRequiredError(false);\n setIsOtherIssueRequiredError(false);\n }\n\n if (isSubmittingFeedback) return;\n if (selectedScore == null) {\n const message = '\\u8bf7\\u5148\\u9009\\u62e9\\u6ee1\\u610f\\u5ea6\\u8bc4\\u5206';\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message,\n duration: 3200,\n });\n return;\n }\n if (isLowScoreDetailVisible || isHighScoreDetailVisible) {\n const hasIssueSelection = currentSelectedIssues.length > 0;\n const needOtherIssueInput = currentSelectedIssues.includes('other_issue');\n const hasOtherIssueInput = currentOtherIssueDetail.trim().length > 0;\n const isDetailMissing = isDetailRequired && !hasMeaningfulDetail(lowScoreDetail);\n\n setIsIssueRequiredError(!hasIssueSelection);\n setIsOtherIssueRequiredError(needOtherIssueInput && !hasOtherIssueInput);\n setIsDetailRequiredError(isDetailMissing);\n\n if (!hasIssueSelection) {\n return;\n }\n if ((needOtherIssueInput && !hasOtherIssueInput) || isDetailMissing) {\n return;\n }\n }\n if (currentSelectedIssues.includes('other_issue') && currentOtherIssueDetail.length > OTHER_ISSUE_MAX_LENGTH) {\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message: OTHER_ISSUE_LENGTH_ERROR_MESSAGE,\n duration: 3200,\n });\n return;\n }\n if (lowScoreDetail.length > currentDetailMaxLength) {\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message: DETAIL_LENGTH_ERROR_MESSAGE,\n duration: 3200,\n });\n return;\n }\n\n const surveyId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_SURVEY_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_SURVEY_ID;\n const serviceId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_SERVICE_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_SERVICE_ID;\n const contactId = readPublicEnv('NEXT_PUBLIC_FEEDBACK_SAVE_CONTACT_ID')?.trim() || DEFAULT_FEEDBACK_SAVE_CONTACT_ID;\n const w3account = getFeedbackUserId();\n const scoreValue = String(selectedScore);\n const selectedIssueCodes = currentIssueOptions\n .map((issue, index) => (currentSelectedIssues.includes(issue.id) ? String(index) : ''))\n .filter(Boolean)\n .join(',');\n const selectedIssueLabels = currentIssueOptions\n .filter((issue) => currentSelectedIssues.includes(issue.id))\n .map((issue) => issue.label)\n .join(',');\n const detailText = hasMeaningfulDetail(lowScoreDetail) ? lowScoreDetail.trim() : '';\n const otherIssueReason = currentSelectedIssues.includes('other_issue')\n ? currentOtherIssueDetail.trim()\n : SCORE_REASON_DEFAULT_REASON;\n const scoreReasonQuestionId = selectedScore >= 9 ? HIGH_SCORE_REASON_QUESTION_ID : LOW_SCORE_REASON_QUESTION_ID;\n const answers: FeedbackSubmitAnswer[] = [\n {\n questionId: SCORE_QUESTION_ID,\n subQuestionId: null,\n subName: currentSurveyTitle,\n answer: scoreValue,\n subRemark: scoreValue,\n reason: SCORE_REASON_DEFAULT_REASON,\n },\n {\n questionId: scoreReasonQuestionId,\n subQuestionId: null,\n subName: currentPrimaryTitle,\n answer: selectedIssueCodes,\n subRemark: selectedIssueLabels,\n reason: otherIssueReason || SCORE_REASON_DEFAULT_REASON,\n },\n {\n questionId: DETAIL_QUESTION_ID,\n subQuestionId: null,\n subName: DETAIL_SUBMIT_TITLE,\n answer: detailText,\n subRemark: detailText ? DETAIL_DEFAULT_SUB_REMARK : '',\n reason: DETAIL_DEFAULT_REASON,\n },\n ];\n\n setIsSubmittingFeedback(true);\n try {\n const response = await fetch(FEEDBACK_SAVE_ENDPOINT, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json;charset=utf8' },\n body: JSON.stringify({\n data: {\n surveyId: surveyId,\n serviceId: serviceId,\n contactId: contactId,\n w3account,\n answers,\n },\n }),\n });\n\n let payload: FeedbackSubmitResponse | null = null;\n try {\n payload = (await response.json()) as FeedbackSubmitResponse;\n } catch {\n payload = null;\n }\n\n if (!response.ok) {\n const message =\n payload?.error_msg?.trim() ||\n payload?.errorMsg?.trim() ||\n payload?.message?.trim() ||\n payload?.msg?.trim() ||\n payload?.error?.trim() ||\n `\\u63d0\\u4ea4\\u5931\\u8d25\\uff08HTTP ${response.status}\\uff09`;\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message,\n duration: 4200,\n });\n return;\n }\n\n if (payload?.error_code || payload?.errorCode) {\n const message =\n payload?.error_msg?.trim() ||\n payload?.errorMsg?.trim() ||\n payload?.message?.trim() ||\n payload?.msg?.trim() ||\n payload?.error_code ||\n payload?.errorCode || '';\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message,\n duration: 4200,\n });\n return;\n }\n\n addToast({\n type: 'success',\n title: '\\u63d0\\u4ea4\\u6210\\u529f',\n message: '\\u611f\\u8c22\\u60a8\\u7684\\u53cd\\u9988',\n duration: 2600,\n });\n closeFeedbackPopover();\n } catch (error) {\n const message = error instanceof Error && error.message ? error.message : '\\u7f51\\u7edc\\u5f02\\u5e38';\n addToast({\n type: 'error',\n title: '\\u63d0\\u4ea4\\u5931\\u8d25',\n message,\n duration: 4200,\n });\n } finally {\n setIsSubmittingFeedback(false);\n }\n }, [\n addToast,\n currentDetailMaxLength,\n currentIssueOptions,\n currentSelectedIssues,\n currentPrimaryTitle,\n closeFeedbackPopover,\n isDetailRequired,\n isHighScoreDetailVisible,\n isLowScoreDetailVisible,\n isSubmittingFeedback,\n lowScoreDetail,\n currentOtherIssueDetail,\n selectedScore,\n ]);\n\n const dragStateRef = useRef<{ isDragging: boolean; startX: number; startY: number }>({\n isDragging: false,\n startX: 0,\n startY: 0,\n });\n\n const handleHeaderMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n // 只响应左键\n if (e.button !== 0) {\n return;\n }\n\n // 排除按钮点击\n if ((e.target as HTMLElement).closest('.ui-content-header-action')) {\n return;\n }\n\n // 排除弹窗区域\n if ((e.target as HTMLElement).closest('.ui-content-header-feedback-popover')) {\n return;\n }\n\n // 排除反馈锚点区域(笑脸按钮的容器)\n if ((e.target as HTMLElement).closest('.ui-content-header-feedback-anchor')) {\n return;\n }\n\n // 记录鼠标按下的位置,等待 mousemove\n dragStateRef.current = {\n isDragging: false,\n startX: e.clientX,\n startY: e.clientY,\n };\n },\n [],\n );\n\n const handleHeaderDoubleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n // 排除按钮点击\n if ((e.target as HTMLElement).closest('.ui-content-header-action')) {\n return;\n }\n\n // 排除弹窗区域\n if ((e.target as HTMLElement).closest('.ui-content-header-feedback-popover')) {\n return;\n }\n\n // 排除反馈锚点区域\n if ((e.target as HTMLElement).closest('.ui-content-header-feedback-anchor')) {\n return;\n }\n\n // 双击时切换最大化\n toggleMaximize();\n },\n [toggleMaximize],\n );\n\n // 监听全局 mousemove 和 mouseup\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n const state = dragStateRef.current;\n // 如果鼠标按下了,但还没开始拖动\n if (state.startX !== 0 && !state.isDragging) {\n // 计算鼠标移动距离\n const deltaX = Math.abs(e.clientX - state.startX);\n const deltaY = Math.abs(e.clientY - state.startY);\n // 如果移动超过 5px,认为是拖动意图\n if (deltaX > 5 || deltaY > 5) {\n state.isDragging = true;\n // 触发拖动\n startDrag();\n }\n }\n };\n\n const handleMouseUp = () => {\n // 重置状态\n dragStateRef.current = {\n isDragging: false,\n startX: 0,\n startY: 0,\n };\n };\n\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n\n return () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n };\n }, [startDrag]);\n\n return (\n <div\n ref={headerRef}\n className=\"ui-content-header\"\n data-testid=\"right-content-header\"\n onMouseDown={handleHeaderMouseDown}\n onDoubleClick={handleHeaderDoubleClick}\n >\n <div className=\"flex h-full min-w-0 flex-1 items-center\">\n {leftContent ?? (\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {threadTitle && (\n <OverflowTooltip content={threadTitle} className=\"min-w-0 max-w-full self-center h-full inline-flex items-center overflow-hidden\" placement=\"bottom\">\n <span\n data-testid=\"thread-title-label\"\n className=\"block w-full truncate whitespace-nowrap text-ellipsis text-[14px] font-medium leading-[2] text-[rgba(25,25,25,1)]\"\n >\n {threadTitle}\n </span>\n </OverflowTooltip>\n )}\n {shouldShowWorkspace && workspaceLabel && (\n <OverflowTooltip\n content=\"点击打开会话工作空间目录\"\n className=\"min-w-0 max-w-full self-center h-full inline-flex items-center shrink-0\"\n placement=\"bottom\"\n forceShow\n >\n <button\n type=\"button\"\n data-testid=\"thread-workspace-open-button\"\n onClick={handleOpenWorkspace}\n onMouseDown={(event) => event.stopPropagation()}\n aria-label={`打开工作空间 ${workspaceLabel}`}\n className=\"inline-flex h-6 max-w-full min-w-0 items-center gap-1.5 rounded bg-[rgba(245,245,245,1)] px-2 text-sm leading-none text-[var(--text-primary)] shadow-none outline-none transition-colors hover:text-[var(--text-accent)] focus-visible:ring-2 focus-visible:ring-[var(--text-accent)]\"\n >\n <HeaderWorkspaceIcon />\n <span className=\"leading-[2] max-[600px]:hidden truncate\">{workspaceLabel}</span>\n </button>\n </OverflowTooltip>\n )}\n </div>\n )}\n </div>\n <div className=\"ui-content-header-actions\">\n {routeThreadId !== null && (\n <><HeaderAction\n title={\n panelToggle\n ? panelToggle.isOpen\n ? panelToggle.closeLabel\n : panelToggle.openLabel\n : isFileBrowserOpen\n ? '关闭文件浏览'\n : '打开文件浏览'\n }\n onClick={panelToggle ? panelToggle.onToggle : handleToggleFileBrowser}\n >\n <RightPanelToggleIcon isOpen={panelToggle ? panelToggle.isOpen : isFileBrowserOpen} />\n </HeaderAction>\n <div className=\"ui-content-header-divider\" aria-hidden=\"true\" />\n </>\n )}\n <div\n className=\"ui-content-header-feedback-anchor\"\n onMouseEnter={cancelMouseLeaveClose}\n onMouseLeave={scheduleMouseLeaveClose}\n >\n <HeaderAction\n title={'\\u7b11\\u8138'}\n buttonRef={smileActionRef}\n aria-expanded={isFeedbackOpen}\n aria-controls={feedbackPopoverId}\n aria-haspopup=\"dialog\"\n onClick={openFeedbackPopoverManually}\n onMouseEnter={openFeedbackPopoverManually}\n >\n <WindowSmileIcon />\n </HeaderAction>\n {isFeedbackOpen ? (\n <div\n ref={feedbackPopoverRef}\n id={feedbackPopoverId}\n role=\"dialog\"\n aria-modal=\"false\"\n aria-label={'\\u6ee1\\u610f\\u5ea6\\u8bc4\\u5206'}\n style={{ height: 'auto' }}\n className={\n isScoreUnselected\n ? 'ui-content-header-feedback-popover ui-content-header-feedback-popover-compact'\n : 'ui-content-header-feedback-popover'\n }\n >\n <div\n className=\"ui-content-header-feedback-popover-content\"\n style={{ maxHeight: feedbackPopoverMaxHeight != null ? `${feedbackPopoverMaxHeight}px` : undefined }}\n >\n <div className=\"ui-content-header-feedback-popover-header\">\n <p className=\"ui-content-header-feedback-popover-title\">\n {currentSurveyTitle}\n </p>\n <button\n type=\"button\"\n aria-label={'\\u5173\\u95ed\\u6ee1\\u610f\\u5ea6\\u8bc4\\u4ef7\\u5f39\\u7a97'}\n className=\"ui-content-header-feedback-popover-close\"\n onClick={dismissFeedbackPopover}\n >\n <PopoverCloseIcon />\n </button>\n </div>\n <div className=\"ui-content-header-feedback-popover-body\">\n <div className=\"ui-content-header-feedback-score-row\">\n {SATISFACTION_SCORES.map((score) => (\n <button\n key={score}\n type=\"button\"\n onClick={() => setSelectedScore(score)}\n aria-label={`\\u8bc4\\u5206 ${score}`}\n aria-pressed={selectedScore === score}\n className={\n selectedScore === score\n ? 'ui-content-header-feedback-score ui-content-header-feedback-score-selected'\n : 'ui-content-header-feedback-score'\n }\n >\n {selectedScore === score ? (\n <span className=\"flex h-full w-full items-center justify-center\">\n <img\n src={getSelectedScoreIconSrc(score) ?? ''}\n alt=\"\"\n aria-hidden=\"true\"\n width={24}\n height={24}\n className=\"h-6 w-6 object-contain\"\n />\n </span>\n ) : (\n score\n )}\n </button>\n ))}\n </div>\n {isLowScoreDetailVisible || isHighScoreDetailVisible ? (\n <div className=\"ui-content-header-feedback-low-score\">\n <div className=\"ui-content-header-feedback-low-score-section\">\n <p className=\"ui-content-header-feedback-low-score-title\">\n {currentPrimaryTitle}\n <span className=\"ui-content-header-feedback-low-score-subtitle\">\n {currentPrimarySubtitle}\n </span>\n </p>\n <div className=\"ui-content-header-feedback-low-score-options\">\n {currentIssueOptions.map((issue) => {\n const isChecked = currentSelectedIssues.includes(issue.id);\n const isDisabled = !isChecked && currentSelectedIssues.length >= 3;\n return (\n <label\n key={issue.id}\n className={\n isDisabled\n ? 'ui-content-header-feedback-low-score-option ui-content-header-feedback-low-score-option-disabled'\n : 'ui-content-header-feedback-low-score-option'\n }\n >\n <input\n type=\"checkbox\"\n checked={isChecked}\n disabled={isDisabled}\n onChange={() => handleToggleIssue(issue.id)}\n />\n <span className=\"ui-content-header-feedback-low-score-option-content\">\n <span className=\"ui-content-header-feedback-low-score-option-label\">{issue.label}</span>\n {issue.hint ? (\n <span className=\"ui-content-header-feedback-low-score-option-hint\">{issue.hint}</span>\n ) : null}\n </span>\n </label>\n );\n })}\n </div>\n {isOtherIssueSelected ? (\n <>\n <input\n type=\"text\"\n className=\"ui-input\"\n placeholder={'\\u662f\\u4ec0\\u4e48\\u95ee\\u9898\\u5462\\uff1f\\u8bf7\\u7b80\\u8981\\u8bf4\\u660e'}\n value={currentOtherIssueDetail}\n onChange={(event) => handleOtherIssueDetailChange(event.target.value)}\n />\n {isOtherIssueRequiredError ? (\n <p className=\"ui-content-header-feedback-other-error\">\n {REQUIRED_INPUT_ERROR_MESSAGE}\n </p>\n ) : isOtherIssueTooLong ? (\n <p className=\"ui-content-header-feedback-other-error\">\n {OTHER_ISSUE_LENGTH_ERROR_MESSAGE}\n </p>\n ) : null}\n </>\n ) : null}\n {isIssueRequiredError ? (\n <p className=\"ui-content-header-feedback-other-error\">\n {REQUIRED_SELECT_ERROR_MESSAGE}\n </p>\n ) : null}\n </div>\n <div className=\"ui-content-header-feedback-low-score-section\">\n <p className=\"ui-content-header-feedback-low-score-title\">\n {currentDetailTitle}\n {currentDetailSubtitle ? (\n <span className=\"ui-content-header-feedback-low-score-subtitle\">{currentDetailSubtitle}</span>\n ) : null}\n </p>\n <div className=\"ui-content-header-feedback-detail-shell\">\n <textarea\n className=\"ui-textarea ui-content-header-feedback-detail-input\"\n placeholder={currentDetailPlaceholder}\n value={lowScoreDetail}\n onFocus={handleDetailFocus}\n onChange={(event) => handleDetailChange(event.target.value)}\n />\n <span className=\"ui-content-header-feedback-detail-counter\">\n {lowScoreDetail.length}/{currentDetailMaxLength}\n </span>\n </div>\n {isDetailRequiredError ? (\n <p className=\"ui-content-header-feedback-detail-error\">\n {REQUIRED_INPUT_ERROR_MESSAGE}\n </p>\n ) : isDetailTooLong ? (\n <p className=\"ui-content-header-feedback-detail-error\">\n {DETAIL_LENGTH_ERROR_MESSAGE}\n </p>\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n {isLowScoreDetailVisible || isHighScoreDetailVisible ? (\n <div className=\"ui-content-header-feedback-low-score-actions\">\n <Button variant=\"default\"\n onClick={closeFeedbackPopover}\n >\n {'\\u53d6\\u6d88'}\n </Button>\n <Button variant=\"major\"\n onClick={() => void handleSubmitFeedback()}\n disabled={isSubmittingFeedback}\n >\n {isSubmittingFeedback ? '\\u63d0\\u4ea4\\u4e2d...' : '\\u63d0\\u4ea4'}\n </Button>\n </div>\n ) : null}\n </div>\n <div className=\"ui-content-header-feedback-popover-arrow\" aria-hidden=\"true\" />\n </div>\n ) : null}\n </div>\n <div className=\"ui-content-header-divider\" data-testid=\"right-content-header-divider\" aria-hidden=\"true\" />\n <HeaderAction title={'\\u6700\\u5c0f\\u5316'} onClick={minimize}>\n <WindowMinimizeIcon />\n </HeaderAction>\n <HeaderAction title={isMaximized ? '\\u8fd8\\u539f' : '\\u6700\\u5927\\u5316'} onClick={toggleMaximize} disabled={!canMaximize}>\n {isMaximized ? <WindowRestoreIcon /> : <WindowMaximizeIcon />}\n </HeaderAction>\n <HeaderAction title={'\\u5173\\u95ed'} onClick={close}>\n <WindowCloseIcon />\n </HeaderAction>\n </div>\n </div>\n );\n}\n"],"names":["resolveUpdater","updater","prev","useFeedbackPopoverStore","create","set","next","selectedScore","state","lowScoreDetail","lowScoreOtherIssueDetail","highScoreOtherIssueDetail","hasAttemptedFeedbackAutoOpenThisSession","WindowSmileIcon","jsxs","jsx","WindowMinimizeIcon","WindowMaximizeIcon","WindowRestoreIcon","WindowCloseIcon","PopoverCloseIcon","HeaderWorkspaceIcon","HeaderAction","title","children","buttonRef","buttonProps","RightPanelToggleIcon","isOpen","SATISFACTION_SCORES","_","index","LOW_SCORE_ISSUE_OPTIONS","HIGH_SCORE_ISSUE_OPTIONS","FEEDBACK_DATE_ENDPOINT","FEEDBACK_SAVE_ENDPOINT","FEEDBACK_CLOSE_TIME_KEY","FEEDBACK_CLOSE_SUPPRESS_DAYS","FEEDBACK_RESURFACE_DAYS","FEEDBACK_AUTO_CLOSE_DELAY_MS","FEEDBACK_MOUSE_LEAVE_CLOSE_DELAY_MS","DEFAULT_FEEDBACK_SAVE_SURVEY_ID","DEFAULT_FEEDBACK_SAVE_SERVICE_ID","DEFAULT_FEEDBACK_SAVE_CONTACT_ID","SCORE_QUESTION_ID","LOW_SCORE_REASON_QUESTION_ID","HIGH_SCORE_REASON_QUESTION_ID","DETAIL_QUESTION_ID","SCORE_REASON_DEFAULT_REASON","DETAIL_DEFAULT_SUB_REMARK","DETAIL_DEFAULT_REASON","OTHER_ISSUE_MAX_LENGTH","OTHER_ISSUE_LENGTH_ERROR_MESSAGE","DETAIL_MAX_LENGTH","DETAIL_LENGTH_ERROR_MESSAGE","DETAIL_PREFILL_TEMPLATE","REQUIRED_SELECT_ERROR_MESSAGE","REQUIRED_INPUT_ERROR_MESSAGE","LOW_SCORE_PRIMARY_TITLE","HIGH_SCORE_PRIMARY_TITLE","PRIMARY_SUBTITLE","LOW_SCORE_DETAIL_TITLE","DETAIL_SUBMIT_TITLE","HIGH_SCORE_DETAIL_TITLE","HIGH_SCORE_DETAIL_SUBTITLE","hasMeaningfulDetail","value","normalizedValue","getSelectedScoreIconSrc","score","parseFeedbackDate","normalized","timestamp","isWithinDays","days","getThreadIdFromPathname","pathname","match","getFolderNameFromPath","path","segments","hasCompletedOneDialogueRound","messages","hasUserMessage","hasAssistantMessage","message","getFeedbackUserId","_a","readPublicEnv","getDomainId","getFeedbackCloseStorageKey","domainId","__resetFeedbackAutoOpenSessionForTests","__resetFeedbackPopoverStateForTests","RightContentHeader","leftContent","panelToggle","isMaximized","canMaximize","minimize","toggleMaximize","close","startDrag","useDesktopWindowControls","useLocation","currentThreadId","useChatStore","s","threads","rightPanelMode","openFileBrowserPanel","setRightPanelMode","isFileBrowserOpen","handleToggleFileBrowser","useCallback","isLoadingHistory","isFeedbackOpen","isAutoOpenedFeedback","lowScoreSelectedIssues","highScoreSelectedIssues","setFeedbackPopoverState","setSelectedScore","setLowScoreSelectedIssues","setHighScoreSelectedIssues","setLowScoreDetail","setLowScoreOtherIssueDetail","setHighScoreOtherIssueDetail","resetFeedbackFormState","feedbackPopoverMaxHeight","setFeedbackPopoverMaxHeight","useState","isDetailTooLong","setIsDetailTooLong","isIssueRequiredError","setIsIssueRequiredError","isOtherIssueRequiredError","setIsOtherIssueRequiredError","isDetailRequiredError","setIsDetailRequiredError","isSubmittingFeedback","setIsSubmittingFeedback","addToast","useToastStore","headerRef","useRef","smileActionRef","feedbackPopoverRef","autoCloseFeedbackTimerRef","mouseLeaveCloseTimerRef","selectedScoreRef","feedbackPopoverId","useId","isScoreUnselected","isLowScoreDetailVisible","isHighScoreDetailVisible","currentIssueOptions","currentSelectedIssues","currentOtherIssueDetail","routeThreadId","currentThread","thread","threadTitle","normalizeStoredThreadTitle","workspacePath","shouldShowWorkspace","workspaceLabel","handleOpenWorkspace","res","apiFetch","data","error","isOtherIssueSelected","isOtherIssueTooLong","currentSurveyTitle","currentPrimaryTitle","currentPrimarySubtitle","currentDetailTitle","currentDetailSubtitle","currentDetailMaxLength","currentDetailPlaceholder","isDetailRequired","resetFeedbackState","closeFeedbackPopover","dismissFeedbackPopover","openFeedbackPopoverManually","cancelMouseLeaveClose","scheduleMouseLeaveClose","useEffect","getIsSkipAuth","dismissedAtRaw","dismissedAt","surveyId","serviceId","_b","contactId","_c","userId","query","cancelled","response","payload","latestFeedbackDate","latestFeedbackTimestamp","updatePopoverMaxHeight","buttonRect","contentBottom","nextMaxHeight","handleToggleIssue","issue","nextIssues","item","handleDetailChange","handleDetailFocus","handleOtherIssueDetailChange","handleSubmitFeedback","hasIssueSelection","needOtherIssueInput","hasOtherIssueInput","isDetailMissing","w3account","scoreValue","selectedIssueCodes","selectedIssueLabels","detailText","otherIssueReason","scoreReasonQuestionId","answers","_d","_e","_f","_g","_h","_i","_j","_k","_l","dragStateRef","handleHeaderMouseDown","handleHeaderDoubleClick","handleMouseMove","e","deltaX","deltaY","handleMouseUp","OverflowTooltip","event","Fragment","isChecked","isDisabled","Button"],"mappings":"gOAYA,SAASA,GAAkBC,EAAqBC,EAAY,CAC1D,OAAO,OAAOD,GAAY,WAAcA,EAA2BC,CAAI,EAAID,CAC7E,CAsBO,MAAME,EAA0BC,GAA8BC,IAAS,CAC5E,eAAgB,GAChB,qBAAsB,GACtB,cAAe,KACf,uBAAwB,CAAA,EACxB,wBAAyB,CAAA,EACzB,eAAgB,GAChB,yBAA0B,GAC1B,0BAA2B,GAC3B,wBAA0BC,GAASD,EAAIC,CAAI,EAC3C,0BAA2B,IACzBD,EAAI,CACF,eAAgB,GAChB,qBAAsB,EAAA,CACvB,EACH,iBAAmBE,GAAkBF,EAAI,CAAE,cAAAE,EAAe,EAC1D,0BAA4BD,GAC1BD,EAAKG,IAAW,CAAE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