@xopcai/xopc 0.0.352 → 0.0.354

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 (587) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
  3. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  4. package/dist/extensions/telegram/src/inbound-processor.js +2 -2
  5. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +2 -2
  7. package/dist/extensions/telegram/xopc.extension.json +1 -1
  8. package/dist/extensions/weixin/src/api/api.js +2 -2
  9. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  10. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  11. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  12. package/dist/gateway/static/root/assets/activity-YogQEteU.js +1 -0
  13. package/dist/gateway/static/root/assets/activity-store-X7CG9pzB.js +1 -0
  14. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-ChlaFmiD.js → agent-avatar-dicebear-B8PS1eLP.js} +1 -1
  15. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CLBSL9hl.js +1 -0
  16. package/dist/gateway/static/root/assets/agent-plugin-dialog-BninweSg.js +1 -0
  17. package/dist/gateway/static/root/assets/agents-CcVLP_WP.js +66 -0
  18. package/dist/gateway/static/root/assets/{agents-admin-api-C_3ucZGI.js → agents-admin-api-Ck2x78jq.js} +1 -1
  19. package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
  20. package/dist/gateway/static/root/assets/app-management-settings-panel-COdQOmdT.js +1 -0
  21. package/dist/gateway/static/root/assets/appearance-settings-CDNjc2yy.js +1 -0
  22. package/dist/gateway/static/root/assets/apps-page-C-kvpPj8.js +1 -0
  23. package/dist/gateway/static/root/assets/{archive-plugin-D4EiLLyl.js → archive-plugin-QfOaQPL_.js} +1 -1
  24. package/dist/gateway/static/root/assets/{automations-page-CMxBpT5v.js → automations-page-87DN5nXX.js} +1 -1
  25. package/dist/gateway/static/root/assets/automations-workspace-BdZ8NO8k.js +7 -0
  26. package/dist/gateway/static/root/assets/{binary-plugins-DQc_BlYP.js → binary-plugins-BF2lVwR9.js} +1 -1
  27. package/dist/gateway/static/root/assets/{block-editor-C3S6gqnS.js → block-editor-B04Kv5DU.js} +39 -39
  28. package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
  29. package/dist/gateway/static/root/assets/{browser-automation-inputs-D2SwaQ2F.js → browser-automation-inputs-FW3bYZ-z.js} +1 -1
  30. package/dist/gateway/static/root/assets/{browser-automations-page-CGG1740U.js → browser-automations-page-Ck6Zb9aU.js} +2 -2
  31. package/dist/gateway/static/root/assets/browser-settings-page-DHlyYItE.js +3 -0
  32. package/dist/gateway/static/root/assets/{capabilities-D4qdO980.js → capabilities-BCF_160Z.js} +1 -1
  33. package/dist/gateway/static/root/assets/capabilities-CF4-mrIa.js +1 -0
  34. package/dist/gateway/static/root/assets/capabilities-page-C-6RLFNh.js +2 -0
  35. package/dist/gateway/static/root/assets/capabilities-settings-panel-CST_HBkR.js +8 -0
  36. package/dist/gateway/static/root/assets/capability-header-actions-PBPJJsp6.js +1 -0
  37. package/dist/gateway/static/root/assets/channels-CM4sIvcP.js +1 -0
  38. package/dist/gateway/static/root/assets/{chat-terminal-dock-DfTUgrey.js → chat-terminal-dock-DTd7mWyE.js} +2 -2
  39. package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
  40. package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
  41. package/dist/gateway/static/root/assets/circle-dashed-8qMD7gHf.js +1 -0
  42. package/dist/gateway/static/root/assets/circle-dot-BAseJTrF.js +1 -0
  43. package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
  44. package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
  45. package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
  46. package/dist/gateway/static/root/assets/computer-settings-page--9rh1mvu.js +1 -0
  47. package/dist/gateway/static/root/assets/connector-service-page-v6Is0BOO.js +1 -0
  48. package/dist/gateway/static/root/assets/connectors-page-CryQzmEZ.js +2 -0
  49. package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +1 -0
  50. package/dist/gateway/static/root/assets/date-picker-DTsMzjoZ.js +1 -0
  51. package/dist/gateway/static/root/assets/{dependency-picker-CV2ybJJd.js → dependency-picker-Y1QYCcLp.js} +1 -1
  52. package/dist/gateway/static/root/assets/{desktop-pet-DipFHe4X.js → desktop-pet-D9dfZrOp.js} +1 -1
  53. package/dist/gateway/static/root/assets/desktop-pet-settings-BHVOHZUL.js +1 -0
  54. package/dist/gateway/static/root/assets/device-pairing-wizard-Cy5YDZ2b.js +1 -0
  55. package/dist/gateway/static/root/assets/directory-picker-path-field-DeMo9KlE.js +1 -0
  56. package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
  57. package/dist/gateway/static/root/assets/dist-Che_jiQF.js +1 -0
  58. package/dist/gateway/static/root/assets/extension-debug-page-BrGWLJg9.js +1 -0
  59. package/dist/gateway/static/root/assets/extension-page-AWrvy1Nb.js +1 -0
  60. package/dist/gateway/static/root/assets/extension-provider-CUpbXB2k.js +1 -0
  61. package/dist/gateway/static/root/assets/extension-settings-page-C5KgmhYu.js +1 -0
  62. package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
  63. package/dist/gateway/static/root/assets/{gateway-config-swr-DZWFlfJr.js → gateway-config-swr-B31I6Gbq.js} +1 -1
  64. package/dist/gateway/static/root/assets/{gateway-realtime-HO9tL9xo.js → gateway-realtime-D6ffOiPe.js} +1 -1
  65. package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +1 -0
  66. package/dist/gateway/static/root/assets/gateway-settings-DC-lok0J.js +1 -0
  67. package/dist/gateway/static/root/assets/{gateway-startup-retry-Cg1nbxJR.js → gateway-startup-retry-DVol958v.js} +1 -1
  68. package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
  69. package/dist/gateway/static/root/assets/home-page-C29_VFAs.js +1 -0
  70. package/dist/gateway/static/root/assets/{image-generation-api-DSnPfr_U.js → image-generation-api-TVgJfz9r.js} +1 -1
  71. package/dist/gateway/static/root/assets/imports-page-BKVKfVMA.js +1 -0
  72. package/dist/gateway/static/root/assets/index-BJh5gU04.css +1 -0
  73. package/dist/gateway/static/root/assets/index-ByFXhQ-T.js +107 -0
  74. package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
  75. package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
  76. package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
  77. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ixQ8_6ad.js → keyboard-shortcuts-settings-DiwE4gKU.js} +1 -1
  78. package/dist/gateway/static/root/assets/local-app-workbench-page-Dt3TC64L.js +1 -0
  79. package/dist/gateway/static/root/assets/{local-apps-page-BV3NFUJQ.js → local-apps-page-DFPhWkxU.js} +1 -1
  80. package/dist/gateway/static/root/assets/{local-session-drafts-CuyTzbfW.js → local-session-drafts-wiq_12oN.js} +1 -1
  81. package/dist/gateway/static/root/assets/{locale-store-qcYD05PF.js → locale-store-Y1aBayM_.js} +1 -1
  82. package/dist/gateway/static/root/assets/logs-page-C4faHZHj.js +2 -0
  83. package/dist/gateway/static/root/assets/management-settings-pZLdvIiw.js +1 -0
  84. package/dist/gateway/static/root/assets/markdown-view-7tzqIp_G.js +201 -0
  85. package/dist/gateway/static/root/assets/{media-plugins-cpalRgVI.js → media-plugins-cjgrKnne.js} +1 -1
  86. package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
  87. package/dist/gateway/static/root/assets/messages-DPw2X06D.js +3 -0
  88. package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
  89. package/dist/gateway/static/root/assets/model-display-name-DXhO9rcM.js +1 -0
  90. package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +1 -0
  91. package/dist/gateway/static/root/assets/note-detail-panel-BLnT1tYJ.js +5 -0
  92. package/dist/gateway/static/root/assets/notes-api-J0yhflxC.js +1 -0
  93. package/dist/gateway/static/root/assets/notes-page-BawArJvP.js +8 -0
  94. package/dist/gateway/static/root/assets/oauth-api-CYe61zfD.js +1 -0
  95. package/dist/gateway/static/root/assets/page-context-capture-button-CiBUm2Br.js +1 -0
  96. package/dist/gateway/static/root/assets/page-tabs-D2xpUV26.js +1 -0
  97. package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
  98. package/dist/gateway/static/root/assets/personal-page-Cng583RH.js +1 -0
  99. package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
  100. package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
  101. package/dist/gateway/static/root/assets/preview-open-alternatives-Dvey7GwU.js +1 -0
  102. package/dist/gateway/static/root/assets/{product-open-page-BJwEshPw.js → product-open-page-B8_w6c3J.js} +1 -1
  103. package/dist/gateway/static/root/assets/project-detail-page-CDZdKiTz.js +1 -0
  104. package/dist/gateway/static/root/assets/projects-page-BvahSrZi.js +1 -0
  105. package/dist/gateway/static/root/assets/{registry-api-C0j3sKT4.js → registry-api-DqDOrPQ0.js} +1 -1
  106. package/dist/gateway/static/root/assets/remote-access-hub-CU_UdkuI.js +1 -0
  107. package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
  108. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-SbIgL9Ya.js → runtime-tools-settings-panel-BnMS50vK.js} +2 -2
  109. package/dist/gateway/static/root/assets/scenes-page-CDR1-q25.js +2 -0
  110. package/dist/gateway/static/root/assets/schema-form-B4Xa8w8S.js +1 -0
  111. package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +1 -0
  112. package/dist/gateway/static/root/assets/send-session-input-C7Nqy0sK.js +1 -0
  113. package/dist/gateway/static/root/assets/{session-api-iR1SFNHe.js → session-api-CTN4qwiN.js} +1 -1
  114. package/dist/gateway/static/root/assets/{session-manager-3YOU74jt.js → session-manager-DsH1DZI_.js} +1 -1
  115. package/dist/gateway/static/root/assets/sessions-page-Ymyg98G-.js +1 -0
  116. package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
  117. package/dist/gateway/static/root/assets/settings-advanced-gate-wMZhxwTM.js +1 -0
  118. package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
  119. package/dist/gateway/static/root/assets/settings-form-section-exRhP9xn.js +1 -0
  120. package/dist/gateway/static/root/assets/settings-page-CHZdpvkT.js +1 -0
  121. package/dist/gateway/static/root/assets/setup-status-panel-HESfALIF.js +1 -0
  122. package/dist/gateway/static/root/assets/share-link-dialog-COlX10Dc.js +1 -0
  123. package/dist/gateway/static/root/assets/share-preview-page-NtRLUieq.js +2 -0
  124. package/dist/gateway/static/root/assets/shares-api-DICV5EKH.js +1 -0
  125. package/dist/gateway/static/root/assets/shares-settings-CXEBo5YL.js +1 -0
  126. package/dist/gateway/static/root/assets/skill-api-DYgcO7y0.js +1 -0
  127. package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
  128. package/dist/gateway/static/root/assets/skill-reload-api-CWH3Fmx4.js +1 -0
  129. package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
  130. package/dist/gateway/static/root/assets/skills-page-Dx5v64jU.js +2 -0
  131. package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
  132. package/dist/gateway/static/root/assets/system-settings-panel-wXCBwYwE.js +1 -0
  133. package/dist/gateway/static/root/assets/task-detail-page-hoIyr7tp.js +1 -0
  134. package/dist/gateway/static/root/assets/tasks-Buv1mgPF.js +1 -0
  135. package/dist/gateway/static/root/assets/theme-store-BKgBPLH4.js +1 -0
  136. package/dist/gateway/static/root/assets/tunnel-api-C0t8y3Mi.js +1 -0
  137. package/dist/gateway/static/root/assets/usage-page-A2DZAidl.js +1 -0
  138. package/dist/gateway/static/root/assets/use-async-resource-GrnWNwMZ.js +1 -0
  139. package/dist/gateway/static/root/assets/use-autosave-Cn6hqqyM.js +1 -0
  140. package/dist/gateway/static/root/assets/use-composer-attachments-DL61XeSu.js +2 -0
  141. package/dist/gateway/static/root/assets/use-file-preview-expanded-Cl9mU32w.js +2 -0
  142. package/dist/gateway/static/root/assets/user-model-page-C1jGTwjK.js +2 -0
  143. package/dist/gateway/static/root/assets/voice-api-key-field-Bw05QB_V.js +1 -0
  144. package/dist/gateway/static/root/assets/{voice-config-api-CylVelIb.js → voice-config-api-BM75K3mR.js} +1 -1
  145. package/dist/gateway/static/root/assets/{work-discovery-overlay-9bULjfGk.js → work-discovery-overlay-xB0QpOFk.js} +1 -1
  146. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-VYQHBiz3.js → workflow-run-setup-panel-rM4U1FXc.js} +2 -2
  147. package/dist/gateway/static/root/assets/workflows-page-QKC34FzQ.js +6 -0
  148. package/dist/gateway/static/root/assets/workspace-api-BbBT75Kg.js +2 -0
  149. package/dist/gateway/static/root/index.html +68 -26
  150. package/dist/package.js +1 -1
  151. package/dist/packages/gateway-contract/src/tasks.js +19 -2
  152. package/dist/src/agent/agent-manager.js +27 -22
  153. package/dist/src/agent/agent-scope.js +2 -2
  154. package/dist/src/agent/background-review/prompts.js +1 -1
  155. package/dist/src/agent/background-review/run-background-review.js +4 -4
  156. package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
  157. package/dist/src/agent/bootstrap/bootstrap-files.js +3 -9
  158. package/dist/src/agent/bootstrap/load-bootstrap-files.js +2 -4
  159. package/dist/src/agent/coding/repository-instructions.js +1 -1
  160. package/dist/src/agent/context/coordinator.js +2 -2
  161. package/dist/src/agent/context/execution-context.js +4 -4
  162. package/dist/src/agent/context/execution-scope.js +2 -2
  163. package/dist/src/agent/context/project-context.js +3 -3
  164. package/dist/src/agent/context/workspace-seed.d.ts +1 -7
  165. package/dist/src/agent/context/workspace-seed.js +4 -13
  166. package/dist/src/agent/context/workspace-templates/AGENTS.md +1 -1
  167. package/dist/src/agent/context/workspace.d.ts +1 -3
  168. package/dist/src/agent/context/workspace.js +3 -7
  169. package/dist/src/agent/data-acquisition/service.js +1 -1
  170. package/dist/src/agent/embedded/index.js +2 -2
  171. package/dist/src/agent/embedded/model-runtime.js +1 -1
  172. package/dist/src/agent/embedded/run-for-session.js +4 -4
  173. package/dist/src/agent/embedded/run-turn.js +15 -5
  174. package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
  175. package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
  176. package/dist/src/agent/external-tools/cliProvider.js +3 -3
  177. package/dist/src/agent/external-tools/composio-provider.js +3 -3
  178. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  179. package/dist/src/agent/external-tools/gateway-tools.js +1 -1
  180. package/dist/src/agent/external-tools/mcp-provider.js +3 -3
  181. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  182. package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
  183. package/dist/src/agent/image/generation/providers/fal.js +1 -1
  184. package/dist/src/agent/image/generation/providers/google.js +1 -1
  185. package/dist/src/agent/image/generation/runtime.js +1 -1
  186. package/dist/src/agent/image/index.js +1 -1
  187. package/dist/src/agent/image/load-image-media.js +1 -1
  188. package/dist/src/agent/image/tool-model-config.js +2 -2
  189. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  190. package/dist/src/agent/inbound/inbound-loop.js +2 -2
  191. package/dist/src/agent/index.js +1 -1
  192. package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
  193. package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
  194. package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
  195. package/dist/src/agent/mcp/index.js +2 -2
  196. package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
  197. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  198. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
  199. package/dist/src/agent/mcp/plugin-http-fetch.js +1 -1
  200. package/dist/src/agent/memory/context-recovery.js +1 -1
  201. package/dist/src/agent/memory/index.js +1 -1
  202. package/dist/src/agent/messaging/no-reply.d.ts +1 -0
  203. package/dist/src/agent/messaging/no-reply.js +4 -0
  204. package/dist/src/agent/messaging/outbound-coordinator.d.ts +0 -4
  205. package/dist/src/agent/messaging/outbound-coordinator.js +2 -4
  206. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  207. package/dist/src/agent/prompt/sections/agent-identity.d.ts +3 -0
  208. package/dist/src/agent/prompt/sections/agent-identity.js +13 -0
  209. package/dist/src/agent/prompt/sections/messaging-runtime.d.ts +0 -5
  210. package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -16
  211. package/dist/src/agent/prompt/sections/project-context.d.ts +0 -3
  212. package/dist/src/agent/prompt/sections/project-context.js +2 -9
  213. package/dist/src/agent/prompt/sections/tooling.js +1 -1
  214. package/dist/src/agent/prompt/service-prompt-builder.d.ts +2 -0
  215. package/dist/src/agent/prompt/service-prompt-builder.js +5 -10
  216. package/dist/src/agent/prompt/subagent-context.js +1 -1
  217. package/dist/src/agent/prompt/system-prompt-params.d.ts +0 -4
  218. package/dist/src/agent/prompt/system-prompt-params.js +0 -2
  219. package/dist/src/agent/prompt/system-prompt.d.ts +2 -2
  220. package/dist/src/agent/prompt/system-prompt.js +8 -9
  221. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  222. package/dist/src/agent/service/direct-turn-helpers.js +4 -4
  223. package/dist/src/agent/service/process-direct-one-shot.js +1 -1
  224. package/dist/src/agent/service/process-direct-streaming.js +5 -5
  225. package/dist/src/agent/service/webchat-tts.js +2 -2
  226. package/dist/src/agent/service.js +24 -22
  227. package/dist/src/agent/session/session-config-service.js +27 -1
  228. package/dist/src/agent/session/session-hydrator.js +1 -1
  229. package/dist/src/agent/session/session-inspector.js +1 -1
  230. package/dist/src/agent/source-context/index.js +2 -2
  231. package/dist/src/agent/starter-agents.d.ts +0 -4
  232. package/dist/src/agent/starter-agents.js +57 -98
  233. package/dist/src/agent/tasks/task-judge-service.js +4 -4
  234. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  235. package/dist/src/agent/tool-manuals/xopc-use.js +7 -4
  236. package/dist/src/agent/tools/create-share-tool.js +3 -3
  237. package/dist/src/agent/tools/dataBatch.js +1 -1
  238. package/dist/src/agent/tools/delegate-tool.js +3 -3
  239. package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
  240. package/dist/src/agent/tools/executor.js +1 -1
  241. package/dist/src/agent/tools/factory.d.ts +1 -1
  242. package/dist/src/agent/tools/factory.js +37 -30
  243. package/dist/src/agent/tools/fetch-text.js +1 -1
  244. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  245. package/dist/src/agent/tools/index.js +6 -6
  246. package/dist/src/agent/tools/list-dir.js +1 -1
  247. package/dist/src/agent/tools/personal-preference-tool.d.ts +10 -0
  248. package/dist/src/agent/tools/personal-preference-tool.js +43 -0
  249. package/dist/src/agent/tools/personal-task-tool.d.ts +28 -0
  250. package/dist/src/agent/tools/personal-task-tool.js +165 -0
  251. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  252. package/dist/src/agent/tools/read.js +2 -2
  253. package/dist/src/agent/tools/review-workspace.js +1 -1
  254. package/dist/src/agent/tools/send-media.js +2 -2
  255. package/dist/src/agent/tools/skills-tools.js +1 -1
  256. package/dist/src/agent/tools/tts-tool.js +1 -1
  257. package/dist/src/agent/tools/user-context-tool.js +1 -1
  258. package/dist/src/agent/tools/write.js +2 -2
  259. package/dist/src/agent/tools/xopc-use-tool.js +8 -7
  260. package/dist/src/agent/workflow/subagent-runner.js +1 -1
  261. package/dist/src/agent-catalog/capabilities.js +2 -2
  262. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +5 -0
  263. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +94 -0
  264. package/dist/src/agent-catalog/repository.js +7 -1
  265. package/dist/src/agent-catalog/service.d.ts +1 -1
  266. package/dist/src/agent-catalog/service.js +4 -3
  267. package/dist/src/agent-config/index.js +2 -2
  268. package/dist/src/agent-config/schema.d.ts +167 -0
  269. package/dist/src/agent-config/schema.js +47 -6
  270. package/dist/src/ai-assist/text-assist.js +1 -1
  271. package/dist/src/auth/credentials.js +1 -1
  272. package/dist/src/auth/oauth-provider-lock.js +1 -1
  273. package/dist/src/auth/sync-provider-auth.js +1 -1
  274. package/dist/src/automations/capabilities/drafts.js +1 -1
  275. package/dist/src/automations/domain/index.js +2 -2
  276. package/dist/src/automations/index.js +4 -4
  277. package/dist/src/automations/service/automation-service.js +2 -2
  278. package/dist/src/backup/archive.js +1 -1
  279. package/dist/src/bootstrap/application-state.js +3 -1
  280. package/dist/src/browser/native-messaging-host.js +1 -1
  281. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  282. package/dist/src/capabilities/runtime/product.js +1 -1
  283. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  284. package/dist/src/channels/index.js +2 -2
  285. package/dist/src/channels/outbound-sender.js +1 -1
  286. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  287. package/dist/src/channels/pairing/pairing-store.js +6 -6
  288. package/dist/src/chat-commands/agent-edit.js +4 -7
  289. package/dist/src/chat-commands/builtins/config.js +4 -4
  290. package/dist/src/chat-commands/builtins/review.js +1 -1
  291. package/dist/src/chat-commands/builtins/session.js +1 -1
  292. package/dist/src/chat-commands/builtins/thinking.js +13 -3
  293. package/dist/src/chat-commands/builtins/tts.js +1 -1
  294. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  295. package/dist/src/chat-commands/builtins/workflow.js +2 -2
  296. package/dist/src/chat-commands/context.js +10 -4
  297. package/dist/src/chat-commands/index.js +3 -3
  298. package/dist/src/cli/commands/agent.js +7 -7
  299. package/dist/src/cli/commands/agents.js +1 -1
  300. package/dist/src/cli/commands/config.js +1 -1
  301. package/dist/src/cli/commands/connectors.js +1 -1
  302. package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
  303. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  304. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
  305. package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
  306. package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
  307. package/dist/src/cli/commands/doctor/checks/workspace-status.js +0 -1
  308. package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
  309. package/dist/src/cli/commands/extension-dev.js +1 -1
  310. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  311. package/dist/src/cli/commands/extension.js +4 -4
  312. package/dist/src/cli/commands/gateway/shared.js +1 -1
  313. package/dist/src/cli/commands/gateway/token.js +1 -1
  314. package/dist/src/cli/commands/image.js +1 -1
  315. package/dist/src/cli/commands/init.js +1 -34
  316. package/dist/src/cli/commands/models.js +1 -1
  317. package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
  318. package/dist/src/cli/commands/onboard/model.js +2 -2
  319. package/dist/src/cli/commands/onboard.js +1 -1
  320. package/dist/src/cli/commands/project.js +2 -2
  321. package/dist/src/cli/commands/runtime.js +1 -1
  322. package/dist/src/cli/commands/skills.js +2 -2
  323. package/dist/src/cli/commands/tunnel.js +4 -4
  324. package/dist/src/cli/extension-cli-register.js +5 -5
  325. package/dist/src/cli/templates.d.ts +1 -1
  326. package/dist/src/cli/templates.js +1 -23
  327. package/dist/src/cli/utils/gateway-client.js +1 -1
  328. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  329. package/dist/src/cli/utils/session.js +1 -1
  330. package/dist/src/computer/runtime.js +2 -2
  331. package/dist/src/config/index.js +8 -8
  332. package/dist/src/config/loader.js +3 -3
  333. package/dist/src/config/models-json.js +1 -1
  334. package/dist/src/config/paths.d.ts +0 -2
  335. package/dist/src/config/paths.js +1 -3
  336. package/dist/src/config/reload.d.ts +0 -1
  337. package/dist/src/config/reload.js +0 -4
  338. package/dist/src/config/rules.js +0 -5
  339. package/dist/src/config/schema.d.ts +0 -45
  340. package/dist/src/config/schema.js +3 -24
  341. package/dist/src/connectors/cli/authorization.js +1 -1
  342. package/dist/src/connectors/cli/runtime.js +1 -1
  343. package/dist/src/connectors/composio-sessions.js +1 -1
  344. package/dist/src/connectors/composio.js +1 -1
  345. package/dist/src/connectors/connected-source-understanding.js +3 -3
  346. package/dist/src/connectors/connection-recovery-service.js +5 -5
  347. package/dist/src/connectors/health.js +1 -1
  348. package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
  349. package/dist/src/discussions/live-worker.js +1 -1
  350. package/dist/src/discussions/recording.js +1 -1
  351. package/dist/src/discussions/sealer.js +1 -1
  352. package/dist/src/extensions/activation-context.js +3 -3
  353. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  354. package/dist/src/extensions/api.js +4 -4
  355. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  356. package/dist/src/extensions/index.js +3 -3
  357. package/dist/src/extensions/install.js +1 -1
  358. package/dist/src/extensions/loader.js +2 -2
  359. package/dist/src/extensions/sdk/index.js +1 -1
  360. package/dist/src/extensions/sdk/media.js +1 -1
  361. package/dist/src/extensions/update.js +1 -1
  362. package/dist/src/gateway/agents-admin.d.ts +1 -9
  363. package/dist/src/gateway/agents-admin.js +9 -34
  364. package/dist/src/gateway/device-routes.js +2 -2
  365. package/dist/src/gateway/file-path-classifier.js +2 -2
  366. package/dist/src/gateway/global-defaults-admin.js +1 -1
  367. package/dist/src/gateway/hono/app.js +3 -3
  368. package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
  369. package/dist/src/gateway/hono/lib/config-payload.js +4 -4
  370. package/dist/src/gateway/hono/routes/agents.js +1 -1
  371. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  372. package/dist/src/gateway/hono/routes/browser.js +1 -1
  373. package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
  374. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  375. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  376. package/dist/src/gateway/hono/routes/home.js +1 -1
  377. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  378. package/dist/src/gateway/hono/routes/mcp.js +2 -2
  379. package/dist/src/gateway/hono/routes/media.js +1 -1
  380. package/dist/src/gateway/hono/routes/models.js +5 -5
  381. package/dist/src/gateway/hono/routes/notes.js +3 -3
  382. package/dist/src/gateway/hono/routes/personal-agent.d.ts +3 -0
  383. package/dist/src/gateway/hono/routes/personal-agent.js +107 -0
  384. package/dist/src/gateway/hono/routes/projects.js +4 -4
  385. package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
  386. package/dist/src/gateway/hono/routes/session-input-handler.js +4 -4
  387. package/dist/src/gateway/hono/routes/sessions.js +6 -1
  388. package/dist/src/gateway/hono/routes/shares.js +3 -3
  389. package/dist/src/gateway/hono/routes/side-chats.js +1 -1
  390. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  391. package/dist/src/gateway/hono/routes/tasks.js +66 -3
  392. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  393. package/dist/src/gateway/hono/routes/user-model.js +5 -5
  394. package/dist/src/gateway/hono/routes/voice.js +14 -6
  395. package/dist/src/gateway/hono/routes/workflows.js +2 -2
  396. package/dist/src/gateway/image-generation-setup.js +3 -3
  397. package/dist/src/gateway/index.js +1 -1
  398. package/dist/src/gateway/lock.js +11 -11
  399. package/dist/src/gateway/media-access.js +1 -1
  400. package/dist/src/gateway/mobile-privacy.js +2 -2
  401. package/dist/src/gateway/ports.js +6 -6
  402. package/dist/src/gateway/run-loop.js +1 -1
  403. package/dist/src/gateway/scenes/mailContext.js +1 -1
  404. package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
  405. package/dist/src/gateway/server.js +1 -1
  406. package/dist/src/gateway/service/config-coordinator.js +3 -3
  407. package/dist/src/gateway/service/run-gateway-agent.js +3 -3
  408. package/dist/src/gateway/service/session-command-service.js +7 -1
  409. package/dist/src/gateway/service/sessions-api.js +12 -2
  410. package/dist/src/gateway/service.js +49 -49
  411. package/dist/src/gateway/session-context-summary.js +2 -2
  412. package/dist/src/gateway/session-reset-service.js +5 -0
  413. package/dist/src/gateway/workspace-editor-path.js +2 -2
  414. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  415. package/dist/src/home-intelligence/generator.js +1 -1
  416. package/dist/src/home-intelligence/host.js +2 -2
  417. package/dist/src/infra/gateway-processes.js +2 -2
  418. package/dist/src/infra/path-env.js +3 -3
  419. package/dist/src/infra/update-global.js +10 -10
  420. package/dist/src/local-apps/service.js +2 -2
  421. package/dist/src/mcp/gateway-http-client.js +1 -1
  422. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  423. package/dist/src/notes/agent-context.js +4 -4
  424. package/dist/src/notes/index.js +1 -1
  425. package/dist/src/notes/service.js +1 -1
  426. package/dist/src/notes/store.js +1 -1
  427. package/dist/src/personal-agent/policy.d.ts +1 -0
  428. package/dist/src/personal-agent/policy.js +13 -0
  429. package/dist/src/personal-agent/repository.d.ts +25 -0
  430. package/dist/src/personal-agent/repository.js +68 -0
  431. package/dist/src/personal-agent/service.d.ts +48 -0
  432. package/dist/src/personal-agent/service.js +222 -0
  433. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  434. package/dist/src/providers/index.js +2 -2
  435. package/dist/src/providers/model-catalog-persistence.js +1 -1
  436. package/dist/src/providers/model-reference-auditor.js +1 -1
  437. package/dist/src/providers/register-runtime-providers.js +1 -1
  438. package/dist/src/remote-access/exposure-manager.js +1 -1
  439. package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
  440. package/dist/src/scenes/taskFollowUp/resources.js +1 -1
  441. package/dist/src/scenes/taskFollowUp/service.js +4 -4
  442. package/dist/src/session/index.js +2 -2
  443. package/dist/src/session/resolve-session.js +4 -2
  444. package/dist/src/session/session-title.js +1 -1
  445. package/dist/src/session/store.js +4 -4
  446. package/dist/src/session/thinking-resolve.js +1 -1
  447. package/dist/src/share/share-store.js +1 -1
  448. package/dist/src/share/share-thumbnail.js +1 -1
  449. package/dist/src/share/share-zip.js +1 -1
  450. package/dist/src/share/site-proxy.js +1 -1
  451. package/dist/src/share/site-share-store.js +1 -1
  452. package/dist/src/storage/sqlite/connection.js +9 -9
  453. package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +12 -0
  454. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  455. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  456. package/dist/src/storage/sqlite/schema.js +1 -1
  457. package/dist/src/storage/sqlite/schema.sql +13 -0
  458. package/dist/src/storage/sqlite/session-repository.js +6 -2
  459. package/dist/src/storage/sqlite/transcript-repository.js +2 -1
  460. package/dist/src/tasks/capabilities/read.js +5 -2
  461. package/dist/src/tasks/capabilities/write.js +1 -1
  462. package/dist/src/tasks/execution-context.js +1 -1
  463. package/dist/src/tasks/home-query-service.js +3 -3
  464. package/dist/src/tasks/index.js +4 -4
  465. package/dist/src/tasks/task-application-service.js +8 -3
  466. package/dist/src/tasks/task-collaboration-delivery.js +1 -1
  467. package/dist/src/tasks/task-context-assembler.js +1 -1
  468. package/dist/src/tasks/task-criterion-review-repository.d.ts +22 -0
  469. package/dist/src/tasks/task-criterion-review-repository.js +74 -0
  470. package/dist/src/tasks/task-handoff-service.js +1 -1
  471. package/dist/src/tasks/task-main-update-decision-service.js +7 -1
  472. package/dist/src/tui/backends/embedded-backend.js +12 -12
  473. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  474. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  475. package/dist/src/tui/tui-command-formatters.js +1 -1
  476. package/dist/src/tui/tui-commands.js +6 -6
  477. package/dist/src/tui/tui-picker-overlay.js +1 -1
  478. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  479. package/dist/src/tui/tui-startup-resources.js +4 -4
  480. package/dist/src/tui/tui.js +7 -7
  481. package/dist/src/tunnel/frpc-binary.js +1 -1
  482. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  483. package/dist/src/voice/realtime/memory-context.js +3 -3
  484. package/dist/src/voice/realtime/persona-context.d.ts +2 -2
  485. package/dist/src/voice/realtime/persona-context.js +19 -33
  486. package/dist/src/voice/realtime/runtime.js +3 -3
  487. package/dist/src/voice/stt/index.js +2 -2
  488. package/dist/src/voice/stt/preflight.js +1 -1
  489. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  490. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  491. package/dist/src/voice/stt/transcribe-core.js +1 -1
  492. package/dist/src/voice/tts/index.js +3 -3
  493. package/dist/src/voice/tts/merge-config.js +1 -1
  494. package/dist/src/voice/tts/payload.js +1 -1
  495. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  496. package/dist/src/voice/tts/speak-core.js +1 -1
  497. package/dist/src/work-discovery/incremental-repository.js +1 -1
  498. package/dist/src/work-discovery/index.js +1 -1
  499. package/dist/src/work-discovery/service.js +5 -5
  500. package/dist/src/workflows/engine/workflow-engine.js +1 -1
  501. package/dist/src/workflows/service/workflow-run-service.js +8 -8
  502. package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
  503. package/package.json +3 -3
  504. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CgNagNMG.js +0 -1
  505. package/dist/gateway/static/root/assets/agent-plugin-dialog-CDhtsMpV.js +0 -1
  506. package/dist/gateway/static/root/assets/agents-BLP0zRru.js +0 -70
  507. package/dist/gateway/static/root/assets/app-management-settings-panel-DqC-oj5_.js +0 -1
  508. package/dist/gateway/static/root/assets/appearance-settings-Cfhepf6U.js +0 -1
  509. package/dist/gateway/static/root/assets/apps-page-C6n5r8AP.js +0 -1
  510. package/dist/gateway/static/root/assets/automations-workspace-DJ_-_kGh.js +0 -7
  511. package/dist/gateway/static/root/assets/browser-settings-page-COTo7btH.js +0 -3
  512. package/dist/gateway/static/root/assets/capabilities-page-BsC346Ym.js +0 -2
  513. package/dist/gateway/static/root/assets/capabilities-settings-panel-CRL4gfk5.js +0 -8
  514. package/dist/gateway/static/root/assets/capability-header-actions-B_60-buR.js +0 -1
  515. package/dist/gateway/static/root/assets/channels-DNxr72oD.js +0 -1
  516. package/dist/gateway/static/root/assets/computer-settings-page-Bk84TKyF.js +0 -1
  517. package/dist/gateway/static/root/assets/connector-service-page-B2pC--2X.js +0 -1
  518. package/dist/gateway/static/root/assets/connectors-page-Bu15_14O.js +0 -2
  519. package/dist/gateway/static/root/assets/date-picker-CCN30yiy.js +0 -1
  520. package/dist/gateway/static/root/assets/desktop-pet-settings-Dg3RM_vY.js +0 -1
  521. package/dist/gateway/static/root/assets/device-pairing-wizard-DUy1HymM.js +0 -1
  522. package/dist/gateway/static/root/assets/directory-picker-path-field-BTuFpGIK.js +0 -1
  523. package/dist/gateway/static/root/assets/dist-CKkafhaS.js +0 -1
  524. package/dist/gateway/static/root/assets/dist-io9jFpN72.js +0 -1
  525. package/dist/gateway/static/root/assets/extension-debug-page-xM8vfbRZ.js +0 -1
  526. package/dist/gateway/static/root/assets/extension-page-Cl8zlion.js +0 -1
  527. package/dist/gateway/static/root/assets/extension-settings-page-DODk0nOi.js +0 -1
  528. package/dist/gateway/static/root/assets/gateway-realtime-store-B01fiKrV.js +0 -1
  529. package/dist/gateway/static/root/assets/gateway-settings-BL3C7Q9w.js +0 -1
  530. package/dist/gateway/static/root/assets/home-page-CjJVq_Ff.js +0 -1
  531. package/dist/gateway/static/root/assets/imports-page-By9oc8sD.js +0 -1
  532. package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +0 -1
  533. package/dist/gateway/static/root/assets/index-S4z-eKe-.js +0 -106
  534. package/dist/gateway/static/root/assets/local-app-workbench-page-Bnz5YOks.js +0 -1
  535. package/dist/gateway/static/root/assets/logs-page-DVqwybaT.js +0 -2
  536. package/dist/gateway/static/root/assets/management-settings-CUoDWFg7.js +0 -1
  537. package/dist/gateway/static/root/assets/markdown-view-BhFHoVtG.js +0 -201
  538. package/dist/gateway/static/root/assets/messages-vL3EpIrL.js +0 -3
  539. package/dist/gateway/static/root/assets/note-detail-panel-CxbZWvj1.js +0 -5
  540. package/dist/gateway/static/root/assets/notes-page-DkEOEza6.js +0 -8
  541. package/dist/gateway/static/root/assets/page-context-capture-button-CjCYNkVb.js +0 -1
  542. package/dist/gateway/static/root/assets/page-tabs-Dnzie6QW.js +0 -1
  543. package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +0 -1
  544. package/dist/gateway/static/root/assets/preview-open-alternatives-D1H4_Nfl.js +0 -1
  545. package/dist/gateway/static/root/assets/project-detail-page-BWC89e7l.js +0 -1
  546. package/dist/gateway/static/root/assets/projects-page-BYmHC91B.js +0 -1
  547. package/dist/gateway/static/root/assets/remote-access-hub-DuVzpZ9R.js +0 -1
  548. package/dist/gateway/static/root/assets/scenes-page-BBl_4U1U.js +0 -2
  549. package/dist/gateway/static/root/assets/schema-form-Rj-wi9sm.js +0 -1
  550. package/dist/gateway/static/root/assets/sessions-page-BnipzwJ6.js +0 -1
  551. package/dist/gateway/static/root/assets/settings-advanced-gate-C7oNKVxC.js +0 -1
  552. package/dist/gateway/static/root/assets/settings-form-section-6gOr-ype.js +0 -1
  553. package/dist/gateway/static/root/assets/settings-page-D1tVcmlR.js +0 -1
  554. package/dist/gateway/static/root/assets/setup-status-panel-CR0VBBw3.js +0 -1
  555. package/dist/gateway/static/root/assets/share-preview-page-CK0Bg_-o.js +0 -2
  556. package/dist/gateway/static/root/assets/shares-settings-B3Ghvh3c.js +0 -1
  557. package/dist/gateway/static/root/assets/skill-api-CoIsCPbI.js +0 -1
  558. package/dist/gateway/static/root/assets/skill-reload-api-DMIwfISw.js +0 -1
  559. package/dist/gateway/static/root/assets/skills-page-CDkm7yig.js +0 -2
  560. package/dist/gateway/static/root/assets/system-settings-panel-Cfv-jDmY.js +0 -1
  561. package/dist/gateway/static/root/assets/task-detail-page-eYs6qgcW.js +0 -1
  562. package/dist/gateway/static/root/assets/tasks-BH8_WMUF.js +0 -1
  563. package/dist/gateway/static/root/assets/tunnel-api-CpOQaCFN.js +0 -1
  564. package/dist/gateway/static/root/assets/usage-page-Cye-2eKA.js +0 -1
  565. package/dist/gateway/static/root/assets/use-autosave-o6YLrkpO.js +0 -1
  566. package/dist/gateway/static/root/assets/user-model-page-Bg-jeU7W.js +0 -2
  567. package/dist/gateway/static/root/assets/voice-api-key-field-FMNwQIho.js +0 -1
  568. package/dist/gateway/static/root/assets/workflows-page-KnoMMEDN.js +0 -6
  569. package/dist/src/agent/bootstrap/filter-bootstrap-files.d.ts +0 -3
  570. package/dist/src/agent/bootstrap/filter-bootstrap-files.js +0 -18
  571. package/dist/src/agent/context/workspace-templates/HEARTBEAT.md +0 -26
  572. package/dist/src/agent/context/workspace-templates/IDENTITY.md +0 -30
  573. package/dist/src/agent/service/parse-outbound-session-key.d.ts +0 -8
  574. package/dist/src/agent/service/parse-outbound-session-key.js +0 -44
  575. package/dist/src/heartbeat/active-hours.d.ts +0 -11
  576. package/dist/src/heartbeat/active-hours.js +0 -40
  577. package/dist/src/heartbeat/content-check.d.ts +0 -4
  578. package/dist/src/heartbeat/content-check.js +0 -17
  579. package/dist/src/heartbeat/event-prompt.d.ts +0 -4
  580. package/dist/src/heartbeat/event-prompt.js +0 -11
  581. package/dist/src/heartbeat/index.d.ts +0 -5
  582. package/dist/src/heartbeat/index.js +0 -6
  583. package/dist/src/heartbeat/tokens.d.ts +0 -15
  584. package/dist/src/heartbeat/tokens.js +0 -25
  585. package/dist/src/heartbeat/wake.d.ts +0 -13
  586. package/dist/src/heartbeat/wake.js +0 -46
  587. /package/dist/gateway/static/root/assets/{dist-CI_fqRk-2.js → dist-CI_fqRk-.js} +0 -0
