@surething/cockpit 1.0.185 → 1.0.187
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +26 -26
- package/.next-prod/build-manifest.json +3 -3
- package/.next-prod/next-minimal-server.js.nft.json +1 -1
- package/.next-prod/next-server.js.nft.json +1 -1
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/react-loadable-manifest.json +1 -1
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +2 -2
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/bash/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +18 -7
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +21 -10
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +154 -6
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +14 -3
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/extension/version/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/load/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/save/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pick-folder/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/identify/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/order/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/share-info/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/users/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +11 -11
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +26 -26
- package/.next-prod/server/chunks/3269.js +1 -0
- package/.next-prod/server/chunks/4098.js +1 -1
- package/.next-prod/server/chunks/4490.js +1 -1
- package/.next-prod/server/chunks/4741.js +4 -4
- package/.next-prod/server/chunks/5394.js +1 -0
- package/.next-prod/server/chunks/6062.js +1 -1
- package/.next-prod/server/chunks/700.js +1 -0
- package/.next-prod/server/chunks/7284.js +1 -1
- package/.next-prod/server/functions-config-manifest.json +0 -1
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +2 -2
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/{1593-7902218f5b10761f.js → 1593-d845ec6e5c8de67e.js} +1 -1
- package/.next-prod/static/chunks/5493-83d6a5ec42d6cbb3.js +1 -0
- package/.next-prod/static/chunks/{700.65a02f6a597083dc.js → 700.0aaec5a3a570d182.js} +1 -1
- package/.next-prod/static/chunks/app/page-cc2b332242bc2c93.js +1 -0
- package/.next-prod/static/chunks/app/project/page-95039285184e0c74.js +25 -0
- package/.next-prod/static/chunks/{webpack-67d02a2a41508d41.js → webpack-0f527ee7ab644d02.js} +1 -1
- package/.next-prod/static/css/bbd65867698c479b.css +3 -0
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/bin/postinstall.mjs +20 -0
- package/dist/{JupyterKernelManager-475VNVA5.mjs → JupyterKernelManager-VBKKSRVJ.mjs} +23 -2
- package/dist/chunk-KLV3PBIZ.mjs +427 -0
- package/dist/scheduledTasks.mjs +7 -2
- package/dist/wsServer.mjs +3 -3
- package/kernels/jupyter_bridge.py +162 -0
- package/package.json +5 -2
- package/server.mjs +5 -1
- package/.next-prod/static/chunks/5493-9f80ad2c7c9cf840.js +0 -1
- package/.next-prod/static/chunks/app/page-cc2bf3ca4c337090.js +0 -1
- package/.next-prod/static/chunks/app/project/page-b73536c67304e489.js +0 -25
- package/.next-prod/static/css/786ec7ade22e6269.css +0 -3
- package/dist/chunk-SWMKAZSL.mjs +0 -250
- /package/.next-prod/static/{ZA65Kd3f2tNa-NfgtOil4 → Avd2f2SegjGOElSYvrTlK}/_buildManifest.js +0 -0
- /package/.next-prod/static/{ZA65Kd3f2tNa-NfgtOil4 → Avd2f2SegjGOElSYvrTlK}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--Avd2f2SegjGOElSYvrTlK--><html lang="en" class="overflow-hidden"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bb3ef058b751a6ad-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/bbd65867698c479b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/9114-abef8471519b7dee.js" async=""></script><script src="/_next/static/chunks/3530-6d8abfd0e950d439.js" async=""></script><script src="/_next/static/chunks/app/layout-44210aade5d56585.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f9f9fb"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111113"/><title>Cockpit</title><meta name="description" content="One seat. One AI. Everything under control."/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Cockpit"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" href="/icons/icon-192x192.png"/><script>
|
|
2
2
|
(function() {
|
|
3
3
|
try {
|
|
4
4
|
var theme = localStorage.getItem('theme') || 'dark';
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
})();
|
|
18
|
-
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2"></div><script src="/_next/static/chunks/webpack-
|
|
18
|
+
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2"></div><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[83599,[\"9114\",\"static/chunks/9114-abef8471519b7dee.js\",\"3530\",\"static/chunks/3530-6d8abfd0e950d439.js\",\"7177\",\"static/chunks/app/layout-44210aade5d56585.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[90484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n:HL[\"/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/bb3ef058b751a6ad-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/bbd65867698c479b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Avd2f2SegjGOElSYvrTlK\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/bbd65867698c479b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"overflow-hidden\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var theme = localStorage.getItem('theme') || 'dark';\\n var resolved = theme;\\n if (theme === 'system') {\\n resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n }\\n document.documentElement.classList.add(resolved);\\n } catch (e) {}\\n // Unregister any leftover Service Workers (PWA has been removed)\\n if ('serviceWorker' in navigator) {\\n navigator.serviceWorker.getRegistrations().then(function(regs) {\\n regs.forEach(function(r) { r.unregister(); });\\n });\\n }\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#f9f9fb\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#111113\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[86869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Cockpit\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"One seat. One AI. Everything under control.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Cockpit\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"link\",\"8\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"$Ld\",\"9\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-
|
|
1
|
+
<!DOCTYPE html><!--Avd2f2SegjGOElSYvrTlK--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Avd2f2SegjGOElSYvrTlK\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"UpwCtxc0N3FrfnzM7K6dS5DzYLdjX5sfDVkj+hwpiQU="}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{24750:(e,t,r)=>{r.d(t,{_:()=>c});var n=r(95155),s=r(12115),l=r(79114),o=r(44810),a=r(38093),i=r(87918);function d(e,t,r){let n=(e,r)=>t[e]||r,s=[],l=null!=r?`[${r+1}] `:"",o=e.anchor.selectedText.length>200?e.anchor.selectedText.slice(0,197)+"...":e.anchor.selectedText;for(let t of(s.push(`${l}${i.A.t("review.quoteRef",{text:o})}`),s.push(i.A.t("review.commentAuthor",{author:n(e.authorId,e.author),content:e.content})),e.replies))s.push(i.A.t("review.replyAuthor",{author:n(t.authorId,t.author),content:t.content}));return s.join("\n")}function c({isOpen:e,onClose:t,comments:r,reviewTitle:c,userNameMap:m,onCommentClick:h}){let{t:x}=(0,l.Bd)(),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)(!1);if(!e)return null;let v=[...r].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),j=(e,t)=>m[e]||t,y=async e=>{f(e.id);try{let t=d(e,m);await navigator.clipboard.writeText(t),(0,a.oR)(x("toast.copiedComment"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{f(null)}},N=async()=>{if(0!==r.length){b(!0);try{let e=function(e,t,r){if(0===e.length)return"";let n=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),s=[i.A.t("review.reviewSummary",{title:t}),""];return n.forEach((e,t)=>{s.push(d(e,r,t)),s.push("")}),s.push(i.A.t("review.totalNComments",{count:e.length})),s.join("\n").trim()}(r,c,m);await navigator.clipboard.writeText(e),(0,a.oR)(x("toast.copiedAllComments"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{b(!1)}}},w=e=>{h?.(e),t()},k=v.filter(e=>!e.closed),C=v.filter(e=>e.closed),L=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:(0,n.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:x("review.allCommentsTitle")}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x("review.commentsCountBrief",{count:r.length}),C.length>0&&` (${x("review.closedCount",{count:C.length})})`]}),r.length>0&&(0,n.jsx)("button",{onClick:N,disabled:g,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:x("review.copyAllComments"),children:g?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===r.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("span",{className:"text-sm",children:x("review.noComments")})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[k.map((e,t)=>(0,n.jsx)(u,{comment:e,index:t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w},e.id)),C.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:x("review.closedComments",{count:C.length})}),C.map((e,t)=>(0,n.jsx)(u,{comment:e,index:k.length+t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w,closed:!0},e.id))]})]})})]})});return(0,n.jsx)(o.Z,{children:L})}function u({comment:e,index:t,resolveAuthor:r,copyingId:s,onCopy:l,onClick:o,closed:a}){let d=e.anchor.selectedText.length>100?e.anchor.selectedText.slice(0,97)+"...":e.anchor.selectedText;return(0,n.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${a?"opacity-50":""}`,onClick:()=>o(e.id),children:[(0,n.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:d})}),(0,n.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:r(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:r(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),a&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,n.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:e.content}),e.replies.length>0&&(0,n.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[e.replies.slice(0,3).map(e=>(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,n.jsx)("span",{className:"font-medium",children:r(e.authorId,e.author)}),": ",e.content]},e.id)),e.replies.length>3&&(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:e.replies.length-3})})]})]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),l(e)},disabled:s===e.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:s===e.id?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},26108:(e,t,r)=>{r.d(t,{T:()=>$});var n=r(95155),s=r(46361),l=r(79204),o=r(98164),a=r(77815),i=r(75035),d=r(88374);r(84559),r(21227);var c=r(91334),u=r(38194),m=r(88522),h=r(12115),x=r(72816),p=r(47650),f=r(79114);let g=null,b=null;async function v(){return g||(b||(b=Promise.all([r.e(221),r.e(8776)]).then(r.bind(r,28776)).then(e=>g=e.default)),b)}function j({code:e,isDark:t}){let{t:r}=(0,f.Bd)(),[s,l]=(0,h.useState)("diagram"),[o,a]=(0,h.useState)(null),[i,d]=(0,h.useState)(null),[x,g]=(0,h.useState)(!1),b=(0,h.useRef)(0);return(0,h.useEffect)(()=>{let r=!1,n=`mermaid-${Math.random().toString(36).slice(2,9)}-${++b.current}`;return async function(){try{let s=await v();s.initialize({startOnLoad:!1,theme:t?"dark":"default",securityLevel:"loose"});let{svg:l}=await s.render(n,e);r||(a(l),d(null))}catch(e){r||(d(e instanceof Error?e.message:String(e)),a(null))}}(),()=>{r=!0}},[e,t]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,n.jsxs)(y,{active:"diagram"===s,onClick:()=>l("diagram"),children:[(0,n.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",r("mermaid.chart")]}),(0,n.jsxs)(y,{active:"code"===s,onClick:()=>l("code"),children:[(0,n.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",r("mermaid.code")]})]}),"diagram"===s?(0,n.jsx)("div",{className:"p-4",children:i?(0,n.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,n.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium mb-1",children:r("mermaid.renderFailed")}),(0,n.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):o?(0,n.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>g(!0),title:r("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:o}}):(0,n.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:r("mermaid.rendering")})}):(0,n.jsx)(c.A,{style:t?u.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:e})]}),x&&o&&(0,p.createPortal)((0,n.jsx)(N,{svgHtml:o,onClose:()=>g(!1)}),document.body)]})}function y({active:e,onClick:t,children:r}){return(0,n.jsx)("button",{onClick:t,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:r})}function N({svgHtml:e,onClose:t}){let{t:r}=(0,f.Bd)();return(0,h.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r("mermaid.mermaidChart")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:r("mermaid.closeEsc"),children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:e}})})]})]})}let w=[l.A,o.A,a.jb],k=[i.A,d.A];function C(e){return e.replace(/^(\|.+\|)$/gm,e=>/^\|[\s:|-]+\|$/.test(e)?e:e.replace(/`([^`]*)`/g,(e,t)=>t.includes("|")?"`"+t.replace(/\|/g,"\\|")+"`":e))}function L(e){return e.replace(/\$(\d)/g,"\\$$1")}function S(e,t){return{code({className:r,children:s,node:l,...o}){let a=/language-(\w+)/.exec(r||""),i=String(s);if(!a&&!r&&!i.includes("\n"))return(0,n.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...o,children:s});let d=String(s).replace(/\n$/,""),h=a?.[1]||"text";if("mermaid"===h&&!t)return(0,n.jsx)(j,{code:d,isDark:e});let x=Number(o["data-source-start"])||0,p=x?x+1:0,f=0;return(0,n.jsx)(c.A,{style:e?u.A:m.A,language:h,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let e=p+f;return f++,{"data-source-start":e,"data-source-end":e,style:{display:"block"}}},children:d})},p:({children:e,node:t,...r})=>(0,n.jsx)("p",{className:"mb-3 last:mb-0",...r,children:e}),h1:({children:e,node:t,...r})=>(0,n.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...r,children:e}),h2:({children:e,node:t,...r})=>(0,n.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...r,children:e}),h3:({children:e,node:t,...r})=>(0,n.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...r,children:e}),ul:({children:e,node:t,...r})=>(0,n.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...r,children:e}),ol:({children:e,node:t,...r})=>(0,n.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...r,children:e}),li:({children:e,node:t,...r})=>(0,n.jsx)("li",{className:"leading-relaxed",...r,children:e}),blockquote:({children:e,node:t,...r})=>(0,n.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...r,children:e}),a:({href:e,children:t,node:r,...s})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...s,children:t}),table:({children:e,node:t,...r})=>(0,n.jsx)("div",{className:"overflow-x-auto my-3",...r,children:(0,n.jsx)("table",{className:"min-w-full border border-border",children:e})}),thead:({children:e,node:t,...r})=>(0,n.jsx)("thead",{className:"bg-accent",...r,children:e}),th:({children:e,node:t,...r})=>(0,n.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...r,children:e}),td:({children:e,node:t,...r})=>(0,n.jsx)("td",{className:"px-4 py-2 border-b border-border",...r,children:e}),hr:({node:e,...t})=>(0,n.jsx)("hr",{className:"my-4 border-border",...t}),img:({src:e,alt:t,node:r,height:s,width:l,style:o,...a})=>{if(!(s||l||o))return(0,n.jsx)("img",{src:e,alt:t||"",className:"max-w-full h-auto rounded-lg my-3",...a});let i=e=>e?/^\d+$/.test(String(e))?`${e}px`:String(e):void 0,d={...o,height:i(s)??o?.height,width:i(l)??o?.width};return(0,n.jsx)("img",{src:e,alt:t||"",style:d,className:"inline-block align-middle",...a})},strong:({children:e,node:t,...r})=>(0,n.jsx)("strong",{className:"font-bold",...r,children:e}),em:({children:e,node:t,...r})=>(0,n.jsx)("em",{className:"italic",...r,children:e}),del:({children:e,node:t,...r})=>(0,n.jsx)("del",{className:"line-through",...r,children:e})}}let $=(0,h.memo)(function({content:e,isUser:t=!1,isStreaming:r=!1,rehypePlugins:l}){let{resolvedTheme:o}=(0,x.D)(),a="dark"===o,i=(0,h.useMemo)(()=>S(a),[a]),d=(0,h.useMemo)(()=>S(a,!0),[a]),c=(0,h.useMemo)(()=>t||r?e:L(C(!function(e){if(/^\|[\s:|-]+\|$/m.test(e))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(e)||/\+[-=]{2,}\+/.test(e))return!0;let t=e.split("\n").filter(e=>/^\s*\||\|\s*$/.test(e));if(t.length>=3){let e=t.map(e=>(e.match(/\|/g)||[]).length);return!e.every(t=>t===e[0])||!(e[0]>=3)}return!1}(e)||/^```[\s\S]*```$/m.test(e.trim())?e:"```text\n"+e.trim()+"\n```")),[e,t,r]),u=(0,h.useMemo)(()=>l?.length?[...k,...l]:k,[l]);if(t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});if(r){let t=e.lastIndexOf("\n");if(-1===t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});let r=e.slice(0,t+1),l=e.slice(t+1);return(0,n.jsxs)("div",{className:"markdown-body",children:[(0,n.jsx)(s.oz,{remarkPlugins:w,rehypePlugins:k,components:d,children:L(C(r))}),l&&(0,n.jsx)("span",{className:"whitespace-pre-wrap",children:l})]})}return(0,n.jsx)("div",{className:"markdown-body",children:(0,n.jsx)(s.oz,{remarkPlugins:w,rehypePlugins:u,components:i,children:c})})})},44810:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(12115),s=r(47650);let l=()=>()=>{},o=()=>document.body,a=()=>null;function i({children:e}){let t=(0,n.useSyncExternalStore)(l,o,a);return t?(0,s.createPortal)(e,t):null}},80777:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(95155),s=r(12115),l=r(47650);function o({content:e,children:t,delay:r=300,className:o=""}){let[a,i]=(0,s.useState)(!1),[d,c]=(0,s.useState)({top:0,left:0}),u=(0,s.useRef)(null),m=(0,s.useRef)({x:0,y:0}),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(a&&h.current){let e=h.current.getBoundingClientRect(),t=d.left,r=d.top;e.right>window.innerWidth-8&&(t=window.innerWidth-e.width-8),e.left<8&&(t=8),e.bottom>window.innerHeight-8&&(r=m.current.y-e.height-8),(t!==d.left||r!==d.top)&&queueMicrotask(()=>c({top:r,left:t}))}},[a,d.left,d.top]),(0,s.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onMouseEnter:()=>{u.current=setTimeout(()=>{let{x:e,y:t}=m.current;c({top:t+12,left:e}),i(!0)},r)},onMouseMove:e=>{m.current={x:e.clientX,y:e.clientY}},onMouseLeave:()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!1)},className:o,children:t}),a&&(0,l.createPortal)((0,n.jsx)("div",{ref:h,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:d.top,left:d.left},children:e}),document.body)]})}},94002:(e,t,r)=>{r.d(t,{l:()=>i});var n=r(95155),s=r(12115),l=r(79114),o=r(80777);let a=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function i({content:e,containerRef:t,width:r="w-80"}){let{t:i}=(0,l.Bd)(),d=(0,s.useMemo)(()=>(function(e){let t=[],r=e.split("\n"),n=!1;for(let e=0;e<r.length;e++){let s=r[e];if(s.trimStart().startsWith("```")){n=!n;continue}if(n)continue;let l=/^(#{1,6})\s+(.+)$/.exec(s);l&&t.push({level:l[1].length,text:l[2].replace(/\s*#+\s*$/,""),sourceLine:e+1})}return t})(e),[e]),[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),x=(0,s.useCallback)(e=>{let r=t.current;if(!r)return;let n=r.querySelector(a(e));n&&n.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return((0,s.useEffect)(()=>{let e=t.current;if(!e||0===d.length)return;let r=()=>{let t=[];for(let r of d){let n=e.querySelector(a(r.sourceLine));if(n){let s=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t.push({line:r.sourceLine,top:s})}}let r=null;for(let e of t)e.top<=60&&(r=e.line);null===r&&t.length>0&&(r=t[0].line),h(r)},n=setTimeout(r,150);return e.addEventListener("scroll",r,{passive:!0}),()=>{clearTimeout(n),e.removeEventListener("scroll",r)}},[d,e,t]),0===d.length)?null:(0,n.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${c?"w-8":r}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!c&&(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("editor.toc")}),(0,n.jsx)("button",{onClick:()=>u(e=>!e),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:i(c?"editor.expandToc":"editor.collapseToc"),children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!c&&(0,n.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:d.map((e,t)=>(0,n.jsx)(o.m,{content:e.text,delay:400,children:(0,n.jsx)("button",{onClick:()=>x(e.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${m===e.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(e.level-1)*12+8}px`},children:e.text})},t))})]})}},95766:(e,t,r)=>{r.d(t,{W:()=>l});var n=r(48250);let s=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function l(){return e=>{(0,n.YR)(e,"element",e=>{if(s.has(e.tagName)&&e.position&&(e.properties||(e.properties={}),e.properties["data-source-start"]=e.position.start.line,e.properties["data-source-end"]=e.position.end.line,"pre"===e.tagName)){let t=e.children?.find(e=>"element"===e.type&&"code"===e.tagName);t&&(t.properties||(t.properties={}),t.properties["data-source-start"]=e.position.start.line,t.properties["data-source-end"]=e.position.end.line)}})}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{24750:(e,t,r)=>{r.d(t,{_:()=>c});var n=r(95155),s=r(12115),l=r(79114),o=r(44810),a=r(38093),i=r(87918);function d(e,t,r){let n=(e,r)=>t[e]||r,s=[],l=null!=r?`[${r+1}] `:"",o=e.anchor.selectedText.length>200?e.anchor.selectedText.slice(0,197)+"...":e.anchor.selectedText;for(let t of(s.push(`${l}${i.A.t("review.quoteRef",{text:o})}`),s.push(i.A.t("review.commentAuthor",{author:n(e.authorId,e.author),content:e.content})),e.replies))s.push(i.A.t("review.replyAuthor",{author:n(t.authorId,t.author),content:t.content}));return s.join("\n")}function c({isOpen:e,onClose:t,comments:r,reviewTitle:c,userNameMap:m,onCommentClick:h}){let{t:x}=(0,l.Bd)(),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)(!1);if(!e)return null;let v=[...r].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),j=(e,t)=>m[e]||t,y=async e=>{f(e.id);try{let t=d(e,m);await navigator.clipboard.writeText(t),(0,a.oR)(x("toast.copiedComment"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{f(null)}},N=async()=>{if(0!==r.length){b(!0);try{let e=function(e,t,r){if(0===e.length)return"";let n=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),s=[i.A.t("review.reviewSummary",{title:t}),""];return n.forEach((e,t)=>{s.push(d(e,r,t)),s.push("")}),s.push(i.A.t("review.totalNComments",{count:e.length})),s.join("\n").trim()}(r,c,m);await navigator.clipboard.writeText(e),(0,a.oR)(x("toast.copiedAllComments"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{b(!1)}}},w=e=>{h?.(e),t()},k=v.filter(e=>!e.closed),C=v.filter(e=>e.closed),L=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:(0,n.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:x("review.allCommentsTitle")}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x("review.commentsCountBrief",{count:r.length}),C.length>0&&` (${x("review.closedCount",{count:C.length})})`]}),r.length>0&&(0,n.jsx)("button",{onClick:N,disabled:g,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:x("review.copyAllComments"),children:g?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===r.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("span",{className:"text-sm",children:x("review.noComments")})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[k.map((e,t)=>(0,n.jsx)(u,{comment:e,index:t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w},e.id)),C.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:x("review.closedComments",{count:C.length})}),C.map((e,t)=>(0,n.jsx)(u,{comment:e,index:k.length+t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w,closed:!0},e.id))]})]})})]})});return(0,n.jsx)(o.Z,{children:L})}function u({comment:e,index:t,resolveAuthor:r,copyingId:s,onCopy:l,onClick:o,closed:a}){let d=e.anchor.selectedText.length>100?e.anchor.selectedText.slice(0,97)+"...":e.anchor.selectedText;return(0,n.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${a?"opacity-50":""}`,onClick:()=>o(e.id),children:[(0,n.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:d})}),(0,n.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:r(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:r(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),a&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,n.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:e.content}),e.replies.length>0&&(0,n.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[e.replies.slice(0,3).map(e=>(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,n.jsx)("span",{className:"font-medium",children:r(e.authorId,e.author)}),": ",e.content]},e.id)),e.replies.length>3&&(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:e.replies.length-3})})]})]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),l(e)},disabled:s===e.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:s===e.id?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},26108:(e,t,r)=>{r.d(t,{T:()=>T});var n=r(95155),s=r(46361),l=r(79204),o=r(98164),a=r(77815),i=r(75035),d=r(88374);r(84559),r(21227);var c=r(91334),u=r(38194),m=r(88522),h=r(12115),x=r(72816),p=r(47650),f=r(79114);let g=null,b=null;async function v(){return g||(b||(b=Promise.all([r.e(221),r.e(8776)]).then(r.bind(r,28776)).then(e=>g=e.default)),b)}function j({code:e,isDark:t}){let{t:r}=(0,f.Bd)(),[s,l]=(0,h.useState)("diagram"),[o,a]=(0,h.useState)(null),[i,d]=(0,h.useState)(null),[x,g]=(0,h.useState)(!1),b=(0,h.useRef)(0);return(0,h.useEffect)(()=>{let r=!1,n=`mermaid-${Math.random().toString(36).slice(2,9)}-${++b.current}`;return async function(){try{let s=await v();s.initialize({startOnLoad:!1,theme:t?"dark":"default",securityLevel:"loose"});let{svg:l}=await s.render(n,e);r||(a(l),d(null))}catch(e){r||(d(e instanceof Error?e.message:String(e)),a(null))}}(),()=>{r=!0}},[e,t]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,n.jsxs)(y,{active:"diagram"===s,onClick:()=>l("diagram"),children:[(0,n.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",r("mermaid.chart")]}),(0,n.jsxs)(y,{active:"code"===s,onClick:()=>l("code"),children:[(0,n.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",r("mermaid.code")]})]}),"diagram"===s?(0,n.jsx)("div",{className:"p-4",children:i?(0,n.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,n.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium mb-1",children:r("mermaid.renderFailed")}),(0,n.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):o?(0,n.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>g(!0),title:r("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:o}}):(0,n.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:r("mermaid.rendering")})}):(0,n.jsx)(c.A,{style:t?u.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:e})]}),x&&o&&(0,p.createPortal)((0,n.jsx)(N,{svgHtml:o,onClose:()=>g(!1)}),document.body)]})}function y({active:e,onClick:t,children:r}){return(0,n.jsx)("button",{onClick:t,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:r})}function N({svgHtml:e,onClose:t}){let{t:r}=(0,f.Bd)();return(0,h.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r("mermaid.mermaidChart")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:r("mermaid.closeEsc"),children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:e}})})]})]})}let w=[l.A,o.A,a.jb],k=[l.A,a.jb],C=[i.A,d.A],L=[i.A];function S(e){return e.replace(/^(\|.+\|)$/gm,e=>/^\|[\s:|-]+\|$/.test(e)?e:e.replace(/`([^`]*)`/g,(e,t)=>t.includes("|")?"`"+t.replace(/\|/g,"\\|")+"`":e))}function $(e){return e.replace(/\$(\d)/g,"\\$$1")}function A(e,t){return{code({className:r,children:s,node:l,...o}){let a=/language-(\w+)/.exec(r||""),i=String(s);if(!a&&!r&&!i.includes("\n"))return(0,n.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...o,children:s});let d=String(s).replace(/\n$/,""),h=a?.[1]||"text";if("mermaid"===h&&!t)return(0,n.jsx)(j,{code:d,isDark:e});let x=Number(o["data-source-start"])||0,p=x?x+1:0,f=0;return(0,n.jsx)(c.A,{style:e?u.A:m.A,language:h,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let e=p+f;return f++,{"data-source-start":e,"data-source-end":e,style:{display:"block"}}},children:d})},p:({children:e,node:t,...r})=>(0,n.jsx)("p",{className:"mb-3 last:mb-0",...r,children:e}),h1:({children:e,node:t,...r})=>(0,n.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...r,children:e}),h2:({children:e,node:t,...r})=>(0,n.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...r,children:e}),h3:({children:e,node:t,...r})=>(0,n.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...r,children:e}),ul:({children:e,node:t,...r})=>(0,n.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...r,children:e}),ol:({children:e,node:t,...r})=>(0,n.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...r,children:e}),li:({children:e,node:t,...r})=>(0,n.jsx)("li",{className:"leading-relaxed",...r,children:e}),blockquote:({children:e,node:t,...r})=>(0,n.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...r,children:e}),a:({href:e,children:t,node:r,...s})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...s,children:t}),table:({children:e,node:t,...r})=>(0,n.jsx)("div",{className:"overflow-x-auto my-3",...r,children:(0,n.jsx)("table",{className:"min-w-full border border-border",children:e})}),thead:({children:e,node:t,...r})=>(0,n.jsx)("thead",{className:"bg-accent",...r,children:e}),th:({children:e,node:t,...r})=>(0,n.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...r,children:e}),td:({children:e,node:t,...r})=>(0,n.jsx)("td",{className:"px-4 py-2 border-b border-border",...r,children:e}),hr:({node:e,...t})=>(0,n.jsx)("hr",{className:"my-4 border-border",...t}),img:({src:e,alt:t,node:r,height:s,width:l,style:o,...a})=>{if(!(s||l||o))return(0,n.jsx)("img",{src:e,alt:t||"",className:"max-w-full h-auto rounded-lg my-3",...a});let i=e=>e?/^\d+$/.test(String(e))?`${e}px`:String(e):void 0,d={...o,height:i(s)??o?.height,width:i(l)??o?.width};return(0,n.jsx)("img",{src:e,alt:t||"",style:d,className:"inline-block align-middle",...a})},strong:({children:e,node:t,...r})=>(0,n.jsx)("strong",{className:"font-bold",...r,children:e}),em:({children:e,node:t,...r})=>(0,n.jsx)("em",{className:"italic",...r,children:e}),del:({children:e,node:t,...r})=>(0,n.jsx)("del",{className:"line-through",...r,children:e})}}let T=(0,h.memo)(function({content:e,isUser:t=!1,isStreaming:r=!1,enableMath:l=!0,rehypePlugins:o}){let{resolvedTheme:a}=(0,x.D)(),i="dark"===a,d=(0,h.useMemo)(()=>A(i),[i]),c=(0,h.useMemo)(()=>A(i,!0),[i]),u=l?w:k,m=l?C:L,p=(0,h.useMemo)(()=>{if(t||r)return e;let n=S(!function(e){if(/^\|[\s:|-]+\|$/m.test(e))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(e)||/\+[-=]{2,}\+/.test(e))return!0;let t=e.split("\n").filter(e=>/^\s*\||\|\s*$/.test(e));if(t.length>=3){let e=t.map(e=>(e.match(/\|/g)||[]).length);return!e.every(t=>t===e[0])||!(e[0]>=3)}return!1}(e)||/^```[\s\S]*```$/m.test(e.trim())?e:"```text\n"+e.trim()+"\n```");return l?$(n):n},[e,t,r,l]),f=(0,h.useMemo)(()=>o?.length?[...m,...o]:m,[o,m]);if(t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});if(r){let t=e.lastIndexOf("\n");if(-1===t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});let r=e.slice(0,t+1),o=e.slice(t+1);return(0,n.jsxs)("div",{className:"markdown-body",children:[(0,n.jsx)(s.oz,{remarkPlugins:u,rehypePlugins:m,components:c,children:l?$(S(r)):S(r)}),o&&(0,n.jsx)("span",{className:"whitespace-pre-wrap",children:o})]})}return(0,n.jsx)("div",{className:"markdown-body",children:(0,n.jsx)(s.oz,{remarkPlugins:u,rehypePlugins:f,components:d,children:p})})})},44810:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(12115),s=r(47650);let l=()=>()=>{},o=()=>document.body,a=()=>null;function i({children:e}){let t=(0,n.useSyncExternalStore)(l,o,a);return t?(0,s.createPortal)(e,t):null}},80777:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(95155),s=r(12115),l=r(47650);function o({content:e,children:t,delay:r=300,className:o=""}){let[a,i]=(0,s.useState)(!1),[d,c]=(0,s.useState)({top:0,left:0}),u=(0,s.useRef)(null),m=(0,s.useRef)({x:0,y:0}),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(a&&h.current){let e=h.current.getBoundingClientRect(),t=d.left,r=d.top;e.right>window.innerWidth-8&&(t=window.innerWidth-e.width-8),e.left<8&&(t=8),e.bottom>window.innerHeight-8&&(r=m.current.y-e.height-8),(t!==d.left||r!==d.top)&&queueMicrotask(()=>c({top:r,left:t}))}},[a,d.left,d.top]),(0,s.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onMouseEnter:()=>{u.current=setTimeout(()=>{let{x:e,y:t}=m.current;c({top:t+12,left:e}),i(!0)},r)},onMouseMove:e=>{m.current={x:e.clientX,y:e.clientY}},onMouseLeave:()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!1)},className:o,children:t}),a&&(0,l.createPortal)((0,n.jsx)("div",{ref:h,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:d.top,left:d.left},children:e}),document.body)]})}},94002:(e,t,r)=>{r.d(t,{l:()=>i});var n=r(95155),s=r(12115),l=r(79114),o=r(80777);let a=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function i({content:e,containerRef:t,width:r="w-80"}){let{t:i}=(0,l.Bd)(),d=(0,s.useMemo)(()=>(function(e){let t=[],r=e.split("\n"),n=!1;for(let e=0;e<r.length;e++){let s=r[e];if(s.trimStart().startsWith("```")){n=!n;continue}if(n)continue;let l=/^(#{1,6})\s+(.+)$/.exec(s);l&&t.push({level:l[1].length,text:l[2].replace(/\s*#+\s*$/,""),sourceLine:e+1})}return t})(e),[e]),[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),x=(0,s.useCallback)(e=>{let r=t.current;if(!r)return;let n=r.querySelector(a(e));n&&n.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return((0,s.useEffect)(()=>{let e=t.current;if(!e||0===d.length)return;let r=()=>{let t=[];for(let r of d){let n=e.querySelector(a(r.sourceLine));if(n){let s=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t.push({line:r.sourceLine,top:s})}}let r=null;for(let e of t)e.top<=60&&(r=e.line);null===r&&t.length>0&&(r=t[0].line),h(r)},n=setTimeout(r,150);return e.addEventListener("scroll",r,{passive:!0}),()=>{clearTimeout(n),e.removeEventListener("scroll",r)}},[d,e,t]),0===d.length)?null:(0,n.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${c?"w-8":r}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!c&&(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("editor.toc")}),(0,n.jsx)("button",{onClick:()=>u(e=>!e),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:i(c?"editor.expandToc":"editor.collapseToc"),children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!c&&(0,n.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:d.map((e,t)=>(0,n.jsx)(o.m,{content:e.text,delay:400,children:(0,n.jsx)("button",{onClick:()=>x(e.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${m===e.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(e.level-1)*12+8}px`},children:e.text})},t))})]})}},95766:(e,t,r)=>{r.d(t,{W:()=>l});var n=r(48250);let s=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function l(){return e=>{(0,n.YR)(e,"element",e=>{if(s.has(e.tagName)&&e.position&&(e.properties||(e.properties={}),e.properties["data-source-start"]=e.position.start.line,e.properties["data-source-end"]=e.position.end.line,"pre"===e.tagName)){let t=e.children?.find(e=>"element"===e.type&&"code"===e.tagName);t&&(t.properties||(t.properties={}),t.properties["data-source-start"]=e.position.start.line,t.properties["data-source-end"]=e.position.end.line)}})}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5493],{10611:(e,t,s)=>{s.d(t,{G:()=>u,f:()=>h});var n=s(12115);function r(){if("u"<typeof document)return null;let e=document.querySelector('meta[name="cockpit-bridge"]');if(!e)return null;let t=e.dataset.id,s=e.dataset.version;return t?{id:t,version:s||"unknown"}:null}let a=null,o=new Set;function l(){o.forEach(e=>e())}function i(e){o.add(e);let t=r();return t&&!a&&(a=t,Promise.resolve().then(l)),()=>{o.delete(e)}}function d(){return a}function c(){return null}if("u">typeof document&&(a=r()),"u">typeof MutationObserver&&"u">typeof document){let e=new MutationObserver(()=>{let e=r();e&&(!a||e.id!==a.id||e.version!==a.version)&&(a=e,l())}),t=document.head||document.documentElement;t&&e.observe(t,{childList:!0})}function u(){return(0,n.useSyncExternalStore)(i,d,c)}function h(){return a??r()}},18658:(e,t,s)=>{s.d(t,{n:()=>o});var n=s(12115);let r="SCHEDULED_TASKS_CHANGED";function a(){try{window.parent.postMessage({type:r},"*")}catch{}document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow?.postMessage({type:r},"*")}catch{}})}function o(){let[e,t]=(0,n.useState)([]),[s,o]=(0,n.useState)(0),l=(0,n.useCallback)(()=>{fetch("/api/scheduled-tasks").then(e=>e.json()).then(e=>{t(e.tasks||[]),o(e.unreadCount||0)}).catch(()=>{})},[]);(0,n.useEffect)(()=>{l()},[l]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type===r&&l()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[l]);let i=(0,n.useCallback)(async e=>{try{let t=await fetch("/api/scheduled-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(s.task)return l(),a(),s.task;return null}catch{return null}},[l]),d=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"pause"})}).catch(()=>{}),l(),a()},[l]),c=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"resume"})}).catch(()=>{}),l(),a()},[l]),u=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}).catch(()=>{}),l(),a()},[l]),h=(0,n.useCallback)(async(e,t)=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"update",fields:t})}).catch(()=>{}),l(),a()},[l]),m=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"trigger"})}).catch(()=>{}),l(),a()},[l]),x=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"markRead"})}).catch(()=>{}),l(),a()},[l]),f=(0,n.useCallback)(async()=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"markAllRead"})}).catch(()=>{}),l(),a()},[l]),p=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"reorder",fields:{orderedIds:e}})}).catch(()=>{}),l(),a()},[l]);return{tasks:e,unreadCount:s,reload:l,createTask:i,pauseTask:d,resumeTask:c,triggerTask:m,deleteTask:u,updateTask:h,markRead:x,markAllRead:f,reorderTasks:p}}},22552:(e,t,s)=>{s.d(t,{h:()=>a});var n=s(12115);let r=new Map;function a({url:e,onMessage:t,enabled:s=!0}){let a=(0,n.useRef)(t);(0,n.useEffect)(()=>{a.current=t}),(0,n.useEffect)(()=>{if(!s)return;let t=e=>a.current(e),n=function(e){let t=r.get(e);if(t)return t;let s={ws:null,listeners:new Set,retryCount:0,retryTimer:null,connect(){let t="https:"===window.location.protocol?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}${e}`);n.onopen=()=>{s.retryCount=0},n.onmessage=e=>{try{let t=JSON.parse(e.data);if("ping"===t.type)return;s.listeners.forEach(e=>e(t))}catch{}},n.onclose=()=>{if(0===s.listeners.size)return;let e=Math.min(1e3*Math.pow(1.5,s.retryCount),1e4);s.retryCount++,s.retryTimer=setTimeout(()=>s.connect(),e)},n.onerror=()=>{},s.ws=n},destroy(){s.retryTimer&&clearTimeout(s.retryTimer),s.ws&&s.ws.close(),s.ws=null,r.delete(e)}};return r.set(e,s),s.connect(),s}(e);return n.listeners.add(t),()=>{n.listeners.delete(t),0===n.listeners.size&&n.destroy()}},[e,s])}},28147:(e,t,s)=>{s.d(t,{E:()=>d});var n=s(95155),r=s(12115),a=s(79114),o=s(87918),l=s(72588);let i={once:[{labelKey:"scheduledTasks.5minLater",value:5},{labelKey:"scheduledTasks.15minLater",value:15},{labelKey:"scheduledTasks.30minLater",value:30},{labelKey:"scheduledTasks.1hourLater",value:60}],interval:[{labelKey:"scheduledTasks.every15min",value:15},{labelKey:"scheduledTasks.every30min",value:30},{labelKey:"scheduledTasks.every1hour",value:60},{labelKey:"scheduledTasks.every2hours",value:120}],cron:[{labelKey:"scheduledTasks.daily9am",value:"0 9 * * *"},{labelKey:"scheduledTasks.daily6pm",value:"0 18 * * *"},{labelKey:"scheduledTasks.weeklyMon9am",value:"0 9 * * 1"},{labelKey:"scheduledTasks.monthly1st9am",value:"0 9 1 * *"}]};function d({onClose:e,onCreate:t,editTask:s,onUpdate:d}){let{t:c}=(0,a.Bd)(),u=!!s,[h,m]=(0,r.useState)(s?.type||"once"),[x,f]=(0,r.useState)(s?.message||""),[p,g]=(0,r.useState)(s?String(s.delayMinutes||s.intervalMinutes||""):""),[b,v]=(0,r.useState)(s?.cron||""),[y,j]=(0,r.useState)(s?.activeFrom||"09:00"),[k,N]=(0,r.useState)(s?.activeTo||"18:00"),[w,C]=(0,r.useState)(!!(s?.activeFrom&&s?.activeTo)),[T,S]=(0,r.useState)(null),E=(0,r.useRef)(null),P=(0,r.useRef)(null);(0,r.useEffect)(()=>{P.current?.focus()},[]),(0,r.useEffect)(()=>{let t=t=>{E.current&&!E.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]);let L=(0,r.useCallback)(()=>{if(!x.trim())return;let n=null;if("once"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"once",delayMinutes:e}}else if("interval"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"interval",intervalMinutes:e,...w?{activeFrom:y,activeTo:k}:{}}}else if("cron"===h){let e=T||b.trim();if(!e)return;n={message:x.trim(),type:"cron",cron:e}}n&&(u&&s&&d?d(s.id,n):t(n),e())},[x,h,T,p,b,w,y,k,t,e,u,s,d]);return(0,n.jsxs)("div",{ref:E,className:`w-80 bg-popover border border-border rounded-lg shadow-lg z-50 ${u?"":"absolute bottom-full left-0 mb-2"}`,onKeyDown:t=>{"Escape"===t.key?e():"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&L()},children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 rounded-t-lg",children:(0,n.jsx)("span",{className:"text-sm font-medium",children:u?c("scheduledTasks.editTask"):c("scheduledTasks.createTask")})}),(0,n.jsxs)("div",{className:"p-3 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.sendMessage")}),(0,n.jsx)("textarea",{ref:P,value:x,onChange:e=>f(e.target.value),placeholder:c("scheduledTasks.messagePlaceholder"),rows:2,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.type")}),(0,n.jsx)("div",{className:"flex gap-1",children:["once","interval","cron"].map(e=>(0,n.jsx)("button",{onClick:()=>{m(e),S(null),g(""),v("")},className:`flex-1 px-2 py-1 text-xs rounded transition-colors ${h===e?"bg-brand text-white":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"once"===e?c("scheduledTasks.once"):"interval"===e?c("scheduledTasks.interval"):"Cron"},e))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.quickSelect")}),(0,n.jsx)("div",{className:"grid grid-cols-2 gap-1",children:i[h].map(e=>(0,n.jsx)("button",{onClick:()=>{S(e.value),"cron"===h?v(String(e.value)):g(String(e.value))},className:`px-2 py-1 text-xs rounded border transition-colors ${T===e.value?"border-brand bg-brand/10 text-brand":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:c(e.labelKey)},e.labelKey))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:"cron"===h?c("scheduledTasks.customCron"):c("scheduledTasks.customMinutes")}),"cron"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"text",value:b,onChange:e=>{v(e.target.value),S(null)},placeholder:c("scheduledTasks.cronPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring font-mono"}),b.trim()&&(0,n.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:function(e){let t=o.A.t,s=e.trim().split(/\s+/);if(5!==s.length)return null;let[n,r,a,l,i]=s,d={0:t("cron.dowSun"),1:t("cron.dowMon"),2:t("cron.dowTue"),3:t("cron.dowWed"),4:t("cron.dowThu"),5:t("cron.dowFri"),6:t("cron.dowSat")},c={1:`1${t("cron.monthPrefix")}`,2:`2${t("cron.monthPrefix")}`,3:`3${t("cron.monthPrefix")}`,4:`4${t("cron.monthPrefix")}`,5:`5${t("cron.monthPrefix")}`,6:`6${t("cron.monthPrefix")}`,7:`7${t("cron.monthPrefix")}`,8:`8${t("cron.monthPrefix")}`,9:`9${t("cron.monthPrefix")}`,10:`10${t("cron.monthPrefix")}`,11:`11${t("cron.monthPrefix")}`,12:`12${t("cron.monthPrefix")}`};try{let e="";if(n.includes("/")||r.includes("/")){if("*"===r&&n.includes("/"))return t("cron.everyNMinutes",{n:n.split("/")[1]});if("0"===n&&r.includes("/"))return t("cron.everyNHours",{n:r.split("/")[1]});return null}let s=parseInt(r,10),o=parseInt(n,10);if(isNaN(s)&&"*"!==r||isNaN(o)&&"*"!==n)return null;e="*"===r&&"*"===n?t("cron.everyMinute"):"*"===r?t("cron.everyHourAtMin",{m:o}):"*"===n?t("cron.hourlyEveryMin",{h:s}):`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`;let u=[];if("*"!==l){let e=l.split(",").map(e=>c[e]||`${e}${t("cron.monthPrefix")}`);u.push(e.join(", "))}if("*"!==a)if(a.includes("-")){let[e,s]=a.split("-");u.push(t("cron.dayRange",{a:e,b:s}))}else a.includes(",")?u.push(a.split(",").map(e=>`${e}${t("cron.dayOfMonth")}`).join(", ")):u.push(`${a}${t("cron.dayOfMonth")}`);if("*"!==i)if("1-5"===i)u.push(t("cron.weekdays"));else if("0,6"===i||"6,0"===i)u.push(t("cron.weekends"));else{let e=i.split(",").map(e=>{if(e.includes("-")){let[s,n]=e.split("-");return t("cron.weekdayRange",{a:d[s]||s,b:d[n]||n})}return`${t("cron.weekdayPrefix")}${d[e]||e}`});u.push(e.join(", "))}if(0===u.length&&"*"===a&&"*"===l&&"*"===i)return t("cron.daily",{time:e});return`${u.join(" ")} ${e}`}catch{return null}}(b.trim())||(0,n.jsx)("span",{className:"text-destructive",children:c("scheduledTasks.cronFormat")})})]}):(0,n.jsx)("input",{type:"number",value:p,onChange:e=>{g(e.target.value),S(null)},placeholder:c("scheduledTasks.minutesPlaceholder"),min:1,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),"interval"===h&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1 cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:w,onChange:e=>C(e.target.checked),className:"rounded border-border"}),c("scheduledTasks.limitTimeRange")]}),w&&(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,n.jsx)("input",{type:"time",value:y,onChange:e=>j(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:c("scheduledTasks.to")}),(0,n.jsx)("input",{type:"time",value:k,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),(0,n.jsx)("button",{onClick:L,disabled:!(x.trim()&&("once"===h||"interval"===h?!!(T||p&&parseInt(p,10)>0):"cron"===h&&!!(T||b.trim()))),className:"w-full py-1.5 text-sm font-medium rounded bg-brand text-white hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?c("scheduledTasks.saveBtn",{modKey:(0,l.Mu)()}):c("scheduledTasks.createBtn",{modKey:(0,l.Mu)()})})]})]})}},31914:(e,t,s)=>{s.d(t,{b:()=>c});var n=s(95155),r=s(12115),a=s(79114),o=s(72816),l=s(38093),i=s(72588),d=s(10611);function c({isOpen:e,onClose:t}){let{t:s,i18n:c}=(0,a.Bd)(),{theme:u,setTheme:h}=(0,o.D)(),m=(0,d.G)(),[x,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[b,v]=(0,r.useState)("auto");(0,r.useEffect)(()=>{e&&fetch("/api/settings").then(e=>e.json()).then(e=>{e.language&&v(e.language)}).catch(()=>{})},[e]);let y=(0,r.useCallback)(e=>{v(e),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})}).catch(()=>{});let t="auto"===e?navigator.language.startsWith("zh")?"zh":"en":e;c.changeLanguage(t)},[c]),j=m?"installed":"not-installed",k=m?.version??null;if((0,r.useEffect)(()=>{e&&fetch("/api/version").then(e=>e.json()).then(e=>{e.version&&g(e.version)}).catch(()=>{})},[e]),(0,r.useEffect)(()=>{e&&fetch("/api/extension/version").then(e=>e.json()).then(e=>{e.path&&f(e.path)}).catch(()=>{})},[e]),!e)return null;let N=[{value:"system",label:s("settings.themeSystem"),icon:"\uD83D\uDCBB"},{value:"light",label:s("settings.themeLight"),icon:"☀️"},{value:"dark",label:s("settings.themeDark"),icon:"\uD83C\uDF19"}];return(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:s("settings.title")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"p-4 space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.theme")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:N.map(e=>(0,n.jsxs)("button",{onClick:()=>h(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${u===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.language")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"auto",label:s("settings.languageAuto"),icon:"\uD83C\uDF10"},{value:"en",label:"English",icon:"\uD83C\uDDFA\uD83C\uDDF8"},{value:"zh",label:"中文",icon:"\uD83C\uDDE8\uD83C\uDDF3"}].map(e=>(0,n.jsxs)("button",{onClick:()=>y(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${b===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.browserExtension")}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:`inline-block w-2 h-2 rounded-full flex-shrink-0 ${"installed"===j?"bg-green-500":"bg-slate-400"}`}),(0,n.jsxs)("span",{children:["installed"===j&&`${s("settings.extensionInstalled")}${k?` (v${k})`:""}`,"not-installed"===j&&s("settings.extensionNotInstalled")]})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s("settings.extensionDescription")}),"installed"!==j&&(0,n.jsxs)("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded-md p-2 space-y-1",children:[(0,n.jsx)("p",{className:"font-medium text-foreground",children:s("settings.installSteps")}),(0,n.jsxs)("p",{children:[s("settings.step1")," ",(0,n.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-foreground",children:"chrome://extensions"})]}),(0,n.jsx)("p",{children:s("settings.step2")}),(0,n.jsx)("p",{children:s("settings.step3")}),(0,i.L)()&&(0,n.jsx)("p",{dangerouslySetInnerHTML:{__html:s("settings.step4mac")}})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{onClick:()=>{let e=x||"chrome-extension";navigator.clipboard.writeText(e),(0,l.oR)(s("toast.copiedName",{name:e}))},className:"px-3 py-1.5 text-xs bg-brand text-white rounded-md hover:bg-brand/90 transition-colors",children:s("settings.copyExtensionPath")}),"installed"===j&&(0,n.jsx)("button",{onClick:()=>{m?.id&&window.chrome?.runtime?.sendMessage&&(window.chrome.runtime.sendMessage(m.id,{type:"reload"}),(0,l.oR)(s("toast.pluginReloading")))},className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-muted transition-colors",children:s("settings.reloadExtension")})]}),x&&(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:x})]})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.about")}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,n.jsxs)("p",{children:["Cockpit",p?` v${p}`:""]}),(0,n.jsx)("p",{className:"text-muted-foreground/60",children:"One seat. One AI. Everything under control."})]})]})]})]})]})}},36998:(e,t,s)=>{s.d(t,{P:()=>r});var n=s(12115);function r(){let[e,t]=(0,n.useState)([]),s=(0,n.useCallback)(()=>{fetch("/api/pinned-sessions").then(e=>e.json()).then(e=>t(e.sessions||[])).catch(()=>{})},[]);(0,n.useEffect)(()=>{s()},[s]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type==="PINNED_SESSIONS_CHANGED"&&s()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[s]);let r=(0,n.useCallback)(e=>{t(e),fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:e})}).catch(()=>{});try{window.parent.postMessage({type:"PINNED_SESSIONS_CHANGED"},"*")}catch{}},[]),a=(0,n.useCallback)(t=>e.some(e=>e.sessionId===t),[e]),o=(0,n.useCallback)((t,s,n)=>{e.some(e=>e.sessionId===t)||r([...e,{sessionId:t,cwd:s,customTitle:n}])},[e,r]),l=(0,n.useCallback)(t=>{r(e.filter(e=>e.sessionId!==t))},[e,r]),i=(0,n.useCallback)((t,s)=>{r(e.map(e=>e.sessionId===t?{...e,customTitle:s}:e))},[e,r]);return{pinnedSessions:e,isPinned:a,pinSession:o,unpinSession:l,updateTitle:i,reorder:(0,n.useCallback)(e=>{r(e)},[r]),reload:s}}},72588:(e,t,s)=>{s.d(t,{L:()=>r,Mu:()=>a});var n=s(41463);function r(){return!("u"<typeof navigator)&&(/Mac|iPhone|iPad/.test(navigator.platform||"")||navigator.userAgentData?.platform==="macOS")}function a(){return r()?"⌘":"Ctrl+"}n.platform,n.platform,n.platform},97440:(e,t,s)=>{s.d(t,{r:()=>o});var n=s(95155),r=s(12115),a=s(79114);function o({isOpen:e,onClose:t,onSelectSession:s,onAddProject:o}){let{t:l}=(0,a.Bd)(),[i,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)([]),[h,m]=(0,r.useState)({}),[x,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),y=(0,r.useRef)(null),j=(0,r.useCallback)(async()=>{f(!0),g(null),m({});try{let e=await fetch("/api/sessions/projects");if(!e.ok)throw Error("Failed to load projects");let t=await e.json();u(t)}catch(e){g(e instanceof Error?e.message:"Unknown error")}finally{f(!1)}},[]),k=(0,r.useCallback)(async e=>{m(t=>({...t,[e]:{...t[e],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let t=await fetch(`/api/sessions/projects/${encodeURIComponent(e)}`);if(!t.ok)throw Error("Failed to load sessions");let s=await t.json();m(t=>({...t,[e]:{...t[e],isLoading:!1,sessions:s}}))}catch(t){m(s=>({...s,[e]:{...s[e],isLoading:!1,error:t instanceof Error?t.message:"Unknown error"}}))}},[]),N=(0,r.useCallback)(e=>{let t=h[e];t?.isExpanded?m(t=>({...t,[e]:{...t[e],isExpanded:!1}})):t?.sessions?.length?m(t=>({...t,[e]:{...t[e],isExpanded:!0}})):k(e)},[h,k]);(0,r.useEffect)(()=>{e&&(j(),setTimeout(()=>{y.current?.focus()},100))},[e,j]);let w=(0,r.useCallback)(async()=>{if(!i){d(!0);try{let e=await fetch("/api/pick-folder"),s=await e.json();s.folder&&o&&(o(s.folder),t())}catch{}finally{d(!1)}}},[i,o,t]);return((0,r.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),e)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),(0,n.jsxs)("div",{className:"relative w-full max-w-6xl h-[90vh] mx-4 bg-card rounded-lg shadow-xl flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:l("sessions.projectList")}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("input",{ref:y,type:"text",placeholder:l("workspace.searchProjectPath"),value:b,onChange:e=>v(e.target.value),className:"px-2 py-1 text-xs border border-border rounded bg-card text-foreground placeholder-slate-9 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),o&&(0,n.jsxs)("button",{onClick:w,disabled:i,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",title:l("sessions.openFolder"),children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),i?l("sessions.selectingFolder"):l("sessions.openFolder")]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-slate-9 hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[x&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("workspace.loadingProjects")})]})}),p&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-red-11",children:p})}),!x&&!p&&0===c.length&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("workspace.projectNotFound")})}),!x&&!p&&c.filter(e=>e.fullPath.toLowerCase().includes(b.toLowerCase())).map(e=>{let t=h[e.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsxs)("button",{onClick:()=>N(e.encodedPath),className:"w-full flex items-center gap-2 p-2 rounded hover:bg-accent transition-colors text-left",children:[(0,n.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${t.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,n.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,n.jsx)("span",{className:"flex-1 text-xs font-medium text-foreground truncate",title:e.fullPath,children:e.fullPath}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.sessionCount,")"]})]}),t.isExpanded&&(0,n.jsxs)("div",{className:"ml-6 mt-2",children:[t.isLoading&&(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("sessions.loadingSessions")})]}),t.error&&(0,n.jsx)("div",{className:"p-3 text-xs text-red-11",children:t.error}),!t.isLoading&&!t.error&&(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:t.sessions.map(t=>(0,n.jsxs)("div",{onClick:()=>{var n;let r;return n=e.fullPath,r=(t.path.split("/").pop()||"").replace(".jsonl",""),void(s?s(n,r):window.parent.postMessage({type:"OPEN_PROJECT",cwd:n,sessionId:r},"*"))},className:"p-3 bg-secondary rounded border border-border hover:border-brand hover:shadow-md cursor-pointer transition-all",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[t.engine&&"claude"!==t.engine&&(0,n.jsx)("span",{className:`shrink-0 px-1 py-0.5 text-[10px] leading-none font-medium rounded ${"claude2"===t.engine?"bg-orange-500/15 text-orange-11":"ollama"===t.engine?"bg-blue-500/15 text-blue-11":"codex"===t.engine?"bg-green-500/15 text-green-11":"kimi"===t.engine?"bg-purple-500/15 text-purple-11":"bg-muted text-muted-foreground"}`,children:t.engine}),(0,n.jsx)("h4",{className:"text-xs font-medium text-foreground truncate",title:t.title,children:t.title})]}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:new Date(t.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,n.jsxs)("div",{className:"space-y-0.5 text-xs",children:[t.firstMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`first-${t}`)),t.lastMessages.length>0&&(0,n.jsx)("div",{className:"text-slate-9 text-center py-0.5",children:"\xb7\xb7\xb7"}),t.lastMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`last-${t}`))]})]},t.path))})]})]},e.encodedPath)})]})]})]}):null}}}]);
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
`).slice(2).join(`
|
|
7
7
|
`))}},I=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},z=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},B=0,F=class{constructor(e){this.value=e,this.id=B++}},q,H=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new E(e?.onListenerError??d,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new x(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new z(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||d)(i),L.None}if(this._disposed)return L.None;t&&(e=e.bind(t));let s=new F(e),r;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(s.stack=N.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof F?(this._deliveryQueue??=new U,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=S(()=>{W?.unregister(n),r?.(),this._removeListener(s)});if(i instanceof b?i.add(n):Array.isArray(i)&&i.push(n),W){let e=Error().stack.split(`
|
|
8
8
|
`).slice(2,3).join(`
|
|
9
|
-
`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);W.register(n,t?.[2]??e,n)}return n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:s&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||d;if(!i)return void e.value(t);try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof F)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},U=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},j=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(Q=q||={}).isCancellationToken=function(e){return e===Q.None||e===Q.Cancelled||e instanceof V||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},Q.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:P.None}),Q.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:j});var Q,$,V=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?j:(this._emitter||(this._emitter=new H),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Y=!1,G="en",J=globalThis;"u">typeof J.vscode&&"u">typeof J.vscode.process?J.vscode.process:"u">typeof c&&c?.versions?.node;var K="string"==typeof c?.versions?.electron&&c?.type==="renderer";if("object"==typeof c){c.platform,c.platform,"linux"===c.platform&&c.env.SNAP&&c.env.SNAP_REVISION,c.env.CI||c.env.BUILD_ARTIFACTSTAGINGDIRECTORY,G="en";let e=c.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,G=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}}else"object"!=typeof navigator||K?console.error("Unable to resolve platform."):(($=navigator.userAgent).indexOf("Windows"),$.indexOf("Macintosh"),($.indexOf("Macintosh")>=0||$.indexOf("iPad")>=0||$.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,$.indexOf("Linux"),$?.indexOf("Mobi"),Y=!0,G=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());Y&&"function"==typeof J.importScripts&&J.origin;var X,Z=$,ee=G;(s=X||={}).value=function(){return ee},s.isDefaultVariant=function(){return 2===ee.length?"en"===ee:ee.length>=3&&"e"===ee[0]&&"n"===ee[1]&&"-"===ee[2]},s.isDefault=function(){return"en"===ee};var et="function"==typeof J.postMessage&&!J.importScripts,ei=(()=>{if(et){let e=[];J.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),J.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),es=!!(Z&&Z.indexOf("Chrome")>=0);function er(e,t=0,i){let s=setTimeout(()=>{e(),i&&r.dispose()},t),r=S(()=>{clearTimeout(s),i?.deleteAndLeak(r)});return i?.add(r),r}Z&&Z.indexOf("Firefox"),!es&&Z&&Z.indexOf("Safari"),Z&&Z.indexOf("Edg/"),Z&&Z.indexOf("Android"),Symbol("MicrotaskDelay"),(r=n||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},r.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var en=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new H,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await P.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};en.EMPTY=en.fromArray([]);var eo=class extends L{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new D),this._linesCacheDisposables=this._register(new D),this._register(S(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=y(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=er(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let i=[],s=[0],r=this._terminal.buffer.active.getLine(e);for(;r;){let n=this._terminal.buffer.active.getLine(e+1),o=!!n&&n.isWrapped,a=r.translateToString(!o&&t);if(o&&n){let e=r.getCell(r.length-1);e&&0===e.getCode()&&1===e.getWidth()&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;e++,r=n}return[i.join(""),s]}},ea=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return!this._lastSearchOptions||!!e&&(this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord)}shouldUpdateHighlighting(e,t){return!!t?.decorations&&(void 0===this._cachedSearchTerm||e!==this._cachedSearchTerm||this.didOptionsChange(t))}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},el=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,i,s){if(!e||0===e.length)return void this._terminal.clearSelection();if(i>this._terminal.cols)throw Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:t,startCol:i},n=this._findInLine(e,r,s);if(!n)for(let i=t+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=i,r.startCol=0,!(n=this._findInLine(e,r,s)));i++);return n}findNextWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===e?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(e,o,t);if(!a)for(let i=n+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);if(!a&&0!==n)for(let i=0;i<n&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(e,o,t)),a}findPreviousWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols;this._lineCache.initLinesCache();let o={startRow:r,startCol:n},a;if(s&&(o.startRow=r=s.start.y,o.startCol=n=s.start.x,i!==e&&((a=this._findInLine(e,o,t,!1))||(o.startRow=r=s.end.y,o.startCol=n=s.end.x))),a||(a=this._findInLine(e,o,t,!0)),!a){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let i=r-1;i>=0&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);}if(!a&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let i=this._terminal.buffer.active.baseY+this._terminal.rows-1;i>=r&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);return a}_isWholeWord(e,t,i){return(0===e||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+i.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+i.length]))}_findInLine(e,t,i={},s=!1){let r=t.startRow,n=t.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=e,u=a;i.regex||(c=i.caseSensitive?e:e.toLowerCase(),u=i.caseSensitive?a:a.toLowerCase());let d=-1;if(i.regex){let t=RegExp(c,i.caseSensitive?"g":"gi"),r;if(s)for(;r=t.exec(u.slice(0,h));)d=t.lastIndex-r[0].length,e=r[0],t.lastIndex-=e.length-1;else(r=t.exec(u.slice(h)))&&r[0].length>0&&(d=h+(t.lastIndex-r[0].length),e=r[0])}else s?h-c.length>=0&&(d=u.lastIndexOf(c,h-c.length)):d=u.indexOf(c,h);if(d>=0){if(i.wholeWord&&!this._isWholeWord(d,u,e))return;let t=0;for(;t<l.length-1&&d>=l[t+1];)t++;let s=t;for(;s<l.length-1&&d+e.length>=l[s+1];)s++;let n=d-l[t],o=d+e.length-l[s],a=this._stringLengthToBufferSize(r+t,n),h=this._stringLengthToBufferSize(r+s,o)-a+this._terminal.cols*(s-t);return{term:e,col:a,row:r+t,size:h}}}_stringLengthToBufferSize(e,t){let i=this._terminal.buffer.active.getLine(e);if(!i)return 0;for(let e=0;e<t;e++){let s=i.getCell(e);if(!s)break;let r=s.getChars();r.length>1&&(t-=r.length-1);let n=i.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){let i=e,s=0,r=this._terminal.buffer.active.getLine(i);for(;t>0&&r;){for(let e=0;e<t&&e<this._terminal.cols;e++){let t=r.getCell(e);if(!t)break;t.getWidth()&&(s+=0===t.getCode()?1:t.getChars().length)}if(i++,(r=this._terminal.buffer.active.getLine(i))&&!r.isWrapped)break;t-=this._terminal.cols}return s}},eh=class extends L{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(S(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){for(let i of(this.clearHighlightDecorations(),e)){let e=this._createResultDecorations(i,t,!1);if(e)for(let t of e)this._storeDecoration(t,i)}}createActiveDecoration(e,t){let i=this._createResultDecorations(e,t,!0);if(i)return{decorations:i,match:e,dispose(){C(i)}}}clearHighlightDecorations(){C(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,i){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),i&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,i){let s=[],r=e.col,n=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;n>0;){let e=Math.min(this._terminal.cols-r,n);s.push([o,r,e]),r=0,n-=e,o++}let a=[];for(let e of s){let s=this._terminal.registerMarker(e[0]),r=this._terminal.registerDecoration({marker:s,x:e[1],width:e[2],backgroundColor:i?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(s.line)?void 0:{color:i?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(r){let e=[];e.push(s),e.push(r.onRender(e=>this._applyStyles(e,i?t.activeMatchBorder:t.matchBorder,!1))),e.push(r.onDispose(()=>C(e))),a.push(r)}}return 0===a.length?void 0:a}},ec=class extends L{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new H)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let i=this._searchResults[t];if(i.row===e.row&&i.col===e.col&&i.size===e.size)return t}return -1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},eu=class extends L{constructor(e){super(),this._highlightTimeout=this._register(new D),this._lineCache=this._register(new D),this._state=new ea,this._resultTracker=this._register(new ec),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new eo(e),this._engine=new el(e,this._lineCache.value),this._decorationManager=new eh(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(S(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=er(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findNextAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e))return void this.clearDecorations();this.clearDecorations(!0);let i=[],s,r=this._engine.find(e,0,0,t);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(e,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,t);this._resultTracker.updateResults(i,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(i,t.decorations)}_findNextAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}findPrevious(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findPreviousAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}_selectResult(e,t,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!i&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let t=e.row-this._terminal.buffer.active.viewportY;t-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(t)}return!0}};let ed=(0,a.memo)((0,a.forwardRef)(function({output:e,isRunning:t,onInput:i,onResize:s,maximized:r,height:n},c){let u=(0,a.useRef)(null),d=(0,a.useRef)(null),f=(0,a.useRef)(null),_=(0,a.useRef)(null),m=(0,a.useRef)(0),g=(0,a.useRef)(i),p=(0,a.useRef)(s);(0,a.useEffect)(()=>{g.current=i},[i]),(0,a.useEffect)(()=>{p.current=s},[s]),(0,a.useImperativeHandle)(c,()=>({findNext:e=>_.current?.findNext(e,{caseSensitive:!1,decorations:{matchBackground:"#facc1550",matchBorder:"#facc15",matchOverviewRuler:"#facc15",activeMatchBackground:"#facc1590",activeMatchBorder:"#facc15",activeMatchColorOverviewRuler:"#facc15"}})??!1,findPrevious:e=>_.current?.findPrevious(e,{caseSensitive:!1,decorations:{matchBackground:"#facc1550",matchBorder:"#facc15",matchOverviewRuler:"#facc15",activeMatchBackground:"#facc1590",activeMatchBorder:"#facc15",activeMatchColorOverviewRuler:"#facc15"}})??!1,clearSearch:()=>{_.current?.clearDecorations()}}),[]),(0,a.useEffect)(()=>{if(!u.current)return;let e=new l.B({convertEol:!1,scrollback:5e3,fontSize:13,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',cursorStyle:"block",cursorBlink:!0,disableStdin:!1,allowProposedApi:!0,theme:{background:"transparent",foreground:"#d4d4d8",cursor:"#d4d4d8",cursorAccent:"#1a1a2e",selectionBackground:"#3b82f680",black:"#27272a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#fafafa"}}),t=new h,i=new eu;e.loadAddon(t),e.loadAddon(i),e.open(u.current),e.onData(e=>{g.current&&g.current(e)});try{t.fit(),p.current&&p.current(e.cols,e.rows)}catch{}return d.current=e,f.current=t,_.current=i,m.current=0,()=>{e.dispose(),d.current=null,f.current=null,_.current=null,m.current=0}},[]),(0,a.useEffect)(()=>{let t=d.current;if(!t)return;let i=!1;if(e.length<m.current&&(t.reset(),m.current=0,i=!0),e.length>m.current){let i=e.slice(m.current);t.write(i),m.current=e.length}i&&g.current&&requestAnimationFrame(()=>t.focus())},[e]),(0,a.useEffect)(()=>{t&&d.current&&d.current.focus()},[t]);let v=(0,a.useCallback)(()=>{let e=d.current,t=f.current;if(e&&t)try{t.fit(),p.current&&p.current(e.cols,e.rows)}catch{}},[]);return(0,a.useEffect)(()=>{requestAnimationFrame(()=>{v(),requestAnimationFrame(v)})},[r,v]),(0,a.useEffect)(()=>{let e=u.current;if(!e)return;let t=new ResizeObserver(v);return t.observe(e),()=>t.disconnect()},[v]),(0,o.jsx)("div",{ref:u,className:"xterm-renderer px-2",style:{height:n??"100%",overflow:"hidden"}})}))}}]);
|
|
9
|
+
`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);W.register(n,t?.[2]??e,n)}return n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:s&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||d;if(!i)return void e.value(t);try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof F)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},U=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},j=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(Q=q||={}).isCancellationToken=function(e){return e===Q.None||e===Q.Cancelled||e instanceof V||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},Q.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:P.None}),Q.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:j});var Q,$,V=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?j:(this._emitter||(this._emitter=new H),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Y=!1,G="en",J=globalThis;"u">typeof J.vscode&&"u">typeof J.vscode.process?J.vscode.process:"u">typeof c&&c?.versions?.node;var K="string"==typeof c?.versions?.electron&&c?.type==="renderer";if("object"==typeof c){c.platform,c.platform,"linux"===c.platform&&c.env.SNAP&&c.env.SNAP_REVISION,c.env.CI||c.env.BUILD_ARTIFACTSTAGINGDIRECTORY,G="en";let e=c.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,G=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}}else"object"!=typeof navigator||K?console.error("Unable to resolve platform."):(($=navigator.userAgent).indexOf("Windows"),$.indexOf("Macintosh"),($.indexOf("Macintosh")>=0||$.indexOf("iPad")>=0||$.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,$.indexOf("Linux"),$?.indexOf("Mobi"),Y=!0,G=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());Y&&"function"==typeof J.importScripts&&J.origin;var X,Z=$,ee=G;(s=X||={}).value=function(){return ee},s.isDefaultVariant=function(){return 2===ee.length?"en"===ee:ee.length>=3&&"e"===ee[0]&&"n"===ee[1]&&"-"===ee[2]},s.isDefault=function(){return"en"===ee};var et="function"==typeof J.postMessage&&!J.importScripts,ei=(()=>{if(et){let e=[];J.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),J.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),es=!!(Z&&Z.indexOf("Chrome")>=0);function er(e,t=0,i){let s=setTimeout(()=>{e(),i&&r.dispose()},t),r=S(()=>{clearTimeout(s),i?.deleteAndLeak(r)});return i?.add(r),r}Z&&Z.indexOf("Firefox"),!es&&Z&&Z.indexOf("Safari"),Z&&Z.indexOf("Edg/"),Z&&Z.indexOf("Android"),Symbol("MicrotaskDelay"),(r=n||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},r.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var en=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new H,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await P.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};en.EMPTY=en.fromArray([]);var eo=class extends L{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new D),this._linesCacheDisposables=this._register(new D),this._register(S(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=y(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=er(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let i=[],s=[0],r=this._terminal.buffer.active.getLine(e);for(;r;){let n=this._terminal.buffer.active.getLine(e+1),o=!!n&&n.isWrapped,a=r.translateToString(!o&&t);if(o&&n){let e=r.getCell(r.length-1);e&&0===e.getCode()&&1===e.getWidth()&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;e++,r=n}return[i.join(""),s]}},ea=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return!this._lastSearchOptions||!!e&&(this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord)}shouldUpdateHighlighting(e,t){return!!t?.decorations&&(void 0===this._cachedSearchTerm||e!==this._cachedSearchTerm||this.didOptionsChange(t))}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},el=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,i,s){if(!e||0===e.length)return void this._terminal.clearSelection();if(i>this._terminal.cols)throw Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:t,startCol:i},n=this._findInLine(e,r,s);if(!n)for(let i=t+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=i,r.startCol=0,!(n=this._findInLine(e,r,s)));i++);return n}findNextWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===e?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(e,o,t);if(!a)for(let i=n+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);if(!a&&0!==n)for(let i=0;i<n&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(e,o,t)),a}findPreviousWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols;this._lineCache.initLinesCache();let o={startRow:r,startCol:n},a;if(s&&(o.startRow=r=s.start.y,o.startCol=n=s.start.x,i!==e&&((a=this._findInLine(e,o,t,!1))||(o.startRow=r=s.end.y,o.startCol=n=s.end.x))),a||(a=this._findInLine(e,o,t,!0)),!a){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let i=r-1;i>=0&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);}if(!a&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let i=this._terminal.buffer.active.baseY+this._terminal.rows-1;i>=r&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);return a}_isWholeWord(e,t,i){return(0===e||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+i.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+i.length]))}_findInLine(e,t,i={},s=!1){let r=t.startRow,n=t.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=e,u=a;i.regex||(c=i.caseSensitive?e:e.toLowerCase(),u=i.caseSensitive?a:a.toLowerCase());let d=-1;if(i.regex){let t=RegExp(c,i.caseSensitive?"g":"gi"),r;if(s)for(;r=t.exec(u.slice(0,h));)d=t.lastIndex-r[0].length,e=r[0],t.lastIndex-=e.length-1;else(r=t.exec(u.slice(h)))&&r[0].length>0&&(d=h+(t.lastIndex-r[0].length),e=r[0])}else s?h-c.length>=0&&(d=u.lastIndexOf(c,h-c.length)):d=u.indexOf(c,h);if(d>=0){if(i.wholeWord&&!this._isWholeWord(d,u,e))return;let t=0;for(;t<l.length-1&&d>=l[t+1];)t++;let s=t;for(;s<l.length-1&&d+e.length>=l[s+1];)s++;let n=d-l[t],o=d+e.length-l[s],a=this._stringLengthToBufferSize(r+t,n),h=this._stringLengthToBufferSize(r+s,o)-a+this._terminal.cols*(s-t);return{term:e,col:a,row:r+t,size:h}}}_stringLengthToBufferSize(e,t){let i=this._terminal.buffer.active.getLine(e);if(!i)return 0;for(let e=0;e<t;e++){let s=i.getCell(e);if(!s)break;let r=s.getChars();r.length>1&&(t-=r.length-1);let n=i.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){let i=e,s=0,r=this._terminal.buffer.active.getLine(i);for(;t>0&&r;){for(let e=0;e<t&&e<this._terminal.cols;e++){let t=r.getCell(e);if(!t)break;t.getWidth()&&(s+=0===t.getCode()?1:t.getChars().length)}if(i++,(r=this._terminal.buffer.active.getLine(i))&&!r.isWrapped)break;t-=this._terminal.cols}return s}},eh=class extends L{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(S(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){for(let i of(this.clearHighlightDecorations(),e)){let e=this._createResultDecorations(i,t,!1);if(e)for(let t of e)this._storeDecoration(t,i)}}createActiveDecoration(e,t){let i=this._createResultDecorations(e,t,!0);if(i)return{decorations:i,match:e,dispose(){C(i)}}}clearHighlightDecorations(){C(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,i){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),i&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,i){let s=[],r=e.col,n=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;n>0;){let e=Math.min(this._terminal.cols-r,n);s.push([o,r,e]),r=0,n-=e,o++}let a=[];for(let e of s){let s=this._terminal.registerMarker(e[0]),r=this._terminal.registerDecoration({marker:s,x:e[1],width:e[2],backgroundColor:i?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(s.line)?void 0:{color:i?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(r){let e=[];e.push(s),e.push(r.onRender(e=>this._applyStyles(e,i?t.activeMatchBorder:t.matchBorder,!1))),e.push(r.onDispose(()=>C(e))),a.push(r)}}return 0===a.length?void 0:a}},ec=class extends L{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new H)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let i=this._searchResults[t];if(i.row===e.row&&i.col===e.col&&i.size===e.size)return t}return -1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},eu=class extends L{constructor(e){super(),this._highlightTimeout=this._register(new D),this._lineCache=this._register(new D),this._state=new ea,this._resultTracker=this._register(new ec),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new eo(e),this._engine=new el(e,this._lineCache.value),this._decorationManager=new eh(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(S(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=er(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findNextAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e))return void this.clearDecorations();this.clearDecorations(!0);let i=[],s,r=this._engine.find(e,0,0,t);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(e,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,t);this._resultTracker.updateResults(i,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(i,t.decorations)}_findNextAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}findPrevious(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findPreviousAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}_selectResult(e,t,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!i&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let t=e.row-this._terminal.buffer.active.viewportY;t-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(t)}return!0}};let ed=(0,a.memo)((0,a.forwardRef)(function({output:e,isRunning:t,onInput:i,onResize:s,maximized:r,height:n,directWrite:c},u){let d=(0,a.useRef)(null),f=(0,a.useRef)(null),_=(0,a.useRef)(null),m=(0,a.useRef)(null),g=(0,a.useRef)(0),p=(0,a.useRef)(i),v=(0,a.useRef)(s);(0,a.useEffect)(()=>{p.current=i},[i]),(0,a.useEffect)(()=>{v.current=s},[s]),(0,a.useImperativeHandle)(u,()=>({findNext:e=>m.current?.findNext(e,{caseSensitive:!1,decorations:{matchBackground:"#facc1550",matchBorder:"#facc15",matchOverviewRuler:"#facc15",activeMatchBackground:"#facc1590",activeMatchBorder:"#facc15",activeMatchColorOverviewRuler:"#facc15"}})??!1,findPrevious:e=>m.current?.findPrevious(e,{caseSensitive:!1,decorations:{matchBackground:"#facc1550",matchBorder:"#facc15",matchOverviewRuler:"#facc15",activeMatchBackground:"#facc1590",activeMatchBorder:"#facc15",activeMatchColorOverviewRuler:"#facc15"}})??!1,clearSearch:()=>{m.current?.clearDecorations()},write:e=>{f.current?.write(e)},reset:()=>{f.current?.reset()}}),[]),(0,a.useEffect)(()=>{if(!d.current)return;let e=new l.B({convertEol:!1,scrollback:5e3,fontSize:13,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',cursorStyle:"block",cursorBlink:!0,disableStdin:!1,allowProposedApi:!0,theme:{background:"transparent",foreground:"#d4d4d8",cursor:"#d4d4d8",cursorAccent:"#1a1a2e",selectionBackground:"#3b82f680",black:"#27272a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#fafafa"}}),t=new h,i=new eu;e.loadAddon(t),e.loadAddon(i),e.open(d.current),e.onData(e=>{p.current&&p.current(e)});try{t.fit(),v.current&&v.current(e.cols,e.rows)}catch{}return f.current=e,_.current=t,m.current=i,g.current=0,()=>{e.dispose(),f.current=null,_.current=null,m.current=null,g.current=0}},[]),(0,a.useEffect)(()=>{if(c)return;let t=f.current;if(!t)return;let i=!1;if(e.length<g.current&&(t.reset(),g.current=0,i=!0),e.length>g.current){let i=e.slice(g.current);t.write(i),g.current=e.length}i&&p.current&&requestAnimationFrame(()=>t.focus())},[e,c]),(0,a.useEffect)(()=>{t&&f.current&&f.current.focus()},[t]);let w=(0,a.useCallback)(()=>{let e=f.current,t=_.current;if(e&&t)try{t.fit(),v.current&&v.current(e.cols,e.rows)}catch{}},[]);return(0,a.useEffect)(()=>{requestAnimationFrame(()=>{w(),requestAnimationFrame(w)})},[r,w]),(0,a.useEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(w);return t.observe(e),()=>t.disconnect()},[w]),(0,o.jsx)("div",{ref:d,className:"xterm-renderer px-2",style:{height:n??"100%",overflow:"hidden"}})}))}}]);
|