@xopcai/xopc 0.0.460 → 0.0.462

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 (264) hide show
  1. package/dist/browser-ext/dist/assets/{pcm-capture-worklet-CGN9Mlhg.js → pcm-capture-worklet-Df5TcFw4.js} +4 -2
  2. package/dist/browser-ext/dist/sidepanel.js +3 -2
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/extensions/telegram/xopc.extension.json +1 -1
  5. package/dist/gateway/static/root/assets/{agents-CGUdvmIT.js → agents-DC0lHtl5.js} +3 -3
  6. package/dist/gateway/static/root/assets/{apps-page-M2XD1Pzu.js → apps-page-QLOYw2QR.js} +1 -1
  7. package/dist/gateway/static/root/assets/{automation-task-card-CiJmJ7_h.js → automation-task-card-CJbIHRxN.js} +1 -1
  8. package/dist/gateway/static/root/assets/{automations-page-CVjgENMO.js → automations-page-DpKnqajR.js} +1 -1
  9. package/dist/gateway/static/root/assets/{automations-workspace-CGPWyL0P.js → automations-workspace-BXT_EDON.js} +2 -2
  10. package/dist/gateway/static/root/assets/{block-editor-CmnkluMF.js → block-editor-DrZyRQQ0.js} +5 -5
  11. package/dist/gateway/static/root/assets/{capabilities-DDqDvCBs.js → capabilities-Dr-vvMez.js} +1 -1
  12. package/dist/gateway/static/root/assets/capabilities-hSb-qEgL.js +1 -0
  13. package/dist/gateway/static/root/assets/capabilities-page-CnU0htlO.js +2 -0
  14. package/dist/gateway/static/root/assets/{capabilities-settings-panel-CvF8VRTv.js → capabilities-settings-panel-B08mjrGB.js} +1 -1
  15. package/dist/gateway/static/root/assets/{channels-BDVQ6Z7A.js → channels-B--IHNs4.js} +1 -1
  16. package/dist/gateway/static/root/assets/{chat-chart-block-stPJEZ90.js → chat-chart-block-ClCZyIi0.js} +1 -1
  17. package/dist/gateway/static/root/assets/chat-page-U2a7d6wP.js +71 -0
  18. package/dist/gateway/static/root/assets/{chat-terminal-dock-B4uA_W6R.js → chat-terminal-dock-eneTvxV3.js} +1 -1
  19. package/dist/gateway/static/root/assets/{connectors-page-DyzDVVfz.js → connectors-page-Bs29RvXz.js} +1 -1
  20. package/dist/gateway/static/root/assets/constants-Bg1wM2nv.js +1 -0
  21. package/dist/gateway/static/root/assets/diagnostics-Bo0Z42P_.js +1 -0
  22. package/dist/gateway/static/root/assets/{extension-debug-page-BPwRrP3L.js → extension-debug-page-Bn_5xu_M.js} +1 -1
  23. package/dist/gateway/static/root/assets/{extension-iframe-host-DIH4TcdH.js → extension-iframe-host-Vs6USa0c.js} +1 -1
  24. package/dist/gateway/static/root/assets/{extension-message-router-C9JDpo_7.js → extension-message-router-GIekDj_w.js} +1 -1
  25. package/dist/gateway/static/root/assets/{extension-page-CLDoL5N8.js → extension-page-C_3bIjSB.js} +1 -1
  26. package/dist/gateway/static/root/assets/{extension-provider-BPIoHw4r.js → extension-provider-D-LolObs.js} +1 -1
  27. package/dist/gateway/static/root/assets/{extension-settings-page-BO_UKeG8.js → extension-settings-page-BV51dk16.js} +1 -1
  28. package/dist/gateway/static/root/assets/home-page-DefKShSW.js +8 -0
  29. package/dist/gateway/static/root/assets/index-CChzK_5b.css +1 -0
  30. package/dist/gateway/static/root/assets/index-CEBDMkde.js +11 -0
  31. package/dist/gateway/static/root/assets/{local-app-workbench-page-D8oqDDAn.js → local-app-workbench-page-CfnixDO3.js} +1 -1
  32. package/dist/gateway/static/root/assets/{markdown-view-BlxIaCCQ.js → markdown-view-CNJaAdNN.js} +39 -39
  33. package/dist/gateway/static/root/assets/note-detail-panel-D_l5jkV9.js +7 -0
  34. package/dist/gateway/static/root/assets/note-image-lightbox-D6mvMSKr.js +1 -0
  35. package/dist/gateway/static/root/assets/{notes-api-CdXA-g9r.js → notes-api-BOIM9Q_D.js} +1 -1
  36. package/dist/gateway/static/root/assets/notes-page-R4uJroeD.js +8 -0
  37. package/dist/gateway/static/root/assets/{page-context-capture-button-Dibmspef.js → page-context-capture-button-B_Vdo2Ai.js} +1 -1
  38. package/dist/gateway/static/root/assets/pcm-capture-worklet-CpXsv44v.js +1 -0
  39. package/dist/gateway/static/root/assets/{personal-page-BwfyW7Hx.js → personal-page-BsONyPfQ.js} +1 -1
  40. package/dist/gateway/static/root/assets/{personal-profile-settings-CQhZjoK6.js → personal-profile-settings-C4CxmQLQ.js} +1 -1
  41. package/dist/gateway/static/root/assets/{personal-settings-panel-peD05ktj.js → personal-settings-panel-CnxI2TL0.js} +1 -1
  42. package/dist/gateway/static/root/assets/{product-automation-feedback-D51I7Lg3.js → product-automation-feedback-CGso8wGv.js} +1 -1
  43. package/dist/gateway/static/root/assets/{product-preview-content-WkF2j_c-.js → product-preview-content-Dgtb4LF7.js} +1 -1
  44. package/dist/gateway/static/root/assets/product-preview-modal-C35EWUps.js +2 -0
  45. package/dist/gateway/static/root/assets/project-detail-page-xNSy6SAv.js +7 -0
  46. package/dist/gateway/static/root/assets/recording-upload-CFX7CANT.js +1 -0
  47. package/dist/gateway/static/root/assets/route-preload-Dwb_N8L-.js +2 -0
  48. package/dist/gateway/static/root/assets/routine-panel-KH1VaEdC.js +2 -0
  49. package/dist/gateway/static/root/assets/session-manager-63NaXb1s.js +25 -0
  50. package/dist/gateway/static/root/assets/{settings-page-BHImcF1q.js → settings-page-8MiJzbbl.js} +1 -1
  51. package/dist/gateway/static/root/assets/{share-preview-page-fV5USZb1.js → share-preview-page-Cqy-7-rd.js} +1 -1
  52. package/dist/gateway/static/root/assets/{shares-settings-sl40lqND.js → shares-settings-BDr50uTV.js} +1 -1
  53. package/dist/gateway/static/root/assets/{skills-page-FTd0Z7Ey.js → skills-page-DReUQ4Ug.js} +1 -1
  54. package/dist/gateway/static/root/assets/star-CnYNmpLd.js +1 -0
  55. package/dist/gateway/static/root/assets/task-detail-page-DxKXoBbE.js +3 -0
  56. package/dist/gateway/static/root/assets/{task-result-evidence-CSJeB9AH.js → task-result-evidence-CW_tN93T.js} +1 -1
  57. package/dist/gateway/static/root/assets/{use-composer-attachments-CO7XLI4x.js → use-composer-attachments-Xn6eUus2.js} +1 -1
  58. package/dist/gateway/static/root/assets/{use-file-preview-expanded-BXXeXnT0.js → use-file-preview-expanded-D0IBFhM9.js} +1 -1
  59. package/dist/gateway/static/root/assets/use-realtime-voice-B5IsKrRW.js +1 -0
  60. package/dist/gateway/static/root/assets/{use-workspace-tree-D27u-eoX.js → use-workspace-tree-7X2ydgS8.js} +1 -1
  61. package/dist/gateway/static/root/assets/{voice-settings-BiqJ0tlf.js → voice-settings-57pwZeKD.js} +1 -1
  62. package/dist/gateway/static/root/assets/workspace-api-Dd_UDfeo.js +2 -0
  63. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-NffP-UXC.js → workspace-file-preview-dialog-Clj9hMj5.js} +1 -1
  64. package/dist/gateway/static/root/assets/{workspace-preview-store-Do31QQH5.js → workspace-preview-store-imhtuEIP.js} +1 -1
  65. package/dist/gateway/static/root/index.html +27 -26
  66. package/dist/package.js +1 -1
  67. package/dist/packages/gateway-contract/src/follow-ups.js +97 -0
  68. package/dist/packages/gateway-contract/src/home.js +1 -0
  69. package/dist/packages/gateway-contract/src/index.js +4 -0
  70. package/dist/packages/gateway-contract/src/observation-starters.js +95 -0
  71. package/dist/packages/gateway-contract/src/observation.js +7 -0
  72. package/dist/packages/gateway-contract/src/task-research-result.js +3 -0
  73. package/dist/src/agent/agent-manager.d.ts +1 -1
  74. package/dist/src/agent/background-review/prompts.d.ts +1 -0
  75. package/dist/src/agent/background-review/prompts.js +7 -1
  76. package/dist/src/agent/background-review/run-background-review.js +85 -7
  77. package/dist/src/agent/coding/run-verification.d.ts +14 -7
  78. package/dist/src/agent/coding/run-verification.js +28 -6
  79. package/dist/src/agent/context/coordinator.js +1 -1
  80. package/dist/src/agent/context/deep-recall.js +1 -1
  81. package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
  82. package/dist/src/agent/embedded/execution-tool-policy.js +4 -2
  83. package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
  84. package/dist/src/agent/embedded/run-for-session.js +9 -0
  85. package/dist/src/agent/embedded/run-turn.js +63 -14
  86. package/dist/src/agent/embedded/types.d.ts +2 -0
  87. package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -0
  88. package/dist/src/agent/inbound/turn-dispatcher.js +1 -0
  89. package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
  90. package/dist/src/agent/service/direct-turn-helpers.js +17 -2
  91. package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
  92. package/dist/src/agent/service/process-direct-streaming.js +1 -0
  93. package/dist/src/agent/service.d.ts +1 -1
  94. package/dist/src/agent/tasks/task-judge-service.js +1 -0
  95. package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
  96. package/dist/src/agent/tool-manuals/browser.js +3 -1
  97. package/dist/src/agent/tools/factory.d.ts +1 -1
  98. package/dist/src/agent/tools/factory.js +1 -1
  99. package/dist/src/agent/tools/personal-request-tool.js +36 -4
  100. package/dist/src/agent/tools/personal-task-tool.d.ts +7 -1
  101. package/dist/src/agent/tools/personal-task-tool.js +68 -3
  102. package/dist/src/agent/tools/session-search-tool.js +1 -1
  103. package/dist/src/agent/tools/task-collaboration-tool.d.ts +1 -1
  104. package/dist/src/agent/tools/task-collaboration-tool.js +54 -3
  105. package/dist/src/agent/tools/task-result-tool.js +31 -0
  106. package/dist/src/agent/tools/xopc-use-tool.js +50 -19
  107. package/dist/src/automations/capabilities/write.d.ts +2 -2
  108. package/dist/src/automations/domain/validation.d.ts +4 -4
  109. package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
  110. package/dist/src/browser/drivers/browser-driver.d.ts +1 -0
  111. package/dist/src/browser/drivers/create-driver.js +2 -11
  112. package/dist/src/browser/drivers/playwright-driver.d.ts +5 -2
  113. package/dist/src/browser/drivers/playwright-driver.js +83 -38
  114. package/dist/src/browser/runtime/browser-runtime.d.ts +5 -0
  115. package/dist/src/browser/runtime/browser-runtime.js +71 -9
  116. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  117. package/dist/src/computer/diagnostics.d.ts +4 -4
  118. package/dist/src/computer/errors.d.ts +4 -4
  119. package/dist/src/computer/evaluation.d.ts +3 -3
  120. package/dist/src/computer/flows.d.ts +1 -1
  121. package/dist/src/computer/runtime.d.ts +3 -3
  122. package/dist/src/config/schema.d.ts +6 -2
  123. package/dist/src/config/schema.js +3 -0
  124. package/dist/src/connectors/connected-source-understanding.js +11 -3
  125. package/dist/src/connectors/learning-coordinator.js +45 -11
  126. package/dist/src/discussions/recording.js +13 -6
  127. package/dist/src/endpoint-tools/device-host.d.ts +2 -2
  128. package/dist/src/gateway/hono/lib/config-payload.d.ts +4 -0
  129. package/dist/src/gateway/hono/routes/home.js +52 -1
  130. package/dist/src/gateway/hono/routes/projects.js +1 -1
  131. package/dist/src/gateway/hono/routes/session-command-handler.js +15 -1
  132. package/dist/src/gateway/hono/routes/user-model.js +1 -1
  133. package/dist/src/gateway/service/agent-runner.d.ts +2 -8
  134. package/dist/src/gateway/service/agent-runner.js +1 -0
  135. package/dist/src/gateway/service/config-coordinator.d.ts +5 -1
  136. package/dist/src/gateway/service/run-gateway-agent.d.ts +13 -8
  137. package/dist/src/gateway/service/run-gateway-agent.js +5 -2
  138. package/dist/src/gateway/service/session-input-coordinator.d.ts +4 -0
  139. package/dist/src/gateway/service/session-input-coordinator.js +6 -1
  140. package/dist/src/gateway/service.d.ts +1 -0
  141. package/dist/src/gateway/service.js +8 -1
  142. package/dist/src/home-intelligence/follow-ups.d.ts +36 -0
  143. package/dist/src/home-intelligence/follow-ups.js +496 -0
  144. package/dist/src/home-intelligence/host.d.ts +80 -4
  145. package/dist/src/home-intelligence/host.js +122 -2
  146. package/dist/src/home-intelligence/observation-starters.d.ts +3 -0
  147. package/dist/src/home-intelligence/observation-starters.js +27 -0
  148. package/dist/src/home-intelligence/observation.d.ts +1 -1
  149. package/dist/src/home-intelligence/observation.js +16 -4
  150. package/dist/src/local-apps/automation-proposals.d.ts +4 -4
  151. package/dist/src/local-apps/capabilities/projections.d.ts +38 -38
  152. package/dist/src/memory-learning/choice-observations.d.ts +9 -0
  153. package/dist/src/memory-learning/choice-observations.js +155 -0
  154. package/dist/src/memory-learning/evidence-repair.d.ts +12 -0
  155. package/dist/src/memory-learning/evidence-repair.js +31 -0
  156. package/dist/src/memory-learning/repository.d.ts +1 -0
  157. package/dist/src/memory-learning/repository.js +43 -5
  158. package/dist/src/memory-learning/source-learning.js +52 -7
  159. package/dist/src/memory-learning/task-receipts.js +19 -10
  160. package/dist/src/memory-learning/transcript-source.js +7 -0
  161. package/dist/src/memory-learning/work-candidate.d.ts +14 -0
  162. package/dist/src/memory-learning/work-candidate.js +17 -2
  163. package/dist/src/memory-learning/work-capture.d.ts +1 -0
  164. package/dist/src/memory-learning/work-capture.js +28 -10
  165. package/dist/src/memory-learning/work-review.d.ts +46 -0
  166. package/dist/src/memory-learning/work-review.js +209 -0
  167. package/dist/src/notes/agent-context.js +1 -1
  168. package/dist/src/personal-agent/communication.d.ts +1 -1
  169. package/dist/src/personal-agent/communication.js +1 -1
  170. package/dist/src/personal-agent/default-style.d.ts +1 -1
  171. package/dist/src/personal-agent/default-style.js +1 -1
  172. package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
  173. package/dist/src/personal-agent/prompts.js +4 -4
  174. package/dist/src/personal-agent/reply-composer.d.ts +1 -1
  175. package/dist/src/personal-agent/reply-composer.js +52 -34
  176. package/dist/src/personal-agent/reply-style.d.ts +2 -2
  177. package/dist/src/personal-agent/reply-style.js +3 -2
  178. package/dist/src/personal-agent/request-repository.d.ts +3 -0
  179. package/dist/src/personal-agent/request-service.d.ts +2 -0
  180. package/dist/src/personal-agent/request-service.js +8 -2
  181. package/dist/src/phone/contracts.d.ts +1 -1
  182. package/dist/src/projects/capabilities/write.js +1 -1
  183. package/dist/src/projects/index.js +1 -1
  184. package/dist/src/projects/project-service.js +1 -1
  185. package/dist/src/storage/sqlite/schema.d.ts +2 -2
  186. package/dist/src/storage/sqlite/schema.js +7 -7
  187. package/dist/src/storage/sqlite/schema.sql +22 -0
  188. package/dist/src/storage/sqlite/upgrades/274_home_followups.sql +21 -0
  189. package/dist/src/tasks/capabilities/management.d.ts +3 -3
  190. package/dist/src/tasks/capabilities/relations.d.ts +3 -3
  191. package/dist/src/tasks/capabilities/write.d.ts +4 -4
  192. package/dist/src/tasks/capabilities/write.js +2 -0
  193. package/dist/src/tasks/home-query-service.js +4 -2
  194. package/dist/src/tasks/task-allocation-service.js +10 -2
  195. package/dist/src/tasks/task-application-service.d.ts +4 -0
  196. package/dist/src/tasks/task-application-service.js +6 -1
  197. package/dist/src/tasks/task-context-assembler.js +7 -2
  198. package/dist/src/tasks/task-contract-planner.js +3 -3
  199. package/dist/src/tasks/task-conversation-summary.d.ts +64 -0
  200. package/dist/src/tasks/task-conversation-summary.js +105 -0
  201. package/dist/src/tasks/task-delay-notice.d.ts +4 -0
  202. package/dist/src/tasks/task-delay-notice.js +113 -0
  203. package/dist/src/tasks/task-deletion-service.js +6 -1
  204. package/dist/src/tasks/task-handoff.d.ts +21 -0
  205. package/dist/src/tasks/task-handoff.js +77 -1
  206. package/dist/src/tasks/task-json-acceptance.d.ts +22 -0
  207. package/dist/src/tasks/task-json-acceptance.js +96 -0
  208. package/dist/src/tasks/task-main-update-decision-service.js +17 -21
  209. package/dist/src/tasks/task-main-update-delivery.js +34 -7
  210. package/dist/src/tasks/task-notification-preference.d.ts +16 -0
  211. package/dist/src/tasks/task-notification-preference.js +42 -0
  212. package/dist/src/tasks/task-origin-repository.d.ts +1 -0
  213. package/dist/src/tasks/task-origin-repository.js +3 -0
  214. package/dist/src/tasks/task-read-model-projector.js +1 -1
  215. package/dist/src/tasks/task-repository.js +1 -0
  216. package/dist/src/tasks/task-research-repair.d.ts +19 -1
  217. package/dist/src/tasks/task-research-repair.js +14 -4
  218. package/dist/src/tasks/task-research-result.d.ts +12 -0
  219. package/dist/src/tasks/task-research-result.js +5 -0
  220. package/dist/src/tasks/task-result-delivery-repository.d.ts +4 -1
  221. package/dist/src/tasks/task-result-delivery-repository.js +8 -5
  222. package/dist/src/tasks/task-result-delivery-service.js +9 -1
  223. package/dist/src/tasks/task-run-coordinator.js +45 -10
  224. package/dist/src/usage/cloud-wire.d.ts +1 -0
  225. package/dist/src/user-context/config.d.ts +8 -0
  226. package/dist/src/user-context/config.js +10 -0
  227. package/dist/src/user-model/capture/evidence-policy.d.ts +2 -0
  228. package/dist/src/user-model/capture/evidence-policy.js +8 -1
  229. package/dist/src/user-model/capture/executor.js +16 -4
  230. package/dist/src/user-model/capture/semantic.d.ts +4 -0
  231. package/dist/src/user-model/capture/semantic.js +3 -0
  232. package/dist/src/user-model/index.js +1 -1
  233. package/dist/src/user-model/observation-repository.d.ts +6 -0
  234. package/dist/src/user-model/observation-repository.js +12 -0
  235. package/dist/src/user-model/repository.js +10 -1
  236. package/dist/src/voice/realtime/agentEngine.js +29 -7
  237. package/dist/src/voice/realtime/pcmPlaybackEcho.d.ts +10 -0
  238. package/dist/src/voice/realtime/pcmPlaybackEcho.js +56 -0
  239. package/dist/src/voice/realtime/playback-echo.d.ts +3 -0
  240. package/dist/src/voice/realtime/playback-echo.js +35 -5
  241. package/dist/src/voice/realtime/runtime.js +6 -1
  242. package/dist/src/voice/realtime/turnPolicy.js +1 -1
  243. package/package.json +14 -8
  244. package/dist/gateway/static/root/assets/capabilities-DB713nRi.js +0 -1
  245. package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +0 -2
  246. package/dist/gateway/static/root/assets/chat-page-BhPw56Vc.js +0 -71
  247. package/dist/gateway/static/root/assets/constants-DpkUgykJ.js +0 -1
  248. package/dist/gateway/static/root/assets/discussion-annotation-sync-fwPPMPv9.js +0 -1
  249. package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +0 -7
  250. package/dist/gateway/static/root/assets/index-DjzrnmBA.js +0 -11
  251. package/dist/gateway/static/root/assets/index-YQxumvaS.css +0 -1
  252. package/dist/gateway/static/root/assets/note-detail-panel-BbHlfAju.js +0 -7
  253. package/dist/gateway/static/root/assets/note-image-lightbox-CqK_uJ6Y.js +0 -1
  254. package/dist/gateway/static/root/assets/notes-page-8w2Stfak.js +0 -8
  255. package/dist/gateway/static/root/assets/pcm-capture-worklet-uW_SEACy.js +0 -1
  256. package/dist/gateway/static/root/assets/product-preview-modal-DMHOKocl.js +0 -2
  257. package/dist/gateway/static/root/assets/project-detail-page-CNFuzmRr.js +0 -7
  258. package/dist/gateway/static/root/assets/recording-upload-CyZSl2DJ.js +0 -1
  259. package/dist/gateway/static/root/assets/route-preload-CuxNu-LB.js +0 -2
  260. package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +0 -2
  261. package/dist/gateway/static/root/assets/session-manager-D2LaQymu.js +0 -25
  262. package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +0 -3
  263. package/dist/gateway/static/root/assets/use-realtime-voice-C7iWQuUv.js +0 -1
  264. package/dist/gateway/static/root/assets/workspace-api-LghfbP5g.js +0 -2
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,l as s,n as c,o as l}from"./locale-store-Dy1EByeG.js";import{t as u}from"./messages-BAnhwALN.js";import{n as d,r as f}from"./popover-select-CLsphyzA.js";import{t as p}from"./secret-input-DsjfQmDn.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{t as h}from"./mic-CuUb7zc-.js";import{t as g}from"./play-kxZvpBg8.js";import{t as _}from"./square-DMK_fB-3.js";import{t as v}from"./volume-2-BSJhAY97.js";import{t as y}from"./cn-0WouolD0.js";import{t as b}from"./skeleton-DzdOeGYz.js";import{a as x,c as S,i as C,m as w,n as T,p as E,u as D}from"./schemas-CCWMleym.js";import{n as O}from"./voice-CDlC6XMH.js";import{i as k}from"./vendor-swr-CdRzEUwF.js";import{n as A,r as j}from"./gateway-config-swr-1Rk0LeEM.js";import{t as M}from"./button-Cc4hUNTt.js";import{t as N}from"./open-capability-settings-DQsmJxI7.js";import{a as P,d as F,f as I,i as L,o as R,p as z,t as B,u as V}from"./use-realtime-voice-C7iWQuUv.js";import{t as H}from"./voice-call-context-BM2A4bLz.js";import{a as U,o as ee,s as te}from"./form-field-width-DJw_jULe.js";import{t as ne}from"./secret-input-labels-B5Jl5HqK.js";import{n as W}from"./model-sort-_Tz8s_4N.js";import{r as G}from"./model-selector-C-CqPBao.js";import{t as K}from"./settings-loading-skeleton-CAoOV17i.js";import{a as re,i as q}from"./capability-navigation-QtHJxxW2.js";import{t as J}from"./number-input-El7Szeln.js";import{n as ie,t as ae}from"./use-autosave-N_SjHXTw.js";import{a as oe,c as se,d as ce,f as le,g as ue,h as de,i as fe,l as pe,n as me,o as he,p as Y,r as ge,t as _e,u as ve}from"./voice-config-api-DhJ3l8fk.js";import{t as ye}from"./voice-api-key-field-B_GApUQP.js";var be=E({"zh-CN":w().min(1).optional(),en:w().min(1).optional()}),xe=T([`transcription`,`transcription.stream`,`speech`,`speech.stream`,`conversation`]),Se=E({protocolVersion:S(1),serviceVersion:D().int().positive(),modes:C(xe),transport:S(`websocket-pcm`),inputFormat:E({encoding:S(`pcm_s16le`),sampleRate:S(16e3),channels:S(1)}),outputFormat:E({encoding:S(`pcm_s16le`),sampleRate:S(24e3),channels:S(1)}),turnDetection:C(S(`server_vad`)),bargeIn:x(),tools:x(),resumable:S(!1),voices:C(E({id:w().min(1),name:w(),displayNames:be.optional(),languages:C(w()),gender:T([`female`,`male`]).optional(),style:w().optional(),description:w().optional(),modes:C(xe).optional()})),defaultVoice:w().min(1).optional(),limits:E({maxFrameBytes:D().int().positive().max(65536),maxSessionSeconds:D().int().positive()})});function Ce(e,t){return e.modes===void 0||e.modes.includes(t)}var we=E({mode:xe,model:w().min(1).max(200),voice:w().min(1).max(200).optional()}),Te=E({revision:w().min(1),catalogVersion:w().nullable(),selections:C(we),models:C(E({id:w(),name:w(),displayNames:be.optional(),voice:Se}))}),X=n(),Z=e(t(),1),Q=r();function Ee({disabled:e=!1,modes:t,onPendingChange:n}){let r=c(e=>e.language),i=r===`zh`,[a,s]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>(n?.(a),()=>n?.(!1)),[a,n]);let[u,p]=(0,Z.useState)(``),{data:m,mutate:h,error:g}=k(o(`/api/voice/catalog`),async e=>{let t=await l(e);return Te.parse(t.payload)}),_=i?{transcription:`录音转文字`,"transcription.stream":`实时听写 / 语音助手输入`,speech:`消息朗读`,"speech.stream":`语音助手输出`,conversation:`自然语音对话`}:{transcription:`Recorded transcription`,"transcription.stream":`Live dictation / assistant input`,speech:`Message readout`,"speech.stream":`Assistant speech`,conversation:`Natural conversation`},v=async e=>{if(m){s(!0),p(``);try{let t=await l(o(e?`/api/voice/selection`:`/api/voice/catalog/refresh`),{method:e?`PUT`:`POST`,...e?{body:JSON.stringify({revision:m.revision,selection:e})}:{}});await h(Te.parse(t.payload),!1),await A()}catch(e){p(e instanceof Error?e.message:String(e)),await h()}finally{s(!1)}}};return(0,Q.jsxs)(`section`,{className:`space-y-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:i?`XOPC 托管语音模型`:`XOPC managed voice models`}),(0,Q.jsx)(M,{variant:`secondary`,disabled:a||e||!m,onClick:()=>void v(),children:i?`刷新目录`:`Refresh catalog`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`修改在下次调用生效。各设备共用此 Gateway 的配置。`:`Changes apply to the next call and are shared across devices.`}),u||g?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600`,children:u||String(g)}):null,m?(0,Q.jsx)(Q.Fragment,{children:t.map(t=>{let n=m.selections.find(e=>e.mode===t),o=m.models.filter(e=>e.voice.modes.includes(t)).sort(W),s=o.find(e=>e.id===n?.model),c=s?.voice.voices.filter(e=>Ce(e,t))??[],l=n?.voice??c.find(e=>e.id===s?.voice.defaultVoice)?.id??c[0]?.id??``;return(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:_[t]}),(0,Q.jsxs)(d,{className:`w-full`,value:n?.model??``,disabled:a||e||!o.length,onChange:e=>void v({mode:t,model:e.target.value}),children:[(0,Q.jsx)(f,{value:``,disabled:!0,children:i?`选择模型`:`Choose model`}),n&&!s?(0,Q.jsxs)(f,{value:n.model,disabled:!0,children:[n.model,` · `,i?`不可用`:`Unavailable`]}):null,o.map(e=>(0,Q.jsx)(f,{value:e.id,children:G(e,r)},e.id))]}),o.length?null:(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i?`暂无可用模型`:`No available model`})]}),s&&c.length>0?(0,Q.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:i?`音色`:`Voice`}),(0,Q.jsxs)(d,{className:`w-full`,value:l,disabled:a||e,onChange:e=>void v({mode:t,model:s.id,voice:e.target.value}),children:[n?.voice&&!c.some(e=>e.id===n.voice)?(0,Q.jsxs)(f,{value:n.voice,disabled:!0,children:[n.voice,` · `,i?`当前场景不可用`:`Unavailable for this mode`]}):null,c.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,r),e.gender?` · ${i?e.gender===`female`?`女声`:`男声`:e.gender}`:``,e.style?` · ${e.style}`:``]},e.id))]}),c.find(e=>e.id===l)?.description?(0,Q.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:c.find(e=>e.id===l)?.description}):null]}):null]},t)})}):(0,Q.jsx)(b,{className:`h-48 w-full`})]})}function De({v:e}){let t=I(e=>e.microphoneId),n=I(e=>e.setMicrophoneId),[r,i]=(0,Z.useState)([]),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),l=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{l.current=!0;let e=()=>{navigator.mediaDevices?.enumerateDevices().then(e=>{l.current&&i(e.filter(e=>e.kind===`audioinput`))}).catch(()=>{})};return e(),navigator.mediaDevices?.addEventListener(`devicechange`,e),()=>{l.current=!1,navigator.mediaDevices?.removeEventListener(`devicechange`,e)}},[]);let u=async()=>{c(!0),o(``);try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop());let e=await navigator.mediaDevices.enumerateDevices();l.current&&i(e.filter(e=>e.kind===`audioinput`))}catch(e){l.current&&o(e instanceof Error?e.message:String(e))}finally{l.current&&c(!1)}};return(0,Q.jsxs)(`section`,{className:`space-y-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:e.experience.microphone}),(0,Q.jsxs)(d,{value:t,onChange:e=>n(e.target.value),children:[(0,Q.jsx)(f,{value:``,children:e.experience.systemDevice}),t&&!r.some(e=>e.deviceId===t)?(0,Q.jsx)(f,{value:t,children:e.experience.unavailable}):null,r.filter(e=>e.deviceId&&e.deviceId!=="default").map((t,n)=>(0,Q.jsx)(f,{value:t.deviceId,children:t.label||`${e.experience.microphone} ${n+1}`},t.deviceId))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.experience.deviceHint}),(0,Q.jsx)(M,{variant:`secondary`,disabled:s,onClick:()=>void u(),children:e.experience.refreshDevices}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600`,children:a}):null]})}var Oe=(0,Z.createContext)(null);function ke(e){let t=(0,X.c)(18),n,r;t[0]===e?(n=t[1],r=t[2]):({to:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let[o]=i(),s=(0,Z.useContext)(Oe),c,l;t[3]===r?(c=t[4],l=t[5]):(c=new URLSearchParams(r.split(`?`)[1]??``),l=q(c.get(`configure`)),t[3]=r,t[4]=c,t[5]=l);let u=l,d;t[6]!==s||t[7]!==n||t[8]!==c||t[9]!==u?(d=e=>{n.onClick?.(e),!e.defaultPrevented&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&s&&u&&c.get(`tab`)===`services`&&(e.preventDefault(),s(u))},t[6]=s,t[7]=n,t[8]=c,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==o||t[12]!==r?(f=re(r,o),t[11]=o,t[12]=r,t[13]=f):f=t[13];let p;return t[14]!==n||t[15]!==d||t[16]!==f?(p=(0,Q.jsx)(a,{...n,onClick:d,to:f}),t[14]=n,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Ae(e){let t=(0,X.c)(19),{zh:n}=e,{data:r,error:i,mutate:a}=k(`voice-dictation-route`,je),o,s;t[0]===a?(o=t[1],s=t[2]):(o=()=>{let e=()=>{a()};return window.addEventListener(`voice-config-changed`,e),window.addEventListener(`config-reload`,e),()=>{window.removeEventListener(`voice-config-changed`,e),window.removeEventListener(`config-reload`,e)}},s=[a],t[0]=a,t[1]=o,t[2]=s),(0,Z.useEffect)(o,s);let c=n?`同时用于聊天听写`:`Also used for chat dictation`,l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(`h2`,{className:`font-medium text-fg`,children:c}),t[3]=c,t[4]=l);let u=n?`默认与录音识别共用模型。已有的独立听写设置会保留。`:`Dictation shares this recognition model. Existing separate dictation settings are preserved.`,d;t[5]===u?d=t[6]:(d=(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:u}),t[5]=u,t[6]=d);let f;t[7]!==r||t[8]!==i||t[9]!==n?(f=!r&&!i?(0,Q.jsx)(b,{className:`h-5 w-64 max-w-full`}):(0,Q.jsx)(`p`,{role:i?`alert`:`status`,className:`text-fg-muted`,children:i?n?`暂时无法读取听写状态。`:`Dictation status could not be loaded.`:r?.mode===`recorded`?n?`当前使用 ${r.provider},点击完成后转为文字。`:`Using ${r.provider}. Choose Finish to transcribe.`:r?.mode===`streaming`?n?`当前使用流式识别${r.provider?` · ${r.provider}`:``}。`:`Using streaming recognition${r.provider?` · ${r.provider}`:``}.`:n?`听写未就绪,请检查识别模型或已有的流式配置。`:`Check the recognition model or existing streaming configuration.`}),t[7]=r,t[8]=i,t[9]=n,t[10]=f):f=t[10];let p;t[11]!==r?.mode||t[12]!==n?(p=r?.mode===`recorded`?null:(0,Q.jsx)(ke,{className:`inline-block text-accent-fg hover:underline`,to:`/settings/capabilities/models?tab=services&configure=transcription`,children:n?`管理识别服务`:`Manage recognition services`}),t[11]=r?.mode,t[12]=n,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl border border-edge p-4 text-sm`,children:[l,d,f,p]}),t[14]=l,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function je(){return L(AbortSignal.timeout(15e3))}function Me({v:e,canListen:t,canSpeak:n,disabled:r,onVerified:i}){let a=e.setup,o=(0,Z.useContext)(H)?.active??!1,[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),p=(0,Z.useRef)(`idle`),v=(0,Z.useRef)(null),y=(0,Z.useRef)(!1),b=e=>{p.current=e,c(e)},x=()=>{v.current?.(),v.current=null};(0,Z.useEffect)(()=>()=>v.current?.(),[]);async function S(e){x(),i?.({input:!1,output:!1}),y.current=!1,u(``),f(``),b(e?`connecting`:`playing`);let t=new AbortController,r,o,s,c,l=()=>{o?.cancel(),r?.getTracks().forEach(e=>e.stop()),s?.stop(`surface_closed`)},d=window.setTimeout(()=>m(a.timeout),6e4);v.current=()=>{t.abort(),window.clearTimeout(d),l(),c?.close()};function m(e){t.signal.aborted||(b(`error`),f(e),x())}async function h(){b(`playing`),l();try{let e=await ce(t.signal);if(t.signal.aborted)return;c?.enqueue(e,()=>{t.signal.aborted||(window.clearTimeout(d),b(`confirm`))})}catch(e){m(e instanceof Error?e.message:a.testFailed)}}try{if(n&&(c=new V,await c.start(),t.signal.throwIfAborted()),!e){await h();return}let d=window.electronAPI?.system;if(d){let e=await d.requestMicrophone();if(t.signal.throwIfAborted(),e.status===`denied`)throw Error(a.microphoneDenied)}if(r=await navigator.mediaDevices.getUserMedia({audio:z()}),t.signal.aborted){l();return}if(s=await F.connect({purpose:`dictation`,signal:t.signal,onEvent:e=>{t.signal.aborted||(e.type===`session.error`&&m(a.testFailed),p.current===`listening`&&(e.type===`input.transcript.delta`&&u(e.payload.text),e.type===`input.transcript.final`&&e.payload.text.trim()&&(u(e.payload.text.trim()),y.current=!0,n?h():(b(`passed`),i?.({input:!0,output:!1}),x()))))},onClose:()=>{(p.current===`listening`||p.current===`connecting`)&&m(a.testFailed)}}),t.signal.aborted){l();return}let f;if(o=await P.start(r,{onSamples:e=>{f&&!t.signal.aborted&&s?.sendAudio(f.push(e))}}),t.signal.aborted){l();return}f=new R(o.sampleRate,s.session.inputFormat.sampleRate),b(`listening`)}catch(e){if(t.signal.aborted){l();return}m(e instanceof Error?e.message:a.testFailed)}}let C=s===`connecting`||s===`listening`||s===`playing`;return(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(M,{type:`button`,variant:`primary`,disabled:o||r||!t||C,onClick:()=>void S(!0),children:[C?(0,Q.jsx)(m,{className:`size-4 animate-spin`}):(0,Q.jsx)(h,{className:`size-4`}),n?a.test:a.testInput]}),(0,Q.jsxs)(M,{type:`button`,variant:`secondary`,disabled:o||r||!n||C,onClick:()=>void S(!1),children:[(0,Q.jsx)(g,{className:`size-4`}),e.tts.test.play]}),C?(0,Q.jsxs)(M,{type:`button`,variant:`ghost`,onClick:()=>{x(),b(`idle`)},children:[(0,Q.jsx)(_,{className:`size-4`}),e.tts.test.stop]}):null]}),(0,Q.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`space-y-2 text-xs text-fg-muted`,children:[s===`idle`?(0,Q.jsx)(`p`,{children:o?e.experience.endCallBeforeTest:r?a.saveBeforeTest:a.microphoneHint}):null,s===`connecting`?(0,Q.jsx)(`p`,{children:a.connecting}):null,s===`listening`?(0,Q.jsx)(`p`,{children:a.speakNow}):null,l?(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-base p-3 text-sm text-fg`,children:l}):null,s===`playing`?(0,Q.jsx)(`p`,{children:a.playing}):null,s===`confirm`?(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{children:a.heardQuestion}),(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:()=>{x(),i?.({input:y.current,output:!0}),b(`passed`)},children:a.heard}),(0,Q.jsx)(M,{type:`button`,variant:`ghost`,onClick:()=>{x(),b(`error`),f(a.notHeard)},children:a.notHeardButton})]}):null,s===`passed`?(0,Q.jsx)(`p`,{children:y.current?n?a.passed:a.inputPassed:a.outputPassed}):null,s===`error`?(0,Q.jsx)(`p`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:d}):null]})]})}function Ne(e){let t=(0,X.c)(78),{section:n,v:r,form:i,pending:a,onChange:s}=e,l=c(Re),u=r.setup,p;t[0]===i?p=t[1]:(p=JSON.stringify(i),t[0]=i,t[1]=p);let m=p,h;t[2]===m?h=t[3]:(h={signature:m,input:!1,output:!1},t[2]=m,t[3]=h);let[g,_]=(0,Z.useState)(h);g.signature!==m&&_({signature:m,input:!1,output:!1});let v;t[4]!==a||t[5]!==m?(v=a?null:[`voice-realtime-status`,m],t[4]=a,t[5]=m,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={revalidateOnFocus:!0},t[7]=y):y=t[7];let{data:x,error:S,isLoading:C}=k(v,ge,y),w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=o(`/api/voice/catalog`),t[8]=w):w=t[8];let{data:T}=k(w,Le),E=i.voice.realtime,D=E.tts,O=D?.provider??x?.tts?.provider,A=x?.tts?.model,j;t[9]!==A||t[10]!==O?(j=O&&A?[`realtime-voices`,O,A]:null,t[9]=A,t[10]=O,t[11]=j):j=t[11];let M;t[12]!==A||t[13]!==O?(M=()=>fe(O,A,`realtime`),t[12]=A,t[13]=O,t[14]=M):M=t[14];let N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N={revalidateOnFocus:!1},t[15]=N):N=t[15];let{data:P}=k(j,M,N),F;t[16]===P?F=t[17]:(F=P===void 0?[]:P,t[16]=P,t[17]=F);let I=F,L=I,R;t[18]===I?R=t[19]:(R=I.filter(Ie),t[18]=I,t[19]=R);let z=R,B=E.defaultEngine===`omni`,V=B?E.omni?.voice??``:D?.voice??``,H;t[20]!==T?.models||t[21]!==B||t[22]!==z||t[23]!==E.omni||t[24]!==L?(H=B&&E.omni?.provider===`qwen-token-plan-cn`?[{id:E.omni.voice,name:E.omni.voice}]:B?E.omni?.provider===`xopc-cloud`?T?.models.find(e=>e.id===E.omni?.model)?.voice.voices.filter(Fe)??[]:z.length?z:[`Cherry`,`Ethan`,`Serena`,`Chelsie`].map(Pe):L,t[20]=T?.models,t[21]=B,t[22]=z,t[23]=E.omni,t[24]=L,t[25]=H):H=t[25];let U=H,te=!!(x?.enabled&&x.stt),ne=!!(x?.enabled&&x.tts),W;t[26]!==i||t[27]!==s||t[28]!==E?(W=e=>s({...i,voice:{...i.voice,realtime:{...E,...e}}}),t[26]=i,t[27]=s,t[28]=E,t[29]=W):W=t[29];let K=W,re;t[30]!==a||t[31]!==E.enabled||t[32]!==u.disabled||t[33]!==u.needsSetup||t[34]!==u.pending||t[35]!==u.unverified||t[36]!==u.verified||t[37]!==m||t[38]!==g.signature?(re=(e,t)=>E.enabled?a?u.pending:e?t&&g.signature===m?u.verified:u.unverified:u.needsSetup:u.disabled,t[30]=a,t[31]=E.enabled,t[32]=u.disabled,t[33]=u.needsSetup,t[34]=u.pending,t[35]=u.unverified,t[36]=u.verified,t[37]=m,t[38]=g.signature,t[39]=re):re=t[39];let q=re,J;t[40]!==V||t[41]!==l||t[42]!==B||t[43]!==O||t[44]!==E.bargeIn||t[45]!==E.defaultEngine||t[46]!==E.enabled||t[47]!==E.omni||t[48]!==E.tts||t[49]!==u.bargeIn||t[50]!==u.defaultVoice||t[51]!==u.enable||t[52]!==u.voice||t[53]!==n||t[54]!==D||t[55]!==x?.tts||t[56]!==K||t[57]!==r.experience||t[58]!==r.realtime||t[59]!==U?(J=n===`listening`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-sm font-medium text-fg`,children:[(0,Q.jsx)(`span`,{children:u.enable}),(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":E.enabled,className:`ui-checkbox`,checked:E.enabled,onChange:e=>K({enabled:e.target.checked})})]}),(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:r.experience.defaultMode}),(0,Q.jsxs)(d,{value:E.defaultEngine,className:ee,onChange:e=>K({defaultEngine:e.target.value}),children:[(0,Q.jsx)(f,{value:`auto`,children:l===`zh`?`自动选择`:`Automatic`}),(0,Q.jsx)(f,{value:`agent`,children:r.experience.assistant}),(0,Q.jsx)(f,{value:`omni`,children:r.experience.natural})]})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[E.defaultEngine===`agent`?r.experience.assistantHint:r.experience.naturalHint,` `,r.experience.nextCall]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`realtime-voice`,className:`text-sm font-medium text-fg`,children:u.voice}),(0,Q.jsxs)(d,{id:`realtime-voice`,className:`${ee} w-full sm:w-56`,value:V,disabled:B?!E.omni:!D&&!x?.tts,onChange:e=>{if(B&&E.omni){K({omni:{...E.omni,voice:e.target.value}});return}if(O===`alibaba`||O===`xopc-cloud`){let t={...E.tts,provider:O};e.target.value?t.voice=e.target.value:delete t.voice,K({tts:t})}},children:[B?null:(0,Q.jsx)(f,{value:``,children:u.defaultVoice}),V&&!U.some(e=>e.id===V)?(0,Q.jsx)(f,{value:V,children:V}):null,U.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,l),`gender`in e&&e.gender?` · ${e.gender===`female`?`女声`:`男声`}`:``,`style`in e&&e.style?` · ${e.style}`:``]},e.id))]}),(()=>{let e=U.find(e=>e.id===V);return e&&`description`in e&&typeof e.description==`string`?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.description}):null})()]}),(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-4 text-sm text-fg`,children:[(0,Q.jsxs)(`span`,{children:[u.bargeIn,(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:r.realtime.bargeInDescription})]}),(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":E.bargeIn,checked:E.bargeIn,className:`size-4 accent-accent`,onChange:e=>K({bargeIn:e.target.checked})})]})]}):null,t[40]=V,t[41]=l,t[42]=B,t[43]=O,t[44]=E.bargeIn,t[45]=E.defaultEngine,t[46]=E.enabled,t[47]=E.omni,t[48]=E.tts,t[49]=u.bargeIn,t[50]=u.defaultVoice,t[51]=u.enable,t[52]=u.voice,t[53]=n,t[54]=D,t[55]=x?.tts,t[56]=K,t[57]=r.experience,t[58]=r.realtime,t[59]=U,t[60]=J):J=t[60];let ie;t[61]!==te||t[62]!==ne||t[63]!==S||t[64]!==C||t[65]!==a||t[66]!==n||t[67]!==m||t[68]!==x||t[69]!==q||t[70]!==r||t[71]!==g.input||t[72]!==g.output?(ie=n===`diagnostics`?(0,Q.jsxs)(Q.Fragment,{children:[C?(0,Q.jsx)(b,{className:`h-16 w-full`}):(0,Q.jsxs)(`div`,{className:`space-y-2 text-sm`,role:`status`,children:[(0,Q.jsxs)(`p`,{children:[r.experience.dictationReady,` · `,q(te,g.input)]}),(0,Q.jsxs)(`p`,{children:[r.experience.agentReady,` · `,q(te&&ne,g.input&&g.output)]}),(0,Q.jsxs)(`p`,{children:[r.experience.omniReady,` · `,q(!!(x?.enabled&&x.omni),!1)]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.experience.configurationOnly}),(0,Q.jsx)(Me,{v:r,canListen:te,canSpeak:ne,disabled:a||C||!!S,onVerified:e=>_({signature:m,...e})},`${m}:${JSON.stringify(x)}`)]}):null,t[61]=te,t[62]=ne,t[63]=S,t[64]=C,t[65]=a,t[66]=n,t[67]=m,t[68]=x,t[69]=q,t[70]=r,t[71]=g.input,t[72]=g.output,t[73]=ie):ie=t[73];let ae;return t[74]!==u.service||t[75]!==J||t[76]!==ie?(ae=(0,Q.jsxs)(`section`,{className:`space-y-5 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":u.service,children:[J,ie]}),t[74]=u.service,t[75]=J,t[76]=ie,t[77]=ae):ae=t[77],ae}function Pe(e){return{id:e,name:e}}function Fe(e){return Ce(e,`conversation`)}function Ie(e){return[`Cherry`,`Ethan`,`Serena`,`Chelsie`].includes(e.id)}async function Le(e){return Te.parse((await l(e)).payload)}function Re(e){return e.language}function ze(e){let t=(0,X.c)(19),{value:n,onChange:r}=e,i=c(Be)===`zh`,a=i?`通话指令`:`Conversation instructions`,o;t[0]===a?o=t[1]:(o=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:a}),t[0]=a,t[1]=o);let s=i?`通话会接续当前会话。可在这里调整语气与回答方式。`:`Calls continue the current conversation. Adjust tone and response style here.`,l;t[2]===s?l=t[3]:(l=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s}),t[2]=s,t[3]=l);let u=i?`通话指令`:`Conversation instructions`,d;t[4]===u?d=t[5]:(d=(0,Q.jsx)(`span`,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==r||t[7]!==n?(f=e=>r({...n,instructions:e.target.value}),t[6]=r,t[7]=n,t[8]=f):f=t[8];let p;t[9]!==f||t[10]!==n.instructions?(p=(0,Q.jsx)(`textarea`,{className:`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,rows:3,maxLength:8e3,value:n.instructions,onChange:f}),t[9]=f,t[10]=n.instructions,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==o||t[16]!==l||t[17]!==m?(h=(0,Q.jsxs)(`details`,{className:`space-y-3 rounded-xl bg-surface-hover/20 p-4`,children:[o,l,m]}),t[15]=o,t[16]=l,t[17]=m,t[18]=h):h=t[18],h}function Be(e){return e.language}function Ve({disabled:e=!1}){let t=c(e=>e.language),n=t===`zh`,{data:r,error:i,mutate:s}=k(o(_e),me),[l,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(0),_=(0,Z.useId)();(0,Z.useLayoutEffect)(()=>{g(e=>e+1)},[]);let[v,y]=(0,Z.useState)(),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(``),[T,E]=(0,Z.useState)(!1),D=B({disabled:e||x,chat:u(t).chat,onTranscript:()=>{},onTestAudioPlayed:()=>E(!0)}),j=D.phase!==`idle`&&D.phase!==`error`,P=v??r?.voice??`default`,F=r?.credentialSource===`global`;async function I(){try{return await Y()}catch(e){throw e instanceof Error&&`status`in e&&e.status===404?Error(n?`当前 Gateway 版本不支持查看密钥。请更新并重启 Gateway。`:`Update and restart the Gateway to view or copy the saved key.`):e}}async function L(e){if(!(x||j)){S(!0),w(``);try{await s(await de(e),{revalidate:!1}),`apiKey`in e&&(m(``),g(e=>e+1),E(!1),D.cancelVoiceInput()),await A()}catch(e){w(e instanceof Error?e.message:String(e))}finally{S(!1)}}}return(0,Q.jsxs)(`section`,{className:`@container space-y-3 rounded-xl border border-edge bg-surface-panel p-4`,"aria-label":`Boson AI`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Boson AI · Higgs Realtime`}),!r&&!i?(0,Q.jsx)(b,{className:`h-24 w-full`}):null,i?(0,Q.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[n?`无法读取 Boson 设置。`:`Could not load Boson settings.`,(0,Q.jsx)(M,{variant:`ghost`,onClick:()=>void s(),children:n?`重试`:`Retry`})]}):null,r&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`fieldset`,{disabled:e||x||j,className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`label`,{htmlFor:_,className:`text-sm font-medium text-fg`,children:`Boson API Key`}),(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:r.credentialSource===`env`?n?`已从环境读取 BOSON_API_KEY`:`Using BOSON_API_KEY from the environment`:r.credentialSource?n?`已保存 API Key`:`API key saved`:n?`尚未连接`:`Connection needed`})]}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-2 @min-[32rem]:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,Q.jsx)(p,{id:_,value:l||(F?`••••••••••••`:``),onChange:e=>m(e.replace(/^•+/u,``)),autoComplete:`new-password`,inputClassName:`min-h-11`,labels:{show:n?`显示密钥`:`Show key`,hide:n?`隐藏密钥`:`Hide key`,copy:n?`复制密钥`:`Copy key`,copied:n?`已复制`:`Copied`},reveal:F?I:void 0,allowUnrevealedCopy:!0,loadFailedLabel:n?`无法查看已保存的密钥。`:`Could not load the saved key.`,notInConfigFile:n?`当前没有已保存的密钥。`:`There is no saved key.`},`${F}:${h}`),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(M,{className:`min-h-11`,variant:`secondary`,type:`button`,disabled:!l.trim(),onClick:()=>void L({apiKey:l}),children:x?n?`正在保存…`:`Saving…`:n?`保存密钥`:`Save key`}),F&&(0,Q.jsx)(M,{className:`min-h-11`,type:`button`,variant:`ghost`,onClick:()=>void L({apiKey:null}),children:n?`移除已保存密钥`:`Remove saved key`})]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:n?`Higgs 默认音色`:`Default Higgs voice`}),(0,Q.jsx)(d,{"aria-label":n?`Higgs 默认音色`:`Default Higgs voice`,value:P,onChange:e=>{y(e.target.value),E(!1),D.cancelVoiceInput()},children:O.map(e=>(0,Q.jsx)(f,{value:e,children:e==="default"?n?`模型默认`:`Model default`:e},e))})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:P===r.voice||!r.credentialSource,onClick:()=>void L({voice:P}),children:n?`保存音色`:`Save voice`}),(0,Q.jsx)(`span`,{className:`text-sm text-fg-muted`,children:r.defaultForNatural?n?`当前全局自然语音模型`:`Current global natural voice model`:n?`在上方选择全局自然语音模型`:`Choose the global natural voice model above`})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-2 border-t border-edge pt-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n?`测试时请说一句中文,听到回复后可以插话。音频由 Boson 处理,测试内容仅在当前面板显示,可能产生用量。`:`Say a sentence and try interrupting the reply. Boson processes the audio. Test content stays in this panel and may incur usage.`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[j?(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:D.cancelVoiceInput,children:n?`结束测试`:`End test`}):(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:e||x||!r.credentialSource,onClick:()=>{D.cancelVoiceInput(),E(!1),w(``),D.startHiggsTest(P)},children:n?`测试通话`:`Test call`}),r.credentialSource&&!e&&!x&&!j&&(0,Q.jsx)(a,{className:`px-2 text-sm text-accent-fg hover:underline`,to:`/personal`,onClick:N,children:n?`打开 Ada`:`Open Ada`})]}),j&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:D.phase===`recording`?D.responsePhase===`speaking`?n?`正在播放,可以插话`:`Playing reply. You can interrupt.`:n?`麦克风已开启,请说话`:`Microphone on. Say something.`:n?`正在连接测试通话…`:`Connecting test call…`}),T&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-success`,children:n?`测试通过,已播放回复`:`Test passed. Reply played.`}),D.finalTranscript&&(0,Q.jsxs)(`p`,{className:`text-sm text-fg`,children:[n?`转写 · `:`Transcript · `,D.finalTranscript]}),D.responseText&&(0,Q.jsxs)(`p`,{className:`text-sm text-fg`,children:[n?`回复 · `:`Reply · `,D.responseText]})]})]}),(C||D.error)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:C||D.error})]})}var He=U;function Ue(){return y(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,te,`dark:border-edge`)}function $(){return y(ee,U)}function We(e){return!e||e<=0?``:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ge(e,t){let n=window.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return URL.createObjectURL(new Blob([r],{type:t}))}function Ke(e,t){switch(e){case`xopc-cloud`:return t.setup.hosted;case`openai`:return t.stt.openai;case`alibaba`:return t.stt.alibaba;case`groq`:return`Groq`;default:return e}}function qe(e,t){switch(e){case`xopc-cloud`:return t.setup.hosted;case`openai`:return t.tts.providerOpenai;case`alibaba`:return t.stt.alibaba;case`edge`:return t.tts.providerEdge;case`minimax`:return`MiniMax`;default:return e}}function Je(e,t){switch(e){case`edge`:return t.tts.providerHints.edge;case`openai`:return t.tts.providerHints.openai;case`alibaba`:return t.tts.providerHints.alibaba;case`minimax`:return t.tts.providerHints.minimax;default:return t.tts.providerHints.generic}}function Ye(e){return{maskedHelp:e.apiKeyMaskedHelp,copy:e.apiKeyCopy,copied:e.apiKeyCopied,show:e.apiKeyShow,hide:e.apiKeyHide,notInConfigFile:e.apiKeyNotInConfigFile,loadFailed:e.apiKeyRevealFailed}}function Xe(e,t){let n=e[t.key];return typeof n==`string`||typeof n==`number`||typeof n==`boolean`?n:t.defaultValue===void 0?t.type!==`boolean`&&``:t.defaultValue}function Ze(e,t){if(e.type===`boolean`)return!!t;if(e.type!==`number`)return t;let n=String(t).trim();if(!n)return;let r=Number(n);return Number.isFinite(r)?r:void 0}function Qe(e,t){switch(t.type){case`reset`:return{form:null,baseline:null};case`sync`:{let e=structuredClone(t.value);return{form:e,baseline:structuredClone(e)}}case`update`:return{...e,form:t.updater(e.form)};case`saved`:{let n=structuredClone(t.value);return{form:e.form!==null&&JSON.stringify(e.form)!==JSON.stringify(t.value)?e.form:n,baseline:structuredClone(n)}}}}function $e(e){let t=(0,X.c)(10),[n,r]=(0,Z.useState)(0),i;t[0]!==e.capability||t[1]!==e.disabled?(i=e.capability===`conversation`&&(0,Q.jsx)(Ve,{disabled:e.disabled}),t[0]=e.capability,t[1]=e.disabled,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>r(et),t[3]=a):a=t[3];let o;t[4]!==n||t[5]!==e?(o=(0,Q.jsx)(tt,{...e,onReload:a},n),t[4]=n,t[5]=e,t[6]=o):o=t[6];let s;return t[7]!==i||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function et(e){return e+1}function tt({capability:e,onPendingChange:t,disabled:n=!1,onReload:r}){let i=c(e=>e.language),a=u(i).voiceSettings,l=I(e=>e.captions),p=I(e=>e.setCaptions),m=!!s(e=>e.conversationId),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useReducer)(Qe,{form:null,baseline:null}),y=_.form,b=_.baseline,[x,S]=(0,Z.useState)(null),C=(0,Z.useRef)(!1),w=(0,Z.useRef)({}),T=(0,Z.useRef)(y);T.current=y;let E=(0,Z.useRef)({parsed:null,models:void 0}),{data:D,error:O,isLoading:A,mutate:N}=j(m),{data:P,error:F,isLoading:L,mutate:R}=k(m?o(`/api/voice/models`):null,oe,{revalidateOnFocus:!1}),{data:z,error:B,isLoading:V}=k(m?o(`/api/voice/providers`):null,he,{revalidateOnFocus:!1}),{data:H,error:U,isLoading:ee}=k(m?o(`/api/voice/stt-providers`):null,se,{revalidateOnFocus:!1}),te=(0,Z.useMemo)(()=>z?.providers??[],[z]),ne=(0,Z.useMemo)(()=>H?.providers??[],[H]),W=(0,Z.useMemo)(()=>D?.payload?.config===void 0?null:pe(D.payload.config),[D]),G=(0,Z.useMemo)(()=>!y||!b?!1:JSON.stringify(y)!==JSON.stringify(b),[y,b]);m?W!==null&&P!==void 0&&!C.current&&(E.current.parsed!==W||E.current.models!==P)&&(E.current={parsed:W,models:P},w.current=le(D?.payload?.config),v({type:`sync`,value:W}),S(P)):(E.current.parsed!==null||E.current.models!==void 0)&&(E.current={parsed:null,models:void 0},v({type:`reset`}),S(null),C.current=!1);let re=!!(m&&(W===null||P===void 0||z===void 0||H===void 0)&&(A||L||V||ee)),q=O instanceof Error?O.message:O?String(O):F instanceof Error?F.message:F?String(F):B instanceof Error?B.message:B?String(B):U instanceof Error?U.message:U?String(U):null,J=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,stt:{...t.stt,...e},...e.provider&&e.provider!==`xopc-cloud`?{voice:{...t.voice,realtime:{...t.voice.realtime,stt:void 0}}}:{}}:null})},[]),ce=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>{if(!t)return null;let n=t.stt.fallback??{enabled:!1,order:[]};return{...t,stt:{...t.stt,fallback:{...n,...e}}}}})},[]),ue=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,input:{...t.voice.input,refinement:{...t.voice.input.refinement,...e}}}}:null})},[]),de=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,languageMode:e,...e===`auto`?{language:i}:{}}}:null})},[i]),fe=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,realtime:{...t.voice.realtime,...e}}}:null})},[]),me=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,tts:{...t.tts,...e}}:null})},[]),Y=ae({value:y,dirty:G,onSave:(0,Z.useCallback)(async t=>{try{let n=await ve(t,e,w.current[e]);w.current={...w.current,...n},v({type:`saved`,value:t}),C.current=!!(T.current&&JSON.stringify(T.current)!==JSON.stringify(t))}catch(e){throw Error(e instanceof Error?e.message:a.saveError)}},[a.saveError,e])});(0,Z.useEffect)(()=>{t?.(G||Y.status===`saving`||h)},[G,Y.status,h,t]),(0,Z.useEffect)(()=>()=>t?.(!1),[t]);let ge=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:()=>e})},[]);if(!m)return(0,Q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a.needToken})});if(re)return(0,Q.jsx)(K,{rows:4});if(!y||x===null)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:q??a.loadError}),(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:()=>{N(),R()},children:a.retry})]});let _e=y.stt,ye=y.tts,be=y.voice.input.refinement,xe=Ye(a);return(0,Q.jsxs)(`fieldset`,{disabled:n||h,className:`flex min-w-0 flex-col gap-4`,onBlurCapture:Y.error?void 0:Y.onBlurCapture,children:[(0,Q.jsx)(ie,{status:Y.status,error:Y.error}),Y.error?(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(M,{variant:`secondary`,onClick:Y.retry,children:i===`zh`?`重试保存`:`Retry saving`}),(0,Q.jsx)(M,{variant:`ghost`,onClick:()=>{N().then(()=>r()).catch(()=>{})},children:i===`zh`?`重新加载(放弃未保存更改)`:`Reload and discard unsaved changes`})]}):null,e===`transcription`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ae,{zh:i===`zh`}),(0,Q.jsx)(it,{managedModel:!0,v:a,apiKeyLabels:xe,stt:_e,models:x,sttProviders:ne,updateStt:J,updateSttFallback:ce}),(0,Q.jsx)(rt,{v:a,voice:y.voice,updateLanguageMode:de}),(0,Q.jsxs)(`details`,{"data-voice-section":`input-processing`,className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[a.experience.inputProcessing,` · `,be.mode===`off`?a.stt.refinementOff:be.mode===`punctuation`?a.stt.refinementPunctuation:be.mode===`light`?a.stt.refinementLight:a.setup.advanced]}),(0,Q.jsxs)(`label`,{className:`mt-4 block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:a.stt.refinement}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.stt.refinementDesc}),(0,Q.jsxs)(d,{className:$(),value:be.mode,onChange:e=>ue({mode:e.target.value}),children:[(0,Q.jsx)(f,{value:`off`,children:a.stt.refinementOff}),(0,Q.jsx)(f,{value:`punctuation`,children:a.stt.refinementPunctuation}),(0,Q.jsx)(f,{value:`light`,children:a.stt.refinementLight}),be.mode===`custom`?(0,Q.jsx)(f,{value:`custom`,children:a.setup.advanced}):null]})]})]}),_e.provider===`xopc-cloud`?(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`实时听写`:`Live dictation`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ee,{modes:[`transcription.stream`],disabled:G||Y.status===`saving`,onPendingChange:g})})]}):null]}):e===`speech`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ot,{managedModel:!0,v:a,apiKeyLabels:xe,tts:ye,models:x,ttsProviders:te,updateTts:me}),(0,Q.jsx)(nt,{v:a,tts:ye,updateTts:me})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ne,{section:`listening`,v:a,form:y,pending:G||Y.status===`saving`||!!Y.error,onChange:ge}),y.voice.realtime.defaultEngine===`omni`&&y.voice.realtime.omni?(0,Q.jsx)(ze,{value:y.voice.realtime.omni,onChange:e=>fe({omni:e})}):null,(0,Q.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(12rem,18rem)] sm:items-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:a.experience.pace}),(0,Q.jsxs)(d,{className:$(),value:String(y.voice.realtime.silenceDurationMs),onChange:e=>fe({silenceDurationMs:Number(e.target.value)}),children:[(0,Q.jsx)(f,{value:`800`,children:a.experience.fast}),(0,Q.jsx)(f,{value:`1200`,children:a.experience.standard}),(0,Q.jsx)(f,{value:`2000`,children:a.experience.relaxed}),[800,1200,2e3].includes(y.voice.realtime.silenceDurationMs)?null:(0,Q.jsxs)(f,{value:String(y.voice.realtime.silenceDurationMs),children:[y.voice.realtime.silenceDurationMs,` ms`]})]})]})}),(0,Q.jsxs)(`label`,{className:`flex items-center justify-between text-sm`,children:[a.experience.captions,(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":l,className:`ui-checkbox`,checked:l,onChange:e=>p(e.target.checked)})]}),y.voice.realtime.defaultEngine===`agent`&&_e.provider===`xopc-cloud`?(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`语音助手输出`:`Assistant speech output`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ee,{modes:[`speech.stream`],disabled:G||Y.status===`saving`,onPendingChange:g})})]}):null,(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`麦克风、扬声器与诊断`:`Microphone, speakers and diagnostics`}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(De,{v:a}),(0,Q.jsx)(Ne,{section:`diagnostics`,v:a,form:y,pending:G||Y.status===`saving`||!!Y.error,onChange:ge})]})]})]})]})}function nt(e){let t=(0,X.c)(29),{v:n,tts:r,updateTts:i}=e,a;t[0]===n.setup.readout?a=t[1]:(a=(0,Q.jsx)(`span`,{className:`font-medium`,children:n.setup.readout}),t[0]=n.setup.readout,t[1]=a);let o=n.setup.readout,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=$(),t[2]=s):s=t[2];let c=r.enabled?r.trigger:`off`,l;t[3]===i?l=t[4]:(l=e=>i({enabled:e.target.value!==`off`,trigger:e.target.value}),t[3]=i,t[4]=l);let u;t[5]===n.tts.triggerOff?u=t[6]:(u=(0,Q.jsx)(f,{value:`off`,children:n.tts.triggerOff}),t[5]=n.tts.triggerOff,t[6]=u);let p;t[7]===n.tts.triggerInbound?p=t[8]:(p=(0,Q.jsx)(f,{value:`inbound`,children:n.tts.triggerInbound}),t[7]=n.tts.triggerInbound,t[8]=p);let m;t[9]===n.tts.triggerAlways?m=t[10]:(m=(0,Q.jsx)(f,{value:`always`,children:n.tts.triggerAlways}),t[9]=n.tts.triggerAlways,t[10]=m);let h;t[11]===n.tts.triggerTagged?h=t[12]:(h=(0,Q.jsx)(f,{value:`tagged`,children:n.tts.triggerTagged}),t[11]=n.tts.triggerTagged,t[12]=h);let g;t[13]!==c||t[14]!==l||t[15]!==u||t[16]!==p||t[17]!==m||t[18]!==h||t[19]!==n.setup.readout?(g=(0,Q.jsxs)(d,{"aria-label":o,className:s,value:c,onChange:l,children:[u,p,m,h]}),t[13]=c,t[14]=l,t[15]=u,t[16]=p,t[17]=m,t[18]=h,t[19]=n.setup.readout,t[20]=g):g=t[20];let _;t[21]!==a||t[22]!==g?(_=(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[a,g]}),t[21]=a,t[22]=g,t[23]=_):_=t[23];let v;t[24]===n.setup.readoutHint?v=t[25]:(v=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.setup.readoutHint}),t[24]=n.setup.readoutHint,t[25]=v);let y;return t[26]!==_||t[27]!==v?(y=(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,children:[_,v]}),t[26]=_,t[27]=v,t[28]=y):y=t[28],y}function rt(e){let t=(0,X.c)(22),{v:n,voice:r,updateLanguageMode:i}=e,a;t[0]===n.language.title?a=t[1]:(a=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.language.title}),t[0]=n.language.title,t[1]=a);let o=r.languageMode===`auto`?n.language.autoDescription:n.language.manualDescription,s;t[2]===o?s=t[3]:(s=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o}),t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==s?(c=(0,Q.jsxs)(`div`,{children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=$(),t[7]=l):l=t[7];let u;t[8]===i?u=t[9]:(u=e=>i(e.target.value),t[8]=i,t[9]=u);let p;t[10]===n.language.auto?p=t[11]:(p=(0,Q.jsx)(f,{value:`auto`,children:n.language.auto}),t[10]=n.language.auto,t[11]=p);let m;t[12]===n.language.manual?m=t[13]:(m=(0,Q.jsx)(f,{value:`manual`,children:n.language.manual}),t[12]=n.language.manual,t[13]=m);let h;t[14]!==u||t[15]!==p||t[16]!==m||t[17]!==r.languageMode?(h=(0,Q.jsxs)(d,{className:l,value:r.languageMode,onChange:u,children:[p,m]}),t[14]=u,t[15]=p,t[16]=m,t[17]=r.languageMode,t[18]=h):h=t[18];let g;return t[19]!==c||t[20]!==h?(g=(0,Q.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(12rem,18rem)] sm:items-center`,children:[c,h]})}),t[19]=c,t[20]=h,t[21]=g):g=t[21],g}function it(e){let t=(0,X.c)(65),{v:n,apiKeyLabels:r,stt:i,models:a,sttProviders:o,updateStt:s,updateSttFallback:c,managedModel:l}=e,u=l!==void 0&&l,p;if(t[0]!==o){let e=new Set;p=[];for(let t of o)e.has(t.id)||(e.add(t.id),p.push(t));t[0]=o,t[1]=p}else p=t[1];let m=p,g,_,v,b;if(t[2]!==a||t[3]!==m||t[4]!==i.provider||t[5]!==i.providers){g=m.find(e=>e.id===i.provider);let e;t[10]!==i.provider||t[11]!==i.providers?(e=i.providers?.[i.provider]??{},t[10]=i.provider,t[11]=i.providers,t[12]=e):e=t[12],v=e,_=a?.stt?.[i.provider]?.length?a.stt[i.provider]:g?.models??[],b=g?.fields.find(at),t[2]=a,t[3]=m,t[4]=i.provider,t[5]=i.providers,t[6]=g,t[7]=_,t[8]=v,t[9]=b}else g=t[6],_=t[7],v=t[8],b=t[9];let x=b,S=typeof v.model==`string`?v.model:void 0,C=S??(typeof x?.defaultValue==`string`?x.defaultValue:_[0]?.id),w;t[13]!==i.provider||t[14]!==i.providers||t[15]!==s?(w=e=>{s({providers:{...i.providers??{},[i.provider]:{...i.providers?.[i.provider]??{},...e}}})},t[13]=i.provider,t[14]=i.providers,t[15]=s,t[16]=w):w=t[16];let T=w,E,D;t[17]!==S||t[18]!==C||t[19]!==u||t[20]!==x||t[21]!==T?(E=()=>{!u&&x&&C&&S!==C&&T({model:C})},D=[u,S,C,x,T],t[17]=S,t[18]=C,t[19]=u,t[20]=x,t[21]=T,t[22]=E,t[23]=D):(E=t[22],D=t[23]),(0,Z.useEffect)(E,D);let O;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent`,strokeWidth:1.75}),t[24]=O):O=t[24];let k;t[25]===n.stt.title?k=t[26]:(k=(0,Q.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[O,n.stt.title]}),t[25]=n.stt.title,t[26]=k);let A;t[27]===n.stt.enable?A=t[28]:(A=(0,Q.jsx)(`span`,{children:n.stt.enable}),t[27]=n.stt.enable,t[28]=A);let j;t[29]===s?j=t[30]:(j=e=>s({enabled:e.target.checked}),t[29]=s,t[30]=j);let M;t[31]!==i.enabled||t[32]!==j?(M=(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":i.enabled,className:`ui-checkbox`,checked:i.enabled,onChange:j}),t[31]=i.enabled,t[32]=j,t[33]=M):M=t[33];let N;t[34]!==M||t[35]!==A?(N=(0,Q.jsxs)(`label`,{className:`flex min-h-10 items-center gap-2 text-xs text-fg-muted`,children:[A,M]}),t[34]=M,t[35]=A,t[36]=N):N=t[36];let P;t[37]!==N||t[38]!==k?(P=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[k,N]}),t[37]=N,t[38]=k,t[39]=P):P=t[39];let F;t[40]===n.stt.description?F=t[41]:(F=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.stt.description}),t[40]=n.stt.description,t[41]=F);let I;t[42]!==P||t[43]!==F?(I=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[P,F]}),t[42]=P,t[43]=F,t[44]=I):I=t[44];let L;t[45]!==g?.fields||t[46]!==r||t[47]!==C||t[48]!==u||t[49]!==_||t[50]!==m||t[51]!==v||t[52]!==i.enabled||t[53]!==i.fallback?.enabled||t[54]!==i.provider||t[55]!==T||t[56]!==s||t[57]!==c||t[58]!==n?(L=i.enabled?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[u?null:(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{children:n.stt.provider}),(0,Q.jsx)(d,{"aria-label":n.stt.provider,className:$(),value:i.provider,onChange:e=>s({provider:e.target.value}),children:m.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[Ke(e.id,n),e.configured?``:` *`]},e.id))})]}),(0,Q.jsx)(st,{managedModel:u,kind:`stt`,providerId:i.provider,fields:g?.fields??[],providerSlice:v,models:_,currentModel:C,apiKeyLabels:r,onPatch:T})]}),i.provider===`alibaba`?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.setup.keyHint}):null,(0,Q.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:n.stt.fallback}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.stt.fallback}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.stt.fallbackDesc})]}),(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i.fallback?.enabled??!1,onChange:e=>c({enabled:e.target.checked})})]})]})]}):null,t[45]=g?.fields,t[46]=r,t[47]=C,t[48]=u,t[49]=_,t[50]=m,t[51]=v,t[52]=i.enabled,t[53]=i.fallback?.enabled,t[54]=i.provider,t[55]=T,t[56]=s,t[57]=c,t[58]=n,t[59]=L):L=t[59];let R;t[60]===L?R=t[61]:(R=(0,Q.jsx)(`div`,{className:`space-y-4`,children:L}),t[60]=L,t[61]=R);let z;return t[62]!==I||t[63]!==R?(z=(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:[I,R]}),t[62]=I,t[63]=R,t[64]=z):z=t[64],z}function at(e){return e.key===`model`}function ot({v:e,apiKeyLabels:t,tts:n,models:r,ttsProviders:i,updateTts:a,managedModel:o=!1}){let[s,c]=(0,Z.useState)(e.tts.test.sampleText),[l,u]=(0,Z.useState)({status:`idle`}),p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x=(0,Z.useCallback)(()=>{b.current?.abort(),b.current=null,p.current?.pause(),p.current=null,h.current&&=(URL.revokeObjectURL(h.current),null)},[]),S=(0,Z.useMemo)(()=>{let e=new Set,t=[];for(let n of i)e.has(n.id)||(e.add(n.id),t.push(n));return t},[i]),C=S.find(e=>e.id===n.provider),w=n.providers?.[n.provider]??{},T=r?.tts?.[n.provider]?.length?r.tts[n.provider]:C?.models??[],E=C?.fields.find(e=>e.key===`model`),D=C?.fields.find(e=>e.key===`voice`),O=typeof w.model==`string`?w.model:void 0,A=O??(typeof E?.defaultValue==`string`?E.defaultValue:T[0]?.id),j=T.find(e=>e.id===A),N=r?.ttsVoices?.[n.provider]?.length?r.ttsVoices[n.provider]:C?.voices??[],{data:P=[]}=k(A?`voice:tts:${n.provider}:${A}`:null,()=>fe(n.provider,A??``),{revalidateOnFocus:!1}),F=P.length>0?P:N,I=typeof w.voice==`string`?w.voice:void 0,L=I??F.find(e=>e.id===j?.tts?.defaultVoice)?.id??(typeof D?.defaultValue==`string`?D.defaultValue:F[0]?.id),R=(C?.fields??[]).filter(e=>(e.key!==`speed`||j?.tts?.speed!==!1)&&(e.key!==`instructions`||j?.tts?.instructions!==!1)),z=(0,Z.useCallback)(e=>{a({providers:{...n.providers??{},[n.provider]:{...n.providers?.[n.provider]??{},...e}}})},[n.provider,n.providers,a]);(0,Z.useEffect)(()=>{if(o)return;let e={};E&&A&&O!==A&&(e.model=A),D&&L&&I!==L&&(e.voice=L),Object.keys(e).length>0&&z(e)},[o,O,I,A,L,E,z,D]),(0,Z.useEffect)(()=>()=>x(),[x]);let B=(0,Z.useCallback)(e=>{a({provider:e}),u({status:`idle`})},[a]),V=(0,Z.useCallback)(async()=>{let t=s.trim();if(!t){u({status:`error`,message:e.tts.test.emptyText});return}x();let r=new AbortController;b.current=r,u({status:`loading`});try{let i=await ue({text:t,provider:n.provider,providerConfig:w,...A?{model:A}:{},...L?{voice:L}:{}},r.signal);if(r.signal.aborted)return;let a=Ge(i.audio,i.mimeType);h.current=a;let o=new Audio(a);p.current=o;let s=[i.provider,i.format,i.latencyMs===void 0?void 0:`${i.latencyMs}ms`,We(i.audioSize)].filter(Boolean).join(` · `);o.addEventListener(`ended`,()=>u({status:`done`,summary:s}),{once:!0}),o.addEventListener(`error`,()=>u({status:`error`,message:e.tts.test.playFailed}),{once:!0}),await o.play(),u({status:`playing`,summary:s})}catch(e){if(r.signal.aborted)return;x(),u({status:`error`,message:e instanceof Error?e.message:String(e)})}},[A,L,w,x,s,n.provider,e.tts.test.emptyText,e.tts.test.playFailed]);return(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mb-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(v,{className:`size-4 text-accent`,strokeWidth:1.75}),e.tts.title]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.tts.description})]}),(0,Q.jsx)(`div`,{className:`space-y-4`,children:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:o?null:(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{children:e.tts.provider}),(0,Q.jsx)(d,{"aria-label":e.tts.provider,className:$(),value:n.provider,onChange:e=>B(e.target.value),children:S.map(t=>(0,Q.jsx)(f,{value:t.id,children:qe(t.id,e)},t.id))}),(0,Q.jsxs)(`p`,{className:`text-xs text-fg-subtle`,children:[C?.configured?e.tts.configured:C?.diagnostics.requiresApiKey?`${e.tts.needsKey} · ${C.diagnostics.envKeys?.join(`, `)??e.stt.apiKey}`:e.tts.noKeyNeeded,` · `,C?.description??Je(n.provider,e)]})]})}),(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:(0,Q.jsx)(st,{managedModel:o,kind:`tts`,providerId:n.provider,fields:R,providerSlice:w,models:T,voices:F,currentModel:A,currentVoice:L,apiKeyLabels:t,onPatch:z,resetVoiceOnModelChange:!0})}),(0,Q.jsxs)(`details`,{className:`rounded-xl bg-surface-panel/80 p-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:e.tts.test.title}),(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.tts.test.description})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,Q.jsxs)(M,{type:`button`,variant:`primary`,onClick:()=>void V(),disabled:l.status===`loading`,className:`h-9`,children:[l.status===`loading`?(0,Q.jsx)(m,{className:`size-4 animate-spin`}):(0,Q.jsx)(g,{className:`size-4`}),l.status===`loading`?e.tts.test.generating:e.tts.test.play]}),(0,Q.jsxs)(M,{type:`button`,variant:`secondary`,onClick:()=>{x(),u(e=>e.status===`playing`?{status:`done`,summary:e.summary}:{status:`idle`})},disabled:l.status!==`playing`,className:`h-9`,children:[(0,Q.jsx)(_,{className:`size-4`}),e.tts.test.stop]})]})]}),(0,Q.jsxs)(`details`,{className:`mt-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:e.setup.sampleText}),(0,Q.jsx)(`textarea`,{className:y(Ue(),`mt-3 min-h-20 resize-y`),value:s,onChange:e=>c(e.target.value),maxLength:1e3})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-subtle`,children:[s.length,`/1000`]}),l.status===`playing`||l.status===`done`?(0,Q.jsxs)(`span`,{className:`text-emerald-700 dark:text-emerald-200`,children:[l.status===`playing`?e.tts.test.playing:e.tts.test.ready,` · `,l.summary]}):null,l.status===`error`?(0,Q.jsx)(`span`,{className:`text-red-600 dark:text-red-400`,children:l.message}):null]})]})]})]})})]})}function st(e){let t=(0,X.c)(48),{kind:n,providerId:r,fields:i,providerSlice:a,models:o,voices:s,currentModel:l,currentVoice:p,apiKeyLabels:m,onPatch:h,resetVoiceOnModelChange:g,managedModel:_}=e,v;t[0]===s?v=t[1]:(v=s===void 0?[]:s,t[0]=s,t[1]=v);let b=v,x=g!==void 0&&g,S=_!==void 0&&_,C=c(dt),w;t[2]===C?w=t[3]:(w=u(C),t[2]=C,t[3]=w);let T=w.voiceSettings,E=S,D=ut,O=lt,k,A,j;if(t[4]!==m||t[5]!==l||t[6]!==p||t[7]!==i||t[8]!==n||t[9]!==C||t[10]!==S||t[11]!==o||t[12]!==h||t[13]!==r||t[14]!==a||t[15]!==x||t[16]!==E||t[17]!==T||t[18]!==b){let e;t[22]===E?e=t[23]:(e=e=>!E||e.key!==`model`&&!O(e),t[22]=E,t[23]=e);let s=i.filter(e),c;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!D(e),t[24]=c):c=t[24];let u=s.filter(c),g;t[25]!==m||t[26]!==l||t[27]!==p||t[28]!==n||t[29]!==C||t[30]!==S||t[31]!==o||t[32]!==h||t[33]!==r||t[34]!==a||t[35]!==x||t[36]!==T||t[37]!==b?(g=e=>e.map(e=>S&&e.key===`model`?null:e.key===`apiKey`?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-api-key`,children:T.stt.apiKey}),(0,Q.jsx)(ye,{kind:n,providerId:r,fieldId:`voice-${n}-${r}-api-key`,value:typeof a.apiKey==`string`?a.apiKey:``,onChange:e=>h({apiKey:e}),labels:m,placeholder:e.placeholder}),e.description?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:e.description}):null]},e.key):e.key===`model`&&o.length>0?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-model`,children:T.stt.model}),(0,Q.jsx)(d,{id:`voice-${n}-${r}-model`,className:$(),value:l??``,onChange:e=>h({model:e.target.value,...x?{voice:void 0}:{}}),children:[...o].sort(W).map(ct)})]},e.key):e.key===`voice`&&b.length>0?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-voice`,children:T.tts.voice}),(0,Q.jsxs)(d,{id:`voice-${n}-${r}-voice`,className:$(),value:p??``,onChange:e=>h({voice:e.target.value}),children:[p&&!b.some(e=>e.id===p)?(0,Q.jsxs)(f,{value:p,children:[p,` · unavailable`]}):null,b.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,C),e.gender?` · ${e.gender===`female`?`女声`:`男声`}`:``,e.style?` · ${e.style}`:``]},e.id))]}),b.find(e=>e.id===p)?.description?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:b.find(e=>e.id===p)?.description}):null]},e.key):(0,Q.jsx)(ft,{fieldId:`voice-${n}-${r}-${e.key}`,field:e,value:Xe(a,e),onChange:t=>h({[e.key]:t}),className:e.type===`textarea`?`sm:col-span-2`:He},e.key)),t[25]=m,t[26]=l,t[27]=p,t[28]=n,t[29]=C,t[30]=S,t[31]=o,t[32]=h,t[33]=r,t[34]=a,t[35]=x,t[36]=T,t[37]=b,t[38]=g):g=t[38];let _=g;t[39]!==i||t[40]!==n||t[41]!==C||t[42]!==E?(k=E&&i.some(O)?(0,Q.jsx)(ke,{className:`text-sm text-accent-fg hover:underline`,to:`/settings/capabilities/models?tab=services&configure=${n===`stt`?`transcription`:`speech`}`,children:C===`zh`?`管理服务连接`:`Manage service connection`}):null,t[39]=i,t[40]=n,t[41]=C,t[42]=E,t[43]=k):k=t[43],A=_(s.filter(D)),j=u.length?(0,Q.jsxs)(`details`,{className:`rounded-lg border border-edge p-3 sm:col-span-2`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:T.experience.providerOptions}),(0,Q.jsx)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:_(u)})]}):null,t[4]=m,t[5]=l,t[6]=p,t[7]=i,t[8]=n,t[9]=C,t[10]=S,t[11]=o,t[12]=h,t[13]=r,t[14]=a,t[15]=x,t[16]=E,t[17]=T,t[18]=b,t[19]=k,t[20]=A,t[21]=j}else k=t[19],A=t[20],j=t[21];let M;return t[44]!==k||t[45]!==A||t[46]!==j?(M=(0,Q.jsxs)(Q.Fragment,{children:[k,A,j]}),t[44]=k,t[45]=A,t[46]=j,t[47]=M):M=t[47],M}function ct(e){return(0,Q.jsx)(f,{value:e.id,children:e.name},e.id)}function lt(e){return e.secret||e.type===`password`||[`apiKey`,`baseUrl`,`region`,`groupId`].includes(e.key)}function ut(e){return e.required||[`apiKey`,`model`,`voice`].includes(e.key)}function dt(e){return e.language}function ft(e){let t=(0,X.c)(37),{fieldId:n,field:r,value:i,onChange:a,className:o}=e,s=n??`voice-schema-field-${r.key}`,c=r.description;if(r.type===`boolean`){let e;t[0]===o?e=t[1]:(e=y(`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,o),t[0]=o,t[1]=e);let n;t[2]===r.label?n=t[3]:(n=(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.label}),t[2]=r.label,t[3]=n);let s;t[4]===c?s=t[5]:(s=c?(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:c}):null,t[4]=c,t[5]=s);let l;t[6]!==n||t[7]!==s?(l=(0,Q.jsxs)(`span`,{children:[n,s]}),t[6]=n,t[7]=s,t[8]=l):l=t[8];let u=!!i,d;t[9]!==r||t[10]!==a?(d=e=>a(Ze(r,e.target.checked)),t[9]=r,t[10]=a,t[11]=d):d=t[11];let f;t[12]!==u||t[13]!==d?(f=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:u,onChange:d}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==e||t[16]!==l||t[17]!==f?(p=(0,Q.jsxs)(`label`,{className:e,children:[l,f]}),t[15]=e,t[16]=l,t[17]=f,t[18]=p):p=t[18],p}let l=typeof i==`boolean`?``:String(i),u;t[19]===o?u=t[20]:(u=y(`flex flex-col gap-1.5`,o),t[19]=o,t[20]=u);let f;t[21]!==r.label||t[22]!==s?(f=(0,Q.jsx)(mt,{htmlFor:s,children:r.label}),t[21]=r.label,t[22]=s,t[23]=f):f=t[23];let m;t[24]!==o||t[25]!==r||t[26]!==l||t[27]!==s||t[28]!==a?(m=r.type===`select`?(0,Q.jsx)(d,{id:s,className:$(),value:l,required:r.required,onChange:e=>a(Ze(r,e.target.value)),children:(r.options??[]).map(pt)}):r.type===`textarea`?(0,Q.jsx)(`textarea`,{id:s,className:y(Ue(),`min-h-24 resize-y`),value:l,required:r.required,placeholder:r.placeholder,onChange:e=>a(Ze(r,e.target.value))}):r.type===`password`?(0,Q.jsx)(p,{id:s,className:o,value:l,onChange:e=>a(Ze(r,e)),placeholder:r.placeholder,labels:ne}):r.type===`number`?(0,Q.jsx)(J,{id:s,className:Ue(),autoComplete:r.secret?`new-password`:`off`,spellCheck:!1,value:l,required:r.required,allowEmpty:!r.required,placeholder:r.placeholder,min:r.min,max:r.max,step:r.step,onChange:e=>a(Ze(r,e.target.value))}):(0,Q.jsx)(`input`,{id:s,className:Ue(),type:`text`,autoComplete:r.secret?`new-password`:`off`,spellCheck:!1,value:l,required:r.required,placeholder:r.placeholder,min:r.min,max:r.max,step:r.step,onChange:e=>a(Ze(r,e.target.value))}),t[24]=o,t[25]=r,t[26]=l,t[27]=s,t[28]=a,t[29]=m):m=t[29];let h;t[30]===c?h=t[31]:(h=c?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:c}):null,t[30]=c,t[31]=h);let g;return t[32]!==u||t[33]!==f||t[34]!==m||t[35]!==h?(g=(0,Q.jsxs)(`div`,{className:u,children:[f,m,h]}),t[32]=u,t[33]=f,t[34]=m,t[35]=h,t[36]=g):g=t[36],g}function pt(e){return(0,Q.jsx)(f,{value:e.id,children:e.name},e.id)}function mt(e){let t=(0,X.c)(3),{children:n,htmlFor:r}=e,i;return t[0]!==n||t[1]!==r?(i=r?(0,Q.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium text-fg`,children:n}):(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}export{Oe as n,$e as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,l as s,n as c,o as l}from"./locale-store-Dy1EByeG.js";import{t as u}from"./messages-BAnhwALN.js";import{n as d,r as f}from"./popover-select-CLsphyzA.js";import{t as p}from"./secret-input-DsjfQmDn.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{t as h}from"./mic-CuUb7zc-.js";import{t as g}from"./play-kxZvpBg8.js";import{t as _}from"./square-DMK_fB-3.js";import{t as v}from"./volume-2-BSJhAY97.js";import{t as y}from"./cn-0WouolD0.js";import{t as b}from"./skeleton-DzdOeGYz.js";import{a as x,c as S,i as C,m as w,n as T,p as E,u as D}from"./schemas-CCWMleym.js";import{n as O}from"./voice-CDlC6XMH.js";import{i as k}from"./vendor-swr-CdRzEUwF.js";import{n as A,r as j}from"./gateway-config-swr-1Rk0LeEM.js";import{t as M}from"./button-Cc4hUNTt.js";import{t as N}from"./open-capability-settings-DQsmJxI7.js";import{a as P,d as F,f as I,i as L,o as R,p as z,t as B,u as V}from"./use-realtime-voice-B5IsKrRW.js";import{t as H}from"./voice-call-context-BM2A4bLz.js";import{a as U,o as ee,s as te}from"./form-field-width-DJw_jULe.js";import{t as ne}from"./secret-input-labels-B5Jl5HqK.js";import{n as W}from"./model-sort-_Tz8s_4N.js";import{r as G}from"./model-selector-C-CqPBao.js";import{t as K}from"./settings-loading-skeleton-CAoOV17i.js";import{a as re,i as q}from"./capability-navigation-QtHJxxW2.js";import{t as J}from"./number-input-El7Szeln.js";import{n as ie,t as ae}from"./use-autosave-N_SjHXTw.js";import{a as oe,c as se,d as ce,f as le,g as ue,h as de,i as fe,l as pe,n as me,o as he,p as Y,r as ge,t as _e,u as ve}from"./voice-config-api-DhJ3l8fk.js";import{t as ye}from"./voice-api-key-field-B_GApUQP.js";var be=E({"zh-CN":w().min(1).optional(),en:w().min(1).optional()}),xe=T([`transcription`,`transcription.stream`,`speech`,`speech.stream`,`conversation`]),Se=E({protocolVersion:S(1),serviceVersion:D().int().positive(),modes:C(xe),transport:S(`websocket-pcm`),inputFormat:E({encoding:S(`pcm_s16le`),sampleRate:S(16e3),channels:S(1)}),outputFormat:E({encoding:S(`pcm_s16le`),sampleRate:S(24e3),channels:S(1)}),turnDetection:C(S(`server_vad`)),bargeIn:x(),tools:x(),resumable:S(!1),voices:C(E({id:w().min(1),name:w(),displayNames:be.optional(),languages:C(w()),gender:T([`female`,`male`]).optional(),style:w().optional(),description:w().optional(),modes:C(xe).optional()})),defaultVoice:w().min(1).optional(),limits:E({maxFrameBytes:D().int().positive().max(65536),maxSessionSeconds:D().int().positive()})});function Ce(e,t){return e.modes===void 0||e.modes.includes(t)}var we=E({mode:xe,model:w().min(1).max(200),voice:w().min(1).max(200).optional()}),Te=E({revision:w().min(1),catalogVersion:w().nullable(),selections:C(we),models:C(E({id:w(),name:w(),displayNames:be.optional(),voice:Se}))}),X=n(),Z=e(t(),1),Q=r();function Ee({disabled:e=!1,modes:t,onPendingChange:n}){let r=c(e=>e.language),i=r===`zh`,[a,s]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>(n?.(a),()=>n?.(!1)),[a,n]);let[u,p]=(0,Z.useState)(``),{data:m,mutate:h,error:g}=k(o(`/api/voice/catalog`),async e=>{let t=await l(e);return Te.parse(t.payload)}),_=i?{transcription:`录音转文字`,"transcription.stream":`实时听写 / 语音助手输入`,speech:`消息朗读`,"speech.stream":`语音助手输出`,conversation:`自然语音对话`}:{transcription:`Recorded transcription`,"transcription.stream":`Live dictation / assistant input`,speech:`Message readout`,"speech.stream":`Assistant speech`,conversation:`Natural conversation`},v=async e=>{if(m){s(!0),p(``);try{let t=await l(o(e?`/api/voice/selection`:`/api/voice/catalog/refresh`),{method:e?`PUT`:`POST`,...e?{body:JSON.stringify({revision:m.revision,selection:e})}:{}});await h(Te.parse(t.payload),!1),await A()}catch(e){p(e instanceof Error?e.message:String(e)),await h()}finally{s(!1)}}};return(0,Q.jsxs)(`section`,{className:`space-y-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:i?`XOPC 托管语音模型`:`XOPC managed voice models`}),(0,Q.jsx)(M,{variant:`secondary`,disabled:a||e||!m,onClick:()=>void v(),children:i?`刷新目录`:`Refresh catalog`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`修改在下次调用生效。各设备共用此 Gateway 的配置。`:`Changes apply to the next call and are shared across devices.`}),u||g?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600`,children:u||String(g)}):null,m?(0,Q.jsx)(Q.Fragment,{children:t.map(t=>{let n=m.selections.find(e=>e.mode===t),o=m.models.filter(e=>e.voice.modes.includes(t)).sort(W),s=o.find(e=>e.id===n?.model),c=s?.voice.voices.filter(e=>Ce(e,t))??[],l=n?.voice??c.find(e=>e.id===s?.voice.defaultVoice)?.id??c[0]?.id??``;return(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:_[t]}),(0,Q.jsxs)(d,{className:`w-full`,value:n?.model??``,disabled:a||e||!o.length,onChange:e=>void v({mode:t,model:e.target.value}),children:[(0,Q.jsx)(f,{value:``,disabled:!0,children:i?`选择模型`:`Choose model`}),n&&!s?(0,Q.jsxs)(f,{value:n.model,disabled:!0,children:[n.model,` · `,i?`不可用`:`Unavailable`]}):null,o.map(e=>(0,Q.jsx)(f,{value:e.id,children:G(e,r)},e.id))]}),o.length?null:(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i?`暂无可用模型`:`No available model`})]}),s&&c.length>0?(0,Q.jsxs)(`label`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:i?`音色`:`Voice`}),(0,Q.jsxs)(d,{className:`w-full`,value:l,disabled:a||e,onChange:e=>void v({mode:t,model:s.id,voice:e.target.value}),children:[n?.voice&&!c.some(e=>e.id===n.voice)?(0,Q.jsxs)(f,{value:n.voice,disabled:!0,children:[n.voice,` · `,i?`当前场景不可用`:`Unavailable for this mode`]}):null,c.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,r),e.gender?` · ${i?e.gender===`female`?`女声`:`男声`:e.gender}`:``,e.style?` · ${e.style}`:``]},e.id))]}),c.find(e=>e.id===l)?.description?(0,Q.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:c.find(e=>e.id===l)?.description}):null]}):null]},t)})}):(0,Q.jsx)(b,{className:`h-48 w-full`})]})}function De({v:e}){let t=I(e=>e.microphoneId),n=I(e=>e.setMicrophoneId),[r,i]=(0,Z.useState)([]),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),l=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{l.current=!0;let e=()=>{navigator.mediaDevices?.enumerateDevices().then(e=>{l.current&&i(e.filter(e=>e.kind===`audioinput`))}).catch(()=>{})};return e(),navigator.mediaDevices?.addEventListener(`devicechange`,e),()=>{l.current=!1,navigator.mediaDevices?.removeEventListener(`devicechange`,e)}},[]);let u=async()=>{c(!0),o(``);try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop());let e=await navigator.mediaDevices.enumerateDevices();l.current&&i(e.filter(e=>e.kind===`audioinput`))}catch(e){l.current&&o(e instanceof Error?e.message:String(e))}finally{l.current&&c(!1)}};return(0,Q.jsxs)(`section`,{className:`space-y-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:e.experience.microphone}),(0,Q.jsxs)(d,{value:t,onChange:e=>n(e.target.value),children:[(0,Q.jsx)(f,{value:``,children:e.experience.systemDevice}),t&&!r.some(e=>e.deviceId===t)?(0,Q.jsx)(f,{value:t,children:e.experience.unavailable}):null,r.filter(e=>e.deviceId&&e.deviceId!=="default").map((t,n)=>(0,Q.jsx)(f,{value:t.deviceId,children:t.label||`${e.experience.microphone} ${n+1}`},t.deviceId))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.experience.deviceHint}),(0,Q.jsx)(M,{variant:`secondary`,disabled:s,onClick:()=>void u(),children:e.experience.refreshDevices}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600`,children:a}):null]})}var Oe=(0,Z.createContext)(null);function ke(e){let t=(0,X.c)(18),n,r;t[0]===e?(n=t[1],r=t[2]):({to:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let[o]=i(),s=(0,Z.useContext)(Oe),c,l;t[3]===r?(c=t[4],l=t[5]):(c=new URLSearchParams(r.split(`?`)[1]??``),l=q(c.get(`configure`)),t[3]=r,t[4]=c,t[5]=l);let u=l,d;t[6]!==s||t[7]!==n||t[8]!==c||t[9]!==u?(d=e=>{n.onClick?.(e),!e.defaultPrevented&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&s&&u&&c.get(`tab`)===`services`&&(e.preventDefault(),s(u))},t[6]=s,t[7]=n,t[8]=c,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==o||t[12]!==r?(f=re(r,o),t[11]=o,t[12]=r,t[13]=f):f=t[13];let p;return t[14]!==n||t[15]!==d||t[16]!==f?(p=(0,Q.jsx)(a,{...n,onClick:d,to:f}),t[14]=n,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Ae(e){let t=(0,X.c)(19),{zh:n}=e,{data:r,error:i,mutate:a}=k(`voice-dictation-route`,je),o,s;t[0]===a?(o=t[1],s=t[2]):(o=()=>{let e=()=>{a()};return window.addEventListener(`voice-config-changed`,e),window.addEventListener(`config-reload`,e),()=>{window.removeEventListener(`voice-config-changed`,e),window.removeEventListener(`config-reload`,e)}},s=[a],t[0]=a,t[1]=o,t[2]=s),(0,Z.useEffect)(o,s);let c=n?`同时用于聊天听写`:`Also used for chat dictation`,l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(`h2`,{className:`font-medium text-fg`,children:c}),t[3]=c,t[4]=l);let u=n?`默认与录音识别共用模型。已有的独立听写设置会保留。`:`Dictation shares this recognition model. Existing separate dictation settings are preserved.`,d;t[5]===u?d=t[6]:(d=(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:u}),t[5]=u,t[6]=d);let f;t[7]!==r||t[8]!==i||t[9]!==n?(f=!r&&!i?(0,Q.jsx)(b,{className:`h-5 w-64 max-w-full`}):(0,Q.jsx)(`p`,{role:i?`alert`:`status`,className:`text-fg-muted`,children:i?n?`暂时无法读取听写状态。`:`Dictation status could not be loaded.`:r?.mode===`recorded`?n?`当前使用 ${r.provider},点击完成后转为文字。`:`Using ${r.provider}. Choose Finish to transcribe.`:r?.mode===`streaming`?n?`当前使用流式识别${r.provider?` · ${r.provider}`:``}。`:`Using streaming recognition${r.provider?` · ${r.provider}`:``}.`:n?`听写未就绪,请检查识别模型或已有的流式配置。`:`Check the recognition model or existing streaming configuration.`}),t[7]=r,t[8]=i,t[9]=n,t[10]=f):f=t[10];let p;t[11]!==r?.mode||t[12]!==n?(p=r?.mode===`recorded`?null:(0,Q.jsx)(ke,{className:`inline-block text-accent-fg hover:underline`,to:`/settings/capabilities/models?tab=services&configure=transcription`,children:n?`管理识别服务`:`Manage recognition services`}),t[11]=r?.mode,t[12]=n,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl border border-edge p-4 text-sm`,children:[l,d,f,p]}),t[14]=l,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function je(){return L(AbortSignal.timeout(15e3))}function Me({v:e,canListen:t,canSpeak:n,disabled:r,onVerified:i}){let a=e.setup,o=(0,Z.useContext)(H)?.active??!1,[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),p=(0,Z.useRef)(`idle`),v=(0,Z.useRef)(null),y=(0,Z.useRef)(!1),b=e=>{p.current=e,c(e)},x=()=>{v.current?.(),v.current=null};(0,Z.useEffect)(()=>()=>v.current?.(),[]);async function S(e){x(),i?.({input:!1,output:!1}),y.current=!1,u(``),f(``),b(e?`connecting`:`playing`);let t=new AbortController,r,o,s,c,l=()=>{o?.cancel(),r?.getTracks().forEach(e=>e.stop()),s?.stop(`surface_closed`)},d=window.setTimeout(()=>m(a.timeout),6e4);v.current=()=>{t.abort(),window.clearTimeout(d),l(),c?.close()};function m(e){t.signal.aborted||(b(`error`),f(e),x())}async function h(){b(`playing`),l();try{let e=await ce(t.signal);if(t.signal.aborted)return;c?.enqueue(e,()=>{t.signal.aborted||(window.clearTimeout(d),b(`confirm`))})}catch(e){m(e instanceof Error?e.message:a.testFailed)}}try{if(n&&(c=new V,await c.start(),t.signal.throwIfAborted()),!e){await h();return}let d=window.electronAPI?.system;if(d){let e=await d.requestMicrophone();if(t.signal.throwIfAborted(),e.status===`denied`)throw Error(a.microphoneDenied)}if(r=await navigator.mediaDevices.getUserMedia({audio:z()}),t.signal.aborted){l();return}if(s=await F.connect({purpose:`dictation`,signal:t.signal,onEvent:e=>{t.signal.aborted||(e.type===`session.error`&&m(a.testFailed),p.current===`listening`&&(e.type===`input.transcript.delta`&&u(e.payload.text),e.type===`input.transcript.final`&&e.payload.text.trim()&&(u(e.payload.text.trim()),y.current=!0,n?h():(b(`passed`),i?.({input:!0,output:!1}),x()))))},onClose:()=>{(p.current===`listening`||p.current===`connecting`)&&m(a.testFailed)}}),t.signal.aborted){l();return}let f;if(o=await P.start(r,{onSamples:e=>{f&&!t.signal.aborted&&s?.sendAudio(f.push(e))}}),t.signal.aborted){l();return}f=new R(o.sampleRate,s.session.inputFormat.sampleRate),b(`listening`)}catch(e){if(t.signal.aborted){l();return}m(e instanceof Error?e.message:a.testFailed)}}let C=s===`connecting`||s===`listening`||s===`playing`;return(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-xl bg-surface-base/45 p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(M,{type:`button`,variant:`primary`,disabled:o||r||!t||C,onClick:()=>void S(!0),children:[C?(0,Q.jsx)(m,{className:`size-4 animate-spin`}):(0,Q.jsx)(h,{className:`size-4`}),n?a.test:a.testInput]}),(0,Q.jsxs)(M,{type:`button`,variant:`secondary`,disabled:o||r||!n||C,onClick:()=>void S(!1),children:[(0,Q.jsx)(g,{className:`size-4`}),e.tts.test.play]}),C?(0,Q.jsxs)(M,{type:`button`,variant:`ghost`,onClick:()=>{x(),b(`idle`)},children:[(0,Q.jsx)(_,{className:`size-4`}),e.tts.test.stop]}):null]}),(0,Q.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`space-y-2 text-xs text-fg-muted`,children:[s===`idle`?(0,Q.jsx)(`p`,{children:o?e.experience.endCallBeforeTest:r?a.saveBeforeTest:a.microphoneHint}):null,s===`connecting`?(0,Q.jsx)(`p`,{children:a.connecting}):null,s===`listening`?(0,Q.jsx)(`p`,{children:a.speakNow}):null,l?(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-base p-3 text-sm text-fg`,children:l}):null,s===`playing`?(0,Q.jsx)(`p`,{children:a.playing}):null,s===`confirm`?(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{children:a.heardQuestion}),(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:()=>{x(),i?.({input:y.current,output:!0}),b(`passed`)},children:a.heard}),(0,Q.jsx)(M,{type:`button`,variant:`ghost`,onClick:()=>{x(),b(`error`),f(a.notHeard)},children:a.notHeardButton})]}):null,s===`passed`?(0,Q.jsx)(`p`,{children:y.current?n?a.passed:a.inputPassed:a.outputPassed}):null,s===`error`?(0,Q.jsx)(`p`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:d}):null]})]})}function Ne(e){let t=(0,X.c)(78),{section:n,v:r,form:i,pending:a,onChange:s}=e,l=c(Re),u=r.setup,p;t[0]===i?p=t[1]:(p=JSON.stringify(i),t[0]=i,t[1]=p);let m=p,h;t[2]===m?h=t[3]:(h={signature:m,input:!1,output:!1},t[2]=m,t[3]=h);let[g,_]=(0,Z.useState)(h);g.signature!==m&&_({signature:m,input:!1,output:!1});let v;t[4]!==a||t[5]!==m?(v=a?null:[`voice-realtime-status`,m],t[4]=a,t[5]=m,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={revalidateOnFocus:!0},t[7]=y):y=t[7];let{data:x,error:S,isLoading:C}=k(v,ge,y),w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=o(`/api/voice/catalog`),t[8]=w):w=t[8];let{data:T}=k(w,Le),E=i.voice.realtime,D=E.tts,O=D?.provider??x?.tts?.provider,A=x?.tts?.model,j;t[9]!==A||t[10]!==O?(j=O&&A?[`realtime-voices`,O,A]:null,t[9]=A,t[10]=O,t[11]=j):j=t[11];let M;t[12]!==A||t[13]!==O?(M=()=>fe(O,A,`realtime`),t[12]=A,t[13]=O,t[14]=M):M=t[14];let N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N={revalidateOnFocus:!1},t[15]=N):N=t[15];let{data:P}=k(j,M,N),F;t[16]===P?F=t[17]:(F=P===void 0?[]:P,t[16]=P,t[17]=F);let I=F,L=I,R;t[18]===I?R=t[19]:(R=I.filter(Ie),t[18]=I,t[19]=R);let z=R,B=E.defaultEngine===`omni`,V=B?E.omni?.voice??``:D?.voice??``,H;t[20]!==T?.models||t[21]!==B||t[22]!==z||t[23]!==E.omni||t[24]!==L?(H=B&&E.omni?.provider===`qwen-token-plan-cn`?[{id:E.omni.voice,name:E.omni.voice}]:B?E.omni?.provider===`xopc-cloud`?T?.models.find(e=>e.id===E.omni?.model)?.voice.voices.filter(Fe)??[]:z.length?z:[`Cherry`,`Ethan`,`Serena`,`Chelsie`].map(Pe):L,t[20]=T?.models,t[21]=B,t[22]=z,t[23]=E.omni,t[24]=L,t[25]=H):H=t[25];let U=H,te=!!(x?.enabled&&x.stt),ne=!!(x?.enabled&&x.tts),W;t[26]!==i||t[27]!==s||t[28]!==E?(W=e=>s({...i,voice:{...i.voice,realtime:{...E,...e}}}),t[26]=i,t[27]=s,t[28]=E,t[29]=W):W=t[29];let K=W,re;t[30]!==a||t[31]!==E.enabled||t[32]!==u.disabled||t[33]!==u.needsSetup||t[34]!==u.pending||t[35]!==u.unverified||t[36]!==u.verified||t[37]!==m||t[38]!==g.signature?(re=(e,t)=>E.enabled?a?u.pending:e?t&&g.signature===m?u.verified:u.unverified:u.needsSetup:u.disabled,t[30]=a,t[31]=E.enabled,t[32]=u.disabled,t[33]=u.needsSetup,t[34]=u.pending,t[35]=u.unverified,t[36]=u.verified,t[37]=m,t[38]=g.signature,t[39]=re):re=t[39];let q=re,J;t[40]!==V||t[41]!==l||t[42]!==B||t[43]!==O||t[44]!==E.bargeIn||t[45]!==E.defaultEngine||t[46]!==E.enabled||t[47]!==E.omni||t[48]!==E.tts||t[49]!==u.bargeIn||t[50]!==u.defaultVoice||t[51]!==u.enable||t[52]!==u.voice||t[53]!==n||t[54]!==D||t[55]!==x?.tts||t[56]!==K||t[57]!==r.experience||t[58]!==r.realtime||t[59]!==U?(J=n===`listening`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-sm font-medium text-fg`,children:[(0,Q.jsx)(`span`,{children:u.enable}),(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":E.enabled,className:`ui-checkbox`,checked:E.enabled,onChange:e=>K({enabled:e.target.checked})})]}),(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:r.experience.defaultMode}),(0,Q.jsxs)(d,{value:E.defaultEngine,className:ee,onChange:e=>K({defaultEngine:e.target.value}),children:[(0,Q.jsx)(f,{value:`auto`,children:l===`zh`?`自动选择`:`Automatic`}),(0,Q.jsx)(f,{value:`agent`,children:r.experience.assistant}),(0,Q.jsx)(f,{value:`omni`,children:r.experience.natural})]})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[E.defaultEngine===`agent`?r.experience.assistantHint:r.experience.naturalHint,` `,r.experience.nextCall]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`realtime-voice`,className:`text-sm font-medium text-fg`,children:u.voice}),(0,Q.jsxs)(d,{id:`realtime-voice`,className:`${ee} w-full sm:w-56`,value:V,disabled:B?!E.omni:!D&&!x?.tts,onChange:e=>{if(B&&E.omni){K({omni:{...E.omni,voice:e.target.value}});return}if(O===`alibaba`||O===`xopc-cloud`){let t={...E.tts,provider:O};e.target.value?t.voice=e.target.value:delete t.voice,K({tts:t})}},children:[B?null:(0,Q.jsx)(f,{value:``,children:u.defaultVoice}),V&&!U.some(e=>e.id===V)?(0,Q.jsx)(f,{value:V,children:V}):null,U.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,l),`gender`in e&&e.gender?` · ${e.gender===`female`?`女声`:`男声`}`:``,`style`in e&&e.style?` · ${e.style}`:``]},e.id))]}),(()=>{let e=U.find(e=>e.id===V);return e&&`description`in e&&typeof e.description==`string`?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.description}):null})()]}),(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-4 text-sm text-fg`,children:[(0,Q.jsxs)(`span`,{children:[u.bargeIn,(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:r.realtime.bargeInDescription})]}),(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":E.bargeIn,checked:E.bargeIn,className:`size-4 accent-accent`,onChange:e=>K({bargeIn:e.target.checked})})]})]}):null,t[40]=V,t[41]=l,t[42]=B,t[43]=O,t[44]=E.bargeIn,t[45]=E.defaultEngine,t[46]=E.enabled,t[47]=E.omni,t[48]=E.tts,t[49]=u.bargeIn,t[50]=u.defaultVoice,t[51]=u.enable,t[52]=u.voice,t[53]=n,t[54]=D,t[55]=x?.tts,t[56]=K,t[57]=r.experience,t[58]=r.realtime,t[59]=U,t[60]=J):J=t[60];let ie;t[61]!==te||t[62]!==ne||t[63]!==S||t[64]!==C||t[65]!==a||t[66]!==n||t[67]!==m||t[68]!==x||t[69]!==q||t[70]!==r||t[71]!==g.input||t[72]!==g.output?(ie=n===`diagnostics`?(0,Q.jsxs)(Q.Fragment,{children:[C?(0,Q.jsx)(b,{className:`h-16 w-full`}):(0,Q.jsxs)(`div`,{className:`space-y-2 text-sm`,role:`status`,children:[(0,Q.jsxs)(`p`,{children:[r.experience.dictationReady,` · `,q(te,g.input)]}),(0,Q.jsxs)(`p`,{children:[r.experience.agentReady,` · `,q(te&&ne,g.input&&g.output)]}),(0,Q.jsxs)(`p`,{children:[r.experience.omniReady,` · `,q(!!(x?.enabled&&x.omni),!1)]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.experience.configurationOnly}),(0,Q.jsx)(Me,{v:r,canListen:te,canSpeak:ne,disabled:a||C||!!S,onVerified:e=>_({signature:m,...e})},`${m}:${JSON.stringify(x)}`)]}):null,t[61]=te,t[62]=ne,t[63]=S,t[64]=C,t[65]=a,t[66]=n,t[67]=m,t[68]=x,t[69]=q,t[70]=r,t[71]=g.input,t[72]=g.output,t[73]=ie):ie=t[73];let ae;return t[74]!==u.service||t[75]!==J||t[76]!==ie?(ae=(0,Q.jsxs)(`section`,{className:`space-y-5 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":u.service,children:[J,ie]}),t[74]=u.service,t[75]=J,t[76]=ie,t[77]=ae):ae=t[77],ae}function Pe(e){return{id:e,name:e}}function Fe(e){return Ce(e,`conversation`)}function Ie(e){return[`Cherry`,`Ethan`,`Serena`,`Chelsie`].includes(e.id)}async function Le(e){return Te.parse((await l(e)).payload)}function Re(e){return e.language}function ze(e){let t=(0,X.c)(19),{value:n,onChange:r}=e,i=c(Be)===`zh`,a=i?`通话指令`:`Conversation instructions`,o;t[0]===a?o=t[1]:(o=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:a}),t[0]=a,t[1]=o);let s=i?`通话会接续当前会话。可在这里调整语气与回答方式。`:`Calls continue the current conversation. Adjust tone and response style here.`,l;t[2]===s?l=t[3]:(l=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s}),t[2]=s,t[3]=l);let u=i?`通话指令`:`Conversation instructions`,d;t[4]===u?d=t[5]:(d=(0,Q.jsx)(`span`,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==r||t[7]!==n?(f=e=>r({...n,instructions:e.target.value}),t[6]=r,t[7]=n,t[8]=f):f=t[8];let p;t[9]!==f||t[10]!==n.instructions?(p=(0,Q.jsx)(`textarea`,{className:`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,rows:3,maxLength:8e3,value:n.instructions,onChange:f}),t[9]=f,t[10]=n.instructions,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==o||t[16]!==l||t[17]!==m?(h=(0,Q.jsxs)(`details`,{className:`space-y-3 rounded-xl bg-surface-hover/20 p-4`,children:[o,l,m]}),t[15]=o,t[16]=l,t[17]=m,t[18]=h):h=t[18],h}function Be(e){return e.language}function Ve({disabled:e=!1}){let t=c(e=>e.language),n=t===`zh`,{data:r,error:i,mutate:s}=k(o(_e),me),[l,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(0),_=(0,Z.useId)();(0,Z.useLayoutEffect)(()=>{g(e=>e+1)},[]);let[v,y]=(0,Z.useState)(),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(``),[T,E]=(0,Z.useState)(!1),D=B({disabled:e||x,chat:u(t).chat,onTranscript:()=>{},onTestAudioPlayed:()=>E(!0)}),j=D.phase!==`idle`&&D.phase!==`error`,P=v??r?.voice??`default`,F=r?.credentialSource===`global`;async function I(){try{return await Y()}catch(e){throw e instanceof Error&&`status`in e&&e.status===404?Error(n?`当前 Gateway 版本不支持查看密钥。请更新并重启 Gateway。`:`Update and restart the Gateway to view or copy the saved key.`):e}}async function L(e){if(!(x||j)){S(!0),w(``);try{await s(await de(e),{revalidate:!1}),`apiKey`in e&&(m(``),g(e=>e+1),E(!1),D.cancelVoiceInput()),await A()}catch(e){w(e instanceof Error?e.message:String(e))}finally{S(!1)}}}return(0,Q.jsxs)(`section`,{className:`@container space-y-3 rounded-xl border border-edge bg-surface-panel p-4`,"aria-label":`Boson AI`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Boson AI · Higgs Realtime`}),!r&&!i?(0,Q.jsx)(b,{className:`h-24 w-full`}):null,i?(0,Q.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[n?`无法读取 Boson 设置。`:`Could not load Boson settings.`,(0,Q.jsx)(M,{variant:`ghost`,onClick:()=>void s(),children:n?`重试`:`Retry`})]}):null,r&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`fieldset`,{disabled:e||x||j,className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`label`,{htmlFor:_,className:`text-sm font-medium text-fg`,children:`Boson API Key`}),(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:r.credentialSource===`env`?n?`已从环境读取 BOSON_API_KEY`:`Using BOSON_API_KEY from the environment`:r.credentialSource?n?`已保存 API Key`:`API key saved`:n?`尚未连接`:`Connection needed`})]}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-2 @min-[32rem]:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,Q.jsx)(p,{id:_,value:l||(F?`••••••••••••`:``),onChange:e=>m(e.replace(/^•+/u,``)),autoComplete:`new-password`,inputClassName:`min-h-11`,labels:{show:n?`显示密钥`:`Show key`,hide:n?`隐藏密钥`:`Hide key`,copy:n?`复制密钥`:`Copy key`,copied:n?`已复制`:`Copied`},reveal:F?I:void 0,allowUnrevealedCopy:!0,loadFailedLabel:n?`无法查看已保存的密钥。`:`Could not load the saved key.`,notInConfigFile:n?`当前没有已保存的密钥。`:`There is no saved key.`},`${F}:${h}`),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(M,{className:`min-h-11`,variant:`secondary`,type:`button`,disabled:!l.trim(),onClick:()=>void L({apiKey:l}),children:x?n?`正在保存…`:`Saving…`:n?`保存密钥`:`Save key`}),F&&(0,Q.jsx)(M,{className:`min-h-11`,type:`button`,variant:`ghost`,onClick:()=>void L({apiKey:null}),children:n?`移除已保存密钥`:`Remove saved key`})]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`span`,{children:n?`Higgs 默认音色`:`Default Higgs voice`}),(0,Q.jsx)(d,{"aria-label":n?`Higgs 默认音色`:`Default Higgs voice`,value:P,onChange:e=>{y(e.target.value),E(!1),D.cancelVoiceInput()},children:O.map(e=>(0,Q.jsx)(f,{value:e,children:e==="default"?n?`模型默认`:`Model default`:e},e))})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:P===r.voice||!r.credentialSource,onClick:()=>void L({voice:P}),children:n?`保存音色`:`Save voice`}),(0,Q.jsx)(`span`,{className:`text-sm text-fg-muted`,children:r.defaultForNatural?n?`当前全局自然语音模型`:`Current global natural voice model`:n?`在上方选择全局自然语音模型`:`Choose the global natural voice model above`})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-2 border-t border-edge pt-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n?`测试时请说一句中文,听到回复后可以插话。音频由 Boson 处理,测试内容仅在当前面板显示,可能产生用量。`:`Say a sentence and try interrupting the reply. Boson processes the audio. Test content stays in this panel and may incur usage.`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[j?(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:D.cancelVoiceInput,children:n?`结束测试`:`End test`}):(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:e||x||!r.credentialSource,onClick:()=>{D.cancelVoiceInput(),E(!1),w(``),D.startHiggsTest(P)},children:n?`测试通话`:`Test call`}),r.credentialSource&&!e&&!x&&!j&&(0,Q.jsx)(a,{className:`px-2 text-sm text-accent-fg hover:underline`,to:`/personal`,onClick:N,children:n?`打开 Ada`:`Open Ada`})]}),j&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:D.phase===`recording`?D.responsePhase===`speaking`?n?`正在播放,可以插话`:`Playing reply. You can interrupt.`:n?`麦克风已开启,请说话`:`Microphone on. Say something.`:n?`正在连接测试通话…`:`Connecting test call…`}),T&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-success`,children:n?`测试通过,已播放回复`:`Test passed. Reply played.`}),D.finalTranscript&&(0,Q.jsxs)(`p`,{className:`text-sm text-fg`,children:[n?`转写 · `:`Transcript · `,D.finalTranscript]}),D.responseText&&(0,Q.jsxs)(`p`,{className:`text-sm text-fg`,children:[n?`回复 · `:`Reply · `,D.responseText]})]})]}),(C||D.error)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:C||D.error})]})}var He=U;function Ue(){return y(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,te,`dark:border-edge`)}function $(){return y(ee,U)}function We(e){return!e||e<=0?``:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ge(e,t){let n=window.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return URL.createObjectURL(new Blob([r],{type:t}))}function Ke(e,t){switch(e){case`xopc-cloud`:return t.setup.hosted;case`openai`:return t.stt.openai;case`alibaba`:return t.stt.alibaba;case`groq`:return`Groq`;default:return e}}function qe(e,t){switch(e){case`xopc-cloud`:return t.setup.hosted;case`openai`:return t.tts.providerOpenai;case`alibaba`:return t.stt.alibaba;case`edge`:return t.tts.providerEdge;case`minimax`:return`MiniMax`;default:return e}}function Je(e,t){switch(e){case`edge`:return t.tts.providerHints.edge;case`openai`:return t.tts.providerHints.openai;case`alibaba`:return t.tts.providerHints.alibaba;case`minimax`:return t.tts.providerHints.minimax;default:return t.tts.providerHints.generic}}function Ye(e){return{maskedHelp:e.apiKeyMaskedHelp,copy:e.apiKeyCopy,copied:e.apiKeyCopied,show:e.apiKeyShow,hide:e.apiKeyHide,notInConfigFile:e.apiKeyNotInConfigFile,loadFailed:e.apiKeyRevealFailed}}function Xe(e,t){let n=e[t.key];return typeof n==`string`||typeof n==`number`||typeof n==`boolean`?n:t.defaultValue===void 0?t.type!==`boolean`&&``:t.defaultValue}function Ze(e,t){if(e.type===`boolean`)return!!t;if(e.type!==`number`)return t;let n=String(t).trim();if(!n)return;let r=Number(n);return Number.isFinite(r)?r:void 0}function Qe(e,t){switch(t.type){case`reset`:return{form:null,baseline:null};case`sync`:{let e=structuredClone(t.value);return{form:e,baseline:structuredClone(e)}}case`update`:return{...e,form:t.updater(e.form)};case`saved`:{let n=structuredClone(t.value);return{form:e.form!==null&&JSON.stringify(e.form)!==JSON.stringify(t.value)?e.form:n,baseline:structuredClone(n)}}}}function $e(e){let t=(0,X.c)(10),[n,r]=(0,Z.useState)(0),i;t[0]!==e.capability||t[1]!==e.disabled?(i=e.capability===`conversation`&&(0,Q.jsx)(Ve,{disabled:e.disabled}),t[0]=e.capability,t[1]=e.disabled,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>r(et),t[3]=a):a=t[3];let o;t[4]!==n||t[5]!==e?(o=(0,Q.jsx)(tt,{...e,onReload:a},n),t[4]=n,t[5]=e,t[6]=o):o=t[6];let s;return t[7]!==i||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function et(e){return e+1}function tt({capability:e,onPendingChange:t,disabled:n=!1,onReload:r}){let i=c(e=>e.language),a=u(i).voiceSettings,l=I(e=>e.captions),p=I(e=>e.setCaptions),m=!!s(e=>e.conversationId),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useReducer)(Qe,{form:null,baseline:null}),y=_.form,b=_.baseline,[x,S]=(0,Z.useState)(null),C=(0,Z.useRef)(!1),w=(0,Z.useRef)({}),T=(0,Z.useRef)(y);T.current=y;let E=(0,Z.useRef)({parsed:null,models:void 0}),{data:D,error:O,isLoading:A,mutate:N}=j(m),{data:P,error:F,isLoading:L,mutate:R}=k(m?o(`/api/voice/models`):null,oe,{revalidateOnFocus:!1}),{data:z,error:B,isLoading:V}=k(m?o(`/api/voice/providers`):null,he,{revalidateOnFocus:!1}),{data:H,error:U,isLoading:ee}=k(m?o(`/api/voice/stt-providers`):null,se,{revalidateOnFocus:!1}),te=(0,Z.useMemo)(()=>z?.providers??[],[z]),ne=(0,Z.useMemo)(()=>H?.providers??[],[H]),W=(0,Z.useMemo)(()=>D?.payload?.config===void 0?null:pe(D.payload.config),[D]),G=(0,Z.useMemo)(()=>!y||!b?!1:JSON.stringify(y)!==JSON.stringify(b),[y,b]);m?W!==null&&P!==void 0&&!C.current&&(E.current.parsed!==W||E.current.models!==P)&&(E.current={parsed:W,models:P},w.current=le(D?.payload?.config),v({type:`sync`,value:W}),S(P)):(E.current.parsed!==null||E.current.models!==void 0)&&(E.current={parsed:null,models:void 0},v({type:`reset`}),S(null),C.current=!1);let re=!!(m&&(W===null||P===void 0||z===void 0||H===void 0)&&(A||L||V||ee)),q=O instanceof Error?O.message:O?String(O):F instanceof Error?F.message:F?String(F):B instanceof Error?B.message:B?String(B):U instanceof Error?U.message:U?String(U):null,J=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,stt:{...t.stt,...e},...e.provider&&e.provider!==`xopc-cloud`?{voice:{...t.voice,realtime:{...t.voice.realtime,stt:void 0}}}:{}}:null})},[]),ce=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>{if(!t)return null;let n=t.stt.fallback??{enabled:!1,order:[]};return{...t,stt:{...t.stt,fallback:{...n,...e}}}}})},[]),ue=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,input:{...t.voice.input,refinement:{...t.voice.input.refinement,...e}}}}:null})},[]),de=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,languageMode:e,...e===`auto`?{language:i}:{}}}:null})},[i]),fe=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,voice:{...t.voice,realtime:{...t.voice.realtime,...e}}}:null})},[]),me=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:t=>t?{...t,tts:{...t.tts,...e}}:null})},[]),Y=ae({value:y,dirty:G,onSave:(0,Z.useCallback)(async t=>{try{let n=await ve(t,e,w.current[e]);w.current={...w.current,...n},v({type:`saved`,value:t}),C.current=!!(T.current&&JSON.stringify(T.current)!==JSON.stringify(t))}catch(e){throw Error(e instanceof Error?e.message:a.saveError)}},[a.saveError,e])});(0,Z.useEffect)(()=>{t?.(G||Y.status===`saving`||h)},[G,Y.status,h,t]),(0,Z.useEffect)(()=>()=>t?.(!1),[t]);let ge=(0,Z.useCallback)(e=>{C.current=!0,v({type:`update`,updater:()=>e})},[]);if(!m)return(0,Q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a.needToken})});if(re)return(0,Q.jsx)(K,{rows:4});if(!y||x===null)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:q??a.loadError}),(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:()=>{N(),R()},children:a.retry})]});let _e=y.stt,ye=y.tts,be=y.voice.input.refinement,xe=Ye(a);return(0,Q.jsxs)(`fieldset`,{disabled:n||h,className:`flex min-w-0 flex-col gap-4`,onBlurCapture:Y.error?void 0:Y.onBlurCapture,children:[(0,Q.jsx)(ie,{status:Y.status,error:Y.error}),Y.error?(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(M,{variant:`secondary`,onClick:Y.retry,children:i===`zh`?`重试保存`:`Retry saving`}),(0,Q.jsx)(M,{variant:`ghost`,onClick:()=>{N().then(()=>r()).catch(()=>{})},children:i===`zh`?`重新加载(放弃未保存更改)`:`Reload and discard unsaved changes`})]}):null,e===`transcription`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ae,{zh:i===`zh`}),(0,Q.jsx)(it,{managedModel:!0,v:a,apiKeyLabels:xe,stt:_e,models:x,sttProviders:ne,updateStt:J,updateSttFallback:ce}),(0,Q.jsx)(rt,{v:a,voice:y.voice,updateLanguageMode:de}),(0,Q.jsxs)(`details`,{"data-voice-section":`input-processing`,className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[a.experience.inputProcessing,` · `,be.mode===`off`?a.stt.refinementOff:be.mode===`punctuation`?a.stt.refinementPunctuation:be.mode===`light`?a.stt.refinementLight:a.setup.advanced]}),(0,Q.jsxs)(`label`,{className:`mt-4 block space-y-2 text-sm`,children:[(0,Q.jsx)(`span`,{children:a.stt.refinement}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.stt.refinementDesc}),(0,Q.jsxs)(d,{className:$(),value:be.mode,onChange:e=>ue({mode:e.target.value}),children:[(0,Q.jsx)(f,{value:`off`,children:a.stt.refinementOff}),(0,Q.jsx)(f,{value:`punctuation`,children:a.stt.refinementPunctuation}),(0,Q.jsx)(f,{value:`light`,children:a.stt.refinementLight}),be.mode===`custom`?(0,Q.jsx)(f,{value:`custom`,children:a.setup.advanced}):null]})]})]}),_e.provider===`xopc-cloud`?(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`实时听写`:`Live dictation`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ee,{modes:[`transcription.stream`],disabled:G||Y.status===`saving`,onPendingChange:g})})]}):null]}):e===`speech`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ot,{managedModel:!0,v:a,apiKeyLabels:xe,tts:ye,models:x,ttsProviders:te,updateTts:me}),(0,Q.jsx)(nt,{v:a,tts:ye,updateTts:me})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ne,{section:`listening`,v:a,form:y,pending:G||Y.status===`saving`||!!Y.error,onChange:ge}),y.voice.realtime.defaultEngine===`omni`&&y.voice.realtime.omni?(0,Q.jsx)(ze,{value:y.voice.realtime.omni,onChange:e=>fe({omni:e})}):null,(0,Q.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(12rem,18rem)] sm:items-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:a.experience.pace}),(0,Q.jsxs)(d,{className:$(),value:String(y.voice.realtime.silenceDurationMs),onChange:e=>fe({silenceDurationMs:Number(e.target.value)}),children:[(0,Q.jsx)(f,{value:`800`,children:a.experience.fast}),(0,Q.jsx)(f,{value:`1200`,children:a.experience.standard}),(0,Q.jsx)(f,{value:`2000`,children:a.experience.relaxed}),[800,1200,2e3].includes(y.voice.realtime.silenceDurationMs)?null:(0,Q.jsxs)(f,{value:String(y.voice.realtime.silenceDurationMs),children:[y.voice.realtime.silenceDurationMs,` ms`]})]})]})}),(0,Q.jsxs)(`label`,{className:`flex items-center justify-between text-sm`,children:[a.experience.captions,(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":l,className:`ui-checkbox`,checked:l,onChange:e=>p(e.target.checked)})]}),y.voice.realtime.defaultEngine===`agent`&&_e.provider===`xopc-cloud`?(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`语音助手输出`:`Assistant speech output`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ee,{modes:[`speech.stream`],disabled:G||Y.status===`saving`,onPendingChange:g})})]}):null,(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:i===`zh`?`麦克风、扬声器与诊断`:`Microphone, speakers and diagnostics`}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(De,{v:a}),(0,Q.jsx)(Ne,{section:`diagnostics`,v:a,form:y,pending:G||Y.status===`saving`||!!Y.error,onChange:ge})]})]})]})]})}function nt(e){let t=(0,X.c)(29),{v:n,tts:r,updateTts:i}=e,a;t[0]===n.setup.readout?a=t[1]:(a=(0,Q.jsx)(`span`,{className:`font-medium`,children:n.setup.readout}),t[0]=n.setup.readout,t[1]=a);let o=n.setup.readout,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=$(),t[2]=s):s=t[2];let c=r.enabled?r.trigger:`off`,l;t[3]===i?l=t[4]:(l=e=>i({enabled:e.target.value!==`off`,trigger:e.target.value}),t[3]=i,t[4]=l);let u;t[5]===n.tts.triggerOff?u=t[6]:(u=(0,Q.jsx)(f,{value:`off`,children:n.tts.triggerOff}),t[5]=n.tts.triggerOff,t[6]=u);let p;t[7]===n.tts.triggerInbound?p=t[8]:(p=(0,Q.jsx)(f,{value:`inbound`,children:n.tts.triggerInbound}),t[7]=n.tts.triggerInbound,t[8]=p);let m;t[9]===n.tts.triggerAlways?m=t[10]:(m=(0,Q.jsx)(f,{value:`always`,children:n.tts.triggerAlways}),t[9]=n.tts.triggerAlways,t[10]=m);let h;t[11]===n.tts.triggerTagged?h=t[12]:(h=(0,Q.jsx)(f,{value:`tagged`,children:n.tts.triggerTagged}),t[11]=n.tts.triggerTagged,t[12]=h);let g;t[13]!==c||t[14]!==l||t[15]!==u||t[16]!==p||t[17]!==m||t[18]!==h||t[19]!==n.setup.readout?(g=(0,Q.jsxs)(d,{"aria-label":o,className:s,value:c,onChange:l,children:[u,p,m,h]}),t[13]=c,t[14]=l,t[15]=u,t[16]=p,t[17]=m,t[18]=h,t[19]=n.setup.readout,t[20]=g):g=t[20];let _;t[21]!==a||t[22]!==g?(_=(0,Q.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[a,g]}),t[21]=a,t[22]=g,t[23]=_):_=t[23];let v;t[24]===n.setup.readoutHint?v=t[25]:(v=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.setup.readoutHint}),t[24]=n.setup.readoutHint,t[25]=v);let y;return t[26]!==_||t[27]!==v?(y=(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,children:[_,v]}),t[26]=_,t[27]=v,t[28]=y):y=t[28],y}function rt(e){let t=(0,X.c)(22),{v:n,voice:r,updateLanguageMode:i}=e,a;t[0]===n.language.title?a=t[1]:(a=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.language.title}),t[0]=n.language.title,t[1]=a);let o=r.languageMode===`auto`?n.language.autoDescription:n.language.manualDescription,s;t[2]===o?s=t[3]:(s=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o}),t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==s?(c=(0,Q.jsxs)(`div`,{children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=$(),t[7]=l):l=t[7];let u;t[8]===i?u=t[9]:(u=e=>i(e.target.value),t[8]=i,t[9]=u);let p;t[10]===n.language.auto?p=t[11]:(p=(0,Q.jsx)(f,{value:`auto`,children:n.language.auto}),t[10]=n.language.auto,t[11]=p);let m;t[12]===n.language.manual?m=t[13]:(m=(0,Q.jsx)(f,{value:`manual`,children:n.language.manual}),t[12]=n.language.manual,t[13]=m);let h;t[14]!==u||t[15]!==p||t[16]!==m||t[17]!==r.languageMode?(h=(0,Q.jsxs)(d,{className:l,value:r.languageMode,onChange:u,children:[p,m]}),t[14]=u,t[15]=p,t[16]=m,t[17]=r.languageMode,t[18]=h):h=t[18];let g;return t[19]!==c||t[20]!==h?(g=(0,Q.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(12rem,18rem)] sm:items-center`,children:[c,h]})}),t[19]=c,t[20]=h,t[21]=g):g=t[21],g}function it(e){let t=(0,X.c)(65),{v:n,apiKeyLabels:r,stt:i,models:a,sttProviders:o,updateStt:s,updateSttFallback:c,managedModel:l}=e,u=l!==void 0&&l,p;if(t[0]!==o){let e=new Set;p=[];for(let t of o)e.has(t.id)||(e.add(t.id),p.push(t));t[0]=o,t[1]=p}else p=t[1];let m=p,g,_,v,b;if(t[2]!==a||t[3]!==m||t[4]!==i.provider||t[5]!==i.providers){g=m.find(e=>e.id===i.provider);let e;t[10]!==i.provider||t[11]!==i.providers?(e=i.providers?.[i.provider]??{},t[10]=i.provider,t[11]=i.providers,t[12]=e):e=t[12],v=e,_=a?.stt?.[i.provider]?.length?a.stt[i.provider]:g?.models??[],b=g?.fields.find(at),t[2]=a,t[3]=m,t[4]=i.provider,t[5]=i.providers,t[6]=g,t[7]=_,t[8]=v,t[9]=b}else g=t[6],_=t[7],v=t[8],b=t[9];let x=b,S=typeof v.model==`string`?v.model:void 0,C=S??(typeof x?.defaultValue==`string`?x.defaultValue:_[0]?.id),w;t[13]!==i.provider||t[14]!==i.providers||t[15]!==s?(w=e=>{s({providers:{...i.providers??{},[i.provider]:{...i.providers?.[i.provider]??{},...e}}})},t[13]=i.provider,t[14]=i.providers,t[15]=s,t[16]=w):w=t[16];let T=w,E,D;t[17]!==S||t[18]!==C||t[19]!==u||t[20]!==x||t[21]!==T?(E=()=>{!u&&x&&C&&S!==C&&T({model:C})},D=[u,S,C,x,T],t[17]=S,t[18]=C,t[19]=u,t[20]=x,t[21]=T,t[22]=E,t[23]=D):(E=t[22],D=t[23]),(0,Z.useEffect)(E,D);let O;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent`,strokeWidth:1.75}),t[24]=O):O=t[24];let k;t[25]===n.stt.title?k=t[26]:(k=(0,Q.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[O,n.stt.title]}),t[25]=n.stt.title,t[26]=k);let A;t[27]===n.stt.enable?A=t[28]:(A=(0,Q.jsx)(`span`,{children:n.stt.enable}),t[27]=n.stt.enable,t[28]=A);let j;t[29]===s?j=t[30]:(j=e=>s({enabled:e.target.checked}),t[29]=s,t[30]=j);let M;t[31]!==i.enabled||t[32]!==j?(M=(0,Q.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":i.enabled,className:`ui-checkbox`,checked:i.enabled,onChange:j}),t[31]=i.enabled,t[32]=j,t[33]=M):M=t[33];let N;t[34]!==M||t[35]!==A?(N=(0,Q.jsxs)(`label`,{className:`flex min-h-10 items-center gap-2 text-xs text-fg-muted`,children:[A,M]}),t[34]=M,t[35]=A,t[36]=N):N=t[36];let P;t[37]!==N||t[38]!==k?(P=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[k,N]}),t[37]=N,t[38]=k,t[39]=P):P=t[39];let F;t[40]===n.stt.description?F=t[41]:(F=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.stt.description}),t[40]=n.stt.description,t[41]=F);let I;t[42]!==P||t[43]!==F?(I=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[P,F]}),t[42]=P,t[43]=F,t[44]=I):I=t[44];let L;t[45]!==g?.fields||t[46]!==r||t[47]!==C||t[48]!==u||t[49]!==_||t[50]!==m||t[51]!==v||t[52]!==i.enabled||t[53]!==i.fallback?.enabled||t[54]!==i.provider||t[55]!==T||t[56]!==s||t[57]!==c||t[58]!==n?(L=i.enabled?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[u?null:(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{children:n.stt.provider}),(0,Q.jsx)(d,{"aria-label":n.stt.provider,className:$(),value:i.provider,onChange:e=>s({provider:e.target.value}),children:m.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[Ke(e.id,n),e.configured?``:` *`]},e.id))})]}),(0,Q.jsx)(st,{managedModel:u,kind:`stt`,providerId:i.provider,fields:g?.fields??[],providerSlice:v,models:_,currentModel:C,apiKeyLabels:r,onPatch:T})]}),i.provider===`alibaba`?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.setup.keyHint}):null,(0,Q.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:n.stt.fallback}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.stt.fallback}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.stt.fallbackDesc})]}),(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i.fallback?.enabled??!1,onChange:e=>c({enabled:e.target.checked})})]})]})]}):null,t[45]=g?.fields,t[46]=r,t[47]=C,t[48]=u,t[49]=_,t[50]=m,t[51]=v,t[52]=i.enabled,t[53]=i.fallback?.enabled,t[54]=i.provider,t[55]=T,t[56]=s,t[57]=c,t[58]=n,t[59]=L):L=t[59];let R;t[60]===L?R=t[61]:(R=(0,Q.jsx)(`div`,{className:`space-y-4`,children:L}),t[60]=L,t[61]=R);let z;return t[62]!==I||t[63]!==R?(z=(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:[I,R]}),t[62]=I,t[63]=R,t[64]=z):z=t[64],z}function at(e){return e.key===`model`}function ot({v:e,apiKeyLabels:t,tts:n,models:r,ttsProviders:i,updateTts:a,managedModel:o=!1}){let[s,c]=(0,Z.useState)(e.tts.test.sampleText),[l,u]=(0,Z.useState)({status:`idle`}),p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x=(0,Z.useCallback)(()=>{b.current?.abort(),b.current=null,p.current?.pause(),p.current=null,h.current&&=(URL.revokeObjectURL(h.current),null)},[]),S=(0,Z.useMemo)(()=>{let e=new Set,t=[];for(let n of i)e.has(n.id)||(e.add(n.id),t.push(n));return t},[i]),C=S.find(e=>e.id===n.provider),w=n.providers?.[n.provider]??{},T=r?.tts?.[n.provider]?.length?r.tts[n.provider]:C?.models??[],E=C?.fields.find(e=>e.key===`model`),D=C?.fields.find(e=>e.key===`voice`),O=typeof w.model==`string`?w.model:void 0,A=O??(typeof E?.defaultValue==`string`?E.defaultValue:T[0]?.id),j=T.find(e=>e.id===A),N=r?.ttsVoices?.[n.provider]?.length?r.ttsVoices[n.provider]:C?.voices??[],{data:P=[]}=k(A?`voice:tts:${n.provider}:${A}`:null,()=>fe(n.provider,A??``),{revalidateOnFocus:!1}),F=P.length>0?P:N,I=typeof w.voice==`string`?w.voice:void 0,L=I??F.find(e=>e.id===j?.tts?.defaultVoice)?.id??(typeof D?.defaultValue==`string`?D.defaultValue:F[0]?.id),R=(C?.fields??[]).filter(e=>(e.key!==`speed`||j?.tts?.speed!==!1)&&(e.key!==`instructions`||j?.tts?.instructions!==!1)),z=(0,Z.useCallback)(e=>{a({providers:{...n.providers??{},[n.provider]:{...n.providers?.[n.provider]??{},...e}}})},[n.provider,n.providers,a]);(0,Z.useEffect)(()=>{if(o)return;let e={};E&&A&&O!==A&&(e.model=A),D&&L&&I!==L&&(e.voice=L),Object.keys(e).length>0&&z(e)},[o,O,I,A,L,E,z,D]),(0,Z.useEffect)(()=>()=>x(),[x]);let B=(0,Z.useCallback)(e=>{a({provider:e}),u({status:`idle`})},[a]),V=(0,Z.useCallback)(async()=>{let t=s.trim();if(!t){u({status:`error`,message:e.tts.test.emptyText});return}x();let r=new AbortController;b.current=r,u({status:`loading`});try{let i=await ue({text:t,provider:n.provider,providerConfig:w,...A?{model:A}:{},...L?{voice:L}:{}},r.signal);if(r.signal.aborted)return;let a=Ge(i.audio,i.mimeType);h.current=a;let o=new Audio(a);p.current=o;let s=[i.provider,i.format,i.latencyMs===void 0?void 0:`${i.latencyMs}ms`,We(i.audioSize)].filter(Boolean).join(` · `);o.addEventListener(`ended`,()=>u({status:`done`,summary:s}),{once:!0}),o.addEventListener(`error`,()=>u({status:`error`,message:e.tts.test.playFailed}),{once:!0}),await o.play(),u({status:`playing`,summary:s})}catch(e){if(r.signal.aborted)return;x(),u({status:`error`,message:e instanceof Error?e.message:String(e)})}},[A,L,w,x,s,n.provider,e.tts.test.emptyText,e.tts.test.playFailed]);return(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-5 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mb-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(v,{className:`size-4 text-accent`,strokeWidth:1.75}),e.tts.title]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.tts.description})]}),(0,Q.jsx)(`div`,{className:`space-y-4`,children:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:o?null:(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{children:e.tts.provider}),(0,Q.jsx)(d,{"aria-label":e.tts.provider,className:$(),value:n.provider,onChange:e=>B(e.target.value),children:S.map(t=>(0,Q.jsx)(f,{value:t.id,children:qe(t.id,e)},t.id))}),(0,Q.jsxs)(`p`,{className:`text-xs text-fg-subtle`,children:[C?.configured?e.tts.configured:C?.diagnostics.requiresApiKey?`${e.tts.needsKey} · ${C.diagnostics.envKeys?.join(`, `)??e.stt.apiKey}`:e.tts.noKeyNeeded,` · `,C?.description??Je(n.provider,e)]})]})}),(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:(0,Q.jsx)(st,{managedModel:o,kind:`tts`,providerId:n.provider,fields:R,providerSlice:w,models:T,voices:F,currentModel:A,currentVoice:L,apiKeyLabels:t,onPatch:z,resetVoiceOnModelChange:!0})}),(0,Q.jsxs)(`details`,{className:`rounded-xl bg-surface-panel/80 p-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:e.tts.test.title}),(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.tts.test.description})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,Q.jsxs)(M,{type:`button`,variant:`primary`,onClick:()=>void V(),disabled:l.status===`loading`,className:`h-9`,children:[l.status===`loading`?(0,Q.jsx)(m,{className:`size-4 animate-spin`}):(0,Q.jsx)(g,{className:`size-4`}),l.status===`loading`?e.tts.test.generating:e.tts.test.play]}),(0,Q.jsxs)(M,{type:`button`,variant:`secondary`,onClick:()=>{x(),u(e=>e.status===`playing`?{status:`done`,summary:e.summary}:{status:`idle`})},disabled:l.status!==`playing`,className:`h-9`,children:[(0,Q.jsx)(_,{className:`size-4`}),e.tts.test.stop]})]})]}),(0,Q.jsxs)(`details`,{className:`mt-3`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:e.setup.sampleText}),(0,Q.jsx)(`textarea`,{className:y(Ue(),`mt-3 min-h-20 resize-y`),value:s,onChange:e=>c(e.target.value),maxLength:1e3})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-subtle`,children:[s.length,`/1000`]}),l.status===`playing`||l.status===`done`?(0,Q.jsxs)(`span`,{className:`text-emerald-700 dark:text-emerald-200`,children:[l.status===`playing`?e.tts.test.playing:e.tts.test.ready,` · `,l.summary]}):null,l.status===`error`?(0,Q.jsx)(`span`,{className:`text-red-600 dark:text-red-400`,children:l.message}):null]})]})]})]})})]})}function st(e){let t=(0,X.c)(48),{kind:n,providerId:r,fields:i,providerSlice:a,models:o,voices:s,currentModel:l,currentVoice:p,apiKeyLabels:m,onPatch:h,resetVoiceOnModelChange:g,managedModel:_}=e,v;t[0]===s?v=t[1]:(v=s===void 0?[]:s,t[0]=s,t[1]=v);let b=v,x=g!==void 0&&g,S=_!==void 0&&_,C=c(dt),w;t[2]===C?w=t[3]:(w=u(C),t[2]=C,t[3]=w);let T=w.voiceSettings,E=S,D=ut,O=lt,k,A,j;if(t[4]!==m||t[5]!==l||t[6]!==p||t[7]!==i||t[8]!==n||t[9]!==C||t[10]!==S||t[11]!==o||t[12]!==h||t[13]!==r||t[14]!==a||t[15]!==x||t[16]!==E||t[17]!==T||t[18]!==b){let e;t[22]===E?e=t[23]:(e=e=>!E||e.key!==`model`&&!O(e),t[22]=E,t[23]=e);let s=i.filter(e),c;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!D(e),t[24]=c):c=t[24];let u=s.filter(c),g;t[25]!==m||t[26]!==l||t[27]!==p||t[28]!==n||t[29]!==C||t[30]!==S||t[31]!==o||t[32]!==h||t[33]!==r||t[34]!==a||t[35]!==x||t[36]!==T||t[37]!==b?(g=e=>e.map(e=>S&&e.key===`model`?null:e.key===`apiKey`?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-api-key`,children:T.stt.apiKey}),(0,Q.jsx)(ye,{kind:n,providerId:r,fieldId:`voice-${n}-${r}-api-key`,value:typeof a.apiKey==`string`?a.apiKey:``,onChange:e=>h({apiKey:e}),labels:m,placeholder:e.placeholder}),e.description?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:e.description}):null]},e.key):e.key===`model`&&o.length>0?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-model`,children:T.stt.model}),(0,Q.jsx)(d,{id:`voice-${n}-${r}-model`,className:$(),value:l??``,onChange:e=>h({model:e.target.value,...x?{voice:void 0}:{}}),children:[...o].sort(W).map(ct)})]},e.key):e.key===`voice`&&b.length>0?(0,Q.jsxs)(`div`,{className:y(`flex flex-col gap-1.5`,He),children:[(0,Q.jsx)(mt,{htmlFor:`voice-${n}-${r}-voice`,children:T.tts.voice}),(0,Q.jsxs)(d,{id:`voice-${n}-${r}-voice`,className:$(),value:p??``,onChange:e=>h({voice:e.target.value}),children:[p&&!b.some(e=>e.id===p)?(0,Q.jsxs)(f,{value:p,children:[p,` · unavailable`]}):null,b.map(e=>(0,Q.jsxs)(f,{value:e.id,children:[G(e,C),e.gender?` · ${e.gender===`female`?`女声`:`男声`}`:``,e.style?` · ${e.style}`:``]},e.id))]}),b.find(e=>e.id===p)?.description?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:b.find(e=>e.id===p)?.description}):null]},e.key):(0,Q.jsx)(ft,{fieldId:`voice-${n}-${r}-${e.key}`,field:e,value:Xe(a,e),onChange:t=>h({[e.key]:t}),className:e.type===`textarea`?`sm:col-span-2`:He},e.key)),t[25]=m,t[26]=l,t[27]=p,t[28]=n,t[29]=C,t[30]=S,t[31]=o,t[32]=h,t[33]=r,t[34]=a,t[35]=x,t[36]=T,t[37]=b,t[38]=g):g=t[38];let _=g;t[39]!==i||t[40]!==n||t[41]!==C||t[42]!==E?(k=E&&i.some(O)?(0,Q.jsx)(ke,{className:`text-sm text-accent-fg hover:underline`,to:`/settings/capabilities/models?tab=services&configure=${n===`stt`?`transcription`:`speech`}`,children:C===`zh`?`管理服务连接`:`Manage service connection`}):null,t[39]=i,t[40]=n,t[41]=C,t[42]=E,t[43]=k):k=t[43],A=_(s.filter(D)),j=u.length?(0,Q.jsxs)(`details`,{className:`rounded-lg border border-edge p-3 sm:col-span-2`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:T.experience.providerOptions}),(0,Q.jsx)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:_(u)})]}):null,t[4]=m,t[5]=l,t[6]=p,t[7]=i,t[8]=n,t[9]=C,t[10]=S,t[11]=o,t[12]=h,t[13]=r,t[14]=a,t[15]=x,t[16]=E,t[17]=T,t[18]=b,t[19]=k,t[20]=A,t[21]=j}else k=t[19],A=t[20],j=t[21];let M;return t[44]!==k||t[45]!==A||t[46]!==j?(M=(0,Q.jsxs)(Q.Fragment,{children:[k,A,j]}),t[44]=k,t[45]=A,t[46]=j,t[47]=M):M=t[47],M}function ct(e){return(0,Q.jsx)(f,{value:e.id,children:e.name},e.id)}function lt(e){return e.secret||e.type===`password`||[`apiKey`,`baseUrl`,`region`,`groupId`].includes(e.key)}function ut(e){return e.required||[`apiKey`,`model`,`voice`].includes(e.key)}function dt(e){return e.language}function ft(e){let t=(0,X.c)(37),{fieldId:n,field:r,value:i,onChange:a,className:o}=e,s=n??`voice-schema-field-${r.key}`,c=r.description;if(r.type===`boolean`){let e;t[0]===o?e=t[1]:(e=y(`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,o),t[0]=o,t[1]=e);let n;t[2]===r.label?n=t[3]:(n=(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.label}),t[2]=r.label,t[3]=n);let s;t[4]===c?s=t[5]:(s=c?(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:c}):null,t[4]=c,t[5]=s);let l;t[6]!==n||t[7]!==s?(l=(0,Q.jsxs)(`span`,{children:[n,s]}),t[6]=n,t[7]=s,t[8]=l):l=t[8];let u=!!i,d;t[9]!==r||t[10]!==a?(d=e=>a(Ze(r,e.target.checked)),t[9]=r,t[10]=a,t[11]=d):d=t[11];let f;t[12]!==u||t[13]!==d?(f=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:u,onChange:d}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==e||t[16]!==l||t[17]!==f?(p=(0,Q.jsxs)(`label`,{className:e,children:[l,f]}),t[15]=e,t[16]=l,t[17]=f,t[18]=p):p=t[18],p}let l=typeof i==`boolean`?``:String(i),u;t[19]===o?u=t[20]:(u=y(`flex flex-col gap-1.5`,o),t[19]=o,t[20]=u);let f;t[21]!==r.label||t[22]!==s?(f=(0,Q.jsx)(mt,{htmlFor:s,children:r.label}),t[21]=r.label,t[22]=s,t[23]=f):f=t[23];let m;t[24]!==o||t[25]!==r||t[26]!==l||t[27]!==s||t[28]!==a?(m=r.type===`select`?(0,Q.jsx)(d,{id:s,className:$(),value:l,required:r.required,onChange:e=>a(Ze(r,e.target.value)),children:(r.options??[]).map(pt)}):r.type===`textarea`?(0,Q.jsx)(`textarea`,{id:s,className:y(Ue(),`min-h-24 resize-y`),value:l,required:r.required,placeholder:r.placeholder,onChange:e=>a(Ze(r,e.target.value))}):r.type===`password`?(0,Q.jsx)(p,{id:s,className:o,value:l,onChange:e=>a(Ze(r,e)),placeholder:r.placeholder,labels:ne}):r.type===`number`?(0,Q.jsx)(J,{id:s,className:Ue(),autoComplete:r.secret?`new-password`:`off`,spellCheck:!1,value:l,required:r.required,allowEmpty:!r.required,placeholder:r.placeholder,min:r.min,max:r.max,step:r.step,onChange:e=>a(Ze(r,e.target.value))}):(0,Q.jsx)(`input`,{id:s,className:Ue(),type:`text`,autoComplete:r.secret?`new-password`:`off`,spellCheck:!1,value:l,required:r.required,placeholder:r.placeholder,min:r.min,max:r.max,step:r.step,onChange:e=>a(Ze(r,e.target.value))}),t[24]=o,t[25]=r,t[26]=l,t[27]=s,t[28]=a,t[29]=m):m=t[29];let h;t[30]===c?h=t[31]:(h=c?(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:c}):null,t[30]=c,t[31]=h);let g;return t[32]!==u||t[33]!==f||t[34]!==m||t[35]!==h?(g=(0,Q.jsxs)(`div`,{className:u,children:[f,m,h]}),t[32]=u,t[33]=f,t[34]=m,t[35]=h,t[36]=g):g=t[36],g}function pt(e){return(0,Q.jsx)(f,{value:e.id,children:e.name},e.id)}function mt(e){let t=(0,X.c)(3),{children:n,htmlFor:r}=e,i;return t[0]!==n||t[1]!==r?(i=r?(0,Q.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium text-fg`,children:n}):(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}export{Oe as n,$e as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-manager-63NaXb1s.js","assets/rolldown-runtime-aKtaBQYM.js","assets/diagnostics-Bo0Z42P_.js","assets/locale-store-Dy1EByeG.js","assets/vendor-react-BOUWij0V.js","assets/messages-BAnhwALN.js","assets/schemas-CCWMleym.js","assets/constants-Bg1wM2nv.js","assets/session-api-BFiIYodK.js","assets/gateway-startup-retry-D6WPS0RW.js","assets/local-session-drafts-BIBHRkpM.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BIOUBrpT.js","assets/gateway-realtime-DIs1pjkQ.js","assets/gateway-realtime-store-sx7B8kdC.js","assets/registry-api-DuDIthjL.js","assets/preload-helper-Czpn1I53.js","assets/agents-admin-api-D0N09mqJ.js","assets/gateway-config-swr-1Rk0LeEM.js","assets/vendor-swr-CdRzEUwF.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-Czpn1I53.js";import{a as t,i as n}from"./locale-store-Dy1EByeG.js";import{i as r,n as i,r as a,t as o}from"./files-BNL4kkSB.js";async function s(e){let t=await e.json().catch(()=>null);return Error(t?.error?.message??`HTTP ${e.status}`)}async function c(e,r){let i=await t(n(e),r);if(!i.ok)throw await s(i);return i.json()}async function l(t){if(!t?.projectId&&t?.conversationId){let{SessionManager:n}=await e(async()=>{let{SessionManager:e}=await import(`./session-manager-63NaXb1s.js`).then(e=>e.n);return{SessionManager:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));await new n().materialize(t.conversationId,`session_resources`)}let n=t?.projectId?{kind:`project`,id:t.projectId}:t?.conversationId?{kind:`session`,id:t.conversationId}:t?.agentId?{kind:`agent`,id:t.agentId}:null;if(n){let e=await c(`/api/files/contexts/${n.kind}/${encodeURIComponent(n.id)}`);return r.parse(e.space)}let i=await c(`/api/files/default-space`);return r.parse(i.space)}function u(e){return{id:e.id,name:e.name,path:e.relativePath,isDirectory:e.kind===`directory`,mimeType:e.mimeType,revision:e.revision}}async function d(e,t){let n=await l(t),r=await c(`/api/files/resolve`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,taskRunId:t?.taskRunId})});return i.parse(r.resource)}async function f(e,t){return d(e,t)}async function p(e=``,t){let n=await l(t),r=new URLSearchParams;return e&&r.set(`path`,e),{entries:a.parse(await c(`/api/files/spaces/${encodeURIComponent(n.id)}/children${r.size?`?${r}`:``}`)).items.map(u)}}async function m(e=``,t){return(await p(e,t)).entries}async function h(e){let t=await l(e);return u(o.parse(await c(`/api/files/spaces/${encodeURIComponent(t.id)}/root`)).resource)}async function g(e,t,n=50){let r=await l(t),i=new URLSearchParams({q:e.trim(),limit:String(n),spaceId:r.id});return a.parse(await c(`/api/files/search?${i}`)).items.map(u)}async function _(e,r){let i=await d(e,r),a=await t(n(`/api/files/${encodeURIComponent(i.id)}/content`));if(!a.ok)throw await s(a);return{content:await a.text(),path:i.relativePath,mtimeMs:i.modifiedAt,revision:a.headers.get(`ETag`)??i.revision}}async function v(e,t){let n;try{n=await l(t)}catch{return null}try{let r=await c(`/api/files/resolve`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,taskRunId:t?.taskRunId})}),a=i.parse(r.resource);return{absolutePath:r.absolutePath,fileId:a.id,inputPath:e,displayName:a.name,scope:r.absolutePath?`external`:`workspace`,locationKind:r.absolutePath?`host`:`workspace`,exists:!0,isDirectory:a.kind===`directory`,workspaceRelativePath:a.relativePath,capabilities:a.capabilities.filter(e=>e===`preview`||e===`edit`),mtimeMs:a.modifiedAt}}catch{try{return(await c(`/api/files/resolve-reference`,{method:`POST`,body:JSON.stringify({spaceId:n.id,path:e,conversationId:t?.conversationId})})).reference}catch{return null}}}async function y(e,t,n){return await c(`/api/files/references/${encodeURIComponent(e)}/action`,{method:`POST`,body:JSON.stringify({action:t,conversationId:n?.conversationId})})}async function b(e,r){let i=await d(e,r),a=await t(n(`/api/files/${encodeURIComponent(i.id)}/content`),{headers:{Accept:`*/*`}});if(!a.ok)throw await s(a);return a.blob()}async function x(e,t,n,r){let a=await d(e,n),o=await c(`/api/files/${encodeURIComponent(a.id)}/content`,{method:`PUT`,body:JSON.stringify({content:t,revision:r??a.revision})}),s=i.parse(o.resource);return{path:s.relativePath,mtimeMs:s.modifiedAt,revision:s.revision}}async function S(e,r=``,i){let a=await l(i),c=new FormData;c.set(`directory`,r),c.set(`file`,e);let d=await t(n(`/api/files/spaces/${encodeURIComponent(a.id)}/upload`),{method:`POST`,body:c});if(!d.ok)throw await s(d);return u(o.parse(await d.json()).resource)}async function C(e){let r=await t(n(`/api/files/${encodeURIComponent(e)}`),{method:`DELETE`});if(!r.ok)throw await s(r)}function w(e,t){let n=new Blob([t],{type:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function T(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}export{b as a,_ as c,f as d,g as f,p as i,y as l,x as m,T as n,h as o,S as p,w as r,m as s,C as t,v as u};
@@ -1 +1 @@
1
- import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-Dy1EByeG.js";import{t as a}from"./messages-BAnhwALN.js";import{c as o,m as s,n as c,o as l,s as u,t as d}from"./use-file-preview-expanded-BXXeXnT0.js";import{n as f}from"./share-link-dialog-C1t_HB6f.js";import{t as p}from"./cn-0WouolD0.js";import{t as m}from"./skeleton-DzdOeGYz.js";import{n as h}from"./right-workspace-store-HPw7Gw0n.js";import{t as ee}from"./copy-to-clipboard-HOJ79TWv.js";import{t as g}from"./composer-notifications-CqV6Xj-H.js";import{i as _}from"./theme-store-BaWep_o7.js";import{n as v}from"./electron-env-DHOGevH3.js";import{a as y,t as b}from"./file-preview-surface-i5UOFnQF.js";var x=e(n(),1);async function S(e,t){try{let n=await e();return n&&`ok`in n&&n.code===`CANCELED`?!1:n&&(`ok`in n?n.ok:n.success)?!0:(g(`warning`,n?.error||t,void 0,{duration:4e3}),!1)}catch{return g(`warning`,t,void 0,{duration:4e3}),!1}}var C=new Map;function w(e,t){return C.set(e,t),()=>{C.get(e)===t&&C.delete(e)}}async function T(e){return await C.get(e)?.()??!0}var E=t({WorkspaceFilePreviewPanel:()=>j}),D=r(),O=new Intl.DateTimeFormat(`zh-CN`,{dateStyle:`medium`,timeStyle:`short`}),k=new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`});function A(e,t){return(t===`zh`?O:k).format(new Date(e))}function j({filePath:e,tabId:t,active:n=!0,onClose:r,targetLine:C,resultRevision:T,projectId:E,conversationId:O,agentId:k}){let j=i(e=>e.language),M=a(j),N=_(e=>e.resolved),P=o({filePath:e,projectId:E,conversationId:O,agentId:k,initialEditMode:t?l(t).sourceEditMode:!1}),{dialogOpen:F,loading:I,result:L,error:R,pendingParams:z,createShareLink:B,confirmShareLink:V,handleOpenChange:H}=y(),[U,W]=(0,x.useState)(!1),[G,K]=(0,x.useState)(!1),{expanded:q,setExpanded:J}=d(!!e,F);(0,x.useEffect)(()=>{t&&u(t,{sourceEditMode:P.sourceEditMode})},[P.sourceEditMode,t]),(0,x.useEffect)(()=>{if(t)return w(t,P.flushSource)},[P.flushSource,t]),(0,x.useEffect)(()=>{t&&P.fileResourceId&&h.getState().resolveFileIdentity(t,P.fileResourceId)},[P.fileResourceId,t]),(0,x.useEffect)(()=>{t&&h.getState().setFileStatus(t,P.saveStatus===`error`?`error`:P.dirty?`dirty`:null)},[P.dirty,P.saveStatus,t]),(0,x.useEffect)(()=>{let e=()=>{document.visibilityState!==`hidden`&&P.checkForUpdates()};return window.addEventListener(`focus`,e),window.addEventListener(`workspace-refresh-files`,e),window.addEventListener(`agent-run-ended`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`workspace-refresh-files`,e),window.removeEventListener(`agent-run-ended`,e),document.removeEventListener(`visibilitychange`,e)}},[P.checkForUpdates]);let Y=e?s(e):``,X=[`text`,`markdown`,`code`,`html`].includes(P.descriptor.type),Z=(0,x.useCallback)(async()=>{if(e){if(await ee(e)){W(!0),g(`success`,M.workspace.pathCopied,void 0,{duration:2500}),window.setTimeout(()=>W(!1),2e3);return}g(`warning`,M.clipboard.copyFailed,void 0,{duration:4e3})}},[e,M.clipboard.copyFailed,M.workspace.pathCopied]),Q=(0,x.useCallback)(()=>{P.fileResourceId&&B({fileId:P.fileResourceId,fileName:Y})},[B,Y,P.fileResourceId]),$=(0,x.useCallback)(async()=>{await S(()=>P.onOpenWithSystemApp(),M.chat.attachmentPreviewOpenLocalFailed)},[M.chat.attachmentPreviewOpenLocalFailed,P.onOpenWithSystemApp]),te=(0,x.useCallback)(async()=>{let e;return await S(async()=>{let t=await P.onChooseOpenWithApp();return t?.ok&&(e=t.app),t},M.workspace.openFileFailed),e},[M.workspace.openFileFailed,P.onChooseOpenWithApp]),ne=(0,x.useCallback)(async e=>{await S(()=>P.onOpenWithRecentApp(e),M.workspace.openFileFailed)},[M.workspace.openFileFailed,P.onOpenWithRecentApp]),re=(0,x.useCallback)(async()=>{await S(()=>P.onRevealInFolder(),M.workspace.revealFileFailed)},[M.workspace.revealFileFailed,P.onRevealInFolder]),ie=(0,x.useCallback)(()=>{J(!1),r()},[r]),ae=!!(e&&!P.loading&&!P.loadError),oe={onDownload:()=>void P.onDownload(),canDownload:P.canDownload,onOpenWithSystemApp:()=>void $(),canOpenWithSystemApp:P.canOpenWithSystemApp,onChooseOpenWithApp:()=>void P.onChooseOpenWithApp(),canChooseOpenWithApp:P.canChooseOpenWithApp};return!e||!n?null:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(b,{expanded:q,children:(0,D.jsx)(c,{header:{subtitle:(0,D.jsxs)(D.Fragment,{children:[!P.loading&&P.mtimeMs!=null?(0,D.jsxs)(`p`,{suppressHydrationWarning:!0,className:`min-w-0 truncate`,title:new Date(P.mtimeMs).toISOString(),children:[M.workspace.lastModified,`: `,A(P.mtimeMs,j),C?` · Line ${C}`:``]}):null,P.externalChange?(0,D.jsx)(`span`,{role:`status`,className:`text-fg-muted`,children:j===`zh`?`文件已更新,请先处理当前编辑`:`File changed; review your current edits`}):null,T?(0,D.jsxs)(`span`,{className:`shrink-0`,"data-result-revision":!0,children:[j===`zh`?`成果版本`:`Result version`,` `,T]}):null,P.loading?(0,D.jsx)(m,{className:`h-3.5 w-32`}):null,X&&P.sourceEditMode&&P.saveStatus!==`idle`?(0,D.jsx)(`span`,{className:p(`shrink-0`,P.saveStatus===`error`&&`text-red-600 dark:text-red-400`),children:P.saveStatus===`saving`?M.workspace.saving:P.saveStatus===`error`?M.workspace.saveFailed:M.workspace.saved}):null]}),expanded:q,onRefresh:P.refresh,onRetrySave:P.saveStatus===`error`?()=>void P.flushSource():void 0,onToggleExpanded:ae?()=>J(e=>!e):void 0,hideClose:!!t,hideExpand:!!t,onClose:ie,edit:X?{active:P.sourceEditMode,onToggle:()=>P.setSourceEditMode(e=>!e)}:void 0,wordWrap:X&&P.sourceEditMode?{active:G,onToggle:()=>K(e=>!e)}:void 0,share:{onClick:Q,loading:I,disabled:!P.fileResourceId||P.loading||!!P.loadError},openWithSystemApp:P.canOpenWithSystemApp||v()&&window.electronAPI?.shell?.openFileResource?{onClick:()=>void $(),disabled:P.loading||!P.canOpenWithSystemApp}:void 0,chooseApp:P.canChooseOpenWithApp?{onClick:te}:void 0,recommendedApps:P.recommendedOpenWithApps,recentApps:P.recentOpenWithApps,onOpenWithApp:e=>void ne(e),onRevealInFolder:P.canRevealInFolder?()=>void re():void 0,copyPath:{copied:U,onClick:()=>void Z()}},chat:{createFile:P.createAttachmentFile,projectId:E,conversationId:O,agentId:k,disabled:P.saveStatus===`saving`},language:j,resolvedTheme:N,descriptor:t?{...P.descriptor,id:t}:P.descriptor,loading:P.loading,loadError:P.loadError,textContent:P.textContent,binaryBuffer:P.binaryBuffer,fileResourceId:P.fileResourceId,mtimeMs:P.mtimeMs,targetLine:C,extractedText:P.extractedText,extractedTextTruncated:P.extractedTextTruncated,workspaceEditing:{sourceEditMode:P.sourceEditMode,onSourceChange:e=>{t&&h.getState().keepFileOpen(t),P.onSourceChange(e)},sourceWordWrap:G,isDark:N===`dark`},actions:oe})}),(0,D.jsx)(f,{open:F,onOpenChange:H,loading:I,error:R,result:L,pendingParams:z,onConfirm:e=>void V(e)})]})}export{S as i,E as n,T as r,j as t};
1
+ import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i}from"./locale-store-Dy1EByeG.js";import{t as a}from"./messages-BAnhwALN.js";import{c as o,m as s,n as c,o as l,s as u,t as d}from"./use-file-preview-expanded-D0IBFhM9.js";import{n as f}from"./share-link-dialog-C1t_HB6f.js";import{t as p}from"./cn-0WouolD0.js";import{t as m}from"./skeleton-DzdOeGYz.js";import{n as h}from"./right-workspace-store-HPw7Gw0n.js";import{t as ee}from"./copy-to-clipboard-HOJ79TWv.js";import{t as g}from"./composer-notifications-CqV6Xj-H.js";import{i as _}from"./theme-store-BaWep_o7.js";import{n as v}from"./electron-env-DHOGevH3.js";import{a as y,t as b}from"./file-preview-surface-i5UOFnQF.js";var x=e(n(),1);async function S(e,t){try{let n=await e();return n&&`ok`in n&&n.code===`CANCELED`?!1:n&&(`ok`in n?n.ok:n.success)?!0:(g(`warning`,n?.error||t,void 0,{duration:4e3}),!1)}catch{return g(`warning`,t,void 0,{duration:4e3}),!1}}var C=new Map;function w(e,t){return C.set(e,t),()=>{C.get(e)===t&&C.delete(e)}}async function T(e){return await C.get(e)?.()??!0}var E=t({WorkspaceFilePreviewPanel:()=>j}),D=r(),O=new Intl.DateTimeFormat(`zh-CN`,{dateStyle:`medium`,timeStyle:`short`}),k=new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`});function A(e,t){return(t===`zh`?O:k).format(new Date(e))}function j({filePath:e,tabId:t,active:n=!0,onClose:r,targetLine:C,resultRevision:T,projectId:E,conversationId:O,agentId:k}){let j=i(e=>e.language),M=a(j),N=_(e=>e.resolved),P=o({filePath:e,projectId:E,conversationId:O,agentId:k,initialEditMode:t?l(t).sourceEditMode:!1}),{dialogOpen:F,loading:I,result:L,error:R,pendingParams:z,createShareLink:B,confirmShareLink:V,handleOpenChange:H}=y(),[U,W]=(0,x.useState)(!1),[G,K]=(0,x.useState)(!1),{expanded:q,setExpanded:J}=d(!!e,F);(0,x.useEffect)(()=>{t&&u(t,{sourceEditMode:P.sourceEditMode})},[P.sourceEditMode,t]),(0,x.useEffect)(()=>{if(t)return w(t,P.flushSource)},[P.flushSource,t]),(0,x.useEffect)(()=>{t&&P.fileResourceId&&h.getState().resolveFileIdentity(t,P.fileResourceId)},[P.fileResourceId,t]),(0,x.useEffect)(()=>{t&&h.getState().setFileStatus(t,P.saveStatus===`error`?`error`:P.dirty?`dirty`:null)},[P.dirty,P.saveStatus,t]),(0,x.useEffect)(()=>{let e=()=>{document.visibilityState!==`hidden`&&P.checkForUpdates()};return window.addEventListener(`focus`,e),window.addEventListener(`workspace-refresh-files`,e),window.addEventListener(`agent-run-ended`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`workspace-refresh-files`,e),window.removeEventListener(`agent-run-ended`,e),document.removeEventListener(`visibilitychange`,e)}},[P.checkForUpdates]);let Y=e?s(e):``,X=[`text`,`markdown`,`code`,`html`].includes(P.descriptor.type),Z=(0,x.useCallback)(async()=>{if(e){if(await ee(e)){W(!0),g(`success`,M.workspace.pathCopied,void 0,{duration:2500}),window.setTimeout(()=>W(!1),2e3);return}g(`warning`,M.clipboard.copyFailed,void 0,{duration:4e3})}},[e,M.clipboard.copyFailed,M.workspace.pathCopied]),Q=(0,x.useCallback)(()=>{P.fileResourceId&&B({fileId:P.fileResourceId,fileName:Y})},[B,Y,P.fileResourceId]),$=(0,x.useCallback)(async()=>{await S(()=>P.onOpenWithSystemApp(),M.chat.attachmentPreviewOpenLocalFailed)},[M.chat.attachmentPreviewOpenLocalFailed,P.onOpenWithSystemApp]),te=(0,x.useCallback)(async()=>{let e;return await S(async()=>{let t=await P.onChooseOpenWithApp();return t?.ok&&(e=t.app),t},M.workspace.openFileFailed),e},[M.workspace.openFileFailed,P.onChooseOpenWithApp]),ne=(0,x.useCallback)(async e=>{await S(()=>P.onOpenWithRecentApp(e),M.workspace.openFileFailed)},[M.workspace.openFileFailed,P.onOpenWithRecentApp]),re=(0,x.useCallback)(async()=>{await S(()=>P.onRevealInFolder(),M.workspace.revealFileFailed)},[M.workspace.revealFileFailed,P.onRevealInFolder]),ie=(0,x.useCallback)(()=>{J(!1),r()},[r]),ae=!!(e&&!P.loading&&!P.loadError),oe={onDownload:()=>void P.onDownload(),canDownload:P.canDownload,onOpenWithSystemApp:()=>void $(),canOpenWithSystemApp:P.canOpenWithSystemApp,onChooseOpenWithApp:()=>void P.onChooseOpenWithApp(),canChooseOpenWithApp:P.canChooseOpenWithApp};return!e||!n?null:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(b,{expanded:q,children:(0,D.jsx)(c,{header:{subtitle:(0,D.jsxs)(D.Fragment,{children:[!P.loading&&P.mtimeMs!=null?(0,D.jsxs)(`p`,{suppressHydrationWarning:!0,className:`min-w-0 truncate`,title:new Date(P.mtimeMs).toISOString(),children:[M.workspace.lastModified,`: `,A(P.mtimeMs,j),C?` · Line ${C}`:``]}):null,P.externalChange?(0,D.jsx)(`span`,{role:`status`,className:`text-fg-muted`,children:j===`zh`?`文件已更新,请先处理当前编辑`:`File changed; review your current edits`}):null,T?(0,D.jsxs)(`span`,{className:`shrink-0`,"data-result-revision":!0,children:[j===`zh`?`成果版本`:`Result version`,` `,T]}):null,P.loading?(0,D.jsx)(m,{className:`h-3.5 w-32`}):null,X&&P.sourceEditMode&&P.saveStatus!==`idle`?(0,D.jsx)(`span`,{className:p(`shrink-0`,P.saveStatus===`error`&&`text-red-600 dark:text-red-400`),children:P.saveStatus===`saving`?M.workspace.saving:P.saveStatus===`error`?M.workspace.saveFailed:M.workspace.saved}):null]}),expanded:q,onRefresh:P.refresh,onRetrySave:P.saveStatus===`error`?()=>void P.flushSource():void 0,onToggleExpanded:ae?()=>J(e=>!e):void 0,hideClose:!!t,hideExpand:!!t,onClose:ie,edit:X?{active:P.sourceEditMode,onToggle:()=>P.setSourceEditMode(e=>!e)}:void 0,wordWrap:X&&P.sourceEditMode?{active:G,onToggle:()=>K(e=>!e)}:void 0,share:{onClick:Q,loading:I,disabled:!P.fileResourceId||P.loading||!!P.loadError},openWithSystemApp:P.canOpenWithSystemApp||v()&&window.electronAPI?.shell?.openFileResource?{onClick:()=>void $(),disabled:P.loading||!P.canOpenWithSystemApp}:void 0,chooseApp:P.canChooseOpenWithApp?{onClick:te}:void 0,recommendedApps:P.recommendedOpenWithApps,recentApps:P.recentOpenWithApps,onOpenWithApp:e=>void ne(e),onRevealInFolder:P.canRevealInFolder?()=>void re():void 0,copyPath:{copied:U,onClick:()=>void Z()}},chat:{createFile:P.createAttachmentFile,projectId:E,conversationId:O,agentId:k,disabled:P.saveStatus===`saving`},language:j,resolvedTheme:N,descriptor:t?{...P.descriptor,id:t}:P.descriptor,loading:P.loading,loadError:P.loadError,textContent:P.textContent,binaryBuffer:P.binaryBuffer,fileResourceId:P.fileResourceId,mtimeMs:P.mtimeMs,targetLine:C,extractedText:P.extractedText,extractedTextTruncated:P.extractedTextTruncated,workspaceEditing:{sourceEditMode:P.sourceEditMode,onSourceChange:e=>{t&&h.getState().keepFileOpen(t),P.onSourceChange(e)},sourceWordWrap:G,isDark:N===`dark`},actions:oe})}),(0,D.jsx)(f,{open:F,onOpenChange:H,loading:I,error:R,result:L,pendingParams:z,onConfirm:e=>void V(e)})]})}export{S as i,E as n,T as r,j as t};
@@ -1 +1 @@
1
- import{i as e,o as t,p as n}from"./locale-store-Dy1EByeG.js";import{d as r,r as i}from"./tasks-BTLabOMp.js";import{a,i as o,o as s}from"./capabilities-DB713nRi.js";import{t as c}from"./capabilities-DDqDvCBs.js";import{n as l}from"./right-workspace-store-HPw7Gw0n.js";import{t as u}from"./workspace-editor-agent-store-DVPJcbuE.js";async function d(n){return i.parse(await t(e(`/api/tasks`),{method:`POST`,body:JSON.stringify(n)}))}async function f(e){return c(`xopc.tasks.get`,{id:e})}async function p(n){return t(e(`/api/tasks/${encodeURIComponent(n)}/conversation`),{method:`POST`})}async function m(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify({...r,expectedVersion:i})}),f(n)}async function h(n){await t(e(`/api/tasks/${encodeURIComponent(n)}`),{method:`DELETE`})}async function g(n,r,i,a=crypto.randomUUID(),o=`api`){return await t(e(`/api/tasks/${encodeURIComponent(n)}/commands`),{method:`POST`,body:JSON.stringify({idempotencyKey:a,expectedVersion:i,command:r,source:o})}),f(n)}async function _(n,r,i,a,o){return await t(e(`/api/tasks/${encodeURIComponent(n)}/criteria/${r}/review`),{method:`PUT`,body:JSON.stringify({status:i,expectedVersion:a,contractVersion:o})}),f(n)}async function v(n,r,i){return await t(e(`/api/task-runs/${encodeURIComponent(r)}/cancel`),{method:`POST`,body:JSON.stringify({expectedVersion:i,reason:`Cancelled by user`})}),f(n)}async function y(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/handoff`),{method:`POST`,body:JSON.stringify({toAgentId:r,expectedVersion:i,idempotencyKey:crypto.randomUUID()})}),f(n)}async function b(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/dependencies`),{method:`PUT`,body:JSON.stringify({dependsOnTaskIds:r,expectedVersion:i})}),f(n)}async function x(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/board-position`),{method:`PUT`,body:JSON.stringify({beforeTaskId:r,expectedVersion:i})}),f(n)}async function S(n,r,i){await t(e(`/api/task-runs/${encodeURIComponent(n)}/feedback`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({rating:r,reason:i?.trim()||void 0})})}function C(n,r=!1){let i=new URLSearchParams;return n&&i.set(`locale`,n),r&&i.set(`attention`,`all`),t(e(`/api/home${i.size?`?${i.toString()}`:``}`)).then(s)}function w(n){return t(e(`/api/home/advisor/refresh`),{method:`POST`,body:JSON.stringify({idempotencyKey:crypto.randomUUID(),locale:n})})}function T(){return t(e(`/api/home/advisor/history`)).then(e=>a.parse(e))}async function E(n,r){return o.parse(await t(e(`/api/home/opportunities/${encodeURIComponent(n.id)}/action`),{method:`POST`,body:JSON.stringify({idempotencyKey:crypto.randomUUID(),expectedRevision:n.revision,mode:r})}))}function D(n,r){let i=crypto.randomUUID();return t(e(`/api/home/opportunities/${encodeURIComponent(n.id)}/feedback`),{method:`POST`,body:JSON.stringify({...r,idempotencyKey:i,expectedRevision:n.revision})}).then(()=>({ok:!0,idempotencyKey:i}))}function O(n,r){return t(e(`/api/home/opportunities/${encodeURIComponent(n)}/feedback/undo`),{method:`POST`,body:JSON.stringify({idempotencyKey:r})})}function k(n,r){return t(e(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...n,decision:r})})}function A(n){return t(e(`/api/home/attention/acknowledge`),{method:`POST`,body:JSON.stringify(n)})}function j(n){return t(e(`/api/home/attention/retry`),{method:`POST`,body:JSON.stringify(n)})}function M(e){let t=e.task.contract?.acceptanceCriteria??[],n=new Map(e.runs.map(e=>[e.id,e])),i=e.receipts.filter(t=>n.get(t.runId)?.contractVersion===e.task.latestContractVersion).sort((e,t)=>t.finalizedAt-e.finalizedAt);return t.map((t,n)=>{let a=e.criterionReviews.find(r=>r.criterionIndex===n&&r.contractVersion===e.task.latestContractVersion&&r.criterionText===t),o={text:t,status:`unverified`,evidence:[]};for(let e of i){let n=e.verification.checks.find(e=>e.criterion===t);if(!n)continue;let i=e.evidence.filter(e=>n.evidenceTitles.includes(e.title)),a=n.status===`passed`&&r(e).has(t)?`passed`:n.status===`failed`?`failed`:`unverified`;o={text:t,status:a,evidence:i,runId:e.runId,verificationStatus:a,method:n.method,note:n.note};break}return a?{...o,status:a.status,review:a}:e.task.contract?.acceptancePolicy===`manual`?{...o,status:`unverified`}:o})}function N(e){let t=new Set(e.runs.filter(t=>t.contractVersion===e.task.latestContractVersion).map(e=>e.id));return e.receipts.filter(e=>t.has(e.runId)).sort((e,t)=>t.finalizedAt-e.finalizedAt)[0]}function P(e){let t=N(e),n=M(e);return{receipt:t,verified:n.filter(e=>e.status===`passed`).length,criteria:n.length,deliverables:e.context.filter(e=>e.role===`deliverable`).length}}function F(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.waits.some(e=>e.kind===`paused`)?`paused`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`ready`:e.operationalState}function I(e){return e===`failed`?`bg-danger/10 text-danger`:e===`needsUser`||e===`blocked`?`bg-warning/10 text-warning`:e===`completed`?`bg-success-soft text-success`:e===`running`||e===`verifying`||e===`review`?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`}var L=n(e=>({path:null,line:null,projectId:null,conversationId:null,setPath:(t,n,r,i,a)=>{if(t){let e=l.getState().scope;l.getState().openFile({path:t,line:n,projectId:r||void 0,conversationId:i||(e===`new`?void 0:e),agentId:u.getState().agentId||void 0,resultRevision:a})}e({path:t,resultRevision:t?a:void 0,line:t&&typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):null,projectId:t&&r?.trim()||null,conversationId:t&&i?.trim()||null})}}));export{S as C,b as D,x as E,D as S,m as T,y as _,M as a,j as b,E as c,d,h as f,f as g,T as h,I as i,v as l,C as m,N as n,P as o,p,F as r,A as s,L as t,g as u,w as v,O as w,_ as x,k as y};
1
+ import{i as e,o as t,p as n}from"./locale-store-Dy1EByeG.js";import{d as r,r as i}from"./tasks-BTLabOMp.js";import{a,i as o,o as s}from"./capabilities-hSb-qEgL.js";import{t as c}from"./capabilities-Dr-vvMez.js";import{n as l}from"./right-workspace-store-HPw7Gw0n.js";import{t as u}from"./workspace-editor-agent-store-DVPJcbuE.js";async function d(n){return i.parse(await t(e(`/api/tasks`),{method:`POST`,body:JSON.stringify(n)}))}async function f(e){return c(`xopc.tasks.get`,{id:e})}async function p(n){return t(e(`/api/tasks/${encodeURIComponent(n)}/conversation`),{method:`POST`})}async function m(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify({...r,expectedVersion:i})}),f(n)}async function h(n){await t(e(`/api/tasks/${encodeURIComponent(n)}`),{method:`DELETE`})}async function g(n,r,i,a=crypto.randomUUID(),o=`api`){return await t(e(`/api/tasks/${encodeURIComponent(n)}/commands`),{method:`POST`,body:JSON.stringify({idempotencyKey:a,expectedVersion:i,command:r,source:o})}),f(n)}async function _(n,r,i,a,o){return await t(e(`/api/tasks/${encodeURIComponent(n)}/criteria/${r}/review`),{method:`PUT`,body:JSON.stringify({status:i,expectedVersion:a,contractVersion:o})}),f(n)}async function v(n,r,i){return await t(e(`/api/task-runs/${encodeURIComponent(r)}/cancel`),{method:`POST`,body:JSON.stringify({expectedVersion:i,reason:`Cancelled by user`})}),f(n)}async function y(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/handoff`),{method:`POST`,body:JSON.stringify({toAgentId:r,expectedVersion:i,idempotencyKey:crypto.randomUUID()})}),f(n)}async function b(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/dependencies`),{method:`PUT`,body:JSON.stringify({dependsOnTaskIds:r,expectedVersion:i})}),f(n)}async function x(n,r,i){return await t(e(`/api/tasks/${encodeURIComponent(n)}/board-position`),{method:`PUT`,body:JSON.stringify({beforeTaskId:r,expectedVersion:i})}),f(n)}async function S(n,r,i){await t(e(`/api/task-runs/${encodeURIComponent(n)}/feedback`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({rating:r,reason:i?.trim()||void 0})})}function C(n,r=!1){let i=new URLSearchParams;return n&&i.set(`locale`,n),r&&i.set(`attention`,`all`),t(e(`/api/home${i.size?`?${i.toString()}`:``}`)).then(s)}function w(n){return t(e(`/api/home/advisor/refresh`),{method:`POST`,body:JSON.stringify({idempotencyKey:crypto.randomUUID(),locale:n})})}function T(){return t(e(`/api/home/advisor/history`)).then(e=>a.parse(e))}async function E(n,r){return o.parse(await t(e(`/api/home/opportunities/${encodeURIComponent(n.id)}/action`),{method:`POST`,body:JSON.stringify({idempotencyKey:crypto.randomUUID(),expectedRevision:n.revision,mode:r})}))}function D(n,r){let i=crypto.randomUUID();return t(e(`/api/home/opportunities/${encodeURIComponent(n.id)}/feedback`),{method:`POST`,body:JSON.stringify({...r,idempotencyKey:i,expectedRevision:n.revision})}).then(()=>({ok:!0,idempotencyKey:i}))}function O(n,r){return t(e(`/api/home/opportunities/${encodeURIComponent(n)}/feedback/undo`),{method:`POST`,body:JSON.stringify({idempotencyKey:r})})}function k(n,r){return t(e(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...n,decision:r})})}function A(n){return t(e(`/api/home/attention/acknowledge`),{method:`POST`,body:JSON.stringify(n)})}function j(n){return t(e(`/api/home/attention/retry`),{method:`POST`,body:JSON.stringify(n)})}function M(e){let t=e.task.contract?.acceptanceCriteria??[],n=new Map(e.runs.map(e=>[e.id,e])),i=e.receipts.filter(t=>n.get(t.runId)?.contractVersion===e.task.latestContractVersion).sort((e,t)=>t.finalizedAt-e.finalizedAt);return t.map((t,n)=>{let a=e.criterionReviews.find(r=>r.criterionIndex===n&&r.contractVersion===e.task.latestContractVersion&&r.criterionText===t),o={text:t,status:`unverified`,evidence:[]};for(let e of i){let n=e.verification.checks.find(e=>e.criterion===t);if(!n)continue;let i=e.evidence.filter(e=>n.evidenceTitles.includes(e.title)),a=n.status===`passed`&&r(e).has(t)?`passed`:n.status===`failed`?`failed`:`unverified`;o={text:t,status:a,evidence:i,runId:e.runId,verificationStatus:a,method:n.method,note:n.note};break}return a?{...o,status:a.status,review:a}:e.task.contract?.acceptancePolicy===`manual`?{...o,status:`unverified`}:o})}function N(e){let t=new Set(e.runs.filter(t=>t.contractVersion===e.task.latestContractVersion).map(e=>e.id));return e.receipts.filter(e=>t.has(e.runId)).sort((e,t)=>t.finalizedAt-e.finalizedAt)[0]}function P(e){let t=N(e),n=M(e);return{receipt:t,verified:n.filter(e=>e.status===`passed`).length,criteria:n.length,deliverables:e.context.filter(e=>e.role===`deliverable`).length}}function F(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.waits.some(e=>e.kind===`paused`)?`paused`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`ready`:e.operationalState}function I(e){return e===`failed`?`bg-danger/10 text-danger`:e===`needsUser`||e===`blocked`?`bg-warning/10 text-warning`:e===`completed`?`bg-success-soft text-success`:e===`running`||e===`verifying`||e===`review`?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`}var L=n(e=>({path:null,line:null,projectId:null,conversationId:null,setPath:(t,n,r,i,a)=>{if(t){let e=l.getState().scope;l.getState().openFile({path:t,line:n,projectId:r||void 0,conversationId:i||(e===`new`?void 0:e),agentId:u.getState().agentId||void 0,resultRevision:a})}e({path:t,resultRevision:t?a:void 0,line:t&&typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):null,projectId:t&&r?.trim()||null,conversationId:t&&i?.trim()||null})}}));export{S as C,b as D,x as E,D as S,m as T,y as _,M as a,j as b,E as c,d,h as f,f as g,T as h,I as i,v as l,C as m,N as n,P as o,p,F as r,A as s,L as t,g as u,w as v,O as w,_ as x,k as y};
@@ -11,8 +11,9 @@
11
11
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260910-1" />
12
12
  <link rel="manifest" href="/site.webmanifest?v=20260910-1" />
13
13
  <title>XOPC — Keep what matters moving.</title>
14
- <script type="module" crossorigin src="/assets/index-DjzrnmBA.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-CEBDMkde.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/diagnostics-Bo0Z42P_.js">
16
17
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
17
18
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
18
19
  <link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-CiwuuyV8.js">
@@ -41,7 +42,7 @@
41
42
  <link rel="modulepreload" crossorigin href="/assets/archive-Dz0hferG.js">
42
43
  <link rel="modulepreload" crossorigin href="/assets/chevron-down-ccbiQQz_.js">
43
44
  <link rel="modulepreload" crossorigin href="/assets/button-Cc4hUNTt.js">
44
- <link rel="modulepreload" crossorigin href="/assets/discussion-annotation-sync-fwPPMPv9.js">
45
+ <link rel="modulepreload" crossorigin href="/assets/recording-upload-CFX7CANT.js">
45
46
  <link rel="modulepreload" crossorigin href="/assets/arrow-left-D880xG-P.js">
46
47
  <link rel="modulepreload" crossorigin href="/assets/arrow-up-right-T72JbQ1Q.js">
47
48
  <link rel="modulepreload" crossorigin href="/assets/arrow-up-D5ZtR1QT.js">
@@ -59,12 +60,12 @@
59
60
  <link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
60
61
  <link rel="modulepreload" crossorigin href="/assets/xml-_d7dTN2Q.js">
61
62
  <link rel="modulepreload" crossorigin href="/assets/mermaid-render-oOellPHt.js">
62
- <link rel="modulepreload" crossorigin href="/assets/markdown-view-BlxIaCCQ.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/markdown-view-CNJaAdNN.js">
63
64
  <link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
64
65
  <link rel="modulepreload" crossorigin href="/assets/copy-Dv6d4Dvw.js">
65
66
  <link rel="modulepreload" crossorigin href="/assets/skeleton-DzdOeGYz.js">
66
- <link rel="modulepreload" crossorigin href="/assets/chat-chart-block-stPJEZ90.js">
67
- <link rel="modulepreload" crossorigin href="/assets/notes-api-CdXA-g9r.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/chat-chart-block-ClCZyIi0.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/notes-api-BOIM9Q_D.js">
68
69
  <link rel="modulepreload" crossorigin href="/assets/loader-circle-CifKLtgG.js">
69
70
  <link rel="modulepreload" crossorigin href="/assets/pause-DuPxgSxk.js">
70
71
  <link rel="modulepreload" crossorigin href="/assets/play-kxZvpBg8.js">
@@ -75,7 +76,7 @@
75
76
  <link rel="modulepreload" crossorigin href="/assets/volume-2-BSJhAY97.js">
76
77
  <link rel="modulepreload" crossorigin href="/assets/vendor-swr-CdRzEUwF.js">
77
78
  <link rel="modulepreload" crossorigin href="/assets/automation-api-DxBmyzp0.js">
78
- <link rel="modulepreload" crossorigin href="/assets/product-automation-feedback-D51I7Lg3.js">
79
+ <link rel="modulepreload" crossorigin href="/assets/product-automation-feedback-CGso8wGv.js">
79
80
  <link rel="modulepreload" crossorigin href="/assets/earth-C9Z4bTTG.js">
80
81
  <link rel="modulepreload" crossorigin href="/assets/chevron-right-BweFrslA.js">
81
82
  <link rel="modulepreload" crossorigin href="/assets/file-archive-DanfQJNe.js">
@@ -109,7 +110,7 @@
109
110
  <link rel="modulepreload" crossorigin href="/assets/refresh-cw-BRlGaq2w.js">
110
111
  <link rel="modulepreload" crossorigin href="/assets/save-DRDABU--.js">
111
112
  <link rel="modulepreload" crossorigin href="/assets/search-DA7gz22f.js">
112
- <link rel="modulepreload" crossorigin href="/assets/constants-DpkUgykJ.js">
113
+ <link rel="modulepreload" crossorigin href="/assets/constants-Bg1wM2nv.js">
113
114
  <link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-D6WPS0RW.js">
114
115
  <link rel="modulepreload" crossorigin href="/assets/session-api-BFiIYodK.js">
115
116
  <link rel="modulepreload" crossorigin href="/assets/attachment-utils-core-BIOUBrpT.js">
@@ -121,10 +122,10 @@
121
122
  <link rel="modulepreload" crossorigin href="/assets/sliding-indicator-hwz0sx3h.js">
122
123
  <link rel="modulepreload" crossorigin href="/assets/sliding-tab-list-CmcrqRzN.js">
123
124
  <link rel="modulepreload" crossorigin href="/assets/files-BNL4kkSB.js">
124
- <link rel="modulepreload" crossorigin href="/assets/workspace-api-LghfbP5g.js">
125
+ <link rel="modulepreload" crossorigin href="/assets/workspace-api-Dd_UDfeo.js">
125
126
  <link rel="modulepreload" crossorigin href="/assets/index.module-Cd9ENXfk.js">
126
127
  <link rel="modulepreload" crossorigin href="/assets/dist-ZrL34Ps4.js">
127
- <link rel="modulepreload" crossorigin href="/assets/use-file-preview-expanded-BXXeXnT0.js">
128
+ <link rel="modulepreload" crossorigin href="/assets/use-file-preview-expanded-D0IBFhM9.js">
128
129
  <link rel="modulepreload" crossorigin href="/assets/globe-DSSGFWFn.js">
129
130
  <link rel="modulepreload" crossorigin href="/assets/history-DXH_9jsE.js">
130
131
  <link rel="modulepreload" crossorigin href="/assets/key-round-DWbpyU2U.js">
@@ -162,18 +163,18 @@
162
163
  <link rel="modulepreload" crossorigin href="/assets/gateway-realtime-store-sx7B8kdC.js">
163
164
  <link rel="modulepreload" crossorigin href="/assets/gateway-realtime-DIs1pjkQ.js">
164
165
  <link rel="modulepreload" crossorigin href="/assets/agents-admin-api-D0N09mqJ.js">
165
- <link rel="modulepreload" crossorigin href="/assets/session-manager-D2LaQymu.js">
166
+ <link rel="modulepreload" crossorigin href="/assets/session-manager-63NaXb1s.js">
166
167
  <link rel="modulepreload" crossorigin href="/assets/new-session-preferences-gb411vZP.js">
167
168
  <link rel="modulepreload" crossorigin href="/assets/open-capability-settings-DQsmJxI7.js">
168
169
  <link rel="modulepreload" crossorigin href="/assets/model-sort-_Tz8s_4N.js">
169
170
  <link rel="modulepreload" crossorigin href="/assets/model-selector-C-CqPBao.js">
170
171
  <link rel="modulepreload" crossorigin href="/assets/composer-model-config-control-DAagrRx_.js">
171
- <link rel="modulepreload" crossorigin href="/assets/capabilities-DB713nRi.js">
172
- <link rel="modulepreload" crossorigin href="/assets/capabilities-DDqDvCBs.js">
172
+ <link rel="modulepreload" crossorigin href="/assets/capabilities-hSb-qEgL.js">
173
+ <link rel="modulepreload" crossorigin href="/assets/capabilities-Dr-vvMez.js">
173
174
  <link rel="modulepreload" crossorigin href="/assets/phone-workspace-store-Ltrevdsx.js">
174
175
  <link rel="modulepreload" crossorigin href="/assets/right-workspace-store-HPw7Gw0n.js">
175
176
  <link rel="modulepreload" crossorigin href="/assets/workspace-editor-agent-store-DVPJcbuE.js">
176
- <link rel="modulepreload" crossorigin href="/assets/workspace-preview-store-Do31QQH5.js">
177
+ <link rel="modulepreload" crossorigin href="/assets/workspace-preview-store-imhtuEIP.js">
177
178
  <link rel="modulepreload" crossorigin href="/assets/chat-agents-api-CjlzCSmC.js">
178
179
  <link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
179
180
  <link rel="modulepreload" crossorigin href="/assets/voice-input-shortcut-events-CEeFBhp3.js">
@@ -182,19 +183,19 @@
182
183
  <link rel="modulepreload" crossorigin href="/assets/linkify-it-BkqEorO0.js">
183
184
  <link rel="modulepreload" crossorigin href="/assets/tool-friendly-title-CP35P4VA.js">
184
185
  <link rel="modulepreload" crossorigin href="/assets/voice-CDlC6XMH.js">
185
- <link rel="modulepreload" crossorigin href="/assets/use-realtime-voice-C7iWQuUv.js">
186
+ <link rel="modulepreload" crossorigin href="/assets/use-realtime-voice-B5IsKrRW.js">
186
187
  <link rel="modulepreload" crossorigin href="/assets/voice-call-context-BM2A4bLz.js">
187
188
  <link rel="modulepreload" crossorigin href="/assets/page-header-store-Bm8oxpFR.js">
188
189
  <link rel="modulepreload" crossorigin href="/assets/loopi-CNtmi9FU.js">
189
190
  <link rel="modulepreload" crossorigin href="/assets/theme-store-BaWep_o7.js">
190
- <link rel="modulepreload" crossorigin href="/assets/extension-message-router-C9JDpo_7.js">
191
- <link rel="modulepreload" crossorigin href="/assets/extension-provider-BPIoHw4r.js">
191
+ <link rel="modulepreload" crossorigin href="/assets/extension-message-router-GIekDj_w.js">
192
+ <link rel="modulepreload" crossorigin href="/assets/extension-provider-D-LolObs.js">
192
193
  <link rel="modulepreload" crossorigin href="/assets/agent-avatar-display-loBdGw_i.js">
193
194
  <link rel="modulepreload" crossorigin href="/assets/skill-wire-pattern-BPpeIcCi.js">
194
195
  <link rel="modulepreload" crossorigin href="/assets/chevron-left-DqFhpbvK.js">
195
196
  <link rel="modulepreload" crossorigin href="/assets/shares-api-Dm07CnXw.js">
196
197
  <link rel="modulepreload" crossorigin href="/assets/file-preview-surface-i5UOFnQF.js">
197
- <link rel="modulepreload" crossorigin href="/assets/use-composer-attachments-CO7XLI4x.js">
198
+ <link rel="modulepreload" crossorigin href="/assets/use-composer-attachments-Xn6eUus2.js">
198
199
  <link rel="modulepreload" crossorigin href="/assets/use-directory-picker-C4p7AgWY.js">
199
200
  <link rel="modulepreload" crossorigin href="/assets/confirm-dialog-DrA5mTQp.js">
200
201
  <link rel="modulepreload" crossorigin href="/assets/skill-api-utils-C7V4JVXM.js">
@@ -204,10 +205,10 @@
204
205
  <link rel="modulepreload" crossorigin href="/assets/calendar-days-hw_Y-g-s.js">
205
206
  <link rel="modulepreload" crossorigin href="/assets/date-picker-XnE3iFhG.js">
206
207
  <link rel="modulepreload" crossorigin href="/assets/time-picker-C1PXAXZF.js">
207
- <link rel="modulepreload" crossorigin href="/assets/automation-task-card-CiJmJ7_h.js">
208
+ <link rel="modulepreload" crossorigin href="/assets/automation-task-card-CJbIHRxN.js">
208
209
  <link rel="modulepreload" crossorigin href="/assets/dev-view-store-B8fGILny.js">
209
210
  <link rel="modulepreload" crossorigin href="/assets/extension-authoritative-grants-BfL8dMBf.js">
210
- <link rel="modulepreload" crossorigin href="/assets/extension-iframe-host-DIH4TcdH.js">
211
+ <link rel="modulepreload" crossorigin href="/assets/extension-iframe-host-Vs6USa0c.js">
211
212
  <link rel="modulepreload" crossorigin href="/assets/runtime-health-zDkHcOZO.js">
212
213
  <link rel="modulepreload" crossorigin href="/assets/api-B1J5ajiP.js">
213
214
  <link rel="modulepreload" crossorigin href="/assets/terminal-panel-store-Du53Upr2.js">
@@ -218,7 +219,7 @@
218
219
  <link rel="modulepreload" crossorigin href="/assets/page-context-draft-Cr5GqS2D.js">
219
220
  <link rel="modulepreload" crossorigin href="/assets/management-api-B5w5DdXH.js">
220
221
  <link rel="modulepreload" crossorigin href="/assets/side-chat-shortcut-BIw-1TTD.js">
221
- <link rel="modulepreload" crossorigin href="/assets/chat-page-BhPw56Vc.js">
222
+ <link rel="modulepreload" crossorigin href="/assets/chat-page-U2a7d6wP.js">
222
223
  <link rel="modulepreload" crossorigin href="/assets/arrow-right-DSSvoX71.js">
223
224
  <link rel="modulepreload" crossorigin href="/assets/browser-notification-delivery-DmE2FgGc.js">
224
225
  <link rel="modulepreload" crossorigin href="/assets/unlink-BEuthaaq.js">
@@ -257,7 +258,7 @@
257
258
  <link rel="modulepreload" crossorigin href="/assets/gauge-C78eD2BA.js">
258
259
  <link rel="modulepreload" crossorigin href="/assets/heart-Cp4rgrqn.js">
259
260
  <link rel="modulepreload" crossorigin href="/assets/image-Cwyalflz.js">
260
- <link rel="modulepreload" crossorigin href="/assets/recording-upload-CyZSl2DJ.js">
261
+ <link rel="modulepreload" crossorigin href="/assets/star-CnYNmpLd.js">
261
262
  <link rel="modulepreload" crossorigin href="/assets/info-CDrmIZhb.js">
262
263
  <link rel="modulepreload" crossorigin href="/assets/layers-mJW7JJKm.js">
263
264
  <link rel="modulepreload" crossorigin href="/assets/layout-grid-CEVZdVFU.js">
@@ -291,16 +292,16 @@
291
292
  <link rel="modulepreload" crossorigin href="/assets/preference-select-fields-D1pZekPs.js">
292
293
  <link rel="modulepreload" crossorigin href="/assets/navigation-ByOzYT0t.js">
293
294
  <link rel="modulepreload" crossorigin href="/assets/page-tabs-oeTY7z3_.js">
294
- <link rel="modulepreload" crossorigin href="/assets/route-preload-CuxNu-LB.js">
295
+ <link rel="modulepreload" crossorigin href="/assets/route-preload-Dwb_N8L-.js">
295
296
  <link rel="modulepreload" crossorigin href="/assets/use-personal-profile-C1vqD9yV.js">
296
297
  <link rel="modulepreload" crossorigin href="/assets/personal-avatar-BMRVyTrE.js">
297
298
  <link rel="modulepreload" crossorigin href="/assets/project-understanding-Cg8WbBNB.js">
298
299
  <link rel="modulepreload" crossorigin href="/assets/refresh-button-DiWdGAaX.js">
299
- <link rel="modulepreload" crossorigin href="/assets/workspace-file-preview-dialog-NffP-UXC.js">
300
- <link rel="modulepreload" crossorigin href="/assets/use-workspace-tree-D27u-eoX.js">
300
+ <link rel="modulepreload" crossorigin href="/assets/workspace-file-preview-dialog-Clj9hMj5.js">
301
+ <link rel="modulepreload" crossorigin href="/assets/use-workspace-tree-7X2ydgS8.js">
301
302
  <link rel="modulepreload" crossorigin href="/assets/settings-mode-store-YH60sibB.js">
302
303
  <link rel="modulepreload" crossorigin href="/assets/global-defaults-api-BpDMnJe7.js">
303
- <link rel="modulepreload" crossorigin href="/assets/product-preview-modal-DMHOKocl.js">
304
+ <link rel="modulepreload" crossorigin href="/assets/product-preview-modal-C35EWUps.js">
304
305
  <link rel="modulepreload" crossorigin href="/assets/settings-loading-skeleton-CAoOV17i.js">
305
306
  <link rel="modulepreload" crossorigin href="/assets/settings-advanced-section-B-H1gYOs.js">
306
307
  <link rel="modulepreload" crossorigin href="/assets/desktop-pet-narrative-JqMsz4rn.js">
@@ -308,7 +309,7 @@
308
309
  <link rel="stylesheet" crossorigin href="/assets/loopi-C09I2mNj.css">
309
310
  <link rel="stylesheet" crossorigin href="/assets/chat-page-zQeUaawJ.css">
310
311
  <link rel="stylesheet" crossorigin href="/assets/personal-avatar-BUCb7OiW.css">
311
- <link rel="stylesheet" crossorigin href="/assets/index-YQxumvaS.css">
312
+ <link rel="stylesheet" crossorigin href="/assets/index-CChzK_5b.css">
312
313
  </head>
313
314
  <body>
314
315
  <div id="root"></div>
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.0.460";
2
+ var version = "0.0.462";
3
3
  //#endregion
4
4
  export { version };