@xopcai/xopc 0.0.407 → 0.0.408

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 (156) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CPNoFyoV.js → agent-avatar-dicebear-B0em9Xfs.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BB0O3b4I.js → agent-defaults-settings-panel-CtE1h2xU.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agents-Y7XtlqVm.js → agents-DAgFeHEb.js} +3 -3
  6. package/dist/gateway/static/root/assets/{app-management-settings-panel-BOAkMTQ7.js → app-management-settings-panel-B1qR8ElB.js} +1 -1
  7. package/dist/gateway/static/root/assets/{appearance-settings-BWPt4-vh.js → appearance-settings-GA819R2q.js} +1 -1
  8. package/dist/gateway/static/root/assets/{apps-page-Ln5N1PK3.js → apps-page-DZptDZ7h.js} +1 -1
  9. package/dist/gateway/static/root/assets/{archive-plugin-CNjE6PYZ.js → archive-plugin-BjWaZIHe.js} +1 -1
  10. package/dist/gateway/static/root/assets/{automations-page-BsP4j7Nw.js → automations-page-IkrLEkMb.js} +1 -1
  11. package/dist/gateway/static/root/assets/{automations-workspace-lq17XY3n.js → automations-workspace-qfEjk_ws.js} +1 -1
  12. package/dist/gateway/static/root/assets/{binary-plugins-AFWJskT6.js → binary-plugins-DKy1DC62.js} +1 -1
  13. package/dist/gateway/static/root/assets/{block-editor-SQ53S4oy.js → block-editor-4E-OdmNm.js} +1 -1
  14. package/dist/gateway/static/root/assets/{browser-automation-inputs-C2SC9h-c.js → browser-automation-inputs-Bs-AkQ1q.js} +1 -1
  15. package/dist/gateway/static/root/assets/{browser-automations-page-kRoqj1qn.js → browser-automations-page-D0Vbe1Q_.js} +1 -1
  16. package/dist/gateway/static/root/assets/{browser-settings-page-dZhjL3oj.js → browser-settings-page-BXCNNpQd.js} +1 -1
  17. package/dist/gateway/static/root/assets/{capabilities-page-Dnp_ilKR.js → capabilities-page-DMtxaYgt.js} +2 -2
  18. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BA9kBBqE.js → capabilities-settings-panel-BlWrMG6Z.js} +1 -1
  19. package/dist/gateway/static/root/assets/{capability-header-actions-Cq5XWEDs.js → capability-header-actions-BMffrHhT.js} +1 -1
  20. package/dist/gateway/static/root/assets/channels-C96r2Rqq.js +1 -0
  21. package/dist/gateway/static/root/assets/{chat-terminal-dock-BC4EyhTx.js → chat-terminal-dock-vb3kBSeI.js} +1 -1
  22. package/dist/gateway/static/root/assets/{computer-settings-page-MxcoTOP1.js → computer-settings-page-75SDQxQW.js} +1 -1
  23. package/dist/gateway/static/root/assets/{connector-service-page-tSQ3a_Ti.js → connector-service-page-DmJ9dIql.js} +1 -1
  24. package/dist/gateway/static/root/assets/{connectors-page-h5FTgews.js → connectors-page-Bua_nhSH.js} +1 -1
  25. package/dist/gateway/static/root/assets/{date-picker-CavoWXMc.js → date-picker-BEDH1AbM.js} +1 -1
  26. package/dist/gateway/static/root/assets/dependency-picker-LwWL5fo8.js +1 -0
  27. package/dist/gateway/static/root/assets/{desktop-pet-B-RDVNqR.js → desktop-pet-Bb-s29ag.js} +1 -1
  28. package/dist/gateway/static/root/assets/{desktop-pet-settings-rttWyUzY.js → desktop-pet-settings-Btt-DzyT.js} +1 -1
  29. package/dist/gateway/static/root/assets/{device-pairing-wizard-6hqiv1ui.js → device-pairing-wizard-_UWo9-4N.js} +1 -1
  30. package/dist/gateway/static/root/assets/{directory-picker-path-field-1rEGI8IE.js → directory-picker-path-field-CkGfC105.js} +1 -1
  31. package/dist/gateway/static/root/assets/{extension-debug-page-BaswNoXz.js → extension-debug-page-Cm0F3rcI.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-page-uCMJMnc_.js → extension-page-B72a-tnZ.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-settings-page-DiczmHyl.js → extension-settings-page-BEDAm_Ib.js} +1 -1
  34. package/dist/gateway/static/root/assets/{gateway-settings-DH5MOwxf.js → gateway-settings-BapgXAhB.js} +1 -1
  35. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-B62h4sJ4.js → highlighted-body-KQOG7T2V-BWjkqT5j.js} +1 -1
  36. package/dist/gateway/static/root/assets/{home-page-BsjMhloP.js → home-page-DNGjF6h4.js} +2 -2
  37. package/dist/gateway/static/root/assets/{image-generation-api-Di7HnFSL.js → image-generation-api-Bi1-Hvtr.js} +1 -1
  38. package/dist/gateway/static/root/assets/{imports-page-DpKfYZMT.js → imports-page-b4VDs6Bd.js} +1 -1
  39. package/dist/gateway/static/root/assets/{index-BUv4J0JN.js → index-Cgd4fGVP.js} +16 -16
  40. package/dist/gateway/static/root/assets/index-gYRNcY2Q.css +1 -0
  41. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D1Q1kTMI.js → keyboard-shortcuts-settings-Cf29ltoI.js} +1 -1
  42. package/dist/gateway/static/root/assets/{local-app-workbench-page-CnaLbgJb.js → local-app-workbench-page-dgUxHhW8.js} +1 -1
  43. package/dist/gateway/static/root/assets/{local-apps-page-CSO0RkyG.js → local-apps-page-D3k9GjgF.js} +1 -1
  44. package/dist/gateway/static/root/assets/{logs-page-DruO5LTf.js → logs-page-BUlU7t8l.js} +1 -1
  45. package/dist/gateway/static/root/assets/{management-settings-Dw3tQKNe.js → management-settings-2L7XFZXc.js} +1 -1
  46. package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +1 -0
  47. package/dist/gateway/static/root/assets/{media-plugins-CrHXsih_.js → media-plugins-Bl1Xga_v.js} +1 -1
  48. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bi62iXra.js +1 -0
  49. package/dist/gateway/static/root/assets/{note-detail-panel-DCZ6Vgd_.js → note-detail-panel-ogBu93h0.js} +3 -3
  50. package/dist/gateway/static/root/assets/note-image-lightbox-Dxvo_WsE.js +1 -0
  51. package/dist/gateway/static/root/assets/{notes-page-Bqy9Rh_j.js → notes-page-CNdoxzIZ.js} +1 -1
  52. package/dist/gateway/static/root/assets/{page-context-capture-button-DQHbuYER.js → page-context-capture-button-Bq4Xpop5.js} +1 -1
  53. package/dist/gateway/static/root/assets/{personal-page-C--WEB5c.js → personal-page-7P2leCsB.js} +1 -1
  54. package/dist/gateway/static/root/assets/{personal-settings-panel-Cwgc13ls.js → personal-settings-panel-D6n6TObP.js} +1 -1
  55. package/dist/gateway/static/root/assets/{plugin-details-dialog-DxkFHaU-.js → plugin-details-dialog-JTxDbMI4.js} +1 -1
  56. package/dist/gateway/static/root/assets/{preview-open-alternatives-BW7P2akd.js → preview-open-alternatives-6XU-2lVI.js} +1 -1
  57. package/dist/gateway/static/root/assets/{product-open-page-BnlpaYs-.js → product-open-page-BpB0klIl.js} +1 -1
  58. package/dist/gateway/static/root/assets/{product-preview-content-DkXx1Vt8.js → product-preview-content-DxQaoQew.js} +1 -1
  59. package/dist/gateway/static/root/assets/project-detail-page-LilHE2OV.js +1 -0
  60. package/dist/gateway/static/root/assets/{projects-page-CJ0s-bI5.js → projects-page-D4Jxhuhq.js} +1 -1
  61. package/dist/gateway/static/root/assets/{remote-access-hub-yItNjAR3.js → remote-access-hub-Cy71CCQq.js} +1 -1
  62. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BGRbt79f.js → runtime-tools-settings-panel-CrbjrokA.js} +1 -1
  63. package/dist/gateway/static/root/assets/{schema-form-B9VP7ldU.js → schema-form-DITi2cne.js} +1 -1
  64. package/dist/gateway/static/root/assets/{sessions-page-3O5S9efw.js → sessions-page-D1THmRXE.js} +1 -1
  65. package/dist/gateway/static/root/assets/settings-advanced-gate-CjRLXfoo.js +1 -0
  66. package/dist/gateway/static/root/assets/{settings-form-section-BA2RkU1S.js → settings-form-section-Cl0eF4hl.js} +1 -1
  67. package/dist/gateway/static/root/assets/{settings-page-BUT0FzfI.js → settings-page-1jcGeVtB.js} +1 -1
  68. package/dist/gateway/static/root/assets/{setup-status-panel-1oWs6iPS.js → setup-status-panel-CFhDHkyK.js} +1 -1
  69. package/dist/gateway/static/root/assets/{share-preview-page-CVNey8Lq.js → share-preview-page-By4IKKgg.js} +1 -1
  70. package/dist/gateway/static/root/assets/{shares-settings-Bb6YoDmU.js → shares-settings-q2sa1VvF.js} +1 -1
  71. package/dist/gateway/static/root/assets/{skill-api-BWi0G9Ii.js → skill-api-BxCyuPhf.js} +1 -1
  72. package/dist/gateway/static/root/assets/{skill-reload-api-DspV2olR.js → skill-reload-api-CIHSQxr1.js} +1 -1
  73. package/dist/gateway/static/root/assets/{skills-page-SbNv1vpY.js → skills-page-BQaej_2C.js} +1 -1
  74. package/dist/gateway/static/root/assets/{style-DlOTU5bN.js → style-Dt_oHNvB.js} +1 -1
  75. package/dist/gateway/static/root/assets/{system-settings-panel-DbS1qtOh.js → system-settings-panel-C9ejxax1.js} +1 -1
  76. package/dist/gateway/static/root/assets/{task-detail-page-uSwizzx8.js → task-detail-page-SipLlGGk.js} +1 -1
  77. package/dist/gateway/static/root/assets/{task-expandable-content-D0ahXP9o.js → task-expandable-content-BMCvE36l.js} +1 -1
  78. package/dist/gateway/static/root/assets/{tracing-settings-page-BMhVvXXd.js → tracing-settings-page-bn9vnLrf.js} +1 -1
  79. package/dist/gateway/static/root/assets/{tunnel-api-CO9rJLFh.js → tunnel-api-BeTAD8BN.js} +1 -1
  80. package/dist/gateway/static/root/assets/{usage-page-DVzIDec4.js → usage-page-BPuc6leN.js} +1 -1
  81. package/dist/gateway/static/root/assets/{use-autosave-DqPaXiX2.js → use-autosave-DwcmmxWR.js} +1 -1
  82. package/dist/gateway/static/root/assets/{user-model-page-BYZCHCzG.js → user-model-page-YWSqv_kR.js} +1 -1
  83. package/dist/gateway/static/root/assets/{voice-api-key-field-C_iOzfIt.js → voice-api-key-field-Bk947X8N.js} +1 -1
  84. package/dist/gateway/static/root/assets/{work-discovery-overlay-n59s18s0.js → work-discovery-overlay-mjj7w_wU.js} +1 -1
  85. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Lp6Vumxc.js → workflow-run-setup-panel-xQUvtVUU.js} +1 -1
  86. package/dist/gateway/static/root/assets/{workflows-page-B5BqN1Y1.js → workflows-page-DbKRAEWP.js} +1 -1
  87. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-QSDUy0uF.js → xopc-cloud-account-card-C4jQM6Uo.js} +1 -1
  88. package/dist/gateway/static/root/index.html +4 -4
  89. package/dist/package.js +1 -1
  90. package/dist/src/agent/agent-manager.js +1 -1
  91. package/dist/src/agent/background-review/run-background-review.js +1 -1
  92. package/dist/src/agent/external-tools/cliProvider.js +2 -2
  93. package/dist/src/agent/external-tools/composio-provider.js +2 -2
  94. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  95. package/dist/src/agent/service.js +1 -1
  96. package/dist/src/agent/skills/index.js +1 -1
  97. package/dist/src/agent/skills/managed-store.js +1 -1
  98. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  99. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  100. package/dist/src/agent/tools/xopc-use-tool.js +2 -2
  101. package/dist/src/agent-catalog/capabilities.js +2 -2
  102. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
  103. package/dist/src/agent-catalog/repository.js +1 -1
  104. package/dist/src/automations/capabilities/drafts.js +1 -1
  105. package/dist/src/bootstrap/application-state.js +1 -1
  106. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  107. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  108. package/dist/src/capabilities/runtime/product.js +1 -1
  109. package/dist/src/cli/commands/agents.js +1 -1
  110. package/dist/src/cli/commands/models.js +1 -1
  111. package/dist/src/cli/commands/onboard/model.js +1 -1
  112. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  113. package/dist/src/config/agent-profile.js +1 -1
  114. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  115. package/dist/src/extensions/agent-plugins/cli-authorization.js +7 -3
  116. package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -1
  117. package/dist/src/extensions/agent-plugins/node-runtime.d.ts +5 -0
  118. package/dist/src/extensions/agent-plugins/node-runtime.js +14 -0
  119. package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
  120. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  121. package/dist/src/gateway/agents-admin.js +2 -2
  122. package/dist/src/gateway/hono/routes/agents.js +1 -1
  123. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  124. package/dist/src/gateway/hono/routes/notes.js +2 -2
  125. package/dist/src/gateway/hono/routes/projects.js +2 -2
  126. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  127. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  128. package/dist/src/gateway/image-generation-setup.js +1 -1
  129. package/dist/src/gateway/service.js +4 -4
  130. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  131. package/dist/src/home-intelligence/host.js +2 -2
  132. package/dist/src/imports/importService.js +1 -1
  133. package/dist/src/local-apps/service.js +1 -1
  134. package/dist/src/personal-agent/communication.d.ts +1 -1
  135. package/dist/src/personal-agent/communication.js +1 -0
  136. package/dist/src/personal-agent/service.js +1 -1
  137. package/dist/src/runtime-tools/archive.js +1 -1
  138. package/dist/src/session/client-history.js +3 -0
  139. package/dist/src/session/session-context-for-llm.js +4 -0
  140. package/dist/src/session/task-allocation-status.d.ts +2 -0
  141. package/dist/src/session/task-allocation-status.js +14 -0
  142. package/dist/src/tasks/capabilities/read.js +2 -2
  143. package/dist/src/tasks/capabilities/write.js +1 -1
  144. package/dist/src/tasks/task-allocation-repository.js +8 -5
  145. package/dist/src/tui/backends/embedded-backend.js +1 -1
  146. package/dist/src/voice/realtime/persona-context.js +1 -1
  147. package/package.json +1 -1
  148. package/dist/gateway/static/root/assets/channels-BZCzeWtD.js +0 -1
  149. package/dist/gateway/static/root/assets/dependency-picker-Cl-3upFX.js +0 -1
  150. package/dist/gateway/static/root/assets/index-Cr4I4q1J.css +0 -1
  151. package/dist/gateway/static/root/assets/markdown-view-Ct4sKkUf.css +0 -1
  152. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CNzdVIcE.js +0 -1
  153. package/dist/gateway/static/root/assets/note-image-lightbox-BXNZw7lJ.js +0 -1
  154. package/dist/gateway/static/root/assets/project-detail-page-CtyCpIx8.js +0 -1
  155. package/dist/gateway/static/root/assets/settings-advanced-gate-BE-SKsf6.js +0 -1
  156. /package/dist/gateway/static/root/assets/{markdown-view-vQSMUUY_.js → markdown-view-B35a4o1v.js} +0 -0