@@ -1,5 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-C3S6gqnS.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-S4z-eKe-.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-2.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-BhFHoVtG.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-qcYD05PF.js","assets/messages-vL3EpIrL.js","assets/cn-JdwAhgNB.js","assets/app-link-DRL0YnPs.js","assets/product-delivery-BAks11S4.js","assets/schemas-CObaziC7.js","assets/local-apps-yys1VChX.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-CKkafhaS.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-0p9PIHRy.js","assets/dist-io9jFpN72.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/globe-DSSGFWFn.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/pencil-DmIY3Oa-.js","assets/rotate-cw-LIg3Am9S.js","assets/search-DA7gz22f.js","assets/middleware-Pd0e8Igk.js","assets/gateway-realtime-HO9tL9xo.js","assets/gateway-realtime-store-B01fiKrV.js","assets/local-session-drafts-CuyTzbfW.js","assets/capabilities-D4qdO980.js","assets/tasks-BH8_WMUF.js","assets/session-api-iR1SFNHe.js","assets/gateway-startup-retry-Cg1nbxJR.js","assets/files-Bw4SBGdM.js","assets/session-manager-3YOU74jt.js","assets/tool-activity-BtJkgjFf.js","assets/constants-Co2_smKQ.js","assets/registry-api-C0j3sKT4.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-C_3ucZGI.js","assets/gateway-config-swr-DZWFlfJr.js","assets/button-CS04eWY9.js","assets/electron-env-Dit0bHgy.js","assets/index-B-w6Rk9Z.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/note-image-lightbox-1qg2v-9j.js","assets/block-editor-BdOTO0Yo.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./popover-select-0p9PIHRy.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./copy-Dv6d4Dvw.js";import{t as f}from"./download-Dk-ZjtO6.js";import{t as p}from"./ellipsis-0k4rZLoy.js";import{t as m}from"./external-link-DjqjBmc3.js";import{t as h}from"./eye-CABVeTq0.js";import{t as g}from"./loader-circle-CifKLtgG.js";import{t as _}from"./pencil-DmIY3Oa-.js";import{t as v}from"./search-DA7gz22f.js";import{t as y}from"./x-B_N4OPjy.js";import{t as b}from"./messages-vL3EpIrL.js";import{t as x}from"./cn-JdwAhgNB.js";import{a as S,c as C,f as w,n as T,r as E}from"./locale-store-qcYD05PF.js";import{a as D,i as O,n as k,o as A,r as j,s as M,t as N}from"./dist-BGTk37IG.js";import{t as P}from"./session-manager-3YOU74jt.js";import{t as F}from"./copy-to-clipboard-HOJ79TWv.js";import{i as I}from"./vendor-swr-BIWyz7Rc.js";import{t as L}from"./button-CS04eWY9.js";import{t as R}from"./skeleton-BwbyijEw.js";import{$n as z,Bn as ee,F as te,Fr as ne,Ft as re,Gn as ie,Hn as B,I as ae,Ir as oe,Jc as se,Jn as ce,Kn as V,Nc as H,Nr as le,Oo as ue,Pl as U,Pr as de,Qi as fe,Qn as pe,Sl as W,So as me,Ta as he,Tu as G,Un as ge,Uu as _e,Vn as ve,Wn as ye,Xl as be,Xn as xe,Yn as Se,Zi as K,Zn as Ce,a as we,aa as Te,ar as Ee,bc as De,c as Oe,dr as ke,er as Ae,fr as je,gr as Me,hn as Ne,ia as Pe,kc as Fe,l as Ie,lr as Le,mn as Re,mr as ze,nl as q,nr as J,o as Be,od as Ve,pr as He,rr as Ue,s as We,sd as Ge,ta as Ke,ur as qe,uu as Je,vc as Ye,xc as Xe,zc as Ze,zn as Qe,zo as $e}from"./index-S4z-eKe-.js";import{n as et,t as Y}from"./note-image-lightbox-1qg2v-9j.js";import{t as X}from"./page-context-capture-button-CjCYNkVb.js";var Z=e(t(),1),tt=n(),Q=r(),nt=6e4,rt=36e5,it=864e5;function at(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function ot(e,t,n){let r=t-e;if(r<nt)return n.justNow;if(r<rt){let e=Math.floor(r/nt);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=at(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-it)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*it){let e=Math.floor(r/it);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function st(e,t,n){let r=at(t);if(e>=r)return n.today;if(e>=r-it)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function $(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function ct(e){let t=(0,tt.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,d=T(dt),f=b(d).automations.suggestions,p=b(d).automations,m=a(),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=h):h=t[0];let{data:g}=I(o?`automation-suggestion-coverage`:null,ut,h),_=o?g?.automations.find(e=>Oe(e,o)):void 0,v=_?Be(_,p):[];if(l===`titleAction`){if(_){let e;t[1]===s?e=t[2]:(e=x(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===m?r=t[5]:(r=()=>m(`/automations`),t[4]=m,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(L,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=x(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(U,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==m||t[13]!==i?(c=()=>{m(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=m,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(L,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,f.setup]})]})}if(_){let e;t[16]===s?e=t[17]:(e=x(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===m?r=t[20]:(r=()=>m(`/automations`),t[19]=m,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(L,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:We(f.coveredDescription,{name:_.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:v.map(lt)})]}),i]})}let y;t[24]===s?y=t[25]:(y=x(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=y);let S;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(U,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=S):S=t[26];let C;t[27]===n?C=t[28]:(C=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=C);let w;t[29]===r?w=t[30]:(w=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=w);let E;t[31]!==C||t[32]!==w?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[S,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[C,w]})]}),t[31]=C,t[32]=w,t[33]=E):E=t[33];let D;t[34]!==m||t[35]!==i?(D=()=>{m(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=m,t[35]=i,t[36]=D):D=t[36];let O;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),t[37]=O):O=t[37];let k;t[38]!==f.create||t[39]!==D?(k=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(L,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[O,f.create]})}),t[38]=f.create,t[39]=D,t[40]=k):k=t[40];let A;return t[41]!==k||t[42]!==y||t[43]!==E?(A=(0,Q.jsxs)(`section`,{className:y,children:[E,k]}),t[41]=k,t[42]=y,t[43]=E,t[44]=A):A=t[44],A}function lt(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function ut(){return Ie.list()}function dt(e){return e.language}function ft(e){let t=(0,tt.c)(51),{initial:n,zh:r,busy:i,onClose:a,onSave:o}=e,[s,c]=(0,Z.useState)(n),l;t[0]!==i||t[1]!==a?(l=e=>{!e&&!i&&a()},t[0]=i,t[1]=a,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(D,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[3]=u):u=t[3];let d=r?`编辑纪要内容`:`Edit meeting content`,f;t[4]===d?f=t[5]:(f=(0,Q.jsx)(`header`,{className:`border-b border-edge p-4`,children:(0,Q.jsx)(M,{children:d})}),t[4]=d,t[5]=f);let p=r?`人工修改会保留,重新整理不会覆盖。已创建任务保持不变。`:`Your changes survive regeneration. Existing tasks remain unchanged.`,m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[6]=p,t[7]=m);let h=r?`内容`:`Content`,g;t[8]===s?g=t[9]:(g=e=>c({...s,text:e.target.value}),t[8]=s,t[9]=g);let _;t[10]!==s.text||t[11]!==g?(_=(0,Q.jsx)(`textarea`,{className:`mt-1 min-h-32 w-full rounded border border-edge bg-transparent p-2`,value:s.text,onChange:g}),t[10]=s.text,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==s||t[17]!==r?(y=s.kind===`actionItems`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`负责人原话`:`Owner as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.owner??``,onChange:e=>c({...s,owner:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`期限原话`:`Date as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.dueDate??``,onChange:e=>c({...s,dueDate:e.target.value})})]})]}):null,t[16]=s,t[17]=r,t[18]=y):y=t[18];let b;t[19]!==s||t[20]!==r?(b=s.kind===`summary`?null:(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!s.ignored,onChange:e=>c({...s,ignored:e.target.checked})}),r?`忽略此项`:`Ignore this item`]}),t[19]=s,t[20]=r,t[21]=b):b=t[21];let x;t[22]!==v||t[23]!==y||t[24]!==b||t[25]!==m?(x=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[m,v,y,b]}),t[22]=v,t[23]=y,t[24]=b,t[25]=m,t[26]=x):x=t[26];let S=r?`取消`:`Cancel`,C;t[27]!==i||t[28]!==a||t[29]!==S?(C=(0,Q.jsx)(L,{disabled:i,onClick:a,children:S}),t[27]=i,t[28]=a,t[29]=S,t[30]=C):C=t[30];let w;t[31]!==i||t[32]!==s.text?(w=i||!s.text.trim(),t[31]=i,t[32]=s.text,t[33]=w):w=t[33];let T;t[34]!==s||t[35]!==o?(T=()=>void o(s),t[34]=s,t[35]=o,t[36]=T):T=t[36];let E=r?`保存修改`:`Save changes`,O;t[37]!==w||t[38]!==T||t[39]!==E?(O=(0,Q.jsx)(L,{variant:`primary`,disabled:w,onClick:T,children:E}),t[37]=w,t[38]=T,t[39]=E,t[40]=O):O=t[40];let k;t[41]!==C||t[42]!==O?(k=(0,Q.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge p-3`,children:[C,O]}),t[41]=C,t[42]=O,t[43]=k):k=t[43];let P;t[44]!==x||t[45]!==k||t[46]!==f?(P=(0,Q.jsxs)(A,{children:[u,(0,Q.jsxs)(j,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(32rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[f,x,k]})]}),t[44]=x,t[45]=k,t[46]=f,t[47]=P):P=t[47];let F;return t[48]!==l||t[49]!==P?(F=(0,Q.jsx)(N,{open:!0,onOpenChange:l,children:P}),t[48]=l,t[49]=P,t[50]=F):F=t[50],F}function pt(e,t,n){if(t===`summary`){let r=e.organization;if(!r)return``;let i=r.organization;if(!i)return``;let a=e=>e.filter(e=>n.showIgnored||!e.ignored);return JSON.stringify({discussionId:e.discussion.id,view:t,revision:r.revision,transcriptRevision:r.transcriptRevision,summary:i.summary,decisions:a(i.decisions),actionItems:a(i.actionItems),risks:a(i.risks),openQuestions:a(i.openQuestions),chapters:i.chapters},null,2)}let r=n.query.toLocaleLowerCase(),i=e.transcript.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(r)||e.speakerLabel?.toLocaleLowerCase().includes(r)).slice(0,n.page*50);return i.length?JSON.stringify({discussionId:e.discussion.id,view:t,revision:e.transcript.revision,scope:`loaded filtered segments only`,segments:i.map(e=>({sequence:e.sequence,startedAtMs:e.startedAtMs,speaker:e.speakerLabel,text:e.displayText??e.rawText??``}))},null,2):``}var mt=e=>`${String(Math.floor(e/6e4)).padStart(2,`0`)}:${String(Math.floor(e/1e3)%60).padStart(2,`0`)}`;function ht({noteId:e}){let t=T(e=>e.language)===`zh`,{data:n,mutate:r,isLoading:i}=I([`note-discussion-document`,e],()=>Re(e),{refreshInterval:e=>e&&([`recording`,`stopping`,`sealing`,`organizing`].includes(e.discussion.status)||e.recordingJob?.state===`queued`||e.recordingJob?.state===`running`)?3e3:0}),a=n?.discussion.id,u=`/api/discussions/${encodeURIComponent(a??``)}`,{data:d=[],mutate:p}=I(a?`${u}/actions`:null,e=>S(E(e)),{refreshInterval:1e4}),[m,h]=(0,Z.useState)(`summary`),[g,_]=(0,Z.useState)(``),[b,x]=(0,Z.useState)(`general`),[C,w]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(null),[z,ee]=(0,Z.useState)(!1),[te,ne]=(0,Z.useState)([]),[re,ie]=(0,Z.useState)(null),[B,ae]=(0,Z.useState)(!1),[oe,ce]=(0,Z.useState)(1),V=(0,Z.useRef)(null),H=(0,Z.useRef)(null),[le,ue]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{let e=()=>{r(),p()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-segment-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-segment-updated`,e)}},[r,p]),(0,Z.useEffect)(()=>{n?.discussion.template&&x(n.discussion.template)},[n?.discussion.template]);async function U(e){if(!B){ae(!0),ie(null);try{await e(),await r(),await p()}catch(e){ie(e instanceof Error?e.message:String(e))}finally{ae(!1)}}}function de(e){V.current&&(V.current.readyState===0?(H.current=e/1e3,V.current.load()):V.current.currentTime=e/1e3,V.current.play().catch(()=>void 0))}async function fe(e,t){n?.organization&&await U(async()=>{w((await S(E(`${u}/transcript?revision=${t??n.organization.transcriptRevision}`))).segments.filter(t=>e.includes(t.sequence)))})}let pe=(e,n,r)=>n.some(e=>z||!e.ignored)?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold text-fg`,children:e}),n.filter(e=>z||!e.ignored).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`flex-1 whitespace-pre-wrap`,children:[e.text,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更`:`Later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B,onClick:()=>F({kind:r,itemId:e.id,text:e.text,ignored:e.ignored}),children:t?`编辑`:`Edit`}),e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`shrink-0 text-accent-fg`,onClick:()=>void fe(e.evidenceSegmentIds,e.evidenceRevision),children:t?`原话`:`Source`}):(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t?`暂无定位`:`No source timing`})]},e.id))]}):null;if(i)return(0,Q.jsx)(R,{className:`h-48 w-full`});if(!n)return null;let{discussion:W,transcript:me,organization:he}=n,G=he?.organization,ge=[`stopping`,`sealing`,`organizing`].includes(W.status),_e=[`recording`,`completed`,`needs_attention`].includes(W.status),ve=me.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(g.toLocaleLowerCase())||e.speakerLabel?.toLocaleLowerCase().includes(g.toLocaleLowerCase())),ye=pt(n,m,{query:g,page:oe,showIgnored:z});return(0,Q.jsxs)(`section`,{className:`relative flex h-full min-h-0 w-full flex-col text-fg`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-edge-subtle p-4`,children:[(0,Q.jsx)(Je,{className:`size-4 text-accent`}),(0,Q.jsxs)(`span`,{className:`text-sm font-medium`,children:[mt(W.durationMs??0),` · `,ge?t?`正在整理`:`Processing`:W.status===`completed`?t?`整理完成`:`Ready`:W.status]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsxs)(c,{value:b,"aria-label":t?`纪要模板`:`Summary template`,onChange:e=>x(e.target.value),children:[(0,Q.jsx)(l,{value:`general`,children:t?`通用会议`:`General`}),(0,Q.jsx)(l,{value:`project`,children:t?`项目例会`:`Project`}),(0,Q.jsx)(l,{value:`review`,children:t?`需求评审`:`Review`}),(0,Q.jsx)(l,{value:`interview`,children:t?`客户访谈`:`Interview`})]}),(0,Q.jsxs)(L,{disabled:B||ge||!W.canonicalTranscript,onClick:()=>void U(()=>S(E(`${u}/organize`),{method:`POST`,body:JSON.stringify({template:b})})),children:[(0,Q.jsx)(se,{className:`size-3.5`}),t?`重新整理`:`Regenerate`]})]})]}),(0,Q.jsxs)(`nav`,{"aria-label":t?`会议内容`:`Meeting content`,className:`flex shrink-0 items-center gap-4 border-b border-edge-subtle px-4 py-2 text-sm`,children:[[`summary`,`transcript`].map(e=>(0,Q.jsx)(`button`,{className:m===e?`font-medium text-accent-fg`:`text-fg-muted`,onClick:()=>h(e),children:e===`summary`?t?`纪要与行动`:`Summary & actions`:t?`逐字稿`:`Transcript`},e)),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(f,{className:`size-3`}),[`md`,`txt`,`srt`].map(e=>(0,Q.jsx)(`a`,{className:`text-accent-fg`,href:E(`${u}/export?format=${e}`),download:!0,children:e.toUpperCase()},e))]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-edge-subtle px-4 py-2`,children:[(0,Q.jsx)(X,{resource:{kind:`note`,id:e,revision:String(n.note.remoteVersion??1)},selection:{text:ye,draft:!1},label:t?`引用当前会议内容到新对话`:`Reference displayed meeting content`,disabled:B||ge||!!(P||O)||!ye||ye.length>16e3}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:ye.length>16e3?t?`内容超过 16,000 字符,请筛选更少的逐字稿内容后重试。`:`Over 16,000 characters. Filter fewer transcript segments and try again.`:t?`仅附带当前纪要或已加载的筛选逐字稿,不含录音;作为用户提供的文本。`:`Includes this summary or loaded filtered transcript only, not audio; treated as user-provided text.`})]}),re?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-sm text-danger`,children:re}):null,n.recordingJob?.state===`queued`||n.recordingJob?.state===`running`?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:t?`录音已上传,正在后台校验与保存。关闭此页面不会中断处理。`:`Recording uploaded. Verification and saving continue in the background, even if you close this page.`}):null,W.status===`needs_attention`?(0,Q.jsxs)(`div`,{className:`flex gap-2 p-4 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:W.failureMessage}),(0,Q.jsx)(`button`,{disabled:B,onClick:()=>void U(()=>Ne(W.id)),children:t?`重试`:`Retry`})]}):null,he&&he.transcriptRevision!==me.revision?(0,Q.jsx)(`p`,{className:`px-4 py-2 text-xs text-fg-muted`,children:t?`转写已修改,当前纪要引用的是修改前版本。重新整理可生成新版纪要。`:`Transcript changed. This summary cites the previous revision; regenerate to update.`}):null,(0,Q.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:m===`summary`?G?(0,Q.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:G.summaryEditedByUser?t?`概要已人工编辑`:`Overview edited`:``}),(0,Q.jsx)(`button`,{disabled:B||ge,onClick:()=>F({kind:`summary`,itemId:`summary`,text:G.summary}),children:t?`编辑概要`:`Edit overview`})]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:G.summary}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:z,onChange:e=>ee(e.target.checked)}),t?`显示已忽略项`:`Show ignored items`]}),te.length?(0,Q.jsx)(L,{disabled:B,onClick:()=>void U(async()=>{for(let e of te)await S(E(`${u}/actions/${encodeURIComponent(e)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:he.revision})});ne([])}),children:t?`加入所选 ${te.length} 项任务`:`Add ${te.length} selected tasks`}):null,pe(t?`已决定事项`:`Decisions`,G.decisions,`decisions`),G.actionItems.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`下一步行动`:`Next actions`}),G.actionItems.filter(e=>z||!e.ignored).map(e=>{let n=d.find(t=>t.actionId===e.id);return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[!n&&!e.ignored&&(!(e.supersededBy||e.disputedBy)||e.reviewedChangeId===(e.supersededBy??e.disputedBy))?(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`${t?`选择行动`:`Select action`}: ${e.title}`,className:`ui-checkbox`,checked:te.includes(e.id),onChange:t=>ne(t.target.checked?[...te,e.id]:te.filter(t=>t!==e.id))}):null,(0,Q.jsxs)(`p`,{className:`flex-1 text-sm font-medium`,children:[e.title,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更,请复核`:`Review later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B||ge,onClick:()=>F({kind:`actionItems`,itemId:e.id,text:e.title,owner:e.owner,dueDate:e.dueDate,ignored:e.ignored}),children:t?`编辑`:`Edit`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.owner??(t?`负责人未明确`:`Owner unspecified`),` · `,e.dueDate??(t?`期限未明确`:`Date unspecified`)]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs`,children:[e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`text-accent-fg`,onClick:()=>void fe(e.evidenceSegmentIds,e.evidenceRevision),children:t?`查看原话`:`Source`}):null,n?n.deleted?(0,Q.jsx)(`span`,{children:t?`关联任务已删除`:`Linked task deleted`}):(0,Q.jsx)(o,{className:`text-accent-fg`,to:`/tasks/${encodeURIComponent(n.taskId)}`,children:n.resolution===`done`?t?`已完成 · 查看任务`:`Done · View task`:t?`查看任务 / 交给助手`:`View task / Delegate`}):e.ignored?null:(0,Q.jsx)(L,{disabled:B||!!(e.supersededBy||e.disputedBy)&&e.reviewedChangeId!==(e.supersededBy??e.disputedBy),onClick:()=>void U(()=>S(E(`${u}/actions/${encodeURIComponent(e.id)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:he.revision})})),children:t?`加入我的任务`:`Add to my tasks`})]})]},e.id)})]}):null,pe(t?`风险`:`Risks`,G.risks,`risks`),pe(t?`尚未确定`:`Open questions`,G.openQuestions,`openQuestions`),G.changes?.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`前后变更`:`Changes during the meeting`}),G.changes.map(e=>{let n=[...G.decisions,...G.actionItems,...G.risks,...G.openQuestions],r=n.find(t=>t.id===e.fromId),i=n.find(t=>t.id===e.toId);return!r||!i?null:(0,Q.jsxs)(`article`,{className:`space-y-2 rounded border border-edge p-3 text-sm`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.relation===`supersedes`?t?`后续撤销或替代`:`Later superseded`:t?`存在冲突,尚未明确解决`:`Unresolved conflict`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void fe(r.evidenceSegmentIds,r.evidenceRevision),children:`title`in r?r.title:r.text}),(0,Q.jsx)(`span`,{children:`↓`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void fe(i.evidenceSegmentIds,i.evidenceRevision),children:`title`in i?i.title:i.text})]},`${e.fromId}:${e.toId}`)})]}):null,G.chapters.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`章节回顾`:`Chapters`}),G.chapters.map((e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{className:`text-sm text-accent-fg`,onClick:()=>de(e.startedAtMs),children:[mt(e.startedAtMs),` · `,e.title]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary})]},t))]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:ge?t?`录音已保存,纪要正在生成。可以先查看逐字稿。`:`Recording saved. Summary is processing; you can read the transcript.`:t?`录音结束后自动生成纪要。`:`Summary appears after recording ends.`}),ge?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(R,{className:`h-6 w-3/4`}),(0,Q.jsx)(R,{className:`h-24 w-full`})]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-edge px-3`,children:[(0,Q.jsx)(v,{className:`size-4 text-fg-muted`}),(0,Q.jsx)(`input`,{className:`w-full bg-transparent py-2 text-sm outline-none`,placeholder:t?`查找原话或说话人`:`Search words or speaker`,value:g,onChange:e=>{_(e.target.value),ce(1)}})]}),ve.slice(0,oe*50).map(e=>(0,Q.jsxs)(`article`,{className:`rounded-md border p-3 ${le>=e.startedAtMs&&le<e.endedAtMs?`border-accent`:`border-edge-subtle`}`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-accent-fg`,onClick:()=>de(e.startedAtMs),children:[(0,Q.jsx)(q,{className:`size-3`}),mt(e.startedAtMs)]}),(0,Q.jsx)(`span`,{children:e.speakerLabel??(t?`未区分说话人`:`Speaker unknown`)}),_e&&e.status===`confirmed`?(0,Q.jsx)(`button`,{className:`ml-auto`,onClick:()=>k({segment:e,text:e.displayText??e.rawText??``,speaker:e.speakerLabel??``}),children:t?`校对`:`Edit`}):null]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6`,children:e.displayText??e.rawText??(t?`等待转写`:`Awaiting transcription`)})]},e.sequence)),ve.length>oe*50?(0,Q.jsx)(L,{onClick:()=>ce(oe+1),children:t?`加载更多`:`More`}):null]})}),W.audioAttachmentId&&!W.audioDeletedAt?(0,Q.jsxs)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:[(0,Q.jsx)(`audio`,{ref:V,controls:!0,preload:`metadata`,className:`h-10 w-full`,src:E(`${u}/audio`),onTimeUpdate:()=>ue((V.current?.currentTime??0)*1e3),onLoadedMetadata:()=>{H.current!==null&&V.current&&(V.current.currentTime=H.current,H.current=null)},onError:()=>ie(t?`录音暂不可播放`:`Recording unavailable`)}),(0,Q.jsx)(`a`,{className:`mt-1 block text-right text-xs text-accent-fg`,href:E(`${u}/audio`),download:!0,children:t?`下载录音`:`Download recording`})]}):null,C?(0,Q.jsxs)(`aside`,{"aria-label":t?`原话证据`:`Source evidence`,className:`absolute inset-y-0 right-0 z-10 flex w-[min(26rem,100%)] flex-col border-l border-edge bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(`h3`,{children:t?`原话证据`:`Source evidence`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭`:`Close`,onClick:()=>w(null),children:(0,Q.jsx)(y,{className:`size-4`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:C.length?C.map(e=>(0,Q.jsxs)(`article`,{children:[(0,Q.jsxs)(`button`,{className:`mb-2 text-xs text-accent-fg`,onClick:()=>de(e.startedAtMs),children:[mt(e.startedAtMs),` · `,e.speakerLabel??(t?`说话人未明确`:`Unknown speaker`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:e.displayText??e.rawText})]},e.sequence)):(0,Q.jsx)(`p`,{children:t?`此版本暂无可定位原话。`:`No timed source available for this revision.`})})]}):null,P&&he?(0,Q.jsx)(ft,{initial:P,zh:t,busy:B,onClose:()=>F(null),onSave:e=>U(async()=>{await S(E(`${u}/summary`),{method:`PATCH`,body:JSON.stringify({...e,expectedRevision:he.revision})}),F(null)})},`${P.kind}:${P.itemId}:${he.revision}`):null,O?(0,Q.jsx)(N,{open:!0,onOpenChange:e=>{e||k(null)},children:(0,Q.jsxs)(A,{children:[(0,Q.jsx)(D,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(j,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(28rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(M,{children:t?`校对逐字稿`:`Edit transcript`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭校对`:`Close editor`,onClick:()=>k(null),children:(0,Q.jsx)(y,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,Q.jsxs)(`label`,{className:`block text-xs`,children:[t?`本段说话人`:`Speaker for this segment`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:O.speaker,onChange:e=>k({...O,speaker:e.target.value})})]}),O.segment.speakerLabel?(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!O.applyToSpeakerGroup,onChange:e=>k({...O,applyToSpeakerGroup:e.target.checked})}),t?`同时更名所有同标签片段;输入已有标签可合并说话人`:`Rename all segments with this label; use an existing label to merge speakers`]}):null,(0,Q.jsx)(`textarea`,{className:`min-h-32 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:O.text,onChange:e=>k({...O,text:e.target.value})})]}),(0,Q.jsx)(`footer`,{className:`border-t border-edge p-3`,children:(0,Q.jsxs)(L,{variant:`primary`,disabled:B||!O.text.trim(),onClick:()=>void U(async()=>{await S(E(`${u}/segments/${O.segment.sequence}`),{method:`PATCH`,body:JSON.stringify({displayText:O.text,speakerLabel:O.speaker,expectedRevision:O.segment.revision,applyToSpeakerGroup:O.applyToSpeakerGroup,expectedTranscriptRevision:me.revision})}),k(null)}),children:[(0,Q.jsx)(s,{className:`size-4`}),t?`保存修订`:`Save revision`]})})]})]})}):null]})}var gt={edit:_,ai_edit:H,sync:se,restore:Ge};function _t(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function vt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=T(e=>e.language),o=b(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:w(a)},{data:c}=I(e?[`note-history`,e]:null,()=>Ae(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),h=(0,Z.useCallback)(async t=>{u(!0),m(null);try{await He(e,t),f(null),i()}catch{m(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),g=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(be,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(y,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[p?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:p}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=gt[e.trigger]??_,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:x(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:_t(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:ot(e.timestamp,g,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),h(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function yt({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=b(T(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,p=f?.report??null,[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(!1),{data:v,mutate:y,isLoading:S}=I(e?[`note-agent-context-status`,e]:null,()=>Ce(e),{revalidateOnFocus:!1}),C=(0,Z.useCallback)(async()=>{if(!g){_(!0),h(null);try{await y(()=>Le(e),{revalidate:!1})}catch(e){h(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{_(!1)}}},[g,y,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),w=(0,Z.useCallback)(async t=>{try{await qe(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(H,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(Ve,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),v?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:S||g,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:g?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:x(`rounded-full px-2 py-0.5 text-[11px] font-medium`,v.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:v.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:v.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(v.attachments.length)).replace(`{{tokens}}`,String(v.tokenEstimate??0))}),m?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:m}):null,v.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:v.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:p?u.recatalyze:u.catalyzeAction}),p?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:p.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(p.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(`helpful`),className:x(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(De,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(`not_helpful`),className:x(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(Xe,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(W,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var bt=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function xt({open:e,onOpenChange:t,note:n}){let r=T(e=>e.language)===`zh`,i=r?Tt:Et,{data:a,mutate:o}=I(e?[`note-shares`,n.id]:null,()=>J(n.id)),u=I(e?`hosted-share-auth-status`:null,Ke),f=u.data===!0,p=I(e&&f?`hosted-publication-capabilities`:null,fe),h=p.data?.publishing.allowed===!0,_=I(e&&f?[`hosted-note-publications`,n.id]:null,()=>z(n.id)),[v,b]=(0,Z.useState)(new Set),[x,S]=(0,Z.useState)(`86400000`),[C,w]=(0,Z.useState)(``),[E,P]=(0,Z.useState)(``),[R,ee]=(0,Z.useState)(`hosted`),[te,ne]=(0,Z.useState)(!1),[ie,B]=(0,Z.useState)(null),[ae,oe]=(0,Z.useState)(null),[se,H]=(0,Z.useState)(!1),[le,ue]=(0,Z.useState)(null),U=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(b(new Set(U.map(e=>e.id))),oe(null),H(!1),ue(null))},[e,U]);let de=async()=>{ne(!0),ue(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[...v],ttlMs:Number(x),maxViews:C.trim()?Number(C):null,description:E.trim()||void 0};R===`hosted`?(oe((await V(n.id,e)).shareUrl),await _.mutate()):(oe((await ce(n.id,e)).payload.shareUrl),await o())}catch(e){ue(e instanceof Error?e.message:String(e))}finally{ne(!1)}},pe=async(e,t)=>{B(e.id),ue(null);try{t===`refresh`?await ke(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):await Pe(e.id),await _.mutate()}catch(e){ue(e instanceof Error?e.message:String(e))}finally{B(null)}},W=async(e,t)=>{B(e.id),ue(null);try{t===`refresh`?await je(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):t===`extend`?await K(e.id,864e5):await Te(e.id),await o()}catch(e){ue(e instanceof Error?e.message:String(e))}finally{B(null)}},me=async e=>{ue(null);try{if(!await F(e)){H(!1),ue(i.copyFailed);return}H(!0),window.setTimeout(()=>H(!1),1500)}catch{H(!1),ue(i.copyFailed)}};return(0,Q.jsx)(N,{open:e,onOpenChange:t,children:(0,Q.jsxs)(A,{children:[(0,Q.jsx)(D,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(M,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(Ze,{className:`size-4`}),i.title]}),(0,Q.jsx)(O,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(k,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(y,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-inset p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),U.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:U.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.has(e.id),onChange:()=>b(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:wt(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(c,{value:R,onChange:e=>ee(e.target.value),children:[(0,Q.jsx)(l,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(l,{value:`local`,children:i.deliveryLocal})]})]}),R===`hosted`&&u.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(re,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void u.mutate(!0,{revalidate:!1})})}):null,R===`hosted`&&f&&p.data&&!h?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(c,{value:x,onChange:e=>S(e.target.value),children:bt.map(e=>(0,Q.jsx)(l,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:C,onChange:e=>w(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:E,onChange:e=>P(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),ae?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:ae,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(L,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void me(ae),children:[se?(0,Q.jsx)(s,{className:`size-4`}):(0,Q.jsx)(d,{className:`size-4`}),se?i.copied:i.copy]}),(0,Q.jsxs)(L,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(ae,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(m,{className:`size-4`}),i.open]})]})}):null,le?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:le}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(Ct,{share:e,busy:ie===e.id,t:i,onCopy:me,onAction:W},e.id))})]}):null,(_.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:_.data.map(e=>(0,Q.jsx)(St,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:ie===e.id,publishingAllowed:h,t:i,onCopy:me,onAction:pe},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(k,{asChild:!0,children:(0,Q.jsx)(L,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(L,{type:`button`,onClick:()=>void de(),disabled:te||R===`hosted`&&(!f||!h),children:[te?(0,Q.jsx)(g,{className:`size-4 animate-spin`}):(0,Q.jsx)(Ze,{className:`size-4`}),te?i.creating:i.create]})]})]})]})})}function St(e){let t=(0,tt.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,u=l&&`opacity-60`,f;t[0]===u?f=t[1]:(f=x(`rounded-lg border border-edge-subtle p-3`,u),t[0]=u,t[1]=f);let p=r&&!l?o.stale:l?o.inactive:o.active,h;t[2]===p?h=t[3]:(h=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=h);let _;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(`span`,{children:`·`}),t[4]=_):_=t[4];let v=n.maxViews===null?``:` / ${n.maxViews}`,y;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==v?(y=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,v]}),t[5]=n.viewCount,t[6]=o.views,t[7]=v,t[8]=y):y=t[8];let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`span`,{children:`·`}),t[9]=b):b=t[9];let S;t[10]!==n.revision||t[11]!==o.revision?(S=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=S):S=t[12];let C;t[13]!==h||t[14]!==y||t[15]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[h,_,y,b,S]}),t[13]=h,t[14]=y,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.shareUrl?w=t[18]:(w=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=w);let T;t[19]!==C||t[20]!==w?(T=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[C,w]}),t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;t[22]===i?E=t[23]:(E=i?(0,Q.jsx)(g,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=E);let D;t[24]!==T||t[25]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,E]}),t[24]=T,t[25]=E,t[26]=D):D=t[26];let O=!a,k;t[27]!==s||t[28]!==n.shareUrl?(k=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=k):k=t[29];let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(d,{className:`size-3.5`}),t[30]=A):A=t[30];let j;t[31]!==o.copy||t[32]!==O||t[33]!==k?(j=(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:O,onClick:k,children:[A,o.copy]}),t[31]=o.copy,t[32]=O,t[33]=k,t[34]=j):j=t[34];let M=!a,N;t[35]===n.shareUrl?N=t[36]:(N=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=N);let P;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(m,{className:`size-3.5`}),t[37]=P):P=t[37];let F;t[38]!==o.open||t[39]!==M||t[40]!==N?(F=(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:M,onClick:N,children:[P,o.open]}),t[38]=o.open,t[39]=M,t[40]=N,t[41]=F):F=t[41];let I;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(I=r&&!l?(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(se,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=I):I=t[49];let R;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(R=n.revoked?null:(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(Ye,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=R):R=t[54];let z;t[55]!==j||t[56]!==F||t[57]!==I||t[58]!==R?(z=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[j,F,I,R]}),t[55]=j,t[56]=F,t[57]=I,t[58]=R,t[59]=z):z=t[59];let ee;return t[60]!==D||t[61]!==f||t[62]!==z?(ee=(0,Q.jsxs)(`div`,{className:f,children:[D,z]}),t[60]=D,t[61]=f,t[62]=z,t[63]=ee):ee=t[63],ee}function Ct(e){let t=(0,tt.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=x(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let u=n.stale&&!s?i.stale:s?i.inactive:i.active,f;t[2]===u?f=t[3]:(f=(0,Q.jsx)(`span`,{children:u}),t[2]=u,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`span`,{children:`·`}),t[4]=p):p=t[4];let h=n.maxViews===null?``:` / ${n.maxViews}`,_;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==h?(_=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,h]}),t[5]=n.viewCount,t[6]=i.views,t[7]=h,t[8]=_):_=t[8];let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{children:`·`}),t[9]=v):v=t[9];let y;t[10]===n.expiresAt?y=t[11]:(y=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=y);let b;t[12]===y?b=t[13]:(b=(0,Q.jsx)(`span`,{children:y}),t[12]=y,t[13]=b);let S;t[14]!==b||t[15]!==f||t[16]!==_?(S=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,_,v,b]}),t[14]=b,t[15]=f,t[16]=_,t[17]=S):S=t[17];let C;t[18]===n.shareUrl?C=t[19]:(C=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=C);let w;t[20]!==S||t[21]!==C?(w=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[S,C]}),t[20]=S,t[21]=C,t[22]=w):w=t[22];let T;t[23]===r?T=t[24]:(T=r?(0,Q.jsx)(g,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=T);let E;t[25]!==w||t[26]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[w,T]}),t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==a||t[29]!==n.shareUrl?(D=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=D):D=t[30];let O;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(d,{className:`size-3.5`}),t[31]=O):O=t[31];let k;t[32]!==i.copy||t[33]!==D?(k=(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:D,children:[O,i.copy]}),t[32]=i.copy,t[33]=D,t[34]=k):k=t[34];let A;t[35]===n.shareUrl?A=t[36]:(A=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=A);let j;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(m,{className:`size-3.5`}),t[37]=j):j=t[37];let M;t[38]!==i.open||t[39]!==A?(M=(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:A,children:[j,i.open]}),t[38]=i.open,t[39]=A,t[40]=M):M=t[40];let N;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(N=n.stale&&!s?(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(se,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=N):N=t[46];let P;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(P=s?null:(0,Q.jsx)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=P):P=t[52];let F;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(F=n.revoked?null:(0,Q.jsxs)(L,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(Ye,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=F):F=t[57];let I;t[58]!==k||t[59]!==M||t[60]!==N||t[61]!==P||t[62]!==F?(I=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[k,M,N,P,F]}),t[58]=k,t[59]=M,t[60]=N,t[61]=P,t[62]=F,t[63]=I):I=t[63];let R;return t[64]!==E||t[65]!==l||t[66]!==I?(R=(0,Q.jsxs)(`div`,{className:l,children:[E,I]}),t[64]=E,t[65]=l,t[66]=I,t[67]=R):R=t[67],R}function wt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var Tt={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},Et={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function Dt(e){let t=(0,tt.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=de(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=de(u),f=de(Ot),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(le,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function Ot(e){return e.stop}function kt(e,t){let n=ne(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=ne(e);return!r||n.split(`
3
- `)[0]===r?n:[r,n].filter(Boolean).join(`
4
-
5
- `)}var At=()=>i(()=>import(`./block-editor-C3S6gqnS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69])),jt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([70,1,66,5,71,72,3])),Mt=(0,Z.lazy)(()=>At().then(e=>({default:e.BlockEditor}))),Nt=(0,Z.lazy)(()=>jt().then(e=>({default:e.MarkdownEditor})));function Pt(){let e=(0,tt.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Ft(e){let t=(0,tt.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:Je},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:G},t[2]=i.source,t[3]=o);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:h},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=[a,o,c],t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=It,g;t[13]===p?g=t[14]:(g=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=g);let _;t[15]===f.label?_=t[16]:(_=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=_);let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(_e,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=v):v=t[17];let y;t[18]!==f.label||t[19]!==g||t[20]!==_?(y=(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[g,_,v]})}),t[18]=f.label,t[19]=g,t[20]=_,t[21]=y):y=t[21];let b;t[22]!==n||t[23]!==u||t[24]!==r?(b=(0,Q.jsx)(ve,{children:(0,Q.jsx)(Qe,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(ee,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=b):b=t[25];let x;return t[26]!==b||t[27]!==y?(x=(0,Q.jsxs)(B,{modal:!1,children:[y,b]}),t[26]=b,t[27]=y,t[28]=x):x=t[28],x}function It(e){e===`wysiwyg`&&At(),e===`source`&&jt()}function Lt(e){let t=(0,tt.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=T(Rt),g;t[0]===h?g=t[1]:(g=b(h),t[0]=h,t[1]=g);let _=g.notes.lightboxClose,v;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(v=(0,Q.jsx)(zt,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=v):v=t[12];let y;return t[13]!==_||t[14]!==v?(y=(0,Q.jsx)(Y,{closeLabel:_,children:v}),t[13]=_,t[14]=v,t[15]=y):y=t[15],y}function Rt(e){return e.language}function zt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=T(e=>e.language),m=b(f).notes,h=b(f).chat.pageContext,g=b(f).automations.suggestions,{data:_}=I([`note-discussion-document`,e],()=>Re(e)),[y,S]=(0,Z.useState)(!0),w=a(),E=ue(e=>e.resolved)===`dark`,{openImage:D}=et(),[O,k]=(0,Z.useState)(u),[A,j]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),[F,L]=(0,Z.useState)(!1),[R,z]=(0,Z.useState)(``),[ne,re]=(0,Z.useState)(360),[se,ce]=(0,Z.useState)(!1),[V,le]=(0,Z.useState)(!1),[U,fe]=(0,Z.useState)(!1),G=(0,Z.useRef)(0);(0,Z.useEffect)(()=>()=>{G.current+=1},[e]);let[_e,K]=(0,Z.useState)(null),[Ce,Te]=(0,Z.useState)(!1),[De,Oe]=(0,Z.useState)(null),[ke,Ae]=(0,Z.useState)(!1),[je,Ne]=(0,Z.useState)(!1),Pe=(0,Z.useRef)(!1),Fe=(0,Z.useRef)(!1),Ie=(0,Z.useRef)(null),Le=(0,Z.useRef)(null),q=(0,Z.useRef)(null),J=(0,Z.useRef)(null),Be=(0,Z.useRef)(null),He=(0,Z.useRef)(null),We=(0,Z.useRef)(null),Ge=(0,Z.useRef)(null),Ke=(0,Z.useRef)(null),qe=me(e=>e.setPageHeader),Xe=me(e=>e.clearPageHeader),{data:Y,mutate:X,error:tt}=I(e?[`note-detail`,e]:null,()=>xe(e)),{data:nt=[],mutate:rt}=I(e?[`note-threads`,e]:null,()=>Ue(e),{revalidateOnFocus:!1}),it=M!==null,at=(0,Z.useCallback)(e=>{K(`${m.refreshFailed}: ${e instanceof Error?e.message:m.quickCaptureFailedHint}`)},[m.quickCaptureFailedHint,m.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&X().catch(at)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[X,e,at]),(0,Z.useEffect)(()=>{Pe.current=!1,z(``),N(null),j(null),Fe.current=!1,Ke.current=null},[e]),(0,Z.useEffect)(()=>{!Y||Pe.current||(z(Y.title??``),Pe.current=!0)},[Y]),(0,Z.useEffect)(()=>{if(!l||!Y||it||Ke.current===e)return;let t=window.requestAnimationFrame(()=>{Ge.current?.focus(),d?.()});return Ke.current=e,()=>window.cancelAnimationFrame(t)},[l,it,Y,e,d]);let ot=Y?new Date(Y.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,st=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":m.back,className:x(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,$e,i),children:(0,Q.jsx)(Ve,{className:`size-4`,"aria-hidden":!0})}):null,[i,m.back,t,r]),$=(0,Z.useCallback)(()=>{let t=de.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),lt=(0,Z.useCallback)(e=>{e!==`preview`&&$(),k(e)},[$]),ut=(0,Z.useCallback)(t=>{$(),z(t),e&&(J.current=t,Le.current&&clearTimeout(Le.current),Le.current=setTimeout(async()=>{let t=J.current;if(J.current=null,t!==null){L(!0);try{await ze(e,{title:t}),await X(),n?.()}catch{}finally{L(!1)}}},600))},[$,e,X,n]),dt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:x(`flex min-w-0 items-center gap-2`,$e),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:R||ot||void 0,children:R||ot}),F?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:m.saving}):null]}),[m.saving,F,ot,R]),ft=(0,Z.useCallback)(async(t=!1)=>{fe(!0),K(null);try{let n=await Ee(e,{forceNew:t});await X(),await rt(),w(`/chat/${encodeURIComponent(n.conversationId)}`)}catch(e){K(`${m.chatOpenFailedTitle}: ${e instanceof Error?e.message:m.chatOpenFailedMessage}`)}finally{fe(!1)}},[X,rt,w,e,m.chatOpenFailedMessage,m.chatOpenFailedTitle]),pt=(0,Z.useCallback)(async()=>{le(!0),K(null);try{await ie(e),await X()}catch(e){K(`${m.catalysisFailed}: ${e instanceof Error?e.message:m.chatOpenFailedMessage}`)}finally{le(!1)}},[X,e]),mt=(0,Z.useCallback)(()=>{j(A===`breakdown`?null:`breakdown`),!Y?.aiDeep?.catalysis?.report&&!V&&pt()},[A,V,pt,Y?.aiDeep?.catalysis?.report]),gt=(0,Z.useCallback)(()=>{let t=M?M.markdown??``:q.current??Y?.markdown??``,n=M?M.title??``:R,r=kt(n,t);return{source:{type:`note`,id:e,title:n||m.titlePlaceholder},text:r,language:oe(r,f)}},[f,m.titlePlaceholder,Y?.markdown,e,M,R]),_t=(0,Z.useCallback)(async()=>{Ie.current&&clearTimeout(Ie.current),Le.current&&clearTimeout(Le.current),Ie.current=null,Le.current=null;let t=q.current,r=J.current;q.current=null,J.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return Y??null;L(!0);try{let t=await ze(e,i);return await X(t,{revalidate:!1}),n?.(),t}catch(e){return q.current===null&&(q.current=t),J.current===null&&(J.current=r),K(`${m.saveFailed}: ${e instanceof Error?e.message:m.saveFailedHint}`),null}finally{L(!1)}},[X,m.saveFailed,m.saveFailedHint,Y,e,n]),bt=(0,Z.useCallback)(async()=>{if(!Y||U||F)return;fe(!0),K(null);let e=C.getState(),t=++G.current,n=()=>G.current===t&&C.getState().baseUrl===e.baseUrl&&C.getState().conversationId===e.conversationId;try{let t=window.getSelection(),r=t?.anchorNode&&t.focusNode&&Be.current?.contains(t.anchorNode)&&Be.current.contains(t.focusNode)?t.toString():``,i=await _t();if(!i||!n())return;if(q.current!==null||J.current!==null)throw Error(h.unavailable);let a=ae.capture({title:i.title||i.id,text:i.markdown,resourceRefs:[{kind:`note`,id:i.id,revision:String(i.remoteVersion??1)}],selection:r?{text:r,draft:!1}:void 0}),o=await new P().createSession();if(!n())return;if(q.current!==null||J.current!==null)throw Error(h.unavailable);let s=te(e.baseUrl,e.conversationId,o.key);if(!ae.put(s,a))throw Error(h.unavailable);w(`/chat/${encodeURIComponent(o.key)}`)}catch{n()&&K(h.unavailable)}finally{G.current===t&&fe(!1)}},[Y,U,F,_t,w,h.unavailable]),St=(0,Z.useCallback)(async()=>{K(null);let e=await _t();e&&(Oe(e),Te(!0))},[_t]),Ct=(0,Z.useCallback)(async()=>{if(!(je||F)){Ae(!1),Ne(!0),K(null),$(),Ie.current&&clearTimeout(Ie.current),Le.current&&clearTimeout(Le.current),Ie.current=null,Le.current=null,q.current=null,J.current=null;try{await Se(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){K(`${m.deleteFailed}: ${e instanceof Error?e.message:m.quickCaptureFailedHint}`)}finally{Ne(!1)}}},[je,m.deleteFailed,m.quickCaptureFailedHint,e,t,n,F,$]),wt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:x(`flex min-w-0 items-center gap-1 sm:gap-2`,$e),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":m.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(v,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(Dt,{input:gt,showLabel:!1,labels:{read:m.readAloud,preparing:m.readAloudPreparing,pause:m.readAloudPause,resume:m.readAloudResume,retry:m.readAloudRetry,stop:m.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:mt,disabled:V,"aria-label":m.catalysisSectionTitle,className:x(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,A===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:V?m.catalyzing:m.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>ft(!1),"aria-label":m.openChatButton,disabled:U,className:x(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(W,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:U?m.openingChat:m.openChatButton})]}),(0,Q.jsx)(Ft,{mode:O,onModeChange:lt,labels:{edit:m.modeEdit,source:m.modeSource,preview:m.modePreview}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>void bt(),disabled:U||F||!Y||!!M,className:`inline-flex items-center gap-1.5 rounded-lg border border-edge px-2.5 py-1.5 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[(0,Q.jsx)(Je,{className:`size-3.5`,"aria-hidden":!0}),h.capture]}),(0,Q.jsxs)(B,{modal:!1,children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":m.noteActions,title:m.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(ve,{children:(0,Q.jsxs)(Qe,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(ee,{onSelect:()=>void St(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Ze,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(ee,{onSelect:()=>j(A===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(be,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:m.history}),A===`history`?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(ge,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(ee,{disabled:je||F,onSelect:()=>Ae(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(Ye,{className:`size-4`,"aria-hidden":!0}),m.delete]})]})})]})]}),[V,mt,ft,bt,h.capture,Y,M,O,m.history,m.modeEdit,m.modePreview,m.modeSource,U,A,c,m.searchDialogTitle,m.readAloud,m.readAloudPause,m.readAloudPreparing,m.readAloudResume,m.readAloudRetry,m.readAloudStop,lt,gt,St,je,F,f,m.delete,Ae]);(0,Z.useLayoutEffect)(()=>(qe({startExtra:st,main:Y?dt:null,end:Y?wt:null}),()=>{o&&Xe()}),[o,Xe,wt,dt,st,Y,qe]);let Tt=(0,Z.useCallback)(t=>{e&&($(),q.current=t,Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(async()=>{let t=q.current;if(q.current=null,t!==null){L(!0),K(null);try{await ze(e,{markdown:t}),await X(),n?.()}catch(e){K(`${m.saveFailed}: ${e instanceof Error?e.message:m.saveFailedHint}`)}finally{L(!1)}}},600))},[$,e,X,m.saveFailed,m.saveFailedHint,n]),Et=(0,Z.useCallback)(t=>{pe(e,t.timestamp).then(e=>{e&&($(),N(e))})},[e,$]),Ot=(0,Z.useCallback)(()=>{$(),j(null),N(null)},[$]),At=(0,Z.useCallback)(()=>{$(),j(null),N(null),X().catch(at),n?.()},[X,n,at,$]);if((0,Z.useEffect)(()=>()=>{Ie.current&&clearTimeout(Ie.current),Le.current&&clearTimeout(Le.current);let t=q.current,n=J.current;q.current=null,J.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&ze(e,r).catch(()=>void 0)},[e]),Y===void 0)return tt?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:m.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void X().catch(at),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:m.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:m.back})]}):(0,Q.jsx)(Pt,{});if(Y===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:m.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:m.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:m.back})]});let jt=it?M.title??``:R,It=it?M.markdown??``:q.current??Y.markdown??``,Lt=new Date(Y.createdAt).getTime(),Rt=Number.isFinite(Lt)&&Date.now()-Lt<3600*1e3?(0,Q.jsx)(ct,{title:g.noteCreatedTitle,description:g.noteCreatedDescription,prompt:g.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[_e?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:_e}):null,(0,Q.jsx)(we,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(we,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),_?(0,Q.jsxs)(`div`,{className:`mb-2 flex shrink-0 gap-4 text-sm`,children:[(0,Q.jsx)(`button`,{className:y?`text-accent-fg`:`text-fg-muted`,onClick:()=>S(!0),children:f===`zh`?`会议`:`Meeting`}),(0,Q.jsx)(`button`,{className:y?`text-fg-muted`:`text-accent-fg`,onClick:()=>S(!1),children:f===`zh`?`我的笔记`:`My notes`})]}):null,(0,Q.jsxs)(`div`,{ref:Be,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[_&&y?(0,Q.jsx)(ht,{noteId:e}):null,(0,Q.jsx)(`div`,{className:_&&y?`hidden`:`min-h-0 min-w-0 flex-1`,children:it?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[jt&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:jt}),It?(0,Q.jsx)(Me,{noteId:e,content:It,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:m.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[O===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Ge,type:`text`,value:R,onChange:e=>ut(e.target.value),onCompositionStart:()=>{Fe.current=!0},onCompositionEnd:()=>{Fe.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Fe.current&&!t.isComposing&&(e.preventDefault(),(Be.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:m.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Rt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(Pt,{}),children:(0,Q.jsx)(Mt,{initialContent:Y.markdown??``,onChange:Tt,noteId:e},`wysiwyg-${e}`)})})]}),O===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Ge,type:`text`,value:R,onChange:e=>ut(e.target.value),placeholder:m.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Rt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(Pt,{}),children:(0,Q.jsx)(Nt,{initialContent:Y.markdown??``,onChange:Tt,isDark:E},`source-${e}`)})})]}),O===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&D(t.currentSrc||t.src,t.alt)},children:[R&&!Y.markdown.trimStart().startsWith(`# ${R.trim()}\n`)&&Y.markdown.trim()!==`# ${R.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:R}),Y.markdown?(0,Q.jsx)(Me,{noteId:e,content:Y.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:m.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:He,className:x(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!se&&`transition-[width] duration-300 ease-in-out`),style:{width:A?ne:0},children:(0,Q.jsxs)(`div`,{ref:We,className:`flex min-h-0 flex-1 flex-col`,style:{width:ne},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),ce(!0);let n=e.clientX,r=ne,i=e.pointerId,a=0,o=ne,s=ne,c=()=>{a=0,s=o,A&&He.current?.style.setProperty(`width`,`${s}px`),We.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}ce(!1),re(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:x(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,se&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:A===`history`?(0,Q.jsx)(vt,{noteId:e,activeTimestamp:M?.timestamp??null,onSelect:Et,onClose:Ot,onRestored:At}):A===`breakdown`?(0,Q.jsx)(yt,{noteId:e,note:Y??null,catalyzing:V,onCatalyze:pt,onClose:()=>j(null),noteThreads:nt,openingChat:U,onOpenChat:()=>ft(!1),onOpenNewChat:()=>ft(!0)}):null})]})})]}),De?(0,Q.jsx)(xt,{open:Ce,onOpenChange:Te,note:De}):null,(0,Q.jsx)(he,{open:ke,title:m.deleteConfirmTitle,description:m.deleteConfirmDescription.replace(`{{title}}`,Y.title||m.titlePlaceholder),confirmLabel:m.deleteConfirmLabel,cancelLabel:m.deleteCancelLabel,destructive:!0,onConfirm:()=>void Ct(),onCancel:()=>Ae(!1)})]})}export{ot as i,$ as n,st as r,Lt as t};
@@ -1,8 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./popover-select-0p9PIHRy.js";import{t as l}from"./ellipsis-0k4rZLoy.js";import{f as u}from"./markdown-view-BhFHoVtG.js";import{t as d}from"./loader-circle-CifKLtgG.js";import{t as f}from"./plus-Q2yW6OE7.js";import{t as p}from"./search-DA7gz22f.js";import{t as m}from"./x-B_N4OPjy.js";import{t as h}from"./messages-vL3EpIrL.js";import{t as g}from"./cn-JdwAhgNB.js";import{c as _,f as v,n as y}from"./locale-store-qcYD05PF.js";import{i as b}from"./vendor-swr-BIWyz7Rc.js";import{t as x}from"./skeleton-BwbyijEw.js";import{Bn as S,Gl as ee,Hn as C,Nc as te,Oc as w,Rn as ne,So as T,Ta as re,Uu as ie,Vn as E,Wc as D,Wn as ae,Wu as O,Yn as k,Zu as A,ad as j,ar as M,cd as oe,cl as N,cn as P,dn as F,fn as I,hr as se,ir as ce,iu as le,ln as ue,mc as L,mr as de,nd as fe,od as pe,pl as me,pn as he,qn as ge,rd as _e,sn as ve,tr as ye,un as R,uu as be,vc as xe,vr as z,yl as Se,za as Ce,zn as we,zo as Te}from"./index-S4z-eKe-.js";import{i as Ee,t as B}from"./note-detail-panel-CxbZWvj1.js";var De=n(),V=e(t(),1),H=r();function Oe({projectId:e}){let t=y(e=>e.language)===`zh`,n=i(),r=(0,V.useRef)(null),a=(0,V.useRef)(null),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null);async function f(){let t=a.current;if(!(!t||o!==null)){s(0),l(null);try{let r=await he();if(r.consentAcknowledgedAt==null){d(r.consentPolicyVersion);return}let i=await ve(t.file,t.requestId),o=await I({clientRequestId:t.requestId,contextProjectId:e,source:`web`,consentPolicyVersion:r.consentPolicyVersion});t.discussionId=o.discussion.id,await R({...i,serverDiscussionId:o.discussion.id,projectId:e}),o.discussion.audioAttachmentId||await P(i,o.discussion.id,s),await ue(t.requestId),a.current=null,n(`/notes/${encodeURIComponent(o.note.id)}`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}}return(0,H.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-2 text-xs`,children:[(0,H.jsx)(`input`,{ref:r,hidden:!0,type:`file`,accept:`audio/*,.m4a,.wav,.mp3,.webm,.ogg`,onChange:e=>{let n=e.target.files?.[0];if(e.target.value=``,n){if(!n.size||n.size>1073741824){l(t?`音频须为 1 字节至 1 GiB`:`Audio must be between 1 byte and 1 GiB`);return}a.current={file:n,requestId:crypto.randomUUID()},f()}}}),(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md p-2 hover:bg-surface-hover`,disabled:o!==null,onClick:()=>c&&a.current?void f():r.current?.click(),children:[(0,H.jsx)(L,{className:`size-3.5`}),o===null?c&&a.current?t?`重试导入`:`Retry import`:t?`导入录音`:`Import recording`:`${o}%`]}),u===null?null:(0,H.jsxs)(`span`,{children:[t?`请确认你有权上传此录音,并允许配置的语音服务处理。`:`Confirm permission to upload this recording and process it with your configured speech service.`,(0,H.jsx)(`button`,{type:`button`,className:`p-2 text-accent`,onClick:()=>void F(u).then(()=>(d(null),f())).catch(e=>l(String(e))),children:t?`确认导入`:`Confirm import`})]}),c?(0,H.jsx)(`span`,{role:`alert`,className:`text-danger`,children:c}):null]})}async function ke(e){e.note??=await ge({title:e.title,markdown:e.markdown,projectId:e.projectId,channel:`web`},e.requestId);let t=e.note.id;for(let n=e.attachments.length;n<e.files.length;n++)e.attachments.push(await se(t,e.files[n],`${e.requestId}:file:${n}`));if(e.attachments.length){let n=e.attachments.map(e=>`[${e.fileName.replace(/[\\[\]]/g,`\\$&`).replace(/[\r\n]/g,` `)}](${z(t,e.id)})`);e.note=await de(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
2
-
3
- `)}`})}return{noteId:t,conversationId:(await M(t,{projectId:e.projectId})).conversationId}}function U(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var W={meeting:fe,requirements:be,research:D,weekly:O};function Ae({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,u=i(),[f,p]=(0,V.useState)(``),[h,_]=(0,V.useState)(null),[v,y]=(0,V.useState)(!1),[b,x]=(0,V.useState)([]),[S,ee]=(0,V.useState)(!1),[C,w]=(0,V.useState)(null),[T,re]=(0,V.useState)(``),E=(0,V.useRef)(null),D=(0,V.useRef)(!1),ae=(0,V.useRef)(null),O=(0,V.useRef)(null),k=S||!!E.current,A=h?l.templateOptions[h]:null,j=!!(f.trim()||b.length);async function M(){if(!(D.current||!j&&!E.current)){D.current=!0,ee(!0),w(null),E.current??={requestId:crypto.randomUUID(),title:f.trim().split(`
4
- `)[0]?.slice(0,80)||A?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${A?`${A.prompt}\n`:``}${f.trim()}`,projectId:t||void 0,files:[...b],attachments:[],materialHeading:l.materialsHeading};try{let e=await ke(E.current);r(),u(U(e.conversationId,e.noteId,l.agentPrompt))}catch(e){E.current.note&&r(),w(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{D.current=!1,ee(!1)}}}function oe(){E.current=null,w(null),p(``),x([]),_(null),y(!1),O.current?.focus()}return(0,H.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,H.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),M()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,H.jsxs)(`fieldset`,{disabled:k,className:`min-w-0`,children:[(0,H.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,H.jsx)(te,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:l.agentResultHint}),A?(0,H.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft px-3 py-2 text-xs leading-5 text-accent-fg`,children:[(0,H.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`font-medium`,children:[A.label,` · `]}),A.prompt.split(`
5
-
6
- `)[0]]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>_(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,H.jsx)(m,{className:`size-3.5`})})]}):null,(0,H.jsx)(`textarea`,{ref:O,id:`notes-home-prompt`,value:f,onChange:e=>p(e.target.value),placeholder:A?A.prompt.split(`
7
-
8
- `).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),M())},className:`mt-2 min-h-16 w-full resize-y bg-transparent py-2 text-base leading-6 text-fg outline-none placeholder:text-fg-muted sm:text-sm`}),b.length?(0,H.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:b.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex max-w-full items-center gap-2 rounded-md border border-edge px-2 py-1 text-xs text-fg-muted`,children:[(0,H.jsx)(N,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`${l.removeMaterial}: ${e.name}`,onClick:()=>x(e=>e.filter((e,n)=>n!==t)),className:`rounded p-1 hover:bg-surface-hover`,children:(0,H.jsx)(m,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,H.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,H.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({value:e.id,label:e.name})),selectedLabel:t?e.find(e=>e.id===t)?.name:l.unassigned,placeholder:l.unassigned,emptyLabel:l.unassigned,ariaLabel:l.assignProject,triggerIcon:(0,H.jsx)(le,{className:`size-4 shrink-0`,"aria-hidden":!0}),triggerClassName:`h-8 border-transparent bg-transparent px-2 text-xs text-fg-muted hover:bg-surface-hover`,onChange:n,disabled:k,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:T,onSearchChange:re})}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>ae.current?.click(),className:`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover`,children:[(0,H.jsx)(N,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,H.jsx)(`input`,{ref:ae,type:`file`,multiple:!0,className:`hidden`,"aria-label":l.addMaterials,onChange:e=>{let t=Array.from(e.target.files??[]);x(e=>[...e,...t]),e.target.value=``}})]})]}),(0,H.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,H.jsxs)(`button`,{type:`submit`,disabled:S||!E.current&&!j,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-on-accent hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[S?(0,H.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,H.jsx)(_e,{className:`size-4`,"aria-hidden":!0}),S?l.creating:C?l.retry:l.agentCreate]})})]}),C?(0,H.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-3 text-xs text-danger`,role:`alert`,children:[(0,H.jsx)(`p`,{children:C}),E.current?.note?(0,H.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[E.current?.note?(0,H.jsx)(`button`,{type:`button`,onClick:()=>u(`/notes/${encodeURIComponent(E.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,H.jsx)(`button`,{type:`button`,onClick:oe,className:`underline`,children:l.newRequest})]})]}):null,(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,H.jsxs)(`button`,{type:`button`,disabled:k,"aria-expanded":v,"aria-controls":`notes-home-templates`,onClick:()=>y(e=>!e),className:`touch-target inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[l.templates,(0,H.jsx)(ie,{className:g(`size-3.5 transition-transform`,v&&`rotate-180`),"aria-hidden":!0})]}),(0,H.jsxs)(`button`,{type:`button`,disabled:S,onClick:()=>ne(),className:`touch-target ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,H.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]}),(0,H.jsxs)(`div`,{id:`notes-home-templates`,hidden:!v,className:g(`mt-1 flex-wrap items-center gap-1 text-xs text-fg-muted`,v?`flex`:`hidden`),children:[Object.keys(W).map(e=>{let t=W[e];return(0,H.jsxs)(`button`,{type:`button`,disabled:k,"aria-pressed":h===e,onClick:()=>{_(h===e?null:e),O.current?.focus()},className:g(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,h===e&&`bg-accent-soft text-accent-fg`),children:[(0,H.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,H.jsx)(Oe,{})]})]})}function je(e,t){let n=Number(e.get(`page`)??0),r=Number.isSafeInteger(n)&&n>=0?n:0,i=e.get(`view`);return{projectId:e.get(`projectId`)||void 0,unassigned:e.get(`unassigned`)===`true`||i===`unassigned`||void 0,pinned:i===`favorites`?!0:void 0,agentEdited:i===`agent`||void 0,status:i===`archived`?`archived`:void 0,search:t.trim()||void 0,sortBy:`updatedAt`,sortOrder:`desc`,limit:12,offset:r*12}}function Me(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var G=`touch-target inline-flex min-h-9 items-center justify-center gap-2 rounded-lg px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`;function K(){let e=y(e=>e.language),t=h(e).notes,n=t.home,r=_(e=>e.conversationId),o=T(e=>e.setPageHeader),u=T(e=>e.clearPageHeader),m=i(),{pathname:ne,search:D}=s(),[O,M]=a(),N=O.get(`projectId`)||``,P=O.get(`view`)||`all`,F=O.get(`unassigned`)===`true`||P===`unassigned`,I=O.get(`search`)||``,[se]=Ce(I,250),[ue,L]=(0,V.useState)(N),[he,_e]=(0,V.useState)(``),[ve,R]=(0,V.useState)(null),[z,Se]=(0,V.useState)(!1),[B,De]=(0,V.useState)(!1),[Oe,ke]=(0,V.useState)(new Set),[U,W]=(0,V.useState)(null),[K,Ne]=(0,V.useState)(null),q=(0,V.useRef)(new Set),J=(0,V.useRef)(null),Pe=(0,V.useRef)(!1),Fe=(0,V.useRef)(null),Ie=je(O,se),Y=(Ie.offset??0)/12,{data:Le,error:Re,isLoading:ze,mutate:Be}=b(r?[`notes-home`,r,Ie]:null,()=>ce(Ie)),{data:Ve,error:He,isLoading:X,mutate:Ue}=b(r?[`notes-home-projects`,r]:null,ye),Z=Ve?.items??[],We=Z.filter(e=>e.noteCount>0).slice(0,2),Ge=Z.find(e=>e.id===N)?.name??n.projectNotes,Ke=Le?.items??[],Q=Le?.total??0,qe=ze||I!==se,Je=(0,V.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:v(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[Ye,Xe]=(0,V.useState)(()=>Date.now());(0,V.useEffect)(()=>{L(N)},[N]),(0,V.useEffect)(()=>{let e=window.setInterval(()=>Xe(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let $=(0,V.useCallback)(()=>{Be().catch(()=>void 0),Ue().catch(()=>void 0)},[Be,Ue]);(0,V.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,$)),()=>e.forEach(e=>window.removeEventListener(e,$))},[$]);let Ze=(0,V.useCallback)((e,t=!1)=>{let n=`${ne}${D}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),m(`/notes/${encodeURIComponent(e)}?${r}`)},[ne,D,m]),Qe=(0,V.useCallback)(async()=>{if(!(Pe.current||!r)){Pe.current=!0,Se(!0),R(null),J.current??={key:crypto.randomUUID(),projectId:N||void 0};try{let e=await ge({markdown:``,kind:`thought`,projectId:J.current.projectId},J.current.key);J.current=null,$(),Ze(e.id,!0)}catch(e){R(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{Pe.current=!1,Se(!1)}}},[N,t.createBlankFailed,t.createBlankFailedHint,Ze,$,r]),$e=(0,V.useCallback)(e=>{M(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[M]);function et(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),L(e),M(n)}function tt(e){M(t=>{let n=new URLSearchParams(t);return F&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function nt(e,n){if(!q.current.has(e)){q.current.add(e),ke(new Set(q.current)),R(null);try{await de(e,{pinned:n}),$()}catch(e){R(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{q.current.delete(e),ke(new Set(q.current))}}}async function rt(){let e=U;if(!(!e||K)){W(null),Ne(e.id),R(null);try{await k(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),$()}catch(e){R(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{Ne(null)}}}if((0,V.useLayoutEffect)(()=>{if(!r){u();return}return o({startExtra:null,main:(0,H.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,H.jsx)(`div`,{className:g(`flex min-w-0 items-center gap-2`,Te),children:(0,H.jsxs)(`label`,{className:`flex h-9 w-32 min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2 sm:w-48`,children:[(0,H.jsx)(p,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,H.jsx)(`input`,{ref:Fe,type:`search`,value:I,onChange:e=>$e(e.target.value),"aria-label":t.searchDialogTitle,placeholder:t.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`})]})})}),()=>u()},[u,Qe,z,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,I,o,$e,r]),(0,V.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.isComposing||e.target?.closest(`input, textarea, [contenteditable="true"], [role="dialog"]`)||(e.key.toLowerCase()===`n`&&(e.preventDefault(),Qe()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Fe.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Qe]),!r)return(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-fg-muted`,children:t.needToken});let it=[{id:`all`,label:n.homeNav,Icon:me},{id:`favorites`,label:n.favorites,Icon:w},{id:`unassigned`,label:n.unassigned,Icon:ee},{id:`archived`,label:t.filterArchived,Icon:oe}],at=N?`project:${N}`:F?`unassigned`:`all`,ot=!qe&&!Re&&Q===0&&!N&&!F&&!I&&P===`all`;return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,H.jsxs)(`aside`,{className:`hidden w-44 shrink-0 flex-col gap-1 overflow-y-auto px-3 py-6 xl:flex`,"aria-label":n.homeNav,children:[it.map(({id:e,label:t,Icon:n})=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>et(``,e),"aria-current":!N&&(e===`unassigned`?F:!F&&P===e)?`page`:void 0,className:g(G,`justify-start px-2 text-left text-xs`,!N&&(e===`unassigned`?F:!F&&P===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,H.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,H.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),X?[0,1,2].map(e=>(0,H.jsx)(x,{className:`mb-2 h-8 w-full`},e)):Z.slice(0,8).map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>et(e.id),"aria-current":N===e.id?`page`:void 0,className:g(G,`justify-start px-2 text-left text-xs`,N===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,H.jsx)(le,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>m(`/projects`),className:g(G,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,H.jsx)(j,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,H.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,H.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col px-4 pb-4 pt-3 sm:px-6 sm:pb-7 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,H.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:N?Ge:F?n.unassigned:ot?n.firstNoteTitle:n.continueTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:N?n.projectDescription:ot?n.firstNoteDescription:n.continueDescription})]}),N?(0,H.jsxs)(`button`,{type:`button`,onClick:()=>m(`/projects/${encodeURIComponent(N)}`),className:g(G,`text-xs`),children:[n.openProject,(0,H.jsx)(j,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),ve?(0,H.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:ve}):null,(0,H.jsxs)(`section`,{"aria-label":n.startAction,children:[(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{De(e=>!e),B||window.requestAnimationFrame(()=>document.getElementById(`notes-home-prompt`)?.focus())},"aria-expanded":B,"aria-controls":`notes-home-agent-composer`,className:g(`touch-target flex min-h-20 items-center gap-3 rounded-xl border p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,B?`border-accent/60 bg-accent-soft`:`border-edge bg-surface-panel hover:bg-surface-hover`),children:[(0,H.jsx)(te,{className:`size-5 shrink-0 text-accent-fg`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n.agentAction}),(0,H.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:n.agentActionHint})]}),(0,H.jsx)(ie,{className:g(`size-4 shrink-0 text-fg-muted transition-transform`,B&&`rotate-180`),"aria-hidden":!0})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void Qe(),disabled:z,className:`touch-target flex min-h-20 items-center gap-3 rounded-xl border border-edge bg-surface-panel p-4 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[z?(0,H.jsx)(d,{className:`size-5 shrink-0 animate-spin text-fg-muted`,"aria-hidden":!0}):(0,H.jsx)(f,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n.blankNote}),(0,H.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:n.blankActionHint})]})]})]}),(0,H.jsx)(`div`,{id:`notes-home-agent-composer`,hidden:!B,className:g(`mt-3`,!B&&`hidden`),children:(0,H.jsx)(Ae,{projects:Z,projectId:ue,onProjectChange:L,onCreated:$,labels:t,projectsLoading:X,projectsError:!!He})})]}),He?(0,H.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,H.jsx)(`span`,{children:n.projectsLoadFailed}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void Ue().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,ot?null:(0,H.jsxs)(`section`,{className:`mt-8 pb-6`,"aria-label":n.recentNotes,children:[(0,H.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:P===`favorites`?n.favorites:P===`archived`?t.filterArchived:N?n.projectNotes:n.recentNotes}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-pressed":P===`agent`,onClick:()=>tt(P===`agent`?`all`:`agent`),className:g(`touch-target rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,P===`agent`&&`bg-accent-soft text-accent-fg`),children:n.agentEdited}),(0,H.jsx)(`span`,{className:`hidden text-xs text-fg-muted xl:inline`,children:n.sortUpdated}),(0,H.jsx)(`div`,{className:`w-48 max-w-full xl:hidden`,children:(0,H.jsx)(c,{value:at,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...Z.filter(e=>e.name.toLowerCase().includes(he.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:N?Ge:F?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:X,searchPlaceholder:n.projectSearch,searchValue:he,onSearchChange:_e,onChange:e=>et(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 border-b border-edge xl:hidden`,"aria-label":t.libraryTitle,children:[[{id:`all`,label:t.filterAll},{id:`favorites`,label:n.favorites},{id:`archived`,label:t.filterArchived}].map(({id:e,label:t})=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":P===e||e===`all`&&P===`unassigned`,onClick:()=>tt(e),className:g(`touch-target border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(P===e||e===`all`&&P===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,H.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Re?(0,H.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,H.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void Be().catch(()=>void 0),className:g(G,`mt-2`),children:n.retry})]}):qe?(0,H.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,H.jsx)(x,{className:`h-10 w-8 shrink-0`}),(0,H.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,H.jsx)(x,{className:`h-4 w-2/3`}),(0,H.jsx)(x,{className:`h-3 w-1/2`})]})]},e))}):Ke.length===0?(0,H.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,H.jsx)(me,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,H.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:I||P!==`all`&&P!==`unassigned`?n.noMatches:N?n.projectEmpty:n.emptyTitle}),(0,H.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:I||P!==`all`&&P!==`unassigned`?n.noMatchesHint:N?n.projectEmptyHint:n.emptyDescription})]}):(0,H.jsx)(`ul`,{className:`divide-y divide-edge`,children:Ke.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?fe:e.kind===`bookmark`?A:be,i=Me(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,H.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ze(e.id),className:`touch-target flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,H.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,H.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block truncate text-base font-medium text-fg sm:text-sm group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,H.jsxs)(`span`,{className:`mt-1 flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[e.lastEditTrigger===`ai_edit`?(0,H.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,H.jsx)(te,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,H.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,H.jsx)(`span`,{className:`truncate`,children:i})]}),(0,H.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`mt-1.5 block text-xs text-fg-muted sm:hidden`,children:Ee(e.updatedAt,Ye,Je)})]})]}),(0,H.jsx)(`span`,{className:`hidden max-w-32 truncate text-xs text-fg-muted md:block`,title:e.projects?.map(e=>e.name).join(` · `),children:e.projects?.map(e=>e.name).join(` · `)||n.unassigned}),(0,H.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:Ee(e.updatedAt,Ye,Je)}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void nt(e.id,!e.pinned),disabled:Oe.has(e.id),"aria-label":`${e.pinned?n.unfavorite:n.favorite}: ${e.title||t.titlePlaceholder}`,"aria-pressed":!!e.pinned,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,H.jsx)(w,{className:g(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,H.jsxs)(C,{children:[(0,H.jsx)(ae,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,disabled:K===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:K===e.id?(0,H.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,H.jsx)(l,{className:`size-4`,"aria-hidden":!0})})}),(0,H.jsx)(E,{children:(0,H.jsx)(we,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,H.jsxs)(S,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft`,onSelect:()=>W(e),children:[(0,H.jsx)(xe,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!qe&&!Re&&Q>0?(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,H.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(Q))}),Q>12||Y>0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:Y===0,className:G,onClick:()=>M(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(Y-1)),t}),children:(0,H.jsx)(pe,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{children:[Y+1,` / `,Math.max(1,Math.ceil(Q/12))]}),(0,H.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(Y+1)*12>=Q,className:G,onClick:()=>M(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(Y+1)),t}),children:(0,H.jsx)(j,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]}),!N&&!F&&(X||We.length>0)?(0,H.jsxs)(`section`,{className:`mt-8`,"aria-label":n.continueProjects,children:[(0,H.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>m(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:X?[0,1].map(e=>(0,H.jsx)(x,{className:`h-28 w-full`},e)):We.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>et(e.id),className:`min-w-0 rounded-lg border border-edge bg-surface-panel p-3 text-left transition-colors sm:p-4 hover:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,H.jsx)(le,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,H.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,H.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,H.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,H.jsx)(`span`,{children:e.updatedAt?Ee(e.updatedAt,Ye,Je):n.emptyProject})]})]},e.id))})]}):null]})}),(0,H.jsx)(re,{open:U!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,U?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void rt(),onCancel:()=>W(null)})]})}function Ne(){let e=(0,De.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=u(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,l;e[2]!==n||e[3]!==c?(l=()=>{n(c)},e[2]=n,e[3]=c,e[4]=l):l=e[4];let d=l;if(!t)return null;let f=r.get(`edit`)===`1`?`wysiwyg`:`preview`,p;e[5]===r?p=e[6]:(p=r.get(`edit`),e[5]=r,e[6]=p);let m=p===`1`,h;return e[7]!==d||e[8]!==t||e[9]!==f||e[10]!==m?(h=(0,H.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,H.jsx)(B,{noteId:t,onBack:d,initialMode:f,autoFocus:m},t)}),e[7]=d,e[8]=t,e[9]=f,e[10]=m,e[11]=h):h=e[11],h}function q(){let e=(0,De.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,H.jsx)(Ne,{}):(0,H.jsx)(K,{}),e[0]=t,e[1]=n),n}export{q as NotesPage};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./messages-vL3EpIrL.js";import{c as s,n as c}from"./locale-store-qcYD05PF.js";import{t as l}from"./session-manager-3YOU74jt.js";import{F as u,I as d,tc as f,uu as p}from"./index-S4z-eKe-.js";var m=e(t(),1),h=n();function g({resource:e,selection:t,label:n,disabled:g=!1}){let _=o(c(e=>e.language)).chat.pageContext,v=r(),y=i().key,[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),w=(0,m.useRef)(!1),T=(0,m.useRef)(0),E=s(e=>e.baseUrl),D=s(e=>e.conversationId);(0,m.useEffect)(()=>(w.current=!1,x(!1),C(!1),()=>{T.current+=1}),[y,e.kind,e.id,e.revision,t?.text,t?.draft,g,E,D]);async function O(){if(g||w.current)return;w.current=!0,x(!0),C(!1);let n=T.current,r=()=>T.current===n&&s.getState().baseUrl===E&&s.getState().conversationId===D;try{let n=d.capture({title:``,text:``,resourceRefs:[e],selection:t}),i=await f(`xopc.context.resolve`,n.envelope);if(!r())return;let a=i.resources[0];if(i.resources.length!==1||JSON.stringify(i.snapshot)!==JSON.stringify(n.envelope)||a.reference.kind!==e.kind||a.reference.id!==e.id||a.reference.revision!==e.revision)throw Error(`Context mismatch`);n.title=a.title,n.preview=a.text,n.truncated=a.truncated;let o=await new l().createSession();if(!r())return;if(!d.put(u(E,D,o.key),n))throw Error(`Context draft limit reached`);v(`/chat/${encodeURIComponent(o.key)}`)}catch{r()&&C(!0)}finally{T.current===n&&(w.current=!1,x(!1))}}return(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,h.jsxs)(`button`,{type:`button`,disabled:g||b,onClick:()=>void O(),"aria-busy":b,title:g?_.unavailable:n??_.capture,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg border border-edge px-2.5 py-1.5 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[b?(0,h.jsx)(a,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,h.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),n??_.capture]}),S?(0,h.jsx)(`p`,{role:`alert`,className:`max-w-72 text-xs text-danger`,children:_.unavailable}):null]})}export{g as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{Ns as a}from"./index-S4z-eKe-.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-surface-active text-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto overscroll-x-contain px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)||!n.length)return;e.preventDefault();let t=n.findIndex(e=>e.id===r),i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,t)+(e.key===`ArrowRight`?1:-1)+n.length)%n.length;l(n[i].id);let a=e.currentTarget.querySelectorAll(`[role="tab"]`)[i];a?.focus(),a?.scrollIntoView({block:`nearest`,inline:`nearest`})},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,tabIndex:h?0:-1,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`touch-target relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-JdwAhgNB.js";import{a as s,i as c,o as l,r as u}from"./dist-io9jFpN72.js";import{t as d}from"./skeleton-BwbyijEw.js";import{a as f,s as p,t as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as h,r as g}from"./settings-shell-layer-context-BTQUDoJ2.js";var _=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),v=e(t(),1),y=n();function b(e,t=!1){if(!t)return m;switch(e){case`modal`:return f;case`page`:return p;default:return`z-50`}}var x=r();function S(e){let t=(0,y.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:s}=e,c=i===void 0?!1:i,l=(0,v.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,x.jsxs)(`label`,{className:o(`touch-target flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,x.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,x.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==s||t[12]!==u?(d=(0,x.jsx)(`fieldset`,{"aria-label":s,className:`min-w-0 space-y-0.5`,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var C=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,w=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function T({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:f=!1,disabledValues:p,disabled:m,id:y,ariaLabel:S,ariaLabelledBy:T,title:E,triggerClassName:D,triggerIcon:O,contentClassName:k,side:A=`bottom`,align:j=`start`,onChange:M,searchPlaceholder:N,searchValue:P,onSearchChange:F,loading:I=!1,statusMessage:L,selectedLabel:R}){let[z,B]=(0,v.useState)(!1),[V,H]=(0,v.useState)(null),U=g(),W=h(V),G=b(U,W!==null),K=t.find(t=>t.value===e),q=R??K?.label??(e?`${e} · unavailable`:n),J;return(0,x.jsxs)(s,{open:z,onOpenChange:B,children:[(0,x.jsx)(l,{asChild:!0,children:(0,x.jsxs)(`button`,{ref:H,id:y,type:`button`,"aria-label":S,"aria-labelledby":T,title:E,disabled:m,className:o(`touch-target box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-inset px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m&&`cursor-not-allowed opacity-50 hover:border-edge`,D),children:[O,(0,x.jsx)(`span`,{className:o(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:q}),(0,x.jsx)(_,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,x.jsx)(c,{container:W??void 0,children:(0,x.jsxs)(u,{side:A,align:j,sideOffset:4,collisionPadding:8,className:o(G,C,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,k),children:[N?(0,x.jsx)(`input`,{type:`search`,"aria-label":N,placeholder:N,value:P,onChange:e=>F?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-base text-fg placeholder:text-fg-subtle sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,x.jsxs)(`div`,{"data-select-scroll-region":!0,className:o(w,`max-h-64`),children:[r?(0,x.jsxs)(`button`,{type:`button`,disabled:f,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,f&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{f||(M(``),B(!1))},children:[(0,x.jsx)(a,{className:o(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,I?(0,x.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,x.jsx)(d,{className:`h-8 w-full`},e))}):null,L&&!I?(0,x.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:L}):null,(I?[]:t).map(t=>{let n=t.disabled===!0||p?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==J;return J=t.group,(0,x.jsxs)(v.Fragment,{children:[r?(0,x.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,x.jsxs)(`button`,{type:`button`,disabled:n,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(M(t.value),B(!1))},children:[t.icon??(0,x.jsx)(a,{className:o(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,x.jsx)(a,{className:o(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function E(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(E).join(``):(0,v.isValidElement)(e)?E(e.props.children):``}function D(e,t){let n=[];return v.Children.forEach(e,e=>{if(!(0,v.isValidElement)(e))return;if(e.type===v.Fragment){n.push(...D(e.props.children,t));return}if(e.type===k){let t=e.props;n.push(...D(t.children,E(t.label)));return}if(e.type!==O)return;let r=e.props,i=E(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function O(e){return null}function k(e){return null}function A(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function j(e){let t=(0,y.c)(66),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:s,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,v.useId)(),g=m==null?``:String(m),_,b,S,C,w,E,O,k,j,P;if(t[13]!==r||t[14]!==i||t[15]!==s||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==g){let e=D(r);C=e.find(N),b=C!==void 0,S=C?.label||u||``,k=s||void 0,t[31]===i?j=t[32]:(j=A(i),t[31]=i,t[32]=j),P=d.name,_=T,w=c??h,E=g,O=e.filter(M),t[13]=r,t[14]=i,t[15]=s,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=g,t[21]=_,t[22]=b,t[23]=S,t[24]=C,t[25]=w,t[26]=E,t[27]=O,t[28]=k,t[29]=j,t[30]=P}else _=t[21],b=t[22],S=t[23],C=t[24],w=t[25],E=t[26],O=t[27],k=t[28],j=t[29],P=t[30];let F=u??S,I=C?.disabled===!0,L=d[`aria-label`],R=d[`aria-labelledby`],z=d.title,B;t[33]!==i||t[34]!==p?(B=o(i,p),t[33]=i,t[34]=p,t[35]=B):B=t[35];let V;t[36]===l?V=t[37]:(V=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=V);let H;t[38]!==_||t[39]!==n||t[40]!==b||t[41]!==a||t[42]!==s||t[43]!==S||t[44]!==d.title||t[45]!==f||t[46]!==w||t[47]!==R||t[48]!==B||t[49]!==V||t[50]!==E||t[51]!==O||t[52]!==F||t[53]!==I||t[54]!==L?(H=(0,x.jsx)(_,{id:w,value:E,options:O,placeholder:F,allowEmpty:b,emptyLabel:S,emptyDisabled:I,disabled:s,ariaLabel:L,ariaLabelledBy:R,title:z,side:f,align:n,triggerClassName:B,contentClassName:a,onChange:V}),t[38]=_,t[39]=n,t[40]=b,t[41]=a,t[42]=s,t[43]=S,t[44]=d.title,t[45]=f,t[46]=w,t[47]=R,t[48]=B,t[49]=V,t[50]=E,t[51]=O,t[52]=F,t[53]=I,t[54]=L,t[55]=H):H=t[55];let U;t[56]!==s||t[57]!==d.name||t[58]!==g?(U=(0,x.jsx)(`input`,{name:d.name,value:g,readOnly:!0,hidden:!0,disabled:s}),t[56]=s,t[57]=d.name,t[58]=g,t[59]=U):U=t[59];let W;return t[60]!==H||t[61]!==U||t[62]!==k||t[63]!==j||t[64]!==P?(W=(0,x.jsxs)(`div`,{"aria-disabled":k,className:j,"data-select-name":P,children:[H,U]}),t[60]=H,t[61]=U,t[62]=k,t[63]=j,t[64]=P,t[65]=W):W=t[65],W}function M(e){return e.value!==``}function N(e){return e.value===``}export{C as a,_ as c,S as i,j as n,w as o,O as r,b as s,T as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{n as a}from"./electron-env-Dit0bHgy.js";import{Ns as o}from"./index-S4z-eKe-.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=a()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=a()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-on-accent shadow-sm`,o.transition,o.press,o.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};