@xopcai/xopc 0.0.445 → 0.0.447
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.
- package/dist/browser-ext/dist/assets/{auth-DAIwDtVp.js → auth-CQmxIyWw.js} +225 -8
- package/dist/browser-ext/dist/background.js +254 -16
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +3 -49
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/draft-stream-lifecycle.d.ts +2 -3
- package/dist/extensions/telegram/src/plugin.d.ts +0 -1
- package/dist/extensions/telegram/src/plugin.js +0 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CuPXAoLe.js → activity-store-D_KDDoA1.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-D92uHOFV.js → agent-avatar-dicebear-CGHzO0HR.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-DINzeGs0.js → agent-avatar-display-Dm1YHaAt.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-rH1QpgiR.js → agent-defaults-settings-panel-BGTfRvG5.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-B2vXlrDW.js → agent-plugin-dialog-D0AQB-2O.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-lvQfOQPN.js → agents-Ckr-T2KU.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DPLtjJtX.js → agents-admin-api-D0qHxAok.js} +1 -1
- package/dist/gateway/static/root/assets/{api-snfMD8_Y.js → api-pQXrYBTk.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CEzBruRJ.js → api-uriioEZx.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CONwDpqL.js → app-management-settings-panel-CQbKhrjd.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Bu7K-_ri.js → appearance-settings-Dm0GM368.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C3iDd3ZQ.js → apps-page-DCeINCy-.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CfLz9o-2.js → archive-plugin-Cd4FOTEH.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-Dl9fi8t0.js → automation-api-B3df53ms.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BjjZCxee.js → automation-result-state-CpgaWu2r.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-9IPHu_UC.js → automation-run-list-DrJfwJN_.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CKbHMLSy.js → automation-task-card-C2mxNw5Q.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-K3trjTZl.js → automations-page-B5bnb-N8.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D7m3w_9B.js → automations-workspace-7R4mL3M-.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Bv4ixxo4.js → binary-plugins-C0QOjfJV.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CtaJSB9U.js → block-editor-BY1Mb-WW.js} +3 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-CmBsnx24.js → browser-settings-page-DUsk02LK.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DJYgOjeq.js → capabilities-Bt1fAcDI.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DDJJhQ40.js → capabilities-Bu7efUpH.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CBqvHAyp.js → capabilities-page-DFv5-mPY.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-wjezs0OE.js → capabilities-settings-panel-BtRMZjAx.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-D4q8hiD0.js → channels-CByFQQ_H.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BOB3dILf.js → chat-agents-api-SruH_oEQ.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DsaCatBN.js → chat-chart-block-BBchFbUa.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-C3ttsYGZ.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D9o0nUEV.js → chat-terminal-dock-DCNAz0CB.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Cj0_7g9o.js → command-palette-api-r8U5soT7.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CoDWKzBm.js → composer-payload-handoff-RaEQXTjj.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DJ9BIOHC.js → computer-settings-page-C7cj9Zyx.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-C5-3MDIj.js → connected-providers-grid-DgJ7I1do.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-bD1sKiAp.js → connection-usage-guide-De6QJt8B.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BEq3i3Vi.js → connector-service-page-qSYlFATU.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DEExP6a7.js → connectors-api-CqyteNnT.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-QVWuoxuK.js → connectors-page-BB3V-zJS.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D2whl8Ci.js → date-picker-CB6IVCiq.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-C8zQtMcw.js → desktop-pet-narrative-B7I1II0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C54b1FY4.js → desktop-pet-settings-Cm1O5CEG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-qnIdmNnH.js → desktop-pet-wqyOn6xs.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-bryv5YRw.js → dev-view-store-BxPWx1Gi.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Du-yOxZv.js → device-pairing-wizard-CqgjknYy.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-GsMkjw59.js → directory-picker-path-field-BCOUShCs.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-CrpDiC7J.js → discussion-annotation-sync-uvwyXFX3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CDZfdMAR.js → extension-debug-page-C7ZJumIY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CG70QWPS.js → extension-iframe-host-B0rM3Ohp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-D7Av-sOf.js → extension-marketplace-api-DIGw487r.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DpJTL6-v.js → extension-page-C5LnL_Dy.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BZTbdvCF.js → extension-provider-D5L3t0e3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CC4rmiFC.js → extension-settings-page-DnXoNNDa.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Dtla5oAW.js → file-preview-surface-Bfqc0ZKv.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B5THNdYK.js → gateway-config-swr-Db2fE-gT.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-nI6k8qP8.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-CjYSSi_l.js +1 -0
- package/dist/gateway/static/root/assets/gateway-restart-CyhN9Fk3.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-Nr0Bzbsy.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CqtCJzWJ.js → gateway-startup-retry-Du7l0oxt.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BQMdHLlp.js → global-defaults-api-qGBKLt28.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Df3X6-Ko.js → home-page-h6D4Pqqc.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-G3tQFhif.js → image-generation-api-DeolJQxY.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BmEqiunH.js → imports-page-B3kUV_dq.js} +1 -1
- package/dist/gateway/static/root/assets/index-Bj6IrJGJ.js +11 -0
- package/dist/gateway/static/root/assets/index-D3YWUSNe.css +1 -0
- package/dist/gateway/static/root/assets/install-connector-dialog-Brl22l1N.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CtNI6i7K.js → keyboard-shortcuts-settings-CFrEEDZu.js} +1 -1
- package/dist/gateway/static/root/assets/languages-kF11aUYU.js +2 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CE46mHc0.js → local-app-workbench-page-CbHgQzs4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DqZT5hLH.js → local-apps-page-Cdeawk2X.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Bt_e3A8f.js → local-session-drafts-oWhYPECv.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bld7_m-Q.js → locale-store-BY-fRY-q.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CzajqK40.js → logs-page-3dWLrUy0.js} +1 -1
- package/dist/gateway/static/root/assets/management-api-BzdYxqsC.js +1 -0
- package/dist/gateway/static/root/assets/management-settings-yWWgFlzF.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-editor-BuuGlcfG.js → markdown-editor-CjQJ-Nho.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-B3cFKCfO.js → markdown-view-ClNfoiYC.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-ZcY1nqMO.js → mcp-conversation-setup-page-C0M7yW4O.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DSOplRhW.js → media-plugins-DmVG3TQ5.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DFCLetQl.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-yAKlOR3O.js → model-selector-DkytsBae.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-8V-ZpAIa.js → models-hub-cache-CESzQ_tk.js} +1 -1
- package/dist/gateway/static/root/assets/navigation-ByOzYT0t.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CQIrUO6h.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-Cw-TaViX.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CVQqqmGI.js → notes-api-32qiHxz2.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DIugUbkV.js → notes-page-gl59x-7l.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-DGa6PTuq.js → oauth-api-CMpfoRed.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-Bc-KLH1e.js → oauth-provider-connect-XzlLkqnK.js} +1 -1
- package/dist/gateway/static/root/assets/page-context-capture-button-CdMxGZaM.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-draft-GveHK8e2.js → page-context-draft-CrgFs0h3.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-BNjlQHqU.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-Cu8lGBXZ.js → personal-avatar-BHMRbUIc.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BZWJKyZ8.js → personal-page-DUuJe2P9.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-awr10jTV.js → personal-settings-panel-CZjvI9rl.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CAxn3usD.js → phone-dependencies-card-BCEI4PGp.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-BBG3LxRP.js → phone-model-connection-BqOzyoRr.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CfPjKpnd.js → phone-model-picker-BGAAMeo6.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-C4dJdwRW.js → phone-settings-page-BdoFCa2J.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-BKltFHtG.js → phone-workspace-store-D1BS7otl.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BqcFfZFH.js → plugin-details-dialog-BP-ZS2g2.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-QlyIA8ve.js → preference-select-fields-RITbo_ES.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-CRsfuAXl.js → product-automation-feedback-CQvcSORB.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CQ4dk-_l.js → product-open-page-CJfYOVkw.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-B0-rh4uS.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-modal-CSFxc7oy.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-CgU7vGyT.js +7 -0
- package/dist/gateway/static/root/assets/project-overview-model-DrLXaO-t.js +1 -0
- package/dist/gateway/static/root/assets/{project-understanding-CU2af95r.js → project-understanding-szQw-qin.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BsgZb6n9.js → projects-page-BFZsIyzp.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-CspehmSU.js → providers-api-j511FMYv.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BOZAOdCI.js → recording-upload-jq70ER5Y.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bdp3UUyz.js → registry-api-BnEoY6_B.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bos3uwAT.js → remote-access-hub-B8AHjzC5.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-DJR3SCy6.js → resource-unavailable-AT-LkLIB.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-ByDpGuZp.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-DsbahxzE.js → runtime-tools-api-BDjAwlQF.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DW9_OFi2.js → runtime-tools-settings-panel-kvbXN_HV.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-Bd1JDO5T.js → service-recommendation-list-DquxQCKH.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DjnHJ-0n.js → session-api-CgTDekPG.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-ChHnJOWW.js → session-manager-V8cj3NVD.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-BM-oqd22.js → sessions-page-KFescmNm.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-JCPJyeK-.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CM44UlF8.js → settings-advanced-section-Daxv3VGf.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-Blc4C8aw.js → settings-mode-store-LUeLxacj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-irv-JoTz.js → settings-page-Bi6rvZGw.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BYFaTD8a.js → settings-page-header-Dmw3nYJ1.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CnUQSxT3.js → settings-page-layout-YJXlkr_Z.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-DqaiLQ0I.js → setup-interaction-page-Dd3Ovfgm.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-iOYgfkoK.js → setup-status-panel-BZZXpXiB.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C_uYNUlp.js → share-link-dialog-B1g7Xero.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CFebGqyB.js → share-preview-page-1GlB7603.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-C2GDyqxP.js → shares-api-DXOD--vt.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-B-7la3QN.js → shares-settings-Bj-HKS3s.js} +1 -1
- package/dist/gateway/static/root/assets/skill-api-HQEXke4-.js +1 -0
- package/dist/gateway/static/root/assets/{skill-list-api-7MY9ewiu.js → skill-list-api-CJBrtxil.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DkDpu3Wd.js → skill-reload-api-CO6jhwui.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DAxov1a8.js +2 -0
- package/dist/gateway/static/root/assets/{source-workspace-editor-kxosllTu.js → source-workspace-editor-BwYU5OEh.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BltKPJdb.js → system-settings-panel-By3gokfs.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-6awKGnOr.js → task-detail-page-Cf58C6gC.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-Cy9txdqV.js → task-result-evidence-DWfp9UIc.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DUEJoa1M.js → terminal-panel-store-DBC-pqGy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DsvYj7Vy.js → theme-store-C57ZxHqm.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-YQmN1S2k.js +2 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-B_Xdc2VF.js → tracing-settings-page-BQ7regHS.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-B6BhWTh3.js → tunnel-api-BOJVQPqI.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-B7rFXhDk.js → understanding-activity-store-YrDh1XvR.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DCFASve5.js → understanding-refresh-store-D6gM1s8M.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DqzosTxy.js → usage-page-DpC6gP1I.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DsqcLHV9.js → use-autosave-NOpNkLFw.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-ClakaDU1.js → use-composer-attachments-R6kKpDgc.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-M7LSoDLc.js +15 -0
- package/dist/gateway/static/root/assets/{use-personal-profile-T2e6P5Ed.js → use-personal-profile-JPLBYzew.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Dq0qgK3N.js → use-workspace-tree-jzKVAl3N.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Ziz55hVM.js → user-model-page-CPZgl93P.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D7NPAc1E.js → voice-api-key-field-R_KAYzHp.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-UQDTh6hh.js → voice-config-api-D6ueBjfw.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-SD2gZVg8.js → voice-input-shortcut-events-04u9YoRg.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-Bf9FaI-p.js → voice-transcribe-api-B2NVJYnu.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B41GOFXh.js → work-discovery-overlay-BHaemIrQ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-NNhExALx.js → work-discovery-page-Bt_j5iQ5.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DeNWVFFK.js → working-directory-picker-modal-5EsBeKBO.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-DrVss2Fd.js → workspace-api-BmUCKePi.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Sy1CLe2K.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-C2egBzza.js → workspace-file-preview-dialog-hYGX2hWZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-XFUtwfLY.js → workspace-open-location-menu-DqLui4B1.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BlhFT1q9.js → xopc-cloud-account-card-CVq7U7Ft.js} +1 -1
- package/dist/gateway/static/root/index.html +85 -84
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +309 -17
- package/dist/packages/endpoint-tools-protocol/src/index.js +62 -10
- package/dist/packages/endpoint-tools-protocol/src/provider-execution.js +32 -0
- package/dist/packages/endpoint-tools-protocol/src/providers.js +233 -0
- package/dist/packages/gateway-contract/src/clarifications.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +2 -1
- package/dist/packages/gateway-contract/src/device-request-proof.js +32 -0
- package/dist/packages/gateway-contract/src/index.js +2 -2
- package/dist/packages/realtime-client/src/index.js +1 -0
- package/dist/packages/realtime-protocol/src/index.js +4 -1
- package/dist/src/agent/agent-manager.d.ts +0 -1
- package/dist/src/agent/agent-manager.js +1 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +4 -7
- package/dist/src/agent/embedded/session-runner.js +8 -3
- package/dist/src/agent/embedded/tool-metadata.d.ts +1 -1
- package/dist/src/agent/embedded/tool-search-extension.d.ts +1 -0
- package/dist/src/agent/embedded/tool-search-extension.js +35 -2
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +3 -0
- package/dist/src/agent/external-tools/endpoint-provider.js +96 -18
- package/dist/src/agent/external-tools/index.js +2 -2
- package/dist/src/agent/external-tools/personal-request-scope.js +6 -0
- package/dist/src/agent/external-tools/read-policy.js +15 -8
- package/dist/src/agent/external-tools/service.js +8 -0
- package/dist/src/agent/external-tools/types.d.ts +1 -0
- package/dist/src/agent/inbound/inbound-loop.js +2 -1
- package/dist/src/agent/mcp/continuation-guard.js +1 -1
- package/dist/src/agent/mcp/conversation-setup.js +1 -1
- package/dist/src/agent/mcp/discovery.js +1 -1
- package/dist/src/agent/mcp/native-mcp.d.ts +2 -0
- package/dist/src/agent/mcp/native-mcp.js +5 -0
- package/dist/src/agent/mcp/transport.d.ts +2 -1
- package/dist/src/agent/mcp/transport.js +21 -6
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +2 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +6 -5
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.d.ts +1 -0
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +56 -30
- package/dist/src/agent/skills/marketplace/search.js +2 -2
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +2 -0
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -0
- package/dist/src/agent/tools/device-use-tool.d.ts +9 -0
- package/dist/src/agent/tools/device-use-tool.js +158 -0
- package/dist/src/agent/tools/factory.js +24 -3
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/mcp-source.js +1 -1
- package/dist/src/automations/service/action-executor.js +10 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/browser/remote/device-driver.js +7 -3
- package/dist/src/browser/remote/device-target.d.ts +1 -1
- package/dist/src/browser/remote/device-target.js +8 -6
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/channels/lifecycle-supervisor.js +2 -1
- package/dist/src/channels/pairing/paths.d.ts +1 -1
- package/dist/src/channels/pairing/paths.js +1 -1
- package/dist/src/channels/verified-inbound.d.ts +13 -0
- package/dist/src/channels/verified-inbound.js +29 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/device-host.js +52 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/index.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +3 -3
- package/dist/src/computer/endpoint-transport.js +1 -1
- package/dist/src/computer/errors.js +4 -0
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/flows.js +1 -1
- package/dist/src/computer/runtime.d.ts +1 -0
- package/dist/src/computer/runtime.js +25 -3
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/paths.d.ts +1 -1
- package/dist/src/config/paths.js +1 -1
- package/dist/src/config/schema.d.ts +2 -0
- package/dist/src/config/schema.js +1 -0
- package/dist/src/connectors/composio-triggers.js +1 -1
- package/dist/src/endpoint-tools/bridge-host.d.ts +5 -4
- package/dist/src/endpoint-tools/bridge-host.js +165 -30
- package/dist/src/endpoint-tools/bridge.d.ts +1 -1
- package/dist/src/endpoint-tools/bridge.js +39 -7
- package/dist/src/endpoint-tools/capability-catalog.d.ts +1 -1
- package/dist/src/endpoint-tools/capability-catalog.js +1 -1
- package/dist/src/endpoint-tools/delegation.d.ts +60 -0
- package/dist/src/endpoint-tools/delegation.js +130 -0
- package/dist/src/endpoint-tools/desktop-execution.js +1 -1
- package/dist/src/endpoint-tools/device-host.d.ts +98 -0
- package/dist/src/endpoint-tools/device-host.js +89 -0
- package/dist/src/endpoint-tools/execution-actor.d.ts +6 -0
- package/dist/src/endpoint-tools/execution-actor.js +53 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +7 -4
- package/dist/src/endpoint-tools/grant-service.js +12 -4
- package/dist/src/endpoint-tools/host-credentials.d.ts +42 -0
- package/dist/src/endpoint-tools/host-credentials.js +144 -0
- package/dist/src/endpoint-tools/index.d.ts +1 -1
- package/dist/src/endpoint-tools/index.js +3 -3
- package/dist/src/endpoint-tools/invocation-service.d.ts +47 -4
- package/dist/src/endpoint-tools/invocation-service.js +328 -36
- package/dist/src/endpoint-tools/mcp-provider.d.ts +32 -0
- package/dist/src/endpoint-tools/mcp-provider.js +258 -0
- package/dist/src/endpoint-tools/policy.js +0 -3
- package/dist/src/endpoint-tools/provider-catalog.d.ts +45 -0
- package/dist/src/endpoint-tools/provider-catalog.js +202 -0
- package/dist/src/endpoint-tools/provider-operation-journal.d.ts +18 -0
- package/dist/src/endpoint-tools/provider-operation-journal.js +111 -0
- package/dist/src/endpoint-tools/provider-operation-status.d.ts +33 -0
- package/dist/src/endpoint-tools/provider-operation-status.js +80 -0
- package/dist/src/endpoint-tools/registry.d.ts +14 -1
- package/dist/src/endpoint-tools/registry.js +15 -1
- package/dist/src/endpoint-tools/result-projector.d.ts +1 -2
- package/dist/src/endpoint-tools/result-projector.js +3 -11
- package/dist/src/endpoint-tools/runtime.d.ts +10 -2
- package/dist/src/endpoint-tools/runtime.js +102 -11
- package/dist/src/endpoint-tools/target-resolver.d.ts +8 -3
- package/dist/src/endpoint-tools/target-resolver.js +24 -5
- package/dist/src/endpoint-tools/task-targets.d.ts +38 -0
- package/dist/src/endpoint-tools/task-targets.js +95 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +34 -1
- package/dist/src/endpoint-tools/upload-service.js +88 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/refresh-runtime-access.d.ts +7 -2
- package/dist/src/extensions/agent-plugins/refresh-runtime-access.js +36 -25
- package/dist/src/extensions/agent-plugins/setup.d.ts +1 -1
- package/dist/src/extensions/agent-plugins/setup.js +2 -2
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/loader.d.ts +0 -1
- package/dist/src/extensions/loader.js +3 -38
- package/dist/src/extensions/typed-event-bus.d.ts +0 -1
- package/dist/src/extensions/typed-event-bus.js +0 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +12 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/device-authorizations.js +4 -10
- package/dist/src/gateway/hono/routes/device-hosts.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-hosts.js +82 -0
- package/dist/src/gateway/hono/routes/device-providers.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-providers.js +297 -0
- package/dist/src/gateway/hono/routes/device-targets.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-targets.js +117 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +2 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -78
- package/dist/src/gateway/hono/routes/lazy-bundles.js +24 -8
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +3 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +8 -18
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/agent-runner.d.ts +3 -0
- package/dist/src/gateway/service/agent-runner.js +21 -5
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -0
- package/dist/src/gateway/service.js +9 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/capability-server.js +1 -1
- package/dist/src/notes/agent-context.d.ts +3 -0
- package/dist/src/notes/agent-context.js +32 -4
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/phone/assistance.js +1 -1
- package/dist/src/phone/location-environment.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/setup/service.js +1 -1
- package/dist/src/realtime/runtime.js +5 -0
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/session/session-context-for-llm.js +9 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +7 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +40 -2
- package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -8
- package/dist/src/storage/sqlite/device-access-repository.js +1 -3
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +2 -2
- package/dist/src/storage/sqlite/index.d.ts +0 -1
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +2 -10
- package/dist/src/storage/sqlite/session-input-repository.js +8 -0
- package/dist/src/storage/sqlite/upgrades/270_device_bridge_kind.sql +30 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +4 -5
- package/dist/extensions/feishu/src/auth/paths.d.ts +0 -2
- package/dist/extensions/feishu/src/auth/paths.js +0 -16
- package/dist/extensions/feishu/src/state/thread-bindings.d.ts +0 -19
- package/dist/extensions/feishu/src/state/thread-bindings.js +0 -44
- package/dist/extensions/feishu/src/subagent-hooks.d.ts +0 -12
- package/dist/extensions/feishu/src/subagent-hooks.js +0 -50
- package/dist/extensions/feishu/src/tools/docx/docx-batch-insert.d.ts +0 -11
- package/dist/extensions/feishu/src/tools/docx/docx-batch-insert.js +0 -93
- package/dist/extensions/feishu/src/tools/docx/docx-color-text.d.ts +0 -15
- package/dist/extensions/feishu/src/tools/docx/docx-color-text.js +0 -73
- package/dist/extensions/feishu/src/tools/docx/docx-table-ops.d.ts +0 -20
- package/dist/extensions/feishu/src/tools/docx/docx-table-ops.js +0 -171
- package/dist/extensions/feishu/src/tools/docx/docx-types.d.ts +0 -34
- package/dist/gateway/static/root/assets/chat-page-CeHOmJqM.js +0 -72
- package/dist/gateway/static/root/assets/gateway-realtime-hnEaDFaA.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-ugwtyD4q.js +0 -1
- package/dist/gateway/static/root/assets/gateway-restart-kwv0njYq.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CxYPJTy8.js +0 -1
- package/dist/gateway/static/root/assets/index-DE2bG5EI.css +0 -1
- package/dist/gateway/static/root/assets/index-PewrhviZ.js +0 -11
- package/dist/gateway/static/root/assets/install-connector-dialog-BU4l6KJv.js +0 -1
- package/dist/gateway/static/root/assets/languages-zXtNocoy.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BgdAP0kf.js +0 -1
- package/dist/gateway/static/root/assets/messages-CGO1P4mz.js +0 -3
- package/dist/gateway/static/root/assets/navigation-D62kPsA9.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DWIWloib.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-BbNYW2Rw.js +0 -1
- package/dist/gateway/static/root/assets/page-context-capture-button-B9L7V_n2.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-YZfSLNTg.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-CGbqoID0.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-0wvIDcVr.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-Bkxs8knZ.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-BVo8JPwW.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-DyGT3o1e.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-BnpTSZGc.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-sL2kGqHZ.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-DEGpbye4.js +0 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-9DED7ohY.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CmSYxTmk.js +0 -1
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +0 -105
- package/dist/packages/gateway-contract/src/desktop-chat.js +0 -29
- package/dist/src/endpoint-tools/binding-service.d.ts +0 -24
- package/dist/src/endpoint-tools/binding-service.js +0 -57
- package/dist/src/gateway/hono/routes/desktop-chat.d.ts +0 -3
- package/dist/src/gateway/hono/routes/desktop-chat.js +0 -30
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.d.ts +0 -9
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +0 -41
- /package/dist/{extensions/feishu/src/tools/docx/docx-types.js → src/cli/commands/device-host.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-7R4mL3M-.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as c,i as l,l as u,n as d}from"./locale-store-Bld7_m-Q.js";import{t as f}from"./messages-CGO1P4mz.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{t as x}from"./calendar-clock-D-quYVPe.js";import{i as S,n as C,r as w,t as T}from"./automation-run-list-9IPHu_UC.js";import{t as E}from"./check-DUBLcKHA.js";import{t as D}from"./chevron-down-ccbiQQz_.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A}from"./popover-select-CLsphyzA.js";import{t as j}from"./circle-alert-BEjgurr2.js";import{t as M}from"./circle-check-C23XjkUj.js";import{t as N}from"./copy-Dv6d4Dvw.js";import{t as P}from"./ellipsis-0k4rZLoy.js";import{t as F}from"./eye-CABVeTq0.js";import{t as I}from"./git-branch-Dh9uxTot.js";import{t as L}from"./list-filter-CIPvpfLA.js";import{t as R}from"./loader-circle-CifKLtgG.js";import{t as z}from"./markdown-view-B3cFKCfO.js";import{t as ee}from"./message-circle-Badhj-4D.js";import{t as te}from"./pause-DuPxgSxk.js";import{t as ne}from"./pencil-DmIY3Oa-.js";import{t as re}from"./play-kxZvpBg8.js";import{t as ie}from"./plus-Q2yW6OE7.js";import{t as ae}from"./refresh-cw-BRlGaq2w.js";import{t as oe}from"./search-DA7gz22f.js";import{t as B}from"./shield-check-BU58siTV.js";import{t as se}from"./sparkles-DHlfQFAF.js";import{t as V}from"./square-pen-B8FsvqNu.js";import{t as H}from"./trash-2-DusmjVPV.js";import{t as ce}from"./x-B_N4OPjy.js";import{t as U}from"./zap-dximCGjy.js";import{t as le}from"./cn-0WouolD0.js";import{t as W}from"./skeleton-DzdOeGYz.js";import{d as G}from"./api-snfMD8_Y.js";import{a as K}from"./session-api-DjnHJ-0n.js";import{T as q}from"./session-manager-ChHnJOWW.js";import{a as ue,i as J,o as de}from"./vendor-swr-CdRzEUwF.js";import{t as fe}from"./chat-agents-api-BOB3dILf.js";import{t as pe}from"./button-Cc4hUNTt.js";import{t as me}from"./page-header-store-YZfSLNTg.js";import{t as Y}from"./automation-api-Dl9fi8t0.js";import{t as he}from"./sliding-tab-list-CmcrqRzN.js";import{t as ge}from"./refresh-button-DiWdGAaX.js";import{a as _e,c as ve,d as ye,f as be,i as xe,l as Se,m as Ce,o as X,p as we,r as Te,s as Ee,t as De,u as Oe}from"./dist-ZrL34Ps4.js";import{n as ke}from"./model-selector-yAKlOR3O.js";import{C as Ae,S as je,T as Z,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,l as Be,m as Ve,n as He,o as Ue,p as We,r as Ge,s as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./automation-task-card-CKbHMLSy.js";import{n as Qe}from"./agent-display-names-Bje7vfSn.js";import{i as $e,n as et,r as tt,t as nt}from"./automation-result-state-BjjZCxee.js";var rt=n(),Q=e(t(),1),$=r(),it=(0,Q.lazy)(()=>i(()=>import(`./chat-page-CeHOmJqM.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193])));function at(e){let t=(0,rt.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ue(),w=(0,Q.useRef)(!1),T=i??``,E;t[2]!==r||t[3]!==n||t[4]!==T?(E=[`automation-execution`,r,n,T],t[2]=r,t[3]=n,t[4]=T,t[5]=E):E=t[5];let D;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(D=async()=>{let{run:e}=await Y.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Y.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=D):D=t[10];let O;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(O={refreshInterval:ct,shouldRetryOnError:!1},t[11]=O):O=t[11];let{data:k,error:A,mutate:j}=J(E,D,O),M=k?.run,N=M?.conversationId,P;t[12]===N?P=t[13]:(P=e=>!!(N&&(e.sessions[N]?.streaming||e.sessions[N]?.sending)),t[12]=N,t[13]=P);let F=q(P),I;t[14]===N?I=t[15]:(I=N?[`automation-execution-session`,N]:null,t[14]=N,t[15]=I);let L;t[16]===N?L=t[17]:(L=()=>K(N),t[16]=N,t[17]=L);let R;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(R={shouldRetryOnError:!1},t[18]=R):R=t[18];let{data:ee,error:te,mutate:ne}=J(I,L,R),re=M?.conversationShared||k?.automation.conversationMode===`continuous`||ee?.customData?.latestAutomationRunId!==void 0&&ee.customData.latestAutomationRunId!==n,ie=!!(ee&&(!re||u)),ae=!A&&!!(M&&(!N||re&&!u&&ee&&!te&&(M?.summary||M?.error)||ee&&!te&&p)),oe,B;if(t[19]!==ae||t[20]!==j||t[21]!==S||t[22]!==M?(oe=()=>{!M||!ae||C(M)||M.readAtMs!=null||w.current||(w.current=!0,Y.markRunRead(M.id).then(async()=>{await Promise.all([j(),S(st)])}).catch(ot).finally(()=>{w.current=!1}))},B=[M,ae,j,S],t[19]=ae,t[20]=j,t[21]=S,t[22]=M,t[23]=oe,t[24]=B):(oe=t[23],B=t[24]),(0,Q.useEffect)(oe,B),A){let e=A instanceof Error?A.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===j?r=t[28]:(r=()=>void j(),t[27]=j,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(pe,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(pe,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!M){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(W,{className:`h-6 w-2/3`}),(0,$.jsx)(W,{className:`h-20`})]}),t[39]=e):e=t[39],e}let se;t[40]===M?se=t[41]:(se=C(M),t[40]=M,t[41]=se);let V=se,H=l?`执行会话`:`Execution conversation`,ce=l?`返回自动化`:`Back to automation`,U;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(b,{className:`size-4`}),t[42]=U):U=t[42];let le;t[43]!==c||t[44]!==ce?(le=(0,$.jsx)(pe,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":ce,children:U}),t[43]=c,t[44]=ce,t[45]=le):le=t[45];let G;t[46]===M.automationName?G=t[47]:(G=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:M.automationName}),t[46]=M.automationName,t[47]=G);let de;t[48]!==le||t[49]!==G?(de=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[le,G]}),t[48]=le,t[49]=G,t[50]=de):de=t[50];let fe;t[51]!==M.createdAtMs||t[52]!==l?(fe=new Date(M.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=M.createdAtMs,t[52]=l,t[53]=fe):fe=t[53];let me;t[54]===a?me=t[55]:(me=f(a),t[54]=a,t[55]=me);let he=me.automations.status[M.status],ge;t[56]!==fe||t[57]!==he?(ge=(0,$.jsxs)(`span`,{children:[fe,` · `,he]}),t[56]=fe,t[57]=he,t[58]=ge):ge=t[58];let _e;t[59]!==s||t[60]!==M.id?(_e=()=>s(M.id),t[59]=s,t[60]=M.id,t[61]=_e):_e=t[61];let ve=l?`运行详情`:`Run details`,ye;t[62]!==_e||t[63]!==ve?(ye=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:_e,children:ve}),t[62]=_e,t[63]=ve,t[64]=ye):ye=t[64];let be;t[65]!==o||t[66]!==M?(be=()=>o(M),t[65]=o,t[66]=M,t[67]=be):be=t[67];let xe=l?`调整自动化`:`Adjust automation`,Se;t[68]!==be||t[69]!==xe?(Se=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:be,children:xe}),t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==ge||t[72]!==ye||t[73]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[ge,ye,Se]}),t[71]=ge,t[72]=ye,t[73]=Se,t[74]=Ce):Ce=t[74];let X;t[75]!==k?.automation||t[76]!==re||t[77]!==l?(X=re?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,k?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=k?.automation,t[76]=re,t[77]=l,t[78]=X):X=t[78];let we;t[79]!==h||t[80]!==u||t[81]!==l?(we=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=we):we=t[82];let Te;t[83]!==V||t[84]!==l?(Te=V?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=V,t[84]=l,t[85]=Te):Te=t[85];let Ee;t[86]!==de||t[87]!==Ce||t[88]!==X||t[89]!==we||t[90]!==Te?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[de,Ce,X,we,Te]}),t[86]=de,t[87]=Ce,t[88]=X,t[89]=we,t[90]=Te,t[91]=Ee):Ee=t[91];let De;t[92]!==V||t[93]!==N||t[94]!==F||t[95]!==ee||t[96]!==a||t[97]!==ne||t[98]!==M.error||t[99]!==M.id||t[100]!==M.summary||t[101]!==te||t[102]!==re||t[103]!==ie||t[104]!==l?(De=ie?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(it,{embedded:!0,automationExecution:!0,conversationId:N,readOnly:V||F,onHistoryReady:x,initialTurnId:re?M.id:void 0,onInitialTurnLocated:v},N)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[M.summary?(0,$.jsx)(z,{content:M.summary}):null,M.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:M.error}):null,N?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:V?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),N&&!ee&&!te?(0,$.jsx)(W,{className:`h-24`}):null,te?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:te.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(pe,{onClick:()=>void ne(),children:l?`重试`:`Retry`})]}):null,re&&ee?(0,$.jsx)(pe,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,V?null:(0,$.jsx)($e,{runId:M.id,language:a})]}),t[92]=V,t[93]=N,t[94]=F,t[95]=ee,t[96]=a,t[97]=ne,t[98]=M.error,t[99]=M.id,t[100]=M.summary,t[101]=te,t[102]=re,t[103]=ie,t[104]=l,t[105]=De):De=t[105];let Oe;return t[106]!==H||t[107]!==Ee||t[108]!==De?(Oe=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":H,children:[Ee,De]}),t[106]=H,t[107]=Ee,t[108]=De,t[109]=Oe):Oe=t[109],Oe}function ot(){}function st(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function ct(e){return e&&C(e.run)?3e3:15e3}function lt(e){let t=(0,rt.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(P,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(Ce,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!Ae(n)?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Y.pause(n.id):Y.resume(n.id)),children:[n.enabled?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(re,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Y.runNow(n.id)),children:[(0,$.jsx)(re,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(ne,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(N,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Oe,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Y.remove(n.id))},children:[(0,$.jsx)(H,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(X,{children:(0,$.jsxs)(De,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(Se,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function ut({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(C);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(D,{className:`size-4`}):(0,$.jsx)(O,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:le(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:le(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:et(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Ae(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[Re(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,Me(e.trigger,n,r,i)]}),et(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(T,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(lt,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var dt=`xopc.automations.listWidth`,ft=272,pt=200,mt=560;function ht({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(dt));if(Number.isFinite(e)&&e>=pt&&e<=mt)return e}catch{}return ft});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(dt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(pt,Math.min(mt,t*.6,t-292));return Math.round(Math.max(pt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":pt,"aria-valuemax":mt,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(ft),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?pt:e.key===`End`?mt:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var gt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-CeHOmJqM.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193])));function _t(e){let t=(0,rt.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Y.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=J(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Y.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=J(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ue(),w;t[16]===S?w=t[17]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=w);let T=q(w),E=(0,Q.useRef)(!1),D,O;t[18]!==C||t[19]!==T?(D=()=>{E.current&&!T&&C(vt),E.current=T},O=[T,C],t[18]=C,t[19]=T,t[20]=D,t[21]=O):(D=t[20],O=t[21]),(0,Q.useEffect)(D,O);let k=a===`zh`,A;t[22]===a?A=t[23]:(A=f(a),t[22]=a,t[23]=A);let j=A,M;if(t[24]!==a||t[25]!==j.automations.status||t[26]!==o||t[27]!==i||t[28]!==k){let e;t[30]!==a||t[31]!==j.automations.status||t[32]!==o||t[33]!==k?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":k?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(k?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,j.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:k?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:tt(e,a)}):e.summary?(0,$.jsx)(z,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(He,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)($e,{runId:e.id,language:a})]})}),t[30]=a,t[31]=j.automations.status,t[32]=o,t[33]=k,t[34]=e):e=t[34],M=i.map(e),t[24]=a,t[25]=j.automations.status,t[26]=o,t[27]=i,t[28]=k,t[29]=M}else M=t[29];let N=M;if(m){let e=k?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=k?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(pe,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let P=k?`任务对话`:`Task conversation`,F;t[45]!==N||t[46]!==S?(F=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(gt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:N},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(W,{className:`h-20 w-2/3`}),(0,$.jsx)(W,{className:`h-28`})]}),t[45]=N,t[46]=S,t[47]=F):F=t[47];let I;return t[48]!==P||t[49]!==F?(I=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":P,children:F}),t[48]=P,t[49]=F,t[50]=I):I=t[50],I}function vt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var yt=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,bt=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function xt(e){let t=(0,rt.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(xe,{className:`absolute right-2.5`,children:(0,$.jsx)(E,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(ve,{value:n,className:yt,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function St(e){let t=(0,rt.c)(131),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=x||!!u,D=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,k;t[0]===_?k=t[1]:(k=()=>{_(``),C(!1),T.current?.focus()},t[0]=_,t[1]=k);let A=k,j=b?`定时任务`:`Scheduled tasks`,M;t[2]===j?M=t[3]:(M=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:j}),t[2]=j,t[3]=M);let N=b?`筛选任务`:`Filter tasks`,P=b?`筛选任务`:`Filter tasks`,F=D&&`text-accent-fg`,I;t[4]===F?I=t[5]:(I=le(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,F),t[4]=F,t[5]=I);let z;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(L,{className:`size-4`,"aria-hidden":!0}),t[6]=z):z=t[6];let ee;t[7]!==D||t[8]!==b?(ee=D?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=D,t[8]=b,t[9]=ee):ee=t[9];let te;t[10]!==N||t[11]!==P||t[12]!==I||t[13]!==ee?(te=(0,$.jsx)(Ce,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":N,title:P,className:I,children:[z,ee]})}),t[10]=N,t[11]=P,t[12]=I,t[13]=ee,t[14]=te):te=t[14];let ne=b?`状态`:`Status`,re;t[15]===ne?re=t[16]:(re=(0,$.jsx)(_e,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ne}),t[15]=ne,t[16]=re);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let ae=b?`全部状态`:`All statuses`,B;t[19]===ae?B=t[20]:(B=(0,$.jsx)(xt,{value:`all`,children:ae}),t[19]=ae,t[20]=B);let se;t[21]===r.filters.active?se=t[22]:(se=(0,$.jsx)(xt,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=se);let V;t[23]===r.paused?V=t[24]:(V=(0,$.jsx)(xt,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=V);let H=b?`已完成`:`Completed`,U;t[25]===H?U=t[26]:(U=(0,$.jsx)(xt,{value:`completed`,children:H}),t[25]=H,t[26]=U);let W;t[27]===r.metrics.running?W=t[28]:(W=(0,$.jsx)(xt,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=W);let G;t[29]===r.dashboard.needsAttention?G=t[30]:(G=(0,$.jsx)(xt,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=G);let K;t[31]!==i||t[32]!==ie||t[33]!==B||t[34]!==se||t[35]!==V||t[36]!==U||t[37]!==W||t[38]!==G?(K=(0,$.jsxs)(Ee,{value:i,onValueChange:ie,children:[B,se,V,U,W,G]}),t[31]=i,t[32]=ie,t[33]=B,t[34]=se,t[35]=V,t[36]=U,t[37]=W,t[38]=G,t[39]=K):K=t[39];let q;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[40]=q):q=t[40];let ue=b?`归属`:`Owner`,J;t[41]===ue?J=t[42]:(J=(0,$.jsx)(_e,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ue}),t[41]=ue,t[42]=J);let de;t[43]===m?de=t[44]:(de=e=>m(e),t[43]=m,t[44]=de);let fe=b?`我的任务`:`My tasks`,pe;t[45]===fe?pe=t[46]:(pe=(0,$.jsx)(xt,{value:`user`,children:fe}),t[45]=fe,t[46]=pe);let me=b?`系统任务`:`System tasks`,Y;t[47]===me?Y=t[48]:(Y=(0,$.jsx)(xt,{value:`system`,children:me}),t[47]=me,t[48]=Y);let he;t[49]!==a||t[50]!==de||t[51]!==pe||t[52]!==Y?(he=(0,$.jsxs)(Ee,{value:a,onValueChange:de,children:[pe,Y]}),t[49]=a,t[50]=de,t[51]=pe,t[52]=Y,t[53]=he):he=t[53];let ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[54]=ge):ge=t[54];let ve;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(ve=l?null:(0,$.jsxs)(ye,{children:[(0,$.jsxs)(we,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(X,{children:(0,$.jsx)(be,{sideOffset:4,className:bt,children:(0,$.jsxs)(Ee,{value:s,onValueChange:g,children:[(0,$.jsx)(xt,{value:``,children:r.filters.allProjects}),c.map(Ct)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=ve):ve=t[61];let xe=b?`任务类型`:`Task type`,ke;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=ke):ke=t[62];let Ae;t[63]===xe?Ae=t[64]:(Ae=(0,$.jsxs)(we,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[xe,ke]}),t[63]=xe,t[64]=Ae);let je;t[65]===h?je=t[66]:(je=e=>h(e),t[65]=h,t[66]=je);let Z=b?`全部类型`:`All types`,Me;t[67]===Z?Me=t[68]:(Me=(0,$.jsx)(xt,{value:`all`,children:Z}),t[67]=Z,t[68]=Me);let Ne;t[69]===r.sources.agent?Ne=t[70]:(Ne=(0,$.jsx)(xt,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Ne);let Pe;t[71]===r.sources.task?Pe=t[72]:(Pe=(0,$.jsx)(xt,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Pe);let Fe;t[73]!==o||t[74]!==je||t[75]!==Me||t[76]!==Ne||t[77]!==Pe?(Fe=(0,$.jsx)(X,{children:(0,$.jsx)(be,{sideOffset:4,className:bt,children:(0,$.jsxs)(Ee,{value:o,onValueChange:je,children:[Me,Ne,Pe]})})}),t[73]=o,t[74]=je,t[75]=Me,t[76]=Ne,t[77]=Pe,t[78]=Fe):Fe=t[78];let Ie;t[79]!==Ae||t[80]!==Fe?(Ie=(0,$.jsxs)(ye,{children:[Ae,Fe]}),t[79]=Ae,t[80]=Fe,t[81]=Ie):Ie=t[81];let Le;t[82]!==D||t[83]!==v||t[84]!==u||t[85]!==b?(Le=D||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),(0,$.jsx)(Te,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[82]=D,t[83]=v,t[84]=u,t[85]=b,t[86]=Le):Le=t[86];let Re;t[87]!==re||t[88]!==K||t[89]!==J||t[90]!==he||t[91]!==ve||t[92]!==Ie||t[93]!==Le?(Re=(0,$.jsx)(X,{children:(0,$.jsxs)(De,{align:`end`,sideOffset:6,className:bt,children:[re,K,q,J,he,ge,ve,Ie,Le]})}),t[87]=re,t[88]=K,t[89]=J,t[90]=he,t[91]=ve,t[92]=Ie,t[93]=Le,t[94]=Re):Re=t[94];let ze;t[95]!==te||t[96]!==Re?(ze=(0,$.jsxs)(Se,{children:[te,Re]}),t[95]=te,t[96]=Re,t[97]=ze):ze=t[97];let Be=b?`搜索任务`:`Search tasks`,Ve=b?`搜索任务`:`Search tasks`,He;t[98]!==A||t[99]!==E?(He=()=>{E?A():(C(!0),requestAnimationFrame(()=>w.current?.focus()))},t[98]=A,t[99]=E,t[100]=He):He=t[100];let Ue=E&&`bg-surface-hover text-fg`,We;t[101]===Ue?We=t[102]:(We=le(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,Ue),t[101]=Ue,t[102]=We);let Ge;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(oe,{className:`size-4`,"aria-hidden":!0}),t[103]=Ge):Ge=t[103];let Ke;t[104]!==E||t[105]!==Be||t[106]!==Ve||t[107]!==He||t[108]!==We?(Ke=(0,$.jsx)(`button`,{ref:T,type:`button`,"aria-label":Be,title:Ve,"aria-expanded":E,onClick:He,className:We,children:Ge}),t[104]=E,t[105]=Be,t[106]=Ve,t[107]=He,t[108]=We,t[109]=Ke):Ke=t[109];let qe;t[110]!==ze||t[111]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[ze,Ke]}),t[110]=ze,t[111]=Ke,t[112]=qe):qe=t[112];let Je;t[113]!==M||t[114]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[M,qe]}),t[113]=M,t[114]=qe,t[115]=Je):Je=t[115];let Ye;t[116]!==r.filters.markAllRead||t[117]!==f||t[118]!==y||t[119]!==d?(Ye=d>0?(0,$.jsxs)(`button`,{type:`button`,disabled:f,onClick:y,className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50`,"aria-busy":f,children:[f?(0,$.jsx)(R,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.filters.markAllRead]}):null,t[116]=r.filters.markAllRead,t[117]=f,t[118]=y,t[119]=d,t[120]=Ye):Ye=t[120];let Xe;t[121]!==A||t[122]!==_||t[123]!==u||t[124]!==E||t[125]!==b?(Xe=E?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(oe,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:w,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:A,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[121]=A,t[122]=_,t[123]=u,t[124]=E,t[125]=b,t[126]=Xe):Xe=t[126];let Ze;return t[127]!==Je||t[128]!==Ye||t[129]!==Xe?(Ze=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye,Xe]}),t[127]=Je,t[128]=Ye,t[129]=Xe,t[130]=Ze):Ze=t[130],Ze}function Ct(e){return(0,$.jsx)(xt,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var wt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Tt(e=Math.random){let t=[...wt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function Et({language:e,projectId:t,onOpenConversation:n}){let r=s(),[i,a]=(0,Q.useState)(!1),[o,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await We({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Tt),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(x,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Tt()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),o?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:o}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function Dt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function Ot(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function kt(e,t={}){let n=Dt(e.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-C3ttsYGZ.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-BY-fRY-q.js","assets/messages-DFCLetQl.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/archive-Dz0hferG.js","assets/arrow-left-D880xG-P.js","assets/voice-call-context-CJ1ZiJWR.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-CQvcSORB.js","assets/activity-YogQEteU.js","assets/bot-DjLkhyZL.js","assets/circle-check-C23XjkUj.js","assets/circle-pause-CN9jYH2s.js","assets/clock-3-DnrAnuyZ.js","assets/external-link-DjqjBmc3.js","assets/notes-api-32qiHxz2.js","assets/download-Dk-ZjtO6.js","assets/markdown-view-ClNfoiYC.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-CdD448kS.js","assets/product-delivery-DRyD9_Xq.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/chat-chart-block-BBchFbUa.js","assets/check-DUBLcKHA.js","assets/copy-Dv6d4Dvw.js","assets/skeleton-DzdOeGYz.js","assets/loader-circle-CifKLtgG.js","assets/message-square-fVE7Ghj1.js","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/rotate-ccw-JM1TBLpp.js","assets/rotate-cw-LIg3Am9S.js","assets/sparkles-DHlfQFAF.js","assets/triangle-alert-2JXFNNKU.js","assets/volume-2-BSJhAY97.js","assets/zap-dximCGjy.js","assets/vendor-swr-CdRzEUwF.js","assets/button-Cc4hUNTt.js","assets/automation-api-B3df53ms.js","assets/earth-C9Z4bTTG.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-5EsBeKBO.js","assets/file-archive-DanfQJNe.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/popover-select-CLsphyzA.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/new-chat-navigation-B6NPQ4h4.js","assets/circle-x-DFsCKeya.js","assets/circle-BoO4YvTx.js","assets/file-tree-utils-DJs1faGv.js","assets/database-CjjeZfRG.js","assets/ellipsis-0k4rZLoy.js","assets/file-BqMS_3DT.js","assets/file-text-D12HbeVy.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-open-CyzJ19I9.js","assets/folder-CN-pC3XL.js","assets/use-file-preview-expanded-M7LSoDLc.js","assets/eye-CABVeTq0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/constants-CsVXarqA.js","assets/session-api-CgTDekPG.js","assets/gateway-startup-retry-Du7l0oxt.js","assets/attachment-utils-core-BIOUBrpT.js","assets/activity-store-D_KDDoA1.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-BmUCKePi.js","assets/files-BNL4kkSB.js","assets/dist-ZrL34Ps4.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/history-DXH_9jsE.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/mic-CuUb7zc-.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-Brl22l1N.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-CqyteNnT.js","assets/gateway-config-swr-Db2fE-gT.js","assets/oauth-provider-connect-XzlLkqnK.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-CESzQ_tk.js","assets/registry-api-BnEoY6_B.js","assets/oauth-api-CMpfoRed.js","assets/connection-usage-guide-De6QJt8B.js","assets/connection-usage-BhdQRWgQ.js","assets/settings-2-D-csvaET.js","assets/settings-uiTATseT.js","assets/shield-check-BU58siTV.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/trash-2-DusmjVPV.js","assets/share-link-dialog-B1g7Xero.js","assets/copy-text-row-CpiRzq4G.js","assets/wrench-DFb4r8bH.js","assets/tasks-D_xuHn6V.js","assets/specialists-xbB3xL9e.js","assets/api-pQXrYBTk.js","assets/session-manager-V8cj3NVD.js","assets/local-session-drafts-oWhYPECv.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/gateway-realtime-nI6k8qP8.js","assets/gateway-realtime-store-CjYSSi_l.js","assets/agents-admin-api-D0qHxAok.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-D5L3t0e3.js","assets/capabilities-Bt1fAcDI.js","assets/theme-store-C57ZxHqm.js","assets/middleware-Pd0e8Igk.js","assets/use-composer-attachments-R6kKpDgc.js","assets/chevron-left-DqFhpbvK.js","assets/capabilities-Bu7efUpH.js","assets/file-preview-surface-Bfqc0ZKv.js","assets/phone-workspace-store-D1BS7otl.js","assets/shares-api-DXOD--vt.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/chat-agents-api-SruH_oEQ.js","assets/composer-payload-handoff-RaEQXTjj.js","assets/voice-transcribe-api-B2NVJYnu.js","assets/open-capability-settings-Cvb65hQB.js","assets/workspace-editor-agent-store-Sy1CLe2K.js","assets/voice-input-shortcut-events-04u9YoRg.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-YQmN1S2k.js","assets/page-header-store-BNjlQHqU.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/agent-avatar-display-Dm1YHaAt.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-D7dQJytv.js","assets/command-palette-api-r8U5soT7.js","assets/skill-list-api-CJBrtxil.js","assets/skill-api-utils-C7V4JVXM.js","assets/model-selector-DkytsBae.js","assets/model-sort-_Tz8s_4N.js","assets/automation-task-card-C2mxNw5Q.js","assets/calendar-clock-D-quYVPe.js","assets/message-circle-Badhj-4D.js","assets/date-picker-CB6IVCiq.js","assets/calendar-days-hw_Y-g-s.js","assets/dev-view-store-BxPWx1Gi.js","assets/extension-iframe-host-B0rM3Ohp.js","assets/api-uriioEZx.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-DBC-pqGy.js","assets/agents-app-path-ciChvpCS.js","assets/agent-display-names-Bje7vfSn.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-CrgFs0h3.js","assets/management-api-BzdYxqsC.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as c,i as l,l as u,n as d}from"./locale-store-BY-fRY-q.js";import{t as f}from"./messages-DFCLetQl.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{t as x}from"./calendar-clock-D-quYVPe.js";import{i as S,n as C,r as w,t as T}from"./automation-run-list-DrJfwJN_.js";import{t as E}from"./check-DUBLcKHA.js";import{t as D}from"./chevron-down-ccbiQQz_.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A}from"./popover-select-CLsphyzA.js";import{t as j}from"./circle-alert-BEjgurr2.js";import{t as M}from"./circle-check-C23XjkUj.js";import{t as N}from"./copy-Dv6d4Dvw.js";import{t as P}from"./ellipsis-0k4rZLoy.js";import{t as F}from"./eye-CABVeTq0.js";import{t as I}from"./git-branch-Dh9uxTot.js";import{t as L}from"./list-filter-CIPvpfLA.js";import{t as R}from"./loader-circle-CifKLtgG.js";import{t as z}from"./markdown-view-ClNfoiYC.js";import{t as ee}from"./message-circle-Badhj-4D.js";import{t as te}from"./pause-DuPxgSxk.js";import{t as ne}from"./pencil-DmIY3Oa-.js";import{t as re}from"./play-kxZvpBg8.js";import{t as ie}from"./plus-Q2yW6OE7.js";import{t as ae}from"./refresh-cw-BRlGaq2w.js";import{t as oe}from"./search-DA7gz22f.js";import{t as B}from"./shield-check-BU58siTV.js";import{t as se}from"./sparkles-DHlfQFAF.js";import{t as V}from"./square-pen-B8FsvqNu.js";import{t as H}from"./trash-2-DusmjVPV.js";import{t as ce}from"./x-B_N4OPjy.js";import{t as U}from"./zap-dximCGjy.js";import{t as le}from"./cn-0WouolD0.js";import{t as W}from"./skeleton-DzdOeGYz.js";import{d as G}from"./api-pQXrYBTk.js";import{a as K}from"./session-api-CgTDekPG.js";import{T as q}from"./session-manager-V8cj3NVD.js";import{a as ue,i as J,o as de}from"./vendor-swr-CdRzEUwF.js";import{t as fe}from"./chat-agents-api-SruH_oEQ.js";import{t as pe}from"./button-Cc4hUNTt.js";import{t as me}from"./page-header-store-BNjlQHqU.js";import{t as Y}from"./automation-api-B3df53ms.js";import{t as he}from"./sliding-tab-list-CmcrqRzN.js";import{t as ge}from"./refresh-button-DiWdGAaX.js";import{a as _e,c as ve,d as ye,f as be,i as xe,l as Se,m as Ce,o as X,p as we,r as Te,s as Ee,t as De,u as Oe}from"./dist-ZrL34Ps4.js";import{n as ke}from"./model-selector-DkytsBae.js";import{C as Ae,S as je,T as Z,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,l as Be,m as Ve,n as He,o as Ue,p as We,r as Ge,s as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./automation-task-card-C2mxNw5Q.js";import{n as Qe}from"./agent-display-names-Bje7vfSn.js";import{i as $e,n as et,r as tt,t as nt}from"./automation-result-state-CpgaWu2r.js";var rt=n(),Q=e(t(),1),$=r(),it=(0,Q.lazy)(()=>i(()=>import(`./chat-page-C3ttsYGZ.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194])));function at(e){let t=(0,rt.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ue(),w=(0,Q.useRef)(!1),T=i??``,E;t[2]!==r||t[3]!==n||t[4]!==T?(E=[`automation-execution`,r,n,T],t[2]=r,t[3]=n,t[4]=T,t[5]=E):E=t[5];let D;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(D=async()=>{let{run:e}=await Y.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Y.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=D):D=t[10];let O;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(O={refreshInterval:ct,shouldRetryOnError:!1},t[11]=O):O=t[11];let{data:k,error:A,mutate:j}=J(E,D,O),M=k?.run,N=M?.conversationId,P;t[12]===N?P=t[13]:(P=e=>!!(N&&(e.sessions[N]?.streaming||e.sessions[N]?.sending)),t[12]=N,t[13]=P);let F=q(P),I;t[14]===N?I=t[15]:(I=N?[`automation-execution-session`,N]:null,t[14]=N,t[15]=I);let L;t[16]===N?L=t[17]:(L=()=>K(N),t[16]=N,t[17]=L);let R;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(R={shouldRetryOnError:!1},t[18]=R):R=t[18];let{data:ee,error:te,mutate:ne}=J(I,L,R),re=M?.conversationShared||k?.automation.conversationMode===`continuous`||ee?.customData?.latestAutomationRunId!==void 0&&ee.customData.latestAutomationRunId!==n,ie=!!(ee&&(!re||u)),ae=!A&&!!(M&&(!N||re&&!u&&ee&&!te&&(M?.summary||M?.error)||ee&&!te&&p)),oe,B;if(t[19]!==ae||t[20]!==j||t[21]!==S||t[22]!==M?(oe=()=>{!M||!ae||C(M)||M.readAtMs!=null||w.current||(w.current=!0,Y.markRunRead(M.id).then(async()=>{await Promise.all([j(),S(st)])}).catch(ot).finally(()=>{w.current=!1}))},B=[M,ae,j,S],t[19]=ae,t[20]=j,t[21]=S,t[22]=M,t[23]=oe,t[24]=B):(oe=t[23],B=t[24]),(0,Q.useEffect)(oe,B),A){let e=A instanceof Error?A.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===j?r=t[28]:(r=()=>void j(),t[27]=j,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(pe,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(pe,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!M){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(W,{className:`h-6 w-2/3`}),(0,$.jsx)(W,{className:`h-20`})]}),t[39]=e):e=t[39],e}let se;t[40]===M?se=t[41]:(se=C(M),t[40]=M,t[41]=se);let V=se,H=l?`执行会话`:`Execution conversation`,ce=l?`返回自动化`:`Back to automation`,U;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(b,{className:`size-4`}),t[42]=U):U=t[42];let le;t[43]!==c||t[44]!==ce?(le=(0,$.jsx)(pe,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":ce,children:U}),t[43]=c,t[44]=ce,t[45]=le):le=t[45];let G;t[46]===M.automationName?G=t[47]:(G=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:M.automationName}),t[46]=M.automationName,t[47]=G);let de;t[48]!==le||t[49]!==G?(de=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[le,G]}),t[48]=le,t[49]=G,t[50]=de):de=t[50];let fe;t[51]!==M.createdAtMs||t[52]!==l?(fe=new Date(M.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=M.createdAtMs,t[52]=l,t[53]=fe):fe=t[53];let me;t[54]===a?me=t[55]:(me=f(a),t[54]=a,t[55]=me);let he=me.automations.status[M.status],ge;t[56]!==fe||t[57]!==he?(ge=(0,$.jsxs)(`span`,{children:[fe,` · `,he]}),t[56]=fe,t[57]=he,t[58]=ge):ge=t[58];let _e;t[59]!==s||t[60]!==M.id?(_e=()=>s(M.id),t[59]=s,t[60]=M.id,t[61]=_e):_e=t[61];let ve=l?`运行详情`:`Run details`,ye;t[62]!==_e||t[63]!==ve?(ye=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:_e,children:ve}),t[62]=_e,t[63]=ve,t[64]=ye):ye=t[64];let be;t[65]!==o||t[66]!==M?(be=()=>o(M),t[65]=o,t[66]=M,t[67]=be):be=t[67];let xe=l?`调整自动化`:`Adjust automation`,Se;t[68]!==be||t[69]!==xe?(Se=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:be,children:xe}),t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==ge||t[72]!==ye||t[73]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[ge,ye,Se]}),t[71]=ge,t[72]=ye,t[73]=Se,t[74]=Ce):Ce=t[74];let X;t[75]!==k?.automation||t[76]!==re||t[77]!==l?(X=re?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,k?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=k?.automation,t[76]=re,t[77]=l,t[78]=X):X=t[78];let we;t[79]!==h||t[80]!==u||t[81]!==l?(we=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=we):we=t[82];let Te;t[83]!==V||t[84]!==l?(Te=V?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=V,t[84]=l,t[85]=Te):Te=t[85];let Ee;t[86]!==de||t[87]!==Ce||t[88]!==X||t[89]!==we||t[90]!==Te?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[de,Ce,X,we,Te]}),t[86]=de,t[87]=Ce,t[88]=X,t[89]=we,t[90]=Te,t[91]=Ee):Ee=t[91];let De;t[92]!==V||t[93]!==N||t[94]!==F||t[95]!==ee||t[96]!==a||t[97]!==ne||t[98]!==M.error||t[99]!==M.id||t[100]!==M.summary||t[101]!==te||t[102]!==re||t[103]!==ie||t[104]!==l?(De=ie?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(it,{embedded:!0,automationExecution:!0,conversationId:N,readOnly:V||F,onHistoryReady:x,initialTurnId:re?M.id:void 0,onInitialTurnLocated:v},N)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[M.summary?(0,$.jsx)(z,{content:M.summary}):null,M.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:M.error}):null,N?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:V?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),N&&!ee&&!te?(0,$.jsx)(W,{className:`h-24`}):null,te?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:te.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(pe,{onClick:()=>void ne(),children:l?`重试`:`Retry`})]}):null,re&&ee?(0,$.jsx)(pe,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,V?null:(0,$.jsx)($e,{runId:M.id,language:a})]}),t[92]=V,t[93]=N,t[94]=F,t[95]=ee,t[96]=a,t[97]=ne,t[98]=M.error,t[99]=M.id,t[100]=M.summary,t[101]=te,t[102]=re,t[103]=ie,t[104]=l,t[105]=De):De=t[105];let Oe;return t[106]!==H||t[107]!==Ee||t[108]!==De?(Oe=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":H,children:[Ee,De]}),t[106]=H,t[107]=Ee,t[108]=De,t[109]=Oe):Oe=t[109],Oe}function ot(){}function st(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function ct(e){return e&&C(e.run)?3e3:15e3}function lt(e){let t=(0,rt.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(P,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(Ce,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!Ae(n)?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Y.pause(n.id):Y.resume(n.id)),children:[n.enabled?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(re,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Y.runNow(n.id)),children:[(0,$.jsx)(re,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(ne,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(N,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Oe,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(Te,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Y.remove(n.id))},children:[(0,$.jsx)(H,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(X,{children:(0,$.jsxs)(De,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(Se,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function ut({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(C);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(D,{className:`size-4`}):(0,$.jsx)(O,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:le(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:le(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:et(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Ae(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[Re(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,Me(e.trigger,n,r,i)]}),et(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(T,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(lt,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var dt=`xopc.automations.listWidth`,ft=272,pt=200,mt=560;function ht({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(dt));if(Number.isFinite(e)&&e>=pt&&e<=mt)return e}catch{}return ft});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(dt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(pt,Math.min(mt,t*.6,t-292));return Math.round(Math.max(pt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":pt,"aria-valuemax":mt,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(ft),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?pt:e.key===`End`?mt:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var gt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-C3ttsYGZ.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194])));function _t(e){let t=(0,rt.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Y.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=J(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Y.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=J(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ue(),w;t[16]===S?w=t[17]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=w);let T=q(w),E=(0,Q.useRef)(!1),D,O;t[18]!==C||t[19]!==T?(D=()=>{E.current&&!T&&C(vt),E.current=T},O=[T,C],t[18]=C,t[19]=T,t[20]=D,t[21]=O):(D=t[20],O=t[21]),(0,Q.useEffect)(D,O);let k=a===`zh`,A;t[22]===a?A=t[23]:(A=f(a),t[22]=a,t[23]=A);let j=A,M;if(t[24]!==a||t[25]!==j.automations.status||t[26]!==o||t[27]!==i||t[28]!==k){let e;t[30]!==a||t[31]!==j.automations.status||t[32]!==o||t[33]!==k?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":k?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(k?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,j.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:k?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:tt(e,a)}):e.summary?(0,$.jsx)(z,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(He,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)($e,{runId:e.id,language:a})]})}),t[30]=a,t[31]=j.automations.status,t[32]=o,t[33]=k,t[34]=e):e=t[34],M=i.map(e),t[24]=a,t[25]=j.automations.status,t[26]=o,t[27]=i,t[28]=k,t[29]=M}else M=t[29];let N=M;if(m){let e=k?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=k?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(pe,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let P=k?`任务对话`:`Task conversation`,F;t[45]!==N||t[46]!==S?(F=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(gt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:N},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(W,{className:`h-20 w-2/3`}),(0,$.jsx)(W,{className:`h-28`})]}),t[45]=N,t[46]=S,t[47]=F):F=t[47];let I;return t[48]!==P||t[49]!==F?(I=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":P,children:F}),t[48]=P,t[49]=F,t[50]=I):I=t[50],I}function vt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var yt=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,bt=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function xt(e){let t=(0,rt.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(xe,{className:`absolute right-2.5`,children:(0,$.jsx)(E,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(ve,{value:n,className:yt,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function St(e){let t=(0,rt.c)(131),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=x||!!u,D=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,k;t[0]===_?k=t[1]:(k=()=>{_(``),C(!1),T.current?.focus()},t[0]=_,t[1]=k);let A=k,j=b?`定时任务`:`Scheduled tasks`,M;t[2]===j?M=t[3]:(M=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:j}),t[2]=j,t[3]=M);let N=b?`筛选任务`:`Filter tasks`,P=b?`筛选任务`:`Filter tasks`,F=D&&`text-accent-fg`,I;t[4]===F?I=t[5]:(I=le(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,F),t[4]=F,t[5]=I);let z;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(L,{className:`size-4`,"aria-hidden":!0}),t[6]=z):z=t[6];let ee;t[7]!==D||t[8]!==b?(ee=D?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=D,t[8]=b,t[9]=ee):ee=t[9];let te;t[10]!==N||t[11]!==P||t[12]!==I||t[13]!==ee?(te=(0,$.jsx)(Ce,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":N,title:P,className:I,children:[z,ee]})}),t[10]=N,t[11]=P,t[12]=I,t[13]=ee,t[14]=te):te=t[14];let ne=b?`状态`:`Status`,re;t[15]===ne?re=t[16]:(re=(0,$.jsx)(_e,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ne}),t[15]=ne,t[16]=re);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let ae=b?`全部状态`:`All statuses`,B;t[19]===ae?B=t[20]:(B=(0,$.jsx)(xt,{value:`all`,children:ae}),t[19]=ae,t[20]=B);let se;t[21]===r.filters.active?se=t[22]:(se=(0,$.jsx)(xt,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=se);let V;t[23]===r.paused?V=t[24]:(V=(0,$.jsx)(xt,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=V);let H=b?`已完成`:`Completed`,U;t[25]===H?U=t[26]:(U=(0,$.jsx)(xt,{value:`completed`,children:H}),t[25]=H,t[26]=U);let W;t[27]===r.metrics.running?W=t[28]:(W=(0,$.jsx)(xt,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=W);let G;t[29]===r.dashboard.needsAttention?G=t[30]:(G=(0,$.jsx)(xt,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=G);let K;t[31]!==i||t[32]!==ie||t[33]!==B||t[34]!==se||t[35]!==V||t[36]!==U||t[37]!==W||t[38]!==G?(K=(0,$.jsxs)(Ee,{value:i,onValueChange:ie,children:[B,se,V,U,W,G]}),t[31]=i,t[32]=ie,t[33]=B,t[34]=se,t[35]=V,t[36]=U,t[37]=W,t[38]=G,t[39]=K):K=t[39];let q;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[40]=q):q=t[40];let ue=b?`归属`:`Owner`,J;t[41]===ue?J=t[42]:(J=(0,$.jsx)(_e,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ue}),t[41]=ue,t[42]=J);let de;t[43]===m?de=t[44]:(de=e=>m(e),t[43]=m,t[44]=de);let fe=b?`我的任务`:`My tasks`,pe;t[45]===fe?pe=t[46]:(pe=(0,$.jsx)(xt,{value:`user`,children:fe}),t[45]=fe,t[46]=pe);let me=b?`系统任务`:`System tasks`,Y;t[47]===me?Y=t[48]:(Y=(0,$.jsx)(xt,{value:`system`,children:me}),t[47]=me,t[48]=Y);let he;t[49]!==a||t[50]!==de||t[51]!==pe||t[52]!==Y?(he=(0,$.jsxs)(Ee,{value:a,onValueChange:de,children:[pe,Y]}),t[49]=a,t[50]=de,t[51]=pe,t[52]=Y,t[53]=he):he=t[53];let ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[54]=ge):ge=t[54];let ve;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(ve=l?null:(0,$.jsxs)(ye,{children:[(0,$.jsxs)(we,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(X,{children:(0,$.jsx)(be,{sideOffset:4,className:bt,children:(0,$.jsxs)(Ee,{value:s,onValueChange:g,children:[(0,$.jsx)(xt,{value:``,children:r.filters.allProjects}),c.map(Ct)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=ve):ve=t[61];let xe=b?`任务类型`:`Task type`,ke;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=ke):ke=t[62];let Ae;t[63]===xe?Ae=t[64]:(Ae=(0,$.jsxs)(we,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[xe,ke]}),t[63]=xe,t[64]=Ae);let je;t[65]===h?je=t[66]:(je=e=>h(e),t[65]=h,t[66]=je);let Z=b?`全部类型`:`All types`,Me;t[67]===Z?Me=t[68]:(Me=(0,$.jsx)(xt,{value:`all`,children:Z}),t[67]=Z,t[68]=Me);let Ne;t[69]===r.sources.agent?Ne=t[70]:(Ne=(0,$.jsx)(xt,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Ne);let Pe;t[71]===r.sources.task?Pe=t[72]:(Pe=(0,$.jsx)(xt,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Pe);let Fe;t[73]!==o||t[74]!==je||t[75]!==Me||t[76]!==Ne||t[77]!==Pe?(Fe=(0,$.jsx)(X,{children:(0,$.jsx)(be,{sideOffset:4,className:bt,children:(0,$.jsxs)(Ee,{value:o,onValueChange:je,children:[Me,Ne,Pe]})})}),t[73]=o,t[74]=je,t[75]=Me,t[76]=Ne,t[77]=Pe,t[78]=Fe):Fe=t[78];let Ie;t[79]!==Ae||t[80]!==Fe?(Ie=(0,$.jsxs)(ye,{children:[Ae,Fe]}),t[79]=Ae,t[80]=Fe,t[81]=Ie):Ie=t[81];let Le;t[82]!==D||t[83]!==v||t[84]!==u||t[85]!==b?(Le=D||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),(0,$.jsx)(Te,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[82]=D,t[83]=v,t[84]=u,t[85]=b,t[86]=Le):Le=t[86];let Re;t[87]!==re||t[88]!==K||t[89]!==J||t[90]!==he||t[91]!==ve||t[92]!==Ie||t[93]!==Le?(Re=(0,$.jsx)(X,{children:(0,$.jsxs)(De,{align:`end`,sideOffset:6,className:bt,children:[re,K,q,J,he,ge,ve,Ie,Le]})}),t[87]=re,t[88]=K,t[89]=J,t[90]=he,t[91]=ve,t[92]=Ie,t[93]=Le,t[94]=Re):Re=t[94];let ze;t[95]!==te||t[96]!==Re?(ze=(0,$.jsxs)(Se,{children:[te,Re]}),t[95]=te,t[96]=Re,t[97]=ze):ze=t[97];let Be=b?`搜索任务`:`Search tasks`,Ve=b?`搜索任务`:`Search tasks`,He;t[98]!==A||t[99]!==E?(He=()=>{E?A():(C(!0),requestAnimationFrame(()=>w.current?.focus()))},t[98]=A,t[99]=E,t[100]=He):He=t[100];let Ue=E&&`bg-surface-hover text-fg`,We;t[101]===Ue?We=t[102]:(We=le(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,Ue),t[101]=Ue,t[102]=We);let Ge;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(oe,{className:`size-4`,"aria-hidden":!0}),t[103]=Ge):Ge=t[103];let Ke;t[104]!==E||t[105]!==Be||t[106]!==Ve||t[107]!==He||t[108]!==We?(Ke=(0,$.jsx)(`button`,{ref:T,type:`button`,"aria-label":Be,title:Ve,"aria-expanded":E,onClick:He,className:We,children:Ge}),t[104]=E,t[105]=Be,t[106]=Ve,t[107]=He,t[108]=We,t[109]=Ke):Ke=t[109];let qe;t[110]!==ze||t[111]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[ze,Ke]}),t[110]=ze,t[111]=Ke,t[112]=qe):qe=t[112];let Je;t[113]!==M||t[114]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[M,qe]}),t[113]=M,t[114]=qe,t[115]=Je):Je=t[115];let Ye;t[116]!==r.filters.markAllRead||t[117]!==f||t[118]!==y||t[119]!==d?(Ye=d>0?(0,$.jsxs)(`button`,{type:`button`,disabled:f,onClick:y,className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50`,"aria-busy":f,children:[f?(0,$.jsx)(R,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.filters.markAllRead]}):null,t[116]=r.filters.markAllRead,t[117]=f,t[118]=y,t[119]=d,t[120]=Ye):Ye=t[120];let Xe;t[121]!==A||t[122]!==_||t[123]!==u||t[124]!==E||t[125]!==b?(Xe=E?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(oe,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:w,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:A,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[121]=A,t[122]=_,t[123]=u,t[124]=E,t[125]=b,t[126]=Xe):Xe=t[126];let Ze;return t[127]!==Je||t[128]!==Ye||t[129]!==Xe?(Ze=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye,Xe]}),t[127]=Je,t[128]=Ye,t[129]=Xe,t[130]=Ze):Ze=t[130],Ze}function Ct(e){return(0,$.jsx)(xt,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var wt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Tt(e=Math.random){let t=[...wt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function Et({language:e,projectId:t,onOpenConversation:n}){let r=s(),[i,a]=(0,Q.useState)(!1),[o,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await We({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Tt),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(x,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Tt()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),o?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:o}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function Dt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function Ot(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function kt(e,t={}){let n=Dt(e.split(`
|
|
3
3
|
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
|
|
4
4
|
`));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(Ot(n));return null}async function At(e,t={}){let n=await c(l(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=kt(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=kt(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let u=o.trim();if(!u)throw Error(`AI returned an empty suggestion`);return{text:u,thinking:s.trim()||void 0}}function jt(){let[e,t]=(0,Q.useState)(``),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,Q.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await At(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){let t=e instanceof Error?e.message:`AI suggestion failed`;return s(t),null}finally{a(!1)}},[]),reset:(0,Q.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var Mt=5;function Nt(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function Pt(e){let t=(0,rt.c)(245),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:o,format:s,intent:c,locale:l,context:u,disabled:d,className:f,showLabel:y}=e,b=o===void 0?`generic.text`:o,x=s===void 0?`plain`:s,S=c===void 0?`improve`:c,C=y===void 0||y,[w,T]=(0,Q.useState)(!1),[E,O]=(0,Q.useState)(n),[k,A]=(0,Q.useState)(`preview`),[j,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(`edit`),[I,L]=(0,Q.useState)(!0),[R,ee]=(0,Q.useState)(!1),[te,ne]=(0,Q.useState)(null),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(!0),{suggestion:oe,thinking:B,loading:H,error:U,generate:W,reset:G}=jt(),K;t[0]===l?K=t[1]:(K=Nt(l),t[0]=l,t[1]=K);let q=K,ue;t[2]!==H||t[3]!==B?(ue=H&&B.trim().length>0,t[2]=H,t[3]=B,t[4]=ue):ue=t[4];let J=ue,de,fe;t[5]!==w||t[6]!==n?(de=()=>{w||O(n)},fe=[w,n],t[5]=w,t[6]=n,t[7]=de,t[8]=fe):(de=t[7],fe=t[8]),(0,Q.useEffect)(de,fe);let me,Y;t[9]===oe?(me=t[10],Y=t[11]):(Y=()=>{M(oe)},me=[oe],t[9]=oe,t[10]=me,t[11]=Y),(0,Q.useEffect)(Y,me);let ge,_e;t[12]===B?(ge=t[13],_e=t[14]):(ge=()=>{B.trim()&&L(!0)},_e=[B],t[12]=B,t[13]=ge,t[14]=_e),(0,Q.useEffect)(ge,_e);let ve;t[15]!==J||t[16]!==I?(ve=()=>{let e=re.current;!e||!J||!I||ie.current&&(e.scrollTop=e.scrollHeight)},t[15]=J,t[16]=I,t[17]=ve):ve=t[17];let ye;t[18]!==J||t[19]!==B||t[20]!==I?(ye=[J,B,I],t[18]=J,t[19]=B,t[20]=I,t[21]=ye):ye=t[21],(0,Q.useLayoutEffect)(ve,ye);let be;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>{let e=re.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;ie.current=t<=Mt},t[22]=be):be=t[22];let xe=be,Se;t[23]!==u||t[24]!==i||t[25]!==a||t[26]!==x||t[27]!==W||t[28]!==S||t[29]!==l||t[30]!==b?(Se=async e=>{P(`edit`),L(!0),ie.current=!0,await W({intent:S,scenario:b,input:e,locale:l,field:{id:i,label:a,format:x},context:u})},t[23]=u,t[24]=i,t[25]=a,t[26]=x,t[27]=W,t[28]=S,t[29]=l,t[30]=b,t[31]=Se):Se=t[31];let Ce=Se,X;t[32]!==G||t[33]!==n?(X=e=>{ee(!!e.currentTarget.closest(`[role="dialog"]`)),ne(document.querySelector(`.app-main-surface`)),O(n),A(`preview`),M(``),P(`edit`),L(!0),G(),T(!0)},t[32]=G,t[33]=n,t[34]=X):X=t[34];let we=X,Te;t[35]!==E||t[36]!==Ce?(Te=async()=>{await Ce(E)},t[35]=E,t[36]=Ce,t[37]=Te):Te=t[37];let Ee=Te,De;t[38]!==G||t[39]!==n?(De=()=>{T(!1),O(n),A(`preview`),M(``),P(`edit`),L(!0),G()},t[38]=G,t[39]=n,t[40]=De):De=t[40];let Oe=De,ke;t[41]!==Oe||t[42]!==E||t[43]!==r?(ke=()=>{r(E),Oe()},t[41]=Oe,t[42]=E,t[43]=r,t[44]=ke):ke=t[44];let Ae=ke,je;t[45]!==Oe||t[46]!==j||t[47]!==r?(je=()=>{j.trim()&&(r(j),Oe())},t[45]=Oe,t[46]=j,t[47]=r,t[48]=je):je=t[48];let Z=je,Me;t[49]!==Oe||t[50]!==E||t[51]!==j||t[52]!==r?(Me=()=>{if(!j.trim())return;let e=E.trimEnd();r(e?`${e}\n\n${j}`:j),Oe()},t[49]=Oe,t[50]=E,t[51]=j,t[52]=r,t[53]=Me):Me=t[53];let Ne=Me,Pe;t[54]!==j||t[55]!==U||t[56]!==H?(Pe=!H&&!U&&j.trim().length>0,t[54]=j,t[55]=U,t[56]=H,t[57]=Pe):Pe=t[57];let Fe=Pe,Ie=E!==n,Le;t[58]!==j||t[59]!==U||t[60]!==B?(Le=j.trim().length>0||B.trim().length>0||!!U,t[58]=j,t[59]=U,t[60]=B,t[61]=Le):Le=t[61];let Re=Le,ze=!C&&`size-7 p-0`,Be;t[62]!==f||t[63]!==ze?(Be=le(`h-7 gap-1 px-2 text-xs`,ze,f),t[62]=f,t[63]=ze,t[64]=Be):Be=t[64];let Ve=d||H,He;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,$.jsx)(se,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=He):He=t[65];let Ue=C?q.buttonTitle:null,We;t[66]!==q.buttonTitle||t[67]!==we||t[68]!==Be||t[69]!==Ve||t[70]!==Ue?(We=(0,$.jsxs)(pe,{type:`button`,variant:`ghost`,className:Be,title:q.buttonTitle,"aria-label":q.buttonTitle,disabled:Ve,onClick:we,children:[He,Ue]}),t[66]=q.buttonTitle,t[67]=we,t[68]=Be,t[69]=Ve,t[70]=Ue,t[71]=We):We=t[71];let Ge;t[72]===Oe?Ge=t[73]:(Ge=e=>e?T(!0):Oe(),t[72]=Oe,t[73]=Ge);let Ke=te??void 0,qe=R?`bg-transparent`:`bg-scrim`,Je;t[74]===qe?Je=t[75]:(Je=le(`xopc-dialog-overlay absolute inset-0 z-[80]`,qe),t[74]=qe,t[75]=Je);let Ye;t[76]===Je?Ye=t[77]:(Ye=(0,$.jsx)(p,{className:Je}),t[76]=Je,t[77]=Ye);let Xe;t[78]===q.title?Xe=t[79]:(Xe=(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:q.title}),t[78]=q.title,t[79]=Xe);let Ze;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,$.jsx)(ce,{className:`size-5`,strokeWidth:1.75}),t[80]=Ze):Ze=t[80];let Qe;t[81]===q.close?Qe=t[82]:(Qe=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":q.close,children:Ze})}),t[81]=q.close,t[82]=Qe);let $e;t[83]!==Xe||t[84]!==Qe?($e=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[Xe,Qe]}),t[83]=Xe,t[84]=Qe,t[85]=$e):$e=t[85];let et;t[86]===q.current?et=t[87]:(et=(0,$.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:q.current}),t[86]=q.current,t[87]=et);let tt=q.current,nt=k===`edit`,it=k===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,at;t[88]===it?at=t[89]:(at=le(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,it),t[88]=it,t[89]=at);let ot,st;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ot=()=>A(`edit`),st=(0,$.jsx)(V,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=ot,t[91]=st):(ot=t[90],st=t[91]);let ct;t[92]!==q.edit||t[93]!==nt||t[94]!==at?(ct=(0,$.jsxs)(`button`,{"aria-pressed":nt,type:`button`,className:at,onClick:ot,children:[st,q.edit]}),t[92]=q.edit,t[93]=nt,t[94]=at,t[95]=ct):ct=t[95];let lt=k===`preview`,ut=k===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,dt;t[96]===ut?dt=t[97]:(dt=le(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,ut),t[96]=ut,t[97]=dt);let ft,pt;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>A(`preview`),pt=(0,$.jsx)(F,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[98]=ft,t[99]=pt):(ft=t[98],pt=t[99]);let mt;t[100]!==q.preview||t[101]!==lt||t[102]!==dt?(mt=(0,$.jsxs)(`button`,{"aria-pressed":lt,type:`button`,className:dt,onClick:ft,children:[pt,q.preview]}),t[100]=q.preview,t[101]=lt,t[102]=dt,t[103]=mt):mt=t[103];let ht;t[104]!==q.current||t[105]!==ct||t[106]!==mt?(ht=(0,$.jsxs)(he,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":tt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[ct,mt]}),t[104]=q.current,t[105]=ct,t[106]=mt,t[107]=ht):ht=t[107];let gt;t[108]!==et||t[109]!==ht?(gt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[et,ht]}),t[108]=et,t[109]=ht,t[110]=gt):gt=t[110];let _t;t[111]!==E||t[112]!==k||t[113]!==x||t[114]!==q.current||t[115]!==q.empty?(_t=k===`preview`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:x===`markdown`?(0,$.jsx)(z,{content:E||q.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:E||q.empty})}):(0,$.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:E,onChange:e=>O(e.currentTarget.value),placeholder:q.empty,"aria-label":q.current}),t[111]=E,t[112]=k,t[113]=x,t[114]=q.current,t[115]=q.empty,t[116]=_t):_t=t[116];let vt;t[117]!==gt||t[118]!==_t?(vt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[gt,_t]}),t[117]=gt,t[118]=_t,t[119]=vt):vt=t[119];let yt;t[120]===q.editedSuggestion?yt=t[121]:(yt=(0,$.jsx)(`span`,{children:q.editedSuggestion}),t[120]=q.editedSuggestion,t[121]=yt);let bt;t[122]!==q.loading||t[123]!==H?(bt=H?(0,$.jsx)(`span`,{className:`ml-2 font-normal`,children:q.loading}):null,t[122]=q.loading,t[123]=H,t[124]=bt):bt=t[124];let xt;t[125]!==yt||t[126]!==bt?(xt=(0,$.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[yt,bt]}),t[125]=yt,t[126]=bt,t[127]=xt):xt=t[127];let St=q.editedSuggestion,Ct=N===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[128]===Ct?wt=t[129]:(wt=le(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ct),t[128]=Ct,t[129]=wt);let Tt=N===`edit`,Et,Dt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>P(`edit`),Dt=(0,$.jsx)(V,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[130]=Et,t[131]=Dt):(Et=t[130],Dt=t[131]);let Ot;t[132]!==q.edit||t[133]!==wt||t[134]!==Tt?(Ot=(0,$.jsxs)(`button`,{type:`button`,className:wt,"aria-pressed":Tt,onClick:Et,children:[Dt,q.edit]}),t[132]=q.edit,t[133]=wt,t[134]=Tt,t[135]=Ot):Ot=t[135];let kt=N===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,At;t[136]===kt?At=t[137]:(At=le(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,kt),t[136]=kt,t[137]=At);let Pt=N===`preview`,Lt,Rt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=()=>P(`preview`),Rt=(0,$.jsx)(F,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[138]=Lt,t[139]=Rt):(Lt=t[138],Rt=t[139]);let zt;t[140]!==q.preview||t[141]!==At||t[142]!==Pt?(zt=(0,$.jsxs)(`button`,{type:`button`,className:At,"aria-pressed":Pt,onClick:Lt,children:[Rt,q.preview]}),t[140]=q.preview,t[141]=At,t[142]=Pt,t[143]=zt):zt=t[143];let Bt;t[144]!==q.editedSuggestion||t[145]!==Ot||t[146]!==zt?(Bt=(0,$.jsxs)(he,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":St,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[Ot,zt]}),t[144]=q.editedSuggestion,t[145]=Ot,t[146]=zt,t[147]=Bt):Bt=t[147];let Vt;t[148]!==xt||t[149]!==Bt?(Vt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[xt,Bt]}),t[148]=xt,t[149]=Bt,t[150]=Vt):Vt=t[150];let Ht=J?`opacity-100`:`pointer-events-none opacity-0`,Ut;t[151]===Ht?Ut=t[152]:(Ut=le(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Ht),t[151]=Ht,t[152]=Ut);let Wt=!J,Gt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=()=>L(Ft),t[153]=Gt):Gt=t[153];let Kt;t[154]!==q.thinkingLoading||t[155]!==H?(Kt=H?(0,$.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,q.thinkingLoading]}):null,t[154]=q.thinkingLoading,t[155]=H,t[156]=Kt):Kt=t[156];let qt;t[157]!==q.thinking||t[158]!==Kt?(qt=(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[q.thinking,Kt]}),t[157]=q.thinking,t[158]=Kt,t[159]=qt):qt=t[159];let Jt=I&&`rotate-180`,Yt;t[160]===Jt?Yt=t[161]:(Yt=le(`size-3.5 shrink-0 transition-transform`,Jt),t[160]=Jt,t[161]=Yt);let Xt;t[162]===Yt?Xt=t[163]:(Xt=(0,$.jsx)(D,{className:Yt,strokeWidth:1.75,"aria-hidden":!0}),t[162]=Yt,t[163]=Xt);let Zt;t[164]!==qt||t[165]!==Xt?(Zt=(0,$.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:Gt,children:[qt,Xt]}),t[164]=qt,t[165]=Xt,t[166]=Zt):Zt=t[166];let Qt;t[167]!==B||t[168]!==I?(Qt=I?(0,$.jsx)(`pre`,{ref:re,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:xe,children:B}):null,t[167]=B,t[168]=I,t[169]=Qt):Qt=t[169];let $t;t[170]!==Zt||t[171]!==Qt?($t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-inset/70`,children:[Zt,Qt]}),t[170]=Zt,t[171]=Qt,t[172]=$t):$t=t[172];let en;t[173]!==Ut||t[174]!==Wt||t[175]!==$t?(en=(0,$.jsx)(`div`,{className:Ut,"aria-hidden":Wt,children:$t}),t[173]=Ut,t[174]=Wt,t[175]=$t,t[176]=en):en=t[176];let tn=J?`pointer-events-none opacity-0`:`opacity-100`,nn;t[177]===tn?nn=t[178]:(nn=le(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,tn),t[177]=tn,t[178]=nn);let rn;t[179]!==j||t[180]!==U||t[181]!==x||t[182]!==q.empty||t[183]!==q.loading||t[184]!==q.suggestion||t[185]!==H||t[186]!==N?(rn=U?(0,$.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:U}):N===`preview`?(0,$.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:H&&!j.trim()?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:q.loading}):x===`markdown`?(0,$.jsx)(z,{content:j||q.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:j||q.empty})}):(0,$.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:j,onChange:e=>M(e.currentTarget.value),disabled:H,placeholder:H?q.loading:q.empty,"aria-label":q.suggestion}),t[179]=j,t[180]=U,t[181]=x,t[182]=q.empty,t[183]=q.loading,t[184]=q.suggestion,t[185]=H,t[186]=N,t[187]=rn):rn=t[187];let an;t[188]!==nn||t[189]!==rn?(an=(0,$.jsx)(`div`,{className:nn,children:rn}),t[188]=nn,t[189]=rn,t[190]=an):an=t[190];let on;t[191]!==en||t[192]!==an?(on=(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[en,an]}),t[191]=en,t[192]=an,t[193]=on):on=t[193];let sn;t[194]!==Vt||t[195]!==on?(sn=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Vt,on]}),t[194]=Vt,t[195]=on,t[196]=sn):sn=t[196];let cn;t[197]!==vt||t[198]!==sn?(cn=(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[vt,sn]}),t[197]=vt,t[198]=sn,t[199]=cn):cn=t[199];let ln;t[200]!==Oe||t[201]!==q.cancel?(ln=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,onClick:Oe,children:q.cancel}),t[200]=Oe,t[201]=q.cancel,t[202]=ln):ln=t[202];let un=!Ie,dn;t[203]!==Ae||t[204]!==q.applyCurrent||t[205]!==un?(dn=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,disabled:un,onClick:Ae,children:q.applyCurrent}),t[203]=Ae,t[204]=q.applyCurrent,t[205]=un,t[206]=dn):dn=t[206];let fn;t[207]===Ee?fn=t[208]:(fn=()=>void Ee(),t[207]=Ee,t[208]=fn);let pn;t[209]===Re?pn=t[210]:(pn=Re?(0,$.jsx)(ae,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,$.jsx)(se,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=Re,t[210]=pn);let mn=Re?q.regenerate:q.generate,hn;t[211]!==H||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,$.jsxs)(pe,{type:`button`,variant:`secondary`,disabled:H,onClick:fn,children:[pn,mn]}),t[211]=H,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!Fe,_n;t[216]!==Ne||t[217]!==q.append||t[218]!==gn?(_n=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,disabled:gn,onClick:Ne,children:q.append}),t[216]=Ne,t[217]=q.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!Fe,yn;t[220]!==Z||t[221]!==q.replace||t[222]!==vn?(yn=(0,$.jsx)(pe,{type:`button`,variant:`primary`,disabled:vn,onClick:Z,children:q.replace}),t[220]=Z,t[221]=q.replace,t[222]=vn,t[223]=yn):yn=t[223];let bn;t[224]!==hn||t[225]!==_n||t[226]!==yn||t[227]!==ln||t[228]!==dn?(bn=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[ln,dn,hn,_n,yn]}),t[224]=hn,t[225]=_n,t[226]=yn,t[227]=ln,t[228]=dn,t[229]=bn):bn=t[229];let xn;t[230]!==bn||t[231]!==$e||t[232]!==cn?(xn=(0,$.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,$.jsxs)(g,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,onOpenAutoFocus:It,children:[$e,cn,bn]})}),t[230]=bn,t[231]=$e,t[232]=cn,t[233]=xn):xn=t[233];let Sn;t[234]!==xn||t[235]!==Ke||t[236]!==Ye?(Sn=(0,$.jsxs)(h,{container:Ke,children:[Ye,xn]}),t[234]=xn,t[235]=Ke,t[236]=Ye,t[237]=Sn):Sn=t[237];let Cn;t[238]!==w||t[239]!==Sn||t[240]!==Ge?(Cn=(0,$.jsx)(v,{open:w,onOpenChange:Ge,children:Sn}),t[238]=w,t[239]=Sn,t[240]=Ge,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==We?(wn=(0,$.jsxs)($.Fragment,{children:[We,Cn]}),t[242]=Cn,t[243]=We,t[244]=wn):wn=t[244],wn}function Ft(e){return!e}function It(e){return e.preventDefault()}function Lt(e){return e.management!==void 0}function Rt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...Ie,name:n.name,instruction:t===`reminder`?``:n.instruction,triggerMode:t===`reminder`?`once`:t===`review`?`weekly`:`daily`,time:t===`brief`?`08:30`:t===`review`?`17:00`:`09:00`,weekday:`5`,notificationPolicy:`all`}}})}var zt=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function Bt(e){let t=(0,rt.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,l;t[0]===r?l=t[1]:(l=e=>r(t=>({...t,...e})),t[0]=r,t[1]=l);let u=l,d;t[2]!==i.experience.source||t[3]!==s?(d=(0,$.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i.experience.source,`: `,s]}),t[2]=i.experience.source,t[3]=s,t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=e=>u({name:e.target.value}),t[5]=u,t[6]=f);let p;t[7]!==n.name||t[8]!==f?(p=(0,$.jsx)(`input`,{className:zt,value:n.name,onChange:f}),t[7]=n.name,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==i.form.name||t[11]!==p?(m=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.name,p]}),t[10]=i.form.name,t[11]=p,t[12]=m):m=t[12];let h;t[13]===u?h=t[14]:(h=e=>u({instruction:e.target.value}),t[13]=u,t[14]=h);let g;t[15]!==n.instruction||t[16]!==h?(g=(0,$.jsx)(`textarea`,{className:zt,rows:5,value:n.instruction,onChange:h}),t[15]=n.instruction,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.info.task||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.info.task,g]}),t[18]=i.info.task,t[19]=g,t[20]=_):_=t[20];let v;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(v=!o&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,$.jsxs)(k,{className:zt,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,$.jsx)(A,{value:``,children:i.form.noProject}),a.map(Vt)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=u,t[27]=v):v=t[27];let y;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(y=c&&!n.projectId?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:i.experience.projectRequired}):null,t[28]=n.projectId,t[29]=i.experience.projectRequired,t[30]=c,t[31]=y):y=t[31];let b;t[32]===u?b=t[33]:(b=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=b);let x;t[34]===i.trigger.once?x=t[35]:(x=(0,$.jsx)(A,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=x);let S;t[36]===i.trigger.daily?S=t[37]:(S=(0,$.jsx)(A,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=S);let C;t[38]===i.trigger.weekly?C=t[39]:(C=(0,$.jsx)(A,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=C);let w;t[40]!==n.triggerMode||t[41]!==b||t[42]!==x||t[43]!==S||t[44]!==C?(w=(0,$.jsxs)(k,{className:zt,value:n.triggerMode,onChange:b,children:[x,S,C]}),t[40]=n.triggerMode,t[41]=b,t[42]=x,t[43]=S,t[44]=C,t[45]=w):w=t[45];let T;t[46]!==i.form.trigger||t[47]!==w?(T=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,w]}),t[46]=i.form.trigger,t[47]=w,t[48]=T):T=t[48];let E;t[49]!==n.onceAt||t[50]!==n.time||t[51]!==n.triggerMode||t[52]!==i.form.onceAt||t[53]!==i.form.time||t[54]!==u?(E=n.triggerMode===`once`?(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,$.jsx)(`input`,{type:`datetime-local`,className:zt,value:n.onceAt,onChange:e=>u({onceAt:e.target.value})})]}):(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:i.form.time}),(0,$.jsx)(Ye,{value:n.time,onChange:e=>u({time:e}),ariaLabel:i.form.time})]}),t[49]=n.onceAt,t[50]=n.time,t[51]=n.triggerMode,t[52]=i.form.onceAt,t[53]=i.form.time,t[54]=u,t[55]=E):E=t[55];let D;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(D=n.triggerMode===`weekly`&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,$.jsx)(k,{className:zt,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,$.jsx)(A,{value:String(t),children:i.weekdays[e]},e))})]}),t[56]=n.triggerMode,t[57]=n.weekday,t[58]=i.form.day,t[59]=i.weekdays,t[60]=u,t[61]=D):D=t[61];let O;t[62]!==T||t[63]!==E||t[64]!==D?(O=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T,E,D]}),t[62]=T,t[63]=E,t[64]=D,t[65]=O):O=t[65];let j;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(j=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-red-700 dark:text-red-300`,children:i.experience.futureTime}):null,t[66]=n.onceAt,t[67]=n.triggerMode,t[68]=i.experience.futureTime,t[69]=j):j=t[69];let M;t[70]===i.experience.scheduleNote?M=t[71]:(M=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=M);let N;t[72]===u?N=t[73]:(N=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=N);let P;t[74]===i.draft.notifyAll?P=t[75]:(P=(0,$.jsx)(A,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=P);let F;t[76]===i.draft.notifyAttention?F=t[77]:(F=(0,$.jsx)(A,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=F);let I;t[78]===i.draft.notifyNone?I=t[79]:(I=(0,$.jsx)(A,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=I);let L;t[80]!==n.notificationPolicy||t[81]!==N||t[82]!==P||t[83]!==F||t[84]!==I?(L=(0,$.jsxs)(k,{className:zt,value:n.notificationPolicy,onChange:N,children:[P,F,I]}),t[80]=n.notificationPolicy,t[81]=N,t[82]=P,t[83]=F,t[84]=I,t[85]=L):L=t[85];let R;t[86]!==i.draft.notifications||t[87]!==L?(R=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,L]}),t[86]=i.draft.notifications,t[87]=L,t[88]=R):R=t[88];let z;return t[89]!==y||t[90]!==O||t[91]!==d||t[92]!==j||t[93]!==M||t[94]!==R||t[95]!==m||t[96]!==_||t[97]!==v?(z=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,_,v,y,O,j,M,R]}),t[89]=y,t[90]=O,t[91]=d,t[92]=j,t[93]=M,t[94]=R,t[95]=m,t[96]=_,t[97]=v,t[98]=z):z=t[98],z}function Vt(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}var Ht=`xopc.automations.dismissedExecutionIssues`;function Ut(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Ht)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function Wt(e,t,n){return e?Ze(e,n):t.never}function Gt(e,t){return e.kind===`system`?e.capability===`home.advisor.refresh`?`Home AI suggestions refresh`:e.capability===`memory.temporal_sweep`?`Memory temporal sweep`:e.capability===`memory.daily_reconciliation`?`Memory daily reconciliation`:`Memory weekly knowledge maintenance`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function Kt(e,t){return e===`task_command`?t.action.runTask:t.action.runAgent}function qt(e){return e.safety?.mode??`auto_apply`}function Jt(e){return e===`succeeded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`||e===`timeout`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`running`||e===`queued`||e===`cancelling`?`bg-blue-500/10 text-blue-700 dark:text-blue-300`:`bg-surface-hover text-fg-muted`}function Yt(e,t){if(e==null)return t.never;if(e<1e3)return`${e}ms`;let n=Math.round(e/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}function Xt(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function Zt(e){return e.status===`failed`||e.status===`timeout`}function Qt(e,t){return e.action.kind===`system`?Gt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,Gt(e.action,t))}function $t(e){return e.description?.trim()??``}function en(e){return Xt(e)?0:Zt(e)?1:e.status===`succeeded`?2:3}function tn(e){return[...e].sort((e,t)=>{let n=en(e)-en(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function nn(){let e=(0,rt.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`section`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:Array.from({length:4}).map(an)}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,$.jsx)(W,{className:`h-4 w-36`}),(0,$.jsx)(W,{className:`h-3 w-56 max-w-full`})]}),(0,$.jsx)(W,{className:`h-7 w-20 rounded-full`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:[n,(0,$.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(rn)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(W,{className:`h-4 w-32`}),a=(0,$.jsx)(W,{className:`mt-4 h-24 rounded-lg`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-3 md:grid-cols-[15rem_minmax(0,1fr)] md:grid-rows-1 lg:grid-cols-[17rem_minmax(0,1fr)]`,children:[r,(0,$.jsxs)(`section`,{className:`hidden rounded-xl bg-surface-panel p-4 shadow-surface xl:block`,children:[i,a,(0,$.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,$.jsx)(W,{className:`h-12 rounded-lg`}),(0,$.jsx)(W,{className:`h-12 rounded-lg`}),(0,$.jsx)(W,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function rn(e,t){return(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(W,{className:`size-4 rounded-full`}),(0,$.jsx)(W,{className:`h-4 w-32`}),(0,$.jsx)(W,{className:`h-5 w-20 rounded-full`})]}),(0,$.jsx)(W,{className:`mt-3 h-4 w-full`}),(0,$.jsx)(W,{className:`mt-2 h-4 w-3/5`})]}),(0,$.jsx)(W,{className:`h-8 w-24 rounded-md`})]})},t)}function an(e,t){return(0,$.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2.5 bg-surface-base px-3 py-2.5`,children:[(0,$.jsx)(W,{className:`size-4 rounded-full`}),(0,$.jsx)(W,{className:`h-3 w-14`}),(0,$.jsx)(W,{className:`ml-auto h-4 w-10`})]},t)}function on({projectId:e,embedded:t=!1,title:n,subtitle:r}){let i=d(e=>e.language),o=f(i),s=o.automations,c=o.productNavigation.sections[`automation-triggers`],l=o.cron,u=me(e=>e.setPageHeader),y=me(e=>e.clearPageHeader),[b,x]=a(),S=!t&&b.get(`view`)===`activity`,C=b.get(`run`)?.trim()??``,w=b.get(`view`)===`execution`&&!!C,T=b.get(`automation`)?.trim()??``,E=b.get(`new`)===`1`,D=b.get(`setupChat`)??void 0,O=b.get(`draft`)?.trim()??``,k=b.get(`action`)?.trim()??``,A=b.get(`taskId`)?.trim()??``,M=b.get(`projectId`)?.trim()??``,N=e?.trim()||M,P=!!e?.trim(),F=b.get(`autogenerate`)===`1`,I=(0,Q.useRef)(``),L=b.get(`status`),R=L===`active`||L===`paused`||L===`completed`||L===`running`||L===`attention`?L:`all`,z=b.get(`ownership`)===`system`?`system`:`user`,ee=b.get(`source`),te=ee===`agent`||ee===`task_command`?ee:`all`,ne=b.get(`q`)??``,re=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),ae=e=>x(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),oe=e=>x(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),B=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),se=()=>x(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[V,H]=(0,Q.useState)(null),[W,K]=(0,Q.useState)(!1),[q,ue]=(0,Q.useState)(`blank`),[he,_e]=(0,Q.useState)(!1),[ve,ye]=(0,Q.useState)(null),[be,xe]=(0,Q.useState)(null),[Se,Ce]=(0,Q.useState)(!1),[X,we]=(0,Q.useState)(Ie),[Te,Ee]=(0,Q.useState)(null),[De,Oe]=(0,Q.useState)(null),[ke,je]=(0,Q.useState)(!1),[Z,Pe]=(0,Q.useState)(null),[Re,ze]=(0,Q.useState)(``),[He,We]=(0,Q.useState)(null),[Ke,Je]=(0,Q.useState)(!1),[Ye,Xe]=(0,Q.useState)(!1),[Ze,Qe]=(0,Q.useState)(N),[$e,tt]=(0,Q.useState)(`new_session`),[rt,it]=(0,Q.useState)(`attention`),[ot,st]=(0,Q.useState)(null),[ct,lt]=(0,Q.useState)(!1),[dt,ft]=(0,Q.useState)(!1),[pt,mt]=(0,Q.useState)(!1),[gt,vt]=(0,Q.useState)(null),[yt,bt]=(0,Q.useState)(Ut),xt=J([`automations`,N],()=>Y.list(N?{projectId:N}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),Ct=J([`automation-runs`,N],()=>Y.runs(50,void 0,N?{projectId:N}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),wt=J(N?`automations-global-system-source`:null,()=>Y.list(),{keepPreviousData:!0,refreshInterval:15e3}),Tt=J(N?`automation-runs-global-system-source`:null,()=>Y.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),Dt=J(Z?[`automation-history`,Z,N]:null,()=>Y.runs(50,Z,N?{projectId:N}:void 0),{refreshInterval:1e4}),Ot=J(De?`automation-run-events:${De}`:null,()=>Y.runEvents(De),{refreshInterval:5e3}),kt=J(De?[`automation-exact-run`,De]:null,()=>Y.getRun(De),{refreshInterval:3e3}),At=J(`automation-chat-agents`,fe),jt=J(`automation-tasks`,Y.tasks),Mt=J(`automation-projects`,()=>G({sortBy:`name`,sortOrder:`asc`,limit:200})),Nt=xt.isLoading&&!xt.data||Ct.isLoading&&!Ct.data||!!N&&wt.isLoading&&!wt.data||!!N&&Tt.isLoading&&!Tt.data,Pt=!Nt&&(xt.isLoading||Ct.isLoading||wt.isLoading||Tt.isLoading),Ft=xt.data?.automations??[],It=N?wt.data?.automations??[]:Ft,zt=(0,Q.useMemo)(()=>tn(Ct.data?.runs??[]),[Ct.data?.runs]),Vt=(0,Q.useMemo)(()=>N?tn(Tt.data?.runs??[]):zt,[Tt.data?.runs,N,zt]),Wt=(0,Q.useMemo)(()=>Ft.filter(e=>!Lt(e)),[Ft]),Gt=(0,Q.useMemo)(()=>It.filter(Lt),[It]),Kt=(0,Q.useMemo)(()=>[...Wt,...Gt],[Gt,Wt]),qt=(0,Q.useMemo)(()=>new Set(Gt.map(e=>e.id)),[Gt]),Jt=(0,Q.useMemo)(()=>zt.filter(e=>!qt.has(e.automationId)),[zt,qt]),Yt=(0,Q.useMemo)(()=>Vt.filter(e=>qt.has(e.automationId)),[Vt,qt]),Zt=(0,Q.useMemo)(()=>N?[...zt,...Yt]:zt,[N,zt,Yt]),en=(0,Q.useMemo)(()=>kt.data?.run?.id===De?kt.data.run:Zt.find(e=>e.id===De)??Dt.data?.runs.find(e=>e.id===De)??null,[Zt,De,Dt.data,kt.data]),rn=(0,Q.useMemo)(()=>Kt.find(e=>e.id===Z)??null,[Kt,Z]),an=(0,Q.useMemo)(()=>Kt.find(e=>e.id===be)??null,[Kt,be]),on=(0,Q.useMemo)(()=>[...Dt.data?.runs??Zt].filter(e=>e.automationId===Z).sort((e,t)=>t.createdAtMs-e.createdAtMs),[Zt,Z,Dt.data]),ln=Ot.data?.events??[],un=(0,Q.useMemo)(()=>Jt.filter(e=>!Xt(e)&&e.readAtMs==null),[Jt]),dn=Wt.reduce((e,t)=>e+(xt.data?.executionSummaries?.[t.id]?.unreadCount??0),0),fn=ne.trim().toLocaleLowerCase(),mn=z===`system`?Gt:Wt,hn=z===`system`?Yt:Jt,gn=(0,Q.useMemo)(()=>new Set(hn.filter(Xt).map(e=>e.automationId)),[hn]),yn=(0,Q.useMemo)(()=>mn.filter(e=>R===`attention`&&!et(e,hn)||R===`running`&&!gn.has(e.id)||R===`active`&&!e.enabled||R===`paused`&&(e.enabled||Ae(e))||R===`completed`&&!Ae(e)||te!==`all`&&e.action.kind!==te?!1:!fn||[e.name,$t(e),Qt(e,s),Me(e.trigger,s,l,i)].some(e=>e.toLocaleLowerCase().includes(fn))),[l,R,s,i,fn,mn,hn,gn,te]),bn=At.data?.items??[],xn=(0,Q.useMemo)(()=>(jt.data?.items??[]).map(e=>e.task),[jt.data]),Sn=Mt.data?.items??[],Cn=!!an?.management?.editable.includes(`trigger`),wn=[`daily`,`weekly`,`interval`,`cron`].includes(X.triggerMode)&&(![`daily`,`weekly`].includes(X.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(X.time))&&(X.triggerMode!==`interval`||Ve(X.intervalValue,X.intervalUnit)>=6e4)&&(X.triggerMode!==`cron`||!!X.cronExpr.trim()),Tn=Cn?wn:!!X.name.trim()&&(X.triggerMode!==`once`||Number.isFinite(new Date(X.onceAt).getTime())&&(!!an||new Date(X.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(X.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(X.time))&&(X.triggerMode!==`event`||!!X.eventType.trim()&&Le(X.eventPayloadMatch))&&(X.actionMode===`task_command`?!!(X.taskId.trim()&&X.agentId.trim()):!!X.instruction.trim()),En=!0;try{[`daily`,`weekly`,`cron`].includes(X.triggerMode)&&Ue(X)}catch{En=!1}let On=Tn&&En,kn=(0,Q.useMemo)(()=>Rt(s),[s]),An=(0,Q.useMemo)(()=>Wt.filter(e=>et(e,Jt)),[Wt,Jt]),jn=An.some(e=>{let t=nt(e,Jt);return t!==null&&yt[e.id]!==t}),Mn=(0,Q.useCallback)(()=>{bt(e=>{let t={...e};for(let e of An){let n=nt(e,Jt);n&&(t[e.id]=n)}try{window.localStorage.setItem(Ht,JSON.stringify(t))}catch{}return t})},[An,Jt]);(0,Q.useEffect)(()=>{if(!Pt){if(E){Pe(null);return}if(T){Pe(T);return}if(yn.length===0){Pe(null);return}Z&&yn.some(e=>e.id===Z)||Pe(null)}},[T,yn,E,Pt,Z]);let Nn=(0,Q.useCallback)(async()=>{await Promise.all([xt.mutate(),Ct.mutate(),wt.mutate(),Tt.mutate(),Dt.mutate(),Ot.mutate(),de(e=>Array.isArray(e)&&e[0]===`automation-navigation-runs`)])},[xt.mutate,wt.mutate,Tt.mutate,Ot.mutate,Ct.mutate,Dt.mutate]),Pn=(0,Q.useCallback)(e=>{if(P){Pe(null),Oe(null);return}x(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),Pe(null),Oe(null)},[P,x]);(0,Q.useEffect)(()=>{P&&(Qe(N),we(e=>e.projectId===N?e:{...e,projectId:N}))},[N,P]);let Fn=(0,Q.useCallback)(e=>{if(e===`blank`&&!A){_e(!0);return}if(xe(null),Ce(!1),Ee(null),ue(e),K(!0),e===`blank`){we({...Ie,projectId:N});return}ze(``),We(null),Xe(!1),Qe(N),tt(`new_session`),it(`attention`)},[N,A]),In=e=>{H(e),we({...e.form,projectId:N}),xe(null),Ce(!1),Ee(null),ue(`quick`),K(!0)},Ln=(0,Q.useCallback)(e=>{if(e.action.kind===`agent`&&!e.management){ye(e);return}we(qe(e)),xe(e.id),Ce(!1),Pe(null),ue(`blank`),K(!0)},[]),Rn=(0,Q.useCallback)(()=>{He&&(we({...qe(He.automation),projectId:Ze,conversationMode:$e,notificationPolicy:rt}),xe(null),Ce(!0),ue(`blank`))},[He,$e,rt,Ze]),zn=(0,Q.useCallback)(async()=>{mt(!0),Ee(null);try{await Nn()}catch(e){let t=e instanceof Error?e.message:String(e);Ee(t)}finally{mt(!1)}},[s.feedback.actionFailed,Nn]);(0,Q.useEffect)(()=>{let e=Kt.find(e=>e.id===T);!e||!Lt(e)||z===`system`||x(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[T,Kt,z,x]),(0,Q.useEffect)(()=>{k===`create`&&(Fn(`blank`),A&&we(e=>({...e,actionMode:`task_command`,taskId:A,safetyMode:`auto_apply`})),x(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[k,Fn,x,A]),(0,Q.useEffect)(()=>{if(!O)return;let e=`${i}:${F?`auto`:`seed`}:${O}`;I.current!==e&&(I.current=e,ze(O),We(null),Xe(!1),Qe(N),ue(`draft`),K(!0),x(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),F&&(Ee(null),Je(!0),Y.draft({prompt:O,language:i}).then(e=>{We(e.draft),Xe(!1)}).catch(e=>{Ee(e instanceof Error?e.message:String(e))}).finally(()=>{Je(!1)})))},[F,O,i,N,x]);let Bn=(0,Q.useCallback)(e=>{let t=zt.find(t=>t.id===e)??Dt.data?.runs.find(t=>t.id===e);if(!t||Xt(t)||t.readAtMs!=null)return;let n=Date.now();Ct.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Dt.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Y.markRunRead(e).catch(e=>{Ee(e instanceof Error?e.message:String(e)),Ct.mutate(),Dt.mutate()})},[zt,Ct.mutate,Dt.data,Dt.mutate]),Vn=(0,Q.useCallback)(e=>{Bn(e),Oe(e),je(!0),x(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[Bn,x]),Hn=(0,Q.useCallback)(e=>{Pe(e),Oe(null),je(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e);for(let e of[`new`,`setupChat`,`chatDraft`,`run`,`view`])n.delete(e);return n})},[x]),Un=(0,Q.useCallback)(e=>{je(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e.automationId),n.set(`run`,e.id),n.set(`view`,`execution`);for(let e of[`new`,`setupChat`,`chatDraft`])n.delete(e);return n})},[x]);(0,Q.useEffect)(()=>{Oe(C||null),je(!!C&&!w)},[w,C]),(0,Q.useEffect)(()=>{C&&!w&&Bn(C)},[w,C,Bn]),(0,Q.useEffect)(()=>{st(null),ft(!1)},[De]);async function Wn(){if(Ee(null),X.triggerMode===`once`&&!an&&new Date(X.onceAt).getTime()<=Date.now()){Ee(s.experience.futureTime);return}if(!(!On||gt)&&!(q===`quick`&&V?.requiresProject&&!X.projectId)){if(Se&&He){vt(`draft:edit`);try{let e=Be(X),{simulation:t}=await Y.simulate(e);We({...He,automation:e,simulation:t}),Qe(X.projectId),tt(X.conversationMode),it(X.notificationPolicy),Xe(!1),Ce(!1),ue(`draft`)}catch(e){let t=e instanceof Error?e.message:String(e);Ee(t)}finally{vt(null)}return}if(an){let e=an.id;await Gn(`automation:${e}:edit`,()=>Y.update(e,{...Cn?{trigger:Fe(an,{...X,instruction:`managed`}).trigger}:Fe(an,X),expectedRevision:an.updatedAtMs}))&&(K(!1),xe(null),Pe(e));return}vt(`automation:create`);try{let e=Be(X),{automation:t}=await Y.create(e);we(Ie),K(!1),x(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.delete(`new`),n.set(`automation`,t.id),P||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Nn(),Pe(t.id)}catch(e){let t=e instanceof Error?e.message:String(e);Ee(t)}finally{vt(null)}}}async function Gn(e,t){Ee(null),vt(e);try{return await t(),await Nn(),!0}catch(e){let t=e instanceof Error?e.message:String(e);return Ee(t),!1}finally{vt(null)}}async function Kn(){await Gn(`runs:read-all`,()=>Y.markAllRunsRead(N||void 0))}async function qn(){let e=Re.trim();if(e){Ee(null),Je(!0);try{let t=await Y.draft({prompt:e,language:i});We(t.draft),Xe(!1)}catch(e){Ee(e instanceof Error?e.message:String(e))}finally{Je(!1)}}}async function Jn(){if(!He)return;let e=``,t=``;await Gn(`draft:publish`,async()=>{let{automation:n}=await Y.create({...He.automation,...Ze?{projectId:Ze}:{projectId:void 0},conversationMode:$e,delivery:{...He.automation.delivery,notificationPolicy:rt}});We(null),ze(``),Xe(!1),K(!1),re(`all`),oe(``),e=n.id,t=n.projectId??``})&&e&&(Pn(t),Hn(e))}async function Yn(){if(!He)return;let e=``,t=``,n=``;await Gn(`draft:test`,async()=>{let{automation:r}=await Y.create({...He.automation,...Ze?{projectId:Ze}:{projectId:void 0},conversationMode:$e,delivery:{...He.automation.delivery,notificationPolicy:rt},enabled:!1}),{run:i}=await Y.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,We(null),ze(``),Xe(!1),K(!1),re(`all`),oe(``)})&&e&&n&&(Pn(t),Hn(e),Vn(n))}async function Xn(e){Ee(null),lt(!0),st(null),ft(!1);try{let t=await Y.repairDraft(e.id,{language:i});st(t.repair)}catch(e){Ee(e instanceof Error?e.message:String(e))}finally{lt(!1)}}async function Zn(e){ot&&await Gn(`run:${e.id}:repair`,async()=>{await Y.update(e.automationId,ot.patch),st(null),ft(!1)})}let Qn=(0,Q.useMemo)(()=>(0,$.jsx)(ge,{className:`size-9 shrink-0 p-0`,loading:pt,label:s.refresh,onClick:zn}),[s.refresh,pt,zn]);return(0,Q.useLayoutEffect)(()=>{if(!t)return u({startExtra:null,main:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:c}),end:Qn}),()=>y()},[y,t,Qn,c,u]),(0,$.jsxs)(`div`,{className:le(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,$.jsxs)(`div`,{className:le(`flex min-h-0 w-full flex-1 flex-col gap-4`,t?`py-1`:`px-4 pt-3 sm:px-9 lg:pt-4 xl:px-10`,!t&&(S?`overflow-y-auto`:`overflow-hidden`)),children:[t?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-xl border border-edge-subtle bg-surface-base px-4 py-3 shadow-surface`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(U,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||s.title})]}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||s.subtitle})]}),Qn]}):null,Te||xt.error||Ct.error||wt.error||Tt.error?(0,$.jsx)(`div`,{role:`alert`,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:Te||s.feedback.actionFailed}):null,S?Nt?(0,$.jsx)(nn,{}):(0,$.jsx)(pn,{runs:hn,ownership:z,labels:s,language:i,unreadCount:z===`user`?un.length:0,loading:Pt||pt,onOwnershipChange:ae,onRefresh:zn,onSelectRun:Vn}):(0,$.jsxs)($.Fragment,{children:[!Nt&&jn&&z===`user`?(0,$.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>re(`attention`),className:`flex min-w-0 flex-1 items-center gap-3 rounded-l-lg px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(j,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[s.experience.executionIssues,` · `,An.length]}),(0,$.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:Mn,className:`mr-2 rounded-md p-2 text-fg-muted hover:bg-red-500/10 hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.close,title:s.close,children:(0,$.jsx)(ce,{className:`size-4`,"aria-hidden":!0})})]}):null,Nt?(0,$.jsx)(nn,{}):(0,$.jsxs)(ht,{language:i,busy:Pt,children:[(0,$.jsxs)(`aside`,{className:le(`max-h-[28vh] min-h-0 min-w-0 flex-col overflow-hidden rounded-xl bg-surface-base md:flex md:h-full md:max-h-none`,w?`hidden`:`flex`),children:[(0,$.jsxs)(`div`,{className:`shrink-0 p-3`,children:[(0,$.jsx)(St,{language:i,labels:s,filter:R,ownership:z,source:te,projectId:N,projects:Sn,projectLocked:P,query:ne,unreadCount:z===`user`?dn:0,markReadBusy:gt===`runs:read-all`,onFilter:re,onOwnership:ae,onSource:B,onProject:Pn,onQuery:oe,onClear:()=>{se(),ae(`user`),P||Pn(``)},onMarkAllRead:()=>void Kn()}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>_e(!0),className:`mt-2 flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),i===`zh`?`新建任务`:`New task`]})]}),T&&!yn.some(e=>e.id===T)?(0,$.jsxs)(`p`,{role:`status`,className:`px-3 pb-2 text-xs text-fg-muted`,children:[i===`zh`?`当前自动化不在筛选结果中。`:`The selected automation is outside these filters.`,(0,$.jsx)(`button`,{type:`button`,className:`ml-1 text-accent-fg underline`,onClick:se,children:i===`zh`?`清除筛选`:`Clear filters`})]}):null,(0,$.jsx)(ut,{automations:yn,runs:hn,labels:s,cronLabels:l,language:i,selectedAutomationId:E?null:Z,selectedRunId:w?C:void 0,selectedRun:w?en:null,projectId:N||void 0,executionSummaries:(z===`system`&&N?wt.data:xt.data)?.executionSummaries,onSelectRun:Un,onOpenDetails:Hn,busy:gt!==null,onEdit:Ln,onAction:Gn})]}),w&&T?(0,$.jsx)(at,{automationId:T,runId:C,projectId:N||void 0,language:i,onBack:()=>Hn(T),onDetails:()=>je(!0),onConfigure:e=>{Y.openConfiguration({automationId:e.automationId,runId:e.id}).then(({conversationId:t})=>{je(!1),x(n=>{let r=new URLSearchParams(n);return r.set(`automation`,e.automationId),r.set(`setupChat`,t),r.delete(`run`),r.delete(`view`),r})}).catch(e=>Ee(e instanceof Error?e.message:String(e)))}},`${T}:${C}`):!E&&rn&&!rn.management&&rn.action.kind!==`system`?(0,$.jsx)(_t,{automation:rn,conversationId:D,runs:on,language:i,onSelectRun:Vn},rn.id):D?(0,$.jsx)(_t,{conversationId:D,runs:[],language:i,onSelectRun:Vn,onConfigured:Hn},D):!E&&rn?(0,$.jsx)(vn,{automation:rn,runs:on,runsLoading:Dt.isLoading,runsError:Dt.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:l,language:i,projects:Sn,busyAction:gt,onEdit:Ln,onSelectRun:Vn,onAction:Gn},rn.id):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(Et,{language:i,projectId:N,onOpenConversation:e=>{let t=new URL(e,window.location.origin),n=t.searchParams.get(`setupChat`);x(e=>{let r=new URLSearchParams(e);r.set(`new`,`1`),r.delete(`automation`),r.set(`setupChat`,n);let i=t.searchParams.get(`chatDraft`);return i?r.set(`chatDraft`,i):r.delete(`chatDraft`),r})}},N)})]})]})]}),he?(0,$.jsx)(Ge,{language:i,projectId:N,onClose:()=>_e(!1),onCreated:e=>{ae(`user`),se(),Hn(e.id)}}):null,ve?(0,$.jsx)(Ge,{automation:ve,language:i,onClose:()=>ye(null)}):null,(0,$.jsx)(v,{open:W,onOpenChange:e=>{K(e),e||(xe(null),Ce(!1))},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(760px,calc(100vh-2rem))] w-[min(100%-2rem,64rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:q===`draft`?s.draft.title:an?s.editTitle:Se?s.draft.editTitle:s.createTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:q===`draft`?s.draft.subtitle:s.form.createFlowHint})]}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),Te?(0,$.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Te}):null,q===`draft`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,$.jsx)(cn,{labels:s,prompt:Re,draft:He,loading:Ke,approved:Ye,publishBusy:gt===`draft:publish`,testBusy:gt===`draft:test`,templates:kn,projects:Sn,projectId:Ze,conversationMode:$e,notificationPolicy:rt,onPromptChange:ze,onGenerate:qn,onEdit:Rn,onPublish:Jn,onTest:Yn,onProjectChange:Qe,onConversationModeChange:tt,onNotificationPolicyChange:it,projectLocked:P,onApprovedChange:Xe,onDiscard:()=>{We(null),Xe(!1)},onTemplateSelect:e=>{In(e),we({...e.form,projectId:Ze})},onOpenAdvanced:()=>{we({...Ie,projectId:Ze,conversationMode:$e,notificationPolicy:rt}),ue(`blank`)}})}):(0,$.jsxs)($.Fragment,{children:[Cn?(0,$.jsx)(sn,{form:X,setForm:we,labels:s}):q===`quick`&&V?(0,$.jsx)(Bt,{form:X,setForm:we,labels:s,projects:Sn,projectLocked:P,source:V.source,requiresProject:V.requiresProject}):(0,$.jsx)(Dn,{form:X,labels:s,setForm:we,projects:Sn,agentOptions:bn,agentsLoading:At.isLoading,defaultAgentId:At.data?.defaultId??``,taskOptions:xn,tasksLoading:jt.isLoading,language:i,projectLocked:P}),Cn||q===`quick`?(0,$.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto px-5 pb-4`,children:(0,$.jsx)(Ne,{form:X,onChange:e=>we(t=>({...t,...e})),language:i})}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[q===`quick`?(0,$.jsx)(pe,{variant:`ghost`,onClick:()=>ue(`blank`),children:s.draft.advancedCreate}):null,Se?(0,$.jsx)(pe,{variant:`ghost`,onClick:()=>{Ce(!1),ue(`draft`)},children:s.cancel}):(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,children:s.cancel})}),(0,$.jsx)(pe,{variant:`primary`,onClick:Wn,disabled:!On||!!gt||q===`quick`&&!!V?.requiresProject&&!X.projectId,children:gt===`automation:create`||gt===`draft:edit`||an&>===`automation:${an.id}:edit`?s.feedback.working:an||Se?s.save:s.experience.createEnabled})]})]})]})]})}),(0,$.jsx)(v,{open:ke&&!!en,onOpenChange:e=>{je(e),!(e||w)&&x(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(85vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover 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)(_,{className:`truncate text-base font-semibold text-fg`,children:en?.automationName??s.dashboard.result}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,$.jsx)(_n,{className:`rounded-none border-0`,run:en,events:ln,labels:s,cronLabels:l,language:i,loading:Ot.isLoading,repairDraft:ot,repairLoading:ct,repairApproved:dt,busyAction:gt,onRepairApprovedChange:ft,onSuggestRepair:Xn,onApplyRepair:Zn})})]})]})})]})}function sn(e){let t=(0,rt.c)(48),{form:n,setForm:r,labels:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(t=>({...t,...e})),t[0]=r,t[1]=a);let o=a,s;t[2]===i.form.trigger?s=t[3]:(s=(0,$.jsx)(An,{title:i.form.trigger}),t[2]=i.form.trigger,t[3]=s);let c;t[4]===o?c=t[5]:(c=e=>o({triggerMode:e.target.value}),t[4]=o,t[5]=c);let l;t[6]===i.trigger.daily?l=t[7]:(l=(0,$.jsx)(A,{value:`daily`,children:i.trigger.daily}),t[6]=i.trigger.daily,t[7]=l);let u;t[8]===i.trigger.weekly?u=t[9]:(u=(0,$.jsx)(A,{value:`weekly`,children:i.trigger.weekly}),t[8]=i.trigger.weekly,t[9]=u);let d;t[10]===i.trigger.interval?d=t[11]:(d=(0,$.jsx)(A,{value:`interval`,children:i.trigger.interval}),t[10]=i.trigger.interval,t[11]=d);let f;t[12]===i.trigger.customCron?f=t[13]:(f=(0,$.jsx)(A,{value:`cron`,children:i.trigger.customCron}),t[12]=i.trigger.customCron,t[13]=f);let p;t[14]!==n.triggerMode||t[15]!==i.form.trigger||t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,$.jsxs)(k,{"aria-label":i.form.trigger,className:kn,value:n.triggerMode,onChange:c,children:[l,u,d,f]}),t[14]=n.triggerMode,t[15]=i.form.trigger,t[16]=c,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21];let m;t[22]!==n.time||t[23]!==n.triggerMode||t[24]!==n.weekday||t[25]!==i.form.day||t[26]!==i.form.time||t[27]!==i.weekdays||t[28]!==o?(m=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(Z,{label:i.form.time,children:(0,$.jsx)(Ye,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,$.jsx)(Z,{label:i.form.day,children:(0,$.jsxs)(k,{className:kn,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,$.jsx)(A,{value:`1`,children:i.weekdays.monday}),(0,$.jsx)(A,{value:`2`,children:i.weekdays.tuesday}),(0,$.jsx)(A,{value:`3`,children:i.weekdays.wednesday}),(0,$.jsx)(A,{value:`4`,children:i.weekdays.thursday}),(0,$.jsx)(A,{value:`5`,children:i.weekdays.friday}),(0,$.jsx)(A,{value:`6`,children:i.weekdays.saturday}),(0,$.jsx)(A,{value:`0`,children:i.weekdays.sunday})]})}):null]}):null,t[22]=n.time,t[23]=n.triggerMode,t[24]=n.weekday,t[25]=i.form.day,t[26]=i.form.time,t[27]=i.weekdays,t[28]=o,t[29]=m):m=t[29];let h;t[30]!==n.intervalUnit||t[31]!==n.intervalValue||t[32]!==n.triggerMode||t[33]!==i.form.intervalEvery||t[34]!==i.form.intervalUnits||t[35]!==o?(h=n.triggerMode===`interval`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,$.jsx)(Z,{label:i.form.intervalEvery,children:(0,$.jsx)(`input`,{className:kn,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,$.jsx)(Z,{label:i.form.intervalUnits.minute,children:(0,$.jsxs)(k,{className:kn,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,$.jsx)(A,{value:`minute`,children:i.form.intervalUnits.minute}),(0,$.jsx)(A,{value:`hour`,children:i.form.intervalUnits.hour}),(0,$.jsx)(A,{value:`day`,children:i.form.intervalUnits.day}),(0,$.jsx)(A,{value:`week`,children:i.form.intervalUnits.week})]})})]}):null,t[30]=n.intervalUnit,t[31]=n.intervalValue,t[32]=n.triggerMode,t[33]=i.form.intervalEvery,t[34]=i.form.intervalUnits,t[35]=o,t[36]=h):h=t[36];let g;t[37]!==n.cronExpr||t[38]!==n.triggerMode||t[39]!==i.form.expression||t[40]!==o?(g=n.triggerMode===`cron`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsx)(Z,{label:i.form.expression,children:(0,$.jsx)(`input`,{className:kn,value:n.cronExpr,onChange:e=>o({cronExpr:e.target.value})})})}):null,t[37]=n.cronExpr,t[38]=n.triggerMode,t[39]=i.form.expression,t[40]=o,t[41]=g):g=t[41];let _;return t[42]!==h||t[43]!==g||t[44]!==s||t[45]!==p||t[46]!==m?(_=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[s,p,m,h,g]}),t[42]=h,t[43]=g,t[44]=s,t[45]=p,t[46]=m,t[47]=_):_=t[47],_}function cn(e){let t=(0,rt.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:l,projects:u,projectId:d,conversationMode:f,notificationPolicy:p,onPromptChange:m,onGenerate:h,onEdit:g,onPublish:_,onTest:v,onProjectChange:y,onConversationModeChange:b,onNotificationPolicyChange:x,onApprovedChange:S,onDiscard:C,onTemplateSelect:w,onOpenAdvanced:T,projectLocked:E}=e,D=s!==void 0&&s,O=c!==void 0&&c,j=E!==void 0&&E,M=!!(i&&i.simulation.requiredConfirmations.length>0),N;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==T||t[6]!==w||t[7]!==l?(N=i?null:(0,$.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,$.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,$.jsx)(pe,{variant:`ghost`,onClick:T,children:n.draft.advancedCreate})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:l.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-2 focus-visible:ring-accent rounded-lg border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>w(e),children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,$.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.experience.source,`: `,e.source]})]},e.name))})]}),t[0]=i,t[1]=n.draft.advancedCreate,t[2]=n.draft.suggestions,t[3]=n.draft.suggestionsDescription,t[4]=n.experience,t[5]=T,t[6]=w,t[7]=l,t[8]=N):N=t[8];let P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(se,{className:`size-4 text-accent`}),t[9]=P):P=t[9];let F;t[10]===n.draft.title?F=t[11]:(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[P,n.draft.title]}),t[10]=n.draft.title,t[11]=F);let I;t[12]===n.draft.subtitle?I=t[13]:(I=(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=I);let L;t[14]!==F||t[15]!==I?(L=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[F,I]}),t[14]=F,t[15]=I,t[16]=L):L=t[16];let R;t[17]!==a||t[18]!==r?(R=a||!r.trim(),t[17]=a,t[18]=r,t[19]=R):R=t[19];let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(se,{className:`size-4`}),t[20]=z):z=t[20];let ee=a?n.draft.generating:n.draft.generate,te;t[21]!==h||t[22]!==ee||t[23]!==R?(te=(0,$.jsxs)(pe,{variant:`primary`,onClick:h,disabled:R,children:[z,ee]}),t[21]=h,t[22]=ee,t[23]=R,t[24]=te):te=t[24];let ie;t[25]!==te||t[26]!==L?(ie=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[L,te]}),t[25]=te,t[26]=L,t[27]=ie):ie=t[27];let ae;t[28]===m?ae=t[29]:(ae=e=>m(e.target.value),t[28]=m,t[29]=ae);let oe;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==ae?(oe=(0,$.jsx)(`textarea`,{"aria-label":n.draft.title,className:`mt-4 min-h-20 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,value:r,onChange:ae,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=ae,t[34]=oe):oe=t[34];let B=j?`sm:grid-cols-2`:`sm:grid-cols-3`,V;t[35]===B?V=t[36]:(V=le(`mt-3 grid gap-3`,B),t[35]=B,t[36]=V);let H;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==y||t[40]!==d||t[41]!==j||t[42]!==u?(H=j?null:(0,$.jsx)(Z,{label:n.draft.project,children:(0,$.jsxs)(k,{className:kn,value:d,onChange:e=>y(e.target.value),children:[(0,$.jsx)(A,{value:``,children:n.draft.noProject}),u.map(ln)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=y,t[40]=d,t[41]=j,t[42]=u,t[43]=H):H=t[43];let ce;t[44]===b?ce=t[45]:(ce=e=>b(e.target.value),t[44]=b,t[45]=ce);let U;t[46]===n.draft.newConversation?U=t[47]:(U=(0,$.jsx)(A,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=U);let W;t[48]===n.draft.continuousConversation?W=t[49]:(W=(0,$.jsx)(A,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=W);let G;t[50]!==f||t[51]!==ce||t[52]!==U||t[53]!==W?(G=(0,$.jsxs)(k,{className:kn,value:f,onChange:ce,children:[U,W]}),t[50]=f,t[51]=ce,t[52]=U,t[53]=W,t[54]=G):G=t[54];let K;t[55]!==n.draft.conversation||t[56]!==G?(K=(0,$.jsx)(Z,{label:n.draft.conversation,children:G}),t[55]=n.draft.conversation,t[56]=G,t[57]=K):K=t[57];let q;t[58]===x?q=t[59]:(q=e=>x(e.target.value),t[58]=x,t[59]=q);let ue;t[60]===n.draft.notifyAttention?ue=t[61]:(ue=(0,$.jsx)(A,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=ue);let J;t[62]===n.draft.notifyAll?J=t[63]:(J=(0,$.jsx)(A,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=J);let de;t[64]===n.draft.notifyNone?de=t[65]:(de=(0,$.jsx)(A,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=de);let fe;t[66]!==p||t[67]!==q||t[68]!==ue||t[69]!==J||t[70]!==de?(fe=(0,$.jsxs)(k,{className:kn,value:p,onChange:q,children:[ue,J,de]}),t[66]=p,t[67]=q,t[68]=ue,t[69]=J,t[70]=de,t[71]=fe):fe=t[71];let me;t[72]!==n.draft.notifications||t[73]!==fe?(me=(0,$.jsx)(Z,{label:n.draft.notifications,children:fe}),t[72]=n.draft.notifications,t[73]=fe,t[74]=me):me=t[74];let Y;t[75]!==V||t[76]!==H||t[77]!==K||t[78]!==me?(Y=(0,$.jsxs)(`div`,{className:V,children:[H,K,me]}),t[75]=V,t[76]=H,t[77]=K,t[78]=me,t[79]=Y):Y=t[79];let he;t[80]!==o||t[81]!==i||t[82]!==n.draft.approval||t[83]!==n.draft.assumptions||t[84]!==n.draft.discard||t[85]!==n.draft.edit||t[86]!==n.draft.publish||t[87]!==n.draft.review||t[88]!==n.draft.risks||t[89]!==n.draft.safety||t[90]!==n.draft.testOnce||t[91]!==n.draft.testing||t[92]!==n.feedback||t[93]!==n.info||t[94]!==n.none||t[95]!==S||t[96]!==C||t[97]!==g||t[98]!==_||t[99]!==v||t[100]!==D||t[101]!==M||t[102]!==O?(he=i?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,$.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,$.jsx)(Tn,{label:n.info.when,value:i.simulation.triggerSummary}),(0,$.jsx)(Tn,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,$.jsx)(un,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,$.jsx)(un,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,$.jsx)(un,{title:n.draft.risks,items:i.risks,empty:n.none}),M?(0,$.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>S(e.target.checked)}),(0,$.jsx)(`span`,{children:n.draft.approval})]}):null,(0,$.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,$.jsx)(pe,{variant:`ghost`,onClick:C,children:n.draft.discard}),(0,$.jsxs)(pe,{variant:`secondary`,onClick:g,children:[(0,$.jsx)(ne,{className:`size-4`}),n.draft.edit]}),(0,$.jsxs)(pe,{variant:`secondary`,onClick:v,disabled:O||D||M&&!o,children:[(0,$.jsx)(re,{className:`size-4`}),O?n.draft.testing:n.draft.testOnce]}),(0,$.jsx)(pe,{variant:`primary`,onClick:_,disabled:D||M&&!o,children:D?n.feedback.working:n.draft.publish})]})]})]}):null,t[80]=o,t[81]=i,t[82]=n.draft.approval,t[83]=n.draft.assumptions,t[84]=n.draft.discard,t[85]=n.draft.edit,t[86]=n.draft.publish,t[87]=n.draft.review,t[88]=n.draft.risks,t[89]=n.draft.safety,t[90]=n.draft.testOnce,t[91]=n.draft.testing,t[92]=n.feedback,t[93]=n.info,t[94]=n.none,t[95]=S,t[96]=C,t[97]=g,t[98]=_,t[99]=v,t[100]=D,t[101]=M,t[102]=O,t[103]=he):he=t[103];let ge;return t[104]!==ie||t[105]!==oe||t[106]!==Y||t[107]!==he||t[108]!==N?(ge=(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[N,ie,oe,Y,he]}),t[104]=ie,t[105]=oe,t[106]=Y,t[107]=he,t[108]=N,t[109]=ge):ge=t[109],ge}function ln(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}function un(e){let t=(0,rt.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r?(o=r.length>0?r.map(dn):(0,$.jsx)(`li`,{className:`text-fg-muted`,children:i}),t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===o?s=t[6]:(s=(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm text-fg`,children:o}),t[5]=o,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function dn(e){return(0,$.jsxs)(`li`,{children:[`- `,e]},e)}function fn(e){let t=(0,rt.c)(25),{icon:n,label:r,value:i,tone:a,active:o,onClick:s}=e,c=a===void 0?`default`:a,l=c===`danger`?`text-red-600 dark:text-red-300`:`text-fg-subtle`,u;t[0]===l?u=t[1]:(u=le(`shrink-0`,l),t[0]=l,t[1]=u);let d;t[2]!==n||t[3]!==u?(d=(0,$.jsx)(`span`,{className:u,children:n}),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:r}),t[5]=r,t[6]=f);let p=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,m;t[7]===p?m=t[8]:(m=le(`ml-auto truncate text-sm font-semibold tabular-nums`,p),t[7]=p,t[8]=m);let h;t[9]!==m||t[10]!==i?(h=(0,$.jsx)(`span`,{className:m,children:i}),t[9]=m,t[10]=i,t[11]=h):h=t[11];let g;t[12]!==d||t[13]!==f||t[14]!==h?(g=(0,$.jsxs)($.Fragment,{children:[d,f,h]}),t[12]=d,t[13]=f,t[14]=h,t[15]=g):g=t[15];let _=g,v=o&&`bg-accent/8`,y=s&&`cursor-pointer hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,b;t[16]!==v||t[17]!==y?(b=le(`flex min-h-12 min-w-0 items-center gap-2.5 bg-surface-base px-3 py-2.5 text-left transition-colors`,v,y),t[16]=v,t[17]=y,t[18]=b):b=t[18];let x=b,S=`${r}: ${i}`,C;return t[19]!==S||t[20]!==o||t[21]!==x||t[22]!==_||t[23]!==s?(C=s?(0,$.jsx)(`button`,{type:`button`,className:x,onClick:s,"aria-label":S,"aria-pressed":o,children:_}):(0,$.jsx)(`div`,{className:x,"aria-label":S,children:_}),t[19]=S,t[20]=o,t[21]=x,t[22]=_,t[23]=s,t[24]=C):C=t[24],C}function pn(e){let t=(0,rt.c)(74),{runs:n,ownership:r,labels:i,language:a,unreadCount:o,loading:s,onOwnershipChange:c,onRefresh:l,onSelectRun:u}=e,d;t[0]===n?d=t[1]:(d=n.filter(Xt),t[0]=n,t[1]=d);let f=d.length,p;t[2]===n?p=t[3]:(p=n.filter(Zt),t[2]=n,t[3]=p);let m=p.length,h;t[4]===i.dashboard.activity?h=t[5]:(h=(0,$.jsx)(`h2`,{id:`automation-activity-title`,className:`text-sm font-semibold text-fg`,children:i.dashboard.activity}),t[4]=i.dashboard.activity,t[5]=h);let g;t[6]===i.dashboard.activityDescription?g=t[7]:(g=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=g);let _;t[8]!==h||t[9]!==g?(_=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=i.filters.ownership,b=r===`user`&&`bg-surface-base text-fg shadow-sm`,x;t[11]===b?x=t[12]:(x=le(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,b),t[11]=b,t[12]=x);let S;t[13]===c?S=t[14]:(S=()=>c(`user`),t[13]=c,t[14]=S);let C=r===`user`,w;t[15]!==i.filters.userManaged||t[16]!==C||t[17]!==x||t[18]!==S?(w=(0,$.jsx)(`button`,{type:`button`,className:x,onClick:S,"aria-pressed":C,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=C,t[17]=x,t[18]=S,t[19]=w):w=t[19];let T=r===`system`&&`bg-surface-base text-fg shadow-sm`,E;t[20]===T?E=t[21]:(E=le(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,T),t[20]=T,t[21]=E);let D;t[22]===c?D=t[23]:(D=()=>c(`system`),t[22]=c,t[23]=D);let O=r===`system`,k;t[24]!==i.system.title||t[25]!==E||t[26]!==D||t[27]!==O?(k=(0,$.jsx)(`button`,{type:`button`,className:E,onClick:D,"aria-pressed":O,children:i.system.title}),t[24]=i.system.title,t[25]=E,t[26]=D,t[27]=O,t[28]=k):k=t[28];let A;t[29]!==i.filters.ownership||t[30]!==w||t[31]!==k?(A=(0,$.jsxs)(he,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":v,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[w,k]}),t[29]=i.filters.ownership,t[30]=w,t[31]=k,t[32]=A):A=t[32];let N;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(N=(0,$.jsx)(ge,{className:`size-9 shrink-0 p-0`,loading:s,label:i.refresh,onClick:l}),t[33]=i.refresh,t[34]=s,t[35]=l,t[36]=N):N=t[36];let P;t[37]!==A||t[38]!==N?(P=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,N]}),t[37]=A,t[38]=N,t[39]=P):P=t[39];let F;t[40]!==P||t[41]!==_?(F=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 sm:px-5`,children:[_,P]}),t[40]=P,t[41]=_,t[42]=F):F=t[42];let I;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[43]=I):I=t[43];let L=i.metrics.total,R=String(n.length),z;t[44]!==i.metrics.total||t[45]!==R?(z=(0,$.jsx)(fn,{icon:I,label:L,value:R}),t[44]=i.metrics.total,t[45]=R,t[46]=z):z=t[46];let ee;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[47]=ee):ee=t[47];let te=i.metrics.running,ne=String(f),ie;t[48]!==i.metrics.running||t[49]!==ne?(ie=(0,$.jsx)(fn,{icon:ee,label:te,value:ne}),t[48]=i.metrics.running,t[49]=ne,t[50]=ie):ie=t[50];let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[51]=ae):ae=t[51];let oe=i.dashboard.needsAttention,B=String(m),se=m>0?`danger`:`default`,V;t[52]!==i.dashboard.needsAttention||t[53]!==B||t[54]!==se?(V=(0,$.jsx)(fn,{icon:ae,label:oe,value:B,tone:se}),t[52]=i.dashboard.needsAttention,t[53]=B,t[54]=se,t[55]=V):V=t[55];let H;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(M,{className:`size-4`,"aria-hidden":!0}),t[56]=H):H=t[56];let ce=i.filters.unread,U=String(o),W;t[57]!==i.filters.unread||t[58]!==U?(W=(0,$.jsx)(fn,{icon:H,label:ce,value:U}),t[57]=i.filters.unread,t[58]=U,t[59]=W):W=t[59];let G;t[60]!==z||t[61]!==ie||t[62]!==V||t[63]!==W?(G=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[z,ie,V,W]}),t[60]=z,t[61]=ie,t[62]=V,t[63]=W,t[64]=G):G=t[64];let K;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(K=n.length===0?(0,$.jsx)(En,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,$.jsx)(y,{className:`size-5`}),title:i.empty.runs}):(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-3 px-4 py-3 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-5`,onClick:()=>u(e.id),children:[(0,$.jsx)(`span`,{className:le(`mt-1.5 size-2 shrink-0 rounded-full`,Xt(e)?`bg-blue-500`:Zt(e)?`bg-red-500`:`bg-emerald-500`),"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.automationName}),e.readAtMs==null&&!Xt(e)?(0,$.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,$.jsx)(`span`,{className:le(`mt-1 line-clamp-2 block text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||i.status[e.status]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:Wt(e.createdAtMs,i,a)})]}),(0,$.jsx)(`span`,{className:le(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Jt(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=K):K=t[69];let q;return t[70]!==F||t[71]!==G||t[72]!==K?(q=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[F,G,K]}),t[70]=F,t[71]=G,t[72]=K,t[73]=q):q=t[73],q}function mn(e,t){let n=t.events,r=e.data&&typeof e.data==`object`?e.data:{},i=typeof r.actionKind==`string`?r.actionKind:null,a=typeof r.status==`string`&&r.status in t.status?t.status[r.status]:null;switch(e.type){case`run.queued`:return e.message.toLowerCase().includes(`manual`)?n.manualQueued:e.message.toLowerCase().includes(`scheduled`)?n.scheduledQueued:n.eventQueued;case`run.started`:return n.runStarted;case`action.started`:return i?n.actionStarted.replace(`{kind}`,i):n.actionStartedFallback;case`action.completed`:return i?n.actionCompleted.replace(`{kind}`,i):n.actionCompletedFallback;case`action.failed`:return i?n.actionFailed.replace(`{kind}`,i):n.actionFailedFallback;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function hn(e){let t=(0,rt.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,Q.useState)(a!==void 0&&a),c;t[0]===n?c=t[1]:(c=JSON.stringify(n,null,2),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.split(`
|
|
5
5
|
`),t[2]=l,t[3]=u);let d=u.length,f=l.length>720||d>18,p;t[4]!==f||t[5]!==l?(p=f?`${l.split(`
|
package/dist/gateway/static/root/assets/{binary-plugins-Bv4ixxo4.js → binary-plugins-C0QOjfJV.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-preview-renderer-DdOEgexg.js","assets/preload-helper-Czpn1I53.js","assets/pdf-runtime-JnUAvfIa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-CGO1P4mz.js";import{a as o,t as s}from"./attachment-utils-core-BIOUBrpT.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(13),{text:n,slideLabel:r,emptySlideLabel:i}=e,a;t[0]===n?a=t[1]:(a=f(n),t[0]=n,t[1]=a);let o=a;if(!o.ok){let e;return t[2]===o.raw?e=t[3]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:o.raw}),t[2]=o.raw,t[3]=e),e}let s;if(t[4]!==i||t[5]!==o.notes||t[6]!==o.slides||t[7]!==r){let e=[];if(o.notes.length>0){let n;t[9]===o.notes?n=t[10]:(n=o.notes.map(h),t[9]=o.notes,t[10]=n);let r;t[11]===n?r=t[12]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[11]=n,t[12]=r),e.push(r)}for(let t of o.slides)e.push((0,p.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:r(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:i})]},t.slideNumber));s=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[4]=i,t[5]=o.notes,t[6]=o.slides,t[7]=r,t[8]=s}else s=t[8];return s}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s}){let[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(!1);return(0,u.useLayoutEffect)(()=>{if(l(null),f(!1),!t||!n||!o||!r)return;let c=!1,u,d=document.createElement(`div`);d.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(d),_(d,g(e,n));let p=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-DdOEgexg.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e}=await r.renderPdfInContainer(d,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});p(e)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(d,t,{truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});p(e),c||f(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(d,t);p(e)}}catch(e){c||l(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),d.remove()}},[t,n,o,r,e,s]),{error:c,excelTruncated:d}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(22),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.setPageCount:void 0,l;t[1]!==r||t[2]!==e.binaryBuffer||t[3]!==e.descriptor.id||t[4]!==e.kind||t[5]!==e.language||t[6]!==c?(l={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:c},t[1]=r,t[2]=e.binaryBuffer,t[3]=e.descriptor.id,t[4]=e.kind,t[5]=e.language,t[6]=c,t[7]=l):l=t[7];let{error:f,excelTruncated:m}=v(l),h=a(e.language),g=e.kind===`pdf`?e.controls?.zoom??1:1,_=e.kind===`pdf`?e.controls?.rotation??0:0,x=e.kind===`pdf`?e.controls?.page??1:1,S,C;t[8]!==e.kind||t[9]!==_||t[10]!==g?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(g)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${_}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*g}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${g}) rotate(${_}deg)`,e.style.marginBottom=g===1?``:`${Math.max(16,24*g)}px`}))},C=[e.kind,_,g],t[8]=e.kind,t[9]=_,t[10]=g,t[11]=S,t[12]=C):(S=t[11],C=t[12]),(0,u.useEffect)(S,C);let w,T;t[13]!==x||t[14]!==e.kind?(w=()=>{e.kind!==`pdf`||!n.current||n.current.querySelector(`[data-pdf-page="${x}"]`)?.scrollIntoView({block:`start`})},T=[x,e.kind],t[13]=x,t[14]=e.kind,t[15]=w,t[16]=T):(w=t[15],T=t[16]),(0,u.useEffect)(w,T);let E=f?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:f})]}):e.kind===`excel`&&m?(0,p.jsx)(y,{props:e,message:h.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,D=`${f?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,O;t[17]===D?O=t[18]:(O=(0,p.jsx)(`div`,{ref:s,className:D}),t[17]=D,t[18]=O);let k;return t[19]!==O||t[20]!==E?(k=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[E,O]}),t[19]=O,t[20]=E,t[21]=k):k=t[21],k}function E(e){let t=(0,d.c)(23),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==h||t[15]!==l?(g=(0,p.jsx)(m,{text:l,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=h,t[15]=l,t[16]=g):g=t[16];let _;t[17]!==f||t[18]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[17]=f,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==u||t[21]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[20]=u,t[21]=_,t[22]=v):v=t[22],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-DFCLetQl.js";import{a as o,t as s}from"./attachment-utils-core-BIOUBrpT.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(13),{text:n,slideLabel:r,emptySlideLabel:i}=e,a;t[0]===n?a=t[1]:(a=f(n),t[0]=n,t[1]=a);let o=a;if(!o.ok){let e;return t[2]===o.raw?e=t[3]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:o.raw}),t[2]=o.raw,t[3]=e),e}let s;if(t[4]!==i||t[5]!==o.notes||t[6]!==o.slides||t[7]!==r){let e=[];if(o.notes.length>0){let n;t[9]===o.notes?n=t[10]:(n=o.notes.map(h),t[9]=o.notes,t[10]=n);let r;t[11]===n?r=t[12]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[11]=n,t[12]=r),e.push(r)}for(let t of o.slides)e.push((0,p.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:r(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:i})]},t.slideNumber));s=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[4]=i,t[5]=o.notes,t[6]=o.slides,t[7]=r,t[8]=s}else s=t[8];return s}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s}){let[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(!1);return(0,u.useLayoutEffect)(()=>{if(l(null),f(!1),!t||!n||!o||!r)return;let c=!1,u,d=document.createElement(`div`);d.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(d),_(d,g(e,n));let p=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-DdOEgexg.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e}=await r.renderPdfInContainer(d,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});p(e)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(d,t,{truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});p(e),c||f(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(d,t);p(e)}}catch(e){c||l(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),d.remove()}},[t,n,o,r,e,s]),{error:c,excelTruncated:d}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(22),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.setPageCount:void 0,l;t[1]!==r||t[2]!==e.binaryBuffer||t[3]!==e.descriptor.id||t[4]!==e.kind||t[5]!==e.language||t[6]!==c?(l={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:c},t[1]=r,t[2]=e.binaryBuffer,t[3]=e.descriptor.id,t[4]=e.kind,t[5]=e.language,t[6]=c,t[7]=l):l=t[7];let{error:f,excelTruncated:m}=v(l),h=a(e.language),g=e.kind===`pdf`?e.controls?.zoom??1:1,_=e.kind===`pdf`?e.controls?.rotation??0:0,x=e.kind===`pdf`?e.controls?.page??1:1,S,C;t[8]!==e.kind||t[9]!==_||t[10]!==g?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(g)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${_}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*g}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${g}) rotate(${_}deg)`,e.style.marginBottom=g===1?``:`${Math.max(16,24*g)}px`}))},C=[e.kind,_,g],t[8]=e.kind,t[9]=_,t[10]=g,t[11]=S,t[12]=C):(S=t[11],C=t[12]),(0,u.useEffect)(S,C);let w,T;t[13]!==x||t[14]!==e.kind?(w=()=>{e.kind!==`pdf`||!n.current||n.current.querySelector(`[data-pdf-page="${x}"]`)?.scrollIntoView({block:`start`})},T=[x,e.kind],t[13]=x,t[14]=e.kind,t[15]=w,t[16]=T):(w=t[15],T=t[16]),(0,u.useEffect)(w,T);let E=f?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:f})]}):e.kind===`excel`&&m?(0,p.jsx)(y,{props:e,message:h.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,D=`${f?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,O;t[17]===D?O=t[18]:(O=(0,p.jsx)(`div`,{ref:s,className:D}),t[17]=D,t[18]=O);let k;return t[19]!==O||t[20]!==E?(k=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[E,O]}),t[19]=O,t[20]=E,t[21]=k):k=t[21],k}function E(e){let t=(0,d.c)(23),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==h||t[15]!==l?(g=(0,p.jsx)(m,{text:l,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=h,t[15]=l,t[16]=g):g=t[16];let _;t[17]!==f||t[18]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[17]=f,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==u||t[21]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[20]=u,t[21]=_,t[22]=v):v=t[22],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
|