@@ -1 +0,0 @@
1
- pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.markdown-render-boundary{isolation:isolate;contain:layout paint;overflow-wrap:anywhere;min-width:0}.markdown-body{letter-spacing:-.011em;color:inherit;font-size:.9375rem;line-height:1.5}.assistant-markdown-content .markdown-body,.chat-user-message .markdown-body{font-size:inherit;line-height:inherit}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{letter-spacing:-.022em;color:var(--color-fg);margin-top:1.35em;margin-bottom:.45em;font-weight:600;line-height:1.25}.markdown-body h1{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.5em}.markdown-body h2{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.3em}.markdown-body h3{font-size:1.1em}.markdown-body ul,.markdown-body ol{margin-bottom:1em;padding-left:2em}.markdown-body li{margin-bottom:.35em}.markdown-body code{font-family:var(--font-mono);background:color-mix(in srgb, var(--color-fg) 8%, transparent);color:var(--color-fg-muted);border-radius:.4rem;padding:.15em .4em;font-size:.875em}.markdown-body pre{background:var(--color-surface-hover);border-radius:var(--radius-xl);border:1px solid var(--color-edge);margin-bottom:1em;padding:1em;overflow-x:auto}.markdown-code-block{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);margin:0 0 1em;overflow:visible}.markdown-code-block-header{z-index:3;border-bottom:1px solid var(--color-edge);border-radius:var(--radius-xl) var(--radius-xl) 0 0;background:var(--color-surface-active);justify-content:space-between;align-items:center;gap:.75rem;min-height:2.25rem;padding:.35rem .65rem .35rem .85rem;display:flex;position:sticky;top:0}.markdown-code-block-lang{min-width:0;font-family:var(--font-mono);letter-spacing:.02em;color:var(--color-fg-muted);text-transform:lowercase;-webkit-user-select:none;user-select:none;flex:auto;font-size:.75rem;font-weight:500;line-height:1.35}.markdown-code-copy-btn{border-radius:var(--radius-md);width:1.75rem;height:1.75rem;color:var(--color-fg-muted);cursor:pointer;opacity:0;pointer-events:none;background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:.75rem;font-weight:500;line-height:1.25;transition:opacity .15s,color .15s,background-color .15s,transform .12s;display:inline-flex}.markdown-code-block:hover .markdown-code-copy-btn,.markdown-code-block:focus-within .markdown-code-copy-btn{opacity:1;pointer-events:auto}.markdown-code-copy-btn:hover{color:var(--color-fg);background:var(--color-surface-panel)}.markdown-code-copy-btn:active{transform:scale(.97)}.markdown-code-copy-btn:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.markdown-code-copy-inner{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.markdown-code-copy-btn svg{pointer-events:none;width:1rem;height:1rem}.markdown-body .markdown-code-block>pre{border-radius:0 0 var(--radius-xl) var(--radius-xl);background:var(--color-surface-hover);border:none;margin:0}html:not(.dark) .assistant-markdown-content .markdown-code-block,html:not(.dark) .assistant-markdown-content .markdown-body .markdown-code-block>pre{background:color-mix(in srgb, var(--color-fg) 4%, var(--color-surface-panel))}html:not(.dark) .assistant-markdown-content .markdown-code-block-header{background:color-mix(in srgb, var(--color-fg) 7%, var(--color-surface-panel))}html.dark .markdown-code-block{border-color:var(--color-edge);background:#0d1117}html.dark .markdown-code-block-header{border-bottom-color:var(--color-edge);background:#06080b}html.dark .markdown-code-block-lang{color:var(--color-fg-muted)}html.dark .markdown-body .markdown-code-block>pre{background:#0d1117}html.dark .markdown-code-copy-btn{color:var(--color-fg-subtle);background:0 0}html.dark .markdown-code-copy-btn:hover{color:var(--color-fg);background:#121820}.chat-messages .markdown-code-block-header{top:-1rem}.chat-messages.chat-messages--compact-welcome .markdown-code-block-header{top:-1.25rem}.markdown-body pre code{color:inherit;background:0 0;padding:0;font-size:.8125rem}.markdown-body blockquote{border-left:2px solid var(--color-edge-strong);color:var(--color-fg-muted);background:0 0;border-radius:0;margin:0 0 1em;padding:.1em 0 .1em 1em}.markdown-body a[href]{color:var(--color-accent-fg);text-decoration:none}.markdown-body a[href]:hover{text-decoration:underline}.markdown-body a[href]:focus-visible{outline:2px solid var(--color-accent);outline-offset:3px;border-radius:var(--radius-sm)}.markdown-body hr{background:var(--color-edge);border:none;height:1px;margin:1.5em 0}.markdown-body table{border-collapse:collapse;border:1px solid var(--color-edge);border-radius:var(--radius-lg);width:100%;margin:0 0 1em;font-size:.875rem;line-height:1.5;overflow:hidden}.markdown-body th,.markdown-body td{border:1px solid var(--color-edge-subtle);text-align:left;vertical-align:top;padding:.5rem .75rem}.markdown-body th{background:var(--color-surface-hover);color:var(--color-fg);font-weight:600}.markdown-body tbody tr:hover td{background:var(--color-surface-hover)}.markdown-body p{margin:0 0 .75em}.markdown-body.workflow-result-markdown{color:var(--color-fg-muted);font-size:1rem;line-height:1.7}.markdown-body.workflow-result-markdown>:first-child{margin-top:0}.markdown-body.workflow-result-markdown>:last-child{margin-bottom:0}.markdown-body.workflow-result-markdown h1,.markdown-body.workflow-result-markdown h2,.markdown-body.workflow-result-markdown h3{color:var(--color-fg)}.markdown-body.workflow-result-markdown table{display:block;overflow-x:auto}.markdown-body.workflow-status-markdown{color:var(--color-fg-muted);font-size:.8125rem;line-height:1.55}.markdown-body.workflow-status-markdown>:first-child{margin-top:0}.markdown-body.workflow-status-markdown h1,.markdown-body.workflow-status-markdown h2,.markdown-body.workflow-status-markdown h3{border-bottom:0;padding-bottom:0;font-size:.875rem}.markdown-body.workflow-status-markdown table{font-size:.75rem;display:block;overflow-x:auto}.markdown-body.markdown-note{font-size:.9375rem;line-height:1.45}.markdown-body.markdown-note p{margin-bottom:.65em}.markdown-body strong{font-weight:600}.markdown-body em{font-style:italic}.markdown-body.markdown-compact h1,.markdown-body.markdown-compact h2,.markdown-body.markdown-compact h3{border-bottom:0;margin-top:1.25em;margin-bottom:.4em;padding-bottom:0}.markdown-body.markdown-compact p{margin:0 0 .8em}.markdown-body.markdown-compact>:first-child{margin-top:0}.markdown-body.markdown-compact:not(.markdown-stream-block)>:last-child,.xopc-chat-markdown>.markdown-stream-block:last-child>:last-child{margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block{margin-block:0}.xopc-chat-markdown>.markdown-stream-block:first-child>:first-child{margin-top:0}.xopc-chat-markdown>.markdown-stream-block:last-child>:has(+[data-xopc-watermark]){margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block:last-child{margin-bottom:0}.xopc-chat-markdown .markdown-code-block>pre{max-height:28rem;overflow:auto}.xopc-chat-markdown .markdown-table-scroll{border-radius:var(--radius-lg);max-width:100%;margin-bottom:1em;overflow:auto}.markdown-body.xopc-chat-markdown .markdown-table-scroll>table{table-layout:fixed;margin-bottom:0;display:table}.xopc-chat-markdown th,.xopc-chat-markdown td[data-markdown-align=right]{white-space:nowrap;word-break:normal;overflow-wrap:normal}.xopc-chat-markdown .markdown-mermaid svg{max-width:100%}.markdown-body.markdown-compact pre,.markdown-body.markdown-compact .markdown-code-block{margin-bottom:.75em}.markdown-body.markdown-compact .markdown-code-block>pre{margin-bottom:0}.markdown-mermaid{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);text-align:center;margin:0 0 1em;padding:1em;overflow-x:auto}.markdown-mermaid svg{max-width:100%;height:auto;display:inline-block}.markdown-mermaid-interactive{position:relative}.markdown-mermaid-interactive>svg{cursor:zoom-in}.markdown-mermaid-actions{z-index:1;border:1px solid var(--color-edge);border-radius:var(--radius-lg);background:color-mix(in srgb, var(--color-surface-panel) 92%, transparent);box-shadow:var(--shadow-popover);opacity:0;pointer-events:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);gap:.25rem;padding:.25rem;transition:opacity .15s,transform .15s;display:flex;position:absolute;top:.5rem;right:.5rem;transform:translateY(-.25rem)}.markdown-mermaid-interactive:hover .markdown-mermaid-actions,.markdown-mermaid-interactive:focus-within .markdown-mermaid-actions{opacity:1;pointer-events:auto;transform:translateY(0)}.markdown-mermaid-action-button,.mermaid-preview-toolbar-button{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-fg-muted);background:0 0;border:0;justify-content:center;align-items:center;transition:color .15s,background-color .15s,transform .15s;display:inline-flex}.markdown-mermaid-action-button:hover,.mermaid-preview-toolbar-button:hover{background:var(--color-surface-hover);color:var(--color-fg)}.markdown-mermaid-action-button:active,.mermaid-preview-toolbar-button:active{transform:scale(.95)}.markdown-mermaid-action-button:focus-visible,.mermaid-preview-toolbar-button:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.markdown-mermaid-action-button:disabled,.mermaid-preview-toolbar-button:disabled{cursor:wait;opacity:.5}.markdown-mermaid-action-button{width:1.75rem;height:1.75rem}@media (hover:none){.markdown-code-copy-btn{opacity:1;pointer-events:auto}.markdown-mermaid-actions{opacity:1;pointer-events:auto;transform:translateY(0)}}@media (max-width:640px){.mermaid-preview-secondary-action{display:none}}.markdown-mermaid-error{justify-content:center;align-items:center;min-height:6rem;display:flex}.markdown-mermaid-error-message{color:var(--color-danger);font-size:.875rem;font-weight:500}.markdown-body.markdown-compact .markdown-mermaid{margin-bottom:.75em}html.dark .markdown-mermaid{background:var(--color-surface-panel)}html.dark .markdown-body pre code.hljs{padding:1em;display:block;overflow-x:auto}html.dark .markdown-body code.hljs{padding:3px 5px}html.dark .markdown-body .hljs{color:#c9d1d9;background:var(--color-surface-panel)}html.dark .markdown-body .hljs-doctag,html.dark .markdown-body .hljs-keyword,html.dark .markdown-body .hljs-meta .hljs-keyword,html.dark .markdown-body .hljs-template-tag,html.dark .markdown-body .hljs-template-variable,html.dark .markdown-body .hljs-type,html.dark .markdown-body .hljs-variable.language_{color:#ff7b72}html.dark .markdown-body .hljs-title,html.dark .markdown-body .hljs-title.class_,html.dark .markdown-body .hljs-title.class_.inherited__,html.dark .markdown-body .hljs-title.function_{color:#d2a8ff}html.dark .markdown-body .hljs-attr,html.dark .markdown-body .hljs-attribute,html.dark .markdown-body .hljs-literal,html.dark .markdown-body .hljs-meta,html.dark .markdown-body .hljs-number,html.dark .markdown-body .hljs-operator,html.dark .markdown-body .hljs-variable,html.dark .markdown-body .hljs-selector-attr,html.dark .markdown-body .hljs-selector-class,html.dark .markdown-body .hljs-selector-id{color:#79c0ff}html.dark .markdown-body .hljs-regexp,html.dark .markdown-body .hljs-string,html.dark .markdown-body .hljs-meta .hljs-string{color:#a5d6ff}html.dark .markdown-body .hljs-built_in,html.dark .markdown-body .hljs-symbol{color:#ffa657}html.dark .markdown-body .hljs-comment,html.dark .markdown-body .hljs-code,html.dark .markdown-body .hljs-formula{color:#8b949e}html.dark .markdown-body .hljs-name,html.dark .markdown-body .hljs-quote,html.dark .markdown-body .hljs-selector-tag,html.dark .markdown-body .hljs-selector-pseudo{color:#7ee787}html.dark .markdown-body .hljs-subst{color:#c9d1d9}html.dark .markdown-body .hljs-section{color:#1f6feb;font-weight:700}html.dark .markdown-body .hljs-bullet{color:#f2cc60}html.dark .markdown-body .hljs-emphasis{color:#c9d1d9;font-style:italic}html.dark .markdown-body .hljs-strong{color:#c9d1d9;font-weight:700}html.dark .markdown-body .hljs-addition{color:#aff5b4;background-color:#033a16}html.dark .markdown-body .hljs-deletion{color:#ffdcd7;background-color:#67060c}.xopc-chat-markdown ul{list-style-type:disc}.xopc-chat-markdown ol{list-style-type:decimal}.xopc-chat-markdown ul ul{list-style-type:circle}.xopc-chat-markdown ul ul ul{list-style-type:square}.xopc-chat-markdown li>ul,.xopc-chat-markdown li>ol{margin-top:.35em;margin-bottom:0}.xopc-chat-markdown li.task-list-item{list-style-type:none}.xopc-chat-markdown li.task-list-item>input[type=checkbox]{margin-right:.4em}.markdown-body.xopc-chat-markdown .markdown-code-block>pre>code.hljs{background:0 0;padding:0;display:block;overflow:visible}.markdown-math{min-width:0;max-width:100%;color:inherit}.markdown-math-display{padding:2rem 0 .75rem;position:relative}.markdown-math-display .katex-display{scrollbar-width:none;min-width:0;max-width:100%;margin:.25rem 0;padding-block:.5em;overflow-x:auto}.markdown-math-display .katex-display::-webkit-scrollbar{display:none}.markdown-math-source{white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--font-mono,monospace)}.markdown-math-actions{opacity:0;pointer-events:none;gap:.25rem;transition:opacity .15s;display:flex;position:absolute;top:0;right:0}.markdown-math-display:hover>.markdown-math-actions,.markdown-math-display:focus-within>.markdown-math-actions{opacity:1;pointer-events:auto}.markdown-math-actions button{width:1.75rem;height:1.75rem;color:var(--color-fg-muted);cursor:pointer;border-radius:.25rem;justify-content:center;align-items:center;display:inline-flex}.markdown-math-actions button svg{pointer-events:none}.markdown-math-actions button:hover{background:var(--color-surface-hover)}.markdown-math-actions button:focus-visible{outline:2px solid var(--color-accent)}@media (hover:none){.markdown-math-actions{opacity:1;pointer-events:auto}}@media (prefers-reduced-motion:reduce){.markdown-math-actions,.markdown-code-copy-btn,.markdown-mermaid-actions{transition:none}.markdown-mermaid-actions{transform:none}}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,math,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.19.0"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{white-space:nowrap;width:min-content;position:relative}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .katex-vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .katex-thinbox{flex-direction:row;width:0;max-width:0;display:inline-flex}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.katex-root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .katex-stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .reflectbox{display:inline-block;transform:scaleX(-1)}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}
@@ -1 +0,0 @@
1
- import{sl as e}from"./index-BUv4J0JN.js";export{e as Mermaid};
@@ -1 +0,0 @@
1
- import"./index-BUv4J0JN.js";
@@ -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{f as i,g as a,m as o,t as s}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as c}from"./check-DUBLcKHA.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./copy-Dv6d4Dvw.js";import{t as d}from"./download-Dk-ZjtO6.js";import{t as f}from"./external-link-DjqjBmc3.js";import{F as p,V as m,t as h,z as g}from"./markdown-view-vQSMUUY_.js";import{t as _}from"./plus-Q2yW6OE7.js";import{t as v}from"./x-B_N4OPjy.js";import{t as y}from"./messages-D__oW2yE.js";import{t as b}from"./cn-0WouolD0.js";import{a as x,c as S,f as C,n as w,r as T}from"./locale-store-D_migb9R.js";import{a as E,c 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{i as P,t as F}from"./tasks-B4bZpO6O.js";import{t as I}from"./copy-to-clipboard-HOJ79TWv.js";import{i as L}from"./vendor-swr-BIWyz7Rc.js";import{a as R}from"./attachment-utils-core-BIOUBrpT.js";import{o as z}from"./agents-admin-api-D0UyB0Y_.js";import{$n as B,A as V,Al as H,Ao as U,Bo as W,Br as G,Bs as K,Cd as ee,Cf as q,Co as te,Cu as ne,Da as re,Df as ie,Dr as ae,Ds as oe,Ef as se,Es as ce,Eu as le,Fd as ue,Fo as de,Fu as J,Gd as fe,Gf as pe,Gl as me,Go as he,Gu as ge,Hd as _e,Hf as ve,Ho as ye,Hr as be,Hs as xe,Hu as Se,Io as Ce,Jd as we,Jf as Te,Ji as Ee,Jr as De,Kf as Oe,Ki as ke,Lf as Ae,Ll as je,Lo as Me,Lu as Ne,Mo as Pe,Nd as Fe,No as Ie,Of as Le,Oo as Re,Os as ze,Pd as Be,Po as Ve,Ro as He,Rr as Ue,Ru as We,Sd as Ge,Ul as Ke,Uo as qe,Us as Je,Uu as Ye,Vo as Xe,Vr as Ze,Vs as Qe,Wd as $e,Wo as et,Yd as tt,Yl as nt,Zr as rt,_ as it,_a as at,_d as ot,_i as st,_o as ct,_r as lt,_u as ut,ao as dt,ba as ft,br as pt,bs as mt,bu as ht,cf as gt,cl as Y,co as _t,do as vt,el as yt,eo as bt,fo as xt,ga as St,gl as Ct,gr as wt,hr as Tt,hu as Et,ia as Dt,io as Ot,jd as kt,jf as At,jo as jt,ka as Mt,kf as Nt,kl as Pt,ko as Ft,kr as It,ld as Lt,lo as Rt,lu as zt,ml as Bt,mr as Vt,nc as Ht,nf as Ut,nu as Wt,oo as Gt,os as Kt,ou as qt,pc as Jt,pf as Yt,pl as Xt,rd as Zt,ro as Qt,ru as $t,so as en,td as tn,to as nn,ud as rn,uo as an,uu as on,v as sn,vf as cn,vi as ln,vr as un,wo as dn,wr as fn,xo as pn,xu as mn,yl as hn,yr as gn,zo as _n,zs as vn}from"./index-BUv4J0JN.js";import{n as yn,t as bn}from"./use-autosave-DqPaXiX2.js";import{t as xn}from"./directory-picker-path-field-1rEGI8IE.js";import{d as Sn,h as Cn,o as wn}from"./skill-api-BWi0G9Ii.js";import{t as Tn}from"./date-picker-CavoWXMc.js";import{t as En}from"./automations-workspace-lq17XY3n.js";import{i as Dn,r as On,t as kn}from"./workflow-run-setup-panel-Lp6Vumxc.js";import{t as An}from"./page-context-capture-button-DQHbuYER.js";import{i as X,n as jn,r as Mn,t as Nn}from"./note-detail-panel-DCZ6Vgd_.js";import{c as Pn,l as Fn,n as In,o as Z,r as Ln,t as Rn,u as zn}from"./style-DlOTU5bN.js";import{t as Bn}from"./dependency-picker-Cl-3upFX.js";var Vn=n(),Q=e(t(),1),$=r();function Hn(e){let t=(0,Vn.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,o]=(0,Q.useState)(!1),s;t[0]!==r||t[1]!==n?(s=ln(n,r),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c=s;if(a){let e;t[3]===i?e=t[4]:(e=b(`flex size-12 shrink-0 items-center justify-center rounded-lg border border-edge-subtle bg-surface-hover text-fg-muted`,i),t[3]=i,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Fe,{className:`size-4`}),t[5]=n):n=t[5];let r;return t[6]===e?r=t[7]:(r=(0,$.jsx)(`div`,{className:e,"aria-hidden":!0,children:n}),t[6]=e,t[7]=r),r}let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>o(!0),t[8]=l):l=t[8];let u;t[9]===i?u=t[10]:(u=b(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=u);let d;return t[11]!==n||t[12]!==c||t[13]!==u?(d=(0,$.jsx)(rt,{src:c,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:l,className:u}),t[11]=n,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Un(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`}function Wn(e){let t=(0,Vn.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:o,loading:s,currentTime:c,duration:l,noteId:u,attachmentId:d}=st(),f=st(Kn),p=u===n&&d===r,m=p&&o,h=p&&s,g=p?c:0,_=p&&l>0?l:i??0,v=_>0?Math.min(g/_*100,100):0,y;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==f?(y=e=>{e.stopPropagation(),f(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=f,t[4]=y):y=t[4];let x=y,S;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==f?(S=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),f(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=f,t[9]=S):S=t[9];let C=S,w;t[10]===a?w=t[11]:(w=b(`flex items-center gap-2`,a),t[10]=a,t[11]=w);let T=m?`bg-accent text-on-accent`:`bg-accent/10 text-accent hover:bg-accent/20`,E;t[12]===T?E=t[13]:(E=b(`flex size-7 shrink-0 items-center justify-center rounded-full transition-colors`,T),t[12]=T,t[13]=E);let D=m?`Pause`:`Play`,O;t[14]!==h||t[15]!==m?(O=h?(0,$.jsx)(rn,{className:`size-3.5 animate-spin`}):m?(0,$.jsx)(Se,{className:`size-3.5`}):(0,$.jsx)(J,{className:`size-3.5 ml-0.5`}),t[14]=h,t[15]=m,t[16]=O):O=t[16];let k;t[17]!==x||t[18]!==C||t[19]!==E||t[20]!==D||t[21]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:x,onKeyDown:C,className:E,"aria-label":D,children:O}),t[17]=x,t[18]=C,t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22];let A=`${v}%`,j;t[23]===A?j=t[24]:(j=(0,$.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-accent/10`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width] duration-200 ease-linear`,style:{width:A}})}),t[23]=A,t[24]=j);let M;t[25]!==_||t[26]!==p||t[27]!==g?(M=Un(p&&g>0?g:_),t[25]=_,t[26]=p,t[27]=g,t[28]=M):M=t[28];let N;t[29]===M?N=t[30]:(N=(0,$.jsx)(`span`,{className:`text-[10px] tabular-nums text-fg-muted`,children:M}),t[29]=M,t[30]=N);let P;t[31]!==j||t[32]!==N?(P=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[j,N]}),t[31]=j,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==P||t[35]!==w||t[36]!==k?(F=(0,$.jsxs)(`div`,{className:w,onClick:Gn,children:[k,P]}),t[34]=P,t[35]=w,t[36]=k,t[37]=F):F=t[37],F}function Gn(e){return e.stopPropagation()}function Kn(e){return e.toggle}function qn(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function Jn(e){let t=(0,Vn.c)(89),{note:n,selected:r,onPress:i,onPin:a,onArchive:o,onDelete:s,labels:c,timeLabels:l}=e,u=r===void 0?!1:r,d=w(nr)===`zh`,f=n.kind===`voice`&&/^Discussion · \d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(n.title??``)?d?`语音笔记`:`Voice note`:n.title,p;t[0]!==c||t[1]!==n?(p=qn(n,c),t[0]=c,t[1]=n,t[2]=p):p=t[2];let m=p,h=!n.snippet?.trim(),[g]=(0,Q.useState)(tr),_;t[3]!==n.createdAt||t[4]!==g||t[5]!==l?(_=X(n.createdAt,g,l),t[3]=n.createdAt,t[4]=g,t[5]=l,t[6]=_):_=t[6];let v=_,y,x;t[7]!==n.id||t[8]!==i?(y=()=>i(n.id),x=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),i(n.id))},t[7]=n.id,t[8]=i,t[9]=y,t[10]=x):(y=t[9],x=t[10]);let S=u?`bg-surface-active hover:bg-surface-active`:`bg-transparent hover:bg-surface-panel/70`,C;t[11]===S?C=t[12]:(C=b(`group relative flex cursor-pointer flex-col gap-2 overflow-hidden rounded-lg px-3 py-2.5`,`transition-colors duration-150 ease-out`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-rail`,S),t[11]=S,t[12]=C);let T=u?`true`:void 0,E;t[13]===u?E=t[14]:(E=u?(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-y-2 left-0 w-0.5 rounded-r-pill bg-accent`,"aria-hidden":!0}):null,t[13]=u,t[14]=E);let D;t[15]!==n.coverAttachmentId||t[16]!==n.id||t[17]!==n.kind||t[18]!==n.voiceAttachmentId||t[19]!==n.voiceDurationSec?(D=n.coverAttachmentId?(0,$.jsx)(Hn,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,$.jsx)(Wn,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-28 shrink-0`}):null,t[15]=n.coverAttachmentId,t[16]=n.id,t[17]=n.kind,t[18]=n.voiceAttachmentId,t[19]=n.voiceDurationSec,t[20]=D):D=t[20];let O;t[21]!==f||t[22]!==n.title?(O=n.title&&(0,$.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:f}),t[21]=f,t[22]=n.title,t[23]=O):O=t[23];let k=n.title?`text-fg-muted`:h?`italic text-fg-muted`:`text-fg`,A;t[24]===k?A=t[25]:(A=b(`truncate text-sm leading-5`,k),t[24]=k,t[25]=A);let j;t[26]!==m||t[27]!==A?(j=(0,$.jsx)(`p`,{className:A,children:m}),t[26]=m,t[27]=A,t[28]=j):j=t[28];let M;t[29]!==O||t[30]!==j?(M=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[O,j]}),t[29]=O,t[30]=j,t[31]=M):M=t[31];let N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(Ut,{className:`size-4`}),t[32]=N):N=t[32];let P;t[33]===c.actions?P=t[34]:(P=(0,$.jsx)(pt,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:er,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-100 transition-opacity hover:bg-surface-panel focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:opacity-0 lg:group-hover:opacity-100 lg:focus-visible:opacity-100`,"aria-label":c.actions,title:c.actions,children:N})}),t[33]=c.actions,t[34]=P);let F;t[35]!==n.id||t[36]!==n.pinned||t[37]!==a?(F=()=>{a(n.id,!n.pinned).catch(Qn)},t[35]=n.id,t[36]=n.pinned,t[37]=a,t[38]=F):F=t[38];let I;t[39]===n.pinned?I=t[40]:(I=n.pinned?(0,$.jsx)(Ne,{className:`size-4`}):(0,$.jsx)(We,{className:`size-4`}),t[39]=n.pinned,t[40]=I);let L=n.pinned?c.unpin:c.pin,R;t[41]!==F||t[42]!==I||t[43]!==L?(R=(0,$.jsxs)(wt,{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`,onSelect:F,children:[I,L]}),t[41]=F,t[42]=I,t[43]=L,t[44]=R):R=t[44];let z;t[45]!==n.id||t[46]!==o?(z=()=>{o(n.id).catch(Zn)},t[45]=n.id,t[46]=o,t[47]=z):z=t[47];let B;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(Te,{className:`size-4`}),t[48]=B):B=t[48];let V;t[49]!==c.archive||t[50]!==z?(V=(0,$.jsxs)(wt,{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`,onSelect:z,children:[B,c.archive]}),t[49]=c.archive,t[50]=z,t[51]=V):V=t[51];let H;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(gn,{className:`my-1 h-px bg-edge-subtle`}),t[52]=H):H=t[52];let U;t[53]!==n.id||t[54]!==s?(U=()=>{s(n.id).catch(Xn)},t[53]=n.id,t[54]=s,t[55]=U):U=t[55];let W;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(nt,{className:`size-4`}),t[56]=W):W=t[56];let G;t[57]!==c.delete||t[58]!==U?(G=(0,$.jsxs)(wt,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-500 outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:U,children:[W,c.delete]}),t[57]=c.delete,t[58]=U,t[59]=G):G=t[59];let K;t[60]!==R||t[61]!==V||t[62]!==G?(K=(0,$.jsx)(lt,{children:(0,$.jsxs)(Tt,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-overlay p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:$n,children:[R,V,H,G]})}),t[60]=R,t[61]=V,t[62]=G,t[63]=K):K=t[63];let ee;t[64]!==P||t[65]!==K?(ee=(0,$.jsxs)(un,{children:[P,K]}),t[64]=P,t[65]=K,t[66]=ee):ee=t[66];let q;t[67]!==D||t[68]!==M||t[69]!==ee?(q=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[D,M,ee]}),t[67]=D,t[68]=M,t[69]=ee,t[70]=q):q=t[70];let te;t[71]===n.pinned?te=t[72]:(te=n.pinned&&(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs font-medium text-accent`,children:(0,$.jsx)(We,{className:`size-3`})}),t[71]=n.pinned,t[72]=te);let ne;t[73]===n.tags?ne=t[74]:(ne=n.tags?.slice(0,2).map(Yn),t[73]=n.tags,t[74]=ne);let re;t[75]===v?re=t[76]:(re=(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:v}),t[75]=v,t[76]=re);let ie;t[77]!==te||t[78]!==ne||t[79]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[te,ne,re]}),t[77]=te,t[78]=ne,t[79]=re,t[80]=ie):ie=t[80];let ae;return t[81]!==q||t[82]!==ie||t[83]!==y||t[84]!==x||t[85]!==C||t[86]!==T||t[87]!==E?(ae=(0,$.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:y,onKeyDown:x,className:C,"aria-current":T,children:[E,q,ie]}),t[81]=q,t[82]=ie,t[83]=y,t[84]=x,t[85]=C,t[86]=T,t[87]=E,t[88]=ae):ae=t[88],ae}function Yn(e){return(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e)}function Xn(){}function Zn(){}function Qn(){}function $n(e){return e.stopPropagation()}function er(e){return e.stopPropagation()}function tr(){return Date.now()}function nr(e){return e.language}var rr=3e4;function ir(){if(!(typeof MediaRecorder>`u`))return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function ar({placeholder:e,submitLabel:t,actionsLabel:n,imageLabel:r,voiceLabel:i,stopRecordingLabel:a,onCapture:o,onImagePick:s,onVoiceCapture:c,onVoiceError:l,recordingLabel:u,imageDisabled:d=!1,voiceDisabled:f=!1,onDiscussionCapture:p,discussionCaptureLabel:m}){let[h,g]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(0),[T,E]=(0,Q.useState)(!1),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A=(0,Q.useRef)([]),j=(0,Q.useRef)(0),M=(0,Q.useRef)(null),N=(0,Q.useRef)(null),P=(0,Q.useCallback)(()=>{M.current&&=(clearInterval(M.current),null),N.current&&=(clearTimeout(N.current),null),k.current?.getTracks().forEach(e=>e.stop()),k.current=null,O.current=null,A.current=[],S(!1),w(0)},[]);(0,Q.useEffect)(()=>()=>P(),[P]);let F=(0,Q.useCallback)(async()=>{let e=O.current;if(!e||e.state!==`recording`)return;E(!0),await new Promise(t=>{e.addEventListener(`stop`,()=>t(),{once:!0}),e.stop()});let t=Math.max(1,Math.round((Date.now()-j.current)/1e3)),n=e.mimeType||ir()||`audio/webm`,r=new Blob(A.current,{type:n});if(P(),r.size>0&&c){let e=n.includes(`mp4`)?`m4a`:n.includes(`ogg`)?`ogg`:`webm`,i=new File([r],`voice-${Date.now()}.${e}`,{type:n});try{await c(i,t)}finally{E(!1)}return}E(!1)},[P,c]),I=(0,Q.useCallback)(async()=>{if(!(!c||T||x)){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){l?.();return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});k.current=e;let t=ir(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);O.current=n,A.current=[],j.current=Date.now(),n.ondataavailable=e=>{e.data.size>0&&A.current.push(e.data)},n.start(),S(!0),w(0),M.current=setInterval(()=>{w(Math.round((Date.now()-j.current)/1e3))},250),N.current=setTimeout(()=>{F()},rr)}catch{P(),l?.()}}},[P,c,l,x,F,T]),L=(0,Q.useCallback)(async()=>{let e=h.trim();if(!(!e||v)){y(!0),g(``);try{await o(e)}catch{g(e)}finally{y(!1),D.current?.focus()}}},[h,v,o]),R=(0,Q.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),L())},[L]),z=v||T,B=!!(s||c||p);return(0,$.jsxs)(`div`,{className:b(`flex items-center gap-1.5 rounded-2xl border border-edge bg-surface-panel p-2 shadow-float dark:shadow-elevated`,`focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,x&&`border-danger ring-1 ring-danger/40`),"aria-busy":z,children:[x?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void F(),disabled:T,className:`shrink-0 rounded-lg bg-danger-soft p-2 text-danger transition-colors hover:bg-danger-soft disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":a,title:a,"aria-pressed":`true`,children:(0,$.jsx)(qt,{className:`size-4 fill-current`,"aria-hidden":!0})}):B?(0,$.jsxs)(un,{children:[(0,$.jsx)(pt,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,disabled:z,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors 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`,"aria-label":n,title:n,children:(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(lt,{children:(0,$.jsxs)(Tt,{side:`top`,align:`start`,sideOffset:8,className:`z-50 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[s?(0,$.jsxs)(wt,{disabled:d,onSelect:s,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 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,$.jsx)(kt,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),r]}):null,c?(0,$.jsxs)(wt,{disabled:f,onSelect:()=>void I(),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 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,$.jsx)(tn,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),i]}):null,p?(0,$.jsxs)(wt,{onSelect:p,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,$.jsx)(ve,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),m]}):null]})})]}):null,x?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate py-1.5 text-sm text-danger`,children:u.replace(`{{seconds}}`,String(C))}):(0,$.jsx)(`textarea`,{ref:D,value:h,onChange:e=>g(e.target.value),onKeyDown:R,placeholder:e,"aria-label":e,rows:1,disabled:z,className:`max-h-28 min-h-8 flex-1 resize-none overflow-y-auto bg-transparent py-1.5 text-sm leading-5 text-fg placeholder:text-fg-muted focus:outline-none disabled:opacity-60`,style:{fieldSizing:`content`}}),(0,$.jsx)(`button`,{type:`button`,disabled:!h.trim()||z||x,onClick:()=>void L(),"aria-label":t,title:t,className:b(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,h.trim()&&!z&&!x?`bg-accent text-on-accent hover:bg-accent-hover`:`text-fg-disabled`),children:(0,$.jsx)(ht,{className:`size-4`,"aria-hidden":!0})})]})}var or={statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1},sr=240,cr=320,lr=520,ur=560;function dr(e){if(globalThis.localStorage===void 0)return cr;try{let t=globalThis.localStorage.getItem(e);if(!t)return cr;let n=Number(t);return Number.isFinite(n)?n:cr}catch{return cr}}function fr(e,t){if(globalThis.localStorage!==void 0)try{globalThis.localStorage.setItem(e,String(Math.round(t)))}catch{}}var pr={thought:$t,todo:zt,voice:tn,media:kt,bookmark:Ae,mixed:$t,task:zt};function mr(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function hr(e,t){return e.statusFilter===t.patch.statusFilter&&e.kindFilter===t.patch.kindFilter&&e.pinnedOnly===t.patch.pinnedOnly}function gr(e,t){return`${e.replace(/\/$/,``)}/${encodeURIComponent(t)}`}function _r({selectedNoteId:e,basePath:t,managePageHeader:n=!1,showLibrary:r=!0,allowMediaCapture:a=!0,projectId:o,listTitle:s,listDescription:c,emptyText:l,emptyDescription:u,listWidthStorageKey:d=`xopc.notes.listWidth`}){let f=w(e=>e.language),p=y(f).notes,m=!!S(e=>e.conversationId),[h,g]=(0,Q.useReducer)(ct,or),[x,T]=(0,Q.useState)(!1),[D,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(0),[R,z]=(0,Q.useState)(()=>dr(d)),[B,V]=(0,Q.useState)(!1),[H,U]=(0,Q.useState)(!1),[W,K]=(0,Q.useState)(!1),[ee,q]=(0,Q.useState)(null),[te,ne]=(0,Q.useState)(null),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(null),[se]=(0,Q.useState)(()=>Date.now()),ce=i(),le=(0,Q.useCallback)(e=>{let t=re.current?.clientWidth??window.innerWidth,n=Math.max(sr,t-ur);return Math.max(sr,Math.min(Math.min(lr,n),e))},[]),ue=(0,Q.useCallback)(e=>{let t=le(e);z(t),fr(d,t)},[le,d]);(0,Q.useLayoutEffect)(()=>{z(e=>le(e))},[le]);let{data:de,mutate:J,isLoading:fe}=L((0,Q.useMemo)(()=>m?[`notes-list`,o,h.statusFilter,h.kindFilter,h.pinnedOnly]:null,[m,o,h.statusFilter,h.kindFilter,h.pinnedOnly]),()=>Ue({status:h.statusFilter===`all`?void 0:h.statusFilter,kind:h.kindFilter===`all`?void 0:h.kindFilter,projectId:o,pinned:h.pinnedOnly?!0:void 0,limit:100,sortBy:`createdAt`,sortOrder:`desc`}),{keepPreviousData:!0}),pe=fe&&!de,me=de?.items??[],he=de?.total??0,_e=D.trim(),{data:ve,isLoading:ye}=L(m&&x&&_e?[`notes-search`,o,_e]:null,()=>Ue({search:_e,projectId:o,limit:30,sortBy:`updatedAt`,sortOrder:`desc`})),xe=ve?.items??[],Se=e?me.some(t=>t.id===e):!0;(0,Q.useEffect)(()=>{I(0)},[_e]),(0,Q.useEffect)(()=>{F>=xe.length&&I(Math.max(0,xe.length-1))},[F,xe.length]),(0,Q.useEffect)(()=>{let e=()=>{J().catch(e=>{q(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)})};return window.addEventListener(`note-updated`,e),()=>window.removeEventListener(`note-updated`,e)},[J,p.quickCaptureFailedHint,p.refreshFailed]);let Ce=Kt(e=>e.setPageHeader),we=Kt(e=>e.clearPageHeader),Te=p.noteCount.replace(`{{count}}`,String(he)),Ee=!r&&he===0&&c?c:Te,Oe=p.searchDialogTitle,ke=p.searchClose,Ae=p.searchClear,je=(0,Q.useMemo)(()=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>T(!0),className:b(`inline-flex h-9 items-center gap-2 rounded-lg border border-edge bg-surface-base px-3 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,Ht),"aria-label":Oe,children:[(0,$.jsx)(mn,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:Oe})]}),[Oe]);(0,Q.useLayoutEffect)(()=>{if(n)return m?(Ce({startExtra:null,main:(0,$.jsxs)(`div`,{className:b(`flex min-w-0 items-center gap-2`,Ht),children:[(0,$.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold tracking-tight text-fg`,children:s??p.title}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs text-fg-muted`,onClick:()=>window.dispatchEvent(new CustomEvent(`open-recording-recoveries`)),children:p.discussionCapture.recoveredTitle}),Te?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Te}):null]}),end:je}),()=>we()):(we(),()=>we())},[we,m,je,s,n,p.title,p.discussionCapture.recoveredTitle,Te,e,Ce]);let Me=(0,Q.useMemo)(()=>({justNow:p.justNow,minutesAgo:p.minutesAgo,today:p.today,yesterday:p.yesterday,daysAgo:p.daysAgo,locale:C(f)}),[f,p.justNow,p.minutesAgo,p.today,p.yesterday,p.daysAgo]),Ne=(0,Q.useMemo)(()=>[{id:`recent`,label:p.viewRecent,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1}},{id:`inbox`,label:p.filterInbox,patch:{statusFilter:`inbox`,kindFilter:`all`,pinnedOnly:!1}},{id:`pinned`,label:p.pinned,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!0}},{id:`tasks`,label:p.viewTasks,patch:{statusFilter:`all`,kindFilter:`todo`,pinnedOnly:!1}},{id:`voice`,label:p.kindVoice,patch:{statusFilter:`all`,kindFilter:`voice`,pinnedOnly:!1}},{id:`media`,label:p.kindMedia,patch:{statusFilter:`all`,kindFilter:`media`,pinnedOnly:!1}},{id:`bookmarks`,label:p.kindBookmark,patch:{statusFilter:`all`,kindFilter:`bookmark`,pinnedOnly:!1}},{id:`processed`,label:p.filterProcessed,patch:{statusFilter:`processed`,kindFilter:`all`,pinnedOnly:!1}},{id:`archive`,label:p.filterArchived,patch:{statusFilter:`archived`,kindFilter:`all`,pinnedOnly:!1}}],[p.filterArchived,p.filterInbox,p.filterProcessed,p.kindBookmark,p.kindMedia,p.kindVoice,p.pinned,p.viewRecent,p.viewTasks]),Pe=Ne.find(e=>hr(h,e))??Ne[0],Fe=s??Pe.label,Ie=(0,Q.useCallback)(async e=>{q(null);try{let n=o?await ae({markdown:e,kind:`thought`,projectId:o,channel:`web`}):await G(e,`web`);await J(),ce(gr(t,n.id))}catch(e){throw q(`${p.quickCaptureFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`),e}},[t,J,p.quickCaptureFailed,p.quickCaptureFailedHint,ce,o]),Le=(0,Q.useCallback)(async()=>{if(!W){K(!0),q(null);try{let e=await ae({markdown:``,kind:`thought`,projectId:o,channel:`web`});g({type:`patch`,patch:or}),await J(),ne(e.id),ce(gr(t,e.id))}catch(e){q(`${p.createBlankFailed}: ${e instanceof Error?e.message:p.createBlankFailedHint}`)}finally{K(!1)}}},[t,W,J,p.createBlankFailed,p.createBlankFailedHint,ce,o]),Re=(0,Q.useCallback)(()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=async()=>{let t=e.files?.[0];if(t)try{q(null),await Ze(t,`web`),await J()}catch(e){q(`${p.imageUploadFailed}: ${e instanceof Error?e.message:p.imageUploadFailedHint}`)}},e.click()},[J,p.imageUploadFailed,p.imageUploadFailedHint]),Be=(0,Q.useCallback)(async(e,t)=>{try{q(null),await be(e,t,`web`),await J()}catch(e){q(`${p.voiceUploadFailed}: ${e instanceof Error?e.message:p.voiceUploadFailedHint}`)}},[J,p.voiceUploadFailed,p.voiceUploadFailedHint]),Ve=(0,Q.useCallback)(()=>{q(`${p.voiceCaptureFailed}: ${p.voiceCaptureFailedHint}`)},[p.voiceCaptureFailed,p.voiceCaptureFailedHint]),He=(0,Q.useCallback)(async(e,t)=>{q(null);try{await De(e,{pinned:t}),await J()}catch(e){q(`${p.actionFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}},[J,p.actionFailed,p.quickCaptureFailedHint]),We=(0,Q.useCallback)(async e=>{q(null);try{await De(e,{status:`archived`}),await J()}catch(e){q(`${p.actionFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}},[J,p.actionFailed,p.quickCaptureFailedHint]),Ge=(0,Q.useCallback)(async e=>{q(null);try{await It(e),await J()}catch(e){q(`${p.actionFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}},[J,p.actionFailed,p.quickCaptureFailedHint]),Ke=(0,Q.useCallback)(e=>{ce(gr(t,e))},[t,ce]),qe=(0,Q.useCallback)(e=>{ce(gr(t,e)),T(!1)},[t,ce]),Je=(0,Q.useCallback)(e=>{if(xe.length){if(e.key===`ArrowDown`)e.preventDefault(),I(e=>Math.min(xe.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),I(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=xe[F]??xe[0];t&&qe(t.id)}}},[F,qe,xe]),Ye=(0,Q.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=ie.current;t.setPointerCapture(e.pointerId),V(!0);let r=re.current?.clientWidth??window.innerWidth,i=Math.max(sr,r-ur),a=Math.min(lr,i),o=e=>Math.max(sr,Math.min(a,e)),s=e.clientX,c=o(R),l=e.pointerId,u=0,f=c,p=c;n&&(n.style.transition=`none`,n.style.width=`${c}px`);let m=()=>{u=0,p=f,n&&(n.style.width=`${p}px`)},h=e=>{f=o(c+e.clientX-s),u===0&&(u=window.requestAnimationFrame(m))},g=()=>{u!==0&&(window.cancelAnimationFrame(u),m());try{t.releasePointerCapture(l)}catch{}V(!1),re.current?.style.setProperty(`--notes-list-width`,`${p}px`),n&&(n.style.removeProperty(`transition`),n.style.removeProperty(`width`)),z(p),fr(d,p),window.removeEventListener(`pointermove`,h),window.removeEventListener(`pointerup`,g),window.removeEventListener(`pointercancel`,g)};window.addEventListener(`pointermove`,h),window.addEventListener(`pointerup`,g),window.addEventListener(`pointercancel`,g)},[d,R]);(0,Q.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.repeat||e.key.toLowerCase()!==`n`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||(e.preventDefault(),Le())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Le]);let Xe=(0,Q.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),ue(R-16)):e.key===`ArrowRight`?(e.preventDefault(),ue(R+16)):e.key===`Home`?(e.preventDefault(),ue(sr)):e.key===`End`&&(e.preventDefault(),ue(lr))},[ue,R]);return m?(0,$.jsxs)(`div`,{ref:re,className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-base`,style:{"--notes-list-width":`${R}px`},children:[(0,$.jsxs)(`section`,{ref:ie,className:b(`relative flex min-h-0 w-full shrink-0 flex-col overflow-hidden bg-surface-rail`,!B&&`lg:transition-[width] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,H?`lg:w-0 lg:min-w-0 lg:max-w-0 lg:pointer-events-none`:`lg:w-[var(--notes-list-width)]`,e&&`hidden lg:flex`),"aria-hidden":H?!0:void 0,children:[(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:[ee?(0,$.jsx)(`p`,{className:`mb-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:ee}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[r?(0,$.jsx)(oe,{value:Pe.id,onChange:e=>{let t=Ne.find(t=>t.id===e.target.value);t&&g({type:`patch`,patch:t.patch})},className:`-ml-1 h-7 w-full max-w-44 rounded-lg border border-transparent bg-transparent px-2 text-sm font-semibold text-fg transition-colors hover:border-edge hover:bg-surface-base focus:border-accent focus:bg-surface-base focus:outline-none focus:ring-1 focus:ring-accent`,"aria-label":p.libraryTitle,children:Ne.map(e=>(0,$.jsx)(ze,{value:e.id,children:e.label},e.id))}):(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:Fe}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:Ee})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>U(!0),className:`hidden size-11 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 lg:inline-flex`,"aria-label":p.collapseNotesList,title:p.collapseNotesList,children:(0,$.jsx)(ge,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Vt(o),"aria-label":f===`zh`?`开始录音`:`Start recording`,className:`inline-flex size-11 shrink-0 items-center justify-center rounded-full text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(tn,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:Le,disabled:W,className:`inline-flex size-11 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 disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":p.createBlankNote,title:p.createBlankShortcut,children:(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>T(!0),className:`inline-flex size-11 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`,"aria-label":p.searchDialogTitle,title:p.searchDialogTitle,children:(0,$.jsx)(mn,{className:`size-4`,"aria-hidden":!0})})]})]})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-3 [scrollbar-gutter:stable]`,children:pe?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3,4].map(e=>(0,$.jsx)(`div`,{className:`h-20 animate-pulse rounded-lg bg-surface-hover`},e))}):me.length===0?(0,$.jsxs)(`div`,{className:`flex h-full min-h-48 flex-col items-center justify-center gap-2 px-6 py-10 text-center`,children:[(0,$.jsx)(`span`,{className:`mb-1 inline-flex size-12 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-fg-muted`,children:(0,$.jsx)($t,{className:`size-6`,"aria-hidden":!0})}),(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:e&&!Se?p.noteOutsideCurrentView:l??p.noNotes}),e&&!Se?null:(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:u??p.noNotesDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e&&!Se?(0,$.jsx)(`div`,{className:`mb-2 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:p.noteOutsideCurrentView}):null,me.map((t,n)=>{let r=n>0?jn(me[n-1].createdAt):null;return(0,$.jsxs)(`div`,{children:[jn(t.createdAt)!==r&&(0,$.jsx)(`div`,{className:b(`px-3 pb-1.5 pt-2 text-xs font-medium text-fg-muted`,n===0&&`pt-0`),children:Mn(t.createdAt,se,Me)}),(0,$.jsx)(Jn,{note:t,selected:t.id===e,onPress:Ke,onPin:He,onArchive:We,onDelete:Ge,timeLabels:Me,labels:{pin:p.pin,unpin:p.unpin,archive:p.archive,delete:p.delete,actions:p.noteActions,imageNote:p.imageNote,noText:p.noText}})]},t.id)})]})}),(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:(0,$.jsx)(ar,{placeholder:p.quickCapturePlaceholder,submitLabel:p.quickCaptureSubmit,actionsLabel:p.quickCaptureActions,imageLabel:p.quickCaptureImage,voiceLabel:p.quickCaptureVoice,stopRecordingLabel:p.stopRecording,onCapture:Ie,onImagePick:a?Re:void 0,onVoiceCapture:a?Be:void 0,onVoiceError:Ve,recordingLabel:p.recording,discussionCaptureLabel:p.discussionCapture.title,onDiscussionCapture:()=>Vt(o)})})]}),(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":p.resizeNotesList,"aria-valuemin":sr,"aria-valuemax":lr,"aria-valuenow":Math.round(R),tabIndex:0,onPointerDown:Ye,onDoubleClick:()=>ue(cr),onKeyDown:Xe,title:p.resizeNotesList,className:b(`group relative z-10 hidden shrink-0 cursor-col-resize touch-none select-none items-center justify-center bg-transparent hover:bg-surface-hover/60 lg:flex`,`lg:transition-[width,opacity] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,H?`lg:w-0 lg:opacity-0 lg:pointer-events-none`:`lg:w-2 lg:opacity-100`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-0`),children:(0,$.jsx)(`span`,{"aria-hidden":!0,className:b(`h-full w-px bg-transparent transition-[background-color,transform] duration-150`,`group-hover:bg-accent/70 group-focus-visible:bg-accent`,B&&`bg-accent scale-x-[2]`)})}),(0,$.jsxs)(`section`,{className:b(`relative min-w-0 flex-1 bg-surface-base`,!e&&`hidden lg:flex`),children:[H?(0,$.jsx)(`button`,{type:`button`,onClick:()=>U(!1),className:`absolute left-3 top-3 z-10 hidden size-8 items-center justify-center rounded-lg border border-edge bg-surface-base text-fg-muted shadow-surface transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:inline-flex`,"aria-label":p.expandNotesList,title:p.expandNotesList,children:(0,$.jsx)(ge,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}):null,e?(0,$.jsx)(Nn,{noteId:e,onBack:()=>ce(t),onSaved:()=>{J().catch(e=>{q(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)})},backButtonClassName:`lg:hidden`,clearHeaderOnCleanup:!1,onOpenSearch:()=>T(!0),autoFocus:e===te,onAutoFocusConsumed:()=>ne(null)}):(0,$.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center px-8 text-center`,children:(0,$.jsxs)(`div`,{className:`max-w-sm`,children:[(0,$.jsx)($t,{className:`mx-auto size-9 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-base font-semibold text-fg`,children:p.emptyEditorTitle}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:p.emptyEditorDescription}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Vt(o),"aria-label":f===`zh`?`开始录音`:`Start recording`,className:`inline-flex size-11 shrink-0 items-center justify-center rounded-full text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(tn,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsxs)(`button`,{type:`button`,onClick:Le,disabled:W,className:`mt-5 inline-flex items-center gap-2 rounded-lg bg-accent px-3 py-2 text-sm font-medium text-on-accent transition-colors hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),W?p.creatingBlankNote:p.createBlankNote]})]})})]}),(0,$.jsx)(N,{open:x,onOpenChange:T,children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-24 z-[90] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(M,{className:`text-sm font-semibold text-fg`,children:Oe}),(0,$.jsx)(O,{className:`sr-only`,children:p.searchPlaceholder}),(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,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`,"aria-label":ke,children:(0,$.jsx)(v,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(mn,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`search`,value:D,onChange:e=>P(e.target.value),onKeyDown:Je,placeholder:p.searchPlaceholder,className:`w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-10 text-sm text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent`}),D?(0,$.jsx)(`button`,{type:`button`,onClick:()=>P(``),className:`absolute right-2 top-1/2 inline-flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":Ae,children:(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0})}):null]}),(0,$.jsx)(`div`,{className:`mt-4 max-h-[min(28rem,calc(100vh-14rem))] overflow-y-auto [scrollbar-gutter:stable]`,children:_e?ye&&!ve?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3].map(e=>(0,$.jsx)(`div`,{className:`h-16 animate-pulse rounded-lg bg-surface-hover`},e))}):xe.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)($t,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:p.searchNoResults}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:p.searchNoResultsDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`px-2 pb-1 text-xs text-fg-muted`,children:p.searchResultsCount.replace(`{{count}}`,String(ve?.total??xe.length))}),xe.map((e,t)=>{let n=pr[e.kind]||$t,r=mr(e,{imageNote:p.imageNote,noText:p.noText});return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>qe(e.id),onMouseEnter:()=>I(t),className:b(`flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors`,t===F?`bg-surface-active`:`hover:bg-surface-hover`),children:[(0,$.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.title||r}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:X(e.updatedAt,se,Me)})]}),e.title?(0,$.jsx)(`span`,{className:`mt-0.5 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:r}):null,e.tags?.length?(0,$.jsx)(`span`,{className:`mt-1 flex min-w-0 flex-wrap gap-1`,children:e.tags.slice(0,3).map(e=>(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]})]},e.id)})]}):(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)(mn,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:p.searchEmptyTitle}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:p.searchEmptyDescription})]})})]})]})]})})]}):(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)($t,{className:`size-10 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:p.needToken})]})}var vr=()=>({goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``});function yr({projectId:e}){let t=w(e=>e.language),n=y(t).workflows,r=t===`zh`,[i,a]=(0,Q.useState)(!1),[o,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(vr),[m,h]=(0,Q.useState)([]),[g,_]=(0,Q.useState)(!0),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),[T,P]=(0,Q.useState)(null),F=L(i?`workflow-definitions`:null,sn,{revalidateOnFocus:!1}),I=L(i?`workflow-agents`:null,z,{revalidateOnFocus:!1}),R=L(i?[`workflow-project-presets`,e]:null,()=>it(e),{revalidateOnFocus:!1}),H=F.data?.find(e=>e.id===o),U=H?ke(H,t):null,W=u||I.data?.defaultId,G=F.isLoading||I.isLoading||R.isLoading,K=F.error||I.error||R.error,ee=Dn(H,f,g).valid,q=e=>{b||(e&&(l(``),d(``),p(vr()),h([]),_(!0),C(null),P(null)),a(e))},te=e=>{l(e),p(vr()),_(!0),C(null),h(R.data?.find(t=>t.definitionId===e)?.contextRefs??[])},ne=async()=>{if(!(!H||!W||!ee||b||T||G||K)){x(!0),C(null);try{P({runId:(await V({definitionId:H.id,agentId:W,projectId:e,goal:f.goal.trim()||U?.description||H.title,input:On(H,f),contextRefs:m,concurrency:f.concurrency.trim()?Number(f.concurrency):void 0,maxSubagents:f.maxSubagents.trim()?Number(f.maxSubagents):void 0})).runId,agentId:W})}catch(e){C(e instanceof Error?e.message:n.startFailed);return}finally{x(!1)}}};return(0,$.jsxs)(N,{open:i,onOpenChange:q,children:[(0,$.jsx)(D,{asChild:!0,children:(0,$.jsxs)(Y,{variant:`secondary`,className:`h-9 rounded-lg`,children:[(0,$.jsx)(_e,{className:`size-4`,"aria-hidden":!0}),y(t).projectDetailPage.common.runWorkflow]})}),(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(46rem,calc(100dvh-2rem))] w-[min(48rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-float`,children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:y(t).projectDetailPage.common.runWorkflow}),(0,$.jsx)(O,{className:`mt-1 text-xs text-fg-muted`,children:r?`选择工作流并运行,结果将关联到当前项目。`:`Choose and run a workflow. The run will be linked to this project.`})]}),(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{variant:`ghost`,className:`size-8 p-0`,disabled:b,"aria-label":n.pickStartClose,children:(0,$.jsx)(v,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:T?(0,$.jsxs)(`div`,{role:`status`,className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,$.jsx)(c,{className:`size-8 text-success`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-base font-medium text-fg`,children:n.startSuccess}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:r?`工作流正在后台运行,你可以继续处理项目。`:`The workflow is running in the background. You can continue working on your project.`}),(0,$.jsx)(Y,{asChild:!0,variant:`secondary`,children:(0,$.jsx)(s,{to:`/workflows/runs/${encodeURIComponent(T.runId)}?agentId=${encodeURIComponent(T.agentId)}&projectId=${encodeURIComponent(e)}`,children:n.taskOpenDetails})})]}):G?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":r?`正在加载工作流`:`Loading workflows`,children:[(0,$.jsx)(yt,{className:`h-10 w-full rounded-lg`}),(0,$.jsx)(yt,{className:`h-10 w-full rounded-lg`}),(0,$.jsx)(yt,{className:`h-56 w-full rounded-xl`})]}):K?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:K instanceof Error?K.message:n.startFailed}):F.data?.length?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n.chooseWorkflow,(0,$.jsxs)(oe,{value:o,onChange:e=>te(e.target.value),disabled:b,"aria-label":n.chooseWorkflow,className:`mt-1 w-full`,children:[(0,$.jsx)(ze,{value:``,children:n.chooseWorkflow}),F.data.map(e=>(0,$.jsx)(ze,{value:e.id,children:ke(e,t).title},e.id))]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[r?`执行助手`:`Execution assistant`,(0,$.jsx)(oe,{value:W??``,onChange:e=>d(e.target.value),disabled:b,"aria-label":r?`执行助手`:`Execution assistant`,className:`mt-1 w-full`,children:I.data?.agents.map(e=>(0,$.jsx)(ze,{value:e.id,children:B(e,y(t).agentsSettings)},e.id))})]}),H&&U?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:U.description}),(0,$.jsx)(zn,{projectId:e,language:t,value:m,onChange:h}),(0,$.jsx)(kn,{definition:H,language:t,value:f,onChange:p,mode:`manual`,onValidityChange:e=>_(e.reason!==`raw-json`)})]}):null,S?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:S}):null]}):(0,$.jsx)(`p`,{className:`py-12 text-center text-sm text-fg-muted`,children:r?`还没有可运行的工作流,请先新建工作流。`:`No workflows are available. Create a workflow to get started.`})}),(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(Y,{asChild:!0,variant:`ghost`,disabled:b,children:(0,$.jsx)(s,{to:`/workflows/new?projectId=${encodeURIComponent(e)}`,onClick:e=>{b&&e.preventDefault()},children:n.addWorkflow})}),T?(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{variant:`primary`,children:n.pickStartClose})}):(0,$.jsxs)(Y,{variant:`primary`,disabled:G||!!K||!H||!W||!ee||b,onClick:()=>void ne(),children:[(0,$.jsx)(J,{className:`size-4`,"aria-hidden":!0}),b?n.starting:n.runWorkflow]})]})]})]})]})}function br(e){return x(T(`/api/projects/${encodeURIComponent(e)}/skills`))}function xr(e,t){return x(T(`/api/projects/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`))}function Sr(e,t){return x(T(`/api/projects/${encodeURIComponent(e)}/workspace-trust`),{method:`PATCH`,body:JSON.stringify({trusted:t})})}function Cr(e,t){let n=new FormData;return n.set(`file`,t),x(T(`/api/projects/${encodeURIComponent(e)}/skills/upload`),{method:`POST`,body:n})}function wr(e,t,n={}){return x(T(`/api/projects/${encodeURIComponent(e)}/skills/marketplace/install`),{method:`POST`,body:JSON.stringify({name:t,...n})})}function Tr(e,t){return x(T(`/api/projects/${encodeURIComponent(e)}/skills/source/install`),{method:`POST`,body:JSON.stringify({source:t})})}function Er(e,t){return x(T(`/api/projects/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`),{method:`DELETE`})}function Dr({projectId:e,copy:t}){let n=w(e=>e.language),[r,i]=(0,Q.useState)([]),[a,o]=(0,Q.useState)([]),[s,c]=(0,Q.useState)([]),[l,u]=(0,Q.useState)([]),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(null),[g,y]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!0),[C,T]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(null),[P,F]=(0,Q.useState)(``),[I,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(null),[B,V]=(0,Q.useState)(``),[H,U]=(0,Q.useState)(1),[W,G]=(0,Q.useState)(null),[ee,q]=(0,Q.useState)(!1),[te,ne]=(0,Q.useState)(``),[re,ae]=(0,Q.useState)(``),oe=(0,Q.useRef)(null),se=(0,Q.useCallback)(async()=>{S(!0),F(``);try{let t=await br(e);i(t.items),o(t.inheritedItems),c(t.sources)}catch(e){F(e instanceof Error?e.message:String(e))}finally{S(!1)}},[e]);(0,Q.useEffect)(()=>{se()},[se]),(0,Q.useEffect)(()=>{let t=!1;return Me(e).then(e=>{t||u(e)}).catch(()=>{t||u([])}),()=>{t=!0}},[e]),(0,Q.useEffect)(()=>{if(!f){h(null);return}let e=l.find(e=>e.key===f),t=!1;return h(null),F(``),y(!0),at(e?.agentId??e?.routing?.agentId,f,!0).then(e=>{t||h(e)}).catch(e=>{t||F(e instanceof Error?e.message:String(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[f,l]),(0,Q.useEffect)(()=>{if(I!==`marketplace`)return;let e=new AbortController,t=window.setTimeout(()=>{q(!0),ne(``),wn({q:B,page:H,pageSize:8,sort:`downloads`,signal:e.signal}).then(G).catch(t=>{e.signal.aborted||ne(t instanceof Error?t.message:String(t))}).finally(()=>{e.signal.aborted||q(!1)})},250);return()=>{window.clearTimeout(t),e.abort()}},[I,H,B]);async function le(e,t){T(!0),O(t??null),F(``);try{await e(),L(null),ae(``),await se()}catch(e){F(e instanceof Error?e.message:String(e))}finally{T(!1),O(null)}}async function ue(t){F(``);try{z((await xr(e,t)).skill)}catch(e){F(e instanceof Error?e.message:String(e))}}async function de(n){if(n.removable&&window.confirm(t.removeConfirm.replace(`{{name}}`,n.name))){T(!0);try{await Er(e,n.directoryId),await se()}catch(e){F(e instanceof Error?e.message:String(e))}finally{T(!1)}}}async function J(){T(!0),F(``);try{await Sr(e,!0),await se()}catch(e){F(e instanceof Error?e.message:String(e))}finally{T(!1)}}let fe=s.find(e=>e.origin===`agents-workspace`),pe=new Map(m?.skills.map(e=>[e.name,e]));return(0,$.jsxs)(`section`,{id:`project-panel-skills`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-skills`,className:`grid content-start gap-4`,children:[(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-panel p-4 shadow-surface`,children:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.description})]}),(0,$.jsxs)(xe,{children:[(0,$.jsx)(Je,{asChild:!0,children:(0,$.jsxs)(Y,{type:`button`,children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),t.add,(0,$.jsx)(Nt,{className:`size-3.5`,"aria-hidden":!0})]})}),(0,$.jsx)(Qe,{children:(0,$.jsxs)(K,{align:`end`,sideOffset:8,className:`z-50 w-72 rounded-lg border border-edge bg-surface-overlay p-1.5 shadow-xl`,children:[(0,$.jsx)(jr,{icon:Wt,title:t.marketplace,hint:t.marketplaceHint,onClick:()=>L(`marketplace`)}),(0,$.jsx)(jr,{icon:_e,title:t.source,hint:t.sourceHint,onClick:()=>L(`source`)}),(0,$.jsx)(jr,{icon:me,title:t.upload,hint:t.uploadHint,onClick:()=>oe.current?.click()})]})})]}),(0,$.jsx)(`input`,{ref:oe,type:`file`,accept:`.zip,application/zip`,className:`hidden`,onChange:t=>{let n=t.target.files?.[0];n&&le(()=>Cr(e,n)),t.target.value=``}})]})}),P?(0,$.jsx)(`p`,{className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:P}):null,fe?.state===`untrusted`?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(Lt,{className:`mt-0.5 size-4 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.trustTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.trustHint})]})]}),(0,$.jsxs)(Y,{type:`button`,variant:`secondary`,disabled:C,onClick:()=>void J(),children:[(0,$.jsx)(Et,{className:`size-4`,"aria-hidden":!0}),C?t.trusting:t.trustAction]})]}):null,l.length?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3 rounded-lg border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.sessionViewLabel}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:g?t.sessionLoading:f?m?.agentId:t.sessionViewAll})]}),(0,$.jsx)(ce,{value:f,options:l.map(e=>({value:e.key,label:e.name?.trim()||`${t.sessionFallback} · ${e.key.slice(-12)}`})),placeholder:t.sessionViewAll,emptyLabel:t.sessionViewAll,triggerClassName:`w-[min(24rem,calc(100vw-3rem))]`,onChange:p})]}):null,x?(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:[0,1,2].map(e=>(0,$.jsx)(yt,{className:`h-36 rounded-lg`},e))}):r.length?(0,$.jsx)(Or,{title:t.localTitle,items:r,copy:t,busy:C,availabilityByName:pe,onPreview:ue,onRemove:de}):(0,$.jsxs)(`div`,{className:`rounded-lg border border-dashed border-edge bg-surface-panel px-6 py-12 text-center`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.empty}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.emptyHint})]}),!x&&a.length?(0,$.jsx)(Or,{title:t.inheritedTitle,hint:t.inheritedHint,items:a,copy:t,busy:C,availabilityByName:pe,onPreview:ue,onRemove:de}):null,(0,$.jsx)(N,{open:I!==null,onOpenChange:e=>{e||L(null)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:b(`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-xl`,I===`marketplace`?`h-[min(46rem,calc(100vh-2rem))] w-[min(58rem,calc(100vw-2rem))]`:`h-[min(22rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))]`),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:I===`marketplace`?t.marketplace:t.source}),(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`size-9 p-0`,children:(0,$.jsx)(v,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:I===`marketplace`?(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.marketplace}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.marketplaceHint}),(0,$.jsxs)(`div`,{className:`relative mt-3`,children:[(0,$.jsx)(mn,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{className:`h-10 w-full rounded-md border border-edge bg-surface-base pl-9 pr-3 text-sm outline-none focus:border-accent`,value:B,onChange:e=>{V(e.target.value),U(1)},placeholder:t.marketplacePlaceholder,autoFocus:!0})]}),te?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-red-600 dark:text-red-300`,children:te}):null,ee&&!W?(0,$.jsx)(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[0,1,2,3].map(e=>(0,$.jsx)(yt,{className:`h-32 rounded-lg`},e))}):W?.items.length?(0,$.jsx)(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:W.items.map(i=>{let a=ft(i,n),o=i.providerId??W.provider,s=Cn(i,o),c=r.some(e=>e.origin===`xopc-workspace`&&(e.directoryId===i.id||e.directoryId===s||e.name===i.name)),l=D===s;return(0,$.jsxs)(`article`,{className:`group flex min-h-32 gap-3 rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsx)(Sn,{name:i.name,className:`size-10`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`h4`,{className:`truncate text-sm font-semibold text-fg`,children:a.displayName}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:a.description||`—`}),(0,$.jsxs)(`div`,{className:`mt-auto flex items-end justify-between gap-2 pt-2`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-fg-subtle`,children:[(0,$.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceDownloads,` `,i.downloads]}),(0,$.jsx)(Y,{type:`button`,className:`h-8 px-2.5 text-xs`,variant:c?`secondary`:`primary`,disabled:C||c,onClick:()=>void le(()=>wr(e,s,{provider:o}),s),children:c?t.marketplaceInstalled:l?t.installing:t.install})]})]})]},`${o??`default`}:${i.id}`)})}):ee?null:(0,$.jsx)(`p`,{className:`mt-6 text-center text-sm text-fg-muted`,children:t.marketplaceEmpty}),W&&W.meta.totalPages>1?(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t.marketplacePage.replace(`{{page}}`,String(W.meta.page)).replace(`{{total}}`,String(W.meta.totalPages))}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:ee||H<=1,onClick:()=>U(e=>Math.max(1,e-1)),children:[(0,$.jsx)(Le,{className:`size-4`}),t.marketplacePrevious]}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:ee||H>=W.meta.totalPages,onClick:()=>U(e=>e+1),children:[t.marketplaceNext,(0,$.jsx)(ie,{className:`size-4`})]})]})]}):null]}):(0,$.jsxs)(`section`,{className:`flex h-full flex-col`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:t.sourceHint}),(0,$.jsx)(`input`,{className:`mt-4 h-10 w-full rounded-md border border-edge bg-surface-base px-3 text-sm outline-none focus:border-accent`,value:re,onChange:e=>ae(e.target.value),placeholder:t.sourcePlaceholder,autoFocus:!0}),(0,$.jsxs)(`div`,{className:`mt-auto flex justify-end gap-2 border-t border-edge pt-4`,children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`secondary`,children:t.close})}),(0,$.jsx)(Y,{type:`button`,disabled:C||!re.trim(),onClick:()=>void le(()=>Tr(e,re.trim())),children:C?t.installing:t.install})]})]})})]})]})}),(0,$.jsx)(N,{open:!!R,onOpenChange:e=>{e||z(null)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(42rem,calc(100vh-2rem))] w-[min(48rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-xl`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:R?.name}),(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`size-9 p-0`,children:(0,$.jsx)(v,{className:`size-4`})})})]}),(0,$.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap p-5 text-sm leading-6 text-fg-muted`,children:R?.bodyMarkdown})]})]})})]})}function Or(e){let t=(0,Vn.c)(25),{title:n,hint:r,items:i,copy:a,busy:o,availabilityByName:s,onPreview:c,onRemove:l}=e,u;t[0]===n?u=t[1]:(u=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n}),t[0]=n,t[1]=u);let d;t[2]===r?d=t[3]:(d=r?(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r}):null,t[2]=r,t[3]=d);let p;t[4]!==u||t[5]!==d?(p=(0,$.jsxs)(`div`,{children:[u,d]}),t[4]=u,t[5]=d,t[6]=p):p=t[6];let m;if(t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==i||t[11]!==c||t[12]!==l){let e;t[14]!==s||t[15]!==o||t[16]!==a||t[17]!==c||t[18]!==l?(e=e=>{let t=e.effective?s.get(e.name):void 0;return(0,$.jsxs)(`article`,{className:b(`flex min-h-36 flex-col rounded-lg border border-edge bg-surface-panel p-4`,!e.effective&&`opacity-70`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Te,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,$.jsx)(`h4`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:e.name})]}),(0,$.jsx)(`p`,{className:`mt-2 line-clamp-2 flex-1 text-sm leading-5 text-fg-muted`,children:e.description||e.directoryId}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover/70 px-2 py-0.5`,children:kr(a,e.origin)}),e.writable?null:(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover/70 px-2 py-0.5`,children:a.sourceReadOnly}),e.effective?null:(0,$.jsx)(`span`,{className:`rounded-md bg-amber-500/10 px-2 py-0.5 text-amber-800 dark:text-amber-200`,children:a.shadowed}),t?(0,$.jsx)(`span`,{className:b(`rounded-md px-2 py-0.5`,t.availableForCurrentAgent?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-amber-500/10 text-amber-800 dark:text-amber-200`),children:Ar(a,t)}):null]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>void c(e.key),children:[(0,$.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),a.view]}),e.removable?(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-red-600`,disabled:o,onClick:()=>void l(e),children:[(0,$.jsx)(nt,{className:`size-3.5`,"aria-hidden":!0}),a.remove]}):null]})]},e.key)},t[14]=s,t[15]=o,t[16]=a,t[17]=c,t[18]=l,t[19]=e):e=t[19],m=i.map(e),t[7]=s,t[8]=o,t[9]=a,t[10]=i,t[11]=c,t[12]=l,t[13]=m}else m=t[13];let h;t[20]===m?h=t[21]:(h=(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:m}),t[20]=m,t[21]=h);let g;return t[22]!==p||t[23]!==h?(g=(0,$.jsxs)(`section`,{className:`grid gap-3`,children:[p,h]}),t[22]=p,t[23]=h,t[24]=g):g=t[24],g}function kr(e,t){switch(t){case`xopc-workspace`:return e.xopcSource;case`agents-workspace`:return e.agentsSource;case`xopc-global`:case`custom-global`:return e.globalXopcSource;case`agents-global`:return e.globalAgentsSource;case`bundled`:return e.bundledSource;case`extra`:return e.extraSource}}function Ar(e,t){if(t.availableForCurrentAgent)return e.sessionAvailable;switch(t.unavailableReason){case`agent-denied`:return e.sessionUnavailableAgent;case`disabled`:return e.sessionUnavailableDisabled;case`requirements-unmet`:return e.sessionUnavailableRequirements;case`model-invocation-disabled`:return e.sessionUnavailableModel;case`tool-gated`:return e.sessionUnavailableTools;default:return e.sessionUnavailableAgent}}function jr(e){let t=(0,Vn.c)(13),{icon:n,title:r,hint:i,onClick:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`,"aria-hidden":!0}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-fg-muted`,children:i}),t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==a||t[10]!==o||t[11]!==l?(u=(0,$.jsx)(vn,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-3 rounded-md px-3 py-2.5 text-left hover:bg-surface-hover`,onClick:a,children:[o,l]})}),t[9]=a,t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function Mr(e){return{name:e.name,description:e.description??``,status:e.status,defaultAgentId:e.defaultAgentId??``,executionMode:e.executionMode,workspaceRoot:e.workspaceRoot??``,brief:e.brief??``,instructions:e.instructions??``}}function Nr(e,t,n){let r=Mr(t),i=Mr(n),a=Object.keys(r).filter(t=>e[t]===r[t]);return{...e,...Object.fromEntries(a.map(e=>[e,i[e]]))}}var Pr={active:0,review:1,ready:2,backlog:3,closed:4},Fr={failed:0,blocked:1,waiting:2,verifying:3,running:4,queued:5,allocating:5,cancelled:6,idle:7},Ir={critical:0,high:1,normal:2,low:3};function Lr(e,t=4){return e.filter(e=>e.phase!==`closed`&&!(e.operationalState===`waiting`&&e.attention.length===0)).sort((e,t)=>{let n=Number(t.attention.length>0)-Number(e.attention.length>0);if(n!==0)return n;let r=Fr[e.operationalState]-Fr[t.operationalState];if(r!==0)return r;let i=Pr[e.phase]-Pr[t.phase];if(i!==0)return i;let a=Ir[e.priority]-Ir[t.priority];return a===0?t.updatedAt-e.updatedAt:a}).slice(0,t)}var Rr=[`backlog`,`ready`,`active`,`review`,`closed`];function zr(e){return{backlog:e.filter(e=>e.phase===`backlog`),ready:e.filter(e=>e.phase===`ready`),active:e.filter(e=>e.phase===`active`),review:e.filter(e=>e.phase===`review`),closed:e.filter(e=>e.phase===`closed`)}}function Br(e,t){if(e.phase!==t&&e.allowedCommands.includes(`move`))return`move_${t}`}function Vr(e){if(e.allowedCommands.includes(`resolve_wait`))return`resume`;if(e.allowedCommands.includes(`mark_ready`))return`ready`;if(e.allowedCommands.includes(`start`))return`run`;if(e.allowedCommands.includes(`request_review`))return`review`;if(e.phase===`review`&&e.allowedCommands.includes(`close`))return`complete`;if(e.allowedCommands.includes(`reopen`))return`reopen`;if(e.allowedCommands.includes(`add_wait`))return`pause`}function Hr(e){let t=new Map,n=new Map;for(let r of e)t.set(r.dependencyTaskId,[...t.get(r.dependencyTaskId)??[],r.dependentTaskId]),n.set(r.dependentTaskId,[...n.get(r.dependentTaskId)??[],r.dependencyTaskId]);return{outgoing:t,incoming:n}}function Ur(e,t){let n=new Set(e.map(e=>e.id)),{outgoing:r,incoming:i}=Hr(t.filter(e=>n.has(e.dependencyTaskId)&&n.has(e.dependentTaskId))),a=new Map(e.map(e=>[e.id,i.get(e.id)?.length??0])),o=new Map(e.map(e=>[e.id,0])),s=e.filter(e=>a.get(e.id)===0).sort((e,t)=>t.updatedAt-e.updatedAt).map(e=>e.id);for(let e=0;e<s.length;e+=1){let t=s[e];for(let e of r.get(t)??[]){o.set(e,Math.max(o.get(e)??0,(o.get(t)??0)+1));let n=(a.get(e)??1)-1;a.set(e,n),n===0&&s.push(e)}}let c=new Map;for(let t of e){let e=o.get(t.id)??0;c.set(e,[...c.get(e)??[],t.id])}let l=new Map;for(let[e,t]of c)t.forEach((t,n)=>l.set(t,{x:e*300,y:n*136}));return l}function Wr(e,t){let{incoming:n}=Hr(t),r=new Set(e.filter(e=>e.operationalState===`blocked`).map(e=>e.id)),i=[...r];for(let e=0;e<i.length;e+=1)for(let t of n.get(i[e])??[])r.has(t)||(r.add(t),i.push(t));return r}function Gr(e,t){let{incoming:n,outgoing:r}=Hr(t),i=new Set([e]);for(let t of[n,r]){let n=[e],r=new Set(n);for(let e=0;e<n.length;e+=1)for(let a of t.get(n[e])??[])r.has(a)||(r.add(a),i.add(a),n.push(a))}return i}var Kr={backlog:`border-edge`,ready:`border-edge`,active:`border-accent ring-2 ring-accent/15`,review:`border-amber-400/80`,closed:`border-emerald-400/60`};function qr(e){let t=(0,Vn.c)(25),{data:n,selected:r}=e,i=n.task,a=i.operationalState===`waiting`||i.operationalState===`blocked`,o=Kr[i.phase],s=r&&`ring-2 ring-accent/30`,c=n.dimmed&&`opacity-30`,l;t[0]!==o||t[1]!==s||t[2]!==c?(l=b(`group w-56 rounded-xl border bg-surface-panel p-3 shadow-surface transition-opacity`,o,s,c),t[0]=o,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(Ln,{type:`target`,position:Fn.Left,className:`!size-3 !border-2 !border-surface-panel !bg-accent opacity-60 transition-opacity group-hover:opacity-100`}),t[4]=u):u=t[4];let d;t[5]===i.title?d=t[6]:(d=(0,$.jsx)(`strong`,{className:`line-clamp-2 min-w-0 text-sm font-medium leading-5 text-fg`,children:i.title}),t[5]=i.title,t[6]=d);let f;t[7]===a?f=t[8]:(f=a?(0,$.jsx)(Be,{className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-300`,"aria-hidden":!0}):null,t[7]=a,t[8]=f);let p;t[9]!==d||t[10]!==f?(p=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===n.phaseLabel?m=t[13]:(m=(0,$.jsx)(`span`,{children:n.phaseLabel}),t[12]=n.phaseLabel,t[13]=m);let h;t[14]!==a||t[15]!==i.blockedBy?(h=a&&i.blockedBy.length>0?(0,$.jsx)(`span`,{children:i.blockedBy.length}):null,t[14]=a,t[15]=i.blockedBy,t[16]=h):h=t[16];let g;t[17]!==h||t[18]!==m?(g=(0,$.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 text-[11px] text-fg-subtle`,children:[m,h]}),t[17]=h,t[18]=m,t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(Ln,{type:`source`,position:Fn.Right,className:`!size-3 !border-2 !border-surface-panel !bg-accent opacity-60 transition-opacity group-hover:opacity-100`}),t[20]=_):_=t[20];let v;return t[21]!==g||t[22]!==l||t[23]!==p?(v=(0,$.jsxs)(`div`,{className:l,children:[u,p,g,_]}),t[21]=g,t[22]=l,t[23]=p,t[24]=v):v=t[24],v}var Jr={taskNode:qr};function Yr(e){let t=(0,Vn.c)(90),{tasks:n,dependencyEdges:r,returnTo:i,copy:a,onDependenciesChange:o}=e,[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(),[g,_]=(0,Q.useState)(),v=(0,Q.useRef)(null),y;t[0]!==r||t[1]!==n?(y=Wr(n,r),t[0]=r,t[1]=n,t[2]=y):y=t[2];let x=y,S;t[3]!==x||t[4]!==u||t[5]!==c||t[6]!==n?(S=u?n.filter(e=>x.has(e.id)):c?n:n.filter(ri),t[3]=x,t[4]=u,t[5]=c,t[6]=n,t[7]=S):S=t[7];let C=S,w;t[8]===C?w=t[9]:(w=new Set(C.map(ni)),t[8]=C,t[9]=w);let T=w,E;if(t[10]!==r||t[11]!==T){let e;t[13]===T?e=t[14]:(e=e=>T.has(e.dependencyTaskId)&&T.has(e.dependentTaskId),t[13]=T,t[14]=e),E=r.filter(e),t[10]=r,t[11]=T,t[12]=E}else E=t[12];let D=E,O;t[15]!==D||t[16]!==C?(O=Ur(C,D),t[15]=D,t[16]=C,t[17]=O):O=t[17];let k=O,A;t[18]!==m||t[19]!==D?(A=m?Gr(m,D):void 0,t[18]=m,t[19]=D,t[20]=A):A=t[20];let j=A,M;t[21]===m?M=t[22]:(M=e=>e.id===m,t[21]=m,t[22]=M);let N=C.find(M),P;t[23]===C?P=t[24]:(P=new Map(C.map(ti)),t[23]=C,t[24]=P);let F=P,I;if(t[25]!==a.phases||t[26]!==k||t[27]!==j||t[28]!==C){let e;t[30]!==a.phases||t[31]!==k||t[32]!==j?(e=e=>({id:e.id,type:`taskNode`,position:k.get(e.id)??{x:0,y:0},data:{task:e,phaseLabel:a.phases[e.phase],dimmed:!!(j&&!j.has(e.id))}}),t[30]=a.phases,t[31]=k,t[32]=j,t[33]=e):e=t[33],I=C.map(e),t[25]=a.phases,t[26]=k,t[27]=j,t[28]=C,t[29]=I}else I=t[29];let L=I,R;if(t[34]!==j||t[35]!==F||t[36]!==D){let e;t[38]!==j||t[39]!==F?(e=e=>{let t=F.get(e.dependencyTaskId),n=t?.phase===`closed`&&t.resolution===`done`,r=!!(j&&(!j.has(e.dependencyTaskId)||!j.has(e.dependentTaskId)));return{id:`${e.dependencyTaskId}:${e.dependentTaskId}`,source:e.dependencyTaskId,target:e.dependentTaskId,markerEnd:{type:Pn.ArrowClosed},style:{stroke:n?`var(--color-edge-strong)`:`var(--color-accent)`,strokeWidth:n?1.25:1.75,opacity:r?.18:1,strokeDasharray:n?`5 5`:void 0}}},t[38]=j,t[39]=F,t[40]=e):e=t[40],R=D.map(e),t[34]=j,t[35]=F,t[36]=D,t[37]=R}else R=t[37];let z=R,B,V;t[41]!==m||t[42]!==T?(B=()=>{m&&!T.has(m)&&h(void 0)},V=[m,T],t[41]=m,t[42]=T,t[43]=B,t[44]=V):(B=t[43],V=t[44]),(0,Q.useEffect)(B,V);let H,U;t[45]!==z||t[46]!==g?(H=()=>{g&&!z.some(e=>e.id===g)&&_(void 0)},U=[z,g],t[45]=z,t[46]=g,t[47]=H,t[48]=U):(H=t[47],U=t[48]),(0,Q.useEffect)(H,U);let W;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>{let e=window.requestAnimationFrame(()=>{v.current?.fitView({padding:.2,minZoom:.35,maxZoom:1,duration:250})});return()=>window.cancelAnimationFrame(e)},t[49]=W):W=t[49];let G;t[50]!==u||t[51]!==c||t[52]!==C.length?(G=[u,c,C.length],t[50]=u,t[51]=c,t[52]=C.length,t[53]=G):G=t[53],(0,Q.useEffect)(W,G);let K;t[54]===m?K=t[55]:(K=()=>{m&&v.current?.fitView({nodes:[{id:m}],padding:1.5,minZoom:.7,maxZoom:1,duration:250})},t[54]=m,t[55]=K);let ee=K,q;t[56]!==r||t[57]!==o?(q=e=>{if(!e.source||!e.target||e.source===e.target)return;let t=r.filter(t=>t.dependentTaskId===e.target).map(ei);t.includes(e.source)||o(e.target,[...t,e.source])},t[56]=r,t[57]=o,t[58]=q):q=t[58];let te=q,ne;t[59]!==r||t[60]!==o||t[61]!==g?(ne=()=>{if(!g)return;let e=r.find(e=>`${e.dependencyTaskId}:${e.dependentTaskId}`===g);e&&(_(void 0),o(e.dependentTaskId,r.filter(t=>t.dependentTaskId===e.dependentTaskId&&t.dependencyTaskId!==e.dependencyTaskId).map($r)))},t[59]=r,t[60]=o,t[61]=g,t[62]=ne):ne=t[62];let re=ne,ie;t[63]===a.connectHint?ie=t[64]:(ie=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a.connectHint}),t[63]=a.connectHint,t[64]=ie);let ae=u?`secondary`:`ghost`,oe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>d(Qr),t[65]=oe):oe=t[65];let se=u?a.allTasks:a.blockedChains,ce;t[66]!==u||t[67]!==ae||t[68]!==se?(ce=(0,$.jsx)(Y,{type:`button`,variant:ae,className:`h-8 rounded-lg px-2.5 text-xs`,"aria-pressed":u,onClick:oe,children:se}),t[66]=u,t[67]=ae,t[68]=se,t[69]=ce):ce=t[69];let le;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>l(Zr),t[70]=le):le=t[70];let ue=c?a.hideCompleted:a.showCompleted,de;t[71]!==u||t[72]!==c||t[73]!==ue?(de=(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,"aria-pressed":c,onClick:le,disabled:u,children:ue}),t[71]=u,t[72]=c,t[73]=ue,t[74]=de):de=t[74];let J=N?(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,onClick:ee,children:[(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0}),a.locateTask]}):null,fe;t[75]!==a.removeDependency||t[76]!==re||t[77]!==g?(fe=g?(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs text-danger`,onClick:re,children:a.removeDependency}):null,t[75]=a.removeDependency,t[76]=re,t[77]=g,t[78]=fe):fe=t[78];let pe;t[79]!==ce||t[80]!==de||t[81]!==J||t[82]!==fe?(pe=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[ce,de,J,fe]}),t[79]=ce,t[80]=de,t[81]=J,t[82]=fe,t[83]=pe):pe=t[83];let me;t[84]!==ie||t[85]!==pe?(me=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b border-edge bg-surface-panel px-3 py-2.5`,children:[ie,pe]}),t[84]=ie,t[85]=pe,t[86]=me):me=t[86];let he=C.length>0?(0,$.jsxs)(`div`,{className:b(`grid h-[min(42rem,calc(100vh-14rem))] min-h-[28rem]`,N&&`lg:grid-cols-[minmax(0,1fr)_18rem]`),children:[(0,$.jsxs)(Z,{nodes:L,edges:z,nodeTypes:Jr,nodesDraggable:!1,nodesConnectable:!0,elementsSelectable:!0,onNodeClick:(e,t)=>h(t.id),onEdgeClick:(e,t)=>_(t.id),onConnect:te,onPaneClick:()=>{h(void 0),_(void 0)},onInit:e=>{v.current=e},fitView:!0,minZoom:.25,maxZoom:1.25,panOnScroll:!0,zoomOnDoubleClick:!1,proOptions:{hideAttribution:!0},children:[(0,$.jsx)(Rn,{color:`var(--color-edge)`,gap:22,size:1}),(0,$.jsx)(In,{showInteractive:!1,className:`!border-edge !bg-surface-panel !shadow-surface`})]}),N?(0,$.jsxs)(`aside`,{className:`overflow-y-auto border-t border-edge bg-surface-panel p-4 lg:border-l lg:border-t-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-accent-fg`,children:a.phases[N.phase]}),(0,$.jsx)(`h3`,{className:`mt-2 text-sm font-semibold leading-6 text-fg`,children:N.title}),N.operationalState===`blocked`&&N.blockedBy.length>0?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg bg-violet-500/8 p-3`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-violet-700 dark:text-violet-300`,children:a.blockedBy.replace(`{{count}}`,String(N.blockedBy.length))}),(0,$.jsx)(`ul`,{className:`mt-2 space-y-1 text-xs leading-5 text-fg-muted`,children:N.blockedBy.map(Xr)})]}):null,(0,$.jsxs)(s,{to:p(i,N.id),className:`mt-4 inline-flex items-center gap-1.5 text-xs font-medium text-accent-fg hover:underline`,children:[(0,$.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),a.openTask]})]}):null]}):(0,$.jsx)(`div`,{className:`flex min-h-72 items-center justify-center px-6 text-center text-sm text-fg-muted`,children:a.empty}),ge;return t[87]!==me||t[88]!==he?(ge=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-base/40`,children:[me,he]}),t[87]=me,t[88]=he,t[89]=ge):ge=t[89],ge}function Xr(e){return(0,$.jsx)(`li`,{children:e.title},e.id)}function Zr(e){return!e}function Qr(e){return!e}function $r(e){return e.dependencyTaskId}function ei(e){return e.dependencyTaskId}function ti(e){return[e.id,e]}function ni(e){return e.id}function ri(e){return e.phase!==`closed`}function ii(e){return e instanceof Element?!!e.closest(`a,button,input,select,textarea,[contenteditable="true"],[draggable="true"],[data-board-pan-skip="true"]`):!0}var ai={backlog:q,ready:q,active:ot,review:Ke,closed:l},oi={backlog:`bg-surface-hover text-fg-muted`,ready:`bg-surface-panel text-fg-muted`,active:`bg-accent-soft text-accent-fg`,review:`bg-amber-500/10 text-amber-700 dark:text-amber-300`,closed:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`};function si(e){return e===`running`||e===`queued`?`border-accent/20 bg-accent-soft text-accent-fg`:e===`verifying`?`border-emerald-500/20 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`waiting`?`border-amber-500/20 bg-amber-500/10 text-amber-700 dark:text-amber-300`:e===`failed`?`border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300`:e===`blocked`?`border-violet-500/20 bg-violet-500/10 text-violet-700 dark:text-violet-300`:`border-edge-subtle bg-surface-hover text-fg-muted`}function ci(e){return e===`passed`?`border-emerald-500/20 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`?`border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300`:`border-edge-subtle bg-surface-hover text-fg-muted`}function li(e){let t=(0,Vn.c)(83),{task:n,returnTo:r,copy:i,busy:a,onAction:o,onDragStart:c,onDropBefore:u}=e,d,f,m,h,g,_,v,y,x,S,C,w,T,E,D,O;t[0]!==c||t[1]!==u||t[2]!==r||t[3]!==n?(g=Vr(n),_=g!==`review`&&n.allowedCommands.includes(`request_review`)?`review`:void 0,m=n.phase===`closed`,h=!!(n.dueAt&&n.dueAt<Date.now()&&!m),f=m?l:cn,y=n.priority!==`normal`,v=y||n.operationalState!==`idle`||!!n.latestVerification||n.acceptanceCriteriaCount>0||!!n.dueAt||!!n.nextCheckAt,C=!0,t[20]!==c||t[21]!==n.id?(w=e=>{e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,n.id),c(n.id)},t[20]=c,t[21]=n.id,t[22]=w):w=t[22],t[23]===c?T=t[24]:(T=()=>c(``),t[23]=c,t[24]=T),E=di,t[25]!==u||t[26]!==n.id?(D=e=>{e.preventDefault(),e.stopPropagation(),u(n.id)},t[25]=u,t[26]=n.id,t[27]=D):D=t[27],O=`group relative min-h-max min-w-0 shrink-0 overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface transition-[border-color,box-shadow] hover:border-edge focus-within:border-accent/40`,d=s,t[28]!==r||t[29]!==n.id?(x=p(r,n.id),t[28]=r,t[29]=n.id,t[30]=x):x=t[30],S=b(`block min-w-0 p-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,_?`pr-19`:g&&`pr-11`),t[0]=c,t[1]=u,t[2]=r,t[3]=n,t[4]=d,t[5]=f,t[6]=m,t[7]=h,t[8]=g,t[9]=_,t[10]=v,t[11]=y,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O):(d=t[4],f=t[5],m=t[6],h=t[7],g=t[8],_=t[9],v=t[10],y=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19]);let k=m?`text-emerald-600 dark:text-emerald-400`:`text-fg-subtle`,A;t[31]===k?A=t[32]:(A=b(`mt-0.5 size-4 shrink-0`,k),t[31]=k,t[32]=A);let j;t[33]!==f||t[34]!==A?(j=(0,$.jsx)(f,{className:A,"aria-hidden":!0}),t[33]=f,t[34]=A,t[35]=j):j=t[35];let M=m?`text-fg-subtle`:`text-fg`,N;t[36]===M?N=t[37]:(N=b(`min-w-0 break-words text-sm font-semibold leading-5`,M),t[36]=M,t[37]=N);let P;t[38]!==N||t[39]!==n.title?(P=(0,$.jsx)(`h3`,{className:N,children:n.title}),t[38]=N,t[39]=n.title,t[40]=P):P=t[40];let F;t[41]!==j||t[42]!==P?(F=(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[j,P]}),t[41]=j,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==i||t[45]!==n.attention||t[46]!==n.blockedBy||t[47]!==n.operationalState?(I=n.operationalState===`blocked`&&n.blockedBy.length>0?(0,$.jsxs)(`div`,{className:`ml-6.5 mt-2.5 rounded-lg bg-violet-500/8 px-2.5 py-2 text-xs text-violet-700 dark:text-violet-300`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,$.jsx)(Be,{className:`size-3.5`,"aria-hidden":!0}),i.blockedBy.replace(`{{count}}`,String(n.blockedBy.length))]}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 leading-5 text-fg-muted`,children:n.blockedBy.map(ui).join(`、`)})]}):n.attention[0]?(0,$.jsxs)(`p`,{className:`ml-6.5 mt-2.5 flex items-start gap-1.5 text-xs leading-5 text-fg-muted`,children:[(0,$.jsx)(se,{className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`line-clamp-2`,children:n.attention[0].summary})]}):null,t[44]=i,t[45]=n.attention,t[46]=n.blockedBy,t[47]=n.operationalState,t[48]=I):I=t[48];let L;t[49]!==i||t[50]!==h||t[51]!==v||t[52]!==y||t[53]!==n.acceptanceCriteriaCount||t[54]!==n.dueAt||t[55]!==n.latestVerification||t[56]!==n.nextCheckAt||t[57]!==n.operationalState||t[58]!==n.priority?(L=v?(0,$.jsxs)(`div`,{className:`ml-6.5 mt-2.5 flex flex-wrap items-center gap-1.5 text-[11px]`,children:[y?(0,$.jsx)(`span`,{className:b(`inline-flex min-h-6 items-center rounded-md border px-2 font-medium`,n.priority===`critical`?`border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300`:n.priority===`high`?`border-amber-500/20 bg-amber-500/10 text-amber-700 dark:text-amber-300`:`border-edge-subtle bg-surface-hover text-fg-muted`),children:i.priorityOptions[n.priority]}):null,n.operationalState===`idle`?null:(0,$.jsx)(`span`,{className:b(`inline-flex min-h-6 items-center rounded-md border px-2 font-medium`,si(n.operationalState)),children:i.operationalStates[n.operationalState]}),n.latestVerification?(0,$.jsx)(`span`,{className:b(`inline-flex min-h-6 items-center rounded-md border px-2 font-medium`,ci(n.latestVerification)),children:i.verification[n.latestVerification]}):null,n.acceptanceCriteriaCount>0?(0,$.jsxs)(`span`,{className:`inline-flex min-h-6 items-center gap-1 rounded-md border border-edge-subtle bg-surface-hover px-2 text-fg-muted`,children:[(0,$.jsx)(ot,{className:`size-3`,"aria-hidden":!0}),i.acceptanceCriteria.replace(`{{count}}`,String(n.acceptanceCriteriaCount))]}):null,n.dueAt?(0,$.jsxs)(`span`,{className:b(`inline-flex min-h-6 items-center gap-1 rounded-md border px-2`,h?`border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300`:`border-edge-subtle bg-surface-hover text-fg-muted`),children:[(0,$.jsx)(At,{className:`size-3`,"aria-hidden":!0}),Ee(new Date(n.dueAt))]}):null,n.nextCheckAt?(0,$.jsxs)(`span`,{className:`inline-flex min-h-6 items-center gap-1 rounded-md border border-accent/20 bg-accent-soft px-2 text-accent-fg`,children:[(0,$.jsx)(At,{className:`size-3`,"aria-hidden":!0}),Ee(new Date(n.nextCheckAt))]}):null]}):null,t[49]=i,t[50]=h,t[51]=v,t[52]=y,t[53]=n.acceptanceCriteriaCount,t[54]=n.dueAt,t[55]=n.latestVerification,t[56]=n.nextCheckAt,t[57]=n.operationalState,t[58]=n.priority,t[59]=L):L=t[59];let R;t[60]!==d||t[61]!==x||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==S?(R=(0,$.jsxs)(d,{to:x,className:S,children:[F,I,L]}),t[60]=d,t[61]=x,t[62]=F,t[63]=I,t[64]=L,t[65]=S,t[66]=R):R=t[66];let z;t[67]!==a||t[68]!==i||t[69]!==o||t[70]!==g||t[71]!==_||t[72]!==n?(z=g?(0,$.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 z-10 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100`,children:[_?(0,$.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>o(n,_),className:`inline-flex size-7 items-center justify-center rounded-md bg-surface-hover text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-wait disabled:opacity-50`,"aria-label":i.actions[_],title:i.actions[_],children:(0,$.jsx)(Ke,{className:`size-3.5`,"aria-hidden":!0})}):null,(0,$.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>o(n,g),className:`inline-flex size-7 items-center justify-center rounded-md bg-accent-soft text-accent-fg hover:bg-accent-soft/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-wait disabled:opacity-50`,"aria-label":i.actions[g],title:i.actions[g],children:(0,$.jsx)(pe,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[67]=a,t[68]=i,t[69]=o,t[70]=g,t[71]=_,t[72]=n,t[73]=z):z=t[73];let B;return t[74]!==R||t[75]!==z||t[76]!==C||t[77]!==w||t[78]!==T||t[79]!==E||t[80]!==D||t[81]!==O?(B=(0,$.jsxs)(`article`,{draggable:C,onDragStart:w,onDragEnd:T,onDragOver:E,onDrop:D,className:O,children:[R,z]}),t[74]=R,t[75]=z,t[76]=C,t[77]=w,t[78]=T,t[79]=E,t[80]=D,t[81]=O,t[82]=B):B=t[82],B}function ui(e){return e.title}function di(e){e.preventDefault(),e.stopPropagation()}function fi({tasks:e,dependencyEdges:t,returnTo:n,copy:r,onAction:i,onReorder:a,onUndoMove:o,onDependenciesChange:s,onCreate:c,actionBusyId:l,ref:u}){let d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(`board`),[C,T]=(0,Q.useState)(!1),[D,P]=(0,Q.useState)(()=>crypto.randomUUID()),[F,I]=(0,Q.useState)(``),[L,R]=(0,Q.useState)(`normal`),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)([]),[U,W]=(0,Q.useState)(!1),[G,K]=(0,Q.useState)(null),ee=w(e=>e.language),q=Dt({chat:y(ee).chat}),te=zr(e),ne=e.filter(e=>e.phase!==`closed`),re=(e,t)=>void i(e,t),ie=async(t,n)=>{let r=e.find(e=>e.id===p);if(m(null),!r||r.id===n)return;let o=te[r.phase],s=o.findIndex(e=>e.id===r.id),c=s>=0?o[s+1]?.id??null:null;if(r.phase===t&&c===n)return;let l=Br(r,t);r.phase!==t&&!l||l&&!await i(r,l)||await a(r.id,n)&&v({taskId:r.id,phase:r.phase,beforeTaskId:c,resolution:r.resolution})},ae=async e=>{e.preventDefault();let t=F.trim();if(!(!t||U)){W(!0),K(null);try{let e=z?new Date(`${z}T23:59:59.999`).getTime():void 0;await c({requestId:D,objective:t,priority:L,dependsOnTaskIds:V,attachments:q.wireAttachmentsPayload(),...e===void 0?{}:{dueAt:e}}),I(``),R(`normal`),B(``),H([]),q.clearAttachments(),P(crypto.randomUUID()),T(!1)}catch(e){K(e instanceof Error?e.message:r.createFailed)}finally{W(!1)}}},se=()=>{P(crypto.randomUUID()),I(``),R(`normal`),B(``),H([]),q.clearAttachments(),K(null),T(!0)};(0,Q.useImperativeHandle)(u,()=>({openCreate:se})),(0,Q.useEffect)(()=>{if(!_)return;let e=window.setTimeout(()=>v(null),6e3);return()=>window.clearTimeout(e)},[_]);let ce=(0,Q.useCallback)(e=>{let t=f.current;!t||t.pointerId!==e.pointerId||(f.current=null,g(!1),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),le=(0,Q.useCallback)(e=>{if(e.button!==0||ii(e.target))return;let t=d.current;t&&(f.current={pointerId:e.pointerId,startX:e.clientX,scrollLeft:t.scrollLeft,active:!1},e.currentTarget.setPointerCapture(e.pointerId))},[]),ue=(0,Q.useCallback)(e=>{let t=f.current,n=d.current;if(!t||!n||t.pointerId!==e.pointerId)return;let r=e.clientX-t.startX;!t.active&&Math.abs(r)<5||(t.active||(t.active=!0,g(!0)),e.preventDefault(),n.scrollLeft=t.scrollLeft-r)},[]);return(0,$.jsxs)(`section`,{id:`project-panel-board`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-board`,className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,$.jsxs)(`div`,{className:`mb-4 flex shrink-0 flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:r.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r.description})]}),(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:(0,$.jsxs)(he,{className:`flex rounded-lg border border-edge bg-surface-panel p-0.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":x===`board`,onClick:()=>S(`board`),className:b(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium`,x===`board`?`bg-surface-hover text-fg`:`text-fg-muted hover:text-fg`),children:[(0,$.jsx)(Ge,{className:`size-3.5`,"aria-hidden":!0}),r.views.board]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":x===`graph`,onClick:()=>S(`graph`),className:b(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium`,x===`graph`?`bg-surface-hover text-fg`:`text-fg-muted hover:text-fg`),children:[(0,$.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0}),r.views.graph]})]})})]}),x===`board`?(0,$.jsx)(`div`,{ref:d,className:b(`min-h-0 w-full min-w-0 flex-1 overflow-x-auto overflow-y-hidden overscroll-x-contain pb-2 [scrollbar-width:thin]`,h?`cursor-grabbing select-none`:`cursor-grab`),onPointerDown:le,onPointerMove:ue,onPointerUp:ce,onPointerCancel:ce,onLostPointerCapture:e=>{f.current?.pointerId===e.pointerId&&(f.current=null,g(!1))},children:(0,$.jsx)(`div`,{className:`grid h-full min-h-0 min-w-[103rem] grid-cols-5 gap-3`,children:Rr.map(t=>{let i=ai[t],a=te[t];return(0,$.jsxs)(`section`,{onDragOver:n=>{let r=e.find(e=>e.id===p);r&&(r.phase===t||Br(r,t))&&n.preventDefault()},onDrop:e=>{e.preventDefault(),ie(t,null)},className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-inset/70 p-2.5`,children:[(0,$.jsxs)(`header`,{className:`mb-2.5 flex shrink-0 items-center gap-2 px-0.5`,children:[(0,$.jsxs)(`div`,{className:b(`flex items-center gap-1.5 rounded-md px-2 py-1`,oi[t]),children:[(0,$.jsx)(i,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(`h3`,{className:`text-sm font-semibold`,children:r.phases[t]})]}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:a.length})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-y-contain pr-1 [scrollbar-gutter:stable] [scrollbar-width:thin]`,children:(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map(e=>(0,$.jsx)(li,{task:e,returnTo:n,copy:r,busy:l===e.id,onAction:re,onDragStart:m,onDropBefore:e=>void ie(t,e)},e.id))})})]},t)})})}):(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,$.jsx)(Yr,{tasks:e,dependencyEdges:t,returnTo:n,copy:{...r.graph,phases:r.phases},onDependenciesChange:s})}),(0,$.jsx)(N,{open:C,onOpenChange:e=>{U||T(e)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(40rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:r.createTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r.createDescription})]}),(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>void ae(e),children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,$.jsx)(`label`,{htmlFor:`project-task-objective`,className:`font-medium text-fg-muted`,children:r.objective}),(0,$.jsxs)(`div`,{className:b(`overflow-hidden rounded-lg border border-edge bg-surface-base transition-colors focus-within:border-accent`,q.isDragging&&`border-accent bg-accent-soft/30`),onDragOver:e=>{e.preventDefault(),U||q.setIsDragging(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||q.setIsDragging(!1)},onDrop:e=>{e.preventDefault(),q.setIsDragging(!1),U||q.processFiles(Array.from(e.dataTransfer.files))},children:[(0,$.jsx)(`textarea`,{id:`project-task-objective`,autoFocus:!0,className:`min-h-28 w-full resize-y bg-transparent px-3 py-3 text-sm leading-6 text-fg outline-none placeholder:text-fg-subtle`,value:F,onChange:e=>{I(e.target.value),K(null)},placeholder:r.objectivePlaceholder,maxLength:12e3,disabled:U}),(0,$.jsx)(St,{attachments:q.attachments,topPadded:!1,onRemove:e=>{U||q.removeAttachment(e)}}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-t border-edge-subtle px-2.5 py-2`,children:[(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:U,onClick:()=>q.fileInputRef.current?.click(),children:[(0,$.jsx)(Ye,{className:`size-3.5`,"aria-hidden":!0}),r.addFiles]}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:r.attachmentsDescription}),(0,$.jsx)(`input`,{ref:q.fileInputRef,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{q.processFiles(Array.from(e.target.files??[])),e.currentTarget.value=``}})]})]})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:r.priority}),(0,$.jsx)(oe,{value:L,onChange:e=>R(e.target.value),disabled:U,children:[`low`,`normal`,`high`,`critical`].map(e=>(0,$.jsx)(ze,{value:e,children:r.priorityOptions[e]},e))})]}),(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[r.dueDate,` `,(0,$.jsx)(`span`,{className:`font-normal text-fg-subtle`,children:r.optional})]}),(0,$.jsx)(Tn,{className:`min-h-10 bg-surface-base`,value:z,onChange:B,disabled:U,ariaLabel:r.dueDate})]})]}),(0,$.jsxs)(`fieldset`,{className:`grid gap-2`,children:[(0,$.jsxs)(`legend`,{className:`text-sm font-medium text-fg-muted`,children:[r.dependencies,` `,(0,$.jsx)(`span`,{className:`font-normal text-fg-subtle`,children:r.optional})]}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:r.dependenciesDescription}),(0,$.jsx)(Bn,{candidates:ne,selectedIds:V,disabled:U,onChange:H,labels:{link:r.linkDependencies,linked:r.linkedDependencies,searchPlaceholder:r.dependencySearchPlaceholder,noMatches:r.noDependencyMatches,noCandidates:r.noDependencyCandidates,remove:r.removeDependency}})]}),G?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:G}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,disabled:U,children:r.cancel})}),(0,$.jsx)(Y,{type:`submit`,variant:`primary`,className:`rounded-lg`,disabled:U||!F.trim(),children:U?r.creating:ee===`zh`?`保存待安排任务`:`Save for later`})]})]})]})]})}),_?(0,$.jsxs)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 z-50 flex -translate-x-1/2 items-center gap-4 rounded-lg border border-edge bg-surface-panel px-4 py-3 text-sm text-fg shadow-float`,children:[(0,$.jsx)(`span`,{children:r.moved}),(0,$.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:()=>{let e=_;v(null),o(e.taskId,e.phase,e.beforeTaskId,e.resolution).then(t=>{t||v(e)})},children:r.undo})]}):null]})}var pi=new Set([{id:`overview`,icon:ee},{id:`tasks`,icon:gt},{id:`automations`,icon:je},{id:`files`,icon:$e},{id:`notes`,icon:tt},{id:`skills`,icon:on},{id:`sessions`,icon:Zt},{id:`progress`,icon:ue},{id:`settings`,icon:ut}].map(e=>e.id)),mi=`xopc.projectFiles.panelWidthPx`,hi=320,gi=220,_i=560;function vi(e,t){return e.name!==t.name||e.description!==(t.description??``)||e.status!==t.status||e.defaultAgentId!==(t.defaultAgentId??``)||e.executionMode!==t.executionMode||e.brief!==(t.brief??``)||e.instructions!==(t.instructions??``)}function yi(e){return Math.min(_i,Math.max(gi,Math.round(e)))}function bi(){try{let e=window.localStorage.getItem(mi);if(e==null)return hi;let t=Number.parseInt(e,10);return Number.isFinite(t)?yi(t):hi}catch{return hi}}function xi(e){try{window.localStorage.setItem(mi,String(yi(e)))}catch{}}function Si(e){return!!(e&&pi.has(e))}function Ci(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function wi(e,t=``){if(!e)return t;let n=new Date(e);return Number.isNaN(n.getTime())?String(e):Ee(n)}function Ti(e){return e===`active`?`bg-accent-soft text-accent-fg`:e===`done`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`paused`?`bg-amber-500/10 text-amber-700 dark:text-amber-300`:e===`archived`?`bg-surface-inset text-fg-subtle`:`bg-surface-hover text-fg-muted`}function Ei(e){let t=(0,Vn.c)(8),{label:n,hint:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`span`,{className:`text-xs leading-5 text-fg-subtle`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Di(e=!1){return b(`w-full rounded-md border border-edge bg-surface-base px-3 text-sm text-fg outline-none focus:border-accent`,e?`min-h-24 py-2 leading-5`:`min-h-10`)}function Oi(e){let t=(0,Vn.c)(10),{label:n,value:r,mono:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`font-mono text-xs`,c;t[2]===s?c=t[3]:(c=b(`mt-1 min-w-0 truncate text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,$.jsx)(`div`,{className:c,title:r,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u=(0,$.jsxs)(`div`,{className:`min-w-0 rounded-md bg-surface-base px-3 py-2`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function ki(e){return[e.name,e.slug,e.workspaceRoot,e.description,e.brief].filter(Boolean).join(` `).toLowerCase()}function Ai(e){let t=e.lastActiveAt??e.updatedAt??e.createdAt,n=t?new Date(t).getTime():0;return Number.isFinite(n)?n:0}function ji(e){return e.trim().replace(/[\\/]+$/,``).split(/[\\/]/).filter(Boolean).pop()??``}function Mi(e){let t=e?.body;return t?.code===`workspace_root_missing`&&t.workspaceRoot?t.workspaceRoot:null}function Ni(e){let t=e.actor;return t.name?t.name:t.agentId?t.agentId:t.id?t.id:t.conversationId?t.conversationId:t.kind}function Pi(e){return e.primaryObject.title?.trim()||e.primaryObject.id}function Fi(e){let t=e.source;return t.toolCallId?`${t.kind} · ${t.toolCallId}`:t.runId?`${t.kind} · ${t.runId}`:t.requestId?`${t.kind} · ${t.requestId}`:t.kind}function Ii(e){let t=e.sourceChannel?.trim();return t?Li(t):``}function Li(e){let t=e.trim().toLowerCase();return t?t===`tui`?`TUI`:t===`acp`?`ACP`:t===`webchat`?`Webchat`:t:``}function Ri(e){let t=e.payload.changes;if(Array.isArray(t)&&t.length)return t.filter(e=>typeof e==`string`).join(`, `);let n=e.payload.contentPreview;if(typeof n==`string`&&n.trim())return n.trim();let r=e.payload.title??e.payload.name;return typeof r==`string`&&r.trim()?r.trim():``}function zi(e){return e.map(e=>({fileId:e.fileId,name:e.name,path:e.path,isDirectory:e.type===`directory`,children:e.type===`directory`?[]:void 0}))}function Bi(e,t,n){return e.map(e=>e.path===t?{...e,children:n}:e.isDirectory&&e.children?.length?{...e,children:Bi(e.children,t,n)}:e)}function Vi({currentProject:e,pm:t,projectsText:n,wd:r}){let a=i(),[o,s]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)([e]),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(`new`),[C,w]=(0,Q.useState)(``),[T,D]=(0,Q.useState)(``),[P,F]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(!0),[R,z]=(0,Q.useState)(null),[B,V]=(0,Q.useState)(null),H=(0,Q.useCallback)(async()=>{m(!0),g(null);try{let t=await He({limit:100});u(n=>{let r=new Map;r.set(e.id,e);for(let e of n)r.set(e.id,e);for(let e of t.items)r.set(e.id,e);return Array.from(r.values())})}catch(e){g(e instanceof Error?e.message:String(e))}finally{m(!1)}},[e]);(0,Q.useEffect)(()=>{u(t=>[e,...t.filter(t=>t.id!==e.id)])},[e]),(0,Q.useEffect)(()=>{o&&H()},[H,o]);let U=(0,Q.useMemo)(()=>{let t=d.trim().toLowerCase().split(/\s+/).filter(Boolean);return l.filter(t=>t.id!==e.id).filter(e=>{if(t.length===0)return!0;let n=ki(e);return t.every(e=>n.includes(e))}).sort((e,t)=>Ai(t)-Ai(e))},[e.id,l,d]),W=e=>t.statuses[e.status]??e.status,G=e=>e.description||e.brief||t.common.defaultWorkspace,ee=e=>{S(e),w(``),D(``),z(null),y(!0),s(!1)},q=(0,Q.useCallback)(async(e={})=>{let t=T.trim(),n=C.trim()||(x===`directory`?ji(t):``);if(n){F(!0),z(null),V(null);try{let r=await Ft({autoUnderstand:I,name:n,...t?{workspaceRoot:t}:{},...e.createWorkspaceRoot?{createWorkspaceRoot:!0}:{}});y(!1),w(``),D(``),L(!0),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:r.id}})),u(e=>[r,...e.filter(e=>e.id!==r.id)]),a(`/projects/${encodeURIComponent(r.id)}`)}catch(e){let t=Mi(e);t?(V(t),y(!1)):z(e instanceof Error?e.message:String(e))}finally{F(!1)}}},[x,C,a,T,I]),ne=(0,Q.useCallback)(e=>{e.preventDefault(),q()},[q]),re=(0,Q.useCallback)(()=>{q({createWorkspaceRoot:!0})},[q]),ie=(0,Q.useCallback)(()=>{V(null),y(!0)},[]),ae=e=>{D(e),x===`directory`&&!C.trim()&&w(ji(e))},oe=(e,t)=>(0,$.jsxs)(`button`,{type:`button`,className:b(`grid w-full grid-cols-[1rem_minmax(0,1fr)_auto] items-center gap-2 rounded-md p-2 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,t&&`bg-accent-soft/55 hover:bg-accent-soft/70`),onClick:()=>{s(!1),t||a(`/projects/${encodeURIComponent(e.id)}`)},children:[(0,$.jsx)(c,{className:b(`size-4 text-accent-fg`,!t&&`invisible`),"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:G(e)})]}),(0,$.jsx)(`span`,{className:b(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,Ti(e.status)),children:W(e)})]},e.id);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(xe,{open:o,onOpenChange:s,children:[(0,$.jsx)(Je,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`group flex max-w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":t.projectSwitcher.switchProject,title:t.projectSwitcher.switchProject,children:[(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:b(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,Ti(e.status)),children:W(e)})]}),(0,$.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:G(e)})]}),(0,$.jsx)(Nt,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-data-[state=open]:rotate-180`,"aria-hidden":!0})]})}),(0,$.jsx)(Qe,{children:(0,$.jsxs)(K,{side:`bottom`,align:`start`,sideOffset:6,className:`z-[70] w-[min(26rem,calc(100vw-2rem))] overflow-hidden rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover outline-none`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`label`,{className:`relative block`,children:[(0,$.jsx)(mn,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`search`,className:`h-9 w-full rounded-lg border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:d,onChange:e=>f(e.target.value),placeholder:t.projectSwitcher.searchPlaceholder,"aria-label":t.projectSwitcher.searchPlaceholder})]}),(0,$.jsxs)(`div`,{className:`mt-1 max-h-[min(54vh,24rem)] overflow-y-auto pr-0.5 [scrollbar-gutter:stable]`,children:[(0,$.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.projectSwitcher.current}),oe(e,!0),(0,$.jsx)(`div`,{className:`px-2 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.projectSwitcher.recent}),h?(0,$.jsx)(`div`,{className:`p-2 text-xs text-red-600 dark:text-red-400`,children:h}):null,p&&U.length===0?(0,$.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-fg-muted`,children:t.projectSwitcher.loading}):null,!p&&U.length===0?(0,$.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-fg-muted`,children:t.projectSwitcher.noMatches}):null,U.map(e=>oe(e,!1))]}),(0,$.jsxs)(`div`,{className:`mt-1 border-t border-edge-subtle pt-1`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,onClick:()=>ee(`new`),children:[(0,$.jsx)(_,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.projectSwitcher.newProject})]}),(0,$.jsxs)(`button`,{type:`button`,className:`flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,onClick:()=>ee(`directory`),children:[(0,$.jsx)($e,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.projectSwitcher.openDirectory})]}),(0,$.jsxs)(`button`,{type:`button`,className:`flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,onClick:()=>{s(!1),a(`/projects`)},children:[(0,$.jsx)(ut,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.projectSwitcher.manageProjects})]})]})]})})]}),(0,$.jsx)(N,{open:v,onOpenChange:e=>!P&&y(e),children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(32rem,calc(100vh-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-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:x===`directory`?t.projectSwitcher.createFromDirectoryTitle:n.createTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm text-fg-muted`,children:x===`directory`?t.projectSwitcher.createFromDirectoryDescription:n.createDescription})]}),(0,$.jsxs)(`form`,{onSubmit:ne,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[R?(0,$.jsx)(`div`,{className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:R}):null,(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.projectName}),(0,$.jsx)(`input`,{className:`min-h-10 rounded-md border border-edge bg-surface-base px-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:C,onChange:e=>w(e.target.value),placeholder:`xopc`})]}),(0,$.jsxs)(`div`,{className:`grid gap-1.5 text-sm`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.workspaceRoot}),(0,$.jsx)(xn,{value:T,onChange:ae,disabled:P,wd:r,placeholder:n.workspacePlaceholder,inputClassName:`min-h-10 rounded-md border border-edge bg-surface-base px-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`}),(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.workspaceHint})]}),(0,$.jsx)(te,{checked:I,onChange:L,disabled:P})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,disabled:P,children:n.cancel})}),(0,$.jsxs)(Y,{type:`submit`,variant:`primary`,className:`rounded-lg`,disabled:P||!(C.trim()||x===`directory`&&ji(T)),children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),n.create]})]})]})]})]})}),(0,$.jsx)(N,{open:!!B,onOpenChange:e=>{e||V(null)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[100] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[110] flex w-[min(30rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:n.workspaceMissingTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:B?Ci(n.workspaceMissingDescription,{workspace:B}):null})]}),B?(0,$.jsx)(`div`,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg bg-surface-inset px-3 py-2 text-sm text-fg-muted`,children:[(0,$.jsx)($e,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:B})]})}):null,(0,$.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,onClick:ie,disabled:P,children:n.workspaceMissingBack}),(0,$.jsxs)(Y,{type:`button`,variant:`primary`,className:`rounded-lg`,onClick:re,disabled:P,children:[(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),n.workspaceMissingCreate]})]})]})]})})]})}function Hi(){let{projectId:e=``,tabId:t,noteId:n}=o(),r=i(),[c]=a(),l=w(e=>e.language),d=y(l),f=d.chat.workingDirectory,x=d.projectDetailPage,S=d.projectsPage,C=Kt(e=>e.setPageHeader),T=Kt(e=>e.clearPageHeader),[D,L]=(0,Q.useState)(null),V=(0,Q.useRef)(D);(0,Q.useLayoutEffect)(()=>{V.current=D},[D]);let[G,K]=(0,Q.useState)(null),[q,te]=(0,Q.useState)([]),[ie,ae]=(0,Q.useState)(``),[ce,J]=(0,Q.useState)([]),[pe,me]=(0,Q.useState)(0),[he,ge]=(0,Q.useState)(!1),[_e,ve]=(0,Q.useState)(!1),[be,xe]=(0,Q.useState)(!1),[Se,we]=(0,Q.useState)([]),[Ee,De]=(0,Q.useState)(null),ke=(0,Q.useRef)(new Set),[Ae,Fe]=(0,Q.useState)(null),[Le,Be]=(0,Q.useState)(null),[He,Ue]=(0,Q.useState)(null),[Ge,Ke]=(0,Q.useState)(bi),[Je,Ye]=(0,Q.useState)(!1),[Ze,Qe]=(0,Q.useState)(!1),[rt,it]=(0,Q.useState)(``),[at,ot]=(0,Q.useState)([]),[st,ct]=(0,Q.useState)(!1),[lt,ft]=(0,Q.useState)(null),[pt,ht]=(0,Q.useState)(!1),[St,wt]=(0,Q.useState)(null),[Tt,Et]=(0,Q.useState)([]),[Dt,kt]=(0,Q.useState)(``),[At,Nt]=(0,Q.useState)(!0),[Ft,It]=(0,Q.useState)(!1),[Lt,zt]=(0,Q.useState)(!1),[Vt,Ht]=(0,Q.useState)(null),[Ut,Wt]=(0,Q.useState)(!1),[qt,$t]=(0,Q.useState)(`fixed`),[tn,rn]=(0,Q.useState)(``),[sn,cn]=(0,Q.useState)(null),[ln,un]=(0,Q.useState)(!1),[gn,vn]=(0,Q.useState)(!1),[Sn,Cn]=(0,Q.useState)(!1),[wn,Tn]=(0,Q.useState)(null),Dn=(0,Q.useRef)(null),On=(0,Q.useRef)(!1),[kn,X]=(0,Q.useState)(null),[jn,Mn]=(0,Q.useState)({title:``,reason:``}),[Nn,Pn]=(0,Q.useState)({name:``,description:``,status:`active`,defaultAgentId:``,executionMode:`local_checkout`,workspaceRoot:``,brief:``,instructions:``}),Fn=(0,Q.useRef)(Nn),In=`overview`,Z=n?`notes`:Si(t)?t:In,Ln=(0,Q.useMemo)(()=>g(c.get(`returnTo`),`/projects`,[`/chat`]),[c]),Rn=(0,Q.useCallback)(t=>{if(!e)return`/projects`;let n=`/projects/${encodeURIComponent(e)}/${t}`;return Ln===`/projects`?n:m(n,Ln)},[Ln,e]),zn=(0,Q.useCallback)(t=>{e&&r(Rn(t))},[r,e,Rn]),Bn=(0,Q.useCallback)(()=>{if(Z===`tasks`&&Dn.current){Dn.current.openCreate();return}On.current=!0,zn(`tasks`)},[zn,Z]);(0,Q.useEffect)(()=>{Z!==`tasks`||!On.current||(On.current=!1,Dn.current?.openCreate())},[Z]);let Vn=(0,Q.useCallback)(t=>{e&&r(Rn(t),{replace:!0})},[r,e,Rn]),Hn=(0,Q.useCallback)(e=>t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||Vn(e)},[Vn]),Un=(0,Q.useCallback)(e=>e.startsWith(`/chat/`)?`sessions`:e.startsWith(`/notes`)?`notes`:Z,[Z]);(0,Q.useEffect)(()=>{!e||!t||Si(t)||r(Rn(In),{replace:!0})},[In,r,e,Rn,t]),(0,Q.useEffect)(()=>{if(!e)return;let t=!1;return Nt(!0),X(null),Promise.all([Pe(e),de(e),Me(e),z().catch(()=>null),Ce(e).catch(()=>null)]).then(([e,n,r,i,a])=>{if(t)return;L(e),K(n),te(r),De(a),Et(i?.agents??[]),kt(e.defaultAgentId??``);let o=Mr(e);Fn.current=o,Pn(o)}).catch(e=>{t||(De(null),X(e instanceof Error?e.message:String(e)))}).finally(()=>{t||Nt(!1)}),()=>{t=!0}},[e]);let Wn=(0,Q.useCallback)(async()=>{e&&K(await de(e))},[e]);(0,Q.useEffect)(()=>{if(At)return;let t=!0,n=0,r=r=>{let i=r.detail?.id;if(!e||i&&i!==e)return;let a=++n;Promise.all([Pe(e),de(e)]).then(([e,r])=>{if(!t||n!==a)return;let i=V.current;if(!(i?.id===e.id&&i.version>e.version)){if(i?.id===e.id){let t=Nr(Fn.current,i,e);Fn.current=t,Pn(t)}V.current=e,L(e),K(r)}}).catch(e=>{!t||n!==a||e instanceof Error&&`status`in e&&e.status===404&&(L(null),K(null),X(e.message))})};return window.addEventListener(`project-resource-changed`,r),r(new Event(`project-resource-changed`)),()=>{t=!1,window.removeEventListener(`project-resource-changed`,r)}},[e,At]),(0,Q.useEffect)(()=>{let t,n=n=>{let r=F.safeParse(n.detail);!r.success||r.data.projectId!==e||(window.clearTimeout(t),t=window.setTimeout(()=>void Wn(),120))},r=n=>{let r=P.safeParse(n.detail);!r.success||r.data.projectId!==e||(window.clearTimeout(t),t=window.setTimeout(()=>void Wn(),120))};return window.addEventListener(`task-changed-v2`,n),window.addEventListener(`task-deleted-v1`,r),()=>{window.clearTimeout(t),window.removeEventListener(`task-changed-v2`,n),window.removeEventListener(`task-deleted-v1`,r)}},[e,Wn]);let Gn=(0,Q.useCallback)(async(e,t)=>{Tn(e.id),X(null);try{let n=await hn(e.id),r=t.startsWith(`move_`)?{type:`move`,phase:t.slice(5)}:t.startsWith(`reopen_`)?{type:`reopen`,phase:t.slice(7)}:t===`ready`?{type:`mark_ready`}:t===`run`?{type:`start`,executor:{kind:`agent`,agentId:n.task.delegateAgentId??(await Ct(e.id)).agentId}}:t===`pause`?{type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}:t===`review`?{type:`request_review`}:t===`complete`?{type:`close`,resolution:`done`}:t===`reopen`?{type:`reopen`,phase:`ready`}:{type:`resolve_wait`,waitId:n.waits[0]?.id??``};if(r.type===`resolve_wait`&&!r.waitId)throw Error(`No active wait to resolve`);return await Xt(e.id,r,n.task.version,void 0,`board`),await Wn(),!0}catch(e){return await Wn().catch(()=>void 0),X(e instanceof Error?e.message:x.board.actionFailed),!1}finally{Tn(null)}},[G,x.board.actionFailed,Wn]),Kn=(0,Q.useCallback)(async t=>{e&&(X(null),await Bt({idempotencyKey:t.requestId,title:t.objective,projectId:e,priority:t.priority,dueAt:t.dueAt,locale:l,contract:{objective:t.objective,expectedOutputs:[],acceptanceCriteria:[],constraints:[],approvalRequired:[],assumptions:[],risks:[],acceptancePolicy:`manual`,outputDestinations:[]},dependencies:t.dependsOnTaskIds,context:t.attachments.map((e,t)=>({targetKind:`file`,targetId:e.uri??e.name??`attachment-${t+1}`,role:`input`,title:e.name,pinned:!0,retrievalPolicy:{},metadata:{mimeType:e.mimeType,size:e.size,data:e.data}})),authorityGrants:[],activation:{mode:`capture`,phase:`backlog`}}),await Wn())},[l,e,Wn]),qn=(0,Q.useCallback)(async(e,t)=>{Tn(e),X(null);try{return await Pt(e,t,(await hn(e)).task.version),await Wn(),!0}catch(e){return await Wn().catch(()=>void 0),X(e instanceof Error?e.message:x.board.actionFailed),!1}finally{Tn(null)}},[x.board.actionFailed,Wn]),Jn=(0,Q.useCallback)(async(e,t,n,r)=>{Tn(e),X(null);try{let i=await hn(e);return i.task.phase!==t&&(i=await Xt(e,{type:`move`,phase:t,...t===`closed`&&r?{resolution:r}:{}},i.task.version,void 0,`undo`)),await Pt(e,n,i.task.version),await Wn(),!0}catch(e){return await Wn().catch(()=>void 0),X(e instanceof Error?e.message:x.board.actionFailed),!1}finally{Tn(null)}},[x.board.actionFailed,Wn]),Yn=(0,Q.useCallback)(async(e,t)=>{Tn(e),X(null);try{await H(e,t,(await hn(e)).task.version),await Wn()}catch(e){await Wn().catch(()=>void 0),X(e instanceof Error?e.message:x.board.actionFailed)}finally{Tn(null)}},[x.board.actionFailed,Wn]),Xn=(0,Q.useCallback)(async()=>{if(D){ge(!0),X(null);try{let e=await Ie(D.id,{includeRelated:_e,limit:100});J(e.items),me(e.total)}catch(e){X(e instanceof Error?e.message:String(e))}finally{ge(!1)}}},[D,_e]);(0,Q.useEffect)(()=>{Z===`progress`&&Xn()},[Xn,Z]);let Zn=(0,Q.useCallback)(async()=>{if(!D?.effectiveWorkspaceRoot?.trim()){we([]),ke.current.clear(),wt(null);return}ht(!0),wt(null),ke.current.clear();try{we(zi((await Ve(D.id,``)).entries)),ke.current.add(``)}catch(e){we([]),ke.current.clear(),wt(e instanceof Error?e.message:String(e))}finally{ht(!1)}},[D]),Qn=(0,Q.useCallback)(async e=>{if(!(!D?.effectiveWorkspaceRoot?.trim()||ke.current.has(e))){ke.current.add(e),wt(null);try{let t=await Ve(D.id,e);we(n=>Bi(n,e,zi(t.entries)))}catch(t){ke.current.delete(e),wt(t instanceof Error?t.message:String(t))}}},[D]),$n=(0,Q.useCallback)(async e=>{if(!D?.effectiveWorkspaceRoot?.trim())return;let t=zi((await Ve(D.id,e)).entries);we(e?n=>Bi(n,e,t):t),ke.current.add(e)},[D]);(0,Q.useEffect)(()=>{Z===`files`&&Zn()},[Zn,Z]);let er=rt.trim();(0,Q.useEffect)(()=>{if(Z!==`files`||!D||!Ze||!er){ot([]),ct(!1),ft(null);return}let e=!1;ct(!0),ft(null),ot([]);let t=window.setTimeout(()=>{ye(D.id,er,50).then(t=>{e||ot(t)}).catch(t=>{e||ft(t instanceof Error?t.message:String(t))}).finally(()=>{e||ct(!1)})},180);return()=>{e=!0,window.clearTimeout(t)}},[er,D,Ze,Z]);let tr=(0,Q.useCallback)(async()=>{if(!D)return;let[e,t]=await Promise.all([Pe(D.id),de(D.id)]);K(t),L(e)},[D]),nr=(0,Q.useCallback)(async e=>{if(e.preventDefault(),!(!D||!jn.title.trim())){vn(!0),X(null);try{await U(D.id,{title:jn.title.trim(),reason:jn.reason.trim()||void 0}),Mn({title:``,reason:``}),Cn(!1),await tr()}catch(e){X(e instanceof Error?e.message:String(e))}finally{vn(!1)}}},[jn.reason,jn.title,D,tr]),rr=(0,Q.useMemo)(()=>(0,$.jsx)(s,{to:Ln,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":Ln===`/projects`?x.backToProjects:d.sidebar.back,children:(0,$.jsx)(Oe,{className:`size-4`,"aria-hidden":!0})}),[Ln,d.sidebar.back,x.backToProjects]),ir=(0,Q.useMemo)(()=>D?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(An,{resource:{kind:`project`,id:D.id,revision:String(D.version)},disabled:Ft||vi(Nn,D)}),(0,$.jsx)(yr,{projectId:D.id},D.id),(0,$.jsxs)(Y,{variant:`secondary`,className:`h-9 rounded-lg`,onClick:Bn,children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),x.board.create]}),(0,$.jsx)(Y,{asChild:!0,variant:`primary`,className:`h-9 rounded-lg`,children:(0,$.jsxs)(s,{to:pn(D.id),state:{forceNewChat:!0,agentId:D.defaultAgentId},onClick:Hn(`sessions`),children:[(0,$.jsx)(Zt,{className:`size-4`,"aria-hidden":!0}),x.common.newChat]})})]}):null,[Bn,Hn,x.board.create,x.common.newChat,D,Ft,Nn]);(0,Q.useLayoutEffect)(()=>(C({startExtra:rr,main:D?(0,$.jsx)(Vi,{currentProject:D,pm:x,projectsText:S,wd:f}):(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:x.fallbackTitle}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:x.fallbackContext})]}),end:ir}),()=>T()),[T,ir,rr,x,D,S,C,f]);function ar(e){L(t=>t?{...t,...e}:null),kt(e.defaultAgentId??``),Ce(e.id).then(De).catch(()=>De(null)),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}async function or(e=Fn.current){if(!(!D||!vi(e,D))){X(null),Ht(null);try{let t=await et(D.id,{name:e.name.trim(),status:e.status,description:e.description,defaultAgentId:e.defaultAgentId,executionMode:e.executionMode,brief:e.brief,instructions:e.instructions},D.version);ar(t);let n=Fn.current,r={...n,name:n.name===e.name?t.name:n.name,description:n.description===e.description?t.description??``:n.description,status:n.status===e.status?t.status:n.status,defaultAgentId:n.defaultAgentId===e.defaultAgentId?t.defaultAgentId??``:n.defaultAgentId,executionMode:n.executionMode===e.executionMode?t.executionMode:n.executionMode,brief:n.brief===e.brief?t.brief??``:n.brief,instructions:n.instructions===e.instructions?t.instructions??``:n.instructions};Fn.current=r,Pn(r)}catch(e){let t=Mi(e);throw t?Ht(t):X(e instanceof Error?e.message:String(e)),e}}}function sr(e){e.preventDefault(),Tr.flush()}function cr(e,t=!1){let n={...Fn.current,...e};Fn.current=n,Pn(n),t&&Tr.saveNow(n)}let lr=(0,Q.useCallback)(()=>{if(!D)return;let e=D.workspaceRoot?.trim()??``;$t(e?`fixed`:`follow`),rn(e||D.effectiveWorkspaceRoot||``),Wt(!0)},[D]);async function ur(e={}){if(!D)return;let t=qt===`fixed`?tn.trim():``;if(!(qt===`fixed`&&!t)){It(!0),X(null),Ht(null);try{let n=await et(D.id,{workspaceRoot:t,...e.createWorkspaceRoot?{createWorkspaceRoot:!0}:{}},D.version);ar(n),cr({workspaceRoot:n.workspaceRoot??``}),Wt(!1),Ht(null)}catch(e){let t=Mi(e);t?(Ht(t),Wt(!1)):X(e instanceof Error?e.message:String(e))}finally{It(!1)}}}async function dr(){if(!(!D||sn)){cn(`pin`),X(null);try{ar(D.pinnedAt?await qe(D.id,D.version):await _n(D.id,D.version))}catch(e){X(e instanceof Error?e.message:String(e))}finally{cn(null)}}}async function fr(){if(!(!D||sn)){cn(`archive`),X(null);try{let e=D.status===`archived`?await W(D.id,D.version):await Re(D.id,D.version);ar(e),cr({status:e.status})}catch(e){X(e instanceof Error?e.message:String(e))}finally{cn(null)}}}async function pr(){if(D){un(!0),X(null);try{await jt(D.id,D.version),zt(!1),r(`/projects`)}catch(e){X(e instanceof Error?e.message:String(e))}finally{un(!1)}}}async function mr(){if(!(!D||be)){xe(!0),X(null);try{await Xe(D.id)}catch(e){X(e instanceof Error?e.message:String(e))}finally{xe(!1)}}}let hr=(0,Q.useCallback)(e=>{Fe(e)},[]),gr=(0,Q.useCallback)((e,t)=>{t||Fe(e)},[]),vr=(0,Q.useCallback)(async(e,t,n)=>{let r=D?.id;if(r)switch(e){case`preview`:t.isDirectory||Fe(t.path);break;case`download`:if(t.isDirectory)return;try{let e=nn(t.path);if(Qt(bt(e))!==`text`){let n=await en(t.path,{projectId:r}),i=R(e)??`application/octet-stream`;dt(e,await n.arrayBuffer(),i)}else{let{content:n}=await _t(t.path,{projectId:r});Gt(e,n)}}catch(e){Jt(`warning`,e instanceof Error?e.message:String(e),void 0,{duration:4e3})}break;case`copyPath`:try{await I(t.path)&&Jt(`success`,d.workspace.pathCopied,void 0,{duration:2500})}catch{Jt(`warning`,d.clipboard.copyFailed,void 0,{duration:4e3})}break;case`openDefault`:await Mt(()=>window.electronAPI?.shell?.openFileResource?.(t.fileId),d.workspace.openFileFailed);break;case`openWith`:await Mt(()=>window.electronAPI?.shell?.chooseAppAndOpenFileResource?.(t.fileId),d.workspace.openFileFailed);break;case`openWithApp`:if(!n)return;await Mt(()=>window.electronAPI?.shell?.openFileResourceWithApp?.(t.fileId,n),d.workspace.openFileFailed);break;case`revealInFolder`:await Mt(()=>window.electronAPI?.shell?.showFileResourceInFolder?.(t.fileId),d.workspace.revealFileFailed);break;case`trash`:Be(t);break;case`delete`:t.isDirectory||Ue(t);break;default:break}},[d.clipboard.copyFailed,d.workspace.openFileFailed,d.workspace.pathCopied,d.workspace.revealFileFailed,D?.id]),br=(0,Q.useCallback)(async()=>{let e=Le;if(!e)return;let t=await window.electronAPI?.shell?.trashFileResource?.(e.fileId);if(!t?.ok){Jt(`warning`,t?.error??d.workspace.trashFailed,void 0,{duration:4e3});return}Ae===e.path&&Fe(null),Be(null),await Zn(),Jt(`success`,d.workspace.trashSuccess,void 0,{duration:2500})},[d.workspace.trashFailed,d.workspace.trashSuccess,Le,Ae,Zn]),xr=(0,Q.useCallback)(async(e,t)=>{let n=D?.id;if(n)try{await Promise.all(e.map(e=>Rt(e,t,{projectId:n}))),await $n(t).catch(()=>void 0),Jt(`success`,d.workspace.uploadSuccess.replace(`{{count}}`,String(e.length)),void 0,{duration:2500})}catch(e){await $n(t).catch(()=>void 0),Jt(`warning`,`${d.workspace.uploadFailed}: ${e instanceof Error?e.message:String(e)}`,void 0,{duration:4e3})}},[d.workspace.uploadFailed,d.workspace.uploadSuccess,D?.id,$n]),Sr=(0,Q.useCallback)(async()=>{let e=He;if(e)try{await Ot(e.fileId),Ae===e.path&&Fe(null),Ue(null);let t=e.path.lastIndexOf(`/`);await $n(t<0?``:e.path.slice(0,t)).catch(()=>void 0),Jt(`success`,d.workspace.deleteSuccess,void 0,{duration:2500})}catch(e){Jt(`warning`,`${d.workspace.deleteFailed}: ${e instanceof Error?e.message:String(e)}`,void 0,{duration:4e3})}},[d.workspace.deleteFailed,d.workspace.deleteSuccess,He,Ae,$n]),Cr=(0,Q.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;e.preventDefault();let t=e.currentTarget,n=t.closest(`[data-project-files-grid]`);if(!n)return;t.setPointerCapture(e.pointerId),Ye(!0);let r=e.clientX,i=Ge,a=e.pointerId,o=0,s=i,c=i,l=()=>{o=0,c=s,n.style.setProperty(`--project-files-panel-width`,`${c}px`)},u=e=>{s=yi(i+(e.clientX-r)),o===0&&(o=window.requestAnimationFrame(l))},d=()=>{o!==0&&(window.cancelAnimationFrame(o),l());try{t.releasePointerCapture(a)}catch{}Ye(!1),Ke(c),xi(c),window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d)};window.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},[Ge]);(0,Q.useEffect)(()=>{Z!==`files`&&Fe(null)},[e,Z]);let wr=!!(D&&vi(Nn,D)),Tr=bn({value:D?Nn:null,dirty:wr,onSave:or,validate:e=>e.name.trim()?null:x.settings.nameRequired});if(At)return(0,$.jsx)(`main`,{className:`w-full flex-1 p-3 text-sm text-fg-muted sm:px-5 sm:py-4 xl:px-6`,children:x.loading});if(!D)return(0,$.jsxs)(`main`,{className:`w-full flex-1 p-3 sm:px-5 sm:py-4 xl:px-6`,children:[(0,$.jsxs)(s,{to:Ln,className:`inline-flex items-center gap-2 text-sm text-accent-fg hover:underline`,children:[(0,$.jsx)(Oe,{className:`size-4`,"aria-hidden":!0}),Ln===`/projects`?x.backToProjects:d.sidebar.back]}),(0,$.jsx)(`p`,{className:`mt-6 rounded-lg bg-surface-panel p-4 shadow-surface text-sm text-fg-muted`,children:kn||x.notFound})]});let Er=q.slice(0,3),Or=G?.blockers??[],kr=Lr(G?.tasks??[]),Ar=G?.tasks.filter(e=>[`queued`,`running`,`waiting`,`verifying`].includes(e.operationalState)).length??0,jr=e=>x.statuses[e]??e,Pr=e=>Ci(x.common.messages,{count:e}),Fr=ie.trim().toLowerCase(),Ir=Fr?q.filter(e=>{let t=wi(e.updatedAt),n=e.routing?.agentId||e.agentId||x.common.agent,r=e.name?.trim()||x.sessions.fallbackTitle,i=Pr(e.messageCount??0),a=Ii(e);return[r,e.key,n,a,t,i].filter(Boolean).join(` `).toLowerCase().includes(Fr)}):q,Rr=q.length>0&&Ir.length===0,zr=Tt.find(e=>e.id===D.defaultAgentId)?.name||D.defaultAgentId||x.settings.globalDefaultAgent,Br=Tt.find(e=>e.id===Nn.defaultAgentId),Vr=D.workspaceRoot?.trim()||``,Hr=D.status===`archived`,Ur=!!D.pinnedAt,Wr=!Vr,Gr=Vr||Br?.workspace||D.effectiveWorkspaceRoot||x.common.defaultWorkspace,Kr=qt===`fixed`?tn.trim()||x.settings.workspacePlaceholder:Br?.workspace||D.effectiveWorkspaceRoot||x.common.defaultWorkspace,qr=(qt===`fixed`?tn.trim():``)!==Vr&&(qt===`follow`||!!tn.trim()),Jr=[{id:`overview`,icon:ee,label:x.tabs.overview},{id:`tasks`,icon:gt,label:x.tabs.tasks},{id:`automations`,icon:je,label:x.tabs.automations},{id:`files`,icon:$e,label:x.tabs.files},{id:`notes`,icon:tt,label:x.tabs.notes},{id:`skills`,icon:on,label:x.tabs.skills},{id:`sessions`,icon:Zt,label:x.tabs.sessions},{id:`progress`,icon:ue,label:x.tabs.progress}];async function Yr(){if(!Gr)return;let e=await I(Gr);Jt(e?`success`:`warning`,e?d.workspace.pathCopied:d.clipboard.copyFailed,void 0,{duration:e?2500:4e3})}function Xr(){Ht(null),Wt(!0)}return(0,$.jsxs)(`main`,{className:`flex h-full min-h-0 w-full flex-1 flex-col overflow-hidden p-3 sm:px-5 sm:py-4 xl:px-6`,children:[(0,$.jsx)(`div`,{className:`flex shrink-0 items-start justify-between gap-3`,children:(0,$.jsx)(mt,{items:[...Jr,{id:`settings`,icon:ut,label:x.tabs.settings,suffix:wr?(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`,"aria-label":x.settings.unsavedChanges}):void 0}],activeTab:Z,onChange:zn,ariaLabel:x.navAria,tabIdPrefix:`project-primary-tab`,className:`min-w-0 flex-1`})}),kn?(0,$.jsx)(`p`,{className:`mt-3 shrink-0 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:kn}):null,(0,$.jsxs)(`div`,{className:b(`mt-3 min-h-0 flex-1`,Z===`overview`?`overflow-y-auto pr-1 [scrollbar-gutter:stable] xl:overflow-hidden xl:pr-0`:Z===`tasks`?`overflow-hidden`:`overflow-y-auto pr-1 [scrollbar-gutter:stable]`),children:[Z===`overview`?(0,$.jsxs)(`section`,{id:`project-panel-overview`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-overview`,className:`grid min-h-full gap-4 xl:h-full xl:min-h-0 xl:grid-cols-[minmax(0,1fr)_20rem] xl:overflow-hidden`,children:[(0,$.jsxs)(`div`,{className:`grid min-w-0 content-start gap-4 xl:min-h-0 xl:overflow-y-auto xl:pr-1 xl:[scrollbar-gutter:stable]`,children:[(0,$.jsx)(dn,{projectId:D.id},D.id),(0,$.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface`,children:[(0,$.jsx)(`div`,{className:`p-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.directionTitle}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:Ci(x.overview.activitySummary,{moving:Ar,attention:Or.length})})]}),(0,$.jsx)(`p`,{className:`mt-2 max-w-3xl text-base font-medium leading-7 text-fg`,children:D.outcome||D.description||D.brief||x.overview.directionFallback}),G?.digest.recommendedAction?(0,$.jsx)(`p`,{className:`mt-3 max-w-3xl rounded-lg bg-surface-hover px-3 py-2.5 text-sm font-medium leading-6 text-fg`,children:Ci(x.overview.recommendedNext,{action:G.digest.recommendedAction})}):null]}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 shrink-0 rounded-lg px-2 text-xs`,onClick:()=>void mr(),disabled:be,children:[(0,$.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),be?x.overview.savingDigest:x.overview.saveDigest]})]})}),(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-5 py-3.5`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.nextActions}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-fg-muted transition-colors hover:text-fg`,onClick:()=>zn(`tasks`),children:x.common.viewAll})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle border-t border-edge-subtle`,children:kr.length?kr.map(e=>(0,$.jsxs)(s,{to:p(Rn(`overview`),e.id),className:`block px-5 py-3 transition-colors hover:bg-surface-hover`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.title}),(0,$.jsxs)(`span`,{className:b(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e.attention.length?`bg-warning/10 text-warning`:`bg-surface-hover text-fg-muted`),children:[x.board.phases[e.phase],e.operationalState===`idle`?``:` · ${x.board.operationalStates[e.operationalState]}`]})]}),e.attention[0]?(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm leading-5 text-fg-muted`,children:e.attention[0].summary}):null]},e.id)):(0,$.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:x.overview.noNextActions})})]})]}),G?.recentResults.length?(0,$.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel`,children:[(0,$.jsx)(`div`,{className:`border-b border-edge-subtle px-5 py-3.5`,children:(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.recentResults})}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:G.recentResults.slice(0,3).map(({taskId:e,taskTitle:t,receipt:n})=>(0,$.jsxs)(s,{to:p(Rn(`overview`),e),className:`block px-5 py-3 transition-colors hover:bg-surface-hover`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:t}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg-muted`,children:[x.overview.resultStatuses[n.status],` · `,x.board.verification[n.verification.status]]})]}),(0,$.jsx)(`div`,{className:`mt-1 line-clamp-3 text-sm leading-5 text-fg-muted`,children:(0,$.jsx)(h,{content:n.summary,compact:!0})})]},n.runId))})]}):null,D.milestones.length||D.recentUpdates.length?(0,$.jsxs)(`div`,{className:`grid min-w-0 gap-4 md:grid-cols-2`,children:[D.milestones.length?(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-panel`,children:[(0,$.jsx)(`div`,{className:`border-b border-edge-subtle px-5 py-3.5`,children:(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.milestones})}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:D.milestones.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-5 py-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.title}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:x.statuses[e.status]})]},e.id))})]}):null,D.recentUpdates.length?(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-panel`,children:[(0,$.jsx)(`div`,{className:`border-b border-edge-subtle px-5 py-3.5`,children:(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.projectUpdates})}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:D.recentUpdates.slice(0,3).map(e=>(0,$.jsxs)(`div`,{className:`px-5 py-3`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-5 text-fg`,children:e.summary}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:x.overview.healthLabels[e.health]})]},e.id))})]}):null]}):null]}),(0,$.jsxs)(`aside`,{className:`grid min-w-0 content-start gap-4 xl:min-h-0 xl:overflow-y-auto xl:pr-1 xl:[scrollbar-gutter:stable]`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 rounded-xl bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.overview.attention}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-8 shrink-0 rounded-lg px-2 text-xs`,"aria-expanded":Sn,onClick:()=>Cn(e=>!e),children:[(0,$.jsx)(_,{className:b(`size-3.5 transition-transform`,Sn&&`rotate-45`),"aria-hidden":!0}),x.overview.addBlocker]})]}),Or.length?(0,$.jsx)(`div`,{className:`mt-3 grid gap-3`,children:Or.map(e=>{let t=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(se,{className:`size-4 text-amber-600 dark:text-amber-300`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.title})]}),(0,$.jsxs)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:[x.overview.attentionKinds[e.kind]??e.kind,e.detail?` · ${e.detail}`:e.status?` · ${jr(e.status)}`:``]})]});return e.href?(0,$.jsx)(s,{to:e.href,onClick:Hn(Un(e.href)),className:`min-w-0 rounded-md bg-surface-base p-3 hover:bg-surface-hover`,children:t},e.id):(0,$.jsx)(`div`,{className:`min-w-0 rounded-md bg-surface-base p-3`,children:t},e.id)})}):(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:x.overview.noBlockedTasks}),Sn?(0,$.jsxs)(`form`,{onSubmit:nr,className:`mt-4 flex gap-2 border-t border-edge-subtle pt-4`,children:[(0,$.jsx)(`input`,{className:`min-h-9 min-w-0 flex-1 rounded-md border border-edge bg-surface-base px-3 text-sm text-fg outline-none focus:border-accent`,value:jn.title,onChange:e=>Mn(t=>({...t,title:e.target.value})),placeholder:x.overview.blockerTitlePlaceholder}),(0,$.jsx)(Y,{type:`submit`,variant:`secondary`,className:`shrink-0 rounded-lg px-3`,disabled:gn||!jn.title.trim(),"aria-label":gn?x.overview.addingBlocker:x.overview.addBlocker,title:gn?x.overview.addingBlocker:x.overview.addBlocker,children:(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0})})]}):null]}),(0,$.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge-subtle px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Yt,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:x.overview.recentSessions})]}),(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>zn(`sessions`),children:x.common.viewAll})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:Er.length?Er.map(e=>(0,$.jsxs)(s,{to:`/chat/${encodeURIComponent(e.key)}`,onClick:Hn(`sessions`),className:`block px-4 py-3 hover:bg-surface-hover`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.name||e.key}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:wi(e.updatedAt)})]}),(e.routing?.agentId||e.agentId)&&(e.routing?.agentId||e.agentId)!==D.defaultAgentId?(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted`,children:e.routing?.agentId||e.agentId}):null]},e.key)):(0,$.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:x.overview.noSessions})})]})]})]}):null,Z===`tasks`?(0,$.jsx)(fi,{ref:Dn,tasks:G?.tasks??[],dependencyEdges:G?.dependencyEdges??[],returnTo:Rn(`tasks`),copy:x.board,onAction:Gn,onReorder:qn,onUndoMove:Jn,onDependenciesChange:Yn,onCreate:Kn,actionBusyId:wn}):null,Z===`automations`?(0,$.jsx)(`section`,{id:`project-panel-automations`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-automations`,className:`grid min-h-full content-start gap-4`,children:(0,$.jsx)(En,{projectId:D.id,embedded:!0,title:x.automations.title,subtitle:x.automations.hint})}):null,Z===`notes`?(0,$.jsx)(`section`,{id:`project-panel-notes`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-notes`,className:`flex h-full min-h-[28rem] overflow-hidden rounded-lg bg-surface-panel shadow-surface`,children:(0,$.jsx)(_r,{selectedNoteId:n,basePath:`/projects/${encodeURIComponent(D.id)}/notes`,showLibrary:!1,allowMediaCapture:!1,projectId:D.id,listTitle:x.notes.title,listDescription:x.notes.hint,emptyText:x.notes.emptyTitle,emptyDescription:x.notes.emptyDescription,listWidthStorageKey:`xopc.projectNotes.listWidth.${D.id}`})}):null,Z===`skills`?(0,$.jsx)(Dr,{projectId:D.id,copy:x.skills}):null,Z===`files`?(0,$.jsx)(`section`,{id:`project-panel-files`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-files`,className:`flex h-full min-h-[28rem] flex-col`,children:(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl bg-surface-panel`,children:D.effectiveWorkspaceRoot?(0,$.jsxs)(`div`,{"data-project-files-grid":!0,className:b(`grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[var(--project-files-panel-width)_8px_minmax(0,1fr)]`,Je&&`cursor-col-resize select-none`),style:{"--project-files-panel-width":`${Ge}px`},children:[(0,$.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-b border-edge bg-surface-panel lg:border-b-0`,children:[(0,$.jsxs)(`div`,{className:`flex h-11 items-center gap-1 bg-surface-hover/30 px-3 text-sm`,children:[Ee?(0,$.jsx)(re,{resourceId:Ee.fileId,displayName:Ee.name}):null,(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:b(`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,Ze&&`bg-surface-hover text-fg`),onClick:()=>Qe(!0),"aria-label":x.files.search,title:x.files.search,"aria-pressed":Ze,children:(0,$.jsx)(mn,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(vt,{className:`size-7 shrink-0 rounded-md p-0`,loading:pt,label:d.cron.refresh,onClick:()=>void Zn()})]})]}),Ze?(0,$.jsx)(`div`,{className:`shrink-0 bg-surface-hover/20 px-3 py-2`,children:(0,$.jsxs)(`div`,{className:`flex h-8 items-center gap-2 rounded-md bg-surface-base px-2 focus-within:ring-2 focus-within:ring-accent/30`,children:[(0,$.jsx)(mn,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`text`,role:`searchbox`,value:rt,onChange:e=>it(e.target.value),placeholder:x.files.searchPlaceholder,"aria-label":x.files.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":x.files.clearSearch,title:x.files.clearSearch,onClick:()=>{it(``),Qe(!1)},children:(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0})})]})}):null,St?(0,$.jsx)(`div`,{className:`bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300`,children:St}):null,er?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-2`,children:st?(0,$.jsxs)(`div`,{className:`space-y-2 px-3 py-1`,children:[(0,$.jsx)(yt,{className:`h-11 w-full`}),(0,$.jsx)(yt,{className:`h-11 w-full`}),(0,$.jsx)(yt,{className:`h-11 w-full`})]}):lt?(0,$.jsxs)(`p`,{className:`px-3 py-2 text-xs text-red-600 dark:text-red-400`,children:[d.workspace.loadError,`: `,lt]}):at.length===0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-fg-muted`,children:x.files.noSearchResults}):at.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:b(`flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left hover:bg-surface-hover`,Ae===e.path&&`bg-accent-soft text-accent-fg`),onClick:()=>Fe(e.path),title:e.path,children:[(0,$.jsx)(tt,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate text-sm text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`block truncate text-xs text-fg-subtle`,children:e.path})]})]},e.path))}):pt&&Se.length===0?(0,$.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:x.files.loading}):(0,$.jsx)(an,{tree:Se,selectedPath:Ae,onSelectFile:hr,onSelectEntry:gr,onExpandDir:e=>void Qn(e),onAction:vr,onUploadFiles:(e,t)=>void xr(e,t),uploadDropHint:d.workspace.dropToUpload,actionLabels:{preview:d.workspace.preview,download:d.workspace.download,copyPath:d.workspace.copyPath,openDefault:d.workspace.openSystemApp,openDirectory:d.workspace.openInFileManager,openWith:d.workspace.openWith,revealInFolder:d.workspace.revealInFolder,trash:d.workspace.moveToTrash,delete:d.workspace.deleteFile,recommendedApps:d.workspace.recommendedApps,desktopUpdateRequired:d.workspace.desktopUpdateRequired},emptyHint:x.files.emptyDirectory})]}),(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":x.files.resizeHandle,className:b(`group hidden cursor-col-resize touch-none items-stretch justify-center bg-transparent transition-colors hover:bg-surface-hover/60 lg:flex`,Je&&`bg-surface-hover/70`),onPointerDown:Cr,children:(0,$.jsx)(`div`,{className:b(`my-3 w-px rounded-full bg-transparent transition-colors`,`group-hover:bg-edge-strong/55`,Je&&`bg-accent/60`)})}),(0,$.jsx)(`div`,{className:`min-h-0 min-w-0 overflow-hidden bg-surface-base`,children:Ae?(0,$.jsx)(fn,{filePath:Ae,projectId:D.id,agentId:D.defaultAgentId||Dt||void 0,onClose:()=>Fe(null)}):(0,$.jsx)(`div`,{className:`flex h-full min-h-[18rem] items-center justify-center px-6 text-center`,children:(0,$.jsxs)(`div`,{className:`max-w-sm`,children:[(0,$.jsx)($e,{className:`mx-auto size-8 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:x.files.previewEmptyTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:x.files.previewEmptyDescription})]})})})]}):(0,$.jsxs)(`div`,{className:`grid gap-3 px-4 py-8 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:x.files.needWorkspace}),(0,$.jsx)(`div`,{children:(0,$.jsx)(Y,{type:`button`,variant:`secondary`,className:`rounded-lg`,onClick:()=>zn(`settings`),children:x.files.openSettings})})]})})}):null,Z===`sessions`?(0,$.jsxs)(`section`,{id:`project-panel-sessions`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-sessions`,className:`grid min-h-full content-start gap-3`,children:[q.length?(0,$.jsxs)(`label`,{className:`relative flex min-h-9 w-full max-w-lg cursor-text items-center rounded-lg bg-surface-panel py-1.5 pl-9 pr-9 shadow-surface`,children:[(0,$.jsx)(mn,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-disabled`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`search`,enterKeyHint:`search`,value:ie,onChange:e=>ae(e.currentTarget.value),placeholder:x.sessions.searchPlaceholder,"aria-label":x.sessions.searchPlaceholder,className:`min-w-0 flex-1 appearance-none border-0 bg-transparent py-0.5 text-sm leading-normal text-fg caret-current placeholder:text-fg-disabled focus:border-0 focus:shadow-none focus:outline-none focus:ring-0 focus-visible:outline-none`}),ie?(0,$.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":x.sessions.clearSearch,onClick:()=>ae(``),children:(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0})}):null]}):null,Ir.length?(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:Ir.map(e=>{let t=wi(e.updatedAt),n=e.routing?.agentId||e.agentId||x.common.agent,r=Ii(e),i=e.name?.trim()||x.sessions.fallbackTitle,a=Pr(e.messageCount??0);return(0,$.jsxs)(s,{to:`/chat/${encodeURIComponent(e.key)}`,onClick:Hn(`sessions`),className:`group flex min-h-[8.75rem] min-w-0 flex-col rounded-lg bg-surface-panel p-4 shadow-surface transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(`span`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base text-fg-muted`,children:(0,$.jsx)(Zt,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-fg`,children:i}),r?(0,$.jsx)(`span`,{className:`shrink-0 rounded-md bg-surface-base px-2 py-0.5 text-[11px] font-medium leading-5 text-fg-muted`,children:r}):null]})})]}),(0,$.jsxs)(`div`,{className:`mt-auto grid gap-2 pt-4 text-xs text-fg-muted`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 max-w-full truncate rounded-md bg-surface-base px-2 py-1`,children:[x.sessions.agent,`: `,n]}),(0,$.jsx)(`span`,{className:`rounded-md bg-surface-base px-2 py-1`,children:a})]}),t?(0,$.jsxs)(`span`,{className:`truncate rounded-md bg-surface-base px-2 py-1`,children:[x.sessions.updated,`: `,t]}):null]})]},e.key)})}):Rr?(0,$.jsx)(`div`,{className:`grid gap-1 rounded-lg bg-surface-panel px-4 py-8 text-center shadow-surface`,children:(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:x.sessions.noMatches})}):(0,$.jsx)(`div`,{className:`grid gap-1 rounded-lg bg-surface-panel px-4 py-8 text-center shadow-surface`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:x.sessions.emptyTitle}),(0,$.jsx)(`p`,{className:`mx-auto mt-1 max-w-md text-sm leading-6 text-fg-muted`,children:x.sessions.emptyDescription})]})})]}):null,Z===`progress`?(0,$.jsxs)(`section`,{id:`project-panel-progress`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-progress`,className:`grid min-h-full content-start gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.progress.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Ci(x.progress.count,{count:pe})})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`label`,{className:`inline-flex min-h-9 items-center gap-2 rounded-lg bg-surface-panel px-3 text-sm text-fg-muted shadow-surface`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:_e,onChange:e=>ve(e.currentTarget.checked),className:`size-4 rounded border-edge text-accent focus:ring-accent/30`}),x.progress.includeRelated]}),(0,$.jsxs)(Y,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg px-3`,onClick:()=>void Xn(),disabled:he,children:[(0,$.jsx)(le,{className:b(`size-4`,he&&`animate-spin`),"aria-hidden":!0}),x.common.refresh]})]})]}),(0,$.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-surface-panel shadow-surface`,children:he&&ce.length===0?(0,$.jsx)(`div`,{className:`px-4 py-8 text-sm text-fg-muted`,children:x.progress.loading}):ce.length?(0,$.jsx)(`div`,{className:`divide-y divide-edge`,children:ce.map(e=>{let t=x.progress.types[e.type]??e.type,n=x.progress.objectKinds[e.primaryObject.kind]??e.primaryObject.kind,r=Ri(e),i=e.relatedProjects.length>0&&!e.scopes.some(e=>e.scopeKind===`project`&&e.scopeId===D.id);return(0,$.jsxs)(`article`,{className:`grid gap-2 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:t}),i?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-xs font-medium text-fg-muted`,children:x.progress.related}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 min-w-0 truncate text-sm text-fg-muted`,children:[n,`: `,Pi(e)]})]}),(0,$.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,dateTime:new Date(e.createdAt).toISOString(),children:wi(e.createdAt)})]}),r?(0,$.jsx)(`p`,{className:`line-clamp-2 text-sm leading-5 text-fg-muted`,children:r}):null,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-base px-2 py-1`,children:[x.progress.actor,`: `,Ni(e)]}),(0,$.jsxs)(`span`,{className:`max-w-full truncate rounded-md bg-surface-base px-2 py-1`,children:[x.progress.source,`: `,Fi(e)]})]})]},e.id)})}):(0,$.jsx)(`div`,{className:`px-4 py-8 text-sm text-fg-muted`,children:x.progress.empty})})]}):null,Z===`settings`?(0,$.jsxs)(`form`,{id:`project-panel-settings`,role:`tabpanel`,"aria-labelledby":`project-primary-tab-settings`,onSubmit:sr,onBlurCapture:Tr.onBlurCapture,className:`grid min-h-full content-start gap-4 pb-1`,children:[(0,$.jsxs)(`section`,{className:`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.summaryTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:x.settings.summaryHint})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-2`,children:[(0,$.jsx)(`span`,{className:b(`rounded-full px-2 py-0.5 text-xs font-medium`,Ti(Nn.status)),children:x.settings.statuses[Nn.status]}),(0,$.jsx)(yn,{status:Tr.status,error:Tr.error})]})]}),(0,$.jsxs)(`div`,{className:`grid items-start gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[(0,$.jsxs)(`section`,{className:`grid gap-4 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.detailsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:x.settings.detailsHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsx)(Ei,{label:x.settings.name,children:(0,$.jsx)(`input`,{className:Di(),value:Nn.name,onChange:e=>cr({name:e.target.value})})}),(0,$.jsx)(Ei,{label:x.settings.defaultAgent,children:(0,$.jsxs)(oe,{className:Di(),value:Nn.defaultAgentId,onChange:e=>cr({defaultAgentId:e.target.value},!0),children:[(0,$.jsx)(ze,{value:``,children:x.settings.globalDefaultAgent}),Tt.map(e=>(0,$.jsx)(ze,{value:e.id,children:B(e,d.agentsSettings)},e.id))]})}),(0,$.jsx)(Ei,{label:x.settings.status,children:Hr?(0,$.jsx)(`div`,{className:`grid min-h-10 content-center rounded-md border border-edge bg-surface-inset px-3 text-sm text-fg-muted`,children:x.settings.statuses.archived}):(0,$.jsxs)(oe,{className:Di(),value:Nn.status===`archived`?`active`:Nn.status,onChange:e=>cr({status:e.target.value},!0),children:[(0,$.jsx)(ze,{value:`active`,children:x.settings.statuses.active}),(0,$.jsx)(ze,{value:`paused`,children:x.settings.statuses.paused})]})}),(0,$.jsx)(Ei,{label:x.settings.executionMode,hint:x.settings.executionModeHint,children:(0,$.jsxs)(oe,{className:Di(),value:Nn.executionMode,onChange:e=>cr({executionMode:e.target.value},!0),children:[(0,$.jsx)(ze,{value:`managed_worktree`,children:x.settings.executionModeWorktree}),(0,$.jsx)(ze,{value:`local_checkout`,children:x.settings.executionModeLocal})]})}),(0,$.jsx)(Ei,{label:x.settings.description,hint:x.settings.descriptionHint,children:(0,$.jsx)(`textarea`,{className:Di(!0),value:Nn.description,onChange:e=>cr({description:e.target.value})})})]})]}),(0,$.jsxs)(`section`,{className:`grid gap-4 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.projectGuidanceTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:x.settings.projectGuidanceHint})]}),(0,$.jsx)(Ei,{label:x.settings.brief,hint:x.settings.briefHint,children:(0,$.jsx)(`textarea`,{className:Di(!0),value:Nn.brief,onChange:e=>cr({brief:e.target.value})})}),(0,$.jsx)(Ei,{label:x.settings.instructions,hint:x.settings.instructionsHint,children:(0,$.jsx)(`textarea`,{className:Di(!0),value:Nn.instructions,onChange:e=>cr({instructions:e.target.value})})})]})]}),(0,$.jsxs)(`aside`,{className:`grid gap-4 xl:sticky xl:top-0`,children:[(0,$.jsxs)(`section`,{className:`grid gap-3 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.workspaceRoot}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:x.settings.workspaceIndependentHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-edge bg-surface-base p-3`,children:[(0,$.jsx)(`span`,{className:`w-fit rounded-md bg-surface-inset px-2 py-0.5 text-xs font-medium text-fg-muted`,children:Wr?x.settings.workspaceModeFollow:x.settings.workspaceModeFixed}),(0,$.jsx)(`div`,{className:`break-all font-mono text-xs leading-5 text-fg`,title:Gr,children:Gr}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,onClick:()=>void Yr(),children:[(0,$.jsx)(u,{className:`size-4`,"aria-hidden":!0}),x.settings.copyWorkspacePath]}),Ee?(0,$.jsx)(re,{resourceId:Ee.fileId,displayName:Ee.name}):null,(0,$.jsxs)(Y,{type:`button`,variant:`secondary`,className:`rounded-lg`,onClick:lr,children:[(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),x.settings.migrateWorkspace]})]})]})]}),(0,$.jsxs)(`section`,{className:`grid gap-3 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.currentProjectTitle}),(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[(0,$.jsx)(Oi,{label:x.settings.defaultAgent,value:zr}),(0,$.jsx)(Oi,{label:x.settings.pinState,value:Ur?x.settings.pinned:x.settings.notPinned}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,$.jsx)(Oi,{label:x.settings.createdAt,value:wi(D.createdAt)||x.common.never}),(0,$.jsx)(Oi,{label:x.settings.updatedAt,value:wi(D.updatedAt)||x.common.never})]})]})]}),(0,$.jsxs)(`section`,{className:`grid gap-4 rounded-lg bg-surface-panel p-4 shadow-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x.settings.managementTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:x.settings.managementHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:Ur?x.settings.pinnedTitle:x.settings.pinTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:x.settings.pinHint})]}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`w-fit rounded-lg`,disabled:sn===`pin`,onClick:()=>void dr(),children:[Ur?(0,$.jsx)(Ne,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(We,{className:`size-4`,"aria-hidden":!0}),Ur?x.settings.unpinProject:x.settings.pinProject]})]}),(0,$.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:Hr?x.settings.restoreTitle:x.settings.archiveTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:Hr?x.settings.restoreHint:x.settings.archiveHint})]}),(0,$.jsxs)(Y,{type:`button`,variant:Hr?`primary`:`ghost`,className:`w-fit rounded-lg`,disabled:sn===`archive`,onClick:()=>void fr(),children:[Hr?(0,$.jsx)(le,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(Te,{className:`size-4`,"aria-hidden":!0}),Hr?x.settings.restoreProject:x.settings.archiveProject]})]})]})]}),(0,$.jsxs)(`section`,{className:`grid gap-3 rounded-lg border border-red-500/20 bg-red-500/5 p-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-red-700 dark:text-red-300`,children:x.settings.dangerTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-red-700/80 dark:text-red-200/80`,children:x.settings.dangerHint})]}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`w-fit text-red-600 hover:bg-red-500/10 hover:text-red-700 focus-visible:ring-red-500 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>zt(!0),children:[(0,$.jsx)(nt,{className:`size-4`,"aria-hidden":!0}),x.settings.deleteConfirmAction]})]})]})]})]}):null]}),(0,$.jsx)(N,{open:Lt,onOpenChange:e=>{ln||zt(e)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-overlay p-5 shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`span`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-red-500/10 text-red-600 dark:text-red-400`,children:(0,$.jsx)(se,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:x.settings.deleteConfirmTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:D?Ci(x.settings.deleteConfirm,{name:D.name}):x.settings.deleteConfirmFallback})]})]}),(0,$.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,disabled:ln,children:x.common.cancel})}),(0,$.jsxs)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg text-red-600 hover:bg-red-500/10 hover:text-red-700 focus-visible:ring-red-500 dark:text-red-400 dark:hover:text-red-300`,disabled:ln||!D,onClick:()=>void pr(),children:[(0,$.jsx)(nt,{className:`size-4`,"aria-hidden":!0}),x.settings.deleteConfirmAction]})]})]})]})}),(0,$.jsx)(xt,{open:!!Le,title:d.workspace.trashConfirmTitle,description:d.workspace.trashConfirmDescription.replace(`{{name}}`,Le?.name??``),confirmLabel:d.workspace.moveToTrash,cancelLabel:d.workspace.cancel,destructive:!0,onConfirm:()=>void br(),onCancel:()=>Be(null)}),(0,$.jsx)(xt,{open:!!He,title:d.workspace.deleteConfirmTitle,description:d.workspace.deleteConfirmDescription.replace(`{{name}}`,He?.name??``),confirmLabel:d.workspace.deleteFile,cancelLabel:d.workspace.cancel,destructive:!0,onConfirm:()=>void Sr(),onCancel:()=>Ue(null)}),(0,$.jsx)(N,{open:Ut,onOpenChange:e=>{Ft||Wt(e)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(34rem,calc(100vh-2rem))] 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 shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:x.settings.workspaceMigrationTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:x.settings.workspaceMigrationDescription})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:x.settings.workspaceMode}),(0,$.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:b(`flex min-h-10 items-start gap-2 rounded-md border px-3 py-2`,qt===`fixed`?`border-accent bg-accent-soft/40 text-fg`:`border-edge bg-surface-base text-fg-muted`),children:[(0,$.jsx)(`input`,{type:`radio`,className:`mt-0.5 size-4`,checked:qt===`fixed`,onChange:()=>$t(`fixed`),disabled:Ft}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block font-medium`,children:x.settings.workspaceModeFixed}),(0,$.jsx)(`span`,{className:`block text-xs leading-5 text-fg-subtle`,children:x.settings.workspaceMigrationFixedHint})]})]}),(0,$.jsxs)(`label`,{className:b(`flex min-h-10 items-start gap-2 rounded-md border px-3 py-2`,qt===`follow`?`border-accent bg-accent-soft/40 text-fg`:`border-edge bg-surface-base text-fg-muted`),children:[(0,$.jsx)(`input`,{type:`radio`,className:`mt-0.5 size-4`,checked:qt===`follow`,onChange:()=>$t(`follow`),disabled:Ft}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block font-medium`,children:x.settings.workspaceModeFollow}),(0,$.jsx)(`span`,{className:`block text-xs leading-5 text-fg-subtle`,children:x.settings.workspaceHint})]})]})]})]}),qt===`fixed`?(0,$.jsx)(xn,{value:tn,onChange:rn,disabled:Ft,wd:f,placeholder:x.settings.workspacePlaceholder,inputClassName:Di(),autoFocus:!0}):null,(0,$.jsx)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm leading-6 text-amber-800 dark:text-amber-200`,children:x.settings.workspaceMigrationImpact}),(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-subtle`,children:Ci(x.settings.workspaceCurrent,{workspace:Kr})})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,disabled:Ft,children:x.common.cancel})}),(0,$.jsxs)(Y,{type:`button`,variant:`primary`,className:`rounded-lg`,disabled:Ft||!qr,onClick:()=>void ur(),children:[(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),x.settings.workspaceMigrationConfirm]})]})]})]})}),(0,$.jsx)(N,{open:!!Vt,onOpenChange:e=>{e||Ht(null)},children:(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex w-[min(30rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(M,{className:`text-base font-semibold text-fg`,children:x.settings.workspaceMissingTitle}),(0,$.jsx)(O,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:Vt?Ci(x.settings.workspaceMissingDescription,{workspace:Vt}):null})]}),Vt?(0,$.jsx)(`div`,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg bg-surface-inset px-3 py-2 text-sm text-fg-muted`,children:[(0,$.jsx)($e,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:Vt})]})}):null,(0,$.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,$.jsx)(Y,{type:`button`,variant:`ghost`,className:`rounded-lg`,onClick:Xr,disabled:Ft,children:x.settings.workspaceMissingBack}),(0,$.jsxs)(Y,{type:`button`,variant:`primary`,className:`rounded-lg`,onClick:()=>void ur({createWorkspaceRoot:!0}),disabled:Ft,children:[(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),x.settings.workspaceMissingCreate]})]})]})]})})]})}export{Hi as ProjectDetailPage};
@@ -1 +0,0 @@
1
- import{rr as e}from"./index-BUv4J0JN.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};