specrails-desktop 2.36.0 → 2.42.2
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/README.md +94 -247
- package/client/dist/assets/ActivityFeedPage-DoEMumQS.js +1 -0
- package/client/dist/assets/AgentBrowserCapture-DIh4K0gh.js +1 -0
- package/client/dist/assets/AgentModeAnalyticsPane-mbq4WEoO.js +2 -0
- package/client/dist/assets/AgentModeCodePane-CKh7zuA4.js +2 -0
- package/client/dist/assets/AgentModeJobsPane-BDokPiLJ.js +1 -0
- package/client/dist/assets/AgentsPage-BFVAZbBj.js +87 -0
- package/client/dist/assets/AnalyticsPage-3Y9LuWwz.js +1 -0
- package/client/dist/assets/CodePage-C9KyuV_C.js +3 -0
- package/client/dist/assets/DesktopAnalyticsPage-Bhi54bXQ.js +1 -0
- package/client/dist/assets/{DocsDialog-C76VdBJC.js → DocsDialog-Dj6mt4ga.js} +2 -2
- package/client/dist/assets/{DocsPage-ziMlj6B6.js → DocsPage-24yWglNI.js} +1 -1
- package/client/dist/assets/ExportDropdown-ophapHrT.js +1 -0
- package/client/dist/assets/InteractiveJobComposer-C1ucmxQh.js +19 -0
- package/client/dist/assets/JobDetailModal-DNWmgVHD.js +1 -0
- package/client/dist/assets/JobDetailPage-BcajZyuu.js +1 -0
- package/client/dist/assets/JobsPage-B9nTZw6e.js +1 -0
- package/client/dist/assets/LoopBuilderPage-Oc48iOFW.js +7 -0
- package/client/dist/assets/LoopPreviewModal-ae0Fr6SU.js +1 -0
- package/client/dist/assets/LoopsPage-CUEqzUBI.js +1 -0
- package/client/dist/assets/MinimizedChatsContext-Deg39peL.js +1 -0
- package/client/dist/assets/PluginsPage-C1xtARIx.js +2 -0
- package/client/dist/assets/ProjectSettingsDialog-JZzrXFBN.js +1 -0
- package/client/dist/assets/RepositoryDeliveries-CSDsiVUz.js +5 -0
- package/client/dist/assets/RepositoryScopeSelector-D-RCaknl.js +1 -0
- package/client/dist/assets/ReviewPacketPage-x5EfGTiL.js +1 -0
- package/client/dist/assets/TemplatePreviewModal-BSyuZxGq.js +1 -0
- package/client/dist/assets/TicketDetailModalContext-DqyF0so-.js +14 -0
- package/client/dist/assets/Trans-SnMX4MhW.js +1 -0
- package/client/dist/assets/agent-BdT0SB1D.js +1 -0
- package/client/dist/assets/agent-Bh9K7iEt.js +1 -0
- package/client/dist/assets/agent-C4ibdFk9.js +1 -0
- package/client/dist/assets/agent-CSFY22Zo.js +1 -0
- package/client/dist/assets/agent-DAnqxUn8.js +1 -0
- package/client/dist/assets/agent-DTQiu0Mi.js +1 -0
- package/client/dist/assets/agent-T54WuR_Y.js +1 -0
- package/client/dist/assets/agent-i75WDZOA.js +1 -0
- package/client/dist/assets/browser-05vRDg_y.js +1 -0
- package/client/dist/assets/browser-Bulb-cB1.js +1 -0
- package/client/dist/assets/browser-C7f-Jsg1.js +1 -0
- package/client/dist/assets/browser-CG0PE1j_.js +1 -0
- package/client/dist/assets/browser-CMzaqAjo.js +1 -0
- package/client/dist/assets/browser-DMajYdNX.js +1 -0
- package/client/dist/assets/browser-DxcOHrdP.js +1 -0
- package/client/dist/assets/browser-ObE7xVo3.js +1 -0
- package/client/dist/assets/builder-765NeYTp.js +1 -0
- package/client/dist/assets/builder-8MG3V6ea.js +1 -0
- package/client/dist/assets/builder-B-1UBs5K.js +1 -0
- package/client/dist/assets/builder-BTiGnPT0.js +1 -0
- package/client/dist/assets/builder-Cx9Rz-7u.js +1 -0
- package/client/dist/assets/builder-DKFMELBl.js +1 -0
- package/client/dist/assets/builder-OcmKrC0h.js +1 -0
- package/client/dist/assets/builder-P9qVBXFZ.js +1 -0
- package/client/dist/assets/{button-CJqFnUOL.js → button-DCBqEaZl.js} +1 -1
- package/client/dist/assets/{code-CkUuW4m9.js → code-B37GRg9C.js} +1 -1
- package/client/dist/assets/{code-B0O8-p8k.js → code-BBOEZbf9.js} +1 -1
- package/client/dist/assets/{code-B1VLZDhS.js → code-BRm-jcyx.js} +1 -1
- package/client/dist/assets/{code-Bpj4Ddml.js → code-CF7w62CR.js} +1 -1
- package/client/dist/assets/{code-BykBZ5-e.js → code-CLuvJt2r.js} +1 -1
- package/client/dist/assets/{code-B86IMAfz.js → code-D0RCm59f.js} +1 -1
- package/client/dist/assets/code-DaZ-ZwCT.js +1 -0
- package/client/dist/assets/{code-cAqaqMTx.js → code-iIHkGaCL.js} +1 -1
- package/client/dist/assets/commands-0XjAftla.js +1 -0
- package/client/dist/assets/commands-BAWSYHjQ.js +1 -0
- package/client/dist/assets/commands-BBwowgiE.js +1 -0
- package/client/dist/assets/commands-BacjIZLN.js +1 -0
- package/client/dist/assets/commands-Bs62IAZ3.js +1 -0
- package/client/dist/assets/commands-CLPdh-Hh.js +1 -0
- package/client/dist/assets/commands-DlbFzgrp.js +1 -0
- package/client/dist/assets/commands-LjPSsi5F.js +1 -0
- package/client/dist/assets/common-B5AZNYMH.js +1 -0
- package/client/dist/assets/common-BFZ0c_vN.js +1 -0
- package/client/dist/assets/common-BrlwEnL7.js +1 -0
- package/client/dist/assets/common-BttQx3z4.js +1 -0
- package/client/dist/assets/common-CM65k_-e.js +1 -0
- package/client/dist/assets/common-D4mvFFlu.js +1 -0
- package/client/dist/assets/common-TZ9Ny96S.js +1 -0
- package/client/dist/assets/common-nFpSF4GC.js +1 -0
- package/client/dist/assets/dashboard-B14uYXkG.js +1 -0
- package/client/dist/assets/dashboard-BK_mez-z.js +1 -0
- package/client/dist/assets/dashboard-BfBir_6o.js +1 -0
- package/client/dist/assets/dashboard-Bt0cCzeG.js +1 -0
- package/client/dist/assets/dashboard-BwkjxI6H.js +1 -0
- package/client/dist/assets/{dashboard-C8WOEiPu.js → dashboard-C3bDKf7s.js} +1 -1
- package/client/dist/assets/dashboard-CdvjGfog.js +1 -0
- package/client/dist/assets/dashboard-fRrP0Kv0.js +1 -0
- package/client/dist/assets/dialog-SRw01_QU.js +45 -0
- package/client/dist/assets/dist-js-CJ_2XX1Y.js +1 -0
- package/client/dist/assets/formatDistanceToNow-DSj5DprF.js +1 -0
- package/client/dist/assets/getTimezoneOffsetInMilliseconds-YhD8rIEs.js +1 -0
- package/client/dist/assets/index-DwAmL7m5.css +2 -0
- package/client/dist/assets/index-EzrkUb8B.js +76 -0
- package/client/dist/assets/{jira-api-B1-MUehg.js → jira-api-CSCqGr-Q.js} +1 -1
- package/client/dist/assets/{jobs-CN_zv4Gr.js → jobs-B8rrzfyZ.js} +1 -1
- package/client/dist/assets/{jobs-DUlWSYq2.js → jobs-BS6RTurf.js} +1 -1
- package/client/dist/assets/{jobs-Bpks6doU.js → jobs-BTT0Bsks.js} +1 -1
- package/client/dist/assets/{jobs-Bgq-PZkC.js → jobs-CezU69AE.js} +1 -1
- package/client/dist/assets/{jobs-SwYS2M-B.js → jobs-ClFJae0s.js} +1 -1
- package/client/dist/assets/{jobs-BAls3bWq.js → jobs-DJSFIFVy.js} +1 -1
- package/client/dist/assets/{jobs-DhxKgWFq.js → jobs-DhgGr8vm.js} +1 -1
- package/client/dist/assets/{jobs-B_TeSQxb.js → jobs-DzMjUcaN.js} +1 -1
- package/client/dist/assets/mcp-6rMoZfEO.js +1 -0
- package/client/dist/assets/mcp-BD8sL5mP.js +1 -0
- package/client/dist/assets/mcp-BkcA3I5s.js +1 -0
- package/client/dist/assets/mcp-CCpSelOh.js +1 -0
- package/client/dist/assets/mcp-CUAN6ORK.js +1 -0
- package/client/dist/assets/mcp-CqbRxRTE.js +1 -0
- package/client/dist/assets/mcp-DP2YfVhO.js +1 -0
- package/client/dist/assets/mcp-DUVQamDz.js +1 -0
- package/client/dist/assets/narration-B-ynWTpn.js +1 -0
- package/client/dist/assets/narration-Bj_laZwg.js +1 -0
- package/client/dist/assets/narration-BxHpmMv_.js +1 -0
- package/client/dist/assets/narration-C1Px0-0j.js +1 -0
- package/client/dist/assets/narration-CAXhGbzM.js +1 -0
- package/client/dist/assets/narration-DQ1l_Kq6.js +1 -0
- package/client/dist/assets/narration-XISXwqZd.js +1 -0
- package/client/dist/assets/narration-kwzfglQo.js +1 -0
- package/client/dist/assets/nav-1-Hh2kOz.js +1 -0
- package/client/dist/assets/nav-B34QkESm.js +1 -0
- package/client/dist/assets/nav-Bap_UXAq.js +1 -0
- package/client/dist/assets/{nav-pYuXq7sf.js → nav-BwxXIB24.js} +1 -1
- package/client/dist/assets/nav-Ch-zHBG5.js +1 -0
- package/client/dist/assets/nav-CygC_WN-.js +1 -0
- package/client/dist/assets/{nav-iwjCg5FR.js → nav-KnnLQtOQ.js} +1 -1
- package/client/dist/assets/nav-m00uxYUG.js +1 -0
- package/client/dist/assets/packet-BQ2tXfJI.js +1 -0
- package/client/dist/assets/packet-BdpOJ1Cy.js +1 -0
- package/client/dist/assets/packet-C3Ievb9R.js +1 -0
- package/client/dist/assets/packet-C4zJIG0Y.js +1 -0
- package/client/dist/assets/packet-Cx-zRuWn.js +1 -0
- package/client/dist/assets/packet-DUTGX52M.js +1 -0
- package/client/dist/assets/packet-DhsKtUPB.js +1 -0
- package/client/dist/assets/packet-z3LJ8Zyy.js +1 -0
- package/client/dist/assets/project-repositories-DYhTvwQ1.js +1 -0
- package/client/dist/assets/provider-capabilities-B-wOHfLP.js +1 -0
- package/client/dist/assets/settings-BBt2xtDQ.js +1 -0
- package/client/dist/assets/settings-BJB9RKJj.js +1 -0
- package/client/dist/assets/settings-CHwQR2rB.js +1 -0
- package/client/dist/assets/settings-CrMi3kSi.js +1 -0
- package/client/dist/assets/settings-DKyhDGD1.js +1 -0
- package/client/dist/assets/settings-Deupji9c.js +1 -0
- package/client/dist/assets/settings-DqRMmwAM.js +1 -0
- package/client/dist/assets/settings-J4rj6vo-.js +1 -0
- package/client/dist/assets/setup-2xGgu4Sk.js +1 -0
- package/client/dist/assets/setup-Ba11l2JA.js +1 -0
- package/client/dist/assets/setup-BzW4kMok.js +1 -0
- package/client/dist/assets/setup-COzwYhkJ.js +1 -0
- package/client/dist/assets/setup-CRVULhtF.js +1 -0
- package/client/dist/assets/setup-DgvlxwpE.js +1 -0
- package/client/dist/assets/setup-Dw_wYeEY.js +1 -0
- package/client/dist/assets/setup-ZPtEeJPW.js +1 -0
- package/client/dist/assets/spending-BqbdPm_4.js +1 -0
- package/client/dist/assets/square-Ci-PFcFe.js +1 -0
- package/client/dist/assets/{terminal-BFRZnMPP.js → terminal-BAzpHtpY.js} +1 -1
- package/client/dist/assets/{terminal-IahE4LW9.js → terminal-C7dHeR3x.js} +1 -1
- package/client/dist/assets/{terminal-tITa81iz.js → terminal-CMla5Qsz.js} +1 -1
- package/client/dist/assets/{terminal-BZiIu3rf.js → terminal-CdNXH-n9.js} +1 -1
- package/client/dist/assets/{terminal-ScjyXNxQ.js → terminal-Cw5bZsmV.js} +1 -1
- package/client/dist/assets/{terminal-C2NAd7BW.js → terminal-DFUP4eNv.js} +1 -1
- package/client/dist/assets/{terminal-d7GadXbN.js → terminal-DGqljeK_.js} +1 -1
- package/client/dist/assets/{terminal-QpXZU2Bn.js → terminal-cU70NodO.js} +1 -1
- package/client/dist/assets/useDesktop-RSMTyy7V.js +1 -0
- package/client/dist/assets/useSharedWebSocket-BOdS5_Iz.js +2 -0
- package/client/dist/index.html +34 -35
- package/docs/README.md +3 -0
- package/docs/agent-live-steering.md +57 -0
- package/docs/ci-cd.md +57 -0
- package/docs/code-explorer.md +48 -0
- package/docs/codex.md +12 -1
- package/docs/features/detachable-mission-windows.md +59 -0
- package/docs/guide/de/integrations/5-mcp-server.md +13 -9
- package/docs/guide/de/integrations/6-agent-chat.md +1 -0
- package/docs/guide/en/integrations/5-mcp-server.md +13 -9
- package/docs/guide/en/integrations/6-agent-chat.md +1 -0
- package/docs/guide/es/integrations/5-mcp-server.md +13 -9
- package/docs/guide/es/integrations/6-agent-chat.md +1 -0
- package/docs/guide/fr/integrations/5-mcp-server.md +13 -9
- package/docs/guide/fr/integrations/6-agent-chat.md +1 -0
- package/docs/guide/it/integrations/5-mcp-server.md +13 -9
- package/docs/guide/it/integrations/6-agent-chat.md +1 -0
- package/docs/guide/ja/integrations/5-mcp-server.md +13 -9
- package/docs/guide/ja/integrations/6-agent-chat.md +1 -0
- package/docs/guide/pt/integrations/5-mcp-server.md +13 -9
- package/docs/guide/pt/integrations/6-agent-chat.md +1 -0
- package/docs/guide/zh/integrations/5-mcp-server.md +13 -9
- package/docs/guide/zh/integrations/6-agent-chat.md +1 -0
- package/docs/internals/README.md +1 -0
- package/docs/internals/browser-capture-performance.md +55 -3
- package/docs/internals/browser-login-popups.md +45 -0
- package/docs/internals/browser-native-retina-audit.md +39 -0
- package/docs/internals/ci-cd-audit.md +39 -0
- package/docs/internals/core-runtime-updates.md +68 -0
- package/docs/internals/embedded-browser-native-webview-evaluation.md +2 -0
- package/docs/internals/implementation-reliability-audit.md +93 -0
- package/docs/internals/interactive-jobs.md +110 -6
- package/docs/internals/mcp-mission-audit.md +76 -0
- package/docs/internals/project-builder.md +404 -42
- package/docs/internals/safe-pr-review-flow.md +52 -10
- package/docs/internals/startup-recovery-audit.md +58 -0
- package/docs/mcp.md +74 -41
- package/docs/mission-processes.md +59 -0
- package/docs/multi-repo-projects.md +51 -0
- package/docs/platforms/windows-parity.md +70 -0
- package/docs/platforms/windows.md +13 -11
- package/docs/running-pipelines.md +14 -0
- package/mcp-bridge/dist/specrails-mcp.js +7186 -0
- package/package.json +9 -4
- package/server/dist/agent-chat-manager.js +537 -68
- package/server/dist/agent-chat-router.js +87 -6
- package/server/dist/agent-context-resolver.js +129 -25
- package/server/dist/agent-defaults.js +19 -11
- package/server/dist/agent-input-store.js +206 -0
- package/server/dist/agent-mcp-config.js +54 -15
- package/server/dist/agent-operator-prompt.js +255 -65
- package/server/dist/agent-spec-framing.js +202 -0
- package/server/dist/agent-steering.js +218 -0
- package/server/dist/agent-store.js +153 -0
- package/server/dist/api-not-found.js +8 -0
- package/server/dist/background-process-control.js +164 -0
- package/server/dist/background-process-service.js +61 -0
- package/server/dist/background-process-store.js +242 -0
- package/server/dist/background-windows-bootstrap.js +238 -0
- package/server/dist/blueprint-chat-manager.js +476 -62
- package/server/dist/blueprint-commit.js +21 -1
- package/server/dist/blueprint-draft-parser.js +122 -17
- package/server/dist/blueprint-generation.js +238 -0
- package/server/dist/blueprint-operator-prompt.js +91 -63
- package/server/dist/blueprint-router.js +55 -3
- package/server/dist/blueprint-spec-fixtures.js +85 -0
- package/server/dist/blueprint-spec-quality.js +57 -16
- package/server/dist/blueprint-store.js +92 -1
- package/server/dist/browser-capture-manager.js +86 -30
- package/server/dist/browser-playwright.js +168 -45
- package/server/dist/browser-viewport.js +26 -0
- package/server/dist/chat-manager.js +23 -15
- package/server/dist/chromium-archive.cjs +83 -0
- package/server/dist/chromium-resolver.js +72 -64
- package/server/dist/code-activity.js +145 -0
- package/server/dist/code-explorer-router.js +714 -114
- package/server/dist/core-compat.js +28 -1
- package/server/dist/core-execution.js +111 -0
- package/server/dist/core-package.js +4 -16
- package/server/dist/core-runtime.js +202 -0
- package/server/dist/core-update-manager.js +161 -60
- package/server/dist/core-update-state.js +29 -0
- package/server/dist/db.js +66 -35
- package/server/dist/delivery-evidence.js +142 -39
- package/server/dist/desktop-db.js +239 -43
- package/server/dist/desktop-router.js +109 -9
- package/server/dist/dev-ports.js +8 -3
- package/server/dist/file-provenance.js +34 -22
- package/server/dist/file-story-manager.js +62 -64
- package/server/dist/file-story.js +118 -35
- package/server/dist/file-summary-generator.js +46 -5
- package/server/dist/file-summary-manager.js +355 -106
- package/server/dist/framework-manager.js +98 -110
- package/server/dist/framework-reseed.js +76 -10
- package/server/dist/git-diagnostics.js +2 -2
- package/server/dist/headroom-manager.js +38 -3
- package/server/dist/host-control.js +52 -0
- package/server/dist/index.js +43 -2
- package/server/dist/interactive-job-session.js +149 -16
- package/server/dist/internal-api.js +48 -0
- package/server/dist/jira/jira-materializer.js +1 -0
- package/server/dist/json-tolerant.js +174 -0
- package/server/dist/legacy-migration.js +4 -2
- package/server/dist/loop-command-catalog.js +83 -21
- package/server/dist/loop-constants.js +6 -1
- package/server/dist/loop-decider.js +11 -1
- package/server/dist/loop-executors.js +194 -45
- package/server/dist/loop-factory.js +11 -4
- package/server/dist/loop-graph.js +90 -4
- package/server/dist/loop-run-manager.js +301 -69
- package/server/dist/loop-shell-invocation.js +21 -0
- package/server/dist/loop-step-idle.js +55 -0
- package/server/dist/loop-templates.js +31 -7
- package/server/dist/mcp/agent-capability.js +37 -4
- package/server/dist/mcp/guide.js +149 -36
- package/server/dist/mcp/mcp-admin-router.js +20 -4
- package/server/dist/mcp/mcp-server.js +89 -43
- package/server/dist/mcp/mcp-tiers.js +6 -5
- package/server/dist/mcp/mcp-token.js +3 -1
- package/server/dist/mcp/resources.js +5 -4
- package/server/dist/mcp/tools/catalog.js +4 -0
- package/server/dist/mcp/tools/code.js +125 -14
- package/server/dist/mcp/tools/context.js +153 -0
- package/server/dist/mcp/tools/git.js +15 -5
- package/server/dist/mcp/tools/jobs.js +84 -71
- package/server/dist/mcp/tools/loops.js +17 -6
- package/server/dist/mcp/tools/meta.js +74 -27
- package/server/dist/mcp/tools/mission.js +29 -0
- package/server/dist/mcp/tools/projects.js +22 -6
- package/server/dist/mcp/tools/rails.js +48 -11
- package/server/dist/mcp/tools/specs.js +86 -14
- package/server/dist/mcp/tools/support.js +1 -1
- package/server/dist/mcp/tools/types.js +117 -43
- package/server/dist/mcp/tools/watch.js +144 -51
- package/server/dist/milestone-chain-store.js +164 -0
- package/server/dist/milestone-chain.js +487 -0
- package/server/dist/milestone-progress.js +348 -0
- package/server/dist/mobile/mobile-devices.js +10 -7
- package/server/dist/mobile/mobile-gateway.js +2 -0
- package/server/dist/mobile/mobile-missions.js +214 -0
- package/server/dist/mobile/mobile-redact.js +17 -3
- package/server/dist/mobile/mobile-router.js +46 -4
- package/server/dist/mobile/mobile-ws.js +49 -4
- package/server/dist/multi-repo-bases.js +56 -0
- package/server/dist/multi-repo-checkout.js +101 -0
- package/server/dist/multi-repo-delivery.js +100 -0
- package/server/dist/multi-repo-execution-store.js +65 -0
- package/server/dist/multi-repo-execution.js +453 -0
- package/server/dist/offline-assemble.js +10 -8
- package/server/dist/openspec-runtime-plugin-commands.json +18 -0
- package/server/dist/openspec-runtime-plugin.js +120 -0
- package/server/dist/plugins/codex-spawn.js +49 -0
- package/server/dist/plugins/serena/manifest.js +2 -2
- package/server/dist/plugins/serena/templates/instructions.md +16 -0
- package/server/dist/pr-publisher.js +1 -1
- package/server/dist/profiles-router.js +3 -18
- package/server/dist/project-code-discovery.js +142 -0
- package/server/dist/project-git.js +19 -21
- package/server/dist/project-registry.js +272 -20
- package/server/dist/project-repositories.js +157 -0
- package/server/dist/project-repository-provenance.js +31 -0
- package/server/dist/project-router-background-processes.js +105 -0
- package/server/dist/project-router-git.js +75 -16
- package/server/dist/project-router-jobs.js +2 -126
- package/server/dist/project-router-loop-runs.js +72 -2
- package/server/dist/project-router-tickets.js +53 -8
- package/server/dist/project-router.js +239 -38
- package/server/dist/provider-detection.js +18 -6
- package/server/dist/provider-limit.js +64 -0
- package/server/dist/providers/claude-adapter.js +26 -1
- package/server/dist/providers/claude-background-tasks.js +18 -0
- package/server/dist/providers/claude-live-session.js +383 -0
- package/server/dist/providers/codex-adapter.js +19 -0
- package/server/dist/providers/codex-live-session.js +545 -0
- package/server/dist/providers/gemini-adapter.js +1 -0
- package/server/dist/providers/live-session-types.js +12 -0
- package/server/dist/providers/live-session.js +13 -0
- package/server/dist/providers/terminal-result.js +24 -0
- package/server/dist/queue-manager.js +2 -0
- package/server/dist/rail-isolated-launch.js +141 -16
- package/server/dist/rail-pr-decision.js +364 -99
- package/server/dist/rail-pr-store.js +24 -10
- package/server/dist/rail-worktree-release.js +34 -2
- package/server/dist/rail-worktrees-store.js +4 -4
- package/server/dist/rails-router.js +249 -55
- package/server/dist/repo-lock.js +92 -17
- package/server/dist/review-packet.js +23 -13
- package/server/dist/schemas/file-summary.v1.json +59 -59
- package/server/dist/schemas/profile.v1.json +137 -137
- package/server/dist/setup-manager.js +52 -8
- package/server/dist/shell-integration/bash-shim.bash +45 -0
- package/server/dist/shell-integration/fish-shim.fish +36 -0
- package/server/dist/shell-integration/powershell-shim.ps1 +48 -0
- package/server/dist/shell-integration/zsh-shim.zsh +47 -0
- package/server/dist/smash-runner.js +1 -0
- package/server/dist/spawn-lifecycle.js +44 -27
- package/server/dist/spec-contract-prompt.js +143 -0
- package/server/dist/spec-draft-parser.js +6 -1
- package/server/dist/spec-models.js +1 -0
- package/server/dist/stuck-run-detector.js +1 -0
- package/server/dist/terminal-manager.js +21 -1
- package/server/dist/terminal-shell-integration.js +4 -1
- package/server/dist/transient-children.js +619 -230
- package/server/dist/util/cli-prompt.js +78 -5
- package/server/dist/util/sqlite-migrations.js +20 -0
- package/server/dist/util/win-spawn.js +18 -3
- package/server/dist/util/windows-provider-shell.js +29 -0
- package/server/dist/verification-sentinel.js +14 -0
- package/server/dist/vitest-setup.js +2 -0
- package/server/dist/windows-job-supervisor.js +133 -0
- package/server/dist/workspace-manager.js +9 -30
- package/server/dist/worktree-manager.js +17 -2
- package/server/dist/worktree-overlay.js +3 -1
- package/client/dist/assets/ActivityFeedPage-tAQcWs1R.js +0 -1
- package/client/dist/assets/AgentBrowserCapture-BX8BNae5.js +0 -1
- package/client/dist/assets/AgentModeAnalyticsPane-BVAqCL0K.js +0 -2
- package/client/dist/assets/AgentModeCodePane-9XfqQc9c.js +0 -2
- package/client/dist/assets/AgentModeJobsPane-BCjLsPhc.js +0 -1
- package/client/dist/assets/AgentsPage-C8J_42sm.js +0 -87
- package/client/dist/assets/AnalyticsPage-BtQuyfJm.js +0 -1
- package/client/dist/assets/CodePage-BZ2MwdCu.js +0 -2
- package/client/dist/assets/DesktopAnalyticsPage-Bh_29V4g.js +0 -1
- package/client/dist/assets/ExportDropdown-BrtfWzEG.js +0 -1
- package/client/dist/assets/InteractiveJobComposer-BCZiSfzc.js +0 -19
- package/client/dist/assets/JobDetailModal-NAJmuYIT.js +0 -1
- package/client/dist/assets/JobDetailPage-fE0ZycUX.js +0 -1
- package/client/dist/assets/JobsPage-z5M_HVJG.js +0 -1
- package/client/dist/assets/LoopBuilderPage-j1FQS47c.js +0 -7
- package/client/dist/assets/LoopPreviewModal-DhDJjdCe.js +0 -1
- package/client/dist/assets/LoopsPage-Ll7zORZb.js +0 -1
- package/client/dist/assets/MinimizedChatsContext-Bd3OqR_S.js +0 -1
- package/client/dist/assets/PluginsPage-DN4kGvJt.js +0 -2
- package/client/dist/assets/ProjectSettingsDialog-OgsgxjzF.js +0 -1
- package/client/dist/assets/ReviewPacketPage-DFog4sXn.js +0 -1
- package/client/dist/assets/TemplatePreviewModal-L2XxqiOD.js +0 -1
- package/client/dist/assets/TicketDetailModal-CsF-AWZX.js +0 -14
- package/client/dist/assets/Trans-Bsz9_gyq.js +0 -1
- package/client/dist/assets/agent-BQgKv_2F.js +0 -1
- package/client/dist/assets/agent-C1NRDJqL.js +0 -1
- package/client/dist/assets/agent-CLNleiy6.js +0 -1
- package/client/dist/assets/agent-CmceArkQ.js +0 -1
- package/client/dist/assets/agent-D3UxQ3SR.js +0 -1
- package/client/dist/assets/agent-DB1JeE64.js +0 -1
- package/client/dist/assets/agent-DXkHcQ-D.js +0 -1
- package/client/dist/assets/agent-DjJJJ2M8.js +0 -1
- package/client/dist/assets/auth-D_5bQv5W.js +0 -1
- package/client/dist/assets/ban-E4EaZe3a.js +0 -1
- package/client/dist/assets/bot-DzuuuC5R.js +0 -1
- package/client/dist/assets/browser-BgqHDMXP.js +0 -1
- package/client/dist/assets/browser-CsKJtrpv.js +0 -1
- package/client/dist/assets/browser-Cu58EpZU.js +0 -1
- package/client/dist/assets/browser-CvXOJm-j.js +0 -1
- package/client/dist/assets/browser-DOrFh1c7.js +0 -1
- package/client/dist/assets/browser-DQv_Jo7x.js +0 -1
- package/client/dist/assets/browser-LPgxvJu2.js +0 -1
- package/client/dist/assets/browser-eL-3MIEI.js +0 -1
- package/client/dist/assets/builder-0IWtosUm.js +0 -1
- package/client/dist/assets/builder-Bf2N6XWn.js +0 -1
- package/client/dist/assets/builder-BnqaaBkT.js +0 -1
- package/client/dist/assets/builder-BxxfGgAO.js +0 -1
- package/client/dist/assets/builder-C5IIgWsq.js +0 -1
- package/client/dist/assets/builder-CHuahItu.js +0 -1
- package/client/dist/assets/builder-CjWosXL_.js +0 -1
- package/client/dist/assets/builder-CpCIOoKj.js +0 -1
- package/client/dist/assets/code-CHPkOkDS.js +0 -1
- package/client/dist/assets/commands-6tYQih5m.js +0 -1
- package/client/dist/assets/commands-BK2QinXN.js +0 -1
- package/client/dist/assets/commands-C2Nca76h.js +0 -1
- package/client/dist/assets/commands-CKdLihNX.js +0 -1
- package/client/dist/assets/commands-CYIBTAlc.js +0 -1
- package/client/dist/assets/commands-CjUtYJIM.js +0 -1
- package/client/dist/assets/commands-Cq_u_8y9.js +0 -1
- package/client/dist/assets/commands-D_ZHYQug.js +0 -1
- package/client/dist/assets/common-6MLbD-jM.js +0 -1
- package/client/dist/assets/common-BKGEu4rm.js +0 -1
- package/client/dist/assets/common-BNbnv8cE.js +0 -1
- package/client/dist/assets/common-BqGWtDbt.js +0 -1
- package/client/dist/assets/common-DBtTzeYm.js +0 -1
- package/client/dist/assets/common-DEW3Nr8n.js +0 -1
- package/client/dist/assets/common-DHsv9N5d.js +0 -1
- package/client/dist/assets/common-mkrEcW-Y.js +0 -1
- package/client/dist/assets/dashboard-B9GhC5ku.js +0 -1
- package/client/dist/assets/dashboard-CBnv6zOI.js +0 -1
- package/client/dist/assets/dashboard-CaP0fU87.js +0 -1
- package/client/dist/assets/dashboard-D4ZZ4x84.js +0 -1
- package/client/dist/assets/dashboard-DmuTQBX8.js +0 -1
- package/client/dist/assets/dashboard-DynLYj3d.js +0 -1
- package/client/dist/assets/dashboard-zj4gGFJ1.js +0 -1
- package/client/dist/assets/dialog-CdWCb02j.js +0 -45
- package/client/dist/assets/dist-bVqfYmby.js +0 -1
- package/client/dist/assets/dist-js-CWeUdf5Z.js +0 -1
- package/client/dist/assets/formatDistanceToNow-DQCvMgUc.js +0 -1
- package/client/dist/assets/getTimezoneOffsetInMilliseconds-C16cxSe1.js +0 -1
- package/client/dist/assets/git-refresh-wTW0rO0Z.js +0 -1
- package/client/dist/assets/i18n-hnX2DPmo.js +0 -2
- package/client/dist/assets/index-DIhMEAVw.js +0 -66
- package/client/dist/assets/index-DwygcU7s.css +0 -2
- package/client/dist/assets/mcp-B8X8wBLu.js +0 -1
- package/client/dist/assets/mcp-C2AojZZN.js +0 -1
- package/client/dist/assets/mcp-D8BT78_L.js +0 -1
- package/client/dist/assets/mcp-Df5RWBNk.js +0 -1
- package/client/dist/assets/mcp-Dj7BgMQW.js +0 -1
- package/client/dist/assets/mcp-Q7iT7rcz.js +0 -1
- package/client/dist/assets/mcp-YlvNvJbW.js +0 -1
- package/client/dist/assets/mcp-mKFpTSRb.js +0 -1
- package/client/dist/assets/narration-4Z2VUhZw.js +0 -1
- package/client/dist/assets/narration-BGuiEDj3.js +0 -1
- package/client/dist/assets/narration-BuSoqRmv.js +0 -1
- package/client/dist/assets/narration-CB9t29fy.js +0 -1
- package/client/dist/assets/narration-CU3x8FHD.js +0 -1
- package/client/dist/assets/narration-CWeXhfP5.js +0 -1
- package/client/dist/assets/narration-DRaDnhT5.js +0 -1
- package/client/dist/assets/narration-DtEbQgCw.js +0 -1
- package/client/dist/assets/nav-ApJVg3xu.js +0 -1
- package/client/dist/assets/nav-BKNky1Bg.js +0 -1
- package/client/dist/assets/nav-C6vWWKYx.js +0 -1
- package/client/dist/assets/nav-CXJ6Aw89.js +0 -1
- package/client/dist/assets/nav-CsmFBIDf.js +0 -1
- package/client/dist/assets/nav-DjkmQJjd.js +0 -1
- package/client/dist/assets/packet-B1IxaL5f.js +0 -1
- package/client/dist/assets/packet-Bh5kkbiB.js +0 -1
- package/client/dist/assets/packet-By8fqYxW.js +0 -1
- package/client/dist/assets/packet-CZdvA44E.js +0 -1
- package/client/dist/assets/packet-CrjHRQCP.js +0 -1
- package/client/dist/assets/packet-Dwi2pTtx.js +0 -1
- package/client/dist/assets/packet-_-ZIa0IR.js +0 -1
- package/client/dist/assets/packet-n0W6E1Hn.js +0 -1
- package/client/dist/assets/play-DNlrawbS.js +0 -1
- package/client/dist/assets/provider-capabilities-Doej9lfa.js +0 -1
- package/client/dist/assets/settings-Bd0x4TBa.js +0 -1
- package/client/dist/assets/settings-C1-7cXzC.js +0 -1
- package/client/dist/assets/settings-CAFaT38b.js +0 -1
- package/client/dist/assets/settings-Ct3v1nW2.js +0 -1
- package/client/dist/assets/settings-DHh7_IF5.js +0 -1
- package/client/dist/assets/settings-DQXAmdcv.js +0 -1
- package/client/dist/assets/settings-guzlhpup.js +0 -1
- package/client/dist/assets/settings-sZfTPMEH.js +0 -1
- package/client/dist/assets/setup-3jWaoVUO.js +0 -1
- package/client/dist/assets/setup-BjgRneb2.js +0 -1
- package/client/dist/assets/setup-BzFIjv-f.js +0 -1
- package/client/dist/assets/setup-C4VfQsxE.js +0 -1
- package/client/dist/assets/setup-DfUkpDbN.js +0 -1
- package/client/dist/assets/setup-ECe90Pmu.js +0 -1
- package/client/dist/assets/setup-dlqC4Jmm.js +0 -1
- package/client/dist/assets/setup-jwfLMiM2.js +0 -1
- package/client/dist/assets/spending-EC9xqio-.js +0 -1
- package/client/dist/assets/useDesktop-BQVt8lFd.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-B3mKBIh5.js","assets/rolldown-runtime-CNC7AqOf.js","assets/dist-js-Rlh4FLH5.js","assets/event-Bt7f3wXe.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{t as r}from"./react-dom-DiWzBDP9.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{u as a}from"./chunk-KS7C4IRE-DEKu087k.js";import{D as o,E as s,a as c,h as l,l as u,m as d,r as f,w as p,x as m}from"./useSharedWebSocket-BOdS5_Iz.js";import{t as h}from"./Trans-SnMX4MhW.js";import{n as g,t as _}from"./createLucideIcon-Bjbbp_KS.js";import{a as v,r as y,s as b}from"./useDesktop-RSMTyy7V.js";import{n as x,t as S}from"./save-B6wGWwBR.js";import{n as C,r as w}from"./spending-BqbdPm_4.js";import{c as T,d as E,f as D,n as O}from"./MinimizedChatsContext-Deg39peL.js";import{t as k}from"./file-text-BcLCfcWZ.js";import{t as A}from"./circle-x-CMYsN4ZH.js";import{t as j}from"./download-CFHyyHcw.js";import{t as M}from"./git-branch-BRM0F5GN.js";import{t as N}from"./loader-circle-DcygOQpC.js";import{t as ee}from"./pencil-C9RkrIPZ.js";import{n as P,t as F}from"./square-Ci-PFcFe.js";import{t as te}from"./plus-CsnjfkmX.js";import{t as I}from"./search-Cq_gE3Ik.js";import{t as L}from"./trash-2-BOU3WdZZ.js";import{t as R}from"./triangle-alert-H9T4jAmh.js";import{n as ne,t as z}from"./jira-api-CSCqGr-Q.js";import{t as re}from"./x-CBMI9ejn.js";import{t as B}from"./zap-CHo3aCD1.js";import{M as ie,a as ae,i as V,j as oe,l as se,o as ce,r as le,t as ue}from"./dialog-SRw01_QU.js";import{t as H}from"./utils-BC4DHlz2.js";import{n as de,t as fe}from"./lib-CGdyxIWg.js";import{t as U}from"./formatDistanceToNow-DSj5DprF.js";import{t as W}from"./button-DCBqEaZl.js";import{t as pe}from"./RepositoryScopeSelector-D-RCaknl.js";import{n as me}from"./provider-capabilities-B-wOHfLP.js";function he(){return typeof window<`u`&&window.__TAURI_INTERNALS__!==void 0}async function G(e){if(!he())return;let{invoke:t}=await i(async()=>{let{invoke:e}=await import(`./core-B3mKBIh5.js`).then(e=>e.i);return{invoke:e}},__vite__mapDeps([0,1]));await t(`desktop_reveal_path`,{path:e})}async function ge(e){if(he())try{let t=await i(()=>import(`./dist-js-Rlh4FLH5.js`),__vite__mapDeps([2,0,1]));if(typeof t.open==`function`){await t.open(e);return}}catch(e){console.warn(`[openExternalUrl] tauri shell open failed:`,e)}try{window.open(e,`_blank`,`noopener,noreferrer`)}catch{}}function _e(e=``){return e||(typeof window<`u`&&(`__TAURI_INTERNALS__`in window||window.location.hostname===`tauri.localhost`)||typeof window<`u`&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`ws://127.0.0.1:4200`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`)}var ve=_e(),ye=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_TERMINAL_PANEL;return typeof e!=`string`||e!==`false`})(),be=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENTS_SECTION;return typeof e!=`string`||e!==`false`})(),xe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_CODE_EXPLORER;return typeof e!=`string`||e!==`false`})(),Se=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_JIRA;return typeof e!=`string`||e!==`false`})(),Ce=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MCP;return typeof e!=`string`||e!==`false`})(),we=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_CHAT;return typeof e!=`string`||e!==`false`})(),Te=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_MODE;return we&&(typeof e!=`string`||e!==`false`)})();(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_INTERACTIVE_JOBS;return typeof e!=`string`||e!==`false`})();var Ee=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOOPS_SECTION;return typeof e!=`string`||e!==`false`})(),De=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NATIVE_BROWSER;return typeof e!=`string`||e!==`false`})(),Oe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_PROJECT_BUILDER;return typeof e!=`string`||e!==`false`})(),ke=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_REVIEW_PACKET;return typeof e!=`string`||e!==`false`})(),Ae=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NARRATED_PROGRESS;return typeof e!=`string`||e!==`false`})(),je=_(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Me=_(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ne=_(`circle-arrow-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m12 16 4-4-4-4`,key:`1i9zcv`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Pe=_(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Fe=_(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Ie=_(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),Le=_(`file-minus-corner`,[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Re=_(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),ze=_(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Be=_(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),K=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ve=_(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),He=_(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Ue=_(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),We=_(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),Ge=_(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Ke=_(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),qe=_(`ticket`,[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]),Je=_(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ye=_(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Xe=_(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Ze=_(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),q=new Map,Qe=2e3;function $e(e){q.set(e,(q.get(e)??0)+1)}function et(e){(q.get(e)??0)<=0||setTimeout(()=>{let t=(q.get(e)??0)-1;t<=0?q.delete(e):q.set(e,t)},Qe)}function tt(e){return e?(q.get(e)??0)>0:!1}var J=e(t(),1),nt=3e3,rt=`
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Contract Layer
|
|
7
|
+
|
|
8
|
+
`;function Y(e){return`${u}/api/projects/${encodeURIComponent(e)}`}function it(e,t){return JSON.stringify(e)===JSON.stringify(t)}function at(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>{let t=n.get(e.id);return t&&it(t,e)?t:e});return r.length===e.length&&r.every((t,n)=>t===e[n])?e:r}function ot(){let{t:e}=g(`tickets`),{activeProjectId:t}=y(),[n,r]=(0,J.useState)([]),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(new Set),[u,d]=(0,J.useState)(new Set),p=(0,J.useRef)(t);p.current=t;let m=(0,J.useRef)(0),h=(0,J.useRef)(null),_=(0,J.useRef)(new Set),{registerHandler:v,unregisterHandler:x,connectionStatus:S}=f(),C=(0,J.useId)(),w=(0,J.useCallback)(async(e,t)=>{let n=Y(e),r=await fetch(`${n}/tickets`,{signal:t,cache:`no-store`});if(!r.ok)throw Error(`Failed to fetch tickets: ${r.status}`);let i=await r.json();return Array.isArray(i)?i:i.tickets??[]},[]),T=(0,J.useCallback)(async(t,n)=>{let i=++m.current;h.current?.abort();let o=new AbortController;h.current=o,p.current===t&&(a(!0),s(null));try{let a=await w(t,o.signal);if(o.signal.aborted||i!==m.current||p.current!==t)return;let s=_.current,c=new Set;if(n===`merge`)for(let e of a)s.size>0&&!s.has(e.id)&&c.add(e.id);_.current=new Set(a.map(e=>e.id)),r(n===`replace`?a:e=>at(e,a)),c.size>0&&s.size>0&&(l(c),b.success(e(`toasts.newTicketsAdded`,{count:c.size}),{id:`tickets-added-${t}`}),setTimeout(()=>{p.current===t&&l(e=>{let t=new Set(e);for(let e of c)t.delete(e);return t})},nt))}catch(e){if(o.signal.aborted||i!==m.current||p.current!==t)return;s(e instanceof Error?e.message:String(e))}finally{i===m.current&&(h.current===o&&(h.current=null),p.current===t&&a(!1))}},[w,e]),E=(0,J.useCallback)(async()=>{t&&await T(t,`merge`)},[t,T]);(0,J.useEffect)(()=>{if(m.current+=1,h.current?.abort(),h.current=null,r([]),a(!1),s(null),_.current=new Set,l(new Set),d(new Set),t)return T(t,`replace`),()=>{m.current+=1,h.current?.abort(),h.current=null}},[t,T]);let D=(0,J.useCallback)(t=>{let n=t;if(!n||typeof n.type!=`string`)return;let i=p.current;if(!(n.projectId&&n.projectId!==i))switch(n.type){case`desktop.project_recovered`:n.projectId===i&&E();break;case`mcp.activity`:n.affectedProjectId&&n.affectedProjectId===i&&E();break;case`ticket_created`:{if(!n.ticket)break;let t=n.ticket;r(e=>e.some(e=>e.id===t.id)?e:[...e,t]),_.current.add(t.id),l(e=>new Set([...e,t.id])),tt(i)||b.success(e(`toasts.newTicket`,{title:t.title}),{id:`new-ticket-${t.id}`}),setTimeout(()=>{l(e=>{let n=new Set(e);return n.delete(t.id),n})},nt);break}case`ticket_updated`:{if(!n.ticket)break;if(n.ticket.id===0){E();break}let e=n.ticket;r(t=>t.map(t=>t.id===e.id?e:t)),typeof e.description==`string`&&e.description.includes(rt)&&d(t=>{if(!t.has(e.id))return t;let n=new Set(t);return n.delete(e.id),n});break}case`ticket_deleted`:{if(n.ticketId==null)break;let e=n.ticketId;r(t=>t.filter(t=>t.id!==e)),_.current.delete(e);break}case`explore.contract_refine_started`:if(n.ticketId==null)break;d(e=>new Set([...e,n.ticketId]));break;case`explore.contract_refine_failed`:{if(n.ticketId==null)break;let e=n.ticketId;d(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n});break}}},[E,e]);(0,J.useLayoutEffect)(()=>(v(`tickets-${C}`,D),()=>x(`tickets-${C}`)),[D,v,x,C]);let O=(0,J.useRef)(S);return(0,J.useEffect)(()=>{O.current!==`connected`&&S===`connected`&&p.current&&E(),O.current=S},[S,E]),{tickets:n,loading:i,isLoading:i,error:o,newTicketIds:c,contractRefiningIds:u,refetch:E,refresh:E,deleteTicket:(0,J.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${Y(n)}/tickets/${e}`,{method:`DELETE`});return t.ok&&p.current===n&&await T(n,`merge`),t.ok}catch{return!1}},[t,T]),updateTicketStatus:(0,J.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${Y(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:n})});return t.ok&&p.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T]),updateTicketPriority:(0,J.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${Y(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({priority:n})});return t.ok&&p.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T]),createTicket:(0,J.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${Y(n)}/tickets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return t.ok&&p.current===n&&await T(n,`merge`),t.ok}catch{return!1}},[t,T]),updateTicket:(0,J.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${Y(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});return t.ok&&p.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T])}}function st(e,t){let n=()=>p(t?.in,NaN),r=t?.additionalDigits??2,i=ft(e),a;if(i.date){let e=pt(i.date,r);a=mt(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=gt(i.time),isNaN(s)))return n();if(i.timezone){if(c=vt(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=m(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return m(o+s+c,t?.in)}var ct={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},lt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ut=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ft(e){let t={},n=e.split(ct.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],ct.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ct.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=ct.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function pt(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function mt(e,t){if(t===null)return new Date(NaN);let n=e.match(lt);if(!n)return new Date(NaN);let r=!!n[4],i=ht(n[1]),a=ht(n[2])-1,o=ht(n[3]),s=ht(n[4]),c=ht(n[5])-1;if(r)return wt(t,s,c)?yt(t,s,c):new Date(NaN);{let e=new Date(0);return!St(t,a,o)||!Ct(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function ht(e){return e?parseInt(e):1}function gt(e){let t=e.match(ut);if(!t)return NaN;let n=_t(t[1]),r=_t(t[2]),i=_t(t[3]);return Tt(n,r,i)?n*s+r*o+i*1e3:NaN}function _t(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function vt(e){if(e===`Z`)return 0;let t=e.match(dt);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Et(r,i)?n*(r*s+i*o):NaN}function yt(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var bt=[31,null,31,30,31,30,31,31,30,31,30,31];function xt(e){return e%400==0||e%4==0&&e%100!=0}function St(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(bt[t]||(xt(e)?29:28))}function Ct(e,t){return t>=1&&t<=(xt(e)?366:365)}function wt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Tt(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Et(e,t){return t>=0&&t<=59}async function Dt(e,t,n){let r=new FormData;r.append(`file`,t);let i=await fetch(`${v()}/tickets/${e}/attachments`,{method:`POST`,body:r,signal:n});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??l.t(`attachments:errors.uploadFailed`,{status:i.status}))}return(await i.json()).attachment}async function Ot(e,t){let n=await fetch(`${v()}/tickets/${e}/attachments/${t}`,{method:`DELETE`});if(!n.ok&&n.status!==404)throw Error(l.t(`attachments:errors.deleteFailed`,{status:n.status}))}async function kt(e){let t=await fetch(`${v()}/tickets/${e}/attachments`,{method:`DELETE`});if(!t.ok&&t.status!==404)throw Error(l.t(`attachments:errors.bulkDeleteFailed`,{status:t.status}))}async function At(e){let t=await fetch(`${v()}/tickets/${e}/attachments`);if(!t.ok)throw Error(l.t(`attachments:errors.listFailed`,{status:t.status}));return(await t.json()).attachments}function jt(e,t){return`${v()}/tickets/${e}/attachments/${t}`}async function Mt(e,t){let n=await fetch(jt(e,t));if(!n.ok)throw Error(l.t(`attachments:errors.fetchFailed`,{status:n.status}));return n.blob()}var Nt=`image/jpeg,image/png,image/gif,image/webp,application/pdf,text/csv,text/plain,application/json,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/sql,application/x-sql,text/sql,text/x-sql,.sql`,Pt=new Set(Nt.split(`,`).filter(e=>!e.startsWith(`.`))),Ft=/\.sql$/i,It=/\.(png|jpe?g|gif|webp)$/i;function Lt(e){return Pt.has(e.type)||Ft.test(e.name)||It.test(e.name)}var X=n();function Rt({ticketKey:e,attachment:t,onClose:n}){let{t:r}=g(`attachments`),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(null);if((0,J.useEffect)(()=>{if(!t)return;function e(e){e.key===`Escape`&&n()}document.addEventListener(`keydown`,e);let r=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=r}},[t,n]),(0,J.useEffect)(()=>{if(!t){a(null),s(null);return}let n=!1;return a(null),s(null),Mt(e,t.id).then(e=>{n||a(URL.createObjectURL(e))}).catch(e=>{n||s(e instanceof Error?e.message:r(`errors.loadFailed`))}),()=>{n=!0}},[t,e]),(0,J.useEffect)(()=>()=>{i&&URL.revokeObjectURL(i)},[i]),!t)return null;let c=t.mimeType.startsWith(`image/`),l=t.mimeType===`application/pdf`;return(0,X.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":r(`lightbox.preview`,{name:t.filename}),className:`fixed inset-0 z-[100] flex flex-col bg-black/85 backdrop-blur-sm animate-in fade-in-0 duration-200`,onClick:n,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-white/10 bg-black/40`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":r(`lightbox.backToDesktop`),className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-white/85 hover:bg-white/10 hover:text-white transition-colors`,children:[(0,X.jsx)(x,{className:`w-4 h-4`}),r(`common:actions.back`)]}),(0,X.jsxs)(`div`,{className:`flex-1 text-center min-w-0 px-4`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-white/95 truncate`,children:t.filename}),(0,X.jsx)(`div`,{className:`text-[11px] text-white/50`,children:t.mimeType})]}),(0,X.jsxs)(`a`,{href:i??`#`,download:t.filename,onClick:e=>{e.stopPropagation(),i||e.preventDefault()},className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-white/85 hover:bg-white/10 hover:text-white transition-colors`,"aria-label":r(`lightbox.download`),children:[(0,X.jsx)(j,{className:`w-4 h-4`}),r(`lightbox.download`)]})]}),(0,X.jsx)(`div`,{className:H(`flex-1 flex items-center justify-center overflow-auto p-6`),onClick:n,children:o?(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/80 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:(0,X.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loadError`,{error:o})})}):i?c?(0,X.jsx)(`img`,{src:i,alt:t.filename,onClick:e=>e.stopPropagation(),className:`max-h-full max-w-full rounded-lg shadow-2xl animate-in zoom-in-95 duration-200`}):l?(0,X.jsx)(`iframe`,{src:i,title:t.filename,onClick:e=>e.stopPropagation(),className:`w-full h-full max-w-5xl bg-white rounded-lg shadow-2xl`}):(0,X.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/80 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:[(0,X.jsx)(`p`,{className:`text-sm mb-3`,children:r(`lightbox.previewUnavailable`)}),(0,X.jsxs)(`a`,{href:i,download:t.filename,className:`inline-flex items-center gap-2 px-4 py-2 rounded-md bg-white/10 hover:bg-white/20 text-white transition-colors`,children:[(0,X.jsx)(j,{className:`w-4 h-4`}),r(`lightbox.downloadFile`,{name:t.filename})]})]}):(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/70 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:(0,X.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loading`)})})})]})}function zt(e,t){let n=new Set,r=[];for(let i of[...e,...t])n.has(i.id)||(n.add(i.id),r.push(i));return r}function Bt(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Vt(e){return e.startsWith(`image/`)?`🖼`:e===`application/pdf`?`📄`:e===`text/csv`||e.includes(`spreadsheetml`)||e===`application/vnd.ms-excel`?`📊`:e===`application/json`?`{ }`:e===`text/plain`||e.includes(`sql`)?`📝`:`📎`}function Ht(e){try{return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return e}}function Ut({ticketKey:e,attachments:t,onChange:n,className:r}){let{t:i}=g(`attachments`),[a,o]=(0,J.useState)(new Set),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(null);if((0,J.useEffect)(()=>{let r=!1;return At(e).then(e=>{if(r)return;let i=zt(t,e);i.length!==t.length&&n?.(i)}).catch(()=>{}),()=>{r=!0}},[e]),!t||t.length===0)return null;let d=[...t].sort((e,t)=>e.addedAt<t.addedAt?1:-1);async function f(r){c(null),o(e=>{let t=new Set(e);return t.add(r.id),t});try{await Ot(e,r.id),await new Promise(e=>setTimeout(e,160)),n?.(t.filter(e=>e.id!==r.id))}catch(e){c(e instanceof Error?e.message:i(`errors.removeFailed`)),o(e=>{let t=new Set(e);return t.delete(r.id),t})}}return(0,X.jsxs)(`section`,{className:H(`mt-4`,r),"aria-label":i(`section.ariaLabel`),children:[(0,X.jsxs)(`header`,{className:`flex items-center justify-between mb-2`,children:[(0,X.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:i(`section.title`)}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:i(`section.fileCount`,{count:d.length})})]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1`,children:d.map(e=>{let t=a.has(e.id);return(0,X.jsxs)(`li`,{className:H(`flex items-center gap-3 px-2.5 py-2 rounded-md border border-border bg-card/60 hover:bg-card transition-all duration-200`,t&&`opacity-0 scale-95 max-h-0 py-0 border-transparent overflow-hidden`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`w-6 text-center text-sm shrink-0`,children:Vt(e.mimeType)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`flex-1 min-w-0 flex flex-col text-sm text-left hover:text-primary transition-colors`,children:[(0,X.jsx)(`span`,{className:`font-medium truncate text-foreground`,children:e.filename}),(0,X.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[Bt(e.size),` · `,Ht(e.addedAt)]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`text-[11px] text-primary hover:underline shrink-0`,children:i(`common:actions.open`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>f(e),"aria-label":i(`removeFile`,{name:e.filename}),disabled:t,className:`w-6 h-6 inline-flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50`,children:`×`})]},e.id)})}),s&&(0,X.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:s}),(0,X.jsx)(Rt,{ticketKey:e,attachment:l,onClose:()=>u(null)})]})}function Wt({ticketId:e,onClose:t}){let{t:n}=g(`code`),r=a(),{activeProjectId:i}=y(),o=`${i}:${e}`,s=(0,J.useRef)(o);s.current=o;let c=(0,J.useRef)(0),l=(0,J.useRef)(null),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(!1),[_,b]=(0,J.useState)(null),x=(0,J.useCallback)(async(t=null)=>{l.current?.abort();let n=new AbortController;l.current=n;let r=++c.current,i=()=>!n.signal.aborted&&c.current===r&&s.current===o;p(!0),h(!1),b(t);try{let r=new URLSearchParams({ticketId:String(e),limit:`50`});t&&r.set(`cursor`,t);let a=await fetch(`${v()}/code/activity?${r}`,{signal:n.signal});if(!a.ok)throw Error(`activity unavailable`);let s=await a.json();if(!Array.isArray(s.entries))throw Error(`invalid activity response`);if(!i())return;d(e=>{let n=t&&e?.scope===o?[...e.rows]:[],r=new Set(n.map(e=>`${e.repositoryId}\0${e.path}`));for(let e of s.entries){let t=`${e.repositoryId}\0${e.path}`;r.has(t)||(r.add(t),n.push(e))}return{scope:o,rows:n,nextCursor:s.nextCursor,truncated:!!s.truncated||!!t&&!!e?.truncated}})}catch{i()&&h(!0)}finally{i()&&p(!1)}},[o,e]);if((0,J.useEffect)(()=>{if(xe)return d(null),x(),()=>{l.current?.abort(),c.current++}},[x]),!xe)return null;let S=u?.scope===o?u:null;return!f&&!m&&S&&!S.rows.length&&!S.truncated&&!S.nextCursor?null:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:n(`ticketFiles.title`)}),f&&!S&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:n(`ticketFiles.loading`)}),m&&(0,X.jsxs)(`div`,{className:`text-xs`,role:`alert`,children:[(0,X.jsx)(`span`,{children:n(`ticketFiles.loadFailed`)}),` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>{x(_)},className:`underline`,children:n(`ticketFiles.retry`)})]}),S?.truncated&&(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[n(`ticketFiles.partial`),` `,(0,X.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>{x()},className:`underline`,children:n(`ticketFiles.retry`)})]}),(0,X.jsx)(`ul`,{className:`space-y-1`,children:S?.rows.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{let n=new URLSearchParams({repositoryId:e.repositoryId,path:e.path});e.jobId&&n.set(`changeJobId`,e.jobId),t(),r(`/code?${n}`)},className:`w-full text-left flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-muted/40`,children:[(0,X.jsx)(e.kind===`created`?Re:e.kind===`deleted`?Le:k,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate max-w-24`,title:e.repositoryName,children:e.repositoryName}),(0,X.jsx)(`span`,{className:`font-mono truncate flex-1`,children:e.path}),e.jobId&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground font-mono shrink-0`,title:n(`ticketFiles.jobTitle`,{jobId:e.jobId}),children:[(0,X.jsx)(ze,{className:`h-3 w-3`}),e.jobId.length>10?e.jobId.slice(0,10):e.jobId]}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider shrink-0`,children:n(`kind.${e.kind}`)})]})},`${e.repositoryId}:${e.path}`))}),S?.nextCursor&&(0,X.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>{x(S.nextCursor)},className:`text-xs underline mt-2`,children:n(f?`ticketFiles.loading`:`ticketFiles.loadMore`)})]})}function Gt(e){return e<.005?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Kt(e){return e<1e3?`${e} ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function qt({ticketId:e}){let{t}=g(`tickets`),[n,r]=(0,J.useState)(null),i=a(),{activeProjectId:o}=y(),{closeTicketDetail:s}=wi();if((0,J.useEffect)(()=>{let t=new AbortController;return r(null),fetch(`${v()}/tickets/${e}/spending-summary`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&r(e)}).catch(()=>{}),()=>t.abort()},[e,o]),!n||!n.bySurface||!n.totalRuns||n.totalRuns===0)return null;let c=Object.entries(n.bySurface).filter(([,e])=>e.count>0).map(([e,n])=>t(`spendingLine.breakdownItem`,{n:n.count,label:C[e].toLowerCase()})).join(` + `),l=n.unpricedRuns??0,u=n.pricedRuns??Math.max(0,n.totalRuns-l),d=l>0&&u===0,f=l>0&&u>0,p=n.turnsUnavailableRuns??0,m=n.totalTurns==null||p>0&&(n.turnsReportedRuns??0)===0,h=!m&&p>0;return(0,X.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),s(),i(`/analytics?ticketId=${e}`)},className:`mt-1.5 group inline-flex items-center gap-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,"aria-label":t(`spendingLine.ariaLabel`),children:[(0,X.jsx)(`span`,{className:`tabular-nums font-medium text-foreground`,"data-testid":d?`ticket-cost-unavailable`:void 0,title:d?t(`spendingLine.costUnavailableTooltip`):f?t(`spendingLine.costPartiallyUnavailableTooltip`):(n.estimatedCostUsd??0)>0?t(`spendingLine.estimatedTooltip`):void 0,children:d?`—`:`${(n.estimatedCostUsd??0)>0?`~`:``}${f?`≥`:``}${Gt(n.totalCostUsd)}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{className:`tabular-nums`,"data-testid":m?`ticket-turns-unavailable`:void 0,title:m?t(`spendingLine.turnsUnavailableTooltip`):h?t(`spendingLine.turnsPartiallyUnavailableTooltip`):void 0,children:m?`—`:`${h?`≥`:``}${t(`spendingLine.turns`,{count:n.totalTurns})}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{className:`tabular-nums`,children:t(`spendingLine.active`,{duration:Kt(n.activeDurationMs)})}),c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{children:c})]}),(0,X.jsx)(je,{className:`w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity`})]})}var Jt={draft:{dotClass:`bg-accent-secondary/60`,textClass:`text-accent-secondary`,borderClass:`border-l-[3px] border-dashed border-accent-secondary/50 pl-3`,labelKey:`common:status.draft`,pulsing:!1},todo:{dotClass:`bg-slate-500/70`,textClass:`text-muted-foreground`,borderClass:`border-l-[3px] border-dashed border-slate-500/40 pl-3`,labelKey:`status.todo`,pulsing:!1},in_progress:{dotClass:`bg-blue-400 aurora-light:bg-accent-info`,textClass:`text-foreground font-semibold`,borderClass:`border-l-[3px] border-solid border-blue-500 pl-3`,labelKey:`status.inProgress`,pulsing:!0},on_review:{dotClass:`bg-accent-warning/80`,textClass:`text-accent-warning`,borderClass:`border-l-[3px] border-solid border-accent-warning/60 pl-3`,labelKey:`status.onReview`,pulsing:!1},done:{dotClass:`text-emerald-400 aurora-light:text-accent-success`,textClass:`text-emerald-400/80 aurora-light:text-accent-success`,borderClass:`border-l-[3px] border-solid border-emerald-500 pl-3`,labelKey:`status.done`,pulsing:!1},cancelled:{dotClass:`text-red-400/60 aurora-light:text-destructive/70`,textClass:`text-muted-foreground/50`,borderClass:`pl-3`,labelKey:`status.cancelled`,pulsing:!1}};function Yt({status:e,className:t}){let{t:n}=g(`specs`),r=Jt[e];return e===`done`?(0,X.jsx)(E,{className:H(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.done`)}):e===`cancelled`?(0,X.jsx)(re,{className:H(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.cancelled`)}):r.pulsing?(0,X.jsxs)(`span`,{className:H(`relative flex shrink-0 h-2.5 w-2.5`,t),"aria-label":n(`status.inProgress`),children:[(0,X.jsx)(`span`,{className:H(`animate-ping absolute inline-flex h-full w-full rounded-full opacity-60`,r.dotClass)}),(0,X.jsx)(`span`,{className:H(`relative inline-flex rounded-full h-2.5 w-2.5`,r.dotClass)})]}):(0,X.jsx)(`span`,{className:H(`inline-flex rounded-full h-2.5 w-2.5 shrink-0`,r.dotClass,t),"aria-label":n(r.labelKey)})}function Xt({status:e,className:t}){let{t:n}=g(`specs`),r=Jt[e];return(0,X.jsxs)(`span`,{className:H(`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-medium border`,e===`todo`&&`bg-slate-500/10 border-slate-500/30 text-slate-400 aurora-light:bg-muted aurora-light:border-border aurora-light:text-muted-foreground`,e===`in_progress`&&`bg-blue-500/10 border-blue-500/30 text-blue-400 aurora-light:bg-accent-info/10 aurora-light:border-accent-info/30 aurora-light:text-accent-info`,e===`on_review`&&`bg-accent-warning/10 border-accent-warning/30 text-accent-warning`,e===`done`&&`bg-emerald-500/10 border-emerald-500/30 text-emerald-400 aurora-light:bg-accent-success/10 aurora-light:border-accent-success/30 aurora-light:text-accent-success`,e===`cancelled`&&`bg-red-500/10 border-red-500/30 text-red-400/60 aurora-light:bg-destructive/10 aurora-light:border-destructive/30 aurora-light:text-destructive/70`,t),children:[(0,X.jsx)(Yt,{status:e}),n(r.labelKey)]})}function Zt(){let{activeProjectId:e}=y(),[t,n]=(0,J.useState)({connected:!1,key:null,discardStatus:null}),[r,i]=(0,J.useState)(!0);return(0,J.useEffect)(()=>{if(!Se||!e){n({connected:!1,key:null,discardStatus:null}),i(!1);return}let t=!1;return i(!0),z.getConnection().then(e=>{if(t)return;let r=!!(e.connected&&e.connection?.enabled);n({connected:r,key:e.connection?.jiraProjectKey??null,discardStatus:r?e.connection?.discardStatus??null:null})}).catch(()=>{t||n({connected:!1,key:null,discardStatus:null})}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{connected:t.connected,jiraProjectKey:t.key,discardStatus:t.discardStatus,loading:r}}function Qt({open:e,onOpenChange:t,ticket:n,discardStatus:r,onDiscarded:i}){let{t:a}=g(`jira`),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1);async function u(){l(!0);try{await z.discardSpec(n.id,o.trim()||null),b.success(a(`discard.movedToast`,{status:r,key:n.jira_key??`#${n.id}`})),t(!1),s(``),i?.()}catch(e){b.error(e instanceof Error?e.message:a(`errors.generic`))}finally{l(!1)}}return(0,X.jsx)(ue,{open:e,onOpenChange:e=>{c||t(e)},children:(0,X.jsxs)(le,{movableResizable:!0,className:`max-w-md`,"data-testid":`jira-discard-dialog`,children:[(0,X.jsxs)(ce,{children:[(0,X.jsx)(se,{children:a(`discard.title`,{status:r})}),(0,X.jsx)(V,{children:a(`discard.body`,{status:r,key:n.jira_key??`#${n.id}`})})]}),(0,X.jsxs)(`label`,{className:`block space-y-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:a(`discard.commentLabel`)}),(0,X.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),placeholder:a(`discard.commentPlaceholder`),rows:3,className:`w-full rounded-md border border-border bg-input px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground resize-none`,"data-testid":`jira-discard-comment`})]}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>t(!1),disabled:c,children:a(`wizard.cancel`)}),(0,X.jsxs)(W,{size:`sm`,onClick:u,disabled:c,"data-testid":`jira-discard-confirm`,children:[(0,X.jsx)(je,{className:`w-3.5 h-3.5 mr-1.5`}),c?a(`discard.moving`):a(`discard.confirm`,{status:r})]})]})]})})}var $t=/^\d{4}-\d{2}-\d{2}T/;function en(e){if($t.test(e))try{return{text:U(st(e),{addSuffix:!0,locale:d()}),title:e}}catch{}return{text:e}}function tn({localId:e}){let{t}=g(`jira`),{activeProjectId:n}=y(),r=Zt(),[i,a]=(0,J.useState)(null);if((0,J.useEffect)(()=>{if(!Se||!r.connected)return;let t=!1;return a(null),z.getSpecDetails(e).then(e=>{t||a(e)}).catch(()=>{t||a(null)}),()=>{t=!0}},[e,n,r.connected]),!Se||!r.connected||!i)return null;let o=i.development,s=i.fields.length>0,c=o.pullRequests.length>0,l=o.branches.length>0,u=(o.commits?.length??0)>0;return!s&&!c&&!l&&!u?null:(0,X.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-details-panel`,children:[s&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.detailsTitle`)}),(0,X.jsx)(`div`,{className:`space-y-1.5`,children:i.fields.map((e,t)=>{let n=en(e.value);return(0,X.jsxs)(`div`,{className:`text-xs`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block`,children:e.label}),e.href?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{ge(e.href)},className:`inline-flex items-center gap-1 text-accent-info hover:underline text-left`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.value}),(0,X.jsx)(T,{className:`w-3 h-3 shrink-0`})]}):(0,X.jsx)(`span`,{className:`text-foreground/80 whitespace-pre-line`,title:n.title,children:n.text})]},`${e.label}-${t}`)})})]}),(c||l||u)&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.developmentTitle`)}),c&&(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.pullRequests`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:o.pullRequests.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{ge(e.url)},className:`w-full flex items-start gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-pr`,children:[(0,X.jsx)(Be,{className:`w-3 h-3 mt-0.5 shrink-0 text-accent-info`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`truncate text-foreground/80 block`,children:e.title}),(0,X.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e.status,e.sourceBranch?` · ${e.sourceBranch} → ${e.destBranch??``}`:``]})]})]},e.url))})]}),l&&(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.branches`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:o.branches.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{ge(e.url)},className:`w-full flex items-center gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-branch`,children:[(0,X.jsx)(M,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,X.jsx)(`span`,{className:`truncate font-mono text-foreground/80`,children:e.name}),e.repo&&(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:e.repo})]},e.url))})]}),u&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.commits`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:o.commits.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{ge(e.url)},className:`w-full flex items-center gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-commit`,children:[(0,X.jsx)(ze,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,X.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:e.displayId}),(0,X.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.message})]},e.url))})]})]})]})}var nn=/\n*##\s*Acceptance Criteria\s*\n([\s\S]*?)(?=\n##\s|\n*$)/i;function rn(e){if(!e)return{body:``,criteria:[]};let t=nn.exec(e);if(!t)return{body:e.replace(/\s+$/,``),criteria:[]};let n=t[1],r=e.slice(0,t.index),i=e.slice(t.index+t[0].length),a=`${r.replace(/\s+$/,``)}${i?`\n\n${i.replace(/^\s+/,``)}`:``}`,o=n.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);return{body:a.replace(/\s+$/,``),criteria:o}}var an=new Set([`draft`,`todo`]);function on(e){return!!(an.has(e.status)||e.source===`jira`&&e.jira_key&&e.status!==`cancelled`)}function sn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function cn(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_BROWSER_CAPTURE;return typeof e!=`string`||e!==`false`}var ln={desktop:{width:1280,height:800},tablet:{width:768,height:1024},mobile:{width:375,height:667}},un=class extends Error{},dn=class extends Error{};function fn(e){if(!e)throw Error(`A project owner is required for browser sessions`);return`${u}/api/projects/${encodeURIComponent(e)}`}async function pn(e,t){let n=await fetch(`${fn(e)}/browser/sessions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({initialUrl:t})});if(n.status===409)throw new un(`Too many open browser sessions`);if(n.status===502)throw new dn(`The browser failed to launch`);if(!n.ok)throw Error(`Failed to open browser (${n.status})`);return(await n.json()).session}async function mn(e,t,n,r){let i=await fetch(`${fn(e)}/browser/sessions/${t}/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:n,url:r})});if(!i.ok)throw Error(`Navigation failed (${i.status})`);return await i.json()}async function hn(e,t,n,r,i){let a=await fetch(`${fn(e)}/browser/sessions/${t}/capture`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rect:n,pendingSpecId:r,captureNetwork:i?.captureNetwork??!0})});if(!a.ok)throw Error(await gn(a));return await a.json()}async function gn(e){let t=await e.json().then(e=>e.error).catch(()=>void 0);return t?`Capture failed (${e.status}): ${t}`:`Capture failed (${e.status})`}async function _n(e,t,n,r,i,a=ln){let o=await fetch(`${fn(e)}/browser/sessions/${t}/capture-breakpoints`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rect:n,anchorPoint:r,pendingSpecId:i,breakpoints:a})});if(!o.ok)throw Error(await gn(o));return await o.json()}async function vn(e,t,n){let r=new FormData;r.append(`file`,t,n);let i=await fetch(`${v()}/tickets/${e}/attachments`,{method:`POST`,body:r});if(!i.ok)throw Error(`Upload failed (${i.status})`);return(await i.json()).attachment}async function yn(e,t,n,r){let i=await fetch(`${fn(e)}/browser/sessions/${t}/clipboard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:n,text:r})});if(!i.ok)throw Error(`Clipboard failed (${i.status})`);return await i.json()}async function bn(e,t,n,r){let i=await fetch(`${fn(e)}/browser/sessions/${t}/element`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({selector:n,direction:r})});if(!i.ok)throw Error(`Element navigate failed (${i.status})`);return(await i.json()).probe}async function xn(e,t,n){let r=await fetch(`${fn(e)}/browser/sessions/${t}/popup-view`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:n})});if(!r.ok)throw Error(`Could not switch browser view (${r.status})`)}function Sn(e){if(!e||e===`about:blank`)return`…`;try{return new URL(e).hostname||`…`}catch{return`…`}}async function Cn(e,t){try{await fetch(`${fn(e)}/browser/sessions/${t}`,{method:`DELETE`})}catch{}}function wn(e,t){return`${ve||(typeof window<`u`?`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`:`ws://localhost:4200`)}/ws/browser/${e}?projectId=${encodeURIComponent(t)}`}function Tn(e,t){let n=wn(e,t),r=c(),i=r?new WebSocket(n,[`specrails-desktop`,r]):new WebSocket(n);return i.binaryType=`arraybuffer`,i}function En(e,t=e=>requestAnimationFrame(e),n=e=>cancelAnimationFrame(e)){let r=null,i=null,a=null,o=!1,s=()=>{a!=null&&(n(a),a=null);let t=r,o=i;r=null,i=null,t&&(!o||t.x!==o.x||t.y!==o.y)&&e({type:`mouse`,action:`move`,x:t.x,y:t.y}),o&&e({type:`wheel`,x:o.x,y:o.y,deltaX:o.deltaX,deltaY:o.deltaY})},c=()=>{a==null&&!o&&(a=t(()=>{a=null,s()}))};return{move(e,t){o||(r={x:e,y:t},c())},wheel(e,t,n,r){o||(i?(i.x=e,i.y=t,i.deltaX+=n,i.deltaY+=r):i={x:e,y:t,deltaX:n,deltaY:r},c())},flush(){o||s()},dispose(){o||(o=!0,a!=null&&(n(a),a=null),r=null,i=null)}}}function Dn(e,t,n){let r=t.width>0?(e.x-t.left)/t.width:0,i=t.height>0?(e.y-t.top)/t.height:0,a=Math.min(Math.max(r,0),1)*n.width,o=Math.min(Math.max(i,0),1)*n.height;return{x:Math.round(a),y:Math.round(o)}}function On(e,t,n){let r=n.width>0?t.width/n.width:0,i=n.height>0?t.height/n.height:0;return{left:t.left+e.x*r,top:t.top+e.y*i,width:e.width*r,height:e.height*i}}function kn(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}function An(e,t=8){return e.width>=t&&e.height>=t}function jn(e,t){let n=Math.max(1,t.width),r=Math.max(1,t.height),i=Math.max(0,Math.min(e.x,n-1)),a=Math.max(0,Math.min(e.y,r-1)),o=Math.min(n,Math.max(i+1,e.x+e.width)),s=Math.min(r,Math.max(a+1,e.y+e.height));return{x:Math.round(i),y:Math.round(a),width:Math.round(o-i),height:Math.round(s-a)}}function Mn(e){return{nodeCount:e.nodes.length,htmlBytes:e.html.length,truncated:e.htmlTruncated,networkCount:e.networkRequests?.length??0}}function Nn(e,t){let n=e.indexOf(`,`);if(!e.startsWith(`data:`)||n===-1)throw Error(`dataUrlToFile: not a data URL`);let r=e.slice(0,n),i=/^data:([^;,]+)/.exec(r)?.[1]||`application/octet-stream`,a=e.slice(n+1);if(/;base64$/i.test(r)){let e=atob(a),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new File([n],t,{type:i})}return new File([decodeURIComponent(a)],t,{type:i})}var Pn={objects:[],past:[],future:[]};function Fn(e,t){switch(t.type){case`add`:return{objects:[...e.objects,t.obj],past:[...e.past,e.objects],future:[]};case`delete`:return e.objects.some(e=>e.id===t.id)?{objects:e.objects.filter(e=>e.id!==t.id),past:[...e.past,e.objects],future:[]}:e;case`undo`:return e.past.length===0?e:{objects:e.past[e.past.length-1],past:e.past.slice(0,-1),future:[e.objects,...e.future]};case`redo`:return e.future.length===0?e:{objects:e.future[0],past:[...e.past,e.objects],future:e.future.slice(1)};case`clear`:return e.objects.length===0?e:{objects:[],past:[...e.past,e.objects],future:[]};default:return e}}function In(e){let t=e.filter(e=>e.kind===`step`).map(e=>e.n);return t.length===0?1:Math.max(...t)+1}function Ln(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function Rn(e,t,n=.04){let r=Math.atan2(t.y-e.y,t.x-e.x),i=r-Math.PI/7,a=r+Math.PI/7;return{left:{x:t.x-n*Math.cos(i),y:t.y-n*Math.sin(i)},right:{x:t.x-n*Math.cos(a),y:t.y-n*Math.sin(a)}}}function zn(e,t,n=.01){return Math.abs(e.x-t.x)>=n||Math.abs(e.y-t.y)>=n}function Bn(e,t=.05){let n=e=>Math.min(1+t,Math.max(-t,e));return{x:n(e.x),y:n(e.y)}}function Vn(e,t,n){return{schemaVersion:1,objects:e,baseWidth:t,baseHeight:n}}function Hn({result:e,pendingSpecId:t,onConfirm:n,...r}){let i=(0,J.useCallback)(async r=>{if(!r.annotations){await n(e);return}let i=`screen-annotated-${Date.now()}.png`,a=await vn(t,Nn(r.screenshotDataUrl,i),i);await n({...e,rawScreenshot:e.screenshot,screenshot:a,screenshotDataUrl:r.screenshotDataUrl,annotations:r.annotations,...e.breakpoints?{breakpoints:Object.fromEntries(Object.entries(e.breakpoints).map(([t,n])=>[t,n.attachment.id===e.screenshot.id?{...n,attachment:a,dataUrl:r.screenshotDataUrl}:n]))}:{}})},[n,t,e]);return(0,X.jsx)(Jn,{...r,responsive:Object.keys(e.breakpoints??{}).length>1,screenshotDataUrl:e.screenshotDataUrl,onConfirm:i})}var Un=[`#ef4444`,`#f59e0b`,`#3b82f6`,`#22c55e`,`#ffffff`],Wn=`#111827`,Gn=[{tool:`arrow`,icon:w,labelKey:`editor.tools.arrow`,key:`a`},{tool:`box`,icon:F,labelKey:`editor.tools.box`,key:`r`},{tool:`text`,icon:Je,labelKey:`editor.tools.text`,key:`t`},{tool:`blur`,icon:Ie,labelKey:`editor.tools.blur`,key:`b`},{tool:`step`,icon:Ve,labelKey:`editor.tools.step`,key:`n`}],Kn=0,qn=()=>`a${++Kn}-${Date.now().toString(36)}`;function Jn({screenshotDataUrl:e,responsive:t,macOverlay:n,confirmLabel:r,onConfirm:i,onReselect:a,onCancel:o}){let{t:s}=g(`browser`),[c,l]=(0,J.useReducer)(Fn,Pn),[u,d]=(0,J.useState)(`arrow`),[f,p]=(0,J.useState)(Un[0]),[m,h]=(0,J.useState)(null),[_,v]=(0,J.useState)({w:1,h:1}),[y,b]=(0,J.useState)(!1),[S,C]=(0,J.useState)(!1),w=(0,J.useRef)(!1),T=(0,J.useRef)(null),D=(0,J.useRef)(null),O=c.objects,k=(0,J.useCallback)(()=>{let e=T.current;if(!e)return;let t=D.current?.getBoundingClientRect();if(!t||t.width<=0||t.height<=0||e.naturalWidth<=0||e.naturalHeight<=0)return;let n=Math.min(1,t.width/e.naturalWidth,t.height/e.naturalHeight),r=e.naturalWidth*n,i=e.naturalHeight*n;v(e=>e.w===r&&e.h===i?e:{w:r,h:i})},[]);(0,J.useEffect)(()=>{k();let e=typeof ResizeObserver>`u`?null:new ResizeObserver(k);return D.current&&e?.observe(D.current),window.addEventListener(`resize`,k),()=>{e?.disconnect(),window.removeEventListener(`resize`,k)}},[k]);let A=(0,J.useCallback)((e,t)=>{let n=T.current;if(!n)return{x:0,y:0};let r=n.getBoundingClientRect();return Bn({x:r.width>0?(e-r.left)/r.width:0,y:r.height>0?(t-r.top)/r.height:0})},[]),j=(0,J.useCallback)(e=>{if(y)return;e.target.setPointerCapture?.(e.pointerId);let t=A(e.clientX,e.clientY);if(u===`text`){let e=window.prompt(s(`editor.notePrompt`))?.trim();e&&l({type:`add`,obj:{id:qn(),kind:`text`,x:t.x,y:t.y,text:e,color:f}});return}if(u===`step`){l({type:`add`,obj:{id:qn(),kind:`step`,x:t.x,y:t.y,n:In(O),color:f}});return}h({start:t,cur:t})},[y,u,f,O,A,s]),M=(0,J.useCallback)(e=>{m&&h(t=>t&&{...t,cur:A(e.clientX,e.clientY)})},[m,A]),ee=(0,J.useCallback)(()=>{if(!m)return;let{start:e,cur:t}=m;if(h(null),zn(e,t)){if(u===`arrow`)l({type:`add`,obj:{id:qn(),kind:`arrow`,from:e,to:t,color:f}});else if(u===`box`){let n=Ln(e,t);l({type:`add`,obj:{id:qn(),kind:`box`,...n,color:f}})}else if(u===`blur`){let n=Ln(e,t);l({type:`add`,obj:{id:qn(),kind:`blur`,...n}})}}},[m,u,f]),P=(0,J.useCallback)(()=>{let e=T.current;if(!e||!e.naturalWidth||!e.naturalHeight)throw Error(`Capture image is not loaded`);let t=e.naturalWidth,n=e.naturalHeight,r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`);if(!i)throw Error(`Image rendering is unavailable`);i.drawImage(e,0,0,t,n);for(let e of O)e.kind===`blur`&&(i.fillStyle=Wn,i.fillRect(e.x*t,e.y*n,e.w*t,e.h*n));let a=Math.max(2,t*.004);for(let e of O)if(e.kind===`box`)i.strokeStyle=e.color,i.lineWidth=a,i.strokeRect(e.x*t,e.y*n,e.w*t,e.h*n);else if(e.kind===`arrow`){let r={x:e.from.x*t,y:e.from.y*n},o={x:e.to.x*t,y:e.to.y*n},s=Rn(e.from,e.to,.035);i.strokeStyle=e.color,i.lineWidth=a,i.lineCap=`round`,i.beginPath(),i.moveTo(r.x,r.y),i.lineTo(o.x,o.y),i.moveTo(s.left.x*t,s.left.y*n),i.lineTo(o.x,o.y),i.lineTo(s.right.x*t,s.right.y*n),i.stroke()}else if(e.kind===`text`){let r=Math.max(12,n*.03);i.font=`600 ${r}px sans-serif`,i.textBaseline=`top`,i.lineWidth=Math.max(2,r*.18),i.strokeStyle=`rgba(0,0,0,0.55)`,i.strokeText(e.text,e.x*t,e.y*n),i.fillStyle=e.color,i.fillText(e.text,e.x*t,e.y*n)}else if(e.kind===`step`){let r=Math.max(10,n*.025);i.beginPath(),i.arc(e.x*t,e.y*n,r,0,Math.PI*2),i.fillStyle=e.color,i.fill(),i.fillStyle=`#000`,i.font=`700 ${r*1.1}px sans-serif`,i.textAlign=`center`,i.textBaseline=`middle`,i.fillText(String(e.n),e.x*t,e.y*n),i.textAlign=`start`}let o=r.toDataURL(`image/png`);if(!o.startsWith(`data:image/png;base64,`))throw Error(`Image encoding failed`);return{screenshotDataUrl:o,annotations:Vn(O,t,n)}},[O]),F=(0,J.useCallback)(async()=>{if(!w.current){w.current=!0,b(!0),C(!1);try{await i(O.length===0?{screenshotDataUrl:e}:P())}catch{C(!0)}finally{w.current=!1,b(!1)}}},[O,P,e,i]),te=(0,J.useCallback)(()=>{O.length>0&&!window.confirm(s(`editor.discardConfirm`))||o()},[O.length,o,s]);(0,J.useEffect)(()=>{let e=e=>{if(y)return;let t=e.metaKey||e.ctrlKey;if(t&&e.key.toLowerCase()===`z`){e.preventDefault(),l({type:e.shiftKey?`redo`:`undo`});return}if(t&&e.key===`Enter`){e.preventDefault(),F();return}if(t)return;let n=Gn.find(t=>t.key===e.key.toLowerCase());if(n){d(n.tool);return}e.key===`Escape`&&(e.preventDefault(),te())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[y,F,te]);let I=(e,t)=>e*(t===`w`?_.w:_.h),L=m?Ln(m.start,m.cur):null;return(0,X.jsxs)(`div`,{className:`flex-1 min-h-0 min-w-0 flex flex-col items-center overflow-hidden p-3 gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 max-w-full items-center gap-1 overflow-x-auto rounded-lg border border-border/60 bg-surface/90 px-1.5 py-1 shadow-xl ${n?`ml-[80px]`:``}`,children:[Gn.map(({tool:e,icon:t,labelKey:n})=>(0,X.jsx)(`button`,{type:`button`,title:s(n),"aria-label":s(n),"aria-pressed":u===e,onClick:()=>d(e),className:`h-7 w-7 inline-flex items-center justify-center rounded transition-colors ${u===e?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground hover:bg-card/60`}`,children:(0,X.jsx)(t,{className:`w-3.5 h-3.5`})},e)),(0,X.jsx)(`span`,{className:`w-px h-5 bg-border/60 mx-0.5`}),Un.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.colorLabel`,{color:e}),onClick:()=>p(e),className:`h-5 w-5 rounded-full border transition-transform ${f===e?`scale-110 border-foreground`:`border-border/60`}`,style:{background:e}},e)),(0,X.jsx)(`span`,{className:`w-px h-5 bg-border/60 mx-0.5`}),(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.undo`),title:s(`editor.undoTitle`),disabled:c.past.length===0,onClick:()=>l({type:`undo`}),className:`h-7 w-7 inline-flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-card/60 disabled:opacity-40`,children:(0,X.jsx)(Ye,{className:`w-3.5 h-3.5`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.redo`),title:s(`editor.redoTitle`),disabled:c.future.length===0,onClick:()=>l({type:`redo`}),className:`h-7 w-7 inline-flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-card/60 disabled:opacity-40`,children:(0,X.jsx)(We,{className:`w-3.5 h-3.5`})})]}),t&&(0,X.jsx)(`p`,{className:`shrink-0 max-w-prose text-center text-xs text-muted-foreground`,children:s(`editor.responsiveHint`)}),(0,X.jsx)(`div`,{ref:D,className:`relative flex-1 min-h-0 w-full flex items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`relative shrink-0`,style:{width:_.w,height:_.h},children:[(0,X.jsx)(`img`,{ref:T,src:e,alt:s(`editor.capturedAlt`),onLoad:k,draggable:!1,className:`block w-full h-full select-none rounded shadow-2xl`}),O.map(e=>e.kind===`blur`?(0,X.jsx)(`div`,{className:`absolute pointer-events-none`,style:{backgroundColor:Wn,left:`${e.x*100}%`,top:`${e.y*100}%`,width:`${e.w*100}%`,height:`${e.h*100}%`}},e.id):null),m&&u===`blur`&&L&&(0,X.jsx)(`div`,{className:`absolute border border-accent-info pointer-events-none`,style:{backgroundColor:Wn,left:`${L.x*100}%`,top:`${L.y*100}%`,width:`${L.w*100}%`,height:`${L.h*100}%`}}),(0,X.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full ${u===`text`||u===`step`?`cursor-pointer`:`cursor-crosshair`}`,viewBox:`0 0 ${_.w} ${_.h}`,preserveAspectRatio:`none`,onPointerDown:j,onPointerMove:M,onPointerUp:ee,children:[O.map(e=>{if(e.kind===`box`)return(0,X.jsx)(`rect`,{x:I(e.x,`w`),y:I(e.y,`h`),width:I(e.w,`w`),height:I(e.h,`h`),fill:`none`,stroke:e.color,strokeWidth:Math.max(2,_.w*.004)},e.id);if(e.kind===`arrow`){let t=Rn(e.from,e.to,.035),n=Math.max(2,_.w*.004);return(0,X.jsxs)(`g`,{stroke:e.color,strokeWidth:n,strokeLinecap:`round`,fill:`none`,children:[(0,X.jsx)(`line`,{x1:I(e.from.x,`w`),y1:I(e.from.y,`h`),x2:I(e.to.x,`w`),y2:I(e.to.y,`h`)}),(0,X.jsx)(`polyline`,{points:`${I(t.left.x,`w`)},${I(t.left.y,`h`)} ${I(e.to.x,`w`)},${I(e.to.y,`h`)} ${I(t.right.x,`w`)},${I(t.right.y,`h`)}`})]},e.id)}if(e.kind===`text`)return(0,X.jsx)(`text`,{x:I(e.x,`w`),y:I(e.y,`h`),dominantBaseline:`hanging`,fontSize:Math.max(12,_.h*.03),fontWeight:600,fill:e.color,stroke:`rgba(0,0,0,0.55)`,strokeWidth:1,paintOrder:`stroke`,children:e.text},e.id);if(e.kind===`step`){let t=Math.max(10,_.h*.025);return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`circle`,{cx:I(e.x,`w`),cy:I(e.y,`h`),r:t,fill:e.color}),(0,X.jsx)(`text`,{x:I(e.x,`w`),y:I(e.y,`h`),textAnchor:`middle`,dominantBaseline:`central`,fontSize:t*1.1,fontWeight:700,fill:`#000`,children:e.n})]},e.id)}return null}),m&&u===`box`&&L&&(0,X.jsx)(`rect`,{x:I(L.x,`w`),y:I(L.y,`h`),width:I(L.w,`w`),height:I(L.h,`h`),fill:`none`,stroke:f,strokeDasharray:`4 3`,strokeWidth:Math.max(2,_.w*.004)}),m&&u===`arrow`&&(0,X.jsx)(`line`,{x1:I(m.start.x,`w`),y1:I(m.start.y,`h`),x2:I(m.cur.x,`w`),y2:I(m.cur.y,`h`),stroke:f,strokeWidth:Math.max(2,_.w*.004),strokeLinecap:`round`})]}),y&&(0,X.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center gap-2 bg-background-deep/50 text-sm text-foreground`,children:[(0,X.jsx)(N,{className:`w-4 h-4 animate-spin`}),` `,s(`common:states.saving`)]})]})}),S&&(0,X.jsx)(`p`,{role:`alert`,className:`shrink-0 text-sm text-destructive`,children:s(`modal.toast.captureFailed`)}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,X.jsxs)(W,{size:`sm`,variant:`ghost`,className:`gap-1.5`,onClick:a,disabled:y,children:[(0,X.jsx)(x,{className:`w-3.5 h-3.5`}),` `,s(`editor.reselect`)]}),(0,X.jsxs)(W,{size:`sm`,variant:`ghost`,className:`gap-1.5`,onClick:te,disabled:y,children:[(0,X.jsx)(re,{className:`w-3.5 h-3.5`}),` `,s(`common:actions.cancel`)]}),(0,X.jsxs)(W,{size:`sm`,className:`gap-1.5`,onClick:()=>void F(),disabled:y,"data-testid":`annotation-confirm`,children:[(0,X.jsx)(E,{className:`w-3.5 h-3.5`}),` `,O.length>0?r??s(`editor.createSpec`):s(`editor.skipContinue`)]})]})]})}var Yn=`native-browser:event`;function Xn(e){let t=(e??``).trim();if(!t)return null;if(t===`about:blank`)return t;let n=Zn(t);if(n){if(n.protocol===`http:`||n.protocol===`https:`)return n.toString();let e=`${n.pathname}${n.search}${n.hash}`;if(!/^\d+([/?#].*)?$/.test(e))return null}let r=Zn(`https://${t}`);if(r&&r.protocol===`https:`){let e=r.hostname.toLowerCase();return(e===`localhost`||e.endsWith(`.localhost`)||e===`[::1]`||/^127\./.test(e))&&(r.protocol=`http:`),r.toString()}return null}function Zn(e){try{return new URL(e)}catch{return null}}function Qn(e){let t=(e,t)=>Number.isFinite(e)?e:t;return{x:Math.max(0,Math.round(t(e.left,0))),y:Math.max(0,Math.round(t(e.top,0))),width:Math.max(1,Math.round(t(e.width,1))),height:Math.max(1,Math.round(t(e.height,1)))}}var $n=null,er=null,tr=Promise.resolve();async function nr(){return(await i(()=>import(`./core-B3mKBIh5.js`).then(e=>e.i),__vite__mapDeps([0,1]))).invoke}function rr(e){let t=e?.flag??De,n=e?.tauri??he();return!t||!n?Promise.resolve(!1):($n||=(async()=>{try{return await(await nr())(`browser_supported`)===!0}catch{return $n=null,!1}})(),$n)}async function ir(e){return await rr(e)?(er||=Z(`browser_capture_supported`).then(e=>e===!0).catch(()=>(er=null,!1)),er):!1}async function Z(e,t){return(await nr())(e,t)}function ar(e){let t=tr.then(e,e);return tr=t.catch(()=>{}),t}var Q={open:(e,t,n)=>ar(()=>Z(`browser_open`,{ownerId:e,url:t,bounds:n})),navigate:(e,t)=>Z(`browser_navigate`,{ownerId:e,url:t}),back:e=>Z(`browser_back`,{ownerId:e}),forward:e=>Z(`browser_forward`,{ownerId:e}),reload:e=>Z(`browser_reload`,{ownerId:e}),setBounds:(e,t)=>Z(`browser_set_bounds`,{ownerId:e,bounds:t}),show:e=>Z(`browser_show`,{ownerId:e}),hide:e=>Z(`browser_hide`,{ownerId:e}),close:e=>ar(()=>Z(`browser_close`,{ownerId:e})),devtools:e=>Z(`browser_devtools`,{ownerId:e}),zoom:(e,t)=>Z(`browser_zoom`,{ownerId:e,factor:t}),setSelectMode:(e,t)=>Z(`browser_set_select_mode`,{ownerId:e,enabled:t}),selection:e=>Z(`browser_selection`,{ownerId:e}),capture:(e,t)=>Z(`browser_capture`,{ownerId:e,selectionOnly:t}),onEvent:async(e,t)=>{let n=n=>{n.payload.ownerId===e&&t(n.payload)},{listen:r}=await i(async()=>{let{listen:e}=await import(`./event-Bt7f3wXe.js`).then(e=>e.i);return{listen:e}},__vite__mapDeps([3,1,0]));return r(Yn,n)}},or=e(r(),1),sr=new Map,cr=new Map;function lr(e,t){let n=(cr.get(e)??Promise.resolve()).catch(()=>{}).then(t);return cr.set(e,n),n.finally(()=>{cr.get(e)===n&&cr.delete(e)}).catch(()=>{}),n}function ur({ownerId:e,leaseRevision:t=0,onBusyChange:n,transferError:r,url:i,onClose:a,onFallback:o,onUrlChange:s,onCaptured:c,confirmLabel:l,selectLabel:u}){let{t:d}=g(`browser`),f=(0,J.useRef)(null),p=(0,J.useRef)(!1),[m,h]=(0,J.useState)(i),[_,v]=(0,J.useState)(i),[y,b]=(0,J.useState)(null),[S,C]=(0,J.useState)(!0),[w,E]=(0,J.useState)(!1),[D,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(!1),[j,M]=(0,J.useState)(null),[N,ee]=(0,J.useState)(!1),[P,F]=(0,J.useState)(null);(0,J.useEffect)(()=>(n?.(k||j!==null||N||P!==null),()=>{n?.(!1)}),[n,k,j,N,P]);let te=(0,J.useRef)(1),I=(0,J.useRef)(null),L=(0,J.useRef)(!1),R=(0,J.useRef)(!1),z=(0,J.useRef)(!1),B=(0,J.useRef)(null),ie=(0,J.useRef)(i),ae=(0,J.useRef)({url:i,onFallback:o,onUrlChange:s});ae.current={url:i,onFallback:o,onUrlChange:s},z.current=P!==null;let V=(0,J.useCallback)(async e=>{let t=I.current;if(!(!t||!L.current)){O(null);try{await e(t)}catch(e){I.current===t&&O(e instanceof Error?e.message:String(e))}}},[]);(0,J.useEffect)(()=>{let t=!1,n=null,r=0,i=null,a=e??crypto.randomUUID(),o=Symbol(a);sr.set(a,o);let s=()=>{lr(a,async()=>{sr.get(a)===o&&(sr.delete(a),await Q.close(a))}).catch(()=>{})};I.current=a,L.current=!1,E(!1);let c=()=>{t||r||(r=requestAnimationFrame(()=>{if(r=0,!L.current||z.current||R.current)return;let e=f.current?.getBoundingClientRect();if(!e||e.width<=0||e.height<=0)return;let t=Qn(e);JSON.stringify(t)!==JSON.stringify(B.current)&&(B.current=t,Q.setBounds(a,t).catch(()=>{B.current=null}))}))};return(async()=>{try{let e=await Q.onEvent(a,e=>{if(!t){if(e.kind===`resume`){!z.current&&!R.current&&lr(a,async()=>{if(t||sr.get(a)!==o||z.current||R.current)return;let n=f.current?.getBoundingClientRect();n&&await Q.open(a,e.url??ie.current,Qn(n))}).catch(e=>{t||O(String(e))});return}e.kind===`nav`&&e.url?(v(e.url),ae.current.onUrlChange?.(e.url),M(null),A(!1),p.current||h(e.url)):e.kind===`title`?b(e.title??null):e.kind===`load-started`?C(!0):e.kind===`load-finished`?(C(!1),e.url&&!p.current&&h(e.url)):e.kind===`popup-error`?O(d(`popup.openFailed`)):e.kind===`popup-opened`&&O(null)}});if(t){e();return}n=e;let r=f.current?.getBoundingClientRect();if(!r)throw Error(`hole not measurable`);ie.current=Xn(ae.current.url)??`about:blank`,B.current=Qn(r);let l=B.current;if(!await lr(a,async()=>t||sr.get(a)!==o?!1:(await Q.open(a,ie.current,l),!0)))return;if(t){s();return}L.current=!0,E(!0),i=new ResizeObserver(c),f.current&&i.observe(f.current),window.addEventListener(`resize`,c),window.addEventListener(`scroll`,c,!0),window.visualViewport?.addEventListener(`resize`,c),window.visualViewport?.addEventListener(`scroll`,c),c()}catch{t||ae.current.onFallback()}})(),()=>{t=!0,cancelAnimationFrame(r),i?.disconnect(),window.removeEventListener(`resize`,c),window.removeEventListener(`scroll`,c,!0),window.visualViewport?.removeEventListener(`resize`,c),window.visualViewport?.removeEventListener(`scroll`,c),n?.(),I.current===a&&(I.current=null,L.current=!1),s()}},[e,t]),(0,J.useEffect)(()=>{let e=Xn(i)??`about:blank`;!w||e===ie.current||(ie.current=e,h(e),V(t=>Q.navigate(t,e)))},[i,w,V]);let oe=(0,J.useCallback)(async e=>{let t=I.current;if(!(!t||!L.current||R.current)){R.current=!0,ee(!0),O(null);try{let n=await Q.capture(t,e);if(I.current!==t||(await Q.hide(t),I.current!==t))return;z.current=!0,A(!1),F(n)}catch(e){I.current===t&&O(e instanceof Error?e.message:String(e))}finally{R.current=!1,I.current===t&&ee(!1)}}},[]);(0,J.useEffect)(()=>{if(!k||!w)return;let e=I.current,t=!1,n,r=async()=>{try{let n=await Q.selection(e);if(t||I.current!==e)return;if(n){if(await Q.setSelectMode(e,!1),t||I.current!==e)return;M(n),A(!1),await oe(!0);return}}catch(n){if(t||I.current!==e)return;O(String(n));try{await Q.setSelectMode(e,!1),!t&&I.current===e&&A(!1)}catch(n){!t&&I.current===e&&O(String(n))}return}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[k,w,oe]);let se=async()=>{await V(async e=>{await Q.setSelectMode(e,!k),M(null),A(!k)})},ce=async()=>{F(null),await V(async e=>{await new Promise(e=>requestAnimationFrame(()=>e()));let t=f.current?.getBoundingClientRect();t&&t.width>0&&t.height>0&&(B.current=Qn(t),await Q.setBounds(e,B.current)),await Q.show(e)})};(0,J.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!z.current&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let le=(0,J.useCallback)(()=>{let e=Xn(m);e&&(h(e),V(t=>Q.navigate(t,e)))},[m,V]),ue=(0,J.useCallback)(e=>{te.current=Math.min(3,Math.max(.25,e)),V(e=>Q.zoom(e,te.current))},[V]);return typeof document>`u`?null:(0,or.createPortal)((0,X.jsx)(`div`,{className:`fixed inset-0 z-[80] bg-background-deep/60 backdrop-blur-md pointer-events-auto`,onClick:e=>{e.target===e.currentTarget&&!P&&a()},"data-testid":`native-browser-modal`,children:(0,X.jsxs)(`div`,{className:`absolute inset-x-[4%] inset-y-[3.5%] flex flex-col border border-border/70 rounded-2xl bg-background-deep overflow-hidden shadow-2xl ring-1 ring-black/20`,role:`dialog`,"aria-modal":`true`,"aria-label":d(`modal.dialogLabel`),onClick:e=>e.stopPropagation(),children:[!P&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/50 bg-surface/80 shrink-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(W,{disabled:!w,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`common:actions.back`),onClick:()=>void V(Q.back),children:(0,X.jsx)(x,{className:`w-4 h-4`})}),(0,X.jsx)(W,{disabled:!w,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`modal.nav.forward`),onClick:()=>void V(Q.forward),children:(0,X.jsx)(je,{className:`w-4 h-4`})}),(0,X.jsx)(W,{disabled:!w,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`modal.nav.reload`),onClick:()=>void V(Q.reload),children:(0,X.jsx)(Ge,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),le()},children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 rounded-md border border-border bg-background px-2.5 py-1`,children:[(0,X.jsx)(K,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),onFocus:()=>{p.current=!0},onBlur:()=>{p.current=!1},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),le())},placeholder:d(`modal.address.placeholder`),"aria-label":d(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,X.jsx)(W,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,children:d(`modal.address.go`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`native.zoomOut`),title:d(`native.zoomOut`),onClick:()=>ue(te.current-.1),children:(0,X.jsx)(Ze,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`native.zoomIn`),title:d(`native.zoomIn`),onClick:()=>ue(te.current+.1),children:(0,X.jsx)(Xe,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`native.devtools`),title:d(`native.devtools`),onClick:()=>void V(Q.devtools),children:(0,X.jsx)(ne,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`native.openExternal`),title:d(`native.openExternal`),onClick:()=>void ge(_),children:(0,X.jsx)(T,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":d(`modal.closeBrowser`),onClick:a,children:(0,X.jsx)(re,{className:`w-4 h-4`})})]})]}),(0,X.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full shrink-0 ${S?`bg-accent-warning animate-pulse`:`bg-accent-success`}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:y||_}),(0,X.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-accent-success/30 bg-accent-success/10 text-accent-success px-2 py-px text-[10px] font-medium`,children:d(`native.badge`)})]}),c&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2 shrink-0`,children:[(0,X.jsxs)(W,{variant:k?`secondary`:`ghost`,size:`sm`,disabled:!w||N,"aria-pressed":k,onClick:()=>void se(),children:[(0,X.jsx)(Ue,{className:`mr-1.5 h-3.5 w-3.5`}),u??d(`native.selectElement`)]}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:k?d(`native.selectHint`):j?.selector}),(0,X.jsxs)(W,{variant:`secondary`,size:`sm`,disabled:!w||N||k||_===`about:blank`,onClick:()=>void oe(j!==null),children:[(0,X.jsx)(Me,{className:`mr-1.5 h-3.5 w-3.5`}),d(N?`native.capturing`:j?`native.captureSelection`:`native.capturePage`)]})]})]}),(D||r)&&(0,X.jsx)(`div`,{role:`alert`,className:`border-b border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive shrink-0`,children:D||r}),P&&c&&(0,X.jsx)(Jn,{screenshotDataUrl:P.screenshotDataUrl,confirmLabel:l,onConfirm:async e=>{await c({...P,screenshotDataUrl:e.screenshotDataUrl})},onReselect:()=>{ce()},onCancel:a}),(0,X.jsx)(`div`,{ref:f,className:P?`hidden`:`relative flex-1 min-h-0 overflow-hidden`,children:S&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-muted-foreground`,children:d(`modal.status.opening`)})})]})}),document.body)}function dr(e){let t=e.schedule??(e=>requestAnimationFrame(e)),n=e.cancel??(e=>cancelAnimationFrame(e)),r=e.now??(()=>typeof performance<`u`?performance.now():Date.now()),i=e.release??(()=>{}),a={received:0,decoded:0,drawn:0,droppedStale:0,droppedUndrawn:0,decodeMsTotal:0,drawMsTotal:0},o=!1,s=!1,c=null,l=null,u=null,d=()=>{u=null;let t=l;if(l=null,t==null||o){t!=null&&f(t);return}let n=r();try{e.draw(t),a.drawn++,a.drawMsTotal+=r()-n}catch{}finally{f(t)}},f=e=>{try{i(e)}catch{}},p=()=>{u==null&&!o&&(u=t(d))},m=t=>{s=!0;let n=r();e.decode(t).then(e=>{if(o){f(e);return}a.decoded++,a.decodeMsTotal+=r()-n,l!=null&&(a.droppedUndrawn++,f(l)),l=e,p(),h()},()=>{h()})},h=()=>{if(o){s=!1;return}let e=c;c=null,e==null?s=!1:m(e)};return{push(e){if(!o){if(a.received++,s){c!=null&&a.droppedStale++,c=e;return}m(e)}},stats(){return{...a}},dispose(){if(!o){if(o=!0,c=null,u!=null){try{n(u)}catch{}u=null}l!=null&&(f(l),l=null)}}}}var fr=`specrails-desktop:browser-capture-debug`;function pr(){try{return typeof localStorage<`u`&&localStorage.getItem(fr)===`1`}catch{return!1}}function mr(e,t,n){let r=Math.max(1,n),i=t.decoded-e.decoded,a=t.drawn-e.drawn,o=e=>Math.round(e*10)/10;return{fpsReceived:o((t.received-e.received)*1e3/r),fpsDrawn:o(a*1e3/r),droppedStale:t.droppedStale-e.droppedStale,droppedUndrawn:t.droppedUndrawn-e.droppedUndrawn,avgDecodeMs:i>0?o((t.decodeMsTotal-e.decodeMsTotal)/i):0,avgDrawMs:a>0?o((t.drawMsTotal-e.drawMsTotal)/a):0}}function hr(e,t=e=>console.table([e]),n=2e3,r=()=>Date.now()){let i=e(),a=r(),o=setInterval(()=>{let n=e(),o=r();t(mr(i,n,o-a)),i=n,a=o},n);return()=>clearInterval(o)}function gr(e){let{projectId:t,open:n,initialUrl:r}=e,i=(0,J.useRef)(null),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(0),c=(0,J.useRef)(0),u=(0,J.useRef)(null),d=(0,J.useRef)(null),f=(0,J.useCallback)(()=>{let e=u.current,t=d.current,n=a.current;if(!(!e||!n||n.readyState!==WebSocket.OPEN)&&!(t&&t.width===e.width&&t.height===e.height&&t.deviceScaleFactor===e.deviceScaleFactor))try{n.send(JSON.stringify({type:`input`,event:{type:`resize`,...e}})),d.current=e}catch{}},[]),p=(0,J.useRef)(0),m=(0,J.useRef)(new Map),h=(0,J.useCallback)(()=>{if(p.current!==0||m.current.size===0)return;let e=[...m.current.values()];m.current.clear();for(let t of e)Cn(t.projectId,t.sessionId)},[]),[g,_]=(0,J.useState)({status:`connecting`,errorMsg:null,url:null,title:null,viewport:{width:1280,height:800},hoverRect:null,hoverSelector:null,hoverPath:null,popup:null,popupError:null});(0,J.useEffect)(()=>{if(!n||!t)return;let e=!1,c=null;d.current=null,_(e=>({...e,status:`connecting`,errorMsg:null,popup:null,popupError:null}));let h=dr({decode:e=>createImageBitmap(new Blob([e],{type:`image/jpeg`})),draw:e=>{let t=i.current;t&&(t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height),t.getContext(`2d`)?.drawImage(e,0,0))},release:e=>e.close()}),g=pr()?hr(()=>h.stats()):null;return(async()=>{try{let n=await pn(t,r);if(e){Cn(t,n.id);return}c=n.id,o.current={id:n.id,projectId:t},_(e=>({...e,url:n.url,title:n.title,viewport:u.current??{width:n.viewportWidth,height:n.viewportHeight}}));let i=Tn(n.id,t);a.current=i,i.onmessage=e=>{if(typeof e.data==`string`){try{let t=JSON.parse(e.data);if(t.type===`ready`)_(e=>({...e,status:`ready`,url:t.url??e.url,title:t.title??e.title,viewport:u.current??t.viewport??e.viewport})),f();else if(t.type===`nav`)_(e=>({...e,url:t.url??e.url,title:t.title??e.title}));else if(t.type===`hover`)_(e=>({...e,hoverRect:t.rect??null,hoverSelector:t.selector??null,hoverPath:t.path??null}));else if(t.type===`popup`){let e=typeof t.count==`number`?t.count:0;s.current+=1,_(n=>({...n,popup:e>0?{count:e,active:t.active===!0,url:t.url??null}:null,popupError:null}))}}catch{}return}h.push(e.data)},i.onopen=()=>{e||(f(),_(e=>({...e,status:`ready`})))},i.onerror=()=>{e||_(e=>({...e,status:`error`,errorMsg:l.t(`browser:session.connectionError`)}))},i.onclose=()=>{e||_(e=>({...e,status:`error`,errorMsg:l.t(`browser:session.lostConnection`)}))}}catch(t){if(e)return;let n=t instanceof un?l.t(`browser:session.tooManySessions`):t instanceof dn?l.t(`browser:session.launchFailed`):l.t(`browser:session.openFailed`);_(e=>({...e,status:`error`,errorMsg:n}))}})(),()=>{e=!0,g?.(),h.dispose();let n=a.current;if(n){n.onmessage=null,n.onopen=null,n.onerror=null,n.onclose=null;try{n.close()}catch{}}a.current=null;let r=c;r&&o.current?.id===r&&o.current.projectId===t&&(o.current=null),r&&(p.current>0?m.current.set(`${t}\0${r}`,{sessionId:r,projectId:t}):Cn(t,r))}},[n,t,r,h,f]);let v=(0,J.useCallback)(e=>{let t=a.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify({type:`input`,event:e}))}catch{}},[]),y=(0,J.useCallback)(async(e,t)=>{let n=o.current;if(n)try{let r=await mn(n.projectId,n.id,e,t);if(o.current!==n)return;r.target!==`popup`&&_(e=>({...e,url:r.url,title:r.title}))}catch{}},[]),b=(0,J.useCallback)(async(e,t,n)=>{let r=o.current;if(!r)throw Error(`No active browser session`);p.current+=1;try{return await hn(r.projectId,r.id,e,t,n)}finally{p.current=Math.max(0,p.current-1),h()}},[h]),x=(0,J.useCallback)(async(e,t,n,r)=>{let i=o.current;if(!i)throw Error(`No active browser session`);p.current+=1;try{return await _n(i.projectId,i.id,e,t,n,r)}finally{p.current=Math.max(0,p.current-1),h()}},[h]),S=(0,J.useCallback)(async(e,t)=>{let n=o.current;return n?yn(n.projectId,n.id,e,t):{text:``}},[]),C=(0,J.useCallback)((e,t,n=window.devicePixelRatio||1)=>{if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return;let r=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t));u.current={width:r,height:i,deviceScaleFactor:Number.isFinite(n)?Math.min(2,Math.max(1,n)):1},_(e=>e.viewport.width===r&&e.viewport.height===i?e:{...e,viewport:{width:r,height:i}}),f()},[f]),w=(0,J.useCallback)(e=>{let t=a.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify({type:`probe`,x:e.x,y:e.y}))}catch{}},[]),T=(0,J.useCallback)(()=>{_(e=>e.hoverRect||e.hoverPath?{...e,hoverRect:null,hoverSelector:null,hoverPath:null}:e)},[]),E=(0,J.useCallback)(async(e,t)=>{let n=o.current;return n?bn(n.projectId,n.id,e,t):null},[]),D=(0,J.useCallback)(async e=>{let t=o.current;if(!t)return;let n=s.current,r=++c.current,i=()=>o.current===t&&s.current===n&&c.current===r;try{await xn(t.projectId,t.id,e),i()&&_(e=>({...e,popupError:null}))}catch{i()&&_(e=>({...e,popupError:l.t(`browser:session.connectionError`)}))}},[]);return{...g,canvasRef:i,forwardInput:v,navigate:y,capture:b,captureBreakpoints:x,clipboard:S,navigateElement:E,setViewport:C,probe:w,clearHover:T,setPopupView:D}}function _r(e,t,n,r){let i=(0,J.useRef)(t);i.current=t,(0,J.useEffect)(()=>{let t=e.current;if(!n||!t)return;let a=!1,o=null,s=0,c=0,l=0,u=null,d=()=>{if(o=null,a)return;let e=r??t.getBoundingClientRect();if(!Number.isFinite(e.width)||!Number.isFinite(e.height)||e.width<=0||e.height<=0)return;let n=Math.max(1,Math.round(e.width)),u=Math.max(1,Math.round(e.height)),d=window.devicePixelRatio,f=Number.isFinite(d)?Math.min(2,Math.max(1,d)):1;n===s&&u===c&&f===l||(s=n,c=u,l=f,i.current(n,u,f))},f=()=>{a||o===null&&(o=requestAnimationFrame(d))},p=()=>{u?.removeEventListener(`change`,m),u=typeof window.matchMedia==`function`?window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`):null,u?.addEventListener(`change`,m)},m=()=>{f(),p()};d();let h=typeof ResizeObserver>`u`?null:new ResizeObserver(f);return h?.observe(t),window.addEventListener(`resize`,f),p(),()=>{a=!0,o!==null&&cancelAnimationFrame(o),h?.disconnect(),u?.removeEventListener(`change`,m),window.removeEventListener(`resize`,f)}},[e,n,r?.width,r?.height])}function vr({open:e,url:t,projectId:n,onClose:r}){let[i,a]=(0,J.useState)(`probing`);(0,J.useEffect)(()=>{if(!e||i!==`probing`)return;let t=!0;return rr().then(e=>{t&&a(e?`native`:`screencast`)}),()=>{t=!1}},[e,i]);let o=(0,J.useCallback)(()=>a(`screencast`),[]);return!e||i===`probing`?null:i===`native`?(0,X.jsx)(ur,{url:t,onClose:r,onFallback:o}):(0,X.jsx)(yr,{open:e,url:t,projectId:n,onClose:r})}function yr({open:e,url:t,projectId:n,onClose:r}){let{t:i}=g(`browser`),a=gr({projectId:n,open:e,initialUrl:t}),{canvasRef:o,viewport:s,status:c,errorMsg:l,url:u,title:d,popup:f,popupError:p,setViewport:m}=a,[h,_]=(0,J.useState)(t),v=(0,J.useRef)(null);_r(v,m,e);let y=(0,J.useRef)(a.forwardInput);y.current=a.forwardInput;let b=(0,J.useRef)(null),S=(0,J.useCallback)(()=>(b.current??=En(e=>y.current(e)),b.current),[]);(0,J.useEffect)(()=>()=>{b.current?.dispose(),b.current=null},[]);let C=f?.active?f.url??`about:blank`:u??``;(0,J.useEffect)(()=>{_(C)},[C,f?.active]),(0,J.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,r]);let w=(0,J.useCallback)((e,t)=>{let n=o.current?.getBoundingClientRect();return n?Dn({x:e,y:t},{left:n.left,top:n.top,width:n.width,height:n.height},s):{x:0,y:0}},[o,s]),E=e=>e===2?`right`:e===1?`middle`:`left`,D=(0,J.useCallback)(e=>{let t=w(e.clientX,e.clientY);S().move(t.x,t.y)},[w,S]),O=(0,J.useCallback)(e=>{let t=w(e.clientX,e.clientY),n=S();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`down`,x:t.x,y:t.y,button:E(e.button),clickCount:e.detail||1})},[w,a,S]),k=(0,J.useCallback)(e=>{let t=w(e.clientX,e.clientY),n=S();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`up`,x:t.x,y:t.y,button:E(e.button),clickCount:e.detail||1})},[w,a,S]),A=(0,J.useCallback)(e=>{let t=w(e.clientX,e.clientY);S().wheel(t.x,t.y,e.deltaX,e.deltaY)},[w,S]),j=(0,J.useCallback)(e=>{if(e.key===`Escape`)return;let t=e.metaKey||e.ctrlKey;if(t&&(e.key===`c`||e.key===`v`||e.key===`x`)){e.preventDefault();let t=e.key;(async()=>{try{if(t===`v`){let e=await navigator.clipboard.readText();e&&await a.clipboard(`paste`,e)}else{let{text:e}=await a.clipboard(t===`x`?`cut`:`copy`);e&&await navigator.clipboard.writeText(e)}}catch{}})();return}let n={type:`key`,action:`down`,key:e.key,code:e.code,text:!t&&e.key.length===1?e.key:void 0};a.forwardInput(n),(e.key===`Tab`||e.key===` `||e.key.startsWith(`Arrow`))&&e.preventDefault()},[a]),M=(0,J.useCallback)(e=>{e.key!==`Escape`&&a.forwardInput({type:`key`,action:`up`,key:e.key,code:e.code})},[a]),N=(0,J.useCallback)(()=>{a.navigate(`goto`,h)},[a,h]);return!e||typeof document>`u`?null:(0,or.createPortal)((0,X.jsx)(`div`,{className:`fixed inset-0 z-[80] bg-background-deep/60 backdrop-blur-md pointer-events-auto`,onClick:e=>{e.target===e.currentTarget&&r()},"data-testid":`webview-modal`,children:(0,X.jsxs)(`div`,{className:`absolute inset-x-[4%] inset-y-[3.5%] flex flex-col border border-border/70 rounded-2xl bg-background-deep overflow-hidden shadow-2xl ring-1 ring-black/20`,role:`dialog`,"aria-modal":`true`,"aria-label":i(`modal.dialogLabel`),onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/50 bg-surface/80 shrink-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`common:actions.back`),onClick:()=>a.navigate(`back`),children:(0,X.jsx)(x,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.forward`),onClick:()=>a.navigate(`forward`),children:(0,X.jsx)(je,{className:`w-4 h-4`})}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.reload`),onClick:()=>a.navigate(`reload`),children:(0,X.jsx)(Ge,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),N()},children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 rounded-md border border-border bg-background px-2.5 py-1`,children:[(0,X.jsx)(K,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),N())},placeholder:i(`modal.address.placeholder`),"aria-label":i(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,X.jsx)(W,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,disabled:c===`error`,children:i(`modal.address.go`)})]}),(0,X.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.closeBrowser`),onClick:r,children:(0,X.jsx)(re,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full shrink-0 ${c===`ready`?`bg-accent-success`:c===`error`?`bg-destructive`:`bg-accent-warning animate-pulse`}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:c===`connecting`?i(`modal.status.connecting`):c===`error`?l??i(`modal.status.unavailable`):f?.active?i(`popup.loginWindow`,{origin:Sn(f.url)}):d||``})]}),p&&(0,X.jsx)(`div`,{role:`alert`,className:`px-3 py-1.5 text-xs text-destructive border-b border-border/40 shrink-0`,children:p}),f&&(0,X.jsxs)(`div`,{"data-testid":`webview-popup-bar`,className:`flex items-center gap-2 px-3 py-1.5 text-xs border-b shrink-0 ${f.active?`bg-accent-info/10 border-accent-info/30 text-accent-info`:`bg-surface/70 border-border/40 text-muted-foreground`}`,children:[(0,X.jsx)(T,{className:`w-3.5 h-3.5 shrink-0`}),f.active?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`truncate font-medium`,children:i(`popup.loginWindow`,{origin:Sn(f.url)})}),f.count>1&&(0,X.jsx)(`span`,{className:`shrink-0 opacity-70`,children:i(`popup.stacked`,{count:f.count-1})}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a.setPopupView(`root`),className:`ml-auto shrink-0 inline-flex items-center gap-1 h-6 px-2 rounded-md border border-current/30 hover:bg-card/60 transition-colors`,children:[(0,X.jsx)(x,{className:`w-3 h-3`}),i(`popup.backToPage`)]})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a.setPopupView(`popup`),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md border border-border/50 hover:bg-card/60 hover:text-foreground transition-colors`,children:[i(`popup.show`),f.count>1&&(0,X.jsx)(`span`,{className:`opacity-70`,children:i(`popup.stacked`,{count:f.count-1})})]})]}),(0,X.jsx)(`div`,{ref:v,className:`relative flex-1 min-h-0 overflow-hidden flex items-center justify-center outline-none`,tabIndex:0,onKeyDown:j,onKeyUp:M,children:c===`error`?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center max-w-md px-6`,children:[(0,X.jsx)(R,{className:`w-8 h-8 text-accent-warning`}),(0,X.jsx)(`p`,{className:`text-sm text-foreground/90`,children:l??i(`modal.error.unavailable`)})]}):(0,X.jsx)(`canvas`,{ref:o,style:{maxWidth:`min(100%, ${s.width}px)`,maxHeight:`min(100%, ${s.height}px)`},className:`max-w-full max-h-full block shadow-2xl cursor-default`,onPointerMove:D,onPointerDown:O,onPointerUp:k,onContextMenu:e=>e.preventDefault(),onWheel:A})})]})}),document.body)}var br=(0,J.createContext)(null);function xr({children:e}){let{activeProjectId:t}=y(),[n,r]=(0,J.useState)(null),i=(0,J.useCallback)(e=>r(e),[]),a=cn();return(0,X.jsxs)(br.Provider,{value:{openWebView:i,canOpenWebView:a&&!!t},children:[e,a&&n&&t&&(0,X.jsx)(vr,{open:!0,url:n,projectId:t,onClose:()=>r(null)})]})}function Sr(){return(0,J.useContext)(br)??{openWebView:()=>{},canOpenWebView:!1}}var Cr={analyzing:`activity:smash.stage.analyzing`,identifying:`activity:smash.stage.identifying`,ordering:`activity:smash.stage.ordering`},wr=(0,J.createContext)(null);function $(e){return`smash:${e}`}async function Tr(e,t){try{let n=await fetch(`${u}/api/projects/${e}/tickets/${t}/smash`,{method:`POST`});if(n.ok)b.loading(l.t(`activity:smash.retrying`),{id:$(t)});else{let e=await n.json().catch(()=>({}));b.error(e.reason?l.t(`activity:smash.couldNotRetryWithReason`,{reason:e.reason}):l.t(`activity:smash.couldNotRetry`),{id:$(t)})}}catch(e){b.error(l.t(`activity:smash.retryFailed`,{message:e.message}),{id:$(t)})}}async function Er(e,t,n){try{let r=await fetch(`${u}/api/projects/${e}/tickets/${t}/smash/undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({smashedAt:n})});if(r.ok)b.success(l.t(`activity:smash.undone`),{id:$(t),duration:3e3});else{let e=await r.json().catch(()=>({}));b.error(e.reason?l.t(`activity:smash.undoFailedWithReason`,{reason:e.reason}):l.t(`activity:smash.undoFailed`),{id:$(t)})}}catch(e){b.error(l.t(`activity:smash.undoFailedWithReason`,{reason:e.message}),{id:$(t)})}}function Dr({children:e}){let{registerHandler:t,unregisterHandler:n}=f(),[r,i]=(0,J.useState)({}),a=(0,J.useRef)(new Map),o=(0,J.useRef)(new Map),s=(0,J.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.started`)return;let n=t.ticketId,r=t.runId,o=t.projectId,s=t.timestamp,c=t.ticketTitle;typeof n!=`number`||!r||!o||(a.current.set(n,o),i(e=>({...e,[n]:{ticketId:n,runId:r,stage:`analyzing`,startedAt:s??new Date().toISOString(),ticketTitle:c}})),b.loading(l.t(Cr.analyzing),{id:$(n),description:c?l.t(`activity:smash.onTitled`,{title:c}):l.t(`activity:smash.onThisSpec`)}))},[]),c=(0,J.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.progress`)return;let n=t.ticketId,r=t.stage;if(typeof n!=`number`||!r)return;let a;i(e=>{let t=e[n];return t?(a=t.ticketTitle,{...e,[n]:{...t,stage:r}}):e}),b.loading(l.t(Cr[r]),{id:$(n),description:a?l.t(`activity:smash.onTitled`,{title:a}):l.t(`activity:smash.onThisSpec`)})},[]),u=(0,J.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.completed`)return;let n=t.ticketId,r=t.runId,a=t.projectId,s=t.smashedAt,c=t.childrenIds;typeof n!=`number`||!r||!a||!s||!c||(o.current.set(r,s),i(e=>{let t={...e};return delete t[n],t}),b.success(l.t(`activity:smash.split`,{count:c.length}),{id:$(n),duration:1e4,action:{label:l.t(`activity:smash.undoAction`),onClick:()=>void Er(a,n,s)}}))},[]),d=(0,J.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.failed`)return;let n=t.ticketId,r=t.projectId,o=t.reason??`unknown`;if(typeof n!=`number`||!r)return;a.current.set(n,r),i(e=>{let t={...e};return delete t[n],t});let s=o===`invalid-output`?l.t(`activity:smash.failReason.invalidOutput`):o===`timeout`?l.t(`activity:smash.failReason.timeout`):o===`model_error`?l.t(`activity:smash.failReason.modelError`):o===`crashed`?l.t(`activity:smash.failReason.crashed`):l.t(`activity:smash.failReason.generic`,{reason:o});b.error(l.t(`activity:smash.couldNotComplete`),{id:$(n),description:s,action:{label:l.t(`common:actions.retry`),onClick:()=>void Tr(r,n)},duration:15e3})},[]),p=(0,J.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.undone`)return;let n=t.ticketId;typeof n==`number`&&(b.dismiss($(n)),b.success(l.t(`activity:smash.undone`),{id:$(n),duration:3e3}))},[]);(0,J.useLayoutEffect)(()=>(t(`_smash_started`,s),t(`_smash_progress`,c),t(`_smash_completed`,u),t(`_smash_failed`,d),t(`_smash_undone`,p),()=>{n(`_smash_started`),n(`_smash_progress`),n(`_smash_completed`),n(`_smash_failed`),n(`_smash_undone`)}),[t,n,s,c,u,d,p]),(0,J.useEffect)(()=>()=>{a.current.clear(),o.current.clear()},[]);let m=(0,J.useMemo)(()=>({inflight:r}),[r]);return(0,X.jsx)(wr.Provider,{value:m,children:e})}function Or(e){let t=(0,J.useContext)(wr);return!t||e==null?null:t.inflight[e]??null}var kr=150,Ar={analyzing:0,identifying:1,ordering:2},jr={analyzing:`smash.stage.analyzing`,identifying:`smash.stage.identifying`,ordering:`smash.stage.ordering`};function Mr({stage:e,minDisplayMs:t=kr}){let{t:n}=g(`activity`),[r,i]=(0,J.useState)(e),a=(0,J.useRef)(Date.now()),o=(0,J.useRef)(null);if((0,J.useEffect)(()=>{if(e===r)return;let n=Date.now()-a.current,s=Math.max(0,t-n);return o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i(e),a.current=Date.now(),o.current=null},s),()=>{o.current&&clearTimeout(o.current)}},[e,r,t]),!r)return null;let s=Ar[r];return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-md border border-accent-highlight/40 bg-accent-highlight/10 text-sm text-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`smash-status-pills`,children:[(0,X.jsx)(N,{className:`h-4 w-4 animate-spin text-accent-highlight`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`flex items-center gap-1.5`,children:[`analyzing`,`identifying`,`ordering`].map(e=>(0,X.jsx)(`span`,{className:[`inline-block w-1.5 h-1.5 rounded-full transition-all`,Ar[e]<=s?`bg-accent-highlight`:`bg-muted`,e===r?`scale-125`:`scale-100`].join(` `),"aria-hidden":!0},e))}),(0,X.jsx)(`span`,{className:`font-medium`,children:n(jr[r])})]})}var Nr={simple:{titleKey:`smashModal.modes.simple.title`,bulletKeys:[`smashModal.modes.simple.bullet1`,`smashModal.modes.simple.bullet2`,`smashModal.modes.simple.bullet3`],etaKey:`smashModal.modes.simple.eta`},full:{titleKey:`smashModal.modes.full.title`,bulletKeys:[`smashModal.modes.full.bullet1`,`smashModal.modes.full.bullet2`,`smashModal.modes.full.bullet3`,`smashModal.modes.full.bullet4`],etaKey:`smashModal.modes.full.eta`}};function Pr({open:e,ticketTitle:t,isReSmash:n,childrenCount:r,submitting:i=!1,onCancel:a,onConfirm:o}){let{t:s}=g(`activity`),[c,l]=(0,J.useState)(`simple`),{panelRef:u,panelStyle:d,headerHandleProps:f,resizeHandles:p,isFloating:m,guardBackdrop:_}=ie();return e?(0,or.createPortal)((0,X.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center`,role:`dialog`,"aria-modal":`true`,"data-testid":`smash-confirm-modal`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:_(a)}),(0,X.jsxs)(`div`,{ref:u,className:`relative w-full max-w-lg m-4 rounded-xl glass-card border border-border/30 animate-in fade-in zoom-in-95 duration-150`,style:d,children:[(0,X.jsxs)(`div`,{...f,className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${m?`cursor-grab active:cursor-grabbing`:``}`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0`,children:[(0,X.jsx)(Ke,{className:`w-5 h-5 text-accent-highlight shrink-0 mt-0.5`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:s(`smashModal.title`)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate`,title:t,children:t})]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:a,className:`h-7 w-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-surface/50 transition-colors shrink-0`,"aria-label":s(`common:actions.close`),children:(0,X.jsx)(re,{className:`w-4 h-4`})})]}),n&&r>0&&(0,X.jsx)(`div`,{className:`mx-5 mt-4 rounded-md border border-accent-warning/40 bg-accent-warning/10 px-3 py-2 text-xs text-foreground`,children:(0,X.jsx)(h,{t:s,i18nKey:`smashModal.reSmashWarning`,count:r})}),(0,X.jsxs)(`div`,{className:`px-5 py-4 space-y-3`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:s(`smashModal.modePickerLabel`)}),[`simple`,`full`].map(e=>{let t=Nr[e],n=c===e;return(0,X.jsx)(`button`,{type:`button`,onClick:()=>l(e),disabled:i,className:`w-full text-left rounded-lg border px-3 py-3 transition-colors ${n?`border-accent-highlight/60 bg-accent-highlight/10`:`border-border/40 bg-card/40 hover:bg-card/60 hover:border-border/60`}`,"data-testid":`smash-mode-${e}`,children:(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(`div`,{className:`mt-0.5 h-3.5 w-3.5 rounded-full border-2 shrink-0 ${n?`border-accent-highlight bg-accent-highlight`:`border-muted-foreground/60`}`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[e===`full`&&(0,X.jsx)(B,{className:`w-3.5 h-3.5 text-accent-highlight`,"aria-hidden":!0}),s(t.titleKey)]}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:s(t.etaKey)})]}),(0,X.jsx)(`ul`,{className:`space-y-0.5`,children:t.bulletKeys.map(e=>(0,X.jsxs)(`li`,{className:`text-[11px] text-foreground/70 leading-snug`,children:[`• `,s(e)]},e))})]})]})},e)})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-border/30 bg-surface/20`,children:[(0,X.jsx)(W,{variant:`ghost`,size:`sm`,onClick:a,disabled:i,children:s(`common:actions.cancel`)}),(0,X.jsxs)(W,{size:`sm`,onClick:()=>o(c),disabled:i,"data-testid":`smash-confirm-modal-continue`,children:[(0,X.jsx)(Ke,{className:`w-3.5 h-3.5 mr-1.5`}),s(i?`smashModal.starting`:n?`smashModal.confirmReSmash`:`smashModal.smash`)]})]})]}),(0,X.jsx)(oe,{handles:p})]}),document.body):null}var Fr=`## Contract Layer`;function Ir(e,t){return!(!t||e.status===`draft`||e.parent_epic_id!=null||!e.description?.includes(Fr))}function Lr({ticket:e,projectId:t,provider:n,featureFlagOn:r,childrenCount:i}){let{t:a}=g(`activity`),o=Or(e.id),[s,c]=(0,J.useState)(!1),[l,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(e.origin_conversation_id?void 0:null);(0,J.useEffect)(()=>{let r=e.origin_conversation_id;if(!r){p(null);return}let i=!1;return p(void 0),fetch(`${u}/api/projects/${t}/chat/conversations/${encodeURIComponent(r)}`).then(async e=>{if(!e.ok)throw Error(`origin conversation lookup failed (${e.status})`);let t=await e.json();i||p(t.conversation?.provider??n??null)}).catch(()=>{i||p(null)}),()=>{i=!0}},[t,n,e.origin_conversation_id]);let m=e.origin_conversation_id?f:n,h=r&&me(m),_=e.is_epic===!0,v=!_&&Ir(e,h),y=_&&h,x=_&&i>0,S=(0,J.useCallback)(async n=>{if(h){d(!0);try{let r=await fetch(`${u}/api/projects/${t}/tickets/${e.id}/smash`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:n})});if(!r.ok){let e=await r.json().catch(()=>({}));b.error(e.reason?a(`smash.couldNotStartWithReason`,{reason:e.reason}):a(`smash.couldNotStart`));return}c(!1)}catch(e){b.error(a(`smash.smashFailed`,{message:e.message}))}finally{d(!1)}}},[t,e.id,a,h]),C=(0,J.useCallback)(async n=>{if(h){if(x){d(!0);try{if(!(await fetch(`${u}/api/projects/${t}/tickets/${e.id}/children`,{method:`DELETE`})).ok){b.error(a(`smash.couldNotDeleteChildren`)),d(!1);return}}catch(e){b.error(a(`smash.deleteFailed`,{message:e.message})),d(!1);return}}await S(n)}},[x,S,t,e.id,a,h]);return!v&&!y?null:o?(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,"data-testid":`smash-actions-streaming`,children:(0,X.jsx)(Mr,{stage:o.stage})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{size:`sm`,variant:`outline`,onClick:()=>c(!0),className:`border-accent-highlight/40 text-accent-highlight hover:bg-accent-highlight/10`,"data-testid":y?`resmash-button`:`smash-button`,children:[(0,X.jsx)(Ke,{className:`w-3.5 h-3.5 mr-1.5`}),a(y?`smash.reSmashButton`:`smash.smashButton`)]}),(0,X.jsx)(Pr,{open:s,ticketTitle:e.title,isReSmash:x,childrenCount:i,submitting:l,onCancel:()=>c(!1),onConfirm:C})]})}function Rr({epic:e,childExecutionOrder:t,totalChildren:n,onOpenEpic:r}){let{t:i}=g(`activity`);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-accent-secondary/30 bg-accent-secondary/10 px-3 py-1.5 text-xs`,"data-testid":`epic-breadcrumb`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:r,className:`text-accent-secondary hover:underline font-medium`,children:[`← `,e.title]}),t!=null&&n>0&&(0,X.jsx)(`span`,{className:`text-foreground/60`,children:i(`epicChildren.step`,{order:t,total:n})})]})}var zr={critical:`bg-red-400`,high:`bg-orange-400`,medium:`bg-yellow-400`,low:`bg-slate-400`};function Br(e){return e?zr[e]:`bg-muted`}function Vr(e){return[...e].sort((e,t)=>{let n=e.execution_order??1/0,r=t.execution_order??1/0;return n===r?e.id-t.id:n-r})}function Hr({ticket:e,allTickets:t,onOpenTicket:n}){let{t:r}=g(`activity`),i=e.is_epic===!0,a=e.parent_epic_id!=null;if(!i&&!a)return null;if(i){let i=Vr(t.filter(t=>t.parent_epic_id===e.id));return(0,X.jsx)(Ur,{header:r(`family.subSpecsHeader`,{count:i.length}),rows:i,currentId:e.id,onOpenTicket:n,emptyMessage:r(`family.emptySubSpecs`)})}let o=t.find(t=>t.id===e.parent_epic_id)??null,s=Vr(t.filter(t=>t.parent_epic_id===e.parent_epic_id)),c=o?[o,...s]:s;return(0,X.jsx)(Ur,{header:r(`family.familyHeader`,{count:s.length}),rows:c,currentId:e.id,onOpenTicket:n,emptyMessage:r(`family.noSiblings`)})}function Ur({header:e,rows:t,currentId:n,onOpenTicket:r,emptyMessage:i}){let{t:a}=g(`activity`);return(0,X.jsxs)(`div`,{"data-testid":`epic-family-sidebar`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1.5`,children:[(0,X.jsx)(Ke,{className:`w-3 h-3 text-accent-highlight`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:e})]}),t.length===0?(0,X.jsx)(`p`,{className:`text-[10px] text-foreground/50 italic`,children:i}):(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:t.map(e=>{let t=e.id===n,i=e.is_epic===!0;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{t||r(e.id)},disabled:t,"aria-label":a(i?`family.openParentEpic`:`family.openSubSpec`,{title:e.title}),"aria-current":t?`page`:void 0,className:[`w-full flex items-center gap-1.5 rounded px-1.5 py-1 text-left transition-colors`,t?`bg-accent-highlight/15 cursor-default`:`hover:bg-muted/30 cursor-pointer`].join(` `),"data-testid":`epic-family-row-${e.id}`,children:[i?(0,X.jsx)(D,{className:`w-3 h-3 text-accent-highlight flex-shrink-0`,"aria-hidden":!0}):(0,X.jsx)(`span`,{className:`text-[9px] tabular-nums text-foreground/40 w-3 text-center flex-shrink-0`,children:e.execution_order??`–`}),(0,X.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full flex-shrink-0 ${Br(e.priority)}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-[11px] truncate ${t?`text-foreground font-medium`:`text-foreground/80`}`,title:e.title,children:e.title})]})},e.id)})})]})}var Wr=224,Gr=8,Kr=8;function qr({rails:e,onMoveToRail:t,onClose:n,anchorRect:r}){let{t:i}=g(`tickets`),a=(0,J.useRef)(null),[o,s]=(0,J.useState)(!1);(0,J.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>s(!0));return()=>cancelAnimationFrame(e)},[]),(0,J.useEffect)(()=>{function e(e){a.current&&(a.current.contains(e.target)||n())}function t(e){e.key===`Escape`&&n()}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]);let{top:c,left:l,caretLeft:u}=(0,J.useMemo)(()=>{let e=r.left+r.width/2,t=e-Wr/2,n=window.innerWidth-Wr-Gr,i=Math.max(Gr,Math.min(n,t)),a=e-i,o=Math.max(12,Math.min(Wr-12,a));return{top:r.bottom+Kr,left:i,caretLeft:o}},[r]);return(0,X.jsxs)(`div`,{ref:a,role:`dialog`,"aria-label":i(`rail.popoverTitle`),"data-testid":`move-to-rail-popover`,style:{top:c,left:l,width:Wr,opacity:+!!o,transform:o?`translateY(0) scale(1)`:`translateY(-4px) scale(0.97)`,transformOrigin:`${u}px top`,transition:`opacity 140ms ease-out, transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1)`},className:`fixed z-50 rounded-xl border border-border/60 bg-card/95 backdrop-blur shadow-xl shadow-black/40 p-1`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`absolute w-2 h-2 rotate-45 bg-card/95 border-l border-t border-border/60`,style:{top:-5,left:u-4}}),(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/70 font-medium`,children:i(`rail.popoverTitle`)}),e.length===0?(0,X.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:i(`rail.noRails`)}):(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{t(e.id),n()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left text-sm hover:bg-accent-info/10 hover:text-accent-info transition-colors`,children:[e.status===`running`?(0,X.jsx)(P,{className:`w-3 h-3 text-accent-success animate-pulse shrink-0`,"aria-hidden":!0}):(0,X.jsx)(Pe,{className:`w-3 h-3 text-muted-foreground/60 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),(0,X.jsx)(Ne,{className:`w-3.5 h-3.5 text-muted-foreground/40 shrink-0`,"aria-hidden":!0})]})},e.id))})]})}var Jr=900,Yr=.2,Xr=[`todo`,`in_progress`,`done`,`cancelled`],Zr={draft:`ticketStatus.draft`,todo:`ticketStatus.todo`,in_progress:`ticketStatus.inProgress`,on_review:`ticketStatus.onReview`,done:`ticketStatus.done`,cancelled:`ticketStatus.cancelled`},Qr=[{value:`critical`,labelKey:`priority.critical`,className:`text-red-400`},{value:`high`,labelKey:`priority.high`,className:`text-orange-400`},{value:`medium`,labelKey:`priority.medium`,className:`text-yellow-400`},{value:`low`,labelKey:`priority.low`,className:`text-slate-400`}];function $r(e){return e.jira_epic_key&&e.jira_url?e.jira_url.replace(/\/browse\/[^/]+$/,`/browse/${e.jira_epic_key}`):null}var ei={manual:`source.manual`,"product-backlog":`source.productBacklog`,"propose-spec":`source.proposeSpec`,"get-backlog-specs":`source.getBacklogSpecs`,"free-prompt":`source.freePrompt`};function ti({ticket:e,allLabels:t,allTickets:n,onClose:r,onOpenTicket:i,onSave:a,onDelete:o,rails:s,onMoveToRail:c,onRemoveFromRail:l,embedded:u=!1}){let{t:d}=g(`tickets`),{t:f}=g(`jira`),{activeProjectId:p,projects:m}=y(),{enterSplit:_,state:v}=wi(),x=v.originSide!==null,C=m.find(e=>e.id===p)?.provider,w=me(C),E=(0,J.useMemo)(()=>(n??[]).filter(t=>t.parent_epic_id===e.id),[n,e.id]),D=(0,J.useMemo)(()=>e.parent_epic_id==null?null:(n??[]).find(t=>t.id===e.parent_epic_id)??null,[n,e.parent_epic_id]),O=(0,J.useMemo)(()=>D?(n??[]).filter(e=>e.parent_epic_id===D.id).length:0,[n,D]),[k,j]=(0,J.useState)(e.title),[M,P]=(0,J.useState)(e.description),[F,I]=(0,J.useState)(e.priority??`medium`),[R,ne]=(0,J.useState)([...e.labels??[]]),[B,H]=(0,J.useState)(e.repositoryIds),[de,fe]=(0,J.useState)(!1),[U,he]=(0,J.useState)(!1),[G,_e]=(0,J.useState)(``),[ve,ye]=(0,J.useState)(!1),[be,xe]=(0,J.useState)(!1),[Se,Ce]=(0,J.useState)(!1),[we,Te]=(0,J.useState)(!1),[Ee,De]=(0,J.useState)(!1),[Oe,ke]=(0,J.useState)(!1),Ae=Zt(),Me=Ae.connected&&!!Ae.discardStatus&&e.source===`jira`&&!!e.jira_key,Ne=Ae.connected&&e.source===`jira`&&!!e.jira_key,[Pe,Ie]=(0,J.useState)(e.attachments??[]);(0,J.useEffect)(()=>{Ie(e.attachments??[])},[e.attachments,e.id]);let[Le,Re]=(0,J.useState)(!1),[ze,Be]=(0,J.useState)(null);(0,J.useEffect)(()=>{if(!Ne)return;let e=!0;return z.listStatuses().then(t=>{e&&Be(t.statuses)}).catch(()=>{e&&Be([])}),()=>{e=!1}},[Ne,e.id]);let K=e.jira_status??``,Ve=async t=>{if(t!==e.status){Re(!0);try{await a(e.id,{status:t})}finally{Re(!1)}}},He=async t=>{if(!(!t||t===K)){Re(!0);try{await z.moveSpecToStatus(e.id,t),b.success(f(`moveToStatus.queued`,{status:t}))}catch{b.error(f(`moveToStatus.failed`))}finally{Re(!1)}}},Ue=(0,J.useRef)(null),We=(0,J.useRef)(null),Ge=(0,J.useRef)(null),Ke=(0,J.useMemo)(()=>k!==e.title||M!==e.description||F!==e.priority||JSON.stringify(R)!==JSON.stringify(e.labels)||JSON.stringify(B)!==JSON.stringify(e.repositoryIds),[k,M,F,R,B,e]);(0,J.useEffect)(()=>{de&&Ue.current?.focus()},[de]),(0,J.useEffect)(()=>{if(U){let e=We.current;e&&(e.focus(),e.selectionStart=e.value.length)}},[U]),(0,J.useEffect)(()=>{ve&&Ge.current?.focus()},[ve]),(0,J.useEffect)(()=>{function e(e){e.key===`Escape`&&!de&&!U&&!be&&r()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,de,U,be]);let qe=(0,J.useMemo)(()=>{if(!G.trim())return[];let e=G.toLowerCase();return t.filter(t=>t.toLowerCase().includes(e)&&!R.includes(t)).slice(0,5)},[G,t,R]),Je=(0,J.useCallback)(e=>{let t=e.trim();t&&!R.includes(t)&&ne(e=>[...e,t]),_e(``)},[R]),Ye=(0,J.useCallback)(e=>{ne(t=>t.filter(t=>t!==e))},[]),Xe=(0,J.useCallback)(async()=>{let t={};if(k!==e.title&&(t.title=k),M!==e.description&&(t.description=M),F!==e.priority&&(t.priority=F),JSON.stringify(R)!==JSON.stringify(e.labels)&&(t.labels=R),JSON.stringify(B)!==JSON.stringify(e.repositoryIds)&&(t.repositoryIds=B),Object.keys(t).length===0){r();return}De(!0);let n=await a(e.id,t);De(!1),n?(b.success(d(`detailModal.toast.updated`)),r()):b.error(d(`detailModal.toast.updateFailed`))},[k,M,F,R,B,e,a,r,d]),Ze=(0,J.useCallback)(async()=>{if(Oe)return;ke(!0);let t=!1;try{t=await o(e.id)}catch{t=!1}if(ke(!1),!t){b.error(d(`detailModal.toast.deleteFailed`));return}xe(!1),r()},[Oe,e.id,o,r,d]),[q,Qe]=(0,J.useState)(0),$e=(0,J.useRef)(null),[et,tt]=(0,J.useState)(()=>typeof window<`u`&&window.innerWidth>=Jr);(0,J.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>tt(window.innerWidth>=Jr);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let nt=!u&&!x&&et,rt=(0,J.useCallback)(e=>{$e.current&&Qe(e.clientX-$e.current.startX)},[]),Y=(0,J.useCallback)(t=>{if(!$e.current)return;let n=t.clientX-$e.current.startX,i=window.innerWidth*Yr;if(window.removeEventListener(`pointermove`,rt),window.removeEventListener(`pointerup`,Y),window.removeEventListener(`pointercancel`,Y),$e.current=null,Qe(0),Math.abs(n)>=i&&window.innerWidth>=Jr){let t=v.leftId===e.id;_(n<0?`left`:`right`,e.id),t||r()}},[_,rt,v.leftId,e.id,r]),it=(0,J.useCallback)(e=>{nt&&e.button===0&&(e.target.closest(`button, input, textarea, select, [contenteditable="true"]`)||($e.current={startX:e.clientX,pointerId:e.pointerId},window.addEventListener(`pointermove`,rt),window.addEventListener(`pointerup`,Y),window.addEventListener(`pointercancel`,Y)))},[nt,rt,Y]);(0,J.useEffect)(()=>()=>{$e.current&&(window.removeEventListener(`pointermove`,rt),window.removeEventListener(`pointerup`,Y),window.removeEventListener(`pointercancel`,Y))},[rt,Y]);let at=(0,J.useCallback)(()=>{if(!nt||window.innerWidth<Jr)return;let t=v.leftId===e.id;_(`right`,e.id),t||r()},[nt,_,v.leftId,e.id,r]),{panelRef:ot,panelStyle:st,resizeHandles:ct,guardBackdrop:lt}=ie({enabled:!u,allowMove:!1}),ut=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{ref:ot,className:u?`relative w-full h-full rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 flex flex-col overflow-hidden`:`relative w-full max-w-[67rem] m-4 rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 flex flex-col animate-in fade-in zoom-in-95 duration-200 h-[90vh]`,style:{...q===0?{transition:`transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1)`}:{transform:`translateX(${q}px)`,transition:`none`},...st},children:[D&&(0,X.jsx)(`div`,{className:`px-5 pt-3`,children:(0,X.jsx)(Rr,{epic:D,childExecutionOrder:e.execution_order??null,totalChildren:O,onOpenEpic:()=>i?.(D.id)})}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${nt?`cursor-grab active:cursor-grabbing`:``}`,onPointerDown:it,"data-testid":`ticket-modal-header`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[de?(0,X.jsx)(`input`,{ref:Ue,value:k,onChange:e=>j(e.target.value),onBlur:()=>fe(!1),onKeyDown:t=>{t.key===`Enter`&&fe(!1),t.key===`Escape`&&(j(e.title),fe(!1))},className:`w-full bg-transparent border-b border-accent-primary/50 text-sm font-semibold text-foreground outline-none pb-0.5`}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>fe(!0),className:`group flex items-center gap-1.5 text-left w-full`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:k||d(`untitled`)}),(0,X.jsx)(ee,{className:`w-3 h-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0`})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] text-foreground font-mono`,children:[`#`,e.id]}),e.status===`on_review`&&(0,X.jsx)(`span`,{title:d(`specs:status.onReviewHint`),"data-testid":`ticket-modal-on-review-badge`,children:(0,X.jsx)(Xt,{status:`on_review`})})]}),(0,X.jsx)(qt,{ticketId:e.id})]}),p&&(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(Lr,{ticket:e,projectId:p,provider:C,featureFlagOn:w,childrenCount:E.length})}),(0,X.jsx)(ri,{ticket:e,title:k,description:M,priority:F,labels:R,repositoryIds:B,onClose:r}),s&&(c||l)&&(0,X.jsx)(ii,{ticket:e,rails:s,onMoveToRail:c,onRemoveFromRail:l}),nt&&(0,X.jsxs)(W,{variant:`outline`,size:`sm`,className:`shrink-0 mr-1 gap-1.5`,"data-testid":`ticket-modal-compare`,onClick:at,title:d(`detailModal.compareTooltip`),children:[(0,X.jsx)(Fe,{className:`w-3.5 h-3.5`}),d(`detailModal.compare`)]}),(0,X.jsx)(`button`,{onClick:r,className:`h-7 w-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-surface/50 transition-colors cursor-pointer shrink-0`,"data-testid":`ticket-modal-close`,children:(0,X.jsx)(re,{className:`w-4 h-4`})})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row h-full`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 px-5 py-4 space-y-4 flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1.5`,children:d(`fields.description`)}),!U&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>he(!0),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,X.jsx)(ee,{className:`w-2.5 h-2.5`}),d(`common:actions.edit`)]})]}),U?(0,X.jsxs)(`div`,{className:`space-y-1.5 flex-1 flex flex-col`,children:[(0,X.jsx)(`textarea`,{ref:We,value:M,onChange:e=>P(e.target.value),className:`w-full flex-1 rounded-lg border border-border bg-input px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground resize-none min-h-[300px]`,placeholder:d(`fields.markdownPlaceholder`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px]`,onClick:()=>he(!1),children:d(`detailModal.doneEditing`)}),(0,X.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:d(`fields.supportsMarkdown`)})]})]}):M?(0,X.jsx)(ci,{description:M,onEdit:()=>he(!0)}):(0,X.jsx)(`button`,{type:`button`,onClick:()=>he(!0),className:`w-full rounded-lg border border-dashed border-border/40 bg-muted/10 px-3 py-4 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/20 transition-colors text-center`,children:d(`detailModal.addDescription`)})]}),(0,X.jsx)(Ut,{ticketKey:e.id,attachments:Pe,onChange:Ie}),(0,X.jsx)(Wt,{ticketId:e.id,onClose:r}),e.prerequisites&&e.prerequisites.length>0&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`detailModal.prerequisites`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.prerequisites.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono bg-accent/60 text-foreground/70`,children:[`#`,e]},e))})]})]}),(0,X.jsxs)(`div`,{className:`sm:w-56 sm:border-l border-t sm:border-t-0 border-border/30 px-4 py-4 space-y-4 bg-muted/5`,children:[e.jira_url&&e.jira_key&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{ge(e.jira_url)},"data-testid":`jira-go-to-ticket`,className:`w-full inline-flex items-center justify-center gap-1.5 h-7 rounded border border-accent-info/50 bg-accent-info/10 px-2 text-xs font-medium text-accent-info hover:bg-accent-info/20 transition-colors`,children:[(0,X.jsx)(T,{className:`w-3.5 h-3.5 shrink-0`}),f(`detail.goToTicket`,{key:e.jira_key})]}),e.jira_epic_key&&(0,X.jsxs)(`div`,{"data-testid":`jira-epic`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`detail.epic`)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{let t=$r(e);t&&ge(t)},title:e.jira_epic_name??e.jira_epic_key,className:`w-full inline-flex items-center gap-1.5 rounded border border-accent-highlight/40 bg-accent-highlight/5 px-2 py-1.5 text-left text-xs hover:bg-accent-highlight/10 transition-colors`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-highlight shrink-0`,children:e.jira_epic_key}),e.jira_epic_name&&(0,X.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.jira_epic_name})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.status`)}),Ne?(0,X.jsx)(`select`,{value:K,disabled:Le||ze===null,onChange:e=>{He(e.target.value)},className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground disabled:opacity-60`,"data-testid":`ticket-jira-status-select`,children:ze===null?(0,X.jsx)(`option`,{value:K,children:K||d(`states.loading`,{ns:`common`})}):(0,X.jsxs)(X.Fragment,{children:[K&&!ze.some(e=>e.name===K)&&(0,X.jsx)(`option`,{value:K,children:K}),ze.map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.name},e.name))]})}):(0,X.jsxs)(`select`,{value:e.status,disabled:Le,onChange:e=>{Ve(e.target.value)},className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground disabled:opacity-60`,"data-testid":`ticket-status-select`,children:[!Xr.includes(e.status)&&(0,X.jsx)(`option`,{value:e.status,children:d(Zr[e.status],{ns:`tickets`})}),Xr.map(e=>(0,X.jsx)(`option`,{value:e,children:d(Zr[e],{ns:`tickets`})},e))]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.priority`)}),(0,X.jsx)(`select`,{value:F,onChange:e=>I(e.target.value),className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground`,children:Qr.map(e=>(0,X.jsx)(`option`,{value:e.value,children:d(e.labelKey)},e.value))})]}),(0,X.jsx)(pe,{value:B,onChange:H,disabled:Ee}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.labels`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1.5`,children:R.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium bg-accent/60 text-foreground/70 group`,children:[e,(0,X.jsx)(`button`,{type:`button`,onClick:()=>Ye(e),className:`text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,X.jsx)(A,{className:`w-2.5 h-2.5`})})]},e))}),ve?(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{ref:Ge,value:G,onChange:e=>_e(e.target.value),onKeyDown:e=>{e.key===`Enter`&&G.trim()&&(e.preventDefault(),Je(G)),e.key===`Escape`&&(ye(!1),_e(``))},onBlur:()=>{G.trim()&&Je(G),ye(!1),_e(``)},placeholder:d(`detailModal.addLabelPlaceholder`),className:`w-full h-6 rounded border border-border bg-input px-2 text-[10px] text-foreground placeholder:text-muted-foreground`}),qe.length>0&&(0,X.jsx)(`div`,{className:`absolute left-0 right-0 top-full mt-0.5 rounded border border-border/50 bg-popover shadow-lg z-10 py-0.5`,children:qe.map(e=>(0,X.jsx)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),Je(e)},className:`w-full text-left px-2 py-1 text-[10px] hover:bg-accent/50 text-foreground/80`,children:e},e))})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>ye(!0),className:`flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,X.jsx)(te,{className:`w-2.5 h-2.5`}),d(`detailModal.addLabel`)]})]}),(0,X.jsx)(Hr,{ticket:e,allTickets:n??[],onOpenTicket:e=>i?.(e)}),e.source===`jira`&&e.jira_key&&(0,X.jsx)(tn,{localId:e.id}),e.metadata?.effort_level&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:d(`detailModal.effort`)}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.metadata.effort_level})]}),e.assignee&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:d(`detailModal.assignee`)}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.assignee})]})]})]})}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-t border-border/30`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:d(`meta.createdAgo`,{time:ni(e.created_at)})}),(0,X.jsx)(`span`,{children:d(`meta.updatedAgo`,{time:ni(e.updated_at)})}),e.source&&(0,X.jsx)(`span`,{className:`bg-muted/30 rounded px-1.5 py-0.5`,children:ei[e.source]?d(ei[e.source]):e.source})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[Me?(0,X.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 text-xs text-accent-info hover:bg-accent-info/10`,onClick:()=>Ce(!0),"data-testid":`jira-move-to-button`,children:[(0,X.jsx)(je,{className:`w-3 h-3 mr-1`}),f(`discard.moveButton`,{status:Ae.discardStatus})]}):(0,X.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 text-xs text-red-400 aurora-light:text-destructive hover:text-red-300 aurora-light:hover:text-destructive hover:bg-red-500/10 aurora-light:hover:bg-destructive/10`,onClick:()=>xe(!0),children:[(0,X.jsx)(L,{className:`w-3 h-3 mr-1`}),d(`common:actions.delete`)]}),Ke&&(0,X.jsxs)(W,{size:`sm`,className:`h-7 text-xs`,onClick:()=>{Ne?Te(!0):Xe()},disabled:Ee||!k.trim(),children:[(0,X.jsx)(S,{className:`w-3 h-3 mr-1`}),d(Ee?`common:states.saving`:`common:actions.save`)]})]})]})]}),(0,X.jsx)(ue,{open:be,onOpenChange:e=>{Oe||xe(e)},children:(0,X.jsxs)(le,{className:`max-w-sm`,children:[(0,X.jsxs)(ce,{children:[(0,X.jsx)(se,{children:d(`deleteDialog.title`)}),(0,X.jsx)(V,{children:(0,X.jsx)(h,{t:d,i18nKey:`deleteDialog.body`,values:{id:e.id,title:e.title},components:{strong:(0,X.jsx)(`span`,{className:`font-semibold text-foreground`})}})})]}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>xe(!1),disabled:Oe,children:d(`common:actions.cancel`)}),(0,X.jsxs)(W,{variant:`destructive`,size:`sm`,onClick:()=>{Ze()},disabled:Oe,"aria-busy":Oe,children:[Oe?(0,X.jsx)(N,{className:`w-3.5 h-3.5 mr-1.5 animate-spin`}):(0,X.jsx)(L,{className:`w-3.5 h-3.5 mr-1.5`}),d(`common:actions.delete`)]})]})]})}),Me&&Ae.discardStatus&&(0,X.jsx)(Qt,{open:Se,onOpenChange:Ce,ticket:{id:e.id,title:e.title,jira_key:e.jira_key},discardStatus:Ae.discardStatus,onDiscarded:r}),(0,X.jsx)(ue,{open:we,onOpenChange:Te,children:(0,X.jsxs)(le,{className:`max-w-md`,"data-testid":`jira-save-confirm`,children:[(0,X.jsxs)(ce,{children:[(0,X.jsx)(se,{children:f(`detail.saveTitle`)}),(0,X.jsx)(V,{children:f(`detail.saveBody`,{key:e.jira_key??`#${e.id}`})})]}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>Te(!1),children:d(`common:actions.cancel`)}),(0,X.jsxs)(W,{size:`sm`,onClick:()=>{Te(!1),Xe()},disabled:Ee,"data-testid":`jira-save-confirm-btn`,children:[(0,X.jsx)(S,{className:`w-3.5 h-3.5 mr-1.5`}),f(`detail.saveConfirm`)]})]})]})})]});return u?ut:(0,or.createPortal)((0,X.jsxs)(`div`,{className:`fixed inset-0 z-[68] flex items-center justify-center`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/70`,onClick:lt(r)}),ut,(0,X.jsx)(oe,{handles:ct})]}),document.body)}function ni(e){try{return U(new Date(e),{addSuffix:!0,locale:d()})}catch{return e}}function ri({ticket:e,title:t,description:n,priority:r,labels:i,repositoryIds:a,onClose:o}){let{t:s}=g(`tickets`),{triggerResume:c}=O(),{activeProjectId:l}=y(),{closeTicketDetail:u}=wi();return on(e)?(0,X.jsxs)(W,{variant:`default`,size:`sm`,onClick:()=>{if(!l)return;let{body:d,criteria:f}=rn(n);c({kind:`explore-spec`,projectId:l,label:t||e.title||s(`detailModal.ticketFallbackLabel`,{id:e.id}),restoreRoute:`/`,params:{initialIdea:``,pendingSpecId:sn(),initialAttachmentIds:[],resumeConversationId:e.origin_conversation_id??void 0,editTicket:{id:e.id,title:t,description:d,labels:i,priority:r,repositoryIds:a,acceptanceCriteria:f,status:e.status}}}),u(),o()},className:`shrink-0 mr-2`,"data-testid":`continue-editing`,children:[(0,X.jsx)(He,{className:`w-3.5 h-3.5 mr-1.5`}),s(`detailModal.continueEditing`)]}):null}function ii({ticket:e,rails:t,onMoveToRail:n,onRemoveFromRail:r}){let{t:i}=g(`tickets`),[a,o]=(0,J.useState)(null),s=(0,J.useRef)(null),c=t.find(t=>t.ticketIds.includes(e.id));return c?r?(0,X.jsxs)(W,{variant:`outline`,size:`sm`,className:`shrink-0 mr-2 gap-1.5 border-accent-warning/30 text-accent-warning hover:bg-accent-warning/10 hover:text-accent-warning`,"data-testid":`modal-remove-from-rail`,onClick:()=>r(e.id),title:i(`rail.currentlyOn`,{rail:c.label}),children:[(0,X.jsx)(x,{className:`w-3.5 h-3.5`,"aria-hidden":!0}),i(`rail.removeFromRail`)]}):null:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{ref:s,variant:`outline`,size:`sm`,className:`shrink-0 mr-2 gap-1.5 border-accent-info/30 text-accent-info hover:bg-accent-info/10 hover:text-accent-info`,"data-testid":`modal-move-to-rail`,onClick:()=>{s.current&&o(s.current.getBoundingClientRect())},children:[i(`rail.moveToRail`),(0,X.jsx)(je,{className:`w-3.5 h-3.5`,"aria-hidden":!0})]}),a&&(0,X.jsx)(qr,{rails:t,anchorRect:a,onMoveToRail:t=>n(e.id,t),onClose:()=>o(null)})]}):null}var ai=`
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Contract Layer
|
|
13
|
+
|
|
14
|
+
`;function oi(e){let t=e.indexOf(ai);return t<0?{user:e,contract:null}:{user:e.slice(0,t),contract:e.slice(t+26)}}function si(e){let t=[`### Naming Contract`,`### Data Shapes`,`### State Machine`,`### Invariants`,`### File Touch List`],n=0;for(let r of t){let t=e.indexOf(r);if(t<0)continue;let i=e.slice(t+r.length),a=i.indexOf(`N/A — model did not produce items`),o=i.indexOf(`### `);a>=0&&(o<0||a<o)||n++}return n}function ci({description:e,onEdit:t}){let{t:n}=g(`tickets`),{openWebView:r}=Sr(),{user:i,contract:a}=oi(e),o=i||e,s=(0,J.useMemo)(()=>({a:({href:e,children:t})=>(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,onClick:t=>{typeof e==`string`&&/^https?:\/\//i.test(e)&&(t.preventDefault(),t.stopPropagation(),r(e))},children:t})}),[r]);return(0,X.jsxs)(`div`,{className:`flex-1 rounded-lg bg-muted/20 px-3 py-2 overflow-y-auto transition-colors`,onClick:e=>{e.target.closest(`details, summary`)||t()},role:`button`,style:{cursor:`pointer`},children:[(0,X.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80 text-xs`,children:(0,X.jsx)(de,{remarkPlugins:[fe],components:s,children:o})}),a&&(0,X.jsxs)(`details`,{"data-testid":`contract-layer-disclosure`,className:`mt-3 rounded-md border border-border/40 bg-muted/10 px-2 py-1`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`summary`,{className:`cursor-pointer text-[10px] font-medium text-foreground/80 select-none flex items-center gap-2`,children:[n(`contractLayer.title`),(0,X.jsx)(`span`,{className:`rounded-full bg-muted/40 px-1.5 text-[9px] text-foreground/60`,children:n(`contractLayer.populated`,{n:si(a)})})]}),(0,X.jsx)(`div`,{className:`mt-2 prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80 text-xs`,children:(0,X.jsx)(de,{remarkPlugins:[fe],components:s,children:a})})]})]})}var li={critical:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,high:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,medium:``,low:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`};function ui(e){try{return U(new Date(e),{addSuffix:!0,locale:d()})}catch{return e}}function di({tickets:e,excludeIds:t,onSelect:n}){let{t:r}=g(`tickets`),[i,a]=(0,J.useState)(``),o=(0,J.useMemo)(()=>{let n=new Set(t),r=e.filter(e=>e.status!==`cancelled`&&!n.has(e.id));if(!i.trim())return r;let a=i.toLowerCase();return r.filter(e=>e.title.toLowerCase().includes(a)||e.description.toLowerCase().includes(a))},[e,t,i]);return(0,X.jsxs)(`div`,{"data-testid":`spec-compare-picker`,className:`h-full flex flex-col rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`px-4 py-3 border-b border-border/30 flex items-center gap-2`,children:[(0,X.jsx)(qe,{className:`w-3.5 h-3.5 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:r(`comparePicker.title`)}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`comparePicker.count`,{n:o.length})})]}),(0,X.jsx)(`div`,{className:`px-4 py-2 border-b border-border/20`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(I,{className:`absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:r(`comparePicker.searchPlaceholder`),className:`w-full h-7 rounded border border-border bg-input pl-7 pr-2 text-[11px] text-foreground placeholder:text-muted-foreground outline-none focus:border-accent-primary/60`})]})}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`spec-compare-picker-list`,children:o.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center px-4 py-8 gap-2`,children:[(0,X.jsx)(qe,{className:`w-6 h-6 text-muted-foreground/40`}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.trim()?r(`comparePicker.noMatches`):r(`comparePicker.empty`)})]}):(0,X.jsx)(`ul`,{className:`divide-y divide-border/10`,children:o.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`spec-compare-card-${e.id}`,onClick:()=>n(e.id),className:`w-full text-left px-4 py-2.5 hover:bg-accent/30 transition-colors flex items-start gap-2 group`,children:[(0,X.jsx)(Yt,{status:e.status}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] font-mono text-muted-foreground`,children:[`#`,e.id]}),e.priority&&li[e.priority]&&(0,X.jsx)(`span`,{className:`inline-flex items-center rounded px-1 py-0.5 text-[9px] font-medium border ${li[e.priority]}`,children:r(`priority.${e.priority}`)})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-xs text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title||r(`untitled`)}),e.description&&(0,X.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground line-clamp-1`,children:e.description.slice(0,120)}),e.labels&&e.labels.length>0&&(0,X.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[e.labels.slice(0,3).map(e=>(0,X.jsx)(`span`,{className:`inline-flex items-center rounded px-1 py-0.5 text-[9px] bg-accent/40 text-foreground/60`,children:e},e)),e.labels.length>3&&(0,X.jsxs)(`span`,{className:`text-[9px] text-muted-foreground`,children:[`+`,e.labels.length-3]})]}),(0,X.jsx)(`p`,{className:`mt-1 text-[9px] text-muted-foreground`,children:r(`meta.updatedAgo`,{time:ui(e.updated_at)})})]})]})},e.id))})})]})}var fi=.25,pi=.75;function mi({state:e,leftTicket:t,rightTicket:n,allTickets:r,allLabels:i,onSave:a,onDelete:o,onOpenTicket:s,onCloseAll:c,onSetCompared:l,onSetRatio:u,onExitSplit:d}){let f=(0,J.useRef)(null),p=(0,J.useRef)(null),[m,h]=(0,J.useState)(!0);(0,J.useEffect)(()=>{let e=setTimeout(()=>h(!1),320);return()=>clearTimeout(e)},[]);let g=(0,J.useCallback)(e=>{if(!p.current)return;let t=window.innerWidth,n=e.clientX/t;u(Math.min(pi,Math.max(fi,n)))},[u]),_=(0,J.useCallback)(e=>{if(!p.current)return;let{pointerId:t,element:n}=p.current;try{n.releasePointerCapture(t)}catch{}p.current=null,window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_)},[g]),v=(0,J.useCallback)(e=>{let t=e.currentTarget;try{t.setPointerCapture(e.pointerId)}catch{}p.current={pointerId:e.pointerId,element:t},window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)},[g,_]);(0,J.useEffect)(()=>()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_);let e=p.current;if(e){try{e.element.releasePointerCapture(e.pointerId)}catch{}p.current=null}},[g,_]);let y=(0,J.useCallback)(t=>{let n=.04;t.key===`ArrowLeft`?(t.preventDefault(),u(Math.max(fi,e.splitRatio-n))):t.key===`ArrowRight`?(t.preventDefault(),u(Math.min(pi,e.splitRatio+n))):t.key===`Home`?(t.preventDefault(),u(fi)):t.key===`End`?(t.preventDefault(),u(pi)):t.key===`0`&&(t.preventDefault(),u(.5))},[u,e.splitRatio]),b=e=>{e.target===e.currentTarget&&c()},x=u=>{let d=u===e.originSide,f=u===`left`?t:n;return f?(0,X.jsx)(ti,{ticket:f,allLabels:i,allTickets:r,onClose:d?c:()=>l(null,u),onOpenTicket:s,onSave:a,onDelete:o,embedded:!0},`${u}-${f.id}`):(0,X.jsx)(di,{tickets:r,excludeIds:[t?.id,n?.id].filter(e=>e!=null),onSelect:e=>l(e,u)})},S=(e.splitRatio*100).toFixed(2),C=((1-e.splitRatio)*100).toFixed(2);return(0,or.createPortal)((0,X.jsxs)(`div`,{ref:f,"data-testid":`split-view-shell`,className:`fixed inset-0 z-[68] flex`,onClick:b,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/70 pointer-events-none`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`relative flex w-full h-full`,style:{transition:m?`opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:[(0,X.jsx)(`div`,{"data-testid":`split-panel-left`,className:`relative h-full overflow-hidden`,style:{width:`${S}%`,transition:m?`width 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:(0,X.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,X.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`left`)})})}),(0,X.jsx)(`div`,{"data-testid":`split-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":Math.round(e.splitRatio*100),"aria-valuemin":Math.round(fi*100),"aria-valuemax":Math.round(pi*100),tabIndex:0,onPointerDown:v,onKeyDown:y,className:`relative z-10 w-2 cursor-col-resize bg-border/40 hover:bg-accent-primary/40 transition-colors focus:outline-none focus:bg-accent-primary/60`}),(0,X.jsx)(`div`,{"data-testid":`split-panel-right`,className:`relative h-full overflow-hidden`,style:{width:`${C}%`,transition:m?`width 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:(0,X.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,X.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`right`)})})})]})]}),document.body)}var hi=.5,gi=.25,_i=.75,vi={leftId:null,rightId:null,originSide:null,splitRatio:hi};function yi(e){return Number.isFinite(e)?Math.min(_i,Math.max(gi,e)):hi}function bi(e,t){switch(t.type){case`openCentered`:return e.originSide!==null&&e.leftId!==t.id&&e.rightId!==t.id?{leftId:t.id,rightId:null,originSide:null,splitRatio:hi}:e.originSide!==null&&(e.leftId===t.id||e.rightId===t.id)?e:{...vi,leftId:t.id};case`closeAll`:return vi;case`enterSplit`:{let n=t.ticketId??e.leftId;return n===null||e.originSide!==null?e:t.side===`left`?{leftId:n,rightId:null,originSide:`left`,splitRatio:hi}:{leftId:null,rightId:n,originSide:`right`,splitRatio:hi}}case`setComparedTicket`:{if(e.originSide===null)return e;let n=e.originSide===`left`?`right`:`left`;return t.side===n?t.side===`left`?{...e,leftId:t.id}:{...e,rightId:t.id}:e}case`exitSplit`:{if(e.originSide===null)return e;let t=e.originSide===`left`?e.leftId:e.rightId;return{...vi,leftId:t}}case`setSplitRatio`:return{...e,splitRatio:yi(t.ratio)};default:return e}}var xi=(0,J.createContext)(null),Si=900;function Ci({children:e}){let[t,n]=(0,J.useReducer)(bi,vi),{tickets:r,updateTicket:i,deleteTicket:a}=ot(),{activeProjectId:o,setActiveProjectId:s}=y(),c=(0,J.useRef)(null);(0,J.useEffect)(()=>{n({type:`closeAll`});let e=c.current;e&&(c.current=null,e.projectId===o&&n({type:`openCentered`,id:e.ticketId}))},[o]);let l=(0,J.useCallback)(e=>n({type:`openCentered`,id:e}),[]),u=(0,J.useCallback)((e,t)=>{if(e===o){n({type:`openCentered`,id:t});return}c.current={projectId:e,ticketId:t},s(e)},[o,s]),d=(0,J.useCallback)(()=>n({type:`closeAll`}),[]),f=(0,J.useCallback)((e,t)=>{typeof window<`u`&&window.innerWidth<Si||n({type:`enterSplit`,side:e,ticketId:t})},[]),p=(0,J.useCallback)((e,t)=>n({type:`setComparedTicket`,id:e,side:t}),[]),m=(0,J.useCallback)(()=>n({type:`exitSplit`}),[]),h=(0,J.useCallback)(e=>n({type:`setSplitRatio`,ratio:e}),[]);(0,J.useEffect)(()=>{if(typeof window>`u`)return;function e(){window.innerWidth<Si&&n({type:`exitSplit`})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let g=(0,J.useMemo)(()=>{let e=new Set;for(let t of r)for(let n of t.labels??[])e.add(n);return Array.from(e).sort()},[r]),_=t.leftId==null?null:r.find(e=>e.id===t.leftId)??null,v=t.rightId==null?null:r.find(e=>e.id===t.rightId)??null,b=(0,J.useMemo)(()=>({openTicketDetail:l,openTicketDetailInProject:u,closeTicketDetail:d,enterSplit:f,setComparedTicket:p,exitSplit:m,setSplitRatio:h,state:t}),[l,u,d,f,p,m,h,t]),x=t.originSide!==null;return(0,X.jsxs)(xi.Provider,{value:b,children:[e,!x&&_&&(0,X.jsx)(ti,{ticket:_,allLabels:g,allTickets:r,onClose:d,onOpenTicket:l,onSave:i,onDelete:a},_.id),x&&(0,X.jsx)(mi,{state:t,leftTicket:_,rightTicket:v,allTickets:r,allLabels:g,onSave:i,onDelete:a,onOpenTicket:l,onCloseAll:d,onSetCompared:p,onSetRatio:h,onExitSplit:m})]})}function wi(){return(0,J.useContext)(xi)||{openTicketDetail:()=>{typeof console<`u`&&console.warn(`[TicketDetailModalContext] openTicketDetail called without provider`)},openTicketDetailInProject:()=>{typeof console<`u`&&console.warn(`[TicketDetailModalContext] openTicketDetailInProject called without provider`)},closeTicketDetail:()=>{},enterSplit:()=>{},setComparedTicket:()=>{},exitSplit:()=>{},setSplitRatio:()=>{},state:vi}}export{Te as $,Yt as A,He as B,Sn as C,rn as D,on as E,ot as F,Re as G,K as H,$e as I,Pe as J,Le as K,et as L,kt as M,Lt as N,Qt as O,Dt as P,we as Q,qe as R,On as S,sn as T,Be as U,Ve as V,ze as W,je as X,Me as Y,be as Z,En as _,Dr as a,Oe as at,An as b,_r as c,ve as ct,ir as d,G as dt,xe as et,Xn as f,jn as g,ln as h,qr as i,Ae as it,Nt as j,Zt as k,gr as l,he as lt,Nn as m,wi as n,Ee as nt,xr as o,ke as ot,Hn as p,Fe as q,ti as r,Ce as rt,Sr as s,ye as st,Ci as t,Se as tt,ur as u,ge as ut,Mn as v,kn as w,Dn as x,cn as y,Ge as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-CNC7AqOf.js";import{n}from"./jsx-runtime-zu2_FqZY.js";import{j as r}from"./useSharedWebSocket-BOdS5_Iz.js";import{a as i,d as a,f as o,i as s,l as c,p as l,s as u,u as d}from"./createLucideIcon-Bjbbp_KS.js";var f=t(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}})),p=e(n()),m=e(f()),h=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function g(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(m.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(h),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var _=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,v=/^\s*$/,y=Object.create(null);function b(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>`),t.voidElement?e:e+t.children.reduce(b,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var x={parse:function(e,t){t||={},t.components||=y;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(_,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=g(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=g(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),_=e.slice(f,h===-1?void 0:h);v.test(_)&&(_=` `),(h>-1&&a+l.length>=0||_!==` `)&&l.push({type:`text`,content:_})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+b(``,t)},``)}},S=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},C=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?T(t):t},w=e=>Array.isArray(e)&&e.every(p.isValidElement),T=e=>Array.isArray(e)?e:[e],E=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},D=e=>{let t={};if(!e)return t;let n=e=>{T(e).forEach(e=>{a(e)||(S(e)?n(C(e)):d(e)&&!(0,p.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},O=(e,t,n,r)=>{if(!e)return``;let i=``,s=T(e),c=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((e,s)=>{if(a(e)){i+=`${e}`;return}if((0,p.isValidElement)(e)){let{props:o,type:l}=e,u=Object.keys(o).length,d=c.indexOf(l)>-1,f=o.children;if(!f&&d&&!u){i+=`<${l}/>`;return}if(!f&&(!d||u)||o.i18nIsDynamicList){i+=`<${s}></${s}>`;return}if(d&&u<=1){let e=a(f)?f:O(f,t,n,r);i+=`<${l}>${e}</${l}>`;return}let p=O(f,t,n,r);i+=`<${s}>${p}</${s}>`;return}if(e===null){o(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(d(e)){let{format:t,...a}=e,s=Object.keys(a);if(s.length===1){let e=t?`${s[0]}, ${t}`:s[0];i+=`{{${e}}}`;return}o(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}o(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},k=(e,t=[],n={})=>{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`<`,o+=1)}else a+=e[o],o+=1;return a},A=(e,t,n,r,i,o,s)=>{if(n===``)return[];let l=i.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(l.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!f&&!s)return[n];let m=t??{},h=e=>{T(e).forEach(e=>{a(e)||(S(e)?h(C(e)):d(e)&&!(0,p.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=k(n,l,m),_=x.parse(`<0>${g}</0>`),v={...m,...o},y=(e,t,n)=>{let r=C(e),i=D(r,t.children,n);return w(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,p.cloneElement)(e,{key:r},i?void 0:t))):n.push(...p.Children.map([e],e=>{if(e.type===p.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,p.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,p.cloneElement)(e,n,i?null:t)}))},D=(e,n,o)=>{let m=T(e),h=T(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&r.services.interpolator.interpolate(n.children[0].content,v,r.language);if(n.type===`tag`){let u=m[parseInt(n.name,10)];!u&&t&&(u=t[n.name]),o.length===1&&!u&&(u=o[0][n.name]),u||={};let x={...n.attrs};s&&Object.keys(x).forEach(e=>{let t=x[e];a(t)&&(x[e]=c(t))});let w=Object.keys(x).length===0?u:E({props:x},u),O=(0,p.isValidElement)(w),k=O&&S(n,!0)&&!n.voidElement,A=f&&d(w)&&w.dummy&&!O,j=d(t)&&Object.hasOwnProperty.call(t,n.name);if(a(w)){let t=r.services.interpolator.interpolate(w,v,r.language);e.push(t)}else if(S(w)||k){let t=y(w,n,o);b(w,t,e,h)}else if(A){let t=D(m,n.children,o);b(w,t,e,h)}else if(Number.isNaN(parseFloat(n.name)))if(j){let t=y(w,n,o);b(w,t,e,h,n.voidElement)}else if(i.transSupportBasicHtmlNodes&&l.indexOf(n.name)>-1)if(n.voidElement)e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,p.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=r?T(C(r)):m,s=D(a,n.children,o);e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=D(m,n.children,o);e.push(`<${n.name}>${t}</${n.name}>`)}else if(d(w)&&!O){let t=n.children[0]?_:null;t&&e.push(t)}else b(w,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=i.transWrapTextNodes,a=typeof i.unescape==`function`?i.unescape:u().unescape,o=s?a(r.services.interpolator.interpolate(n.content,v,r.language)):r.services.interpolator.interpolate(n.content,v,r.language);t?e.push((0,p.createElement)(t,{key:`${n.name}-${h}`},o)):e.push(o)}return e},[])};return C(D([{dummy:!0,children:e||[]}],_,T(e||[]))[0])},j=(e,t,n)=>{let r=e.key||t,i=(0,p.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,p.createElement)(p.Fragment,null,i)}return(0,p.createElement)(a,{key:r})},M=(e,t)=>e.map((e,n)=>j(e,n,t)),N=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:j(e[r],r,t)})}),n},P=(e,t,n,r)=>e?Array.isArray(e)?M(e,t):d(e)?N(e,t):(l(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,F=e=>!d(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function I({children:e,count:t,parent:n,i18nKey:o,context:s,tOptions:c={},values:d,defaults:f,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||i();if(!b)return l(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:o}),e;let x=_||b.t.bind(b)||(e=>e),S={...u(),...b.options?.react},C=h||x.ns||b.options?.defaultNS;C=a(C)?[C]:C||[`translation`];let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...c}:c,E=v??w?.shouldUnescape,k=w?.values?{...w.values,...d}:d,j=w?.components?{...w.components,...m}:m,M=O(e,S,b,o),N=f||T?.defaultValue||M||S.transEmptyNodeValue||(typeof o==`function`?r(o):o),{hashTransKey:I}=S,L=o||(I?I(M||N):M||N);d=b.options?.interpolation?.defaultVariables?k&&Object.keys(k).length>0?{...k,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:k;let R=D(e);R&&typeof R.count==`number`&&t===void 0&&(t=R.count);let z=d||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:s||T.context,count:t,...d,...z,defaultValue:N,ns:C},V=L?x(L,B):N;V===L&&N&&(V=N);let H=P(j,V,b,o),U=H||e,W=null;F(H)&&(W=H,U=e);let G=A(U,W,V,b,S,B,E),K=n??S.defaultTransParent;return K?(0,p.createElement)(K,y,G):G}function L({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:o={},values:c,defaults:l,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,p.useContext)(s)||{},y=f||_||i(),b=m||y?.t.bind(y);return I({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:o,values:c,defaults:l,components:u,ns:d||b?.ns||v||y?.options?.defaultNS,i18n:y,t:m,shouldUnescape:h,...g})}export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`Controle de missões`,t=`Opere o Specrails conversando`,n=`Controle de missões`,r=`Peça ao agente o que quiser…`,i=`Enviar`,a=`Parar`,o=`Copiar`,s={openPreview:`Pré-visualizar {{name}}`,openDownload:`Transferir {{name}}`,previewTitle:`Pré-visualização de {{name}}`,downloadTitle:`Transferir ficheiro?`,downloadPrompt:`Este ficheiro não pode ser pré-visualizado aqui. Queres transferi-lo?`,download:`Transferir`,cancelDownload:`Agora não`,loading:`A preparar ficheiro…`,loadFailed:`Não foi possível carregar o anexo`,loadError:`Não foi possível carregar o anexo: {{error}}`},c=`Maximizar`,l=`Restaurar`,u=`Minimizar`,d=`Fechar`,f=`Nova missão`,p=`Qual é a missão?`,m=`Escolha um projeto e depois pergunte. O quadro é atualizado ao vivo enquanto o agente trabalha.`,h=`Pensando…`,g=`Conectando…`,_=`Consultando o app…`,v={compact:`Compacto`,comfortable:`Confortável`,max:`Maximizar`},y={label:`Modelo`,loading:`Carregando modelos…`,unavailable:`Modelos indisponíveis`},b={hint:`Explorando histórico — escreva para editar, ↑↓ para navegar`},x={queued:`Na fila`,send:`Enviar mensagem`,sendHint:`Enfileirar para o próximo turno. Escolha «Orientar» em uma mensagem na fila para enviá-la sem interromper o modelo.`,placeholder:`Adicionar uma mensagem à fila…`,delivered:`Entregue ao agente`,interrupted:`Entrega não confirmada`,cancelled:`Cancelada antes da entrega`,steer:`Orientar`,steerHint:`Enviar sem interromper o modelo`,steering:`Enviando ao agente…`,remove:`Excluir mensagem da fila`,more:`Opções da mensagem`,edit:`Editar`,actionConflict:`Esta mensagem já está sendo entregue ou não está mais na fila.`,actionFailed:`Não foi possível atualizar a mensagem na fila. Tente novamente.`},S={sent:`Enviado ao agente`,received:`Entregue ao agente`,read:`Lido pelo agente`,interrupted:`Entrega não confirmada`,cancelled:`Cancelado antes da entrega`},C={editing:`Editando mensagem pendente {{n}} de {{m}}`,hint:`↑↓ para navegar · Enter salva · Esc cancela`,save:`Salvar mensagem pendente`,cancel:`Cancelar edição`,dispatched:`Essa mensagem já foi entregue; seu texto foi mantido como rascunho`,saveFailed:`Não foi possível salvar a mensagem pendente`},w={branch:`Branch`,detached:`(detached)`,dirty:`Alterações sem commit`,switched:`Mudou para {{branch}}`,switchFailed:`Não foi possível trocar de branch`,lockedWhileWorking:`Branch bloqueada enquanto o agente trabalha`,searchPlaceholder:`Buscar branches…`,noMatches:`Nenhuma branch corresponde`,worktrees:`Worktrees`,worktreePathCopied:`Caminho do worktree copiado`,copyWorktreePath:`Copiar caminho do worktree`,repository:`Repositório`,repositoryUnavailable:`Repositório indisponível`,loadFailed:`Estado do Git indisponível`,notGit:`Pasta de contexto · sem Git`,retry:`Tentar novamente`},T={label:`Provedor`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},E={cycleHint:`⇧⇥ para mudar`,observe:{name:`Observa`,desc:`Somente leitura — nada muda`},edit:{name:`Edita`,desc:`Criar e editar (reversível)`},operate:{name:`Opera`,desc:`Lançar IA — tem custo`},autonomous:{name:`Autônomo`,desc:`Excluir e encerrar — irreversível`},lockedTitle:`Precisa de um nível superior`,lockedBody:`Essa ação precisa do nível "{{level}}". Você está no "{{current}}".`,raiseHint:`⇧⇥ para aumentar o nível, ou peça de outra forma.`},D={title:`Confirmar ação`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`Aprovar`,cancel:`Cancelar`,dontAskAgain:`Não perguntar de novo nesta sessão`,approved:`Aprovado`,cancelled:`Cancelado`},O={home:`Início`,searchPlaceholder:`Fale com o Specrails…`,searchProjectsPlaceholder:`Buscar projetos…`,recents:`Recentes`,allProjects:`Todos os projetos`,searchAll:`Buscar em todos os projetos`,addProject:`Adicionar projeto…`,homeHint:`Nenhum projeto selecionado — operando em todos os projetos.`,askCreateOrSearch:`Nenhum projeto está selecionado. Você quer criar um novo projeto ou buscar em todos os projetos?`},k={remove:`Remover {{label}}`,addContextAction:`Adicionar contexto ou ação`,filtering:`Filtrando "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`Sem resultados`,noMatchesFor:`Sem resultados para "{{query}}"`,mode:{reference:{title:`Referência`,hint:`@ projetos, specs, missões`},trace:{title:`Traço`,hint:`# jobs, execuções, IDs`},action:{title:`Ação`,hint:`/ comandos para este contexto`}},plus:{reference:`Referência`,referenceHint:`Projetos, specs, missões`,trace:`Traço`,traceHint:`Jobs, execuções, IDs`,action:`Ação`,actionHint:`Criar, lançar, inspecionar`,fileAttachment:`Anexo de arquivo`,fileAttachmentHint:`Adicionar docs, imagens, logs`,browserCapture:`Captura do navegador`,browserCaptureHint:`Capturar uma área da página para esta missão`}},A={label:`Trocar de missão`,untitled:`Nova missão`,new:`Nova missão`,searchPlaceholder:`Pesquisar missões…`,noMatches:`Nenhuma missão corresponde`,working:`O agente está trabalhando`,queuedBadge:`{{n}} na fila`,delete:`Excluir missão "{{title}}"`,deleteConfirm:`Excluir?`,deleteLiveConfirm:`O agente está trabalhando — excluir mesmo assim?`,confirmDelete:`Confirmar exclusão`,cancelDelete:`Manter missão`,deleteFailed:`Não foi possível excluir a missão`},j={title:`Nenhum provedor de IA instalado`,body:`O agente precisa de Claude, Codex, Gemini ou Kimi na sua máquina. Instale um e reabra o agente para começar a conversar.`,placeholder:`Instale um provedor de IA para usar o agente…`},M={title:`O MCP do Specrails está desligado`,body:`O agente precisa do servidor MCP integrado para operar o app.`,enable:`Ativar o MCP do Specrails`,enabling:`Ativando…`,enabled:`MCP ativado`},N={live:`ao vivo`,queued:`na fila`,running:`em execução`,done:`concluído`,failed:`falhou`},P={generic:`Algo deu errado. Tente novamente.`,busy:`O agente está ocupado. Tente novamente em um instante.`},F={kindAgent:`Missão do agente`},I=`Nova missão`,L=`Mudar para o Controle de missões`,R=`Mudar para o quadro`,z=`Buscar`,B=`Início`,V=`Missões favoritas`,H=`Sem título`,U={title:`No workspace`,terminal:`Terminal`,files:`Arquivos`,browser:`Navegador`,requiresProject:`Selecione um projeto para usar esta ferramenta`,resizeCode:`Redimensionar painel de código`,closeFiles:`Fechar código`,browserConfirm:`Adicionar ao agente`,browserSelectStart:`Selecionar para adicionar à missão`,browserCaptured:`Captura adicionada`,uploadFailed:`Falha no upload`,requiresConversation:`Inicie uma missão para usar esta ferramenta`,jobs:`Jobs`,closeJobs:`Fechar jobs`,resizeJobs:`Redimensionar painel de jobs`,noJobs:`Ainda não há jobs — peça ao agente para lançar um`,analytics:`Analítica`,closeAnalytics:`Fechar analítica`,resizeAnalytics:`Redimensionar painel de analítica`},W=`Anexar arquivo`,G=`Excluir "{{title}}"`,K=`Confirmar exclusão de "{{title}}"`,q=`Adicionar "{{title}}" aos favoritos`,J=`Remover "{{title}}" dos favoritos`,Y=`confirmar?`,X=`Este provedor ainda não lê imagens — anexe arquivos de texto`,Z={label:`Esforço`,minimal:`Mínimo`,low:`Baixo`,medium:`Médio`,high:`Alto`,xhigh:`Extra alto`,max:`Máximo`,ultra:`Ultra`},Q=JSON.parse(`{"operation":{"inProgress":"Ação em andamento…","create-pr":"Criando PR…","publish":"Publicando…","discard":"Descartando…","dismiss":"Encerrando acompanhamento…","poll-merge":"Verificando merge…","reopen":"Reabrindo…","merge-local":"Integrando localmente…","recover-and-retry":"A criar o commit e a tentar novamente o push do resultado preservado…","acknowledge-no-changes":"Marcando como concluído…"},"markDone":"Marcar como concluídas","refine":"Refinar","completedNote":"Confirmado — as specs foram movidas para Concluído","partialSummary":"{{succeeded}} de {{total}} concluídas; {{failed}} falharam","unit":{"failed":"implementação falhou","blocked":"entrega bloqueada","noChanges":"sem alterações","succeeded":"pronta"},"rail":"Rail {{index}}","specCount_one":"{{count}} spec","specCount_other":"{{count}} specs","base":"Ramo base","openPr":"Abrir PR","existingPr":"PR existente","title":{"no_changes":"Nenhuma alteração necessária","partial":"Implementação parcial","delivery_blocked":"Implementação concluída — a entrega requer atenção","update_failed":"Implementação concluída — falha na atualização","pr_closed":"PR fechada sem merge","superseded":"Substituída por uma execução mais recente","existing_pr_updated":"PR existente atualizada","building":"A implementar num worktree isolado…","buildingExistingPr":"A aplicar alterações numa PR existente…","paused":"Precisa de decisão humana","on_review":"Implementação pronta para revisão","pr_draft":"PR em rascunho criada","pr_draft_degraded":"Entrega da PR incompleta","pr_ready":"PR pronta para merge","implementation_failed":"Implementação falhou","pr_failed":"Falha ao criar a PR","merged":"Merge da PR concluído","discarded":"Descartada"},"buildingHint":"Quando terminar, ser-lhe-á perguntado se quer criar a PR.","buildingExistingPrHint":"O Specrails está a trabalhar no ramo da PR existente e irá enviar as alterações de revisão para essa mesma PR.","paused":"Implementação em pausa","pausedForRun":"Em pausa em {{ref}}","resume":"Retomar","stopExecution":"Parar execução","stopExecutionSent":"Sinal de paragem enviado","stopExecutionFailed":"Não foi possível parar a execução","createPr":"Criar PR","publish":"Publicar","checkout":"Mudar para o branch","openReview":"Revisar","openReviewTooltip":"Abrir a revisão em linguagem clara","checkoutTooltip":"Fazer checkout de {{branch}} na pasta principal do projeto","checkoutSuccess":"Checkout feito em {{branch}}","checkoutFailed":"Não foi possível fazer checkout da branch de implementação","checkoutDirtyTitle":"Checkout bloqueado para proteger as suas alterações","checkoutDirtyBody":"A pasta principal do projeto contém alterações sem commit. Faça commit ou stash e tente novamente. Não foi feita qualquer alteração.","checkoutSafetyUnknownTitle":"Checkout em pausa porque não foi possível verificar a segurança","checkoutSafetyUnknownBody":"O Specrails não conseguiu ler o estado do Git na pasta principal do projeto. Nada foi libertado ou alterado. Tente novamente quando o Git estiver disponível.","checkoutNotDeliverableTitle":"Esta branch não contém a implementação preservada","checkoutNotDeliverableBody":"O commit exato da entrega ainda não foi verificado. Em alternativa, inspecione ou recupere o resultado local.","inspectLocalResult":"Inspecionar resultado local","inspectLocalResultTooltip":"Mostrar o worktree isolado preservado e copiar o respetivo caminho","localResultPathCopied":"Caminho do resultado local copiado","localResultPath":"Resultado local preservado","localResultUnavailableHere":"Não existe nenhum worktree recuperável neste computador. Consulte o log da execução no computador onde foi iniciada.","recoverAndRetry":"Fazer commit e tentar push novamente","recoverAndRetryVerified":"O commit recuperado {{sha}} está verificado na PR","recoveryStillBlocked":"A recuperação local ainda requer atenção","recheckRecovery":"Verificar novamente","recoveryUnavailable":"Não foi possível verificar a recuperação neste computador","recoveryUnavailableBody":"O Specrails não conseguiu comprovar com segurança um único resultado pertencente à entrega neste clone. Nada foi alterado ou removido. Consulte os detalhes da etapa e os registos de execução. Se o run foi executado noutro computador, abra o Specrails nele e verifique novamente.","recoveryDetailSummary":"Detalhe técnico da recuperação","retry":"Tentar novamente","retryPr":"Tentar PR novamente","checkMerge":"Verificar merge","verifyPr":"Verificar PR","discard":"Descartar","confirmDiscard":"Confirmar descarte?","mergedNote":"Merge concluído — specs movidas para Concluído","discardedNote":"Descartada — specs devolvidas ao backlog","implementationFailedNote":"A execução de implementação falhou antes de produzir algo entregável. Abra o log da execução para inspecionar a falha e descarte este cartão antes de relançar.","dismiss":"Encerrar acompanhamento","discardLocalResult":"Descartar resultado local","retryPush":"Tentar push novamente","retryPushVerified":"Push verificado · o commit {{sha}} está na PR","commitAlreadyVerified":"O commit {{sha}} já está verificado na PR","deliveryCommit":"commit {{sha}}","reopen":"Reabrir","createPartialPr":"Criar PR com {{count}}","supersededNote":"Uma execução de implementação mais recente substituiu este cartão.","noChangesExisting":"Nenhuma nova alteração foi necessária; a PR existente permanece inalterada.","noChangesNote":"Nenhuma alteração de código foi necessária. Marque as specs como concluídas ou devolva-as ao backlog para refinamento.","deliveryNeedsAttention":"Implementação concluída; a entrega requer atenção","deliveryBlockedNote":"A implementação foi concluída com sucesso, mas a entrega está bloqueada. Revise os detalhes da etapa e os logs antes de descartar o resultado local.","partialDeliveryBlockedNote":"Parte da implementação foi concluída com sucesso, mas ainda não há nada que possa ser entregue com segurança. Reveja as evidências por unidade e os logs antes de escolher a próxima ação.","retryPushNote":"A implementação foi concluída com sucesso e as alterações estão seguras localmente. Tente novamente apenas o push.","cleanupIncomplete_one":"Limpeza incompleta ({{count}} aviso)","cleanupIncomplete_other":"Limpeza incompleta ({{count}} avisos)","safetyArchiveTitle":"Arquivo de segurança ({{count}})","safetyArchiveHint":"Os ficheiros temporários do espaço de trabalho foram preservados fora da PR por precaução. Pode inspecioná-los ou removê-los manualmente.","confirm":{"recoverAndRetryTitle":"Fazer commit e enviar o resultado preservado?","recoverAndRetryBody":"O Specrails utilizará apenas o worktree isolado ou o ramo registado compatível com avanço rápido para {{branch}}. Se necessário, criará um commit com os ficheiros entregáveis e enviará esse commit exato apenas se a PR continuar aberta nos ramos de origem e destino esperados. A pasta principal do projeto e as respetivas alterações sem commit não serão afetadas.","recheckRecoveryTitle":"Verificar este computador novamente?","recheckRecoveryBody":"O Specrails examinará novamente neste clone o worktree, a branch, as refs, os reflogs e os objetos Git órfãos pertencentes à entrega de {{branch}}. Se comprovar um único resultado, poderá fazer commit das alterações isoladas e repetir o push exato. A pasta principal do projeto não será alterada.","noChangesDoneTitle":"Marcar estas specs como concluídas?","noChangesDoneBody":"A implementação confirmou que nenhuma alteração de código é necessária. As specs serão movidas para Concluído e o worktree sem alterações será limpo.","refineTitle":"Refinar estas specs?","refineBody":"O resultado sem alterações será fechado e as specs voltarão ao backlog para refinamento. Os logs de execução permanecerão disponíveis.","mergeLocalTitle":"Integrar localmente?","mergeLocalBody":"As branches entregues serão integradas em {{base}} localmente. As alterações existentes são preservadas; alterações sobrepostas podem precisar de resolução antes da integração.","freshDiscardTitle":"Descartar esta entrega?","freshDiscardBody":"A PR será fechada sem excluir o branch remoto. Apenas branches locais e worktrees pertencentes ao SpecRails que ainda estejam no commit registrado serão removidos; qualquer item alterado será preservado com um aviso. As specs voltarão ao backlog. Os recursos locais removidos não podem ser recuperados.","implementationFailedDiscardTitle":"Descartar esta entrega com falha?","implementationFailedDiscardBody":"O cartão será fechado e as specs voltarão ao backlog. O trabalho local e os branches serão preservados para inspeção. Apenas recursos comprovadamente seguros para limpeza poderão ser removidos.","dismissTitle":"Encerrar este acompanhamento?","dismissBody":"Este cartão de acompanhamento será encerrado. Seu worktree só será removido se isso ainda for seguro; caso contrário, será preservado com um aviso. A PR existente, seu branch e o estado da revisão permanecerão inalterados.","discardLocalTitle":"Descartar o resultado local?","discardLocalBody":"A iteração local recuperável só será removida se isso ainda for seguro; se tiver sido alterada, será preservada com um aviso. Qualquer PR existente e seu branch permanecerão inalterados. Um resultado removido não pode ser recuperado."},"degraded":{"pushed":"O ramo foi enviado mas não foi possível criar a PR — tente novamente para concluir.","localOnly":"As alterações foram montadas localmente mas não enviadas — tente novamente para publicar a PR."},"alreadyResolved":"Já resolvida noutro lugar","actionFailed":"A ação falhou","notMergedYet":"Ainda sem merge","commitMissingRetry":"O commit da entrega não está mais na PR. Você pode tentar o push novamente.","prVerifiedWaiting":"Commit {{sha}} verificado · aguardando merge","viewLog":"Ver o registro de execução de {{ref}}","runElapsedAria":"{{elapsed}} decorridos","runCostAria":"{{cost}} gastos","pinned":{"label":"Fixada","marker":"Cartão de implementação — fixado acima","collapse":"Minimizar cartão fixado","expand":"Expandir cartão fixado","expandCard":"Expandir este cartão","collapseCard":"Minimizar este cartão","collapsed_one":"Cartão de implementação","collapsed_other":"{{count}} cartões de implementação","state":{"completed":"Concluída","no_changes":"Sem alterações","pr_closed":"Fechada","superseded":"Substituída","building":"Em curso","on_review":"Revisão","pr_draft":"PR rascunho","pr_ready":"Publicada","implementation_failed":"Falhou","pr_failed":"Falhou","merged":"Integrada","discarded":"Descartada"}},"mergeLocal":"Integrar localmente","mergeLocalTooltip":"Faz merge dos branches entregues em {{base}} no seu checkout local (sem GitHub)","mergeLocalBlockedDirty":"Não é possível integrar: as alterações locais em {{base}} sobrepõem-se à entrega. Faça commit ou stash dessas alterações e tente novamente.","mergeLocalBlockedBranch":"Não é possível integrar: seu checkout está em {{current}}, não em {{base}}. Mude para {{base}} e tente de novo.","mergedLocally":"Integrado em {{base}} localmente","discardStackedNote":"Os rails seguintes deste marco foram construídos sobre esta entrega. Descartá-la pausa a cadeia do marco; os rails seguintes mantêm o seu trabalho."}`),$={heading:`Rascunho da spec`,drafting:`Atualizando rascunho…`,acceptanceCriteria:`Critérios de aceitação`,untitled:`Spec sem título`,expand:`Ver descrição completa`,collapse:`Recolher descrição`},ee={heading:`Enquadramento`,framing:`A enquadrar o pedido…`,restated:`O que entendi`,alternative:`Também poderia significar`,pick:`Responder com isto`,touches:`Tocaria em`,discriminator:`Qual das duas?`,assumptions:`O que estou a assumir`,unknowns:`Ainda em aberto`},te={openTicket:`Abrir spec #{{id}}`,openPullRequest:`Abrir PR #{{id}}`,openJob:`Abrir job {{id}}`,openLoop:`Abrir loop {{id}}`,ticketNotFound:`Spec #{{id}} não encontrada — pode ter sido excluída`,pullRequestUrlMissing:`A PR #{{id}} foi mencionada sem URL`,pullRequestNotFound:`A PR #{{id}} não foi encontrada neste projeto`,jobNotFound:`Job não encontrado — pode ter sido excluído`,loopNotFound:`Loop não encontrado — pode ter sido excluído`,lookupFailed:`Não foi possível verificar a referência — tente novamente`},ne={untitled:`Missão sem título`,menu:`Menu da missão`,rename:`Renomear`,renamePlaceholder:`Nome da missão`,renameHint:`Duplo clique para renomear`,renameFailed:`Não foi possível renomear`,addFavorite:`Adicionar aos favoritos`,removeFavorite:`Remover dos favoritos`,copyName:`Copiar nome da missão`,copyId:`Copiar ID da missão`,copyProject:`Copiar nome do projeto`,copyProjectPath:`Copiar caminho do projeto`,copyFailed:`Não foi possível copiar`,copyTranscript:`Copiar transcrição`,copyTranscriptSuccess:`Transcrição copiada`,copyTranscriptFailed:`Não foi possível copiar a transcrição`,exportTranscript:`Exportar transcrição (.txt)`,exportTranscriptSuccess:`Exportação da transcrição iniciada`,exportTranscriptFailed:`Não foi possível exportar a transcrição`,delete:`Excluir missão`,deleteConfirm:`Excluir esta missão? Não pode ser desfeito.`,deleteFailed:`Não foi possível excluir a missão`},re=`O que devemos construir agora?`,ie={title:`Log de execução`,live:`Ao vivo`,empty:`Ainda não há atividade de ferramentas neste turno.`,output:`Saída`,error:`Erro`,copyAll:`Copiar log completo`,copyEntry:`Copiar entrada`,copySuccess:`Log copiado para a área de transferência`,copyFailed:`Não foi possível copiar o log`,openLog:`Ver log de execução`,close:`Fechar`},ae={open:`Ver logs de {{command}}`,logsTitle:`Logs do processo`,logsDescription:`Saída ao vivo e histórico salvo deste processo.`,close:`Fechar logs`,command:`Comando`,directory:`Diretório`,exitCode:`Código de saída: {{code}}`,signal:`Sinal: {{signal}}`,search:`Pesquisar nos logs…`,source:`Origem da saída`,allSources:`Toda a saída`,pause:`Pausar`,resume:`Retomar`,follow:`Seguir`,copy:`Copiar logs visíveis`,download:`Descarregar logs visíveis`,stop:`Parar processo`,stopCommand:`Parar {{command}}`,stopFailed:`Não foi possível parar o processo. Tente novamente.`,truncated:`É apresentada uma janela limitada de logs. Saída anterior ou linhas longas podem ser omitidas. Copiar e descarregar incluem apenas esta vista.`,paused:`Vista em pausa. O processo continua a funcionar.`,loadFailed:`Não foi possível carregar os logs. A retenção pode ter expirado; a saída já carregada continua visível.`,retry:`Tentar novamente`,copied:`Logs visíveis copiados.`,exportFailed:`Não foi possível exportar os logs. Tente novamente.`,output:`Saída do processo`,loading:`A carregar logs…`,noMatches:`Nenhuma saída correspondente.`,empty:`Ainda não há saída.`,lineCount:`{{count}} de {{total}} linhas`,exportHint:`A exportação inclui apenas o filtro atual e a saída retida.`,status:{starting:`A iniciar`,running:`Em execução`,stopping:`A parar`,exited:`Terminado`,killed:`Parado`,failed:`Falhou`,interrupted:`Desconectado`},repository:`Repositório`,history:{button:`Processos`,title:`Processos da missão`,open:`Ver histórico de processos`,description:`Consulte processos ativos e logs salvos de execuções anteriores.`,search:`Buscar comando ou repositório…`,refresh:`Atualizar histórico`,close:`Fechar histórico de processos`,back:`Voltar aos processos`,loading:`Carregando histórico de processos…`,empty:`Ainda não há processos registrados nesta missão.`,noMatches:`Nenhum processo correspondente.`,loadFailed:`Não foi possível carregar o histórico. As entradas já carregadas continuam disponíveis.`,showMore:`Mostrar mais`,count:`Processos: {{count}}`},interruptedHint:`O Specrails deixou de monitorar este processo. Seu estado no sistema operacional é desconhecido; os logs salvos continuam disponíveis.`,persistenceFailed:`Não foi possível salvar o histórico do processo. A saída disponível continua visível.`},oe={detach:`Abrir numa janela separada`,attach:`Voltar à janela principal`,detached:`Esta missão está aberta noutra janela.`,focus:`Mostrar janela da missão`,loading:`A mover a missão…`,failed:`Não foi possível mover esta missão. O rascunho foi preservado.`,dismiss:`Fechar aviso`,wrongMission:`Abre esta missão antes de a mover.`,finishPending:`Conclui a operação em curso ou guarda ou cancela a mensagem ou a captura antes de mover a missão.`},se={title:e,subtitle:t,trigger:n,composerPlaceholder:r,send:i,stop:a,copy:o,attachment:s,maximize:c,restore:l,minimize:u,close:d,newConversation:f,emptyTitle:p,emptyHint:m,thinking:h,connecting:g,consultingCode:_,size:v,model:y,history:b,queue:x,receipt:S,queueEdit:C,git:w,provider:T,tier:E,approval:D,project:O,palette:k,mission:A,noProvider:j,degraded:M,toolCard:N,error:P,chip:F,newAgent:I,switchToAgent:L,switchToKanban:R,search:z,home:B,favoriteMissions:V,untitled:H,workspace:U,attachFile:W,deleteConversation:G,confirmDeleteConversation:K,addFavoriteConversation:q,removeFavoriteConversation:J,confirmShort:Y,imagesUnsupported:X,effort:Z,prCard:Q,specDraft:$,problemFrame:ee,refs:te,header:ne,emptyTitleCodeRain:re,activity:ie,backgroundProcess:ae,window:oe};export{ie as activity,q as addFavoriteConversation,D as approval,W as attachFile,s as attachment,ae as backgroundProcess,F as chip,d as close,r as composerPlaceholder,K as confirmDeleteConversation,Y as confirmShort,g as connecting,_ as consultingCode,o as copy,se as default,M as degraded,G as deleteConversation,Z as effort,m as emptyHint,p as emptyTitle,re as emptyTitleCodeRain,P as error,V as favoriteMissions,w as git,ne as header,b as history,B as home,X as imagesUnsupported,c as maximize,u as minimize,A as mission,y as model,I as newAgent,f as newConversation,j as noProvider,k as palette,Q as prCard,ee as problemFrame,O as project,T as provider,x as queue,C as queueEdit,S as receipt,te as refs,J as removeFavoriteConversation,l as restore,z as search,i as send,v as size,$ as specDraft,a as stop,t as subtitle,L as switchToAgent,R as switchToKanban,h as thinking,E as tier,e as title,N as toolCard,n as trigger,H as untitled,oe as window,U as workspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as ee}from"./rolldown-runtime-CNC7AqOf.js";var te=ee({activity:()=>oe,addFavoriteConversation:()=>K,approval:()=>ne,attachFile:()=>U,attachment:()=>s,backgroundProcess:()=>se,chip:()=>P,close:()=>d,composerPlaceholder:()=>r,confirmDeleteConversation:()=>G,confirmShort:()=>J,connecting:()=>g,consultingCode:()=>_,copy:()=>o,default:()=>le,degraded:()=>j,deleteConversation:()=>W,effort:()=>X,emptyHint:()=>m,emptyTitle:()=>p,emptyTitleCodeRain:()=>ae,error:()=>N,favoriteMissions:()=>B,git:()=>w,header:()=>ie,history:()=>b,home:()=>z,imagesUnsupported:()=>Y,maximize:()=>c,minimize:()=>u,mission:()=>k,model:()=>y,newAgent:()=>F,newConversation:()=>f,noProvider:()=>A,palette:()=>O,prCard:()=>Z,problemFrame:()=>$,project:()=>D,provider:()=>T,queue:()=>x,queueEdit:()=>C,receipt:()=>S,refs:()=>re,removeFavoriteConversation:()=>q,restore:()=>l,search:()=>R,send:()=>i,size:()=>v,specDraft:()=>Q,stop:()=>a,subtitle:()=>t,switchToAgent:()=>I,switchToKanban:()=>L,thinking:()=>h,tier:()=>E,title:()=>e,toolCard:()=>M,trigger:()=>n,untitled:()=>V,window:()=>ce,workspace:()=>H}),e=`Mission Control`,t=`Operate Specrails by chatting`,n=`Mission Control`,r=`Ask the agent to do anything…`,i=`Send`,a=`Stop`,o=`Copy`,s={openPreview:`Preview {{name}}`,openDownload:`Download {{name}}`,previewTitle:`Preview {{name}}`,downloadTitle:`Download file?`,downloadPrompt:`This file cannot be previewed here. Do you want to download it?`,download:`Download`,cancelDownload:`Not now`,loading:`Preparing file…`,loadFailed:`Could not load attachment`,loadError:`Could not load attachment: {{error}}`},c=`Maximize`,l=`Restore`,u=`Minimize`,d=`Close`,f=`New mission`,p=`What's the mission?`,m=`Pick a project, then ask. The board updates live as the agent works.`,h=`Thinking…`,g=`Connecting…`,_=`Consulting the app…`,v={compact:`Compact`,comfortable:`Comfortable`,max:`Maximize`},y={label:`Model`,loading:`Loading models…`,unavailable:`Models unavailable`},b={hint:`Browsing prompt history — type to edit, ↑↓ to navigate`},x={queued:`Queued`,send:`Send message`,sendHint:`Queue for the next turn. Choose Steer on a queued message to submit it without interrupting the model.`,placeholder:`Add a message to the queue…`,delivered:`Delivered to agent`,interrupted:`Delivery unconfirmed`,cancelled:`Cancelled before delivery`,steer:`Steer`,steerHint:`Submit without interrupting the model`,steering:`Sending to agent…`,remove:`Delete queued message`,more:`Message options`,edit:`Edit`,actionConflict:`This message is already being delivered or is no longer queued.`,actionFailed:`Could not update the queued message. Try again.`},S={sent:`Sent to agent`,received:`Delivered to agent`,read:`Read by agent`,interrupted:`Delivery unconfirmed`,cancelled:`Cancelled before delivery`},C={editing:`Editing pending message {{n}} of {{m}}`,hint:`↑↓ to navigate · Enter saves · Esc cancels`,save:`Save pending message`,cancel:`Cancel editing`,dispatched:`That message was already delivered — your text is kept as a draft`,saveFailed:`Couldn’t save the pending message`},w={branch:`Branch`,detached:`(detached)`,dirty:`Uncommitted changes`,switched:`Switched to {{branch}}`,switchFailed:`Couldn't switch branch`,lockedWhileWorking:`Branch locked while the agent works`,searchPlaceholder:`Search branches…`,noMatches:`No branches match`,worktrees:`Worktrees`,worktreePathCopied:`Worktree path copied`,copyWorktreePath:`Copy worktree path`,repository:`Repository`,repositoryUnavailable:`Repository unavailable`,loadFailed:`Git state unavailable`,notGit:`Context folder · no Git`,retry:`Retry`},T={label:`Provider`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},E={cycleHint:`⇧⇥ to change`,observe:{name:`Observe`,desc:`Read only — nothing changes`},edit:{name:`Edit`,desc:`Create and edit (reversible)`},operate:{name:`Operate`,desc:`Launch AI — costs money`},autonomous:{name:`Autonomous`,desc:`Delete and kill — irreversible`},lockedTitle:`Needs a higher level`,lockedBody:`That action needs the "{{level}}" level. You're on "{{current}}".`,raiseHint:`⇧⇥ to raise the level, or ask another way.`},ne={title:`Confirm action`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`Approve`,cancel:`Cancel`,dontAskAgain:`Don't ask again this session`,approved:`Approved`,cancelled:`Cancelled`},D={home:`Home`,searchPlaceholder:`Talk to Specrails…`,searchProjectsPlaceholder:`Search projects…`,recents:`Recents`,allProjects:`All projects`,searchAll:`Search across all projects`,addProject:`Add project…`,homeHint:`No project selected — operating across all projects.`,askCreateOrSearch:`No project is selected. Do you want to create a new project, or search across all projects?`},O={remove:`Remove {{label}}`,addContextAction:`Add context or action`,filtering:`Filtering "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`No matches`,noMatchesFor:`No matches for "{{query}}"`,mode:{reference:{title:`Reference`,hint:`@ projects, specs, missions`},trace:{title:`Trace`,hint:`# jobs, runs, IDs`},action:{title:`Action`,hint:`/ commands for this context`}},plus:{reference:`Reference`,referenceHint:`Projects, specs, missions`,trace:`Trace`,traceHint:`Jobs, runs, IDs`,action:`Action`,actionHint:`Create, launch, inspect`,fileAttachment:`File attachment`,fileAttachmentHint:`Add docs, images, logs`,browserCapture:`Browser capture`,browserCaptureHint:`Capture a page region into this mission`}},k={label:`Switch mission`,untitled:`New mission`,new:`New mission`,searchPlaceholder:`Search missions…`,noMatches:`No missions match`,working:`Agent working`,queuedBadge:`{{n}} queued`,delete:`Delete mission "{{title}}"`,deleteConfirm:`Delete?`,deleteLiveConfirm:`Agent is working — delete anyway?`,confirmDelete:`Confirm delete`,cancelDelete:`Keep mission`,deleteFailed:`Couldn't delete the mission`},A={title:`No AI provider installed`,body:`The agent needs Claude, Codex, Gemini or Kimi on your machine. Install one, then reopen the agent to start chatting.`,placeholder:`Install an AI provider to use the agent…`},j={title:`Specrails MCP is off`,body:`The agent needs the embedded MCP server to operate the app.`,enable:`Enable Specrails MCP`,enabling:`Enabling…`,enabled:`MCP enabled`},M={live:`live`,queued:`queued`,running:`running`,done:`done`,failed:`failed`},N={generic:`Something went wrong. Try again.`,busy:`The agent is busy. Try again in a moment.`},P={kindAgent:`Agent mission`},F=`New Mission`,I=`Switch to Mission Control`,L=`Switch to Board`,R=`Search`,z=`Home`,B=`Favorite missions`,V=`Untitled`,H={title:`On workspace`,terminal:`Terminal`,files:`Files`,browser:`Browser`,requiresProject:`Select a project to use this tool`,resizeCode:`Resize code pane`,closeFiles:`Close code`,browserConfirm:`Add to agent`,browserSelectStart:`Select to add to mission`,browserCaptured:`Capture added`,uploadFailed:`Upload failed`,requiresConversation:`Start a mission to use this tool`,jobs:`Jobs`,closeJobs:`Close jobs`,resizeJobs:`Resize jobs pane`,noJobs:`No jobs yet — ask the agent to launch one`,analytics:`Analytics`,closeAnalytics:`Close analytics`,resizeAnalytics:`Resize analytics pane`},U=`Attach file`,W=`Delete "{{title}}"`,G=`Confirm delete "{{title}}"`,K=`Add "{{title}}" to favorites`,q=`Remove "{{title}}" from favorites`,J=`confirm?`,Y=`This provider can't read images yet — attach text files instead`,X={label:`Effort`,minimal:`Minimal`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra high`,max:`Max`,ultra:`Ultra`},Z=JSON.parse(`{"operation":{"inProgress":"Action in progress…","create-pr":"Creating PR…","publish":"Publishing…","discard":"Discarding…","dismiss":"Dismissing follow-up…","poll-merge":"Checking merge…","reopen":"Reopening…","merge-local":"Integrating locally…","recover-and-retry":"Committing and retrying the preserved result…","acknowledge-no-changes":"Marking done…"},"rail":"Rail {{index}}","specCount_one":"{{count}} spec","specCount_other":"{{count}} specs","base":"Base branch","openPr":"Open PR","existingPr":"Existing PR","title":{"building":"Implementing in an isolated worktree…","buildingExistingPr":"Applying changes to an existing PR…","paused":"Needs a human decision","on_review":"Implementation ready for review","pr_draft":"Draft PR created","pr_draft_degraded":"PR delivery incomplete","pr_ready":"PR ready for merge","no_changes":"No changes needed","partial":"Partially implemented","delivery_blocked":"Implementation complete — delivery needs attention","update_failed":"Implementation complete — update failed","pr_closed":"PR closed without merge","superseded":"Superseded by a newer run","existing_pr_updated":"Existing PR updated","implementation_failed":"Implementation failed","pr_failed":"PR creation failed","merged":"PR merged","discarded":"Discarded"},"buildingHint":"You'll be asked to create the PR when it settles.","buildingExistingPrHint":"Specrails is working on the existing PR branch and will push the review changes back to that PR.","paused":"Implementation paused","pausedForRun":"Paused on {{ref}}","resume":"Resume","stopExecution":"Stop execution","stopExecutionSent":"Stop signal sent","stopExecutionFailed":"Could not stop execution","partialSummary":"{{succeeded}} of {{total}} completed; {{failed}} failed","unit":{"failed":"implementation failed","blocked":"delivery blocked","noChanges":"no changes","succeeded":"ready"},"createPr":"Create PR","publish":"Publish","checkout":"Checkout","openReview":"Review","openReviewTooltip":"Open the plain-language review","checkoutTooltip":"Check out {{branch}} in the main project folder","checkoutSuccess":"Checked out {{branch}}","checkoutFailed":"Could not check out the implementation branch","checkoutDirtyTitle":"Checkout blocked to protect your changes","checkoutDirtyBody":"The main project folder has uncommitted changes. Commit or stash them, then retry. Nothing was changed.","checkoutSafetyUnknownTitle":"Checkout paused because safety could not be verified","checkoutSafetyUnknownBody":"Specrails could not read the main project folder’s Git status. Nothing was released or changed. Retry after Git is available.","checkoutNotDeliverableTitle":"This branch is not the preserved implementation","checkoutNotDeliverableBody":"No exact delivery commit has been verified yet. Inspect or recover the local result instead.","inspectLocalResult":"Inspect local result","inspectLocalResultTooltip":"Reveal the preserved isolated worktree and copy its path","localResultPathCopied":"Local result path copied","localResultPath":"Preserved local result","localResultUnavailableHere":"No recoverable worktree is available on this computer. Review the run log from the machine where it executed.","recoverAndRetry":"Commit & retry push","recoverAndRetryVerified":"Recovered commit {{sha}} is verified in the PR","recoveryStillBlocked":"Local recovery still needs attention","recheckRecovery":"Check again","recoveryUnavailable":"Recovery could not be verified on this computer","recoveryUnavailableBody":"Specrails could not safely prove one delivery-owned result in this clone. Nothing was changed or removed. Inspect the stage detail and run logs. If the run executed on another computer, open Specrails there, then check again.","recoveryDetailSummary":"Technical recovery detail","retry":"Retry","retryPr":"Retry PR","checkMerge":"Check merge","verifyPr":"Verify PR","discard":"Discard","dismiss":"Dismiss follow-up","discardLocalResult":"Discard local result","markDone":"Mark done","refine":"Refine","retryPush":"Retry push","retryPushVerified":"Push verified · commit {{sha}} is in the PR","commitAlreadyVerified":"Commit {{sha}} is already verified in the PR","deliveryCommit":"commit {{sha}}","reopen":"Reopen","createPartialPr":"Create PR with {{count}}","confirmDiscard":"Confirm discard?","mergedNote":"Merged — specs moved to Done","discardedNote":"Discarded — specs returned to the backlog","supersededNote":"A newer implementation run replaced this card.","completedNote":"Confirmed — specs moved to Done","noChangesExisting":"No new changes were needed; the existing PR is unchanged.","noChangesNote":"No code changes were needed. Mark the specs done or return them to the backlog to refine.","deliveryNeedsAttention":"Implementation complete; delivery needs attention","deliveryBlockedNote":"Implementation succeeded, but delivery is blocked. Review the stage detail and run logs before discarding the local result.","partialDeliveryBlockedNote":"Part of the implementation succeeded, but nothing is safely deliverable yet. Review the per-unit evidence and run logs before choosing the next action.","retryPushNote":"Implementation succeeded and the changes are safe locally. Retry only the push.","cleanupIncomplete_one":"Cleanup is incomplete ({{count}} warning)","cleanupIncomplete_other":"Cleanup is incomplete ({{count}} warnings)","safetyArchiveTitle":"Safety archive ({{count}})","safetyArchiveHint":"Temporary workspace files were preserved outside the PR as a precaution. You can inspect or remove them manually.","implementationFailedNote":"The implementation run failed before there was anything deliverable. Open the run log to inspect the failure, then discard this card before relaunching.","degraded":{"pushed":"The branch was pushed but the PR could not be created — retry to finish.","localOnly":"The changes were assembled locally but not pushed — retry to publish the PR."},"alreadyResolved":"Already resolved elsewhere","actionFailed":"Action failed","notMergedYet":"Not merged yet","commitMissingRetry":"The delivery commit is no longer in the PR. Retry push is available again.","prVerifiedWaiting":"Commit {{sha}} verified · waiting for merge","viewLog":"View run log for {{ref}}","runElapsedAria":"{{elapsed}} elapsed","runCostAria":"{{cost}} spent","pinned":{"label":"Pinned","marker":"Implementation card — pinned above","collapse":"Minimize pinned card","expand":"Expand pinned card","expandCard":"Expand this card","collapseCard":"Minimize this card","collapsed_one":"Implementation card","collapsed_other":"{{count}} implementation cards","state":{"building":"Building","on_review":"Review","pr_draft":"Draft PR","pr_ready":"Published","no_changes":"No changes","completed":"Completed","pr_closed":"Closed","superseded":"Superseded","implementation_failed":"Failed","pr_failed":"Failed","merged":"Merged","discarded":"Discarded"}},"mergeLocal":"Integrate locally","mergeLocalTooltip":"Merge the delivered branches into {{base}} in your local checkout (no GitHub needed)","mergeLocalBlockedDirty":"Cannot integrate: local changes on {{base}} overlap the delivery. Commit or stash those changes, then retry.","mergeLocalBlockedBranch":"Cannot integrate: your checkout is on {{current}}, not {{base}}. Check out {{base}}, then retry.","mergedLocally":"Integrated into {{base}} locally","confirm":{"mergeLocalTitle":"Integrate locally?","mergeLocalBody":"The delivered branches will be merged into {{base}} locally. Existing changes are preserved; overlapping edits may require resolution before integration.","recoverAndRetryTitle":"Commit and push the preserved result?","recoverAndRetryBody":"Specrails will use only the isolated worktree or recorded fast-forward branch for {{branch}}. It will commit deliverable files if needed, then push the exact commit only if the PR is still open on the expected head and base. Your main project folder and its uncommitted changes will not be touched.","recheckRecoveryTitle":"Check this computer again?","recheckRecoveryBody":"Specrails will rescan this clone’s delivery-owned worktree, branch, refs, reflogs, and orphan Git objects for {{branch}}. If it proves one result, it may commit isolated changes and retry the exact push. Your main project folder will not be touched.","freshDiscardTitle":"Discard this delivery?","freshDiscardBody":"The PR will be closed without deleting its remote branch. Only SpecRails-owned local branches and worktrees that are still at their recorded commit will be removed; anything changed will be preserved with a warning. The specs will return to the backlog. Removed local resources cannot be recovered.","implementationFailedDiscardTitle":"Discard this failed delivery?","implementationFailedDiscardBody":"The card will be cleared and its specs will return to the backlog. Local work and branches will be kept for inspection. Only resources proven safe to clean up may be removed.","dismissTitle":"Dismiss this follow-up?","dismissBody":"This follow-up card will be cleared. Its owned worktree will be removed only if it is still safe; otherwise it will be preserved with a warning. The existing PR, its branch, and review state will remain unchanged.","discardLocalTitle":"Discard the local result?","discardLocalBody":"The recoverable local iteration will be removed only if it is still safe; if it changed, it will be preserved with a warning. Any existing PR and its branch will remain unchanged. A removed result cannot be recovered.","noChangesDoneTitle":"Mark these specs done?","noChangesDoneBody":"The implementation confirmed that no code changes are needed. The specs will move to Done and the no-change worktree will be cleaned up.","refineTitle":"Refine these specs?","refineBody":"The no-change result will be closed and the specs will return to the backlog so you can refine them. The run logs remain available."},"discardStackedNote":"Later rails of this milestone were built on this delivery. Discarding it pauses the milestone chain; the later rails keep their work."}`),Q={heading:`Spec draft`,drafting:`Updating draft…`,acceptanceCriteria:`Acceptance criteria`,untitled:`Untitled spec`,expand:`Show full description`,collapse:`Collapse description`},$={heading:`Framing`,framing:`Framing the request…`,restated:`What I understood`,alternative:`It could also mean`,pick:`Reply with this`,touches:`Would touch`,discriminator:`Which is it?`,assumptions:`What I'm assuming`,unknowns:`Still open`},re={openTicket:`Open spec #{{id}}`,openPullRequest:`Open PR #{{id}}`,openJob:`Open job {{id}}`,openLoop:`Open loop {{id}}`,ticketNotFound:`Spec #{{id}} not found — it may have been deleted`,pullRequestUrlMissing:`PR #{{id}} was referenced without a URL`,pullRequestNotFound:`PR #{{id}} could not be found in this project`,jobNotFound:`Job not found — it may have been deleted`,loopNotFound:`Loop not found — it may have been deleted`,lookupFailed:`Couldn't verify the reference — try again`},ie={untitled:`Untitled mission`,menu:`Mission menu`,rename:`Rename`,renamePlaceholder:`Mission name`,renameHint:`Double-click to rename`,renameFailed:`Could not rename`,addFavorite:`Add to favorites`,removeFavorite:`Remove from favorites`,copyName:`Copy mission name`,copyId:`Copy mission ID`,copyProject:`Copy project name`,copyProjectPath:`Copy project path`,copyFailed:`Couldn't copy`,copyTranscript:`Copy transcript`,copyTranscriptSuccess:`Transcript copied`,copyTranscriptFailed:`Could not copy transcript`,exportTranscript:`Export transcript (.txt)`,exportTranscriptSuccess:`Transcript export started`,exportTranscriptFailed:`Could not export transcript`,delete:`Delete mission`,deleteConfirm:`Delete this mission? This cannot be undone.`,deleteFailed:`Could not delete the mission`},ae=`What should we build next?`,oe={title:`Execution log`,live:`Live`,empty:`No tool activity in this turn yet.`,output:`Output`,error:`Error`,copyAll:`Copy full log`,copyEntry:`Copy entry`,copySuccess:`Log copied to clipboard`,copyFailed:`Could not copy the log`,openLog:`View execution log`,close:`Close`},se={open:`View logs for {{command}}`,logsTitle:`Process logs`,logsDescription:`Live output and saved history for this process.`,close:`Close logs`,command:`Command`,directory:`Directory`,exitCode:`Exit code: {{code}}`,signal:`Signal: {{signal}}`,search:`Search logs…`,source:`Output source`,allSources:`All output`,pause:`Pause`,resume:`Resume`,follow:`Follow`,copy:`Copy visible logs`,download:`Download visible logs`,stop:`Stop process`,stopCommand:`Stop {{command}}`,stopFailed:`Could not stop the process. Try again.`,truncated:`Showing a limited log window. Older output or long lines may be omitted. Copy and download include this view only.`,paused:`View paused. The process continues running.`,loadFailed:`Logs could not be loaded. The process may have expired from retention; saved output is still shown.`,retry:`Retry`,copied:`Visible logs copied.`,exportFailed:`Could not export logs. Try again.`,output:`Process output`,loading:`Loading logs…`,noMatches:`No matching output.`,empty:`No output yet.`,lineCount:`{{count}} of {{total}} lines`,exportHint:`Exports include the current filter and retained output only.`,status:{starting:`Starting`,running:`Running`,stopping:`Stopping`,exited:`Exited`,killed:`Stopped`,failed:`Failed`,interrupted:`Disconnected`},repository:`Repository`,history:{button:`Processes`,title:`Mission processes`,open:`View process history`,description:`Browse active processes and saved logs from earlier executions.`,search:`Search command or repository…`,refresh:`Refresh history`,close:`Close process history`,back:`Back to processes`,loading:`Loading process history…`,empty:`No processes have been recorded for this mission.`,noMatches:`No matching processes.`,loadFailed:`Process history could not be loaded. Previously loaded entries remain available.`,showMore:`Show more`,count:`Processes: {{count}}`},interruptedHint:`Specrails stopped supervising this process. Its operating system state is unknown; saved logs remain available.`,persistenceFailed:`The process history could not be saved. Available output remains visible.`},ce={detach:`Open in separate window`,attach:`Return to main window`,detached:`This mission is open in another window.`,focus:`Show mission window`,loading:`Moving mission…`,failed:`Could not move this mission. Your draft is preserved.`,dismiss:`Dismiss`,wrongMission:`Open this mission before moving it.`,finishPending:`Finish the operation in progress, or save or cancel the message or capture before moving the mission.`},le={title:e,subtitle:t,trigger:n,composerPlaceholder:r,send:i,stop:a,copy:o,attachment:s,maximize:c,restore:l,minimize:u,close:d,newConversation:f,emptyTitle:p,emptyHint:m,thinking:h,connecting:g,consultingCode:_,size:v,model:y,history:b,queue:x,receipt:S,queueEdit:C,git:w,provider:T,tier:E,approval:ne,project:D,palette:O,mission:k,noProvider:A,degraded:j,toolCard:M,error:N,chip:P,newAgent:F,switchToAgent:I,switchToKanban:L,search:R,home:z,favoriteMissions:B,untitled:V,workspace:H,attachFile:U,deleteConversation:W,confirmDeleteConversation:G,addFavoriteConversation:K,removeFavoriteConversation:q,confirmShort:J,imagesUnsupported:Y,effort:X,prCard:Z,specDraft:Q,problemFrame:$,refs:re,header:ie,emptyTitleCodeRain:ae,activity:oe,backgroundProcess:se,window:ce};export{te as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`Controllo missioni`,t=`Gestisci Specrails chattando`,n=`Controllo missioni`,r=`Chiedi all'agente qualsiasi cosa…`,i=`Invia`,a=`Ferma`,o=`Copia`,s={openPreview:`Anteprima di {{name}}`,openDownload:`Scarica {{name}}`,previewTitle:`Anteprima di {{name}}`,downloadTitle:`Scaricare il file?`,downloadPrompt:`Questo file non può essere visualizzato qui. Vuoi scaricarlo?`,download:`Scarica`,cancelDownload:`Non ora`,loading:`Preparazione del file…`,loadFailed:`Impossibile caricare l'allegato`,loadError:`Impossibile caricare l'allegato: {{error}}`},c=`Massimizza`,l=`Ripristina`,u=`Riduci a icona`,d=`Chiudi`,f=`Nuova missione`,p=`Qual è la missione?`,m=`Scegli un progetto, poi chiedi. La board si aggiorna in tempo reale mentre l'agente lavora.`,h=`Sto pensando…`,g=`Connessione…`,_=`Consulto l'app…`,v={compact:`Compatto`,comfortable:`Comodo`,max:`Ingrandisci`},y={label:`Modello`,loading:`Caricamento modelli…`,unavailable:`Modelli non disponibili`},b={hint:`Cronologia prompt — scrivi per modificare, ↑↓ per navigare`},x={queued:`In coda`,send:`Invia messaggio`,sendHint:`In coda per il prossimo turno. Seleziona «Indirizza» su un messaggio in coda per inviarlo senza interrompere il modello.`,placeholder:`Aggiungi un messaggio alla coda…`,delivered:`Consegnato all’agente`,interrupted:`Consegna non confermata`,cancelled:`Annullato prima della consegna`,steer:`Indirizza`,steerHint:`Invia senza interrompere il modello`,steering:`Invio all’agente…`,remove:`Elimina messaggio dalla coda`,more:`Opzioni del messaggio`,edit:`Modifica`,actionConflict:`Il messaggio è già in fase di consegna o non è più in coda.`,actionFailed:`Impossibile aggiornare il messaggio in coda. Riprova.`},S={sent:`Inviato all’agente`,received:`Consegnato all’agente`,read:`Letto dall’agente`,interrupted:`Consegna non confermata`,cancelled:`Annullato prima della consegna`},C={editing:`Modifica del messaggio in attesa {{n}} di {{m}}`,hint:`↑↓ per navigare · Invio salva · Esc annulla`,save:`Salva messaggio in attesa`,cancel:`Annulla modifica`,dispatched:`Il messaggio è già stato consegnato; il testo rimane come bozza`,saveFailed:`Impossibile salvare il messaggio in attesa`},w={branch:`Branch`,detached:`(detached)`,dirty:`Modifiche non committate`,switched:`Passato a {{branch}}`,switchFailed:`Impossibile cambiare branch`,lockedWhileWorking:`Branch bloccato mentre l'agente lavora`,searchPlaceholder:`Cerca branch…`,noMatches:`Nessun branch corrisponde`,worktrees:`Worktree`,worktreePathCopied:`Percorso del worktree copiato`,copyWorktreePath:`Copia percorso del worktree`,repository:`Repository`,repositoryUnavailable:`Repository non disponibile`,loadFailed:`Stato Git non disponibile`,notGit:`Cartella di contesto · senza Git`,retry:`Riprova`},T={label:`Provider`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},E={cycleHint:`⇧⇥ per cambiare`,observe:{name:`Osserva`,desc:`Solo lettura — niente cambia`},edit:{name:`Modifica`,desc:`Crea e modifica (reversibile)`},operate:{name:`Opera`,desc:`Avvia l'IA — ha un costo`},autonomous:{name:`Autonomo`,desc:`Elimina e arresta — irreversibile`},lockedTitle:`Serve un livello superiore`,lockedBody:`Quell'azione richiede il livello «{{level}}». Sei su «{{current}}».`,raiseHint:`⇧⇥ per alzare il livello, o chiedi in un altro modo.`},D={title:`Conferma azione`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`Approva`,cancel:`Annulla`,dontAskAgain:`Non chiedere più in questa sessione`,approved:`Approvato`,cancelled:`Annullato`},O={home:`Home`,searchPlaceholder:`Parla con Specrails…`,searchProjectsPlaceholder:`Cerca progetti…`,recents:`Recenti`,allProjects:`Tutti i progetti`,searchAll:`Cerca in tutti i progetti`,addProject:`Aggiungi progetto…`,homeHint:`Nessun progetto selezionato — operando su tutti i progetti.`,askCreateOrSearch:`Nessun progetto è selezionato. Vuoi creare un nuovo progetto o cercare in tutti i progetti?`},k={remove:`Rimuovi {{label}}`,addContextAction:`Aggiungi contesto o azione`,filtering:`Filtro "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`Nessun risultato`,noMatchesFor:`Nessun risultato per "{{query}}"`,mode:{reference:{title:`Riferimento`,hint:`@ progetti, spec, missioni`},trace:{title:`Traccia`,hint:`# job, esecuzioni, ID`},action:{title:`Azione`,hint:`/ comandi per questo contesto`}},plus:{reference:`Riferimento`,referenceHint:`Progetti, spec, missioni`,trace:`Traccia`,traceHint:`Job, esecuzioni, ID`,action:`Azione`,actionHint:`Crea, avvia, ispeziona`,fileAttachment:`File allegato`,fileAttachmentHint:`Aggiungi doc, immagini, log`,browserCapture:`Cattura browser`,browserCaptureHint:`Cattura un'area della pagina per questa missione`}},A={label:`Cambia missione`,untitled:`Nuova missione`,new:`Nuova missione`,searchPlaceholder:`Cerca missioni…`,noMatches:`Nessuna missione corrisponde`,working:`L'agente sta lavorando`,queuedBadge:`{{n}} in coda`,delete:`Elimina missione "{{title}}"`,deleteConfirm:`Eliminare?`,deleteLiveConfirm:`L'agente sta lavorando — eliminare comunque?`,confirmDelete:`Conferma eliminazione`,cancelDelete:`Mantieni missione`,deleteFailed:`Impossibile eliminare la missione`},j={title:`Nessun provider IA installato`,body:`L'agente richiede Claude, Codex, Gemini o Kimi sul tuo computer. Installane uno e riapri l'agente per iniziare a chattare.`,placeholder:`Installa un provider IA per usare l'agente…`},M={title:`L'MCP di Specrails è spento`,body:`L'agente ha bisogno del server MCP integrato per gestire l'app.`,enable:`Attiva l'MCP di Specrails`,enabling:`Attivazione…`,enabled:`MCP attivato`},N={live:`in diretta`,queued:`in coda`,running:`in corso`,done:`completato`,failed:`fallito`},P={generic:`Qualcosa è andato storto. Riprova.`,busy:`L'agente è occupato. Riprova tra un momento.`},F={kindAgent:`Missione dell'agente`},I=`Nuova missione`,L=`Passa al Controllo missioni`,R=`Passa alla board`,z=`Cerca`,B=`Home`,V=`Missioni preferite`,H=`Senza titolo`,U={title:`Nel workspace`,terminal:`Terminale`,files:`File`,browser:`Browser`,requiresProject:`Seleziona un progetto per usare questo strumento`,resizeCode:`Ridimensiona pannello codice`,closeFiles:`Chiudi codice`,browserConfirm:`Aggiungi all'agente`,browserSelectStart:`Seleziona per aggiungere alla missione`,browserCaptured:`Cattura aggiunta`,uploadFailed:`Caricamento non riuscito`,requiresConversation:`Avvia una missione per usare questo strumento`,jobs:`Jobs`,closeJobs:`Chiudi jobs`,resizeJobs:`Ridimensiona pannello jobs`,noJobs:`Ancora nessun job — chiedi all'agente di lanciarne uno`,analytics:`Analytics`,closeAnalytics:`Chiudi analytics`,resizeAnalytics:`Ridimensiona pannello analytics`},W=`Allega file`,G=`Elimina «{{title}}»`,K=`Conferma eliminazione di «{{title}}»`,q=`Aggiungi «{{title}}» ai preferiti`,J=`Rimuovi «{{title}}» dai preferiti`,Y=`confermare?`,X=`Questo provider non legge ancora le immagini — allega file di testo`,Z={label:`Sforzo`,minimal:`Minimo`,low:`Basso`,medium:`Medio`,high:`Alto`,xhigh:`Extra alto`,max:`Massimo`,ultra:`Ultra`},Q=JSON.parse(`{"operation":{"inProgress":"Azione in corso…","create-pr":"Creazione PR…","publish":"Pubblicazione…","discard":"Eliminazione…","dismiss":"Chiusura del follow-up…","poll-merge":"Verifica merge…","reopen":"Riapertura…","merge-local":"Integrazione locale…","recover-and-retry":"Creazione del commit e nuovo tentativo di push del risultato preservato…","acknowledge-no-changes":"Contrassegno come completato…"},"markDone":"Segna come completate","refine":"Perfeziona","completedNote":"Confermato — le spec sono passate a Completate","partialSummary":"{{succeeded}} di {{total}} completate; {{failed}} non riuscite","unit":{"failed":"implementazione non riuscita","blocked":"consegna bloccata","noChanges":"nessuna modifica","succeeded":"pronta"},"rail":"Rail {{index}}","specCount_one":"{{count}} spec","specCount_other":"{{count}} spec","base":"Ramo base","openPr":"Apri PR","existingPr":"PR esistente","title":{"no_changes":"Nessuna modifica necessaria","partial":"Implementazione parziale","delivery_blocked":"Implementazione completa — la consegna richiede attenzione","update_failed":"Implementazione completa — aggiornamento non riuscito","pr_closed":"PR chiusa senza merge","superseded":"Sostituita da un’esecuzione più recente","existing_pr_updated":"PR esistente aggiornata","building":"Implementazione in un worktree isolato…","buildingExistingPr":"Applicazione delle modifiche su una PR esistente…","paused":"Serve una decisione umana","on_review":"Implementazione pronta per la revisione","pr_draft":"PR in bozza creata","pr_draft_degraded":"Consegna della PR incompleta","pr_ready":"PR pronta per il merge","implementation_failed":"Implementazione non riuscita","pr_failed":"Creazione della PR non riuscita","merged":"Merge della PR effettuato","discarded":"Scartata"},"buildingHint":"Al termine ti verrà chiesto se creare la PR.","buildingExistingPrHint":"Specrails sta lavorando sul branch della PR esistente e invierà le modifiche di review a quella stessa PR.","paused":"Implementazione in pausa","pausedForRun":"In pausa su {{ref}}","resume":"Riprendi","stopExecution":"Interrompi esecuzione","stopExecutionSent":"Segnale di stop inviato","stopExecutionFailed":"Impossibile interrompere l’esecuzione","createPr":"Crea PR","publish":"Pubblica","checkout":"Passa al branch","openReview":"Rivedi","openReviewTooltip":"Apri la revisione in linguaggio semplice","checkoutTooltip":"Esegui il checkout di {{branch}} nella cartella principale del progetto","checkoutSuccess":"Checkout eseguito su {{branch}}","checkoutFailed":"Impossibile eseguire il checkout del branch di implementazione","checkoutDirtyTitle":"Checkout bloccato per proteggere le tue modifiche","checkoutDirtyBody":"La cartella principale del progetto contiene modifiche senza commit. Esegui un commit o uno stash, quindi riprova. Non è stato modificato nulla.","checkoutSafetyUnknownTitle":"Checkout in pausa: impossibile verificare la sicurezza","checkoutSafetyUnknownBody":"Specrails non ha potuto leggere lo stato Git della cartella principale del progetto. Nulla è stato rilasciato o modificato. Riprova quando Git sarà disponibile.","checkoutNotDeliverableTitle":"Questo branch non contiene l’implementazione conservata","checkoutNotDeliverableBody":"Il commit esatto della consegna non è ancora stato verificato. Ispeziona o recupera invece il risultato locale.","inspectLocalResult":"Ispeziona il risultato locale","inspectLocalResultTooltip":"Mostra il worktree isolato preservato e copia il suo percorso","localResultPathCopied":"Percorso del risultato locale copiato","localResultPath":"Risultato locale preservato","localResultUnavailableHere":"Su questo computer non è disponibile alcun worktree recuperabile. Consulta il log dell’esecuzione dal computer su cui è stata eseguita.","recoverAndRetry":"Crea commit e riprova il push","recoverAndRetryVerified":"Il commit recuperato {{sha}} è verificato nella PR","recoveryStillBlocked":"Il recupero locale richiede ancora attenzione","recheckRecovery":"Controlla di nuovo","recoveryUnavailable":"Impossibile verificare il recupero su questo computer","recoveryUnavailableBody":"Specrails non ha potuto dimostrare in sicurezza un unico risultato appartenente alla consegna in questo clone. Nulla è stato modificato o rimosso. Controlla i dettagli della fase e i log di esecuzione. Se il run è stato eseguito su un altro computer, apri Specrails lì e controlla di nuovo.","recoveryDetailSummary":"Dettaglio tecnico del recupero","retry":"Riprova","retryPr":"Riprova PR","checkMerge":"Verifica merge","verifyPr":"Verifica PR","discard":"Scarta","confirmDiscard":"Confermare lo scarto?","mergedNote":"Merge effettuato — le spec sono passate a Completato","discardedNote":"Scartata — le spec sono tornate nel backlog","implementationFailedNote":"Il run di implementazione non è riuscito prima di produrre qualcosa di consegnabile. Apri il log del run per controllare l'errore, poi scarta questa scheda prima di rilanciare.","dismiss":"Chiudi follow-up","discardLocalResult":"Elimina risultato locale","retryPush":"Riprova push","retryPushVerified":"Push verificato · il commit {{sha}} è nella PR","commitAlreadyVerified":"Il commit {{sha}} è già verificato nella PR","deliveryCommit":"commit {{sha}}","reopen":"Riapri","createPartialPr":"Crea PR con {{count}}","supersededNote":"Un’esecuzione di implementazione più recente ha sostituito questa scheda.","noChangesExisting":"Non erano necessarie nuove modifiche; la PR esistente resta invariata.","noChangesNote":"Non erano necessarie modifiche al codice. Segna le spec come completate oppure riportale nel backlog per perfezionarle.","deliveryNeedsAttention":"Implementazione completa; la consegna richiede attenzione","deliveryBlockedNote":"L’implementazione è riuscita, ma la consegna è bloccata. Controlla il dettaglio della fase e i log prima di eliminare il risultato locale.","partialDeliveryBlockedNote":"Una parte dell’implementazione è riuscita, ma non c’è ancora nulla che possa essere consegnato in sicurezza. Controlla le evidenze per unità e i log prima di scegliere l’azione successiva.","retryPushNote":"L’implementazione è riuscita e le modifiche sono al sicuro in locale. Riprova solo il push.","cleanupIncomplete_one":"Pulizia incompleta ({{count}} avviso)","cleanupIncomplete_other":"Pulizia incompleta ({{count}} avvisi)","safetyArchiveTitle":"Archivio di sicurezza ({{count}})","safetyArchiveHint":"I file temporanei dell’area di lavoro sono stati conservati fuori dalla PR per precauzione. Puoi controllarli o rimuoverli manualmente.","confirm":{"recoverAndRetryTitle":"Creare il commit e inviare il risultato preservato?","recoverAndRetryBody":"Specrails userà esclusivamente il worktree isolato o il branch registrato compatibile con il fast-forward per {{branch}}. Se necessario, creerà un commit con i file consegnabili e invierà quel commit esatto solo se la PR è ancora aperta sui branch di origine e destinazione previsti. La cartella principale del progetto e le sue modifiche senza commit non verranno toccate.","recheckRecoveryTitle":"Controllare di nuovo questo computer?","recheckRecoveryBody":"Specrails riesaminerà in questo clone il worktree, il branch, i ref, i reflog e gli oggetti Git orfani appartenenti alla consegna di {{branch}}. Se dimostra un unico risultato, potrà eseguire il commit delle modifiche isolate e ritentare il push esatto. La cartella principale del progetto non verrà toccata.","noChangesDoneTitle":"Segnare queste spec come completate?","noChangesDoneBody":"L’implementazione ha confermato che non servono modifiche al codice. Le spec passeranno a Completate e il worktree senza modifiche verrà ripulito.","refineTitle":"Perfezionare queste spec?","refineBody":"Il risultato senza modifiche verrà chiuso e le spec torneranno nel backlog per essere perfezionate. I log di esecuzione resteranno disponibili.","mergeLocalTitle":"Integrare localmente?","mergeLocalBody":"I branch consegnati saranno uniti a {{base}} localmente. Le modifiche esistenti vengono preservate; quelle sovrapposte potrebbero richiedere una risoluzione prima dell’integrazione.","freshDiscardTitle":"Eliminare questa consegna?","freshDiscardBody":"La PR verrà chiusa senza eliminare il branch remoto. Verranno rimossi solo i branch locali e i worktree di proprietà di SpecRails che si trovano ancora sul commit registrato; qualsiasi elemento modificato sarà conservato con un avviso. Le spec torneranno nel backlog. Le risorse locali rimosse non possono essere recuperate.","implementationFailedDiscardTitle":"Scartare questa consegna non riuscita?","implementationFailedDiscardBody":"La scheda verrà chiusa e le spec torneranno nel backlog. Il lavoro locale e i branch saranno conservati per l’ispezione. Potranno essere rimosse solo le risorse la cui pulizia è dimostrata sicura.","dismissTitle":"Chiudere questo follow-up?","dismissBody":"Questa scheda di follow-up verrà chiusa. Il relativo worktree verrà rimosso solo se è ancora sicuro farlo; in caso contrario, sarà conservato con un avviso. La PR esistente, il suo branch e lo stato di revisione resteranno invariati.","discardLocalTitle":"Eliminare il risultato locale?","discardLocalBody":"L’iterazione locale recuperabile verrà rimossa solo se è ancora sicuro farlo; se è cambiata, sarà conservata con un avviso. Qualsiasi PR esistente e il suo branch resteranno invariati. Un risultato rimosso non può essere recuperato."},"degraded":{"pushed":"Il ramo è stato inviato ma non è stato possibile creare la PR — riprova per completare.","localOnly":"Le modifiche sono state assemblate in locale ma non inviate — riprova per pubblicare la PR."},"alreadyResolved":"Già risolta altrove","actionFailed":"Azione non riuscita","notMergedYet":"Ancora nessun merge","commitMissingRetry":"Il commit di consegna non è più presente nella PR. Puoi riprovare il push.","prVerifiedWaiting":"Commit {{sha}} verificato · in attesa del merge","viewLog":"Vedi il log di esecuzione di {{ref}}","runElapsedAria":"{{elapsed}} trascorsi","runCostAria":"{{cost}} spesi","pinned":{"label":"Fissata","marker":"Scheda di implementazione — fissata sopra","collapse":"Riduci la scheda fissata","expand":"Espandi la scheda fissata","expandCard":"Espandi questa scheda","collapseCard":"Riduci questa scheda","collapsed_one":"Scheda di implementazione","collapsed_other":"{{count}} schede di implementazione","state":{"completed":"Completata","no_changes":"Nessuna modifica","pr_closed":"Chiusa","superseded":"Sostituita","building":"In corso","on_review":"Revisione","pr_draft":"PR bozza","pr_ready":"Pubblicata","implementation_failed":"Fallita","pr_failed":"Fallita","merged":"Unita","discarded":"Scartata"}},"mergeLocal":"Integra in locale","mergeLocalTooltip":"Unisce i branch consegnati in {{base}} nel tuo checkout locale (senza GitHub)","mergeLocalBlockedDirty":"Impossibile integrare: le modifiche locali su {{base}} si sovrappongono alla consegna. Esegui il commit o lo stash di queste modifiche e riprova.","mergeLocalBlockedBranch":"Impossibile integrare: il tuo checkout è su {{current}}, non su {{base}}. Passa a {{base}} e riprova.","mergedLocally":"Integrato in {{base}} in locale","discardStackedNote":"I rail successivi di questa milestone sono stati costruiti su questa consegna. Scartarla mette in pausa la catena della milestone; i rail successivi conservano il loro lavoro."}`),$={heading:`Bozza della spec`,drafting:`Aggiornamento della bozza…`,acceptanceCriteria:`Criteri di accettazione`,untitled:`Spec senza titolo`,expand:`Mostra descrizione completa`,collapse:`Comprimi descrizione`},ee={heading:`Inquadramento`,framing:`Inquadramento della richiesta…`,restated:`Ciò che ho capito`,alternative:`Potrebbe anche significare`,pick:`Rispondi con questo`,touches:`Toccherebbe`,discriminator:`Quale delle due?`,assumptions:`Ciò che sto assumendo`,unknowns:`Ancora aperto`},te={openTicket:`Apri la spec #{{id}}`,openPullRequest:`Apri PR #{{id}}`,openJob:`Apri il job {{id}}`,openLoop:`Apri loop {{id}}`,ticketNotFound:`Spec #{{id}} non trovata — potrebbe essere stata eliminata`,pullRequestUrlMissing:`La PR #{{id}} è stata citata senza URL`,pullRequestNotFound:`La PR #{{id}} non è stata trovata in questo progetto`,jobNotFound:`Job non trovato — potrebbe essere stato eliminato`,loopNotFound:`Loop non trovato — potrebbe essere stato eliminato`,lookupFailed:`Impossibile verificare il riferimento — riprova`},ne={untitled:`Missione senza titolo`,menu:`Menu della missione`,rename:`Rinomina`,renamePlaceholder:`Nome della missione`,renameHint:`Doppio clic per rinominare`,renameFailed:`Impossibile rinominare`,addFavorite:`Aggiungi ai preferiti`,removeFavorite:`Rimuovi dai preferiti`,copyName:`Copia nome missione`,copyId:`Copia ID missione`,copyProject:`Copia nome progetto`,copyProjectPath:`Copia percorso progetto`,copyFailed:`Impossibile copiare`,copyTranscript:`Copia trascrizione`,copyTranscriptSuccess:`Trascrizione copiata`,copyTranscriptFailed:`Impossibile copiare la trascrizione`,exportTranscript:`Esporta trascrizione (.txt)`,exportTranscriptSuccess:`Esportazione della trascrizione avviata`,exportTranscriptFailed:`Impossibile esportare la trascrizione`,delete:`Elimina missione`,deleteConfirm:`Eliminare questa missione? Non è reversibile.`,deleteFailed:`Impossibile eliminare la missione`},re=`Cosa costruiamo adesso?`,ie={title:`Log di esecuzione`,live:`In diretta`,empty:`Nessuna attività degli strumenti in questo turno.`,output:`Output`,error:`Errore`,copyAll:`Copia log completo`,copyEntry:`Copia voce`,copySuccess:`Log copiato negli appunti`,copyFailed:`Impossibile copiare il log`,openLog:`Vedi log di esecuzione`,close:`Chiudi`},ae={open:`Visualizza i log di {{command}}`,logsTitle:`Log del processo`,logsDescription:`Output in diretta e cronologia salvata del processo.`,close:`Chiudi log`,command:`Comando`,directory:`Directory`,exitCode:`Codice di uscita: {{code}}`,signal:`Segnale: {{signal}}`,search:`Cerca nei log…`,source:`Origine dell’output`,allSources:`Tutto l’output`,pause:`Pausa`,resume:`Riprendi`,follow:`Segui`,copy:`Copia i log visibili`,download:`Scarica i log visibili`,stop:`Arresta processo`,stopCommand:`Arresta {{command}}`,stopFailed:`Impossibile arrestare il processo. Riprova.`,truncated:`La finestra dei log è limitata. Output precedente o righe lunghe possono essere omessi. Copia e download includono solo questa vista.`,paused:`Vista in pausa. Il processo continua.`,loadFailed:`Impossibile caricare i log. Il periodo di conservazione potrebbe essere scaduto; l’output già caricato resta visibile.`,retry:`Riprova`,copied:`Log visibili copiati.`,exportFailed:`Impossibile esportare i log. Riprova.`,output:`Output del processo`,loading:`Caricamento dei log…`,noMatches:`Nessun output corrispondente.`,empty:`Nessun output per ora.`,lineCount:`{{count}} di {{total}} righe`,exportHint:`L’esportazione include solo il filtro attuale e l’output conservato.`,status:{starting:`Avvio`,running:`In esecuzione`,stopping:`Arresto in corso`,exited:`Terminato`,killed:`Arrestato`,failed:`Non riuscito`,interrupted:`Disconnesso`},repository:`Repository`,history:{button:`Processi`,title:`Processi della missione`,open:`Visualizza cronologia dei processi`,description:`Consulta i processi attivi e i log salvati delle esecuzioni precedenti.`,search:`Cerca comando o repository…`,refresh:`Aggiorna cronologia`,close:`Chiudi cronologia dei processi`,back:`Torna ai processi`,loading:`Caricamento della cronologia…`,empty:`Non sono ancora stati registrati processi per questa missione.`,noMatches:`Nessun processo corrispondente.`,loadFailed:`Impossibile caricare la cronologia. Le voci già caricate restano disponibili.`,showMore:`Mostra altri`,count:`Processi: {{count}}`},interruptedHint:`Specrails non supervisiona più questo processo. Il suo stato nel sistema operativo è sconosciuto; i log salvati restano disponibili.`,persistenceFailed:`Impossibile salvare la cronologia del processo. L’output disponibile resta visibile.`},oe={detach:`Apri in una finestra separata`,attach:`Torna alla finestra principale`,detached:`Questa missione è aperta in un’altra finestra.`,focus:`Mostra la finestra della missione`,loading:`Spostamento della missione…`,failed:`Impossibile spostare la missione. La bozza è stata conservata.`,dismiss:`Chiudi`,wrongMission:`Apri questa missione prima di spostarla.`,finishPending:`Completa l’operazione in corso oppure salva o annulla il messaggio o la cattura prima di spostare la missione.`},se={title:e,subtitle:t,trigger:n,composerPlaceholder:r,send:i,stop:a,copy:o,attachment:s,maximize:c,restore:l,minimize:u,close:d,newConversation:f,emptyTitle:p,emptyHint:m,thinking:h,connecting:g,consultingCode:_,size:v,model:y,history:b,queue:x,receipt:S,queueEdit:C,git:w,provider:T,tier:E,approval:D,project:O,palette:k,mission:A,noProvider:j,degraded:M,toolCard:N,error:P,chip:F,newAgent:I,switchToAgent:L,switchToKanban:R,search:z,home:B,favoriteMissions:V,untitled:H,workspace:U,attachFile:W,deleteConversation:G,confirmDeleteConversation:K,addFavoriteConversation:q,removeFavoriteConversation:J,confirmShort:Y,imagesUnsupported:X,effort:Z,prCard:Q,specDraft:$,problemFrame:ee,refs:te,header:ne,emptyTitleCodeRain:re,activity:ie,backgroundProcess:ae,window:oe};export{ie as activity,q as addFavoriteConversation,D as approval,W as attachFile,s as attachment,ae as backgroundProcess,F as chip,d as close,r as composerPlaceholder,K as confirmDeleteConversation,Y as confirmShort,g as connecting,_ as consultingCode,o as copy,se as default,M as degraded,G as deleteConversation,Z as effort,m as emptyHint,p as emptyTitle,re as emptyTitleCodeRain,P as error,V as favoriteMissions,w as git,ne as header,b as history,B as home,X as imagesUnsupported,c as maximize,u as minimize,A as mission,y as model,I as newAgent,f as newConversation,j as noProvider,k as palette,Q as prCard,ee as problemFrame,O as project,T as provider,x as queue,C as queueEdit,S as receipt,te as refs,J as removeFavoriteConversation,l as restore,z as search,i as send,v as size,$ as specDraft,a as stop,t as subtitle,L as switchToAgent,R as switchToKanban,h as thinking,E as tier,e as title,N as toolCard,n as trigger,H as untitled,oe as window,U as workspace};
|