@shepai/cli 1.162.0-pr506.4839064 → 1.162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +0 -20
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/index.d.ts +1 -1
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +0 -5
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +1 -2
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +0 -20
- package/dist/src/presentation/cli/commands/repo/add.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/add.command.js +1 -3
- package/dist/src/presentation/tui/wizards/github-import.wizard.d.ts +2 -5
- package/dist/src/presentation/tui/wizards/github-import.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/github-import.wizard.js +6 -38
- package/dist/src/presentation/web/app/actions/list-github-repositories.d.ts +0 -1
- package/dist/src/presentation/web/app/actions/list-github-repositories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.d.ts +1 -8
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.js +7 -37
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.d.ts +0 -1
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.js +0 -35
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +56 -71
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +58 -73
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +72 -87
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +72 -87
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +58 -73
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +72 -87
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +72 -87
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +52 -67
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +10 -25
- package/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +16 -31
- package/web/.next/server/app/settings/page.js +1 -1
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +20 -35
- package/web/.next/server/app/skills/page.js +1 -1
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +20 -35
- package/web/.next/server/app/tools/page.js +1 -1
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +10 -25
- package/web/.next/server/app/version/page.js +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__209c9597._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__209c9597._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__27301e38._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__27301e38._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6eb2a2b0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6fecf886._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6fecf886._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8d27866c._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8d27866c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f3504c7._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f3504c7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bd6ed91a._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bd6ed91a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ee0eaaf9._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ee0eaaf9._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0fc83881._.js → _07635b7c._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0fc83881._.js.map → _07635b7c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ce97386b._.js → _1c309165._.js} +2 -2
- package/web/.next/server/chunks/ssr/_1c309165._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_3a0b989f._.js +6 -0
- package/web/.next/server/chunks/ssr/_3a0b989f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5f69c13f._.js +4 -0
- package/web/.next/server/chunks/ssr/_5f69c13f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_71ba6039._.js → _73e1eb5f._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_71ba6039._.js.map → _73e1eb5f._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js +4 -0
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_82c57f10._.js +4 -0
- package/web/.next/server/chunks/ssr/_82c57f10._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_0727935d._.js → _9495d50b._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0727935d._.js.map → _9495d50b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_9c5bd84a._.js +3 -0
- package/web/.next/server/chunks/ssr/_9c5bd84a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js +4 -0
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ac4a3873._.js +1 -1
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js +4 -0
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cb5a021e._.js +4 -0
- package/web/.next/server/chunks/ssr/_cb5a021e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_d86175ae._.js +4 -0
- package/web/.next/server/chunks/ssr/_d86175ae._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_d8bedf13._.js +4 -0
- package/web/.next/server/chunks/ssr/_d8bedf13._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_d90b0a06._.js +3 -0
- package/web/.next/server/chunks/ssr/_d90b0a06._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_fa7efce3._.js +6 -0
- package/web/.next/server/chunks/ssr/_fa7efce3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +495 -636
- package/web/.next/static/chunks/{430ebb233af04232.js → 04b3e8b2c0b2a310.js} +2 -2
- package/web/.next/static/chunks/{63f6860c64adac54.js → 192dd30a464572ef.js} +1 -1
- package/web/.next/static/chunks/{35ec31863fa35a53.js → 1d980f961818ff68.js} +1 -1
- package/web/.next/static/chunks/1db4dfa35a1637ed.js +1 -0
- package/web/.next/static/chunks/{6dfd3331ed16c17a.js → 2770aabb38d76609.js} +1 -1
- package/web/.next/static/chunks/2c9404cf96b0a5a0.js +1 -0
- package/web/.next/static/chunks/4864ff06a738d58b.js +1 -0
- package/web/.next/static/chunks/{d98bc2adcbbf962b.js → 5281c5a2011132bc.js} +2 -2
- package/web/.next/static/chunks/{0b25e132c6474df2.js → 7cd7aef397d53b94.js} +1 -1
- package/web/.next/static/chunks/83928a921868a809.js +1 -0
- package/web/.next/static/chunks/a81350e847797ff8.js +1 -0
- package/web/.next/static/chunks/cb41e1da2ce3a710.js +7 -0
- package/web/.next/static/chunks/{b84a4b22a24e32e5.js → d0613380bbaa9a8e.js} +1 -1
- package/dist/packages/core/src/application/use-cases/repositories/list-github-organizations.use-case.d.ts +0 -13
- package/dist/packages/core/src/application/use-cases/repositories/list-github-organizations.use-case.d.ts.map +0 -1
- package/dist/packages/core/src/application/use-cases/repositories/list-github-organizations.use-case.js +0 -35
- package/dist/src/presentation/web/app/actions/list-github-organizations.d.ts +0 -6
- package/dist/src/presentation/web/app/actions/list-github-organizations.d.ts.map +0 -1
- package/dist/src/presentation/web/app/actions/list-github-organizations.js +0 -17
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__512b2c98._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__512b2c98._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bde2d922._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bde2d922._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c7691da2._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c7691da2._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f1048f45._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f1048f45._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_075fae20._.js +0 -4
- package/web/.next/server/chunks/ssr/_075fae20._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_125c55af._.js +0 -4
- package/web/.next/server/chunks/ssr/_125c55af._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +0 -4
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_289a182a._.js +0 -3
- package/web/.next/server/chunks/ssr/_289a182a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_628621c7._.js +0 -4
- package/web/.next/server/chunks/ssr/_628621c7._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_68996e5b._.js +0 -3
- package/web/.next/server/chunks/ssr/_68996e5b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_9412b27f._.js +0 -4
- package/web/.next/server/chunks/ssr/_9412b27f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +0 -4
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +0 -4
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ce97386b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +0 -6
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +0 -6
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +0 -4
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_select_tsx_45d6b8ae._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_select_tsx_45d6b8ae._.js.map +0 -1
- package/web/.next/static/chunks/045afc2f5599f55e.js +0 -7
- package/web/.next/static/chunks/50a500c1cc2dee74.js +0 -1
- package/web/.next/static/chunks/6b7c8cc4aaebde67.js +0 -1
- package/web/.next/static/chunks/9059af01c4765dae.js +0 -1
- package/web/.next/static/chunks/c3a67566f78b5bc3.js +0 -1
- package/web/.next/static/chunks/e4f58183caab77d8.js +0 -1
- /package/web/.next/static/{Nr75BQmqg1jHaq9Qff_Wk → GXMtXdKTjklQ1IkrOohzE}/_buildManifest.js +0 -0
- /package/web/.next/static/{Nr75BQmqg1jHaq9Qff_Wk → GXMtXdKTjklQ1IkrOohzE}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{Nr75BQmqg1jHaq9Qff_Wk → GXMtXdKTjklQ1IkrOohzE}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36986,e=>{"use strict";var t=e.i(20314),s=e.i(79054);e.i(41001);var a=e.i(64780),r=e.i(31406),n=e.i(60112),l=e.i(83428),i=e.i(67669),o=e.i(24042),d=e.i(6910),c=e.i(33548),u=e.i(23925),m=e.i(8986),x=e.i(30702),p=e.i(37260),h=e.i(83299),f=e.i(21023);let g=(0,f.createServerReference)("6022fe2bf91936fa4af9dc77532bc4d550ae0359f4",f.callServer,void 0,f.findSourceMapURL,"approveFeature");var j=e.i(49627),b=e.i(5431);let v=(0,f.createServerReference)("704b59637b68ea49a2738b898448adca21c77abc3f",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),N=(0,f.createServerReference)("4013cd83afa9dc254c606dd40b8d2ca2a13faf1ab5",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),y=(0,f.createServerReference)("40a510ad90130b1cc0529dcd6b1b2d6813fd62b0ce",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),w=(0,f.createServerReference)("40d582e7c6a45209b9205497f56ae301b3928ea6d5",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),C=e.i(8361),S=e.i(30153),T=e.i(8537),M=e.i(39443);e.i(1650);var R=e.i(11495);e.i(99348);var I=e.i(5259),A=e.i(35364),P=e.i(2828);e.i(31566);var $=e.i(65104);e.i(81803);var D=e.i(72714),E=e.i(38573),L=e.i(19933),z=e.i(99105),F=e.i(51251),q=e.i(70646);function B({actions:e,repositoryPath:a,worktreePath:r,showSpecs:n}){let[i,o]=(0,s.useState)(!1),d=e.ideLoading||e.shellLoading||e.folderLoading||e.specsLoading,x=e.ideError??e.shellError??e.folderError??e.specsError;return(0,t.jsxs)(q.DropdownMenu,{modal:!1,children:[(0,t.jsx)(q.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(A.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:d,children:[d?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):x?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(z.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(q.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,t.jsx)(q.DropdownMenuLabel,{children:"Open in"}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(m.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(E.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openFolder,disabled:e.folderLoading,className:"gap-2",children:[e.folderLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.folderError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Folder"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!n,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(q.DropdownMenuSeparator,{}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(r??a),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[i?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),i?"Copied!":"Copy path"]})]})]})}var O=e.i(79687),U=e.i(68304),H=e.i(25235);let V=(0,f.createServerReference)("40de206023ed7793d74605c70a9ea5340b47102964",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),W=(0,f.createServerReference)("409d59dec6fcc822fbf643bfef9cfadb14b857f778",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var G=e.i(11345),_=e.i(76016),K=e.i(31777),Q=e.i(81846),Z=e.i(16868),J=e.i(3645);let X=(0,J.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var Y=e.i(58481),ee=e.i(48306);e.i(50032);var et=e.i(86254),es=e.i(42076);let ea=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function er({onReject:e,onApprove:r,approveLabel:n,approveVariant:l="default",revisionPlaceholder:i,isProcessing:o=!1,isRejecting:d=!1,children:c,chatInput:m,onChatInputChange:x}){let{t:p}=(0,a.useTranslation)("web"),h="warning"===l,f=h?Y.AlertTriangle:u.Check,g=h?"bg-orange-500/85":"bg-blue-500/85",[j,b]=(0,s.useState)(""),v=m??j,N=x??b,y=(0,C.useSoundAction)("approve"),w=o||d,[k,S]=(0,s.useState)([]),[T,M]=(0,s.useState)(!1),[R,I]=(0,s.useState)(null),[$,D]=(0,s.useState)(!1),[E,L]=(0,s.useState)(!1),[z,F]=(0,s.useState)(!1),q=v.trim().length>0,B=q?$||E&&z:!$,O=(0,s.useRef)(0),U=(0,s.useRef)(crypto.randomUUID()),H=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&L(!0),"Shift"===e.key&&F(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&L(!1),"Shift"===e.key&&F(!1)}function s(){L(!1),F(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",s)}},[]);let V=(0,s.useCallback)(async e=>{for(let t of(I(null),e)){if(t.size>0xa00000)return void I(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!ea.has(e))return void I(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();S(s=>[...s,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let s=new FormData;s.append("file",t),s.append("sessionId",U.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:s});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));S(t=>t.filter(t=>t.id!==e)),I(t.error??"Upload failed");return}let r=await a.json();S(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{S(t=>t.filter(t=>t.id!==e)),I("Upload failed")}}},[]),W=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current+=1,1===O.current&&M(!0)},[]),_=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current-=1,0===O.current&&M(!1)},[]),Q=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),J=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current=0,M(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&V(t)},[V]),er=(0,s.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let s=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&s.push(t)}s.length>0&&(e.preventDefault(),V(s))},[V]),en=(0,s.useCallback)(async()=>{try{let e=await (0,es.pickFiles)();e&&S(t=>{let s=new Set(t.map(e=>e.path)),a=e.filter(e=>!s.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return a.length>0?[...t,...a]:t})}catch{}},[]),el=(0,s.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),ei=(0,s.useCallback)((e,t)=>{S(s=>s.map(s=>s.id===e?{...s,notes:t}:s))},[]),eo=(0,s.useCallback)(()=>{N(""),S([]),I(null)},[N]),ed=(0,s.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),H.current?.requestSubmit())},[]),ec="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:H,onSubmit:function(t){t.preventDefault();let s=v.trim();if(B)y.play(),r(),eo();else{if(!s||!e)return;e(s,k.filter(e=>!e.loading)),eo()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":p("createDrawer.fileDropZone"),"data-drag-over":T?"true":"false",onDragEnter:W,onDragLeave:_,onDragOver:Q,onDrop:J,className:(0,K.cn)("rounded-md border-2 border-transparent transition-colors",T&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(ee.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:w,value:v,onChange:e=>N(e.target.value),onKeyDown:ed,onPaste:er,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),k.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:k.map(e=>(0,t.jsx)(et.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>el(e.id),disabled:w,loading:e.loading,notes:e.notes,onNotesChange:t=>ei(e.id,t)},e.id))}),R?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:R}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[ec,"+Enter"]})," ",q?"reject":"approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:en,disabled:w,"aria-label":p("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(Z.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:p("chat.attachFiles")})]}),(0,t.jsx)("div",{onMouseLeave:()=>D(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:w,"data-testid":"drawer-action-submit",className:(0,K.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border ps-4 pe-10 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",B?`${h?"border-orange-400/60":"border-blue-400/60"} text-white`:q&&E&&!z?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,K.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",g),style:{transform:B?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,K.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pe-8 transition-opacity duration-300",B?"opacity-0":"opacity-100"),children:[(0,t.jsx)(X,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,K.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",B?"opacity-100":"opacity-0"),children:[(0,t.jsx)(f,{className:"h-4 w-4 shrink-0"}),n]}),(0,t.jsx)("span",{className:(0,K.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-e-[5px] border-s ${g} transition-opacity duration-300`,!q&&!$&&"pointer-events-none opacity-0"),onMouseEnter:()=>D(!0),children:(0,t.jsx)(G.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),h?null:(0,t.jsx)(P.TooltipContent,{side:"top",children:B?n:p("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(A.Button,{type:"button",className:"flex-1",disabled:w,onClick:()=>{y.play(),r()},children:n})})]})}function en({data:e,selections:a,onSelect:r,onApprove:n,onReject:l,isProcessing:i=!1,isRejecting:o=!1,showHeader:d=!1,chatInput:c,onChatInputChange:u}){let{question:m,context:x,questions:p,finalAction:h}=e,[f,g]=(0,s.useState)(0),j=(0,C.useSoundAction)("select"),b=(0,C.useSoundAction)("navigate"),v=p.length,N=f===v-1,y=p[f],w=(0,s.useMemo)(()=>Object.keys(a).length,[a]),k=(0,s.useCallback)((e,t)=>{j.play(),r(e,t),N||setTimeout(()=>g(e=>e+1),250)},[r,N,j]);return 0===v?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[d?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:x})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[f+1,". ",y.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:p.map((e,s)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${s+1}`,className:(0,K.cn)("h-1.5 rounded-full transition-all duration-200",s===f?"bg-primary w-4":"w-1.5",s!==f&&a[e.id]?"bg-primary/50":"",s===f||a[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{b.play(),g(s)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:y.options.map((e,s)=>{let r=a[y.id]===e.id,n=String.fromCharCode(65+s);return(0,t.jsx)("button",{type:"button",className:(0,K.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-start text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",r&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:i,onClick:()=>k(y.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[n,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(Q.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(Q.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(A.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===f||i,onClick:()=>{b.play(),g(e=>e-1)},children:[(0,t.jsx)(G.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),N?null:(0,t.jsxs)(A.Button,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:()=>{b.play(),g(e=>e+1)},children:[a[y.id]?"Next":"Skip",(0,t.jsx)(_.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,t.jsx)(er,{onReject:l,onApprove:()=>n(h.id),approveLabel:h.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:i,isRejecting:o,chatInput:c,onChatInputChange:u,children:(0,t.jsx)("div",{className:(0,K.cn)("bg-muted h-1.5 overflow-hidden",w>0&&w<v||i?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:i?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${v>0?w/v*100:0}%`},"data-testid":"progress-bar"})})})]})}var el=e.i(427);let ei=(0,J.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),eo=(0,J.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),ed={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:s})=>s?(0,t.jsx)("code",{className:`${s} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 ps-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 ps-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:s})=>(0,t.jsx)("a",{href:s,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function ec({decision:e,index:a}){let[r,n]=(0,s.useState)(!1),l=(0,C.useSoundAction)("expand"),i=(0,C.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:a+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(Q.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(el.default,{components:ed,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r?i.play():l.play(),n(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(_.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${r?"rotate-90":""}`}),(0,t.jsx)(eo,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),r?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function eu({data:e}){let{summary:s,decisions:a}=e;return 0===a.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),s?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(ei,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),a.map((e,s)=>(0,t.jsx)(ec,{decision:e,index:s},e.title))]})}var em=e.i(41698);function ex({item:e,index:s}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:s+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(Q.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function ep({data:e}){let{questions:s}=e;return 0===s.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(em.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),s.map((e,s)=>(0,t.jsx)(ex,{item:e,index:s},e.question))]})}let eh=(0,J.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var ef=e.i(48923),eg=e.i(49228);let ej=(0,J.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),eb=(0,J.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var ev=e.i(70471);let eN=(0,J.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var ey=e.i(81181),ew=e.i(35e3),ek=e.i(30090),ek=ek,eC=e.i(17406);function eS({status:e}){switch(e){case eC.CiStatus.Success:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(ew.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case eC.CiStatus.Pending:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(l.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case eC.CiStatus.Failure:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(ek.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}let eT=(0,J.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),eM=(0,J.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),eR=(0,J.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),eI={added:{icon:eT,label:"A",className:"text-green-600"},modified:{icon:eR,label:"M",className:"text-amber-600"},deleted:{icon:eM,label:"D",className:"text-red-600"},renamed:{icon:eR,label:"R",className:"text-blue-600"}};function eA({status:e}){let s=eI[e],a=s.icon;return(0,t.jsx)(a,{className:(0,K.cn)("h-3.5 w-3.5 shrink-0",s.className)})}function eP({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,K.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,K.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pe-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function e$({file:e}){let[a,r]=(0,s.useState)(!1),n=e.path.split("/").pop()??e.path,l=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r(!a),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,t.jsx)(_.ChevronRight,{className:(0,K.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",a&&"rotate-90")}),(0,t.jsx)(eA,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[l,"/"]}),n]}):n}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),a&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(eP,{hunk:e},e.header))}):null]})}function eD({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(ev.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(e$,{file:e},`${e.status}-${e.path}`))})]})}let eE={Screenshot:eb,Video:eN,TestOutput:ev.FileText,TerminalRecording:E.Terminal},eL=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),ez=new Set([".mp4",".webm",".mov"]);function eF({evidence:e}){var a,r;let n,[l,i]=(0,s.useState)(!0),o=eE[e.type]??eb,d=(n=(a=e.relativePath).lastIndexOf("."))>=0?a.slice(n).toLowerCase():"",c=(r=e.relativePath,`/api/evidence?path=${encodeURIComponent(r)}`),u="Screenshot"===e.type||eL.has(d),m="Video"===e.type||ez.has(d),x="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!l),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-start",children:[l?(0,t.jsx)(z.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(_.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:c,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(ey.Download,{className:"h-3 w-3"})})]}),l&&c?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:u?(0,t.jsx)("img",{src:c,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):m?(0,t.jsx)("video",{src:c,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):x?(0,t.jsx)(eq,{url:c}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function eq({url:e}){let[a,r]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);return n?a?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:a}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");r(t.length>100?`${t.slice(0,100).join("\n")}
|
|
2
|
-
...`:e)}).catch(()=>r(null)).finally(()=>l(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function eB({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eb,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(Q.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eF,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function eO({data:e,readOnly:s=!1,onApprove:a,onReject:r,isProcessing:n=!1,isRejecting:l=!1,chatInput:i,onChatInputChange:o}){let{pr:d,diffSummary:c,fileDiffs:u,branch:m,warning:p,evidence:h,hideCiStatus:f}=e,g=d?.mergeable===!1,j=g&&r?()=>r("Resolve merge conflicts",[]):a;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:s?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"This feature was merged. Review the pull request details and evidence below.":d?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),m?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(eg.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(Q.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:m.source}),(0,t.jsx)(ej,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(Q.Badge,{variant:"outline",className:"font-mono text-[11px]",children:m.target})]})}):null,d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",d.number,(0,t.jsx)(x.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(Q.Badge,{variant:"outline",className:"text-xs",children:d.status})]}),!1===d.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(Y.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,d.ciStatus&&!0!==f?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eS,{status:d.ciStatus})]}):null,d.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ef.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:d.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eh,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):p?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(Y.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:p})]})}):null,h&&h.length>0?(0,t.jsx)(eB,{evidence:h}):null,u&&u.length>0?(0,t.jsx)(eD,{fileDiffs:u}):null]}),!s&&(0,t.jsx)(er,{onReject:r,onApprove:j,approveLabel:g?"Resolve Conflicts":"Approve Merge",approveVariant:g?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:n,isRejecting:l,chatInput:i,onChatInputChange:o})]})}let eU=(0,J.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var eH=e.i(38227);let eV=(0,J.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var eW=e.i(60253),eG=e.i(53360),e_=e.i(2287),eK=e.i(28267),eQ=e.i(80436);let eZ=(0,J.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),eJ=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function eX(e){let t=e.lastIndexOf(".");return t>=0&&eJ.has(e.slice(t).toLowerCase())}function eY(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",s=eX(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",a=new URLSearchParams({path:e,...s&&{mimeType:s}});return`/api/attachments/preview?${a.toString()}`}let e0=/(?:^|\s)@(\/[^\s]+)/g;function e1({text:e,attachmentPaths:s}){let a=function(e){let t=[],s=0;for(let a of e.matchAll(e0)){let r=a.index,n=r+(a[0].length-a[0].trimStart().length);n>s&&t.push({type:"text",value:e.slice(s,n)}),t.push({type:"attachment",path:a[1]}),s=r+a[0].length}return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}(e),r=a.some(e=>"attachment"===e.type),n=s?.filter(Boolean)??[];return r||0!==n.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[a.map(e=>{if("text"===e.type){let s=e.value.trim();return s?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:s},`text-${s.slice(0,40)}`):null}return(0,t.jsx)(e2,{path:e.path},`att-${e.path}`)}),n.map(e=>(0,t.jsx)(e2,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function e2({path:e}){let a=e.split("/").pop()??e,[r,n]=(0,s.useState)(!1);return eX(e)?r?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(eZ,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}):(0,t.jsxs)(e_.Dialog,{children:[(0,t.jsx)(e_.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:eY(e),alt:a,"data-testid":"inline-attachment-image",onError:()=>n(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(e_.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(eK.VisuallyHidden.Root,{children:(0,t.jsxs)(e_.DialogTitle,{children:["Preview: ",a]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:eY(e),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a})}),(0,t.jsx)("a",{href:eY(e),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,t.jsx)(eQ.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:eY(e),download:a,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:a})}let e5=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),e3=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function e4({className:e,size:s="md",duration:a=5,...r}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,K.cn)(e5({size:s}),e),...r,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${a}s`,repeatCount:"indefinite"}),e3.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var e6=e.i(2929),e8=e.i(86782),e9=e.i(29847);function e7(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let s=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return s>0?`${s}h ${a}m`:a>0?`${a}m ${r}s`:`${r}s`}let te=(0,J.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var tt=e.i(59311);function ts({syncStatus:e,syncLoading:s,syncError:r,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i,rebaseError:o}){let{t:d}=(0,a.useTranslation)("web"),c=null!=e&&e.behind>0,u=e?.behind===0,m=e?.baseBranch??"main";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:s&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"text-sm text-red-600",children:r})]}):i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}),(0,t.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),"..."]})]}):c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,t.jsxs)("span",{className:"text-sm",children:[e.behind," commit",1===e.behind?"":"s"," behind"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",e.ahead," ahead"]}):null]})]}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ew.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,t.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||r)&&!i?(0,t.jsx)("button",{"data-testid":"sync-refresh-button",onClick:n,disabled:s,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":d("branchSyncStatus.refreshSyncStatus"),children:(0,t.jsx)(tt.RefreshCw,{className:`h-3.5 w-3.5 ${s?"animate-spin":""}`})}):null]}),c&&!i?(0,t.jsx)(D.ActionButton,{label:d("branchSyncStatus.rebaseOnMain"),onClick:l,loading:!1,error:!!o,icon:te,variant:"outline",size:"sm"}):null,o?(0,t.jsx)("p",{className:"text-destructive text-xs",children:o}):null]})]})}function ta({data:e,syncStatus:s,syncLoading:a,syncError:r,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i,rebaseError:o}){let c="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:e6.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(tr,{data:e}),"error"===e.state&&e.onRetry?(0,t.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>e.onRetry(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(eH.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===e.state||"action-required"===e.state)&&e.onStop?(0,t.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>e.onStop(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(d.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!c&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,K.cn)("h-full rounded-full transition-all",e6.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,c&&e.pr?(0,t.jsx)(ti,{pr:e.pr,hideCiStatus:e.hideCiStatus}):null]}),(0,t.jsx)(tn,{data:e}),!c&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(ti,{pr:e.pr,hideCiStatus:e.hideCiStatus})})]}):null,(0,t.jsx)(to,{data:e}),l&&e.branch&&n?(0,t.jsx)(ts,{syncStatus:s??null,syncLoading:a??!1,syncError:r??null,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i??!1,rebaseError:o??null}):null,(0,t.jsx)(tu,{data:e})]})}function tr({data:e}){let s=e6.featureNodeStateConfig[e.state],a=s.icon;return(0,t.jsxs)("div",{className:(0,K.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",s.badgeBgClass,s.badgeClass),children:["running"===e.state?(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}):(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:s.label})]})}function tn({data:e}){var s;let r,n,l,i,o,{t:d}=(0,a.useTranslation)("web"),c=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return e.branch||e.oneLiner||c||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(eg.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(e1,{text:e.userQuery})]}):null,c?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(tm,{label:d("overviewTab.created"),value:(s=e.createdAt,r=Date.now(),(o=Math.floor((i=Math.floor((l=Math.floor(Math.floor((r-(n="string"==typeof s?new Date(s).getTime():s))/1e3)/60))/60))/24))>30?new Date(n).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):o>0?`${o} day${1===o?"":"s"} ago`:i>0?`${i} hour${1===i?"":"s"} ago`:l>0?`${l} minute${1===l?"":"s"} ago`:"just now")}):null]})]}):null}let tl={[eC.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[eC.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[eC.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function ti({pr:e,hideCiStatus:s}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(x.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(Q.Badge,{className:tl[e.status],children:e.status})]}),e.ciStatus&&!0!==s?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eS,{status:e.ciStatus})]}):null,!1===e.mergeable?(0,t.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(Y.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ef.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function to({data:e}){let{t:r}=(0,a.useTranslation)("web"),n=function(e){let[t,a]=(0,s.useState)(null),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>e?(a(e7(Math.max(0,Date.now()-e))),r.current=setInterval(()=>{a(e7(Math.max(0,Date.now()-e)))},1e3),()=>{r.current&&(clearInterval(r.current),r.current=null)}):void a(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0);return e.fastMode??e.agentType??e.runtime??n??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(eG.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(td,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(tm,{label:r("overviewTab.runtime"),value:e.runtime}):null,!e.runtime&&n?(0,t.jsx)(tm,{label:r("overviewTab.runningFor"),value:n}):null,e.blockedBy?(0,t.jsx)(tm,{label:r("overviewTab.blockedBy"),value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(tm,{label:r("overviewTab.error"),value:e.errorMessage}):null]})]}):null}function td({agentType:e}){let s=(0,e8.getAgentTypeIcon)(e),a=e8.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0"}),a]})]})}function tc({enabled:e,label:s}){return(0,t.jsxs)("span",{className:(0,K.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",e?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[e?(0,t.jsx)(u.Check,{className:"h-3 w-3"}):(0,t.jsx)(eW.X,{className:"h-3 w-3"}),s]})}function tu({data:e}){let{t:s}=(0,a.useTranslation)("web");return null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs||e.modelId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),e.modelId?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,t.jsx)("span",{className:"text-sm",children:(0,e9.getModelMeta)(e.modelId).displayName||e.modelId})]}):null,e.approvalGates?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eV,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(tc,{enabled:e.approvalGates.allowPrd,label:s("overviewTab.prd")}),(0,t.jsx)(tc,{enabled:e.approvalGates.allowPlan,label:s("overviewTab.plan")}),(0,t.jsx)(tc,{enabled:e.approvalGates.allowMerge,label:s("overviewTab.merge")})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eU,{className:"h-3 w-3"}),"Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(tc,{enabled:e.enableEvidence,label:s("overviewTab.collect")}),null!=e.commitEvidence?(0,t.jsx)(tc,{enabled:e.commitEvidence,label:s("overviewTab.addToPr")}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eg.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=e.push?(0,t.jsx)(tc,{enabled:e.push,label:s("overviewTab.push")}):null,null!=e.openPr?(0,t.jsx)(tc,{enabled:e.openPr,label:s("overviewTab.pr")}):null,null!=e.ciWatchEnabled?(0,t.jsx)(tc,{enabled:e.ciWatchEnabled,label:s("overviewTab.watch")}):null,null!=e.commitSpecs?(0,t.jsx)(tc,{enabled:e.commitSpecs,label:s("overviewTab.commitSpecs")}):null,null!=e.forkAndPr?(0,t.jsx)(tc,{enabled:e.forkAndPr,label:s("overviewTab.forkAndPr")}):null]})]}):null]})]}):null}function tm({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:s})]})}var tx=e.i(55016);let tp=(0,J.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var ek=ek,th=e.i(94819),tf=e.i(48109),tg=e.i(58860);let tj=(0,J.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),tb=(0,J.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function tv(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let s=new Date(e.startedAt).getTime();if(!Number.isNaN(s))return Math.max(0,t-s)}return 0}function tN(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ty(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function tw(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let tk={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},tC={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:o.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:eH.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:ew.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ek.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:d.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ek.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:th.Ban}};function tS(e){return e.startsWith("run:")}function tT({timings:e,loading:r,error:n,rejectionFeedback:i}){let{t:o}=(0,a.useTranslation)("web"),d=function(e){let[t,a]=(0,s.useState)(Date.now),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(r.current=setInterval(()=>a(Date.now()),1e3)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[e]),t}(e);if(r)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(tx.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:o("activityTab.noActivityRecorded")})]});let c=e.filter(e=>!tS(e.phase)),u=Math.max(...c.map(e=>tv(e,d)),...c.map(e=>e.approvalWaitMs??0),0),m=function(e,t){if(!e.length)return[];let s=e.filter(e=>"run:rejected"===e.phase).length,a=t?.length??0,r=e;if(a>s){r=[...e];let n=e[e.length-1].agentRunId;for(let e=s;e<a;e++){let a=t[e];e>s&&r.push({agentRunId:n,phase:"run:resumed",startedAt:a.timestamp??`synthetic-resumed-${e}`}),r.push({agentRunId:n,phase:"run:rejected",startedAt:a.timestamp??`synthetic-${e}`})}}let n=[],l=[],i=0;for(let e of r)if(l.push(e),"run:rejected"===e.phase){let e=t?.[i];n.push({number:n.length+1,timings:l,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),l=[],i++}return l.length>0&&n.push({number:n.length+1,timings:l}),n}(e,i),x=m.length>1,p=c.reduce((e,t)=>e+tv(t,d),0),h=c.reduce((e,t)=>e+(t.approvalWaitMs??0),0),f=c.reduce((e,t)=>e+(t.inputTokens??0),0),g=c.reduce((e,t)=>e+(t.outputTokens??0),0),j=c.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:m.map(e=>(0,t.jsx)(tM,{iteration:e,showHeader:x,maxDurationMs:u,now:d},e.number))}),p>0?(0,t.jsx)(tP,{totalExecMs:p,totalWaitMs:h,totalInputTokens:f,totalOutputTokens:g,totalCostUsd:j}):null]})}function tM({iteration:e,showHeader:s,maxDurationMs:a,now:r}){let n=function(e){let t=[...e.timings].reverse().find(e=>tS(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[s?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),n?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${n.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n.dotClass}`}),n.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((s,n)=>{if(tS(s.phase)){let a,r="run:rejected"===s.phase,l="run:failed"===s.phase||"run:crashed"===s.phase||"run:stopped"===s.phase;if(r)a=e.rejectionMessage;else if(l){let t=[...e.timings].reverse().find(e=>!tS(e.phase)&&e.errorMessage);a=t?.errorMessage??s.errorMessage}return(0,t.jsx)(tR,{timing:s,message:a,attachments:r?e.rejectionAttachments:void 0,isFirst:0===n,isLast:n===e.timings.length-1},`${s.agentRunId}-${s.phase}-${s.startedAt}`)}return(0,t.jsx)(tI,{timing:s,maxDurationMs:a,now:r},`${s.agentRunId}-${s.phase}-${s.startedAt}`)})]})]})}function tR({timing:e,message:s,attachments:a,isFirst:r,isLast:n}){let l,i=tC[e.phase];if(!i)return null;let o=a&&a.length>0,d=i.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${r?"pt-2":"pt-1"} ${n?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${i.bgClass}`,children:(0,t.jsx)(d,{className:`h-3 w-3 ${i.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${i.colorClass}`,children:i.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:ty(String(e.startedAt))}):null]}),s?(l="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${l?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[l?(0,t.jsx)(O.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(tf.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":l?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",s]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(e1,{text:"",attachmentPaths:a})}):null]})}function tI({timing:e,maxDurationMs:r,now:n}){let{t:l}=(0,a.useTranslation)("web"),i=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,o=e.phase.includes(":")?e.phase.split(":")[1]:null,d=null!==o,m=o?.startsWith("phase-")??!1,x=tk[i]??i,p=m?`Phase ${o.replace("phase-","")}`:null!==o?`${x} #${o}`:x,h=tv(e,n),f=!e.completedAt&&!!e.startedAt,g=f?15:2,j=r>0?Math.max(g,h/r*100):g,b=e.completedAt?m?"bg-emerald-400":d?"bg-amber-500":"bg-emerald-500":"bg-blue-500",v=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[N,y]=(0,s.useState)(!1),w=(0,s.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{y(!0),setTimeout(()=>y(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${d?"ms-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${f?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${f?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${d?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:w,className:"text-muted-foreground/50 hover:text-foreground/70 -ms-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:l("activityTab.copyPromptToClipboard"),children:N?(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(c.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${d?"h-1.5":"h-2"}`,children:f?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${b}`,style:{width:`${Math.min(j,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-sm font-medium tabular-nums",children:e7(h)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:ty(e.startedAt)}):null,null!=v&&v>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(eG.Zap,{className:"h-3 w-3 opacity-50"}),tN(v)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(tp,{className:"h-3 w-3 opacity-50"}),tw(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(tA,{timing:e,maxDurationMs:r}):null]})}function tA({timing:e,maxDurationMs:s}){let a=e.approvalWaitMs??0,r=s>0?Math.max(2,a/s*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(tg.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(r,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-xs tabular-nums",children:e7(a)})]})}function tP({totalExecMs:e,totalWaitMs:s,totalInputTokens:r,totalOutputTokens:n,totalCostUsd:l}){let{t:i}=(0,a.useTranslation)("web"),o=r+n;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(t$,{icon:tx.Clock,label:i("activityTab.execution"),value:e7(e)}),(0,t.jsx)(t$,{icon:tg.Timer,label:i("activityTab.wait"),value:s>0?e7(s):"n/a"}),(0,t.jsx)(t$,{icon:tx.Clock,label:"Wall-clock",value:s>0?e7(e+s):e7(e)}),(0,t.jsx)(t$,{icon:tp,label:i("activityTab.cost"),value:l>0?tw(l):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(eG.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),o>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:tN(o)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tj,{className:"h-3 w-3 text-blue-500 opacity-60"}),tN(r)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tb,{className:"h-3 w-3 text-emerald-500 opacity-60"}),tN(n)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function t$({icon:e,label:s,value:a,className:r=""}){let n="n/a"===a;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${r}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),s]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${n?"text-muted-foreground/40 italic":""}`,children:a})]})}var tD=e.i(7311),tE=e.i(44229);let tL=(0,J.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),tz=(0,J.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),tF=(0,J.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),tq=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,tB=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function tO(e){let t=e.match(tq);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,s,a,r,n,l]=t,i=null,o=null,d=null,c=l??"";if(null!=r&&null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null,c=`[${r}] ${l??""}`}else i=a,o=r,d=n??null;else if(null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null}else i=a;let u=c.match(tB),m="info";return u&&(m=u[1].toLowerCase(),c=u[2]),{timestamp:s??null,phase:i,agent:o,model:d,tag:m,message:c.trim(),raw:e}}function tU({content:e}){let a=(0,s.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(tO):[],[e]);return 0===a.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:a.map((e,s)=>(0,t.jsx)(tH,{line:e},s))})}function tH({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(tG,{line:e});case"tool-result":return(0,t.jsx)(tX,{line:e});case"text":case"delta":return(0,t.jsx)(tK,{line:e});case"result":return(0,t.jsx)(tQ,{line:e});case"tokens":case"turn":return(0,t.jsx)(tZ,{line:e});case"cmd":return(0,t.jsx)(tY,{line:e});case"file":return(0,t.jsx)(t0,{line:e});case"thread":case"event":case"info":return(0,t.jsx)(t2,{line:e});case"error":return(0,t.jsx)(t1,{line:e});case"worker":return(0,t.jsx)(tJ,{line:e});default:return(0,t.jsx)(t5,{line:e})}}function tV({value:e}){if(!e)return null;let s=e.replace(/^.*T/,"").replace("Z",""),a=s.split(":"),r=a.length>=3?`${a[1]}:${a[2].split(".")[0]}`:s;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:r})}function tW({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function tG({line:e}){var s;let a,{toolName:r,args:n}=-1===(a=(s=e.message).indexOf(" "))?{toolName:s,args:""}:{toolName:s.slice(0,a),args:s.slice(a+1)},l=function(e,t){try{let s=JSON.parse(t);if("Read"===e&&s.file_path||"Write"===e&&s.file_path||"Edit"===e&&s.file_path)return s.file_path;if("Glob"===e&&s.pattern||"Grep"===e&&s.pattern)return s.pattern;if("Bash"===e&&s.command)return s.command;if("Task"===e&&s.description)return s.description}catch{if(t.length>0)return t}return null}(r,n);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t_,{toolName:r}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:r}),l?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:l}):null]})]})}function t_({toolName:e}){let s=e.toLowerCase();return"bash"===s?(0,t.jsx)(E.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===s||"glob"===s||"grep"===s?(0,t.jsx)(ev.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===s||"edit"===s?(0,t.jsx)(tF,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)(E.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function tK({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tf.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function tQ({line:e}){var s;let a,r,{chars:n}=(a=(s=e.message).match(/^(\d+)\s+chars/),r=s.match(/session=(\S+)/),{chars:a?parseInt(a[1],10):0,sessionId:r?r[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ew.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",n.toLocaleString()," chars"]})]})]})}function tZ({line:e}){let s,{inputTokens:a,outputTokens:r}=(s=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(s[1],10),outputTokens:parseInt(s[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tL,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:a.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," out"]})]})]})}function tJ({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tz,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function tX({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ej,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:e.message})]})]})}function tY({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(o.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,t.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:e.message})]})]})}function t0({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tF,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:e.message})]})]})}function t1({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(O.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:e.message})]})]})}function t2({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function t5({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function t3({content:e,isConnected:r,error:n}){let{t:l}=(0,a.useTranslation)("web"),i=(0,s.useRef)(null),[o,d]=(0,s.useState)(!0),[c,u]=(0,s.useState)("structured"),m=(0,s.useCallback)(()=>{let e=i.current;e&&d(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),x=(0,s.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,d(!0))},[]);return((0,s.useEffect)(()=>{o&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,o]),n)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u("structured"),className:`rounded p-1 transition-colors ${"structured"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.structuredView"),children:(0,t.jsx)(ev.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>u("raw"),className:`rounded p-1 transition-colors ${"raw"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.rawView"),children:(0,t.jsx)(tE.Code,{className:"h-3.5 w-3.5"})}),o?null:(0,t.jsxs)("button",{type:"button",onClick:x,className:"text-muted-foreground hover:text-foreground ms-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(tD.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:i,onScroll:m,className:`flex-1 overflow-y-auto ${"raw"===c?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===c?(0,t.jsx)(tU,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(E.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:l("logTab.noLogOutput")}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let t4=(0,J.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var t6=e.i(95812),t8=e.i(87889);let t9=(0,J.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),t7={Todo:{icon:t6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:l.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:t8.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},se={icon:t6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function st({tasks:e}){let{t:s}=(0,a.useTranslation)("web");return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:s("taskProgress.noTasksDefined")})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(ss,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,s)=>(0,t.jsx)(sr,{task:e,index:s},e.title||`task-${s}`))})]})}function ss({tasks:e}){let{t:r}=(0,a.useTranslation)("web"),n=(0,s.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,s=e.filter(e=>"Work in Progress"===e.state).length,a=e.filter(e=>"Review"===e.state).length,r=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,n=e.length,l=n>0?Math.round(t/n*100):0;return{done:t,wip:s,review:a,todo:r,total:n,percent:l}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[n.done," of ",n.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${n.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.done>0?(0,t.jsx)(sa,{icon:u.Check,label:r("taskProgress.done"),count:n.done,className:"text-emerald-600"}):null,n.wip>0?(0,t.jsx)(sa,{icon:l.Loader2,label:r("taskProgress.inProgress"),count:n.wip,className:"text-blue-600"}):null,n.review>0?(0,t.jsx)(sa,{icon:t8.Eye,label:r("taskProgress.review"),count:n.review,className:"text-amber-600"}):null,n.todo>0?(0,t.jsx)(sa,{icon:t6.Circle,label:r("taskProgress.todo"),count:n.todo,className:"text-muted-foreground"}):null]})]})}function sa({icon:e,label:s,count:a,className:r}){return(0,t.jsxs)("span",{className:(0,K.cn)("flex items-center gap-1 text-xs",r),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),a," ",s]})}function sr({task:e,index:a}){let[r,n]=(0,s.useState)(!1),l=t7[e.state]??se,i=l.icon,o=e.actionItems.length>0,d=(0,s.useCallback)(()=>{o&&n(e=>!e)},[o]);return(0,t.jsxs)("div",{"data-testid":`task-card-${a}`,className:(0,K.cn)("rounded-lg border",l.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:d,disabled:!o,className:(0,K.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",o&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(i,{className:(0,K.cn)("mt-0.5 h-4 w-4 shrink-0",l.colorClass,l.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,K.cn)("text-sm font-medium",l.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),o?(0,t.jsx)(_.ChevronRight,{className:(0,K.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",r&&"rotate-90")}):null]}),r&&o?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,s)=>(0,t.jsx)(sn,{item:e},e.name||`ai-${s}`))})}):null]})}function sn({item:e}){let s=e.acceptanceCriteria.length,a=e.acceptanceCriteria.filter(e=>e.verified).length,r=s>0&&a===s;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[r?(0,t.jsx)(ew.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(t9,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),s>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[a,"/",s]}):null]}),s>0?(0,t.jsx)("div",{className:"ms-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,s)=>(0,t.jsx)(sl,{criterion:e},e.description||`ac-${s}`))}):null]})}function sl({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(t6.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,K.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let si={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function so({plan:e,loading:s,error:a}){return s?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):a?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:a})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(Q.Badge,{className:si[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(st,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(t4,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var sd=e.i(28112);function sc(){return{data:null,loading:!1,error:null}}let su=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"},{key:"chat",label:"Chat"}],sm={activity:async function(e){let t=await V(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await W(e);if("error"in t)throw Error(t.error);return t.plan}};function sx({featureName:e,headerContent:a,featureNode:n,featureId:i,initialTab:o,urlTab:d,prdData:c,prdSelections:u,onPrdSelect:m,onPrdApprove:x,onPrdReject:p,isPrdLoading:h,techData:f,onTechApprove:g,onTechReject:j,isTechLoading:b,productData:v,mergeData:N,onMergeApprove:y,onMergeReject:w,isMergeLoading:k,syncStatus:C,syncLoading:S,syncError:T,onRefreshSync:M,onRebaseOnMain:R,rebaseLoading:I,rebaseError:A,isRejecting:P,chatInput:$,onChatInputChange:D,sseEvents:E,interactiveAgentEnabled:L=!0}){let z=(0,r.usePathname)(),F=(0,s.useMemo)(()=>(function(e,t=!0){let s=["overview","activity"];return e.hasAgentRun&&s.push("log"),e.hasPlan&&s.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&s.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&s.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&s.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&s.push("merge-review"),t&&s.push("chat"),s})(n,L),[n,L]),q=(0,s.useMemo)(()=>su.filter(e=>F.includes(e.key)).map(e=>"merge-review"===e.key&&"maintain"===n.lifecycle?{...e,label:"Merge History"}:e),[F,n.lifecycle]),B=(0,s.useMemo)(()=>{let e=z.match(/^(\/feature\/[^/]+)/);return e?e[1]:z},[z]),V=(0,s.useMemo)(()=>d&&F.includes(d)?d:o&&F.includes(o)?o:"overview",[]),[W,G]=(0,s.useState)(V),_=function(e){let[t,a]=(0,s.useState)(""),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(null),d=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),n(!1)},[]);return(0,s.useEffect)(()=>{if(!e){a(""),n(!1),i(null);return}a(""),i(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{n(!0)},t.addEventListener("initial",e=>{a(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);a(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);i(t.error)}catch{i(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{n(!1)},()=>{t.close(),o.current=null}},[e,d]),{content:t,isConnected:r,error:l}}("log"===W?i:null),{tabs:K,fetchTab:Q,refreshTab:Z}=function(e,t){let a=Object.keys(t),[r,n]=(0,s.useState)(()=>{let e={};for(let t of a)e[t]=sc();return e}),l=(0,s.useRef)(t);l.current=t;let i=(0,s.useRef)(e);i.current=e;let o=(0,s.useRef)(!0);(0,s.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let d=(0,s.useRef)(e);(0,s.useEffect)(()=>{d.current!==e&&(d.current=e,n(e=>{let t={};for(let s of Object.keys(e))t[s]=sc();return t}))},[e]);let c=(0,s.useCallback)(async e=>{let t=l.current[e],s=i.current;if(t){o.current&&n(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let a=await t(s);o.current&&n(t=>({...t,[e]:{data:a,loading:!1,error:null}}))}catch(t){o.current&&n(s=>{let a=t instanceof Error?t.message:"Failed to fetch tab data",r=s[e]?.data??null;return{...s,[e]:{data:r,loading:!1,error:r?null:a}}})}}},[]),u=(0,s.useCallback)(async e=>{let t=r[e];t&&null!==t.data||t&&t.loading||await c(e)},[r,c]);return{tabs:r,fetchTab:u,refreshTab:(0,s.useCallback)(async e=>{await c(e)},[c])}}(i,sm),J=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!J.current)return;J.current=!1;let e="overview"===W?B:`${B}/${W}`;e!==z&&window.history.pushState(null,"",e)},[W,B,z]);let X=(0,s.useRef)(z);(0,s.useEffect)(()=>{if(X.current===z||(X.current=z,J.current))return;let e=z.split("/"),t=e.length>=4?e[3]:void 0,s=t&&F.includes(t)?t:"overview";s!==W&&(G(s),("activity"===s||"plan"===s)&&Q(s))},[z]);let Y=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!Y.current&&(Y.current=!0,!d&&"overview"!==V)){let e=`${B}/${V}`;e!==z&&window.history.replaceState(null,"",e)}},[]);let ee=(0,s.useRef)(!1);(0,s.useEffect)(()=>{ee.current||(ee.current=!0,("activity"===W||"plan"===W)&&Q(W))},[W,Q]);let et=(0,s.useRef)(i);(0,s.useEffect)(()=>{et.current!==i&&(et.current=i,G("overview"))},[i]);let es=(0,s.useRef)(o);(0,s.useEffect)(()=>{if(es.current!==o&&o&&F.includes(o)){es.current=o,G(o),("activity"===o||"plan"===o)&&Q(o);let e="overview"===o?B:`${B}/${o}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[o,F,B,Q]),(0,s.useEffect)(()=>{F.includes(W)||(G("overview"),window.location.pathname!==B&&window.history.replaceState(null,"",B))},[F,W,B]);let ea=(0,s.useRef)(W);ea.current=W;let er=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!E||0===E.length||(er.current>E.length&&(er.current=0),E.length<=er.current))return;let e=E.slice(er.current);if(er.current=E.length,!e.some(e=>e.featureId===i))return;Z("activity");let t=ea.current;"plan"===t&&Z(t)},[E,i,Z]);let el="running"===n.state||"creating"===n.state;(0,s.useEffect)(()=>{if(!el)return;let e=setInterval(()=>{Z("activity")},5e3);return()=>clearInterval(e)},[el,Z]);let ei=(0,s.useCallback)(e=>{J.current=!0,G(e),("activity"===e||"plan"===e)&&Q(e)},[Q]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(U.Tabs,{value:W,onValueChange:ei,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-3","data-testid":"feature-drawer-header",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-4 pe-6",children:[e?(0,t.jsx)("h2",{className:"text-foreground min-w-0 shrink truncate text-base font-semibold tracking-tight",children:e}):null,(0,t.jsx)(U.TabsList,{className:"h-auto shrink-0 gap-0.5 rounded-none border-0 bg-transparent p-0",children:q.map(e=>(0,t.jsx)(U.TabsTrigger,{value:e.key,className:"text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary h-auto rounded-none border-b-2 border-transparent bg-transparent px-2 py-0.5 text-[12px] font-medium shadow-none transition-colors data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:e.label},e.key))})]}),a]}),(0,t.jsx)(H.Separator,{}),(0,t.jsx)(U.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ta,{data:n,syncStatus:C,syncLoading:S,syncError:T,onRefreshSync:M,onRebaseOnMain:R,rebaseLoading:I,rebaseError:A})}),(0,t.jsx)(U.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tT,{timings:K.activity.data?.timings??null,loading:K.activity.loading,error:K.activity.error,rejectionFeedback:K.activity.data?.rejectionFeedback})}),(0,t.jsx)(U.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(t3,{content:_.content,isConnected:_.isConnected,error:_.error})}),(0,t.jsx)(U.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(so,{plan:K.plan.data,loading:K.plan.loading,error:K.plan.error})}),F.includes("prd-review")?(0,t.jsx)(U.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:c?(0,t.jsx)(en,{data:c,selections:u??{},onSelect:m??(()=>void 0),onApprove:x??(()=>void 0),onReject:p,isProcessing:h,isRejecting:P,chatInput:$,onChatInputChange:D}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,F.includes("tech-decisions")?(0,t.jsx)(U.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:f?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(eu,{data:f})}),(0,t.jsx)(sp,{onApprove:g??(()=>void 0),onReject:j,isProcessing:b,isRejecting:P,chatInput:$,onChatInputChange:D})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,F.includes("product-decisions")?(0,t.jsx)(U.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===v?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):v?(0,t.jsx)(ep,{data:v}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,F.includes("merge-review")?(0,t.jsx)(U.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:N?(0,t.jsx)(eO,{data:N,readOnly:"maintain"===n.lifecycle,onApprove:y??(()=>void 0),onReject:w,isProcessing:k,isRejecting:P,chatInput:$,onChatInputChange:D}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:k?(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(O.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,F.includes("chat")?(0,t.jsx)(U.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(sd.ChatTab,{featureId:i,worktreePath:n.worktreePath})}):null]})})}function sp({onApprove:e,onReject:s,isProcessing:r,isRejecting:n,chatInput:l,onChatInputChange:i}){let{t:o}=(0,a.useTranslation)("web");return(0,t.jsx)(er,{onReject:s,onApprove:e,approveLabel:o("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:n,chatInput:l,onChatInputChange:i})}var sh=e.i(48044),sf=e.i(78692),sg=e.i(37740);let sj=(0,f.createServerReference)("406c7c09aee727dcd210851e8a48c6c5808babf743",f.callServer,void 0,f.findSourceMapURL,"rebaseFeature");var sb=e.i(99045);function sv(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function sN(e,t,a,r,l,i){let[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(a),u=(0,s.useRef)(r);return c.current=a,u.current=r,(0,s.useEffect)(()=>{if(u.current(),!e)return;let s=!1;return d(!0),t(e).then(e=>{s||c.current(e)}).catch(()=>{!s&&l&&n.toast.error(l)}).finally(()=>{s||d(!1)}),()=>{s=!0}},[e,t,l,i]),o}let sy=(0,f.createServerReference)("40f9c04ef94440f6f28f28ec937bd00c290e0c61ca",f.callServer,void 0,f.findSourceMapURL,"getFeatureDrawerData"),sw=(0,f.createServerReference)("404e3df03919d08e9e39406b1cdf34e5976639d5e2",f.callServer,void 0,f.findSourceMapURL,"getBranchSyncStatus"),sk=new Map;function sC({view:e,urlTab:f,interactiveAgentEnabled:E=!0}){var L;let z,F,q,O,U,H=(0,k.useFeatureFlags)(),{t:V}=(0,a.useTranslation)("web"),W=(0,r.useRouter)(),G=(0,C.useSoundAction)("reject"),[_,K]=(0,s.useState)(e);(0,s.useEffect)(()=>{K(e)},[e]);let Q="feature"===_.type?_.node:null,{events:Z}=(0,M.useAgentEventsContext)(),J=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(J.current>Z.length&&(J.current=0),!Q||Z.length<=J.current)return;let e=Z.slice(J.current);for(let t of(J.current=Z.length,(0,sb.resolveSseEventUpdates)(e)))t.featureId===Q.featureId&&"deleting"!==Q.state&&(void 0!==t.state||void 0!==t.lifecycle)&&K(e=>{if("feature"!==e.type)return e;let s={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:s,initialTab:sv(s)}})},[Z,Q]);let X=(0,r.usePathname)().startsWith("/feature/");L=Q?.featureId??null,z=(0,s.useRef)(X),F=(0,s.useRef)(!1),q=(0,s.useCallback)(async()=>{if(L&&!F.current){F.current=!0;try{let e=await sy(L);if(!e)return;K(t=>(function(e,t){if("feature"!==e.type)return e;let s={...e.node,...t},a=s.state!==e.node.state||s.lifecycle!==e.node.lifecycle;return{...e,node:s,initialTab:a?sv(s):e.initialTab}})(t,e))}catch{}finally{F.current=!1}}},[L,K]),O=(0,s.useRef)(!1),(0,s.useEffect)(()=>{!X||z.current&&O.current||(O.current=!0,q()),z.current=X},[X,q]),(0,s.useEffect)(()=>{if(!X||!L)return;let e=setInterval(()=>{q()},15e3);return()=>clearInterval(e)},[X,L,q]);let Y=(0,s.useCallback)(()=>{W.push("/")},[W]),[ee,et]=(0,s.useState)(""),[es,ea]=(0,s.useState)(null),[er,en]=(0,s.useState)({}),[el,ei]=(0,s.useState)({}),[eo,ed]=(0,s.useState)(null),[ec,eu]=(0,s.useState)(void 0),[em,ex]=(0,s.useState)(null),[ep,eh]=(0,s.useState)(!1),[ef,eg]=(0,s.useState)(!1),[ej,eb]=(0,s.useState)(!1),ev=`${Q?.featureId}:${Q?.state}`,eN=(0,s.useRef)(ev);(0,s.useEffect)(()=>{ev!==eN.current&&(eN.current=ev,eb(!1))},[ev]);let[ey,ew]=(0,s.useState)(!1),ek=(0,s.useRef)(!1),eC="feature"===_.type?_.initialTab:void 0;(0,s.useEffect)(()=>{et("")},[eC]);let eS=(0,s.useRef)(0),eT=(0,s.useRef)(Q?.state),eM=(0,s.useRef)(Q?.lifecycle);(Q?.state!==eT.current||Q?.lifecycle!==eM.current)&&(eT.current=Q?.state,eM.current=Q?.lifecycle,eS.current+=1);let eR=eS.current,eI=sN(Q?.lifecycle==="requirements"&&Q?.state==="action-required"?Q.featureId:null,N,e=>{if(e.error)return void n.toast.error(e.error);if(e.questionnaire){ea(e.questionnaire);let t={};for(let s of e.questionnaire.questions){let e=s.options.find(e=>e.recommended);e&&(t[s.id]=e.id)}en(t),ei(t)}},()=>{en({}),ei({}),ea(null)},"Failed to load questionnaire",eR),eA=Q?.lifecycle==="implementation"&&Q?.state==="action-required"?Q.featureId:null,eP=sN(eA,y,e=>{e.error?n.toast.error(e.error):e.techDecisions&&ed(e.techDecisions)},()=>ed(null),"Failed to load tech decisions",eR),e$=sN(eA,N,e=>{e.productDecisions&&eu(e.productDecisions)},()=>eu(void 0),void 0,eR),eD=sN(Q?.lifecycle==="review"&&(Q?.state==="action-required"||Q?.state==="error")||Q?.lifecycle==="maintain"&&Q?.pr?Q.featureId:null,w,e=>{"error"in e?n.toast.error(e.error):ex(e)},()=>ex(null),"Failed to load merge review data",eR),eE=ee.trim().length>0,eL=Q?.lifecycle==="requirements"&&Q?.state==="action-required"&&Object.keys(el).some(e=>el[e]!==er[e]),ez=(0,s.useCallback)(()=>{et(""),en({...el})},[el]),{attemptClose:eF}=(0,S.useGuardedDrawerClose)({open:X,isDirty:eE||eL,onClose:Y,onReset:ez}),eq=(0,s.useCallback)(async(e,t,s=[],a)=>{if(Q?.featureId){ek.current=!0,ew(!0);try{let r=s.map(e=>e.path).filter(Boolean),l=s.filter(e=>e.notes?.trim()),i=l.length>0?`${e}
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36986,e=>{"use strict";var t=e.i(20314),s=e.i(79054);e.i(41001);var a=e.i(64780),r=e.i(31406),n=e.i(60112),l=e.i(83428),i=e.i(67669),o=e.i(24042),d=e.i(6910),c=e.i(33548),u=e.i(23925),m=e.i(8986),x=e.i(30702),p=e.i(37260),h=e.i(83299),f=e.i(21023);let g=(0,f.createServerReference)("60de579ff44a016e4dd4c77f74505b5b48fcaab96f",f.callServer,void 0,f.findSourceMapURL,"approveFeature");var j=e.i(70096),b=e.i(30732);let v=(0,f.createServerReference)("70f9de08b91c9f0a00aeb3f769e05a79f842f94f70",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),N=(0,f.createServerReference)("402e1e440c414339ac7a67cd4d12f54a63a884c792",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),y=(0,f.createServerReference)("408f99cdf32f407f0c1991a2c6e798d07285ea1d01",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),w=(0,f.createServerReference)("400190a337fc0ab5ce4c13dad792e2a8474892811d",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),C=e.i(8361),S=e.i(30153),T=e.i(8537),M=e.i(39443);e.i(1650);var R=e.i(11495);e.i(99348);var I=e.i(5259),A=e.i(35364),P=e.i(2828);e.i(31566);var $=e.i(65104);e.i(81803);var D=e.i(72714),E=e.i(38573),L=e.i(19933),z=e.i(99105),F=e.i(51251),q=e.i(70646);function B({actions:e,repositoryPath:a,worktreePath:r,showSpecs:n}){let[i,o]=(0,s.useState)(!1),d=e.ideLoading||e.shellLoading||e.folderLoading||e.specsLoading,x=e.ideError??e.shellError??e.folderError??e.specsError;return(0,t.jsxs)(q.DropdownMenu,{modal:!1,children:[(0,t.jsx)(q.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(A.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:d,children:[d?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):x?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(z.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(q.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,t.jsx)(q.DropdownMenuLabel,{children:"Open in"}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(m.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(E.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openFolder,disabled:e.folderLoading,className:"gap-2",children:[e.folderLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.folderError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Folder"]}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!n,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(F.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(L.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(q.DropdownMenuSeparator,{}),(0,t.jsxs)(q.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(r??a),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[i?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),i?"Copied!":"Copy path"]})]})]})}var O=e.i(79687),U=e.i(68304),H=e.i(25235);let V=(0,f.createServerReference)("40b4a5a239d8d4ef81e5f1f4a7c596c6ba3f8e0287",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),W=(0,f.createServerReference)("409bd9256d009d32ec172f5dc69e763ae342f39a05",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var G=e.i(11345),_=e.i(76016),K=e.i(31777),Q=e.i(81846),Z=e.i(16868),J=e.i(3645);let X=(0,J.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var Y=e.i(58481),ee=e.i(48306);e.i(50032);var et=e.i(86254),es=e.i(42076);let ea=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function er({onReject:e,onApprove:r,approveLabel:n,approveVariant:l="default",revisionPlaceholder:i,isProcessing:o=!1,isRejecting:d=!1,children:c,chatInput:m,onChatInputChange:x}){let{t:p}=(0,a.useTranslation)("web"),h="warning"===l,f=h?Y.AlertTriangle:u.Check,g=h?"bg-orange-500/85":"bg-blue-500/85",[j,b]=(0,s.useState)(""),v=m??j,N=x??b,y=(0,C.useSoundAction)("approve"),w=o||d,[k,S]=(0,s.useState)([]),[T,M]=(0,s.useState)(!1),[R,I]=(0,s.useState)(null),[$,D]=(0,s.useState)(!1),[E,L]=(0,s.useState)(!1),[z,F]=(0,s.useState)(!1),q=v.trim().length>0,B=q?$||E&&z:!$,O=(0,s.useRef)(0),U=(0,s.useRef)(crypto.randomUUID()),H=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&L(!0),"Shift"===e.key&&F(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&L(!1),"Shift"===e.key&&F(!1)}function s(){L(!1),F(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",s)}},[]);let V=(0,s.useCallback)(async e=>{for(let t of(I(null),e)){if(t.size>0xa00000)return void I(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!ea.has(e))return void I(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();S(s=>[...s,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let s=new FormData;s.append("file",t),s.append("sessionId",U.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:s});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));S(t=>t.filter(t=>t.id!==e)),I(t.error??"Upload failed");return}let r=await a.json();S(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{S(t=>t.filter(t=>t.id!==e)),I("Upload failed")}}},[]),W=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current+=1,1===O.current&&M(!0)},[]),_=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current-=1,0===O.current&&M(!1)},[]),Q=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),J=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O.current=0,M(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&V(t)},[V]),er=(0,s.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let s=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&s.push(t)}s.length>0&&(e.preventDefault(),V(s))},[V]),en=(0,s.useCallback)(async()=>{try{let e=await (0,es.pickFiles)();e&&S(t=>{let s=new Set(t.map(e=>e.path)),a=e.filter(e=>!s.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return a.length>0?[...t,...a]:t})}catch{}},[]),el=(0,s.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),ei=(0,s.useCallback)((e,t)=>{S(s=>s.map(s=>s.id===e?{...s,notes:t}:s))},[]),eo=(0,s.useCallback)(()=>{N(""),S([]),I(null)},[N]),ed=(0,s.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),H.current?.requestSubmit())},[]),ec="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:H,onSubmit:function(t){t.preventDefault();let s=v.trim();if(B)y.play(),r(),eo();else{if(!s||!e)return;e(s,k.filter(e=>!e.loading)),eo()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":p("createDrawer.fileDropZone"),"data-drag-over":T?"true":"false",onDragEnter:W,onDragLeave:_,onDragOver:Q,onDrop:J,className:(0,K.cn)("rounded-md border-2 border-transparent transition-colors",T&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(ee.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:w,value:v,onChange:e=>N(e.target.value),onKeyDown:ed,onPaste:er,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),k.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:k.map(e=>(0,t.jsx)(et.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>el(e.id),disabled:w,loading:e.loading,notes:e.notes,onNotesChange:t=>ei(e.id,t)},e.id))}),R?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:R}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[ec,"+Enter"]})," ",q?"reject":"approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:en,disabled:w,"aria-label":p("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(Z.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:p("chat.attachFiles")})]}),(0,t.jsx)("div",{onMouseLeave:()=>D(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:w,"data-testid":"drawer-action-submit",className:(0,K.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border ps-4 pe-10 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",B?`${h?"border-orange-400/60":"border-blue-400/60"} text-white`:q&&E&&!z?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,K.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",g),style:{transform:B?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,K.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pe-8 transition-opacity duration-300",B?"opacity-0":"opacity-100"),children:[(0,t.jsx)(X,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,K.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",B?"opacity-100":"opacity-0"),children:[(0,t.jsx)(f,{className:"h-4 w-4 shrink-0"}),n]}),(0,t.jsx)("span",{className:(0,K.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-e-[5px] border-s ${g} transition-opacity duration-300`,!q&&!$&&"pointer-events-none opacity-0"),onMouseEnter:()=>D(!0),children:(0,t.jsx)(G.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),h?null:(0,t.jsx)(P.TooltipContent,{side:"top",children:B?n:p("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(A.Button,{type:"button",className:"flex-1",disabled:w,onClick:()=>{y.play(),r()},children:n})})]})}function en({data:e,selections:a,onSelect:r,onApprove:n,onReject:l,isProcessing:i=!1,isRejecting:o=!1,showHeader:d=!1,chatInput:c,onChatInputChange:u}){let{question:m,context:x,questions:p,finalAction:h}=e,[f,g]=(0,s.useState)(0),j=(0,C.useSoundAction)("select"),b=(0,C.useSoundAction)("navigate"),v=p.length,N=f===v-1,y=p[f],w=(0,s.useMemo)(()=>Object.keys(a).length,[a]),k=(0,s.useCallback)((e,t)=>{j.play(),r(e,t),N||setTimeout(()=>g(e=>e+1),250)},[r,N,j]);return 0===v?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[d?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:x})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[f+1,". ",y.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:p.map((e,s)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${s+1}`,className:(0,K.cn)("h-1.5 rounded-full transition-all duration-200",s===f?"bg-primary w-4":"w-1.5",s!==f&&a[e.id]?"bg-primary/50":"",s===f||a[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{b.play(),g(s)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:y.options.map((e,s)=>{let r=a[y.id]===e.id,n=String.fromCharCode(65+s);return(0,t.jsx)("button",{type:"button",className:(0,K.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-start text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",r&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:i,onClick:()=>k(y.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[n,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(Q.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(Q.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(A.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===f||i,onClick:()=>{b.play(),g(e=>e-1)},children:[(0,t.jsx)(G.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),N?null:(0,t.jsxs)(A.Button,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:()=>{b.play(),g(e=>e+1)},children:[a[y.id]?"Next":"Skip",(0,t.jsx)(_.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,t.jsx)(er,{onReject:l,onApprove:()=>n(h.id),approveLabel:h.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:i,isRejecting:o,chatInput:c,onChatInputChange:u,children:(0,t.jsx)("div",{className:(0,K.cn)("bg-muted h-1.5 overflow-hidden",w>0&&w<v||i?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:i?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${v>0?w/v*100:0}%`},"data-testid":"progress-bar"})})})]})}var el=e.i(427);let ei=(0,J.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),eo=(0,J.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),ed={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:s})=>s?(0,t.jsx)("code",{className:`${s} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 ps-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 ps-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:s})=>(0,t.jsx)("a",{href:s,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function ec({decision:e,index:a}){let[r,n]=(0,s.useState)(!1),l=(0,C.useSoundAction)("expand"),i=(0,C.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:a+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(Q.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(el.default,{components:ed,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r?i.play():l.play(),n(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(_.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${r?"rotate-90":""}`}),(0,t.jsx)(eo,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),r?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function eu({data:e}){let{summary:s,decisions:a}=e;return 0===a.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),s?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(ei,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),a.map((e,s)=>(0,t.jsx)(ec,{decision:e,index:s},e.title))]})}var em=e.i(41698);function ex({item:e,index:s}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:s+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(Q.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function ep({data:e}){let{questions:s}=e;return 0===s.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(em.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),s.map((e,s)=>(0,t.jsx)(ex,{item:e,index:s},e.question))]})}let eh=(0,J.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var ef=e.i(48923),eg=e.i(49228);let ej=(0,J.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),eb=(0,J.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var ev=e.i(70471);let eN=(0,J.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var ey=e.i(81181),ew=e.i(35e3),ek=e.i(30090),ek=ek,eC=e.i(17406);function eS({status:e}){switch(e){case eC.CiStatus.Success:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(ew.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case eC.CiStatus.Pending:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(l.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case eC.CiStatus.Failure:return(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(ek.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}let eT=(0,J.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),eM=(0,J.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),eR=(0,J.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),eI={added:{icon:eT,label:"A",className:"text-green-600"},modified:{icon:eR,label:"M",className:"text-amber-600"},deleted:{icon:eM,label:"D",className:"text-red-600"},renamed:{icon:eR,label:"R",className:"text-blue-600"}};function eA({status:e}){let s=eI[e],a=s.icon;return(0,t.jsx)(a,{className:(0,K.cn)("h-3.5 w-3.5 shrink-0",s.className)})}function eP({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,K.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,K.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pe-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function e$({file:e}){let[a,r]=(0,s.useState)(!1),n=e.path.split("/").pop()??e.path,l=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r(!a),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,t.jsx)(_.ChevronRight,{className:(0,K.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",a&&"rotate-90")}),(0,t.jsx)(eA,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[l,"/"]}),n]}):n}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),a&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(eP,{hunk:e},e.header))}):null]})}function eD({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(ev.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(e$,{file:e},`${e.status}-${e.path}`))})]})}let eE={Screenshot:eb,Video:eN,TestOutput:ev.FileText,TerminalRecording:E.Terminal},eL=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),ez=new Set([".mp4",".webm",".mov"]);function eF({evidence:e}){var a,r;let n,[l,i]=(0,s.useState)(!0),o=eE[e.type]??eb,d=(n=(a=e.relativePath).lastIndexOf("."))>=0?a.slice(n).toLowerCase():"",c=(r=e.relativePath,`/api/evidence?path=${encodeURIComponent(r)}`),u="Screenshot"===e.type||eL.has(d),m="Video"===e.type||ez.has(d),x="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!l),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-start",children:[l?(0,t.jsx)(z.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(_.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:c,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(ey.Download,{className:"h-3 w-3"})})]}),l&&c?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:u?(0,t.jsx)("img",{src:c,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):m?(0,t.jsx)("video",{src:c,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):x?(0,t.jsx)(eq,{url:c}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function eq({url:e}){let[a,r]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);return n?a?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:a}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");r(t.length>100?`${t.slice(0,100).join("\n")}
|
|
2
|
+
...`:e)}).catch(()=>r(null)).finally(()=>l(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function eB({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eb,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(Q.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eF,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function eO({data:e,readOnly:s=!1,onApprove:a,onReject:r,isProcessing:n=!1,isRejecting:l=!1,chatInput:i,onChatInputChange:o}){let{pr:d,diffSummary:c,fileDiffs:u,branch:m,warning:p,evidence:h,hideCiStatus:f}=e,g=d?.mergeable===!1,j=g&&r?()=>r("Resolve merge conflicts",[]):a;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:s?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"This feature was merged. Review the pull request details and evidence below.":d?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),m?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(eg.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(Q.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:m.source}),(0,t.jsx)(ej,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(Q.Badge,{variant:"outline",className:"font-mono text-[11px]",children:m.target})]})}):null,d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",d.number,(0,t.jsx)(x.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(Q.Badge,{variant:"outline",className:"text-xs",children:d.status})]}),!1===d.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(Y.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,d.ciStatus&&!0!==f?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eS,{status:d.ciStatus})]}):null,d.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ef.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:d.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eh,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):p?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(Y.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:p})]})}):null,h&&h.length>0?(0,t.jsx)(eB,{evidence:h}):null,u&&u.length>0?(0,t.jsx)(eD,{fileDiffs:u}):null]}),!s&&(0,t.jsx)(er,{onReject:r,onApprove:j,approveLabel:g?"Resolve Conflicts":"Approve Merge",approveVariant:g?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:n,isRejecting:l,chatInput:i,onChatInputChange:o})]})}let eU=(0,J.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var eH=e.i(38227);let eV=(0,J.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var eW=e.i(60253),eG=e.i(53360),e_=e.i(2287),eK=e.i(28267),eQ=e.i(80436);let eZ=(0,J.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),eJ=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function eX(e){let t=e.lastIndexOf(".");return t>=0&&eJ.has(e.slice(t).toLowerCase())}function eY(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",s=eX(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",a=new URLSearchParams({path:e,...s&&{mimeType:s}});return`/api/attachments/preview?${a.toString()}`}let e0=/(?:^|\s)@(\/[^\s]+)/g;function e1({text:e,attachmentPaths:s}){let a=function(e){let t=[],s=0;for(let a of e.matchAll(e0)){let r=a.index,n=r+(a[0].length-a[0].trimStart().length);n>s&&t.push({type:"text",value:e.slice(s,n)}),t.push({type:"attachment",path:a[1]}),s=r+a[0].length}return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}(e),r=a.some(e=>"attachment"===e.type),n=s?.filter(Boolean)??[];return r||0!==n.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[a.map(e=>{if("text"===e.type){let s=e.value.trim();return s?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:s},`text-${s.slice(0,40)}`):null}return(0,t.jsx)(e2,{path:e.path},`att-${e.path}`)}),n.map(e=>(0,t.jsx)(e2,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function e2({path:e}){let a=e.split("/").pop()??e,[r,n]=(0,s.useState)(!1);return eX(e)?r?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(eZ,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}):(0,t.jsxs)(e_.Dialog,{children:[(0,t.jsx)(e_.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:eY(e),alt:a,"data-testid":"inline-attachment-image",onError:()=>n(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(e_.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(eK.VisuallyHidden.Root,{children:(0,t.jsxs)(e_.DialogTitle,{children:["Preview: ",a]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:eY(e),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a})}),(0,t.jsx)("a",{href:eY(e),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,t.jsx)(eQ.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:eY(e),download:a,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:a})}let e5=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),e3=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function e4({className:e,size:s="md",duration:a=5,...r}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,K.cn)(e5({size:s}),e),...r,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${a}s`,repeatCount:"indefinite"}),e3.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var e6=e.i(2929),e8=e.i(86782),e9=e.i(29847);function e7(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let s=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return s>0?`${s}h ${a}m`:a>0?`${a}m ${r}s`:`${r}s`}let te=(0,J.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var tt=e.i(59311);function ts({syncStatus:e,syncLoading:s,syncError:r,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i,rebaseError:o}){let{t:d}=(0,a.useTranslation)("web"),c=null!=e&&e.behind>0,u=e?.behind===0,m=e?.baseBranch??"main";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:s&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"text-sm text-red-600",children:r})]}):i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}),(0,t.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),"..."]})]}):c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,t.jsxs)("span",{className:"text-sm",children:[e.behind," commit",1===e.behind?"":"s"," behind"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",e.ahead," ahead"]}):null]})]}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ew.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,t.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||r)&&!i?(0,t.jsx)("button",{"data-testid":"sync-refresh-button",onClick:n,disabled:s,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":d("branchSyncStatus.refreshSyncStatus"),children:(0,t.jsx)(tt.RefreshCw,{className:`h-3.5 w-3.5 ${s?"animate-spin":""}`})}):null]}),c&&!i?(0,t.jsx)(D.ActionButton,{label:d("branchSyncStatus.rebaseOnMain"),onClick:l,loading:!1,error:!!o,icon:te,variant:"outline",size:"sm"}):null,o?(0,t.jsx)("p",{className:"text-destructive text-xs",children:o}):null]})]})}function ta({data:e,syncStatus:s,syncLoading:a,syncError:r,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i,rebaseError:o}){let c="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:e6.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(tr,{data:e}),"error"===e.state&&e.onRetry?(0,t.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>e.onRetry(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(eH.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===e.state||"action-required"===e.state)&&e.onStop?(0,t.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>e.onStop(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(d.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!c&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,K.cn)("h-full rounded-full transition-all",e6.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,c&&e.pr?(0,t.jsx)(ti,{pr:e.pr,hideCiStatus:e.hideCiStatus}):null]}),(0,t.jsx)(tn,{data:e}),!c&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(ti,{pr:e.pr,hideCiStatus:e.hideCiStatus})})]}):null,(0,t.jsx)(to,{data:e}),l&&e.branch&&n?(0,t.jsx)(ts,{syncStatus:s??null,syncLoading:a??!1,syncError:r??null,onRefreshSync:n,onRebaseOnMain:l,rebaseLoading:i??!1,rebaseError:o??null}):null,(0,t.jsx)(tu,{data:e})]})}function tr({data:e}){let s=e6.featureNodeStateConfig[e.state],a=s.icon;return(0,t.jsxs)("div",{className:(0,K.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",s.badgeBgClass,s.badgeClass),children:["running"===e.state?(0,t.jsx)(e4,{size:"sm",className:"shrink-0"}):(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:s.label})]})}function tn({data:e}){var s;let r,n,l,i,o,{t:d}=(0,a.useTranslation)("web"),c=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return e.branch||e.oneLiner||c||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(eg.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(e1,{text:e.userQuery})]}):null,c?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(tm,{label:d("overviewTab.created"),value:(s=e.createdAt,r=Date.now(),(o=Math.floor((i=Math.floor((l=Math.floor(Math.floor((r-(n="string"==typeof s?new Date(s).getTime():s))/1e3)/60))/60))/24))>30?new Date(n).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):o>0?`${o} day${1===o?"":"s"} ago`:i>0?`${i} hour${1===i?"":"s"} ago`:l>0?`${l} minute${1===l?"":"s"} ago`:"just now")}):null]})]}):null}let tl={[eC.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[eC.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[eC.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function ti({pr:e,hideCiStatus:s}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(x.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(Q.Badge,{className:tl[e.status],children:e.status})]}),e.ciStatus&&!0!==s?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eS,{status:e.ciStatus})]}):null,!1===e.mergeable?(0,t.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(Q.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(Y.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ef.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function to({data:e}){let{t:r}=(0,a.useTranslation)("web"),n=function(e){let[t,a]=(0,s.useState)(null),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>e?(a(e7(Math.max(0,Date.now()-e))),r.current=setInterval(()=>{a(e7(Math.max(0,Date.now()-e)))},1e3),()=>{r.current&&(clearInterval(r.current),r.current=null)}):void a(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0);return e.fastMode??e.agentType??e.runtime??n??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(eG.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(td,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(tm,{label:r("overviewTab.runtime"),value:e.runtime}):null,!e.runtime&&n?(0,t.jsx)(tm,{label:r("overviewTab.runningFor"),value:n}):null,e.blockedBy?(0,t.jsx)(tm,{label:r("overviewTab.blockedBy"),value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(tm,{label:r("overviewTab.error"),value:e.errorMessage}):null]})]}):null}function td({agentType:e}){let s=(0,e8.getAgentTypeIcon)(e),a=e8.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0"}),a]})]})}function tc({enabled:e,label:s}){return(0,t.jsxs)("span",{className:(0,K.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",e?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[e?(0,t.jsx)(u.Check,{className:"h-3 w-3"}):(0,t.jsx)(eW.X,{className:"h-3 w-3"}),s]})}function tu({data:e}){let{t:s}=(0,a.useTranslation)("web");return null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs||e.modelId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),e.modelId?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,t.jsx)("span",{className:"text-sm",children:(0,e9.getModelMeta)(e.modelId).displayName||e.modelId})]}):null,e.approvalGates?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eV,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(tc,{enabled:e.approvalGates.allowPrd,label:s("overviewTab.prd")}),(0,t.jsx)(tc,{enabled:e.approvalGates.allowPlan,label:s("overviewTab.plan")}),(0,t.jsx)(tc,{enabled:e.approvalGates.allowMerge,label:s("overviewTab.merge")})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eU,{className:"h-3 w-3"}),"Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(tc,{enabled:e.enableEvidence,label:s("overviewTab.collect")}),null!=e.commitEvidence?(0,t.jsx)(tc,{enabled:e.commitEvidence,label:s("overviewTab.addToPr")}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(eg.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=e.push?(0,t.jsx)(tc,{enabled:e.push,label:s("overviewTab.push")}):null,null!=e.openPr?(0,t.jsx)(tc,{enabled:e.openPr,label:s("overviewTab.pr")}):null,null!=e.ciWatchEnabled?(0,t.jsx)(tc,{enabled:e.ciWatchEnabled,label:s("overviewTab.watch")}):null,null!=e.commitSpecs?(0,t.jsx)(tc,{enabled:e.commitSpecs,label:s("overviewTab.commitSpecs")}):null,null!=e.forkAndPr?(0,t.jsx)(tc,{enabled:e.forkAndPr,label:s("overviewTab.forkAndPr")}):null]})]}):null]})]}):null}function tm({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:s})]})}var tx=e.i(55016);let tp=(0,J.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var ek=ek,th=e.i(94819),tf=e.i(48109),tg=e.i(58860);let tj=(0,J.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),tb=(0,J.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function tv(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let s=new Date(e.startedAt).getTime();if(!Number.isNaN(s))return Math.max(0,t-s)}return 0}function tN(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ty(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function tw(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let tk={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},tC={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:o.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:eH.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:ew.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ek.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:d.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ek.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:th.Ban}};function tS(e){return e.startsWith("run:")}function tT({timings:e,loading:r,error:n,rejectionFeedback:i}){let{t:o}=(0,a.useTranslation)("web"),d=function(e){let[t,a]=(0,s.useState)(Date.now),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(r.current=setInterval(()=>a(Date.now()),1e3)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[e]),t}(e);if(r)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(tx.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:o("activityTab.noActivityRecorded")})]});let c=e.filter(e=>!tS(e.phase)),u=Math.max(...c.map(e=>tv(e,d)),...c.map(e=>e.approvalWaitMs??0),0),m=function(e,t){if(!e.length)return[];let s=e.filter(e=>"run:rejected"===e.phase).length,a=t?.length??0,r=e;if(a>s){r=[...e];let n=e[e.length-1].agentRunId;for(let e=s;e<a;e++){let a=t[e];e>s&&r.push({agentRunId:n,phase:"run:resumed",startedAt:a.timestamp??`synthetic-resumed-${e}`}),r.push({agentRunId:n,phase:"run:rejected",startedAt:a.timestamp??`synthetic-${e}`})}}let n=[],l=[],i=0;for(let e of r)if(l.push(e),"run:rejected"===e.phase){let e=t?.[i];n.push({number:n.length+1,timings:l,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),l=[],i++}return l.length>0&&n.push({number:n.length+1,timings:l}),n}(e,i),x=m.length>1,p=c.reduce((e,t)=>e+tv(t,d),0),h=c.reduce((e,t)=>e+(t.approvalWaitMs??0),0),f=c.reduce((e,t)=>e+(t.inputTokens??0),0),g=c.reduce((e,t)=>e+(t.outputTokens??0),0),j=c.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:m.map(e=>(0,t.jsx)(tM,{iteration:e,showHeader:x,maxDurationMs:u,now:d},e.number))}),p>0?(0,t.jsx)(tP,{totalExecMs:p,totalWaitMs:h,totalInputTokens:f,totalOutputTokens:g,totalCostUsd:j}):null]})}function tM({iteration:e,showHeader:s,maxDurationMs:a,now:r}){let n=function(e){let t=[...e.timings].reverse().find(e=>tS(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[s?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),n?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${n.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n.dotClass}`}),n.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((s,n)=>{if(tS(s.phase)){let a,r="run:rejected"===s.phase,l="run:failed"===s.phase||"run:crashed"===s.phase||"run:stopped"===s.phase;if(r)a=e.rejectionMessage;else if(l){let t=[...e.timings].reverse().find(e=>!tS(e.phase)&&e.errorMessage);a=t?.errorMessage??s.errorMessage}return(0,t.jsx)(tR,{timing:s,message:a,attachments:r?e.rejectionAttachments:void 0,isFirst:0===n,isLast:n===e.timings.length-1},`${s.agentRunId}-${s.phase}-${s.startedAt}`)}return(0,t.jsx)(tI,{timing:s,maxDurationMs:a,now:r},`${s.agentRunId}-${s.phase}-${s.startedAt}`)})]})]})}function tR({timing:e,message:s,attachments:a,isFirst:r,isLast:n}){let l,i=tC[e.phase];if(!i)return null;let o=a&&a.length>0,d=i.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${r?"pt-2":"pt-1"} ${n?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${i.bgClass}`,children:(0,t.jsx)(d,{className:`h-3 w-3 ${i.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${i.colorClass}`,children:i.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:ty(String(e.startedAt))}):null]}),s?(l="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${l?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[l?(0,t.jsx)(O.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(tf.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":l?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",s]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(e1,{text:"",attachmentPaths:a})}):null]})}function tI({timing:e,maxDurationMs:r,now:n}){let{t:l}=(0,a.useTranslation)("web"),i=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,o=e.phase.includes(":")?e.phase.split(":")[1]:null,d=null!==o,m=o?.startsWith("phase-")??!1,x=tk[i]??i,p=m?`Phase ${o.replace("phase-","")}`:null!==o?`${x} #${o}`:x,h=tv(e,n),f=!e.completedAt&&!!e.startedAt,g=f?15:2,j=r>0?Math.max(g,h/r*100):g,b=e.completedAt?m?"bg-emerald-400":d?"bg-amber-500":"bg-emerald-500":"bg-blue-500",v=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[N,y]=(0,s.useState)(!1),w=(0,s.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{y(!0),setTimeout(()=>y(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${d?"ms-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${f?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${f?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${d?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:w,className:"text-muted-foreground/50 hover:text-foreground/70 -ms-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:l("activityTab.copyPromptToClipboard"),children:N?(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(c.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${d?"h-1.5":"h-2"}`,children:f?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${b}`,style:{width:`${Math.min(j,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-sm font-medium tabular-nums",children:e7(h)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:ty(e.startedAt)}):null,null!=v&&v>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(eG.Zap,{className:"h-3 w-3 opacity-50"}),tN(v)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(tp,{className:"h-3 w-3 opacity-50"}),tw(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(tA,{timing:e,maxDurationMs:r}):null]})}function tA({timing:e,maxDurationMs:s}){let a=e.approvalWaitMs??0,r=s>0?Math.max(2,a/s*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(tg.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(r,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-xs tabular-nums",children:e7(a)})]})}function tP({totalExecMs:e,totalWaitMs:s,totalInputTokens:r,totalOutputTokens:n,totalCostUsd:l}){let{t:i}=(0,a.useTranslation)("web"),o=r+n;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(t$,{icon:tx.Clock,label:i("activityTab.execution"),value:e7(e)}),(0,t.jsx)(t$,{icon:tg.Timer,label:i("activityTab.wait"),value:s>0?e7(s):"n/a"}),(0,t.jsx)(t$,{icon:tx.Clock,label:"Wall-clock",value:s>0?e7(e+s):e7(e)}),(0,t.jsx)(t$,{icon:tp,label:i("activityTab.cost"),value:l>0?tw(l):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(eG.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),o>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:tN(o)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tj,{className:"h-3 w-3 text-blue-500 opacity-60"}),tN(r)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tb,{className:"h-3 w-3 text-emerald-500 opacity-60"}),tN(n)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function t$({icon:e,label:s,value:a,className:r=""}){let n="n/a"===a;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${r}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),s]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${n?"text-muted-foreground/40 italic":""}`,children:a})]})}var tD=e.i(7311),tE=e.i(44229);let tL=(0,J.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),tz=(0,J.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),tF=(0,J.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),tq=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,tB=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function tO(e){let t=e.match(tq);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,s,a,r,n,l]=t,i=null,o=null,d=null,c=l??"";if(null!=r&&null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null,c=`[${r}] ${l??""}`}else i=a,o=r,d=n??null;else if(null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null}else i=a;let u=c.match(tB),m="info";return u&&(m=u[1].toLowerCase(),c=u[2]),{timestamp:s??null,phase:i,agent:o,model:d,tag:m,message:c.trim(),raw:e}}function tU({content:e}){let a=(0,s.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(tO):[],[e]);return 0===a.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:a.map((e,s)=>(0,t.jsx)(tH,{line:e},s))})}function tH({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(tG,{line:e});case"tool-result":return(0,t.jsx)(tX,{line:e});case"text":case"delta":return(0,t.jsx)(tK,{line:e});case"result":return(0,t.jsx)(tQ,{line:e});case"tokens":case"turn":return(0,t.jsx)(tZ,{line:e});case"cmd":return(0,t.jsx)(tY,{line:e});case"file":return(0,t.jsx)(t0,{line:e});case"thread":case"event":case"info":return(0,t.jsx)(t2,{line:e});case"error":return(0,t.jsx)(t1,{line:e});case"worker":return(0,t.jsx)(tJ,{line:e});default:return(0,t.jsx)(t5,{line:e})}}function tV({value:e}){if(!e)return null;let s=e.replace(/^.*T/,"").replace("Z",""),a=s.split(":"),r=a.length>=3?`${a[1]}:${a[2].split(".")[0]}`:s;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:r})}function tW({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function tG({line:e}){var s;let a,{toolName:r,args:n}=-1===(a=(s=e.message).indexOf(" "))?{toolName:s,args:""}:{toolName:s.slice(0,a),args:s.slice(a+1)},l=function(e,t){try{let s=JSON.parse(t);if("Read"===e&&s.file_path||"Write"===e&&s.file_path||"Edit"===e&&s.file_path)return s.file_path;if("Glob"===e&&s.pattern||"Grep"===e&&s.pattern)return s.pattern;if("Bash"===e&&s.command)return s.command;if("Task"===e&&s.description)return s.description}catch{if(t.length>0)return t}return null}(r,n);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t_,{toolName:r}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:r}),l?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:l}):null]})]})}function t_({toolName:e}){let s=e.toLowerCase();return"bash"===s?(0,t.jsx)(E.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===s||"glob"===s||"grep"===s?(0,t.jsx)(ev.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===s||"edit"===s?(0,t.jsx)(tF,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)(E.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function tK({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tf.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function tQ({line:e}){var s;let a,r,{chars:n}=(a=(s=e.message).match(/^(\d+)\s+chars/),r=s.match(/session=(\S+)/),{chars:a?parseInt(a[1],10):0,sessionId:r?r[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ew.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",n.toLocaleString()," chars"]})]})]})}function tZ({line:e}){let s,{inputTokens:a,outputTokens:r}=(s=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(s[1],10),outputTokens:parseInt(s[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tL,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:a.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," out"]})]})]})}function tJ({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tz,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function tX({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ej,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:e.message})]})]})}function tY({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(o.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,t.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:e.message})]})]})}function t0({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tF,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:e.message})]})]})}function t1({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(O.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:e.message})]})]})}function t2({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(tV,{value:e.timestamp}),(0,t.jsx)(tW,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function t5({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function t3({content:e,isConnected:r,error:n}){let{t:l}=(0,a.useTranslation)("web"),i=(0,s.useRef)(null),[o,d]=(0,s.useState)(!0),[c,u]=(0,s.useState)("structured"),m=(0,s.useCallback)(()=>{let e=i.current;e&&d(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),x=(0,s.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,d(!0))},[]);return((0,s.useEffect)(()=>{o&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,o]),n)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u("structured"),className:`rounded p-1 transition-colors ${"structured"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.structuredView"),children:(0,t.jsx)(ev.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>u("raw"),className:`rounded p-1 transition-colors ${"raw"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.rawView"),children:(0,t.jsx)(tE.Code,{className:"h-3.5 w-3.5"})}),o?null:(0,t.jsxs)("button",{type:"button",onClick:x,className:"text-muted-foreground hover:text-foreground ms-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(tD.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:i,onScroll:m,className:`flex-1 overflow-y-auto ${"raw"===c?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===c?(0,t.jsx)(tU,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(E.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:l("logTab.noLogOutput")}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let t4=(0,J.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var t6=e.i(95812),t8=e.i(87889);let t9=(0,J.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),t7={Todo:{icon:t6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:l.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:t8.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},se={icon:t6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function st({tasks:e}){let{t:s}=(0,a.useTranslation)("web");return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:s("taskProgress.noTasksDefined")})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(ss,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,s)=>(0,t.jsx)(sr,{task:e,index:s},e.title||`task-${s}`))})]})}function ss({tasks:e}){let{t:r}=(0,a.useTranslation)("web"),n=(0,s.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,s=e.filter(e=>"Work in Progress"===e.state).length,a=e.filter(e=>"Review"===e.state).length,r=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,n=e.length,l=n>0?Math.round(t/n*100):0;return{done:t,wip:s,review:a,todo:r,total:n,percent:l}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[n.done," of ",n.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${n.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.done>0?(0,t.jsx)(sa,{icon:u.Check,label:r("taskProgress.done"),count:n.done,className:"text-emerald-600"}):null,n.wip>0?(0,t.jsx)(sa,{icon:l.Loader2,label:r("taskProgress.inProgress"),count:n.wip,className:"text-blue-600"}):null,n.review>0?(0,t.jsx)(sa,{icon:t8.Eye,label:r("taskProgress.review"),count:n.review,className:"text-amber-600"}):null,n.todo>0?(0,t.jsx)(sa,{icon:t6.Circle,label:r("taskProgress.todo"),count:n.todo,className:"text-muted-foreground"}):null]})]})}function sa({icon:e,label:s,count:a,className:r}){return(0,t.jsxs)("span",{className:(0,K.cn)("flex items-center gap-1 text-xs",r),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),a," ",s]})}function sr({task:e,index:a}){let[r,n]=(0,s.useState)(!1),l=t7[e.state]??se,i=l.icon,o=e.actionItems.length>0,d=(0,s.useCallback)(()=>{o&&n(e=>!e)},[o]);return(0,t.jsxs)("div",{"data-testid":`task-card-${a}`,className:(0,K.cn)("rounded-lg border",l.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:d,disabled:!o,className:(0,K.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",o&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(i,{className:(0,K.cn)("mt-0.5 h-4 w-4 shrink-0",l.colorClass,l.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,K.cn)("text-sm font-medium",l.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),o?(0,t.jsx)(_.ChevronRight,{className:(0,K.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",r&&"rotate-90")}):null]}),r&&o?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,s)=>(0,t.jsx)(sn,{item:e},e.name||`ai-${s}`))})}):null]})}function sn({item:e}){let s=e.acceptanceCriteria.length,a=e.acceptanceCriteria.filter(e=>e.verified).length,r=s>0&&a===s;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[r?(0,t.jsx)(ew.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(t9,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),s>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[a,"/",s]}):null]}),s>0?(0,t.jsx)("div",{className:"ms-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,s)=>(0,t.jsx)(sl,{criterion:e},e.description||`ac-${s}`))}):null]})}function sl({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(t6.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,K.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let si={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function so({plan:e,loading:s,error:a}){return s?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):a?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:a})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(Q.Badge,{className:si[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(st,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(t4,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var sd=e.i(28112);function sc(){return{data:null,loading:!1,error:null}}let su=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"},{key:"chat",label:"Chat"}],sm={activity:async function(e){let t=await V(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await W(e);if("error"in t)throw Error(t.error);return t.plan}};function sx({featureName:e,headerContent:a,featureNode:n,featureId:i,initialTab:o,urlTab:d,prdData:c,prdSelections:u,onPrdSelect:m,onPrdApprove:x,onPrdReject:p,isPrdLoading:h,techData:f,onTechApprove:g,onTechReject:j,isTechLoading:b,productData:v,mergeData:N,onMergeApprove:y,onMergeReject:w,isMergeLoading:k,syncStatus:C,syncLoading:S,syncError:T,onRefreshSync:M,onRebaseOnMain:R,rebaseLoading:I,rebaseError:A,isRejecting:P,chatInput:$,onChatInputChange:D,sseEvents:E,interactiveAgentEnabled:L=!0}){let z=(0,r.usePathname)(),F=(0,s.useMemo)(()=>(function(e,t=!0){let s=["overview","activity"];return e.hasAgentRun&&s.push("log"),e.hasPlan&&s.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&s.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&s.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&s.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&s.push("merge-review"),t&&s.push("chat"),s})(n,L),[n,L]),q=(0,s.useMemo)(()=>su.filter(e=>F.includes(e.key)).map(e=>"merge-review"===e.key&&"maintain"===n.lifecycle?{...e,label:"Merge History"}:e),[F,n.lifecycle]),B=(0,s.useMemo)(()=>{let e=z.match(/^(\/feature\/[^/]+)/);return e?e[1]:z},[z]),V=(0,s.useMemo)(()=>d&&F.includes(d)?d:o&&F.includes(o)?o:"overview",[]),[W,G]=(0,s.useState)(V),_=function(e){let[t,a]=(0,s.useState)(""),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(null),d=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),n(!1)},[]);return(0,s.useEffect)(()=>{if(!e){a(""),n(!1),i(null);return}a(""),i(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{n(!0)},t.addEventListener("initial",e=>{a(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);a(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);i(t.error)}catch{i(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{n(!1)},()=>{t.close(),o.current=null}},[e,d]),{content:t,isConnected:r,error:l}}("log"===W?i:null),{tabs:K,fetchTab:Q,refreshTab:Z}=function(e,t){let a=Object.keys(t),[r,n]=(0,s.useState)(()=>{let e={};for(let t of a)e[t]=sc();return e}),l=(0,s.useRef)(t);l.current=t;let i=(0,s.useRef)(e);i.current=e;let o=(0,s.useRef)(!0);(0,s.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let d=(0,s.useRef)(e);(0,s.useEffect)(()=>{d.current!==e&&(d.current=e,n(e=>{let t={};for(let s of Object.keys(e))t[s]=sc();return t}))},[e]);let c=(0,s.useCallback)(async e=>{let t=l.current[e],s=i.current;if(t){o.current&&n(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let a=await t(s);o.current&&n(t=>({...t,[e]:{data:a,loading:!1,error:null}}))}catch(t){o.current&&n(s=>{let a=t instanceof Error?t.message:"Failed to fetch tab data",r=s[e]?.data??null;return{...s,[e]:{data:r,loading:!1,error:r?null:a}}})}}},[]),u=(0,s.useCallback)(async e=>{let t=r[e];t&&null!==t.data||t&&t.loading||await c(e)},[r,c]);return{tabs:r,fetchTab:u,refreshTab:(0,s.useCallback)(async e=>{await c(e)},[c])}}(i,sm),J=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!J.current)return;J.current=!1;let e="overview"===W?B:`${B}/${W}`;e!==z&&window.history.pushState(null,"",e)},[W,B,z]);let X=(0,s.useRef)(z);(0,s.useEffect)(()=>{if(X.current===z||(X.current=z,J.current))return;let e=z.split("/"),t=e.length>=4?e[3]:void 0,s=t&&F.includes(t)?t:"overview";s!==W&&(G(s),("activity"===s||"plan"===s)&&Q(s))},[z]);let Y=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!Y.current&&(Y.current=!0,!d&&"overview"!==V)){let e=`${B}/${V}`;e!==z&&window.history.replaceState(null,"",e)}},[]);let ee=(0,s.useRef)(!1);(0,s.useEffect)(()=>{ee.current||(ee.current=!0,("activity"===W||"plan"===W)&&Q(W))},[W,Q]);let et=(0,s.useRef)(i);(0,s.useEffect)(()=>{et.current!==i&&(et.current=i,G("overview"))},[i]);let es=(0,s.useRef)(o);(0,s.useEffect)(()=>{if(es.current!==o&&o&&F.includes(o)){es.current=o,G(o),("activity"===o||"plan"===o)&&Q(o);let e="overview"===o?B:`${B}/${o}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[o,F,B,Q]),(0,s.useEffect)(()=>{F.includes(W)||(G("overview"),window.location.pathname!==B&&window.history.replaceState(null,"",B))},[F,W,B]);let ea=(0,s.useRef)(W);ea.current=W;let er=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!E||0===E.length||(er.current>E.length&&(er.current=0),E.length<=er.current))return;let e=E.slice(er.current);if(er.current=E.length,!e.some(e=>e.featureId===i))return;Z("activity");let t=ea.current;"plan"===t&&Z(t)},[E,i,Z]);let el="running"===n.state||"creating"===n.state;(0,s.useEffect)(()=>{if(!el)return;let e=setInterval(()=>{Z("activity")},5e3);return()=>clearInterval(e)},[el,Z]);let ei=(0,s.useCallback)(e=>{J.current=!0,G(e),("activity"===e||"plan"===e)&&Q(e)},[Q]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(U.Tabs,{value:W,onValueChange:ei,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-3","data-testid":"feature-drawer-header",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-4 pe-6",children:[e?(0,t.jsx)("h2",{className:"text-foreground min-w-0 shrink truncate text-base font-semibold tracking-tight",children:e}):null,(0,t.jsx)(U.TabsList,{className:"h-auto shrink-0 gap-0.5 rounded-none border-0 bg-transparent p-0",children:q.map(e=>(0,t.jsx)(U.TabsTrigger,{value:e.key,className:"text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary h-auto rounded-none border-b-2 border-transparent bg-transparent px-2 py-0.5 text-[12px] font-medium shadow-none transition-colors data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:e.label},e.key))})]}),a]}),(0,t.jsx)(H.Separator,{}),(0,t.jsx)(U.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ta,{data:n,syncStatus:C,syncLoading:S,syncError:T,onRefreshSync:M,onRebaseOnMain:R,rebaseLoading:I,rebaseError:A})}),(0,t.jsx)(U.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tT,{timings:K.activity.data?.timings??null,loading:K.activity.loading,error:K.activity.error,rejectionFeedback:K.activity.data?.rejectionFeedback})}),(0,t.jsx)(U.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(t3,{content:_.content,isConnected:_.isConnected,error:_.error})}),(0,t.jsx)(U.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(so,{plan:K.plan.data,loading:K.plan.loading,error:K.plan.error})}),F.includes("prd-review")?(0,t.jsx)(U.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:c?(0,t.jsx)(en,{data:c,selections:u??{},onSelect:m??(()=>void 0),onApprove:x??(()=>void 0),onReject:p,isProcessing:h,isRejecting:P,chatInput:$,onChatInputChange:D}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,F.includes("tech-decisions")?(0,t.jsx)(U.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:f?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(eu,{data:f})}),(0,t.jsx)(sp,{onApprove:g??(()=>void 0),onReject:j,isProcessing:b,isRejecting:P,chatInput:$,onChatInputChange:D})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,F.includes("product-decisions")?(0,t.jsx)(U.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===v?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):v?(0,t.jsx)(ep,{data:v}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,F.includes("merge-review")?(0,t.jsx)(U.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:N?(0,t.jsx)(eO,{data:N,readOnly:"maintain"===n.lifecycle,onApprove:y??(()=>void 0),onReject:w,isProcessing:k,isRejecting:P,chatInput:$,onChatInputChange:D}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:k?(0,t.jsx)(l.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(O.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,F.includes("chat")?(0,t.jsx)(U.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(sd.ChatTab,{featureId:i,worktreePath:n.worktreePath})}):null]})})}function sp({onApprove:e,onReject:s,isProcessing:r,isRejecting:n,chatInput:l,onChatInputChange:i}){let{t:o}=(0,a.useTranslation)("web");return(0,t.jsx)(er,{onReject:s,onApprove:e,approveLabel:o("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:n,chatInput:l,onChatInputChange:i})}var sh=e.i(51386),sf=e.i(99682),sg=e.i(79078);let sj=(0,f.createServerReference)("404e4d43eb0ff959c79ff467b9a13d85bf587c8fea",f.callServer,void 0,f.findSourceMapURL,"rebaseFeature");var sb=e.i(99045);function sv(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function sN(e,t,a,r,l,i){let[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(a),u=(0,s.useRef)(r);return c.current=a,u.current=r,(0,s.useEffect)(()=>{if(u.current(),!e)return;let s=!1;return d(!0),t(e).then(e=>{s||c.current(e)}).catch(()=>{!s&&l&&n.toast.error(l)}).finally(()=>{s||d(!1)}),()=>{s=!0}},[e,t,l,i]),o}let sy=(0,f.createServerReference)("4082800e963046c23be964b4759d4323e0595d6c60",f.callServer,void 0,f.findSourceMapURL,"getFeatureDrawerData"),sw=(0,f.createServerReference)("403025ecd047a0c47df0777b960fd20201ac4ef2b3",f.callServer,void 0,f.findSourceMapURL,"getBranchSyncStatus"),sk=new Map;function sC({view:e,urlTab:f,interactiveAgentEnabled:E=!0}){var L;let z,F,q,O,U,H=(0,k.useFeatureFlags)(),{t:V}=(0,a.useTranslation)("web"),W=(0,r.useRouter)(),G=(0,C.useSoundAction)("reject"),[_,K]=(0,s.useState)(e);(0,s.useEffect)(()=>{K(e)},[e]);let Q="feature"===_.type?_.node:null,{events:Z}=(0,M.useAgentEventsContext)(),J=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(J.current>Z.length&&(J.current=0),!Q||Z.length<=J.current)return;let e=Z.slice(J.current);for(let t of(J.current=Z.length,(0,sb.resolveSseEventUpdates)(e)))t.featureId===Q.featureId&&"deleting"!==Q.state&&(void 0!==t.state||void 0!==t.lifecycle)&&K(e=>{if("feature"!==e.type)return e;let s={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:s,initialTab:sv(s)}})},[Z,Q]);let X=(0,r.usePathname)().startsWith("/feature/");L=Q?.featureId??null,z=(0,s.useRef)(X),F=(0,s.useRef)(!1),q=(0,s.useCallback)(async()=>{if(L&&!F.current){F.current=!0;try{let e=await sy(L);if(!e)return;K(t=>(function(e,t){if("feature"!==e.type)return e;let s={...e.node,...t},a=s.state!==e.node.state||s.lifecycle!==e.node.lifecycle;return{...e,node:s,initialTab:a?sv(s):e.initialTab}})(t,e))}catch{}finally{F.current=!1}}},[L,K]),O=(0,s.useRef)(!1),(0,s.useEffect)(()=>{!X||z.current&&O.current||(O.current=!0,q()),z.current=X},[X,q]),(0,s.useEffect)(()=>{if(!X||!L)return;let e=setInterval(()=>{q()},15e3);return()=>clearInterval(e)},[X,L,q]);let Y=(0,s.useCallback)(()=>{W.push("/")},[W]),[ee,et]=(0,s.useState)(""),[es,ea]=(0,s.useState)(null),[er,en]=(0,s.useState)({}),[el,ei]=(0,s.useState)({}),[eo,ed]=(0,s.useState)(null),[ec,eu]=(0,s.useState)(void 0),[em,ex]=(0,s.useState)(null),[ep,eh]=(0,s.useState)(!1),[ef,eg]=(0,s.useState)(!1),[ej,eb]=(0,s.useState)(!1),ev=`${Q?.featureId}:${Q?.state}`,eN=(0,s.useRef)(ev);(0,s.useEffect)(()=>{ev!==eN.current&&(eN.current=ev,eb(!1))},[ev]);let[ey,ew]=(0,s.useState)(!1),ek=(0,s.useRef)(!1),eC="feature"===_.type?_.initialTab:void 0;(0,s.useEffect)(()=>{et("")},[eC]);let eS=(0,s.useRef)(0),eT=(0,s.useRef)(Q?.state),eM=(0,s.useRef)(Q?.lifecycle);(Q?.state!==eT.current||Q?.lifecycle!==eM.current)&&(eT.current=Q?.state,eM.current=Q?.lifecycle,eS.current+=1);let eR=eS.current,eI=sN(Q?.lifecycle==="requirements"&&Q?.state==="action-required"?Q.featureId:null,N,e=>{if(e.error)return void n.toast.error(e.error);if(e.questionnaire){ea(e.questionnaire);let t={};for(let s of e.questionnaire.questions){let e=s.options.find(e=>e.recommended);e&&(t[s.id]=e.id)}en(t),ei(t)}},()=>{en({}),ei({}),ea(null)},"Failed to load questionnaire",eR),eA=Q?.lifecycle==="implementation"&&Q?.state==="action-required"?Q.featureId:null,eP=sN(eA,y,e=>{e.error?n.toast.error(e.error):e.techDecisions&&ed(e.techDecisions)},()=>ed(null),"Failed to load tech decisions",eR),e$=sN(eA,N,e=>{e.productDecisions&&eu(e.productDecisions)},()=>eu(void 0),void 0,eR),eD=sN(Q?.lifecycle==="review"&&(Q?.state==="action-required"||Q?.state==="error")||Q?.lifecycle==="maintain"&&Q?.pr?Q.featureId:null,w,e=>{"error"in e?n.toast.error(e.error):ex(e)},()=>ex(null),"Failed to load merge review data",eR),eE=ee.trim().length>0,eL=Q?.lifecycle==="requirements"&&Q?.state==="action-required"&&Object.keys(el).some(e=>el[e]!==er[e]),ez=(0,s.useCallback)(()=>{et(""),en({...el})},[el]),{attemptClose:eF}=(0,S.useGuardedDrawerClose)({open:X,isDirty:eE||eL,onClose:Y,onReset:ez}),eq=(0,s.useCallback)(async(e,t,s=[],a)=>{if(Q?.featureId){ek.current=!0,ew(!0);try{let r=s.map(e=>e.path).filter(Boolean),l=s.filter(e=>e.notes?.trim()),i=l.length>0?`${e}
|
|
3
3
|
|
|
4
4
|
Image notes:
|
|
5
5
|
${l.map(e=>`- @${e.path}: ${e.notes.trim()}`).join("\n")}`:e,o=await v(Q.featureId,i,r);if(!o.rejected)return void n.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);G.play(),et(""),n.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&n.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:Q.featureId}})),Y(),a?.()}finally{ek.current=!1,ew(!1)}}},[Q,Y,G]),eB=(0,s.useCallback)((e,t)=>eq(e,"Requirements",t,()=>en({})),[eq]),eO=(0,s.useCallback)((e,t)=>eq(e,"Plan",t),[eq]),eU=(0,s.useCallback)((e,t)=>eq(e,"Merge",t),[eq]),eH=(0,s.useCallback)(async e=>{if(!Q?.featureId)return;let t=await g(Q.featureId);t.approved?(et(""),n.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:Q.featureId}})),Y()):n.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[Q,Y]),eV=(0,s.useCallback)(async e=>{let t;if("feature"!==_.type||!Q)return;if(es){let e=[];for(let[t,s]of Object.entries(er)){let a=es.questions.find(e=>e.id===t),r=a?.options.find(e=>e.id===s);a&&r&&e.push({questionId:a.question,selectedOption:r.label})}t={approved:!0,changedSelections:e}}let s=await g(Q.featureId,t);s.approved?(et(""),n.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:Q.featureId}})),en({}),Y()):n.toast.error(s.error??"Failed to approve requirements")},[_,Q,es,er,Y]),eW=(0,s.useCallback)(()=>eH("Plan"),[eH]),eG=(0,s.useCallback)(()=>eH("Merge"),[eH]),e_=(0,s.useCallback)(async(e,t,s,a)=>{eh(!0),eg(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:e,cleanup:t,cascadeDelete:s,closePr:a}})),W.push("/")},[W]),eK=(0,s.useCallback)(e=>{eb(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:e}})),W.push("/")},[W]),eQ=(0,s.useCallback)(e=>{eb(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:e}})),W.push("/")},[W]),eZ=(0,s.useCallback)(async e=>{let t=await (0,j.resumeFeature)(e);t.error?n.toast.error(t.error):(n.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:e}})),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[]),eJ=(0,s.useCallback)(async e=>{let t=await (0,b.startFeature)(e);t.error?n.toast.error(t.error):(n.toast.success("Feature started"),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[]),eX=Q?.repositoryPath&&Q?.branch?{featureId:Q.featureId,repositoryPath:Q.repositoryPath,branch:Q.branch,worktreePath:Q.worktreePath,specPath:Q.specPath}:null,eY=function(e){let[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),[j,b]=(0,s.useState)(null),[v,N]=(0,s.useState)(null),y=(0,s.useRef)(null),w=(0,s.useRef)(null),k=(0,s.useRef)(null),C=(0,s.useRef)(null),S=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=[y,w,k,C,S];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let T=(0,s.useCallback)(async(t,s,a,r,n)=>{if(e&&!n){r.current&&clearTimeout(r.current),s(!0),a(null);try{let s=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!s.success){let e=s.error??"An unexpected error occurred";a(e),r.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),r.current=setTimeout(()=>a(null),5e3)}finally{s(!1)}}},[e]);return{openInIde:(0,s.useCallback)(()=>T(sh.openIde,a,x,y,t),[T,t]),openInShell:(0,s.useCallback)(()=>T(sf.openShell,n,h,w,r),[T,r]),openFolder:(0,s.useCallback)(async()=>{if(e&&!l){k.current&&clearTimeout(k.current),i(!0),g(null);try{let t=e.worktreePath??e.repositoryPath,s=await (0,sg.openFolder)(t);if(!s.success){let e=s.error??"An unexpected error occurred";g(e),k.current=setTimeout(()=>g(null),5e3)}}catch(e){g(e instanceof Error?e.message:"An unexpected error occurred"),k.current=setTimeout(()=>g(null),5e3)}finally{i(!1)}}},[e,l]),openSpecsFolder:(0,s.useCallback)(async()=>{if(e?.specPath&&!o){C.current&&clearTimeout(C.current),d(!0),b(null);try{let t=await (0,sg.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";b(e),C.current=setTimeout(()=>b(null),5e3)}}catch(e){b(e instanceof Error?e.message:"An unexpected error occurred"),C.current=setTimeout(()=>b(null),5e3)}finally{d(!1)}}},[e,o]),rebaseOnMain:(0,s.useCallback)(async()=>{if(e?.featureId&&!c){S.current&&clearTimeout(S.current),u(!0),N(null);try{let t=await sj(e.featureId);if(!t.success){let e=t.error??"An unexpected error occurred";N(e),S.current=setTimeout(()=>N(null),5e3)}}catch(e){N(e instanceof Error?e.message:"An unexpected error occurred"),S.current=setTimeout(()=>N(null),5e3)}finally{u(!1)}}},[e,c]),ideLoading:t,shellLoading:r,folderLoading:l,specsLoading:o,rebaseLoading:c,ideError:m,shellError:p,folderError:f,specsError:j,rebaseError:v}}(eX),e0=H.gitRebaseSync&&Q?.branch&&Q?.remoteUrl?Q.featureId:null,{data:e1,loading:e2,error:e5,refresh:e3}=function(e){let[t,a]=(0,s.useState)(()=>{if(!e)return null;let t=sk.get(e);return t?t.data:null}),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(e);o.current=e;let d=(0,s.useCallback)(async e=>{n(!0),i(null);try{let t=await sw(e);if(o.current!==e)return;if(t.success&&t.data){let s=t.data;sk.set(e,{data:s,timestamp:Date.now()}),a(s)}else i(t.error??"Failed to check sync status")}catch{if(o.current!==e)return;i("Failed to check sync status")}finally{o.current===e&&n(!1)}},[]);return(0,s.useEffect)(()=>{if(!e){a(null),i(null);return}let t=sk.get(e);t&&(a(t.data),Date.now()-t.timestamp<3e4)||d(e)},[e,d]),{data:t,loading:r,error:l,refresh:(0,s.useCallback)(()=>{e&&d(e)},[e,d])}}(e0),e4=(0,s.useRef)(eY.rebaseLoading);(0,s.useEffect)(()=>{!e4.current||eY.rebaseLoading||eY.rebaseError||e3(),e4.current=eY.rebaseLoading},[eY.rebaseLoading,eY.rebaseError,e3]);let e6=Q?.repositoryPath&&Q.branch?{targetId:Q.featureId,targetType:"feature",repositoryPath:Q.repositoryPath,branch:Q.branch}:null,e8=(0,T.useDeployAction)(e6),e9="Booting"===e8.status||"Ready"===e8.status,[e7,te]=(0,s.useState)(!1),tt=(0,s.useCallback)(()=>{Q?.featureId&&(navigator.clipboard.writeText(Q.featureId),te(!0),setTimeout(()=>te(!1),2e3))},[Q?.featureId]);if(Q){let e=Q.featureId.slice(0,8),s=Q.repositoryName??Q.repositoryPath.split("/").filter(Boolean).at(-1)??"";U=(0,t.jsxs)(t.Fragment,{children:[s?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,t.jsx)(m.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),Q.remoteUrl?(0,t.jsxs)("a",{href:Q.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[s,(0,t.jsx)(x.ExternalLink,{className:"size-3"})]}):(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:s})]}):null,eX?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1","data-testid":"feature-drawer-actions",children:[Q?.state!=="done"?(0,t.jsx)(B,{actions:eY,repositoryPath:eX.repositoryPath,worktreePath:eX.worktreePath,showSpecs:!!eX.specPath}):null,Q?.state!=="done"&&H.envDeploy&&e6?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.TooltipProvider,{children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(D.ActionButton,{label:V(e9?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),onClick:e9?e8.stop:e8.deploy,loading:e8.deployLoading||e8.stopLoading,error:!!e8.deployError,icon:e9?d.Square:o.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(P.TooltipContent,{children:V(e9?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),e9?(0,t.jsx)(I.DeploymentStatusBadge,{status:e8.status,url:e8.url,targetId:e6?.targetId}):null]}):null,(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:e}),(0,t.jsx)("button",{type:"button",onClick:tt,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":V("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:e7?(0,t.jsx)(u.Check,{className:"size-3.5 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-3.5"})})]}),Q.featureId?(0,t.jsxs)(t.Fragment,{children:["archived"===Q.state?(0,t.jsx)(P.TooltipProvider,{children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(A.Button,{variant:"ghost",size:"icon-sm","aria-label":V("featureDrawer.unarchiveFeature"),disabled:ej,className:"text-muted-foreground hover:text-primary","data-testid":"feature-drawer-unarchive",onClick:()=>eQ(Q.featureId),children:ej?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(h.ArchiveRestore,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{children:V("featureDrawer.unarchiveFeature")})]})}):"deleting"!==Q.state?(0,t.jsx)(P.TooltipProvider,{children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(A.Button,{variant:"ghost",size:"icon-sm","aria-label":V("featureDrawer.archiveFeature"),disabled:ej,className:"text-muted-foreground hover:text-foreground","data-testid":"feature-drawer-archive",onClick:()=>eK(Q.featureId),children:ej?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(p.Archive,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{children:V("featureDrawer.archiveFeature")})]})}):null,(0,t.jsx)(A.Button,{variant:"ghost",size:"icon-sm","aria-label":V("featureDrawer.deleteFeature"),disabled:ep,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>eg(!0),children:ep?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(i.Trash2,{className:"size-4"})}),(0,t.jsx)($.DeleteFeatureDialog,{open:ef,onOpenChange:eg,onConfirm:(e,t,s)=>e_(Q.featureId,e,t,s),isDeleting:ep,featureName:Q.name,featureId:Q.featureId,hasChildren:Q.hasChildren,hasOpenPr:!!Q.pr&&"Open"===Q.pr.status})]}):null]}):null]})}let ts=null;if("feature"===_.type&&Q){let e={...Q,..."error"===Q.state&&{onRetry:eZ},..."pending"===Q.state&&{onStart:eJ}};ts=(0,t.jsx)(sx,{featureName:Q.name,headerContent:U,featureNode:e,featureId:Q.featureId,initialTab:_.initialTab,urlTab:f,sseEvents:Z,prdData:es,prdSelections:er,onPrdSelect:(e,t)=>en(s=>({...s,[e]:t})),onPrdApprove:eV,onPrdReject:eB,isPrdLoading:eI,techData:eo,onTechApprove:eW,onTechReject:eO,isTechLoading:eP,productData:e$?null:ec,mergeData:em,onMergeApprove:eG,onMergeReject:eU,isMergeLoading:eD,syncStatus:e0?e1:void 0,syncLoading:e2,syncError:e5,onRefreshSync:e0?e3:void 0,onRebaseOnMain:e0?eY.rebaseOnMain:void 0,rebaseLoading:eY.rebaseLoading,rebaseError:eY.rebaseError,isRejecting:ey,chatInput:ee,onChatInputChange:et,interactiveAgentEnabled:E})}return(0,t.jsx)(R.BaseDrawer,{open:X,onClose:eF,size:"lg",modal:!1,"data-testid":"feature"===_.type?"feature-drawer":"repository-drawer",children:ts})}e.s(["FeatureDrawerClient",()=>sC],36986)}]);
|