@shepai/cli 1.122.2-pr392.a8f2b76 → 1.122.2-pr394.daae4c9
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/repositories/feature-repository.interface.d.ts +11 -0
- package/dist/packages/core/src/application/ports/output/repositories/feature-repository.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts +15 -0
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts +40 -0
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +146 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.d.ts +33 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.js +77 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +5 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.js +8 -0
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +15 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts +14 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.js +43 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/index.js +3 -1
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.d.ts +10 -0
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.js +22 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.d.ts +11 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.js +20 -0
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts +0 -2
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.js +0 -2
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts +9 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +27 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts +32 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.js +115 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.d.ts +5 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.js +56 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +9 -20
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +31 -130
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +0 -13
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.js +9 -18
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +18 -18
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +17 -31
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +22 -29
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +14 -5
- package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts +0 -2
- package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/sidebar-features-context.js +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +1 -0
- package/web/.next/build-manifest.json +4 -4
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/routes-manifest.json +6 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +18 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/next-font-manifest.json +6 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +320 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +20 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.map +5 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +2 -0
- package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
- 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]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- 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)/create/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +22 -22
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
- 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]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- 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/page/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +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/settings/page/build-manifest.json +2 -2
- package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js +4 -4
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- 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/build-manifest.json +2 -2
- package/web/.next/server/app/version/page/server-reference-manifest.json +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/app-paths-manifest.json +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_client_components_94d75bc3._.js +3 -0
- package/web/.next/server/chunks/ssr/403f9_next_dist_client_components_94d75bc3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_0b3f4f0d.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_0b3f4f0d.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_adopt-drawer-client_tsx_6c5e4bbb._.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_adopt-drawer-client_tsx_6c5e4bbb._.js.map +1 -0
- 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/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e2227c0f._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e2227c0f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e7258841._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e7258841._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ec26e818._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ec26e818._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0589cc3._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0589cc3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_19a2fb35._.js +3 -0
- package/web/.next/server/chunks/ssr/_19a2fb35._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_1e1b2639._.js +3 -0
- package/web/.next/server/chunks/ssr/_1e1b2639._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_4093a637._.js +5 -0
- package/web/.next/server/chunks/ssr/_4093a637._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_36dccae9._.js → _5317c57e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_36dccae9._.js.map → _5317c57e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_a4a44cc0._.js +3 -0
- package/web/.next/server/chunks/ssr/_a4a44cc0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_b56e7571._.js +3 -0
- package/web/.next/server/chunks/ssr/_b56e7571._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d5206f22._.js +4 -0
- package/web/.next/server/chunks/ssr/_d5206f22._.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/f7870_sonner_dist_index_mjs_dbf63824._.js +3 -0
- package/web/.next/server/chunks/ssr/f7870_sonner_dist_index_mjs_dbf63824._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.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/middleware-build-manifest.js +2 -2
- 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 +189 -34
- package/web/.next/static/chunks/0d2af96e64960ef5.css +1 -0
- package/web/.next/static/chunks/430ef376bd249b14.js +1 -0
- package/web/.next/static/chunks/4796c6e7d84294d7.js +1 -0
- package/web/.next/static/chunks/52c0456129cb8a10.js +1 -0
- package/web/.next/static/chunks/767cf20dbde41522.js +1 -0
- package/web/.next/static/chunks/78e2f79d08767e8d.js +9 -0
- package/web/.next/static/chunks/{90e7434ef9395b62.js → 7f0206527c67e121.js} +1 -1
- package/web/.next/static/chunks/{ed3a602003bcb31b.js → 89aac43287d73b02.js} +1 -1
- package/web/.next/static/chunks/{1c19bf1f99269544.js → 9f4eb9f1618c8bd9.js} +1 -1
- package/web/.next/static/chunks/a8d65187623d628b.js +5 -0
- package/web/.next/static/chunks/{816ee0f2c6b490a4.js → b14644925c7af7f5.js} +2 -2
- package/web/.next/static/chunks/b4a6061718adb25e.js +2 -0
- package/web/.next/static/chunks/bf108ed551e585e6.js +1 -0
- package/web/.next/static/chunks/c6356369a45d19d6.js +1 -0
- package/web/.next/static/chunks/ca946dcbfbb2df74.js +1 -0
- package/web/.next/static/chunks/cafcbd67d82d65db.js +1 -0
- package/web/.next/static/chunks/d6d6af31b7ef545b.js +1 -0
- package/web/.next/static/chunks/f83551c20dcda199.js +1 -0
- package/web/.next/static/chunks/{turbopack-426d9bc2450816ba.js → turbopack-080e470ea902d0ba.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f646b99a._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f646b99a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_3a4c94e3._.js +0 -3
- package/web/.next/server/chunks/ssr/_3a4c94e3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js +0 -3
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_9ac70f88._.js +0 -5
- package/web/.next/server/chunks/ssr/_9ac70f88._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_d99705a5._.js +0 -3
- package/web/.next/server/chunks/ssr/_d99705a5._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_60c91521._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_60c91521._.js.map +0 -1
- package/web/.next/static/chunks/275f0d403059b5b4.js +0 -1
- package/web/.next/static/chunks/3911a7175044e784.js +0 -1
- package/web/.next/static/chunks/52b56677c842e45f.js +0 -3
- package/web/.next/static/chunks/61df7e9671cf4e76.css +0 -1
- package/web/.next/static/chunks/6272719b144b6c1a.js +0 -11
- package/web/.next/static/chunks/691a93561029b01b.js +0 -2
- package/web/.next/static/chunks/6db4aa6aed9e6545.js +0 -1
- package/web/.next/static/chunks/845d8e58a91014e6.js +0 -1
- package/web/.next/static/chunks/a92706d178a3fa6c.js +0 -1
- package/web/.next/static/chunks/bf479173877b0a2f.js +0 -1
- package/web/.next/static/chunks/dbbb446493f21874.js +0 -1
- package/web/.next/static/chunks/f90f55b8e972bd8e.js +0 -1
- /package/web/.next/static/{x39t_TXToqcf-uNwPMhq8 → eu15XGqVtBSCUjVy2GmoQ}/_buildManifest.js +0 -0
- /package/web/.next/static/{x39t_TXToqcf-uNwPMhq8 → eu15XGqVtBSCUjVy2GmoQ}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{x39t_TXToqcf-uNwPMhq8 → eu15XGqVtBSCUjVy2GmoQ}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=o((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},a=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function a(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(void 0===n?"\0":n)}function s(e,t){return a(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var a=r.parent(o);return void 0===a||t.hasNode(a)?(n[o]=a,a):a in n?n[a]:e(a)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=i,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var l=a(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return s&&(this._edgeLabels[l]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=s?o:this._defaultEdgeLabelFn(e,t,n);var d=function(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}var i={v:o,w:a};return n&&(i.name=n),i}(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[l]=d,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=d,this._out[e][l]=d,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),i=this._edgeObjs[o];return i&&(e=i.v,t=i.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),i=n((e,t)=>{t.exports={Graph:a(),version:s()}}),l=n((e,t)=>{var r=a();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),d=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},a=!0,s=0,i=e.nodes(),l=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},a=!0)},d=function(){i.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;l({v:r,w:n})})})};i.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=i.length,u=1;u<c&&(a=!1,s++,d(),a);u++);if(s===c-1&&(a=!1,d(),a))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),u=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],a=r[t];r[e]=a,r[t]=o,n[a.key]=e,n[o.key]=t}}}),h=n((e,t)=>{var r=u();t.exports=function(e,t,o,a){return function(e,t,n,o){var a,s,i={},l=new r,d=function(e){var t=e.v!==a?e.v:e.w,r=i[t],o=n(e),d=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);d<r.distance&&(r.distance=d,r.predecessor=a,l.decrease(t,d))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},l.add(e,r)});l.size()>0&&(s=i[a=l.removeMin()]).distance!==1/0;)o(a).forEach(d);return i}(e,String(t),o||n,a||function(t){return e.outEdges(t)})};var n=()=>1}),f=n((e,t)=>{var r=h();t.exports=function(e,t,n){return e.nodes().reduce(function(o,a){return o[a]=r(e,a,t,n),o},{})}}),p=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(a){Object.hasOwn(n,a)||function a(s){var i=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(i.lowlink=Math.min(i.lowlink,n[e].index)):(a(e),i.lowlink=Math.min(i.lowlink,n[e].lowlink))}),i.lowlink===i.index){var l,d=[];do n[l=r.pop()].onStack=!1,d.push(l);while(s!==l)o.push(d)}}(a)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,a,s,i,l;return o=e,a=t||r,s=n||function(t){return e.outEdges(t)},i={},(l=o.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},l.forEach(function(t){e!==t&&(i[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=a(t);i[e][r]={distance:n,predecessor:e}})}),l.forEach(function(e){var t=i[e];l.forEach(function(r){var n=i[r];l.forEach(function(r){var o=n[e],a=t[r],s=n[r],i=o.distance+a.distance;i<s.distance&&(s.distance=i,s.predecessor=a.predecessor)})})}),i};var r=()=>1}),y=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function a(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(a),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),x=n((e,t)=>{var r=y();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),b=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,a,s,i){return Object.hasOwn(o,r)||(o[r]=!0,n||(i=s(i,r)),a(r).forEach(function(r){i=e(t,r,n,o,a,s,i)}),n&&(i=s(i,r))),i}(e,t,"post"===r,s,a,n,o)}),o}}),w=n((e,t)=>{var r=b();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=a(),n=u();t.exports=function(e,t){var o,a=new r,s={},i=new n;function l(e){var r=e.v===o?e.w:e.v,n=i.priority(r);if(void 0!==n){var a=t(e);a<n&&(s[r]=o,i.decrease(r,a))}}if(0===e.nodeCount())return a;e.nodes().forEach(function(e){i.add(e,1/0),a.setNode(e)}),i.decrease(e.nodes()[0],0);for(var d=!1;i.size()>0;){if(Object.hasOwn(s,o=i.removeMin()))a.setEdge(o,s[o]);else{if(d)throw Error("Input graph is not connected: "+e);d=!0}e.nodeEdges(o).forEach(l)}return a}}),C=n((e,t)=>{var r=h(),n=d();t.exports=function(e,t,o,a){return function(e,t,o,a){if(void 0===o)return r(e,t,o,a);for(var s=!1,i=e.nodes(),l=0;l<i.length;l++){for(var d=a(i[l]),c=0;c<d.length;c++){var u=d[c],h=u.v===i[l]?u.v:u.w,f=h===u.v?u.w:u.v;0>o({v:h,w:f})&&(s=!0)}if(s)return n(e,t,o,a)}return r(e,t,o,a)}(e,t,o,a||function(t){return e.outEdges(t)})}}),N=n((e,t)=>{t.exports={bellmanFord:d(),components:c(),dijkstra:h(),dijkstraAll:f(),extractPath:p(),findCycles:m(),floydWarshall:v(),isAcyclic:x(),postorder:E(),preorder:k(),prim:j(),shortestPaths:C(),reduce:b(),tarjan:g(),topsort:y()}}),_=i();t.exports={Graph:_.Graph,json:l(),alg:N(),version:_.version}}),s=o((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),i=o((e,t)=>{var r=a().Graph,n=s();t.exports=function(e,t){var a,s;let d,c,u,h,f;if(1>=e.nodeCount())return[];let p=(a=e,s=t||o,d=new r,c=0,u=0,a.nodes().forEach(e=>{d.setNode(e,{v:e,in:0,out:0})}),a.edges().forEach(e=>{let t=d.edge(e.v,e.w)||0,r=s(e);d.setEdge(e.v,e.w,t+r),u=Math.max(u,d.node(e.v).out+=r),c=Math.max(c,d.node(e.w).in+=r)}),h=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(u+c+3).map(()=>new n),f=c+1,d.nodes().forEach(e=>{l(h,f,d.node(e))}),{graph:d,buckets:h,zeroIdx:f});return(function(e,t,r){let n=[],o=t[t.length-1],a=t[0],s;for(;e.nodeCount();){for(;s=a.dequeue();)i(e,t,r,s);for(;s=o.dequeue();)i(e,t,r,s);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue()){n=n.concat(i(e,t,r,s,!0));break}}}return n})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let a=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),i=e.node(n.v);o&&a.push({v:n.v,w:n.w}),i.out-=s,l(t,r,i)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),a=n.w,s=e.node(a);s.in-=o,l(t,r,s)}),e.removeNode(n.v),a}function l(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),l=o((e,t)=>{var r=a().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=l(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=o),n(e,"border",a,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=d(s(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,a=e.y,s=t.x-o,i=t.y-a,l=e.width/2,d=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*l>Math.abs(s)*d?(i<0&&(d=-d),r=d*s/i,n=d):(s<0&&(l=-l),r=l,n=l*i/s),{x:o+r,y:a+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:s,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:d,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%a!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:l,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function s(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var i=0;function l(e){return e+""+ ++i}function d(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),d=o((e,t)=>{var r=i(),n=l().uniqueId;t.exports={run:function(e){var t,o;let a,s,i;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(a=[],s={},i={},(o=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?a.push(t):e(t.w)}),delete s[t])}),a)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),c=o((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,a,s=t.v,i=e.node(s).rank,l=t.w,d=e.node(l).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(d!==i+1){for(e.removeEdge(t),a=0,++i;i<d;++a,++i)u.points=[],o={width:0,height:0,edgeLabel:u,edgeObj:t,rank:i},n=r.addDummyNode(e,"edge",o,"_d"),i===h&&(o.width=u.width,o.height=u.height,o.dummy="edge-label",o.labelpos=u.labelpos),e.setEdge(s,n,{weight:u.weight},c),0===a&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,l,{weight:u.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=o((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var a=e.node(o);if(Object.hasOwn(t,o))return a.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),a.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=o((e,t)=>{var r=a().Graph,n=u().slack;t.exports=function(e){var t,o,a,s,i=new r({directed:!1}),l=e.nodes()[0],d=e.nodeCount();for(i.setNode(l,{});t=i,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(a=>{var s=a.v,i=r===s?a.w:s;t.hasNode(i)||n(o,a)||(t.setNode(i,{}),t.setEdge(r,i,{}),e(i))})}),t.nodeCount()<d;)a=function(e,t){return t.edges().reduce((r,o)=>{let a=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(a=n(t,o)),a<r[0]?[a,o]:r},[1/0,null])[1]}(i,e),s=i.hasNode(a.v)?n(e,a):-n(e,a),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(i,e,s);return i}}),f=o((e,t)=>{var r=h(),n=u().slack,o=u().longestPath,s=a().alg.preorder,i=a().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,a=r(e);for(g(a),f(a,e);t=m(a);)n=v(a,e,t),y(a,e,t,n)}function f(e,t){var r=i(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,a,s;return n=e,o=t,a=r,s=n.node(a).parent,void(n.edge(a,s).cutvalue=p(n,o,a))})}function p(e,t,r){var n=e.node(r).parent,o=!0,a=t.edge(r,n),s=0;return a||(o=!1,a=t.edge(n,r)),s=a.weight,t.nodeEdges(r).forEach(a=>{var i=a.v===r,l=i?a.w:a.v;if(l!==n){var d,c,u,h=i===o,f=t.edge(a).weight;if(s+=h?f:-f,d=e,c=r,u=l,d.hasEdge(c,u)){var p=e.edge(r,l).cutvalue;s+=h?-p:p}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,a){var s=n,i=t.node(o);return r[o]=!0,t.neighbors(o).forEach(a=>{Object.hasOwn(r,a)||(n=e(t,r,n,a,o))}),i.low=s,i.lim=n++,a?i.parent=a:delete i.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,a=r.w;t.hasEdge(o,a)||(o=r.w,a=r.v);var s=e.node(o),i=e.node(a),l=s,d=!1;return s.lim>i.lim&&(l=i,d=!0),t.edges().filter(t=>d===x(e,e.node(t.v),l)&&d!==x(e,e.node(t.w),l)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function y(e,t,r,n){var o,a,i,l,d=r.v,c=r.w;e.removeEdge(d,c),e.setEdge(n.v,n.w,{}),g(e),f(e,t),o=e,a=t,i=o.nodes().find(e=>!a.node(e).parent),(l=(l=s(o,i)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=a.edge(e,t),n=!1;r||(r=a.edge(t,e),n=!0),a.node(e).rank=a.node(t).rank+(n?r.minlen:-r.minlen)})}function x(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=p,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=y}),p=o((e,t)=>{var r=u().longestPath,n=h(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":a(e);case"none":}};var a=r}),g=o((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let a=n;t.children(o).forEach(e),r[o]={low:a,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,a=function(e,t,r,n){let o=[],a=[],s=Math.min(t[r].low,t[n].low),i=Math.max(t[r].lim,t[n].lim),l,d;l=r;do o.push(l=e.parent(l));while(l&&(t[l].low>s||i>t[l].lim))for(d=l,l=n;(l=e.parent(l))!==d;)a.push(l);return{path:o.concat(a.reverse()),lca:d}}(e,o,n.v,n.w),s=a.path,i=a.lca,l=0,d=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(d=s[l])!==i&&e.node(d).maxRank<r.rank;)l++;d===i&&(c=!1)}if(!c){for(;l<s.length-1&&e.node(d=s[l+1]).minRank<=r.rank;)l++;d=s[l]}e.setParent(t,d),t=e.successors(t)[0]}})}}),m=o((e,t)=>{var r=l();t.exports={run:function(e){var t,n,o;let a=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var a=t.children(r);a&&a.length&&a.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),i=Object.values(s),l=r.applyWithChunking(Math.max,i)-1,d=2*l+1;e.graph().nestingRoot=a,e.edges().forEach(t=>e.edge(t).minlen*=d);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,a,s,i,l){let d=t.children(l);if(!d.length){l!==n&&t.setEdge(n,l,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),u=r.addBorderNode(t,"_bb"),h=t.node(l);t.setParent(c,l),h.borderTop=c,t.setParent(u,l),h.borderBottom=u,d.forEach(r=>{e(t,n,o,a,s,i,r);let d=t.node(r),h=d.borderTop?d.borderTop:r,f=d.borderBottom?d.borderBottom:r,p=d.borderTop?a:2*a,g=h!==f?1:s-i[l]+1;t.setEdge(c,h,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,u,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(l)||t.setEdge(n,c,{weight:0,minlen:s+i[l]})})(e,a,d,c,l,s,t)),e.graph().nodeRankFactor=d},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),v=o((e,t)=>{var r=l();function n(e,t,n,o,a,s){let i=a[t][s-1],l=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);a[t][s]=l,e.setParent(l,o),i&&e.setEdge(i,l,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),a=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,o=a.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,a,t),n(e,"borderRight","_br",r,a,t)}})}}),y=o((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function a(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>a(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(a),Object.hasOwn(t,"x")&&a(t)}),r(e))}}}),x=o((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),a=r.applyWithChunking(Math.max,o),s=r.range(a+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),b=o((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),a=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let i=2*s-1;s-=1;let l=Array(i).fill(0),d=0;return a.forEach(e=>{let t=e.pos+s;l[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=l[t+1]),t=t-1>>1,l[t]+=e.weight;d+=e.weight*r}),d}(e,t[o-1],t[o]);return n}}),w=o((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),E=o((e,t)=>{var r=l();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),k=o((e,t)=>{var r=l();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let a=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=a.lhs,i=a.rhs.sort((e,t)=>t.i-e.i),l=[],d=0,c=0,u=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),u=n(l,i,u),s.forEach(e=>{u+=e.vs.length,l.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,u=n(l,i,u)});let h={vs:l.flat(!0)};return c&&(h.barycenter=d/c,h.weight=c),h}}),j=o((e,t)=>{var r=w(),n=E(),o=k();t.exports=function e(t,a,s,i){var l,d;let c=t.children(a),u=t.node(a),h=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};h&&(c=c.filter(e=>e!==h&&e!==f));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let a=e(t,r.v,s,i);p[r.v]=a,Object.hasOwn(a,"barycenter")&&(n=r,o=a,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);l=m,d=p,l.forEach(e=>{e.vs=e.vs.flatMap(e=>d[e]?d[e].vs:e)});let v=o(m,i);if(h&&(v.vs=[h,v.vs,f].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(f)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),C=o((e,t)=>{var r=a().Graph,n=l();t.exports=function(e,t,o,a){a||(a=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),i=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return a.forEach(r=>{let n=e.node(r),a=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(i.setNode(r),i.setParent(r,a||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=i.edge(n,r),a=void 0!==o?o.weight:0;i.setEdge(n,r,{weight:e.edge(t).weight+a})}),Object.hasOwn(n,"minRank")&&i.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),i}}),N=o((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let a=e.parent(r),s,i;for(;a;){if((s=e.parent(a))?(i=n[s],n[s]=a):(i=o,o=a),i&&i!==a)return void t.setEdge(i,a);a=s}})}}),_=o((e,t)=>{var r=x(),n=b(),o=j(),s=C(),i=N(),d=a().Graph,c=l();function u(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return s(e,t,r,n.get(t)||[])})}function h(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,a={}){if("function"==typeof a.customOrder)return void a.customOrder(t,e);let s=c.maxRank(t),l=u(t,c.range(1,s+1),"inEdges"),f=u(t,c.range(s-1,-1,-1),"outEdges"),p=r(t);if(h(t,p),a.disableOptimalOrderHeuristic)return;let g=1/0,m,v=a.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new d;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let a=e.graph().root,s=o(e,a,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),i(e,n,s.vs)})})(e%2?l:f,e%4>=2,v),p=c.buildLayerMatrix(t);let a=n(t,p);a<g?(r=0,m=Object.assign({},p),g=a):a===g&&(m=structuredClone(p))}h(t,m)}}),O=o((e,t)=>{var r=a().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,a=0,s=t.length,l=n[n.length-1];return n.forEach((t,d)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),u=c?e.node(c).order:s;(c||t===l)&&(n.slice(a,d+1).forEach(t=>{e.predecessors(t).forEach(n=>{let a=e.node(n),s=a.order;(s<o||u<s)&&!(a.dummy&&e.node(t).dummy)&&i(r,n,t)})}),a=d+1,o=u)}),n}),r}function s(e,t){let r={};function o(t,o,a,s,l){let d;n.range(o,a).forEach(n=>{d=t[n],e.node(d).dummy&&e.predecessors(d).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>l)&&i(r,t,d)})})}return t.length&&t.reduce(function(t,r){let n=-1,a,s=0;return r.forEach((i,l)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(a=e.node(t[0]).order,o(r,s,l,n,a),s=l,n=a)}o(r,s,r.length,a,t.length)}),r}),r}function i(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function d(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},a={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,a[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let i=n(e);if(i.length){let n=((i=i.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=i[l];a[e]===e&&t<s[n]&&!d(r,e,n)&&(a[n]=e,a[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:a}}function u(e,t,n,o,a){var s,i,l,d,c,u,h;let f,p,g,m={},v=(s=e,i=t,l=n,d=a,f=new r,g=(c=(p=s.graph()).nodesep,u=p.edgesep,h=d,(e,t,r)=>{let n=e.node(t),o=e.node(r),a,s;if(a=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(a+=h?s:-s),s=0,a+=(n.dummy?u:c)/2,a+=(o.dummy?u:c)/2,a+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(a+=h?s:-s),s=0,a}),i.forEach(e=>{let t;e.forEach(e=>{let r=l[e];if(f.setNode(r),t){var n=l[t],o=f.edge(n,r);f.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),f),y=a?"borderLeft":"borderRight";function x(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return x(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),x(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==y&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function h(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var a,s;let i=(a=e,s=t,a.node(s).width/2);n=Math.max(r+i,n),o=Math.min(r-i,o)});let a=n-o;return a<t[0]&&(t=[a,r]),t},[1/0,null])[1]}function f(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),a=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let i=r+s,l=e[i];if(l===t)return;let d=Object.values(l),c=o-n.applyWithChunking(Math.min,d);"l"!==s&&(c=a-n.applyWithChunking(Math.max,d)),c&&(e[i]=n.mapValues(l,e=>e+c))})})}function p(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),s(e,t)),a={},i;["u","d"].forEach(o=>{i="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(i=i.map(e=>Object.values(e).reverse()));let s=("u"===o?e.predecessors:e.successors).bind(e),l=c(e,i,r,s),d=u(e,i,l.root,l.align,"r"===t);"r"===t&&(d=n.mapValues(d,e=>-e)),a[o+t]=d})});let l=h(e,a);return f(a,l),p(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:i,hasConflict:d,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}}),R=o((e,t)=>{var r=l(),n=O().positionX;t.exports=function(e){var t;let o,a,s,i;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),a=t.graph().ranksep,s=t.graph().rankalign,i=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=i+n.height/2:"bottom"===s?n.y=i+r-n.height/2:n.y=i+r/2}),i+=r+a}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),S=o((e,t)=>{var r=d(),n=c(),o=p(),s=l().normalizeRanks,i=g(),u=l().removeEmptyRanks,h=m(),f=v(),x=y(),b=_(),w=R(),E=l(),k=a().Graph;t.exports=function(e,t={}){let a=t.debugTiming?E.time:E.notime;return a("layout",()=>{let l=a(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=F(t.graph()),r.setGraph(Object.assign({},C,L(n,j),E.pick(n,N))),t.nodes().forEach(e=>{let n=L(F(t.node(e)),O);Object.keys(S).forEach(e=>{void 0===n[e]&&(n[e]=S[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=F(t.edge(e));r.setEdge(e,Object.assign({},P,L(n,M),E.pick(n,T)))}),r});return a(" runLayout",()=>{var e,d,c;return e=l,d=a,c=t,void(d(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),d(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),d(" acyclic",()=>r.run(e)),d(" nestingGraph.run",()=>h.run(e)),d(" rank",()=>o(E.asNonCompoundGraph(e))),d(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),d(" removeEmptyRanks",()=>u(e)),d(" nestingGraph.cleanup",()=>h.cleanup(e)),d(" normalizeRanks",()=>s(e)),d(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),d(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),d(" normalize.run",()=>n.run(e)),d(" parentDummyChains",()=>i(e)),d(" addBorderSegments",()=>f(e)),d(" order",()=>b(e,c)),d(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),d(" adjustCoordinateSystem",()=>x.adjust(e)),d(" position",()=>w(e)),d(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,a=n.y,s=r.x-o,i=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:a-i},{x:o+5*s/6,y:a-i},{x:o+s,y:a},{x:o+5*s/6,y:a+i},{x:o+2*s/3,y:a+i}],r.label.x=r.x,r.label.y=r.y}})}),d(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),a=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(o.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),d(" normalize.undo",()=>n.undo(e)),d(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),d(" undoCoordinateSystem",()=>x.undo(e)),d(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,a=e.graph(),s=a.marginx||0,i=a.marginy||0;function l(e){let a=e.x,s=e.y,i=e.width,l=e.height;t=Math.min(t,a-i/2),r=Math.max(r,a+i/2),n=Math.min(n,s-l/2),o=Math.max(o,s+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&l(r)}),t-=s,n-=i,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),a.width=r-t+s,a.height=o-n+i})(e)),d(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=o,s=n),r.points.unshift(E.intersectRect(n,a)),r.points.push(E.intersectRect(o,s))})}),d(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),d(" acyclic.undo",()=>r.undo(e)))}),a(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],C={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],O=["width","height","rank"],S={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function L(e,t){return E.mapValues(E.pick(e,t),Number)}function F(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),M=o((e,t)=>{var r=l(),n=a().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),P=o((e,t)=>{t.exports="2.0.4"});let T=o((e,t)=>{t.exports={graphlib:a(),layout:S(),debug:M(),util:{time:l().time,notime:l().notime},version:P()}})(),L={direction:"LR",ranksep:200,nodesep:15},F={featureNode:{width:288,height:140},repositoryNode:{width:328,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:F[e.type??""]??t}function D(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:a=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let i=new T.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:a,nodesep:s});let l=new Set;for(let e of t)l.add(e.source),l.add(e.target);let d=e.filter(e=>l.has(e.id)),c=e.filter(e=>!l.has(e.id));for(let e of d){let t=A(e,o);i.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)i.hasNode(e.source)&&i.hasNode(e.target)&&i.setEdge(e.source,e.target,{},e.id);T.layout(i);let{targetPosition:u,sourcePosition:h}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),f="LR"===n||"RL"===n,p=new Map;for(let e of d){let t=i.node(e.id),r=A(e,o);p.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of p.values()){g=f?e.cx:e.cy;break}for(let e of c){let t=A(e,o);p.set(e.id,{cx:f?g:0,cy:f?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)p.has(e.source)&&p.has(e.target)&&(m.has(e.source)||m.set(e.source,[]),m.get(e.source).push(e.target));let v=new Map;for(let t=0;t<e.length;t++)v.set(e[t].id,t);for(let[,e]of m)e.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let y=new Set;for(let e of m.values())for(let t of e)y.add(t);let x=[...[...l].filter(e=>p.has(e)&&!y.has(e)),...c.map(e=>e.id)];x.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let b=new Map;for(let e of x)!function e(t){if(b.has(t))return b.get(t);let r=p.get(t),n=f?r.h:r.w,o=m.get(t);if(!o||0===o.length)return b.set(t,n),n;let a=0;for(let t of o)a+=e(t);let i=Math.max(n,a+=(o.length-1)*s);return b.set(t,i),i}(e);let w=0;for(let e of x){let t=b.get(e)??0;!function e(t,r){let n=p.get(t);f?n.cy=r:n.cx=r;let o=m.get(t);if(!o||0===o.length)return;let a=0;for(let e of o)a+=b.get(e)??0;let i=r-(a+=(o.length-1)*s)/2;for(let t of o){let r=b.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let E=[];for(let t of e){let e=p.get(t.id);e&&E.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:E,edges:[...t]}}var I=e.i(21023);let $=(0,I.createServerReference)("7083cd2fc473b133e6b69eb66b8e717e25adb791fc",I.callServer,void 0,I.findSourceMapURL,"deleteFeature");var z=e.i(576),B=e.i(71318);let G=(0,I.createServerReference)("407cb12c3062dd0f15ccdf20e53ba3a87d805c4af9",I.callServer,void 0,I.findSourceMapURL,"stopFeature");var q=e.i(74309);let W=(0,I.createServerReference)("40715f8a1be1f003b03c9091e21678615c3af3ac55",I.callServer,void 0,I.findSourceMapURL,"deleteRepository"),U=(0,I.createServerReference)("4039244f36b53f246b6258db96d2a2a5909128528a",I.callServer,void 0,I.findSourceMapURL,"getFeatureMetadata");var V=e.i(39443),H=e.i(8361),X=e.i(18354),J=e.i(99045);function K(e,t){let r=new Map;for(let e of t)"dependencyEdge"===e.type&&r.set(e.target,e.source);let n=new Map,o=new Map;for(let t of e)"featureNode"===t.type?n.set(t.id,{nodeId:t.id,data:t.data,parentNodeId:r.get(t.id)}):"repositoryNode"===t.type&&o.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:o}}function Y(e,t){return(void 0===t.state||t.state===e.state)&&(void 0===t.lifecycle||t.lifecycle===e.lifecycle)&&(void 0===t.name||t.name===e.name)&&(void 0===t.description||t.description===e.description)}function Q(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||n.parentNodeId!==e.parentNodeId||n.data!==e.data&&JSON.stringify(n.data)!==JSON.stringify(e.data))return!1}return!0}let Z=(0,X.createLogger)("[Polling]"),ee=0,et=0;function er(e,o){let a=(0,r.useRouter)(),s=(0,H.useSoundAction)("delete"),i=(0,H.useSoundAction)("create"),{nodes:l,edges:d,reconcile:c,updateFeature:u,addPendingFeature:h,removeFeature:f,restoreFeature:p,addRepository:g,removeRepository:m,replaceRepository:v,getFeatureRepositoryPath:y,getRepositoryData:x,getRepoMapSize:b,setCallbacks:w,beginMutation:E,endMutation:k,isMutating:j}=function(e,r){let n=(0,t.useMemo)(()=>K(e,r),[]),[o,a]=(0,t.useState)(n.featureMap),[s,i]=(0,t.useState)(n.repoMap),[l,d]=(0,t.useState)(new Map),c=(0,t.useRef)(new Map),u=(0,t.useRef)(new Set),h=(0,t.useRef)(0),f=(0,t.useRef)(new Set),p=(0,t.useRef)(new Set),g=(0,t.useRef)({}),m=(0,t.useMemo)(()=>({onNodeAction:e=>g.current.onNodeAction?.(e),onNodeSettings:e=>g.current.onNodeSettings?.(e),onFeatureDelete:e=>g.current.onFeatureDelete?.(e),onRepositoryAdd:e=>g.current.onRepositoryAdd?.(e),onRepositoryClick:e=>g.current.onRepositoryClick?.(e),onRepositoryDelete:e=>g.current.onRepositoryDelete?.(e),onRetryFeature:e=>g.current.onRetryFeature?.(e),onStartFeature:e=>g.current.onStartFeature?.(e)}),[]),v=(0,t.useRef)(o);v.current=o;let y=(0,t.useRef)(s);y.current=s;let x=(0,t.useMemo)(()=>(function(e,t,r,n){let o=[],a=[],s=e=>e.replace(/\\/g,"/"),i=new Map;for(let[e,r]of t)r.data.repositoryPath&&i.set(s(r.data.repositoryPath),e);let l=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>(e[1].data.createdAt??0)-(t[1].data.createdAt??0))){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};o.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,d,c]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let e="creating"===d.data.state||c,r={...d.data,...!e&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!e&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!e&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete},...!e&&"error"===d.data.state&&n?.onRetryFeature&&{onRetry:n.onRetryFeature},...!e&&"pending"===d.data.state&&n?.onStartFeature&&{onStart:n.onStartFeature},...!e&&("running"===d.data.state||"action-required"===d.data.state)&&n?.onStopFeature&&{onStop:n.onStopFeature}};if(o.push({id:t,type:"featureNode",position:{x:0,y:0},data:r}),d.parentNodeId)a.push({id:`dep-${d.parentNodeId}-${t}`,source:d.parentNodeId,target:t,type:"dependencyEdge"});else{let e=s(d.data.repositoryPath),r=i.get(e)??function(e){if(l.has(e))return l.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return o.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),l.set(e,t),t}(e);a.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}let d=new Set;for(let e of a)"dependencyEdge"===e.type&&d.add(e.source);let c=a.length>0;for(let e of o){let t=e.data;t.showHandles=c,"featureNode"===e.type&&(t.hasChildren=d.has(e.id))}return{nodes:o,edges:a}})(o,s,l,m),[o,s,l,m]),b=(0,t.useRef)({key:"",positions:new Map}),{nodes:w,edges:E}=(0,t.useMemo)(()=>{let e=x.nodes.map(e=>e.id).sort().join(","),t=x.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}`;if(r!==b.current.key){let e=D(x.nodes,x.edges,L),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=b.current.positions;if(n.size>0){let r=0,o=0;for(let[e,a]of t){let t=n.get(e);if(t){r=t.position.x-a.position.x,o=t.position.y-a.position.y;break}}if(0!==r||0!==o){for(let e of t.values())e.position={x:e.position.x+r,y:e.position.y+o};for(let t of e.nodes)t.position={x:t.position.x+r,y:t.position.y+o}}}return b.current={key:r,positions:t},e}let{positions:n}=b.current;return{nodes:x.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:x.edges}},[x]),k=(0,t.useCallback)((e,t)=>{if(h.current>0)return;let{featureMap:r,repoMap:n}=K(e,t),o=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));a(e=>{let t=[...e.entries()].filter(([,e])=>"creating"===e.data.state),n=new Map(r);for(let[e,r]of t){let t=`${r.data.name}\0${r.data.repositoryPath}`;o.has(t)||n.set(e,r)}let a=new Set;for(let[t,r]of e)"deleting"===r.data.state&&(n.has(t)?n.set(t,{...n.get(t),data:{...n.get(t).data,state:"deleting"}}):p.current.has(t)||(n.set(t,r),a.add(t)));for(let[e,t]of(p.current=a,c.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),c.current.delete(e))}return Q(e,n)?e:n}),d(e=>{if(0===e.size)return e;let t=!1,r=new Map(e);for(let[n,a]of e){let e=`${a.data.name}\0${a.data.repositoryPath}`;o.has(e)&&(r.delete(n),t=!0)}return t?r:e}),i(e=>{let t=new Map(n),r=new Set([...n.values()].map(e=>e.data.repositoryPath));for(let[n,o]of e){if(t.has(n)||r.has(o.data.repositoryPath)){u.current.delete(n);continue}(n.startsWith("repo-temp-")||u.current.has(n))&&t.set(n,o)}return Q(e,t)?e:t})},[]),j=(0,t.useCallback)((e,t)=>{a(r=>{let n=r.get(e);if(!n)return c.current.set(e,{...c.current.get(e),...t}),r;if(c.current.delete(e),Y(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o}),d(r=>{let n=r.get(e);if(!n||Y(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o})},[]),C=(0,t.useCallback)((e,t,r)=>{d(n=>{let o=new Map(n);return o.set(e,{nodeId:e,data:t,parentNodeId:r}),o})},[]),N=(0,t.useCallback)(e=>{d(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),_=(0,t.useCallback)(e=>{a(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),O=(0,t.useCallback)((e,t)=>{a(r=>{let n=new Map(r);return n.set(e,t),n})},[]),R=(0,t.useCallback)((e,t)=>{u.current.add(e),i(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),S=(0,t.useCallback)(e=>{u.current.delete(e),i(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),M=(0,t.useCallback)((e,t,r)=>{u.current.delete(e),u.current.add(t),i(n=>{if(!n.has(e))return n;let o=new Map(n);return o.delete(e),o.set(t,{nodeId:t,data:r}),o})},[]),P=(0,t.useCallback)(e=>v.current.get(e)?.data.repositoryPath,[]),T=(0,t.useCallback)(e=>y.current.get(e)?.data,[]),F=(0,t.useCallback)(()=>y.current.size,[]),A=(0,t.useCallback)(e=>{g.current=e},[]),I=(0,t.useCallback)(()=>{h.current++},[]),$=(0,t.useCallback)((e=3e3)=>{let t=setTimeout(()=>{h.current=Math.max(0,h.current-1),f.current.delete(t)},e);f.current.add(t)},[]),z=(0,t.useCallback)(()=>h.current>0,[]);return(0,t.useEffect)(()=>{let e=f.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]),{nodes:w,edges:E,reconcile:k,updateFeature:j,addPendingFeature:C,removePendingFeature:N,removeFeature:_,restoreFeature:O,addRepository:R,removeRepository:S,replaceRepository:M,getFeatureRepositoryPath:P,getRepositoryData:T,getRepoMapSize:F,setCallbacks:A,beginMutation:I,endMutation:$,isMutating:z}}(e,o),C=(0,t.useRef)(l),N=(0,t.useRef)(d);(0,t.useEffect)(()=>{C.current=l,N.current=d},[l,d]);let _=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),O=(0,t.useMemo)(()=>e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(","),[e]),R=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${_}|${O}`;t!==R.current&&(R.current=t,c(e,o))},[_,O,e,o,c]);let S=(0,t.useRef)(new Map),{events:M}=(0,V.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=S.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(M.some(t=>t.featureId===e.featureId&&(0,J.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>a.push(`/feature/${e.featureId}`)}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[O,e,M,a]);let P=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(P.current>M.length&&(P.current=0),M.length<=P.current)return;let e=M.slice(P.current);for(let{featureId:t,state:r,lifecycle:n}of(P.current=M.length,(0,J.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,o=C.current.find(t=>t.id===e);if(o&&"deleting"===o.data.state)continue;u(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[M,u]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;E(),u(`feat-${t}`,{state:"running"}),k()};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[u,E,k]);let T=(0,t.useRef)(new Set),F=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(F.current>M.length&&(F.current=0),M.length<=F.current)return;let e=M.slice(F.current);for(let t of(F.current=M.length,e)){if("Feature metadata updated"!==t.message||T.current.has(t.featureId))continue;T.current.add(t.featureId);let e=`feat-${t.featureId}`;U(t.featureId).then(t=>{t&&u(e,{name:t.name,description:t.description})}).catch(()=>{})}},[M,u]),(0,t.useEffect)(()=>{Z.debug("polling enabled (3000ms interval)");let e=setInterval(async()=>{if(!j())try{let e=await fetch("/api/graph-data");if(!e.ok)throw Error(`status ${e.status}`);let{nodes:t,edges:r}=await e.json();c(t,r)}catch{Z.warn("poll fetch failed — will retry next interval")}},3e3);return()=>{Z.debug("polling disabled"),clearInterval(e)}},[c,j]);let A=(0,t.useCallback)(e=>{},[]),I=(0,t.useCallback)(e=>{},[]),X=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${ee++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:t?.featureId??`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return h(n,o,"dependencyEdge"===r&&e?e:void 0),n},[h]),er=(0,t.useCallback)(e=>{let t=`feat-${e}`;E(),u(t,{state:"running"}),(0,z.resumeFeature)(e).then(e=>{e.error?(u(t,{state:"error"}),n.toast.error(e.error)):n.toast.success("Feature resumed")}).catch(()=>{u(t,{state:"error"}),n.toast.error("Failed to resume feature")}).finally(()=>k())},[u,E,k]),en=(0,t.useCallback)(e=>{let t=`feat-${e}`;E(),u(t,{state:"running"}),(0,B.startFeature)(e).then(e=>{e.error?(u(t,{state:"pending"}),n.toast.error(e.error)):n.toast.success("Feature started")}).catch(()=>{u(t,{state:"pending"}),n.toast.error("Failed to start feature")}).finally(()=>k())},[u,E,k]),eo=(0,t.useCallback)(e=>{E(),G(e).then(e=>{e.error?n.toast.error(e.error):n.toast.success("Agent stopped")}).catch(()=>{n.toast.error("Failed to stop agent")}).finally(()=>k())},[E,k]),ea=(0,t.useCallback)((e,t,r)=>{let o=`feat-${e}`,i=[];if(!0===r){let e=[o];for(;e.length>0;){let t=e.shift();for(let r of N.current)"dependencyEdge"===r.type&&r.source===t&&(i.push(r.target),e.push(r.target))}}let l=new Map;for(let e of[o,...i]){let t=C.current.find(t=>t.id===e);t&&l.set(e,t.data.state)}for(let e of(E(),u(o,{state:"deleting"}),i))u(e,{state:"deleting"});s.play(),a.push("/"),$(e,t,r).then(e=>{if(e.error){for(let[e,t]of l)t&&u(e,{state:t});n.toast.error(e.error)}else for(let e of(f(o),i))f(e)}).catch(()=>{for(let[e,t]of l)t&&u(e,{state:t});n.toast.error("Failed to delete feature")}).finally(()=>k())},[a,s,u,f,E,k]),es=(0,t.useCallback)(async e=>{let t=`repo-${e}`,r=new Set(N.current.filter(e=>e.source===t).map(e=>e.target)),o=x(t),a=new Map;for(let e of r){let t=C.current.find(t=>t.id===e);t&&a.set(e,{nodeId:e,data:t.data})}let i=()=>{for(let[e,r]of(o&&g(t,o),a))p(e,r)};for(let e of(E(),m(t),r))f(e);try{let t=await W(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),i();return}s.play()}catch{n.toast.error("Failed to remove repository"),i()}finally{k()}},[s,m,f,g,p,x,E,k]),ei=(0,t.useCallback)(e=>{let t=D(C.current,N.current,{...L,direction:e});c(t.nodes,t.edges)},[c]);return{nodes:l,edges:d,onNodesChange:A,handleConnect:I,handleAddRepository:(0,t.useCallback)(e=>{let t=0===b(),r=`repo-temp-${++et}`,o=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return E(),g(r,{name:o,repositoryPath:e,id:r,createdAt:Date.now()}),(0,q.addRepository)({path:e,name:o}).then(e=>{if(e.error){m(r),n.toast.error(e.error);return}let t=e.repository;v(r,`repo-${t.id}`,{name:t.name,repositoryPath:t.path,id:t.id,createdAt:t.createdAt instanceof Date?t.createdAt.getTime():Number(t.createdAt)}),i.play()}).catch(()=>{m(r),n.toast.error("Failed to add repository")}).finally(()=>k()),{wasEmpty:t,repoPath:e}},[g,m,v,i,b,E,k]),handleLayout:ei,handleDeleteFeature:ea,handleRetryFeature:er,handleStartFeature:en,handleStopFeature:eo,handleDeleteRepository:es,createFeatureNode:X,getFeatureRepositoryPath:y,getRepositoryData:x,setCallbacks:w}}e.s(["useControlCenterState",()=>er],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),a=e.i(3214),s=e.i(38227),i=e.i(31777),l=e.i(35364);e.i(54793);var d=e.i(7729);e.i(47506);var c=e.i(89313),u=e.i(92002);let h=(0,e.i(3645).default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var f=e.i(8986),p=e.i(38573),g=e.i(19933),m=e.i(67669),v=e.i(24042),y=e.i(64970);e.i(81803);var x=e.i(72714),b=e.i(2287),w=e.i(2828);e.i(99348);var E=e.i(17466),k=e.i(8537),j=e.i(75921),C=e.i(76852),N=e.i(80519);function _({data:e}){let s=(0,o.useRouter)(),d=(0,j.useFeatureFlags)(),[c,_]=(0,n.useState)(!1),O=(0,C.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),R=(0,k.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),S="Booting"===R.status||"Ready"===R.status,M=(0,n.useCallback)((t,r)=>{if(!e.repositoryPath)return;let n=t.preview?t.preview.slice(0,200):"Unknown conversation",o=["Continue work from a previous agent session.","","## Session Context",`- Session ID: ${t.id}`,`- Messages: ${t.messageCount}`,t.lastMessageAt?`- Last active: ${t.lastMessageAt}`:"",`- Conversation file: ${r}`,"","## Session Preview",`> ${n}`,"","## Instructions","1. Read the full conversation history from the file above",`2. Analyze the current state of the repository — what was done, what remains`,"3. Create or update spec files to accurately reflect the current state and remaining work","4. Continue implementing any unfinished work from the conversation"].filter(Boolean).join("\n"),a=new URLSearchParams({repo:e.repositoryPath,prompt:o});s.push(`/create?${a.toString()}`)},[e.repositoryPath,s]);return(0,t.jsxs)("div",{className:(0,i.cn)("group relative",e.onDelete&&e.id&&"pl-10"),children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:u.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 left-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),_(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(m.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(w.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(b.Dialog,{open:c,onOpenChange:_,children:(0,t.jsxs)(b.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(b.DialogHeader,{children:[(0,t.jsx)(b.DialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(b.DialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," and all its features from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(b.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(b.DialogClose,{asChild:!0,children:(0,t.jsx)(l.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>{_(!1),e.onDelete?.(e.id)},children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-pointer items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(h,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,i.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(x.ActionButton,{label:"Open in IDE",onClick:O.openInIde,loading:O.ideLoading,error:!!O.ideError,icon:f.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(w.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(x.ActionButton,{label:"Open in Shell",onClick:O.openInShell,loading:O.shellLoading,error:!!O.shellError,icon:p.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(w.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(x.ActionButton,{label:"Open Folder",onClick:O.openFolder,loading:O.folderLoading,error:!!O.folderError,icon:g.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(w.TooltipContent,{children:"Open Folder"})]})}),(0,t.jsx)(N.FeatureSessionsDropdown,{repositoryPath:e.repositoryPath,onCreateFromSession:M}),d.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(x.ActionButton,{label:S?"Stop Dev Server":"Start Dev Server",onClick:S?R.stop:R.deploy,loading:R.deployLoading||R.stopLoading,error:!!R.deployError,icon:S?y.Square:v.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(w.TooltipContent,{children:S?"Stop Dev Server":"Start Dev Server"})]})}),S?(0,t.jsx)(E.DeploymentStatusBadge,{status:R.status,url:R.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(w.TooltipProvider,{children:(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:(0,i.cn)("text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",e.pulseAdd&&"animate-pulse-cta bg-blue-100 text-blue-500 dark:bg-blue-900/40"),children:(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(w.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:u.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}function O(e){let[n]=(0,u.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}e.i(1650),e.i(45811),e.i(25235);let R={x:30,y:30,zoom:.85};function S({onResetViewport:e}){let{setViewport:o}=(0,r.useReactFlow)(),a=(0,n.useCallback)(()=>{o(e(),{duration:400})},[e,o]);return(0,t.jsx)(r.ControlButton,{onClick:a,title:"Reset view","aria-label":"Reset view",children:(0,t.jsx)(s.RotateCcw,{style:{fill:"none"}})})}function M({nodes:e,edges:o,selectedFeatureId:s,defaultViewport:u,onNodesChange:h,onAddFeature:f,onConnect:p,onNodeClick:g,onPaneClick:m,onCanvasDrag:v,onMoveEnd:y,onResetViewport:x,toolbar:b,emptyState:w}){let E=(0,n.useMemo)(()=>({featureNode:c.FeatureNode,repositoryNode:_}),[]),k=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),j=(0,n.useMemo)(()=>null==s?e:e.map(e=>"featureNode"===e.type&&e.data.featureId===s?{...e,selected:!0}:e),[e,s]),C=0===e.length,[N,M]=(0,n.useState)(C),[P,T]=(0,n.useState)(!1),L=(0,n.useRef)(C);(0,n.useEffect)(()=>{if(L.current&&!C){T(!0);let e=setTimeout(()=>{M(!1),T(!1)},300);return L.current=C,()=>clearTimeout(e)}!L.current&&C&&M(!0),L.current=C},[C]);let F=C&&!w?(0,t.jsx)(d.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(l.Button,{onClick:f,children:[(0,t.jsx)(a.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})}):null,A=w??F;return(0,t.jsxs)("div",{"data-testid":C?"features-canvas-empty":"features-canvas","data-no-drawer-close":!0,className:"dark:bg-background pointer-events-auto relative h-full w-full bg-[#f6f7f8]",children:[(0,t.jsxs)(r.ReactFlow,{nodes:j,edges:o,nodeTypes:E,edgeTypes:k,onConnect:p,onNodesChange:h,onNodeClick:g,onPaneClick:m,onMoveStart:v,onMoveEnd:y,defaultViewport:u??R,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),!C&&(0,t.jsx)(r.Controls,{showInteractive:!1,children:x?(0,t.jsx)(S,{onResetViewport:x}):null}),b]}),N&&A?(0,t.jsx)("div",{className:(0,i.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",P?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto h-full w-full",children:A})}):null]})}var P=e.i(5147),T=e.i(8361),L=e.i(30153);let F="shep-canvas-viewport",A={x:30,y:30,zoom:.85};var D=e.i(33548),I=e.i(23925),$=e.i(83428),z=e.i(35e3),B=e.i(79687),G=e.i(99105),q=e.i(78521),W=e.i(21023);let U=(0,W.createServerReference)("00159d626582fc1b91f3f86ad3def71199ec54f529",W.callServer,void 0,W.findSourceMapURL,"isAgentSetupComplete"),V=(0,W.createServerReference)("0084d7c14f2626cb846d6c8416c2b05a734e78bc18",W.callServer,void 0,W.findSourceMapURL,"checkAgentAuth");var H=e.i(11345),X=e.i(81088),J=e.i(73377),K=e.i(86782),Y=e.i(29847);let Q=["select-agent","select-model"];function Z({onComplete:e,className:r}){let[o,a]=(0,n.useState)([]),[s,l]=(0,n.useState)(!0),[d,c]=(0,n.useState)("select-agent"),[u,h]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),[g,m]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!0),x=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{(0,X.getAllAgentModels)().then(a).finally(()=>l(!1))},[]);let b=u?o.find(e=>e.agentType===u):null,w=(0,n.useCallback)((e,t)=>{m(!0),y(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{t?.(),c(e),requestAnimationFrame(()=>{y(!0),m(!1)})},150)},[]);(0,n.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let E=(0,n.useCallback)(async(t,r)=>{p(!0);try{await (0,J.updateAgentAndModel)(t,r),y(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{e()},200)}catch{p(!1)}},[e]),k=(0,n.useCallback)(e=>{let t=o.find(t=>t.agentType===e);t&&t.models.length>0?w("select-model",()=>{h(e)}):E(e,null)},[o,w,E]),j=(0,n.useCallback)(e=>{u&&E(u,e)},[u,E]),C=(0,n.useCallback)(()=>{"select-model"===d&&w("select-agent",()=>{h(null)})},[d,w]);if(s)return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex flex-col items-center justify-center gap-4",r),children:[(0,t.jsx)($.Loader2,{className:"text-muted-foreground h-5 w-5 animate-spin"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Loading agents…"})]});let N=Q.indexOf(d),_="select-agent"===d?"Choose your agent":"Pick a model",O="select-agent"===d?"Select the AI coding agent you want Shep to use.":b?`Choose which ${b.label} model to run.`:"";return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex w-full flex-col items-center",r),children:[(0,t.jsx)("div",{className:"mb-8 flex w-full max-w-xs items-center gap-1.5",children:Q.map((e,r)=>(0,t.jsx)("div",{className:(0,i.cn)("h-[3px] flex-1 rounded-full transition-colors duration-300",r<=N?"bg-foreground/60":"bg-muted")},e))}),(0,t.jsxs)("div",{className:(0,i.cn)("flex w-full flex-col items-center transition-opacity duration-200",v&&!g?"opacity-100":"opacity-0"),children:[(0,t.jsx)("h1",{className:"text-foreground/90 text-center text-5xl font-extralight tracking-tight",children:_}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 text-center text-lg leading-relaxed font-light",children:O}),(0,t.jsxs)("div",{className:"mt-8 flex w-full flex-col items-center",children:["select-agent"===d&&(0,t.jsx)("div",{"data-testid":"agent-list",className:"grid w-full max-w-lg gap-3",style:{gridTemplateColumns:`repeat(${Math.min(o.length,4)}, minmax(0, 1fr))`},children:o.map(e=>{let r=(0,K.getAgentTypeIcon)(e.agentType);return(0,t.jsxs)("button",{type:"button",disabled:f,"data-testid":`agent-option-${e.agentType}`,className:"border-border hover:bg-accent hover:border-foreground/20 flex cursor-pointer flex-col items-center gap-3 rounded-2xl border px-4 py-5 transition-all duration-150 active:scale-[0.97] disabled:opacity-50",onClick:()=>k(e.agentType),children:[(0,t.jsx)(r,{className:"text-foreground/70 h-7 w-7"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.label})]},e.agentType)})}),"select-model"===d&&b?(0,t.jsxs)("div",{"data-testid":"model-list",className:"flex w-full max-w-lg flex-col items-center gap-4",children:[(0,t.jsxs)("button",{type:"button",disabled:f,className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1.5 self-start text-sm transition-colors",onClick:C,children:[(0,t.jsx)(H.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,t.jsx)("div",{className:"grid w-full gap-3",style:{gridTemplateColumns:`repeat(${Math.min(b.models.length,3)}, minmax(0, 1fr))`},children:b.models.map(e=>{let r=(0,Y.getModelMeta)(e.id);return(0,t.jsxs)("button",{type:"button",disabled:f,"data-testid":`model-option-${e.id}`,className:"border-border hover:bg-accent hover:border-foreground/20 flex cursor-pointer flex-col items-center gap-2 rounded-2xl border px-4 py-5 text-center transition-all duration-150 active:scale-[0.97] disabled:opacity-50",onClick:()=>j(e.id),children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:r.displayName||e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs leading-tight",children:r.description||e.description})]},e.id)})})]}):null]})]})]})}let ee=["cd ~/my-repo",'shep feat new "sleek dashboard"'];function et({onRepositorySelect:e,className:r}){let[o,a]=(0,n.useState)(!1),[s,l]=(0,n.useState)(!1),[d,c]=(0,n.useState)(null),[u,h]=(0,n.useState)(null),[f,m]=(0,n.useState)(!1);async function v(){if(!s){l(!0);try{let t=await (0,q.pickFolder)();t&&e?.(t)}finally{l(!1)}}}(0,n.useEffect)(()=>{U().then(e=>{c(e)})},[]),(0,n.useEffect)(()=>{d&&V().then(h)},[d]);let y=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText(ee.join("\n")),a(!0),setTimeout(()=>a(!1),2e3)},[]),x=(0,n.useCallback)(()=>{c(!0)},[]),b=(0,n.useCallback)(()=>{h(null),V().then(h)},[]);return null===d?null:(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,i.cn)("relative flex h-full w-full flex-col items-center justify-center px-8",r),children:[d?(0,t.jsxs)("div",{className:"animate-in fade-in flex w-full max-w-md flex-col items-center duration-300",children:[(0,t.jsx)("h1",{className:"text-foreground/90 text-center text-5xl font-extralight tracking-tight",children:"Add a project"}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-3 text-center text-lg leading-relaxed font-light",children:["Add your project folder to unlock feature creation.",(0,t.jsx)("br",{}),"Describe what you need — Shep handles the rest."]}),(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)(er,{status:u,onRetry:b})}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:v,disabled:s,className:"bg-foreground text-background hover:bg-foreground/90 mt-10 flex w-full cursor-pointer items-center justify-center gap-2.5 rounded-xl px-6 py-4 text-base font-medium shadow-lg transition-all duration-200 hover:shadow-xl active:scale-[0.98] disabled:cursor-wait disabled:opacity-50",children:[s?(0,t.jsx)($.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(g.FolderOpen,{className:"h-5 w-5"}),s?"Opening…":"Choose a Folder"]}),(0,t.jsx)("p",{className:"text-muted-foreground/60 mt-3 text-center text-sm",children:"Any folder works — git will be initialized automatically if needed."})]}):(0,t.jsx)(Z,{onComplete:x}),d?(0,t.jsxs)("div",{className:"absolute bottom-8 flex flex-col items-center",style:{animationDelay:"400ms",animationDuration:"600ms",animationFillMode:"both"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>m(!f),className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1.5 transition-colors duration-200",children:[(0,t.jsx)(p.Terminal,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-sm",children:"or use the CLI"}),(0,t.jsx)(G.ChevronDown,{className:(0,i.cn)("h-3.5 w-3.5 transition-transform duration-200",f?"":"rotate-180")})]}),f?(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-top-1 mt-3 w-80 duration-200",children:(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative rounded-xl bg-zinc-900 px-5 py-4 font-mono text-[13px] leading-relaxed text-zinc-400",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:y,className:"absolute top-3 right-3 cursor-pointer rounded-md p-1.5 text-zinc-600 transition-colors hover:bg-zinc-800 hover:text-zinc-300","aria-label":"Copy commands",children:o?(0,t.jsx)(I.Check,{className:"h-3.5 w-3.5 text-emerald-400"}):(0,t.jsx)(D.Copy,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("div",{className:"space-y-1",children:ee.map(e=>(0,t.jsxs)("div",{className:"whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-zinc-600 select-none",children:"$ "}),(0,t.jsx)("span",{className:"text-zinc-300",children:e})]},e))})]})}):null]}):null]})}function er({status:e,onRetry:r}){return e?e.installed&&e.authenticated?(0,t.jsxs)("div",{className:"animate-in fade-in flex items-center gap-2",children:[(0,t.jsx)(z.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:[e.label," ready"]})]}):e.installed?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 text-amber-500"}),(0,t.jsxs)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:[e.label," needs authentication"]})]}),e.authCommand?(0,t.jsx)("code",{className:"rounded-lg bg-zinc-100 px-3 py-1.5 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",children:e.authCommand}):null,(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e.binaryName?(0,t.jsxs)("button",{type:"button","data-testid":"auth-banner-open-terminal",onClick:async()=>{try{let t="claude-code"===e.agentType?"claude-code":e.agentType;await fetch(`/api/tools/${t}/launch`,{method:"POST"})}catch{}},className:"flex items-center gap-1.5 text-xs font-medium text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:[(0,t.jsx)(p.Terminal,{className:"h-3 w-3"}),"Open ",e.label]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:"Re-check"})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 text-amber-500"}),(0,t.jsxs)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:[e.label," not installed"]})]}),e.binaryName?(0,t.jsxs)("code",{className:"rounded-lg bg-zinc-100 px-3 py-1.5 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",children:["npm install -g ",e.binaryName]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:"Re-check"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)($.Loader2,{className:"text-muted-foreground/50 h-3.5 w-3.5 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground/50 text-sm",children:"Checking setup…"})]})}var en=e.i(17840);let eo={maxZoom:1,padding:.5,duration:500};function ea({initialNodes:e,initialEdges:a}){let s,i,l,d=(0,o.useRouter)(),c=(0,o.usePathname)(),u=(s=(0,o.usePathname)().match(/^\/feature\/([^/]+)/),s?.[1]??null),h=(0,T.useSoundAction)("click"),{guardedNavigate:f}=(0,L.useDrawerCloseGuard)(),{fitView:p}=(0,r.useReactFlow)(),g=(0,n.useRef)(null),{defaultViewport:m,onMoveEnd:v,resetViewport:y}=(i=(0,n.useRef)(function(){try{let e=localStorage.getItem(F);if(null==e)return A;let t=JSON.parse(e);return!(null==t||"object"!=typeof t||Array.isArray(t))&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.zoom&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?t:A}catch{return A}}()).current,l=(0,n.useRef)(null),(0,n.useEffect)(()=>()=>{null!=l.current&&clearTimeout(l.current)},[]),{defaultViewport:i,onMoveEnd:(0,n.useCallback)(e=>{null!=l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{try{localStorage.setItem(F,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,n.useCallback)(()=>{try{localStorage.removeItem(F)}catch{}return A},[])}),{nodes:x,edges:b,onNodesChange:w,handleConnect:E,handleAddRepository:k,handleDeleteFeature:j,handleRetryFeature:C,handleStartFeature:N,handleStopFeature:_,handleDeleteRepository:O,createFeatureNode:R,setCallbacks:S}=(0,en.useControlCenterState)(e,a),{setFeatures:D,setHasRepositories:I}=(0,P.useSidebarFeaturesContext)(),$=(0,n.useMemo)(()=>x.filter(e=>"featureNode"===e.type),[x]),z=(0,n.useMemo)(()=>$.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}`}).sort().join(","),[$]);(0,n.useEffect)(()=>{D($.map(e=>{let t=e.data,r=(0,P.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}:null}).filter(Boolean))},[z,$,D]);let B=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let r=t.data;"creating"!==r.state&&"deleting"!==r.state&&e.target.closest('[data-testid="feature-node-card"]')&&f(()=>{h.play(),d.push(`/feature/${r.featureId}`)})}},[d,h,f]),G=(0,n.useCallback)(()=>{h.play(),d.push("/create")},[d,h]),q=(0,n.useCallback)(e=>{h.play();let t=x.find(t=>t.id===e),r=t?.data?.repositoryPath;r?d.push(`/create?repo=${encodeURIComponent(r)}`):d.push("/create")},[x,d,h]),W=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=b.find(t=>t.target===e),n=r?x.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;h.play();let a=new URLSearchParams;o&&a.set("repo",o),a.set("parent",t),d.push(`/create?${a.toString()}`)},[x,b,d,h]),U=(0,n.useCallback)(e=>{let t=x.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&f(()=>d.push(`/repository/${e.id}`))}},[x,d,f]),V=(0,n.useCallback)(()=>{"/"!==c&&f(()=>d.push("/"))},[d,c,f]),H=(0,n.useCallback)(e=>{setTimeout(()=>{p(eo),g.current=setTimeout(()=>{f(()=>d.push(`/create?repo=${encodeURIComponent(e)}`))},600)},0)},[p,f,d]),X=(0,n.useCallback)(e=>{let{wasEmpty:t,repoPath:r}=k(e);t&&H(r)},[k,H]);(0,n.useEffect)(()=>{let e=e=>{X(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>{window.removeEventListener("shep:add-repository",e),null!=g.current&&clearTimeout(g.current)}},[X]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void R(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let r=x.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);R(r?.id??null,{state:"running",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[x,R]),(0,n.useEffect)(()=>{let e=e=>{let{featureId:t,cleanup:r,cascadeDelete:n}=e.detail;j(t,r,n)};return window.addEventListener("shep:feature-delete-requested",e),()=>window.removeEventListener("shep:feature-delete-requested",e)},[j]),(0,n.useEffect)(()=>{S({onNodeAction:W,onFeatureDelete:j,onRetryFeature:C,onStartFeature:N,onStopFeature:_,onRepositoryAdd:q,onRepositoryClick:U,onRepositoryDelete:O})},[S,W,j,C,N,_,q,U,O]);let J=(0,n.useCallback)((e,t)=>{v(t)},[v]),K=x.some(e=>"repositoryNode"===e.type);(0,n.useEffect)(()=>{I(K)},[K,I]);let[Y,Q]=(0,n.useState)(K),Z=(0,n.useRef)(null);(0,n.useEffect)(()=>(K?(Z.current&&(clearTimeout(Z.current),Z.current=null),Q(!0)):Y&&(y(),Z.current=setTimeout(()=>{Q(!1),Z.current=null},500)),()=>{Z.current&&clearTimeout(Z.current)}),[K,Y,y]);let ee=c.startsWith("/create"),er=(0,n.useMemo)(()=>{let e=x.filter(e=>"repositoryNode"===e.type),t=x.some(e=>"featureNode"===e.type);return 1!==e.length||t||ee?x:x.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[x,ee]);return(0,t.jsx)(M,{nodes:Y?er:[],edges:Y?b:[],selectedFeatureId:u,defaultViewport:m,onNodesChange:w,onConnect:E,onAddFeature:G,onNodeClick:B,onPaneClick:V,onMoveEnd:J,onResetViewport:y,emptyState:(0,t.jsx)(et,{onRepositorySelect:X})})}function es({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(ea,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>es],48246)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},81846,e=>{"use strict";var t=e.i(20314),s=e.i(94237),r=e.i(31777);let a=(0,s.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:e,variant:s,...i}){return(0,t.jsx)("div",{className:(0,r.cn)(a({variant:s}),e),...i})}e.s(["Badge",()=>i])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},68304,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(91967),a=e.i(22528),i=e.i(51080),l=e.i(85995),n=e.i(87620),o=e.i(66033),c=e.i(36589),d=e.i(13123),u="Tabs",[m,f]=(0,a.createContextScope)(u,[i.createRovingFocusGroupScope]),h=(0,i.createRovingFocusGroupScope)(),[x,p]=m(u),g=s.forwardRef((e,s)=>{let{__scopeTabs:r,value:a,onValueChange:i,defaultValue:l,orientation:m="horizontal",dir:f,activationMode:h="automatic",...p}=e,g=(0,o.useDirection)(f),[v,b]=(0,c.useControllableState)({prop:a,onChange:i,defaultProp:l??"",caller:u});return(0,t.jsx)(x,{scope:r,baseId:(0,d.useId)(),value:v,onValueChange:b,orientation:m,dir:g,activationMode:h,children:(0,t.jsx)(n.Primitive.div,{dir:g,"data-orientation":m,...p,ref:s})})});g.displayName=u;var v="TabsList",b=s.forwardRef((e,s)=>{let{__scopeTabs:r,loop:a=!0,...l}=e,o=p(v,r),c=h(r);return(0,t.jsx)(i.Root,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:a,children:(0,t.jsx)(n.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:s})})});b.displayName=v;var y="TabsTrigger",j=s.forwardRef((e,s)=>{let{__scopeTabs:a,value:l,disabled:o=!1,...c}=e,d=p(y,a),u=h(a),m=N(d.baseId,l),f=C(d.baseId,l),x=l===d.value;return(0,t.jsx)(i.Item,{asChild:!0,...u,focusable:!o,active:x,children:(0,t.jsx)(n.Primitive.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":f,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:m,...c,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(l)}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(l)}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==d.activationMode;x||o||!e||d.onValueChange(l)})})})});j.displayName=y;var k="TabsContent",w=s.forwardRef((e,r)=>{let{__scopeTabs:a,value:i,forceMount:o,children:c,...d}=e,u=p(k,a),m=N(u.baseId,i),f=C(u.baseId,i),h=i===u.value,x=s.useRef(h);return s.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(l.Presence,{present:o||h,children:({present:s})=>(0,t.jsx)(n.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":m,hidden:!s,id:f,tabIndex:0,...d,ref:r,style:{...e.style,animationDuration:x.current?"0s":void 0},children:s&&c})})});function N(e,t){return`${e}-trigger-${t}`}function C(e,t){return`${e}-content-${t}`}w.displayName=k,e.s(["Content",()=>w,"List",()=>b,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>w,"TabsList",()=>b,"TabsTrigger",()=>j,"Trigger",()=>j,"createTabsScope",()=>f],43133);var T=e.i(43133),T=T,R=e.i(31777);let S=T.Root,I=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.List,{ref:r,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...s}));I.displayName=T.List.displayName;let A=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.Trigger,{ref:r,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...s}));A.displayName=T.Trigger.displayName;let z=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.Content,{ref:r,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...s}));z.displayName=T.Content.displayName,e.s(["Tabs",()=>S,"TabsContent",()=>z,"TabsList",()=>I,"TabsTrigger",()=>A],68304)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var s=e.i(80986);e.s(["CheckCircle2",()=>s.default],35e3)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},51080,e=>{"use strict";var t=e.i(79054),s=e.i(91967),r=e.i(87342),a=e.i(5978),i=e.i(22528),l=e.i(13123),n=e.i(87620),o=e.i(29297),c=e.i(36589),d=e.i(66033),u=e.i(20314),m="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[x,p,g]=(0,r.createCollection)(h),[v,b]=(0,i.createContextScope)(h,[g]),[y,j]=v(h),k=t.forwardRef((e,t)=>(0,u.jsx)(x.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(x.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(w,{...e,ref:t})})}));k.displayName=h;var w=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:i,orientation:l,loop:x=!1,dir:g,currentTabStopId:v,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:j,onEntryFocus:k,preventScrollOnEntryFocus:w=!1,...N}=e,C=t.useRef(null),T=(0,a.useComposedRefs)(r,C),S=(0,d.useDirection)(g),[I,A]=(0,c.useControllableState)({prop:v,defaultProp:b??null,onChange:j,caller:h}),[z,E]=t.useState(!1),M=(0,o.useCallbackRef)(k),D=p(i),L=t.useRef(!1),[F,P]=t.useState(0);return t.useEffect(()=>{let e=C.current;if(e)return e.addEventListener(m,M),()=>e.removeEventListener(m,M)},[M]),(0,u.jsx)(y,{scope:i,orientation:l,dir:S,loop:x,currentTabStopId:I,onItemFocus:t.useCallback(e=>A(e),[A]),onItemShiftTab:t.useCallback(()=>E(!0),[]),onFocusableItemAdd:t.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>P(e=>e-1),[]),children:(0,u.jsx)(n.Primitive.div,{tabIndex:z||0===F?-1:0,"data-orientation":l,...N,ref:T,style:{outline:"none",...e.style},onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,s.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!z){let t=new CustomEvent(m,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,s.composeEventHandlers)(e.onBlur,()=>E(!1))})})}),N="RovingFocusGroupItem",C=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:a,focusable:i=!0,active:o=!1,tabStopId:c,children:d,...m}=e,f=(0,l.useId)(),h=c||f,g=j(N,a),v=g.currentTabStopId===h,b=p(a),{onFocusableItemAdd:y,onFocusableItemRemove:k,currentTabStopId:w}=g;return t.useEffect(()=>{if(i)return y(),()=>k()},[i,y,k]),(0,u.jsx)(x.ItemSlot,{scope:a,id:h,focusable:i,active:o,children:(0,u.jsx)(n.Primitive.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{i?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,s){var r;let a=(r=e.key,"rtl"!==s?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return T[a]}(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){var s,r;"prev"===t&&a.reverse();let i=a.indexOf(e.currentTarget);a=g.loop?(s=a,r=i+1,s.map((e,t)=>s[(r+t)%s.length])):a.slice(i+1)}setTimeout(()=>R(a))}}),children:"function"==typeof d?d({isCurrentTabStop:v,hasTabStop:null!=w}):d})})});C.displayName=N;var T={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e,t=!1){let s=document.activeElement;for(let r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}e.s(["Item",()=>C,"Root",()=>k,"createRovingFocusGroupScope",()=>b])},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),s=e.i(22528),r=e.i(5978),a=e.i(86874),i=e.i(20314);function l(e){let l=e+"CollectionProvider",[n,o]=(0,s.createContextScope)(l),[c,d]=n(l,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:s,children:r}=e,a=t.default.useRef(null),l=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:s,itemMap:l,collectionRef:a,children:r})};u.displayName=l;let m=e+"CollectionSlot",f=(0,a.createSlot)(m),h=t.default.forwardRef((e,t)=>{let{scope:s,children:a}=e,l=d(m,s),n=(0,r.useComposedRefs)(t,l.collectionRef);return(0,i.jsx)(f,{ref:n,children:a})});h.displayName=m;let x=e+"CollectionItemSlot",p="data-radix-collection-item",g=(0,a.createSlot)(x),v=t.default.forwardRef((e,s)=>{let{scope:a,children:l,...n}=e,o=t.default.useRef(null),c=(0,r.useComposedRefs)(s,o),u=d(x,a);return t.default.useEffect(()=>(u.itemMap.set(o,{ref:o,...n}),()=>void u.itemMap.delete(o))),(0,i.jsx)(g,{...{[p]:""},ref:c,children:l})});return v.displayName=x,[{Provider:u,Slot:h,ItemSlot:v},function(s){let r=d(e+"CollectionConsumer",s);return t.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort((e,s)=>t.indexOf(e.ref.current)-t.indexOf(s.ref.current))},[r.collectionRef,r.itemMap])},o]}var n=new WeakMap;function o(e,t){var s,r;let a,i,l;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=(s=e,r=t,a=s.length,(l=(i=c(r))>=0?i:a+i)<0||l>=a?-1:l);return -1===n?void 0:e[n]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],n.set(this,!0)}set(e,t){return n.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,s){let r,a=this.has(t),i=this.#e.length,l=c(e),n=l>=0?l:i+l,o=n<0||n>=i?-1:n;if(o===this.size||a&&o===this.size-1||-1===o)return this.set(t,s),this;let d=this.size+ +!a;l<0&&n++;let u=[...this.#e],m=!1;for(let e=n;e<d;e++)if(n===e){let i=u[e];u[e]===t&&(i=u[e+1]),a&&this.delete(t),r=this.get(i),this.set(t,s)}else{m||u[e-1]!==t||(m=!0);let s=u[m?e:e-1],a=r;r=this.get(s),this.delete(s),this.set(s,a)}return this}with(t,s,r){let a=new e(this);return a.insert(t,s,r),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,s){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,s)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,s){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=o(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=o(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return o(this.#e,e)}from(e,t){let s=this.indexOf(e);if(-1===s)return;let r=s+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let s=this.indexOf(e);if(-1===s)return;let r=s+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return r;s++}}findIndex(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return s;s++}return -1}filter(t,s){let r=[],a=0;for(let e of this)Reflect.apply(t,s,[e,a,this])&&r.push(e),a++;return new e(r)}map(t,s){let r=[],a=0;for(let e of this)r.push([e[0],Reflect.apply(t,s,[e,a,this])]),a++;return new e(r)}reduce(...e){let[t,s]=e,r=0,a=s??this.at(0);for(let s of this)a=0===r&&1===e.length?s:Reflect.apply(t,this,[a,s,r,this]),r++;return a}reduceRight(...e){let[t,s]=e,r=s??this.at(-1);for(let s=this.size-1;s>=0;s--){let a=this.at(s);r=s===this.size-1&&1===e.length?a:Reflect.apply(t,this,[r,a,s,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let s=this.keyAt(e),r=this.get(s);t.set(s,r)}return t}toSpliced(...t){let s=[...this.entries()];return s.splice(...t),new e(s)}slice(t,s){let r=new e,a=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==s&&s>0&&(a=s-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),s=this.get(t);r.set(t,s)}return r}every(e,t){let s=0;for(let r of this){if(!Reflect.apply(e,t,[r,s,this]))return!1;s++}return!0}some(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return!0;s++}return!1}}),e.s(["createCollection",()=>l])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},44412,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(81975),a=e.i(68304),i=e.i(31777),l=e.i(83428),n=e.i(83902),o=e.i(81181),c=e.i(3645);let d=(0,c.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var u=e.i(38573),m=e.i(49228),f=e.i(54277),h=e.i(95812),x=e.i(35e3);let p=(0,c.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var g=e.i(35364),v=e.i(2828),b=e.i(33548),y=e.i(23925),j=e.i(30702),k=e.i(11495);let w={linux:"Linux",darwin:"macOS",win32:"Windows"},N={ide:{label:"IDE",icon:d},"cli-agent":{label:"CLI Agent",icon:u.Terminal},vcs:{label:"VCS",icon:m.GitBranch},terminal:{label:"Terminal",icon:u.Terminal}};function C({status:e}){return"available"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",children:[(0,t.jsx)(y.Check,{className:"h-3 w-3"}),"Installed"]}):"error"===e?(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-700 dark:bg-red-900/30 dark:text-red-400",children:"Error"}):(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:"Missing"})}function T({tool:e,open:r,onClose:a,onRefresh:i,autoStart:c}){let[u,m]=(0,s.useState)(!1),[f,h]=(0,s.useState)(!1),{logs:x,status:v,startInstall:T}=function(e){let[t,r]=(0,s.useState)([]),[a,i]=(0,s.useState)("idle"),[l,n]=(0,s.useState)(null),o=(0,s.useRef)(null),c=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null)},[]);return(0,s.useEffect)(()=>c,[c]),{logs:t,status:a,result:l,startInstall:(0,s.useCallback)(()=>{c(),r([]),n(null),i("streaming");let t=new EventSource(`/api/tools/${e}/install/stream`);o.current=t,t.onmessage=e=>{r(t=>[...t,e.data])},t.addEventListener("done",e=>{let t=JSON.parse(e.data);n(t),i("error"===t.status?"error":"done"),c()}),t.onerror=()=>{i("error"),c()}},[e,c])}}(e.id),R=(0,s.useRef)(null),S=(0,s.useRef)(!0),I=(0,s.useRef)(!1),A="available"===e.status.status,z="error"===e.status.status,E=A&&!!e.openDirectory,M=!A&&!z&&e.autoInstall;async function D(){h(!0);try{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})}finally{h(!1)}}(0,s.useEffect)(()=>{r&&c&&M&&"idle"===v&&!I.current&&(I.current=!0,T()),r||(I.current=!1)},[r,c,M,v,T]);let L=(0,s.useCallback)(()=>{let e=R.current;e&&(S.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);(0,s.useEffect)(()=>{S.current&&R.current&&(R.current.scrollTop=R.current.scrollHeight)},[x,v]),(0,s.useEffect)(()=>{"done"===v&&i&&i()},[v,i]);let F=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 pr-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",width:24,height:24,className:"shrink-0 dark:invert"}):(0,t.jsx)(p,{className:"text-muted-foreground h-6 w-6 shrink-0"}),(0,t.jsx)("h2",{className:"text-base font-bold",children:e.name}),(0,t.jsx)(C,{status:e.status.status})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:e.tags.map(e=>{let s=N[e]??{label:e,icon:d},r=s.icon;return(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5 text-[10px]",children:[(0,t.jsx)(r,{className:"h-3 w-3"}),s.label]},e)})})]});return(0,t.jsx)(k.BaseDrawer,{open:r,onClose:a,size:"md",modal:!0,title:e.name,header:F,"data-testid":"tool-detail-drawer",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.description}),e.author||e.platforms?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs",children:[e.author?(0,t.jsxs)("span",{className:"text-muted-foreground",children:["by"," ",e.website?(0,t.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",className:"text-foreground hover:underline",children:e.author}):(0,t.jsx)("span",{className:"text-foreground",children:e.author})]}):null,e.platforms&&e.platforms.length>0?(0,t.jsx)("span",{className:"text-muted-foreground",children:e.platforms.map(e=>w[e]??e).join(" · ")}):null]}):null,e.installCommand?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wide uppercase",children:"Install command"}),(0,t.jsxs)("div",{className:"relative rounded-md bg-zinc-900 text-zinc-100",children:[(0,t.jsx)("pre",{className:"overflow-x-auto px-3 py-2.5 pr-16 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap",children:(0,t.jsx)("code",{children:e.installCommand})}),(0,t.jsxs)(g.Button,{variant:"ghost",size:"sm",className:"absolute top-1.5 right-1.5 h-7 cursor-pointer px-2 text-zinc-400 hover:text-zinc-100",onClick:function(){e.installCommand&&navigator.clipboard.writeText(e.installCommand).then(()=>{m(!0),setTimeout(()=>m(!1),2e3)})},"aria-label":u?"Copied!":"Copy install command",children:[u?(0,t.jsx)(y.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(b.Copy,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"ml-1 text-[10px]",children:u?"Copied!":"Copy"})]})]})]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,t.jsxs)(g.Button,{size:"sm",onClick:T,disabled:"streaming"===v,"aria-label":`Install ${e.name}`,className:"cursor-pointer",children:["streaming"===v?(0,t.jsx)(l.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o.Download,{className:"mr-1.5 h-3.5 w-3.5"}),"streaming"===v?"Installing...":"Install"]}):null,E?(0,t.jsxs)(g.Button,{size:"sm",variant:"outline",onClick:()=>void D(),disabled:f,"aria-label":`Launch ${e.name}`,className:"cursor-pointer",children:[f?(0,t.jsx)(l.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(n.Rocket,{className:"mr-1.5 h-3.5 w-3.5"}),"Launch"]}):null,e.documentationUrl?(0,t.jsx)(g.Button,{variant:"outline",size:"sm",className:"cursor-pointer",asChild:!0,children:(0,t.jsxs)("a",{href:e.documentationUrl,target:"_blank",rel:"noopener noreferrer",children:["Docs",(0,t.jsx)(j.ExternalLink,{className:"ml-1 h-3 w-3"})]})}):null]}),("streaming"===v||"done"===v||"error"===v)&&x.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wide uppercase",children:"Install log"}),(0,t.jsxs)("div",{ref:R,onScroll:L,className:"max-h-60 overflow-auto rounded-md bg-zinc-900 p-3 font-mono text-xs leading-relaxed text-zinc-100","data-testid":"tool-install-log",children:[x.map((e,s)=>(0,t.jsx)("div",{className:"break-all whitespace-pre-wrap",children:e},s)),"done"===v?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-emerald-400",children:"Installation complete"}):null,"error"===v?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-red-400",children:"Installation failed"}):null]})]}):null]})})}let R={ide:{label:"IDE",icon:d},"cli-agent":{label:"CLI Agent",icon:u.Terminal},vcs:{label:"VCS",icon:m.GitBranch},terminal:{label:"Terminal",icon:u.Terminal}};function S({tool:e,onRefresh:r,className:a}){let[c,u]=(0,s.useState)(!1),[m,b]=(0,s.useState)(!1),[y,j]=(0,s.useTransition)(),k="available"===e.status.status,w="error"===e.status.status,N=k&&!!e.openDirectory;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"tool-card",onClick:function(){b(!1),u(!0)},className:(0,i.cn)("bg-card group flex h-30 w-full cursor-pointer flex-col rounded-lg border p-3 transition-shadow hover:shadow-md",a),children:[(0,t.jsxs)("div",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",width:20,height:20,className:"shrink-0 dark:invert"}):(0,t.jsx)(p,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("h3",{"data-testid":"tool-card-name",className:"truncate text-sm font-bold",children:e.name})]}),(0,t.jsx)("div",{"data-testid":"tool-card-tags",className:"flex shrink-0 items-center gap-1",children:e.tags.map(e=>{let s=R[e]??{label:e,icon:d},r=s.icon;return(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5 text-[9px]",children:[(0,t.jsx)(r,{className:"h-2.5 w-2.5"}),s.label]},e)})})]}),(0,t.jsx)("p",{"data-testid":"tool-card-summary",className:"text-muted-foreground mt-1 truncate text-xs",children:e.summary}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w&&"error"===e.status.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 truncate text-[10px] text-red-600 dark:text-red-400",title:e.status.errorMessage,children:[(0,t.jsx)(f.CircleX,{className:"h-3 w-3 shrink-0"}),e.status.errorMessage??"Error"]}):k?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400",children:[(0,t.jsx)(x.CheckCircle2,{className:"h-3 w-3"}),"Installed"]}):(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-[10px]",children:[(0,t.jsx)(h.Circle,{className:"h-3 w-3"}),"Not installed"]}),e.required?(0,t.jsx)(v.TooltipProvider,{children:(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-[9px] font-medium text-amber-700 dark:bg-amber-900/50 dark:text-amber-400",children:"Required"})}),(0,t.jsx)(v.TooltipContent,{side:"top",children:"This tool is required for Shep to function properly"})]})}):null]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:k&&N?(0,t.jsxs)(g.Button,{size:"sm",variant:"outline",onClick:function(t){t.stopPropagation(),j(async()=>{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})})},disabled:y,"aria-label":`Launch ${e.name}`,"data-testid":"tool-card-launch-button",className:"h-7 cursor-pointer rounded-md px-3 text-xs",children:[y?(0,t.jsx)(l.Loader2,{className:"mr-1 h-3 w-3 animate-spin"}):(0,t.jsx)(n.Rocket,{className:"mr-1 h-3 w-3"}),"Launch"]}):k||w?null:(0,t.jsxs)(g.Button,{size:"sm",variant:"default",onClick:function(t){t.stopPropagation(),b(e.autoInstall),u(!0)},"aria-label":`Install ${e.name}`,"data-testid":"tool-card-install-button",className:"h-7 cursor-pointer rounded-md px-3 text-xs",children:[(0,t.jsx)(o.Download,{className:"mr-1 h-3 w-3"}),"Install"]})})]})]}),(0,t.jsx)(T,{tool:e,open:c,onClose:()=>u(!1),onRefresh:r,autoStart:m})]})}let I={all:()=>!0,ide:e=>e.tags.includes("ide"),"cli-agent":e=>e.tags.includes("cli-agent"),vcs:e=>e.tags.includes("vcs"),terminal:e=>e.tags.includes("terminal")};function A({tools:e,className:l}){let[n,o]=(0,s.useState)(e),[c,d]=(0,s.useState)("all"),u=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/tools");if(e.ok){let t=await e.json();o(t)}}catch{}},[]),m=n.filter(I[c]);return(0,t.jsxs)("div",{"data-testid":"tools-page-client",className:(0,i.cn)("space-y-4",l),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Wrench,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Tools"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:[n.filter(e=>"available"===e.status.status).length,"/",n.length," installed"]})]}),(0,t.jsxs)(a.Tabs,{value:c,onValueChange:e=>d(e),"data-testid":"tools-page-tabs",children:[(0,t.jsxs)(a.TabsList,{className:"h-7",children:[(0,t.jsx)(a.TabsTrigger,{value:"all","data-testid":"tools-tab-all",className:"px-2.5 text-xs",children:"All"}),(0,t.jsx)(a.TabsTrigger,{value:"ide","data-testid":"tools-tab-ide",className:"px-2.5 text-xs",children:"IDEs"}),(0,t.jsx)(a.TabsTrigger,{value:"cli-agent","data-testid":"tools-tab-cli-agent",className:"px-2.5 text-xs",children:"CLI Agents"}),(0,t.jsx)(a.TabsTrigger,{value:"vcs","data-testid":"tools-tab-vcs",className:"px-2.5 text-xs",children:"Version Control"}),(0,t.jsx)(a.TabsTrigger,{value:"terminal","data-testid":"tools-tab-terminal",className:"px-2.5 text-xs",children:"Terminals"})]}),(0,t.jsx)(a.TabsContent,{value:c,className:"mt-3",children:0===m.length?(0,t.jsxs)("div",{"data-testid":"tools-page-empty",className:"text-muted-foreground flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(r.Wrench,{className:"mb-2 h-6 w-6 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"No tools in this category."})]}):(0,t.jsx)("div",{"data-testid":"tools-page-grid",className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.map(e=>(0,t.jsx)(S,{tool:e,onRefresh:u},e.id))})})]})]})}e.s(["ToolsPageClient",()=>A],44412)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},81846,e=>{"use strict";var t=e.i(20314),r=e.i(94237),s=e.i(31777);let i=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l({className:e,variant:r,...l}){return(0,t.jsx)("div",{className:(0,s.cn)(i({variant:r}),e),...l})}e.s(["Badge",()=>l])},1650,e=>{"use strict";e.i(11495),e.s([])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},8986,48403,1654,21092,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986);var r=e.i(21023);let s=(0,r.createServerReference)("400f0829198b5afea02a7b9a40a564714d345b233d",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>s],48403);let i=(0,r.createServerReference)("40ad1c4a89f52d8f18e2093b39f17f3e7795de1240",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>i],1654);let l=(0,r.createServerReference)("4051ca4f27ce41484876e591a89de2a8c4589fcb80",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>l],21092)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),s=e.i(87342),i=e.i(5978),l=e.i(22528),n=e.i(13123),o=e.i(87620),a=e.i(29297),u=e.i(36589),c=e.i(66033),f=e.i(20314),d="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[v,y,m]=(0,s.createCollection)(p),[x,g]=(0,l.createContextScope)(p,[m]),[b,k]=x(p),R=t.forwardRef((e,t)=>(0,f.jsx)(v.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(v.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(w,{...e,ref:t})})}));R.displayName=p;var w=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:l,orientation:n,loop:v=!1,dir:m,currentTabStopId:x,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:k,onEntryFocus:R,preventScrollOnEntryFocus:w=!1,...S}=e,A=t.useRef(null),M=(0,i.useComposedRefs)(s,A),I=(0,c.useDirection)(m),[F,T]=(0,u.useControllableState)({prop:x,defaultProp:g??null,onChange:k,caller:p}),[j,z]=t.useState(!1),E=(0,a.useCallbackRef)(R),P=y(l),L=t.useRef(!1),[D,O]=t.useState(0);return t.useEffect(()=>{let e=A.current;if(e)return e.addEventListener(d,E),()=>e.removeEventListener(d,E)},[E]),(0,f.jsx)(b,{scope:l,orientation:n,dir:I,loop:v,currentTabStopId:F,onItemFocus:t.useCallback(e=>T(e),[T]),onItemShiftTab:t.useCallback(()=>z(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,f.jsx)(o.Primitive.div,{tabIndex:j||0===D?-1:0,"data-orientation":n,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(d,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>z(!1))})})}),S="RovingFocusGroupItem",A=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:l=!0,active:a=!1,tabStopId:u,children:c,...d}=e,h=(0,n.useId)(),p=u||h,m=k(S,i),x=m.currentTabStopId===p,g=y(i),{onFocusableItemAdd:b,onFocusableItemRemove:R,currentTabStopId:w}=m;return t.useEffect(()=>{if(l)return b(),()=>R()},[l,b,R]),(0,f.jsx)(v.ItemSlot,{scope:i,id:p,focusable:l,active:a,children:(0,f.jsx)(o.Primitive.span,{tabIndex:x?0:-1,"data-orientation":m.orientation,...d,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{l?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return M[i]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let l=i.indexOf(e.currentTarget);i=m.loop?(r=i,s=l+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(l+1)}setTimeout(()=>C(i))}}),children:"function"==typeof c?c({isCurrentTabStop:x,hasTabStop:null!=w}):c})})});A.displayName=S;var M={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>A,"Root",()=>R,"createRovingFocusGroupScope",()=>g])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),i=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label",e.s(["Label",()=>i,"Root",()=>i],27572);var l=e.i(27572),l=l,n=e.i(94237),o=e.i(31777);let a=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,o.cn)(a(),e),...r}));u.displayName=l.Root.displayName,e.s(["Label",()=>u],41957)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),i=e.i(86874),l=e.i(20314);function n(e){let n=e+"CollectionProvider",[o,a]=(0,r.createContextScope)(n),[u,c]=o(n,{collectionRef:{current:null},itemMap:new Map}),f=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(u,{scope:r,itemMap:n,collectionRef:i,children:s})};f.displayName=n;let d=e+"CollectionSlot",h=(0,i.createSlot)(d),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,n=c(d,r),o=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(h,{ref:o,children:i})});p.displayName=d;let v=e+"CollectionItemSlot",y="data-radix-collection-item",m=(0,i.createSlot)(v),x=t.default.forwardRef((e,r)=>{let{scope:i,children:n,...o}=e,a=t.default.useRef(null),u=(0,s.useComposedRefs)(r,a),f=c(v,i);return t.default.useEffect(()=>(f.itemMap.set(a,{ref:a,...o}),()=>void f.itemMap.delete(a))),(0,l.jsx)(m,{...{[y]:""},ref:u,children:n})});return x.displayName=v,[{Provider:f,Slot:p,ItemSlot:x},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${y}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},a]}var o=new WeakMap;function a(e,t){var r,s;let i,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(n=(l=u(s))>=0?l:i+l)<0||n>=i?-1:n);return -1===o?void 0:e[o]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],o.set(this,!0)}set(e,t){return o.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),l=this.#e.length,n=u(e),o=n>=0?n:l+n,a=o<0||o>=l?-1:o;if(a===this.size||i&&a===this.size-1||-1===a)return this.set(t,r),this;let c=this.size+ +!i;n<0&&o++;let f=[...this.#e],d=!1;for(let e=o;e<c;e++)if(o===e){let l=f[e];f[e]===t&&(l=f[e+1]),i&&this.delete(t),s=this.get(l),this.set(t,r)}else{d||f[e-1]!==t||(d=!0);let r=f[d?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=a(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=a(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return a(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function s({icon:e,title:s,description:i,action:l,className:n,...o}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...o,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),i?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:i}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}e.s(["EmptyState",()=>s],7729),e.s([],54793)},81088,73377,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00b6935c21f6212ccf47c3444f3bc609fbfcf5dc5a",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],81088);let s=(0,t.createServerReference)("60cc3c83bca545e2369fceb6e725d3588e5c106e64",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],73377)},74309,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("40aafe8ebeed6e5b7c69470aec82793ee3b630cc9b",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},76852,e=>{"use strict";var t=e.i(79054),r=e.i(48403),s=e.i(1654),i=e.i(21092);function l(e){let[l,n]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),[u,c]=(0,t.useState)(!1),[f,d]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[v,y]=(0,t.useState)(null),m=(0,t.useRef)(null),x=(0,t.useRef)(null),g=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current)},[]);let b=(0,t.useCallback)(async(t,r,s,i,l)=>{if(e&&!l){i.current&&clearTimeout(i.current),r(!0),s(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";s(t),i.current=setTimeout(()=>s(null),5e3)}}catch(e){s(e instanceof Error?e.message:"An unexpected error occurred"),i.current=setTimeout(()=>s(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>b(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),n,d,m,l),[b,l,e]),openInShell:(0,t.useCallback)(()=>b(()=>(0,s.openShell)({repositoryPath:e.repositoryPath}),a,p,x,o),[b,o,e]),openFolder:(0,t.useCallback)(()=>b(()=>(0,i.openFolder)(e.repositoryPath),c,y,g,u),[b,u,e]),ideLoading:l,shellLoading:o,folderLoading:u,ideError:f,shellError:h,folderError:v}}e.s(["useRepositoryActions",()=>l])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(87889),a=e.i(3645);let i=(0,a.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(23925);let l=(0,a.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var s=e.i(38573),d=e.i(49228);let c=(0,a.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,a.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),p=(0,a.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),h=(0,a.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var m=e.i(10714),m=m,f=e.i(3214),g=e.i(30702);let x=(0,a.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var v=e.i(58860),w=e.i(60112),b=e.i(31777),y=e.i(41957),j=e.i(98127),S=e.i(35364),C=e.i(51911),k=e.i(2828),M=e.i(26036),I=e.i(27069),N=e.i(91967),P=e.i(87342),E=e.i(5978),R=e.i(22528),T=e.i(66033),A=e.i(53532),D=e.i(41687),L=e.i(56720),F=e.i(13123),H=e.i(52740),z=e.i(39979),B=e.i(87620),_=e.i(86874),V=e.i(29297),W=e.i(36589),O=e.i(5192),U=e.i(23405),K=e.i(1693),q=e.i(73772),G=e.i(13044),$=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[X,Q,J]=(0,P.createCollection)(Z),[ee,et]=(0,R.createContextScope)(Z,[J,H.createPopperScope]),en=(0,H.createPopperScope)(),[er,ea]=ee(Z),[ei,eo]=ee(Z),el=e=>{let{__scopeSelect:r,children:a,open:i,defaultOpen:o,onOpenChange:l,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=en(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,S]=n.useState(!1),C=(0,T.useDirection)(u),[k,M]=(0,W.useControllableState)({prop:i,defaultProp:o??!1,onChange:l,caller:Z}),[I,N]=(0,W.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),E=!v||g||!!v.closest("form"),[R,A]=n.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return(0,t.jsx)(H.Root,{...x,children:(0,t.jsxs)(er,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:(0,F.useId)(),value:I,onValueChange:N,open:k,onOpenChange:M,dir:C,triggerPointerDownPosRef:P,disabled:m,children:[(0,t.jsx)(X.Provider,{scope:r,children:(0,t.jsx)(ei,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),E?(0,t.jsxs)(e$,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>N(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(R)]},D):null]})})};el.displayName=Z;var es="SelectTrigger",ed=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:i=!1,...o}=e,l=en(a),s=ea(es,a),d=s.disabled||i,c=(0,E.useComposedRefs)(r,s.onTriggerChange),u=Q(a),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eX(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(H.Anchor,{asChild:!0,...l,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...o,ref:c,onClick:(0,N.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,N.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&$.includes(e.key)&&(g(),e.preventDefault())})})})});ed.displayName=es;var ec="SelectValue",eu=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:i,children:o,placeholder:l="",...s}=e,d=ea(ec,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==o,p=(0,E.useComposedRefs)(n,d.onValueNodeChange);return(0,O.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:l}):o})});eu.displayName=ec;var ep=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...i}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})});ep.displayName="SelectIcon";var eh=e=>(0,t.jsx)(z.Portal,{asChild:!0,...e});eh.displayName="SelectPortal";var em="SelectContent",ef=n.forwardRef((e,r)=>{let a=ea(em,e.__scopeSelect),[i,o]=n.useState();return((0,O.useLayoutEffect)(()=>{o(new DocumentFragment)},[]),a.open)?(0,t.jsx)(ew,{...e,ref:r}):i?M.createPortal((0,t.jsx)(eg,{scope:e.__scopeSelect,children:(0,t.jsx)(X.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),i):null});ef.displayName=em;var[eg,ex]=ee(em),ev=(0,_.createSlot)("SelectContent.RemoveScroll"),ew=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(em,a),[y,j]=n.useState(null),[S,C]=n.useState(null),k=(0,E.useComposedRefs)(r,e=>j(e)),[M,I]=n.useState(null),[P,R]=n.useState(null),T=Q(a),[F,H]=n.useState(!1),z=n.useRef(!1);n.useEffect(()=>{if(y)return(0,q.hideOthers)(y)},[y]),(0,D.useFocusGuards)();let B=n.useCallback(e=>{let[t,...n]=T().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==a))return},[T,S]),_=n.useCallback(()=>B([M,y]),[B,M,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:V,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||V(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,V,W]),n.useEffect(()=>{let e=()=>V(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[V]);let[O,U]=eZ(e=>{let t=T().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eX(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),K=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&(I(e),r&&(z.current=!0))},[b.value]),$=n.useCallback(()=>y?.focus(),[y]),Y=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&R(e)},[b.value]),Z="popper"===i?ey:eb,X=Z===ey?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eg,{scope:a,content:y,viewport:S,onViewportChange:C,itemRefCallback:K,selectedItem:M,onItemLeave:$,itemTextRefCallback:Y,focusSelectedItem:_,selectedItemText:P,position:i,isPositioned:F,searchRef:O,children:(0,t.jsx)(G.RemoveScroll,{as:ev,allowPinchZoom:!0,children:(0,t.jsx)(L.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,N.composeEventHandlers)(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Z,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...X,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,N.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});ew.displayName="SelectContentImpl";var eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:i,...o}=e,l=ea(em,a),s=ex(em,a),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,E.useComposedRefs)(r,e=>p(e)),m=Q(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&u&&x&&v&&w){let e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==l.dir){let a=r.left-t.left,i=n.left-a,o=e.left-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,I.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.left=u+"px"}else{let a=t.right-r.right,i=window.innerWidth-n.right-a,o=window.innerWidth-e.right-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,I.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.right=u+"px"}let a=m(),o=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),S=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),k=e.top+e.height/2-10,M=v.offsetHeight/2,N=p+h+(v.offsetTop+M);if(N<=k){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(o-k,M+(e?C:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;d.style.top="0px";let t=Math.max(k,p+x.offsetTop+(e?S:0)+M);d.style.height=t+(b-N)+"px",x.scrollTop=N-k+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=o+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[m,l.trigger,l.valueNode,d,u,x,v,w,l.dir,i]);(0,O.useLayoutEffect)(()=>y(),[y]);let[j,S]=n.useState();(0,O.useLayoutEffect)(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ej,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});eb.displayName="SelectItemAlignedPosition";var ey=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:i=10,...o}=e,l=en(r);return(0,t.jsx)(H.Content,{...l,...o,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ey.displayName="SelectPopperPosition";var[ej,eS]=ee(em,{}),eC="SelectViewport",ek=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:i,...o}=e,l=ex(eC,a),s=eS(eC,a),d=(0,E.useComposedRefs)(r,l.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),(0,t.jsx)(X.Slot,{scope:a,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,N.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let i=a+e,o=Math.min(r,i),l=i-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eM="SelectGroup",[eI,eN]=ee(eM),eP=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=(0,F.useId)();return(0,t.jsx)(eI,{scope:r,id:i,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":i,...a,ref:n})})});eP.displayName=eM;var eE="SelectLabel",eR=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=eN(eE,r);return(0,t.jsx)(B.Primitive.div,{id:i.id,...a,ref:n})});eR.displayName=eE;var eT="SelectItem",[eA,eD]=ee(eT),eL=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:i,disabled:o=!1,textValue:l,...s}=e,d=ea(eT,a),c=ex(eT,a),u=d.value===i,[p,h]=n.useState(l??""),[m,f]=n.useState(!1),g=(0,E.useComposedRefs)(r,e=>c.itemRefCallback?.(e,i,o)),x=(0,F.useId)(),v=n.useRef("touch"),w=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};if(""===i)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:a,value:i,disabled:o,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(X.ItemSlot,{scope:a,value:i,disabled:o,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:(0,N.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,N.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,N.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,N.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,N.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,N.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,o?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,N.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,N.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eL.displayName=eT;var eF="SelectItemText",eH=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:i,style:o,...l}=e,s=ea(eF,a),d=ex(eF,a),c=eD(eF,a),u=eo(eF,a),[p,h]=n.useState(null),m=(0,E.useComposedRefs)(r,e=>h(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,O.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...l,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?M.createPortal(l.children,s.valueNode):null]})});eH.displayName=eF;var ez="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eD(ez,r).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eB.displayName=ez;var e_="SelectScrollUpButton",eV=n.forwardRef((e,r)=>{let a=ex(e_,e.__scopeSelect),i=eS(e_,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){l(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eV.displayName=e_;var eW="SelectScrollDownButton",eO=n.forwardRef((e,r)=>{let a=ex(eW,e.__scopeSelect),i=eS(eW,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eO.displayName=eW;var eU=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:i,...o}=e,l=ex("SelectScrollButton",a),s=n.useRef(null),d=Q(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,O.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(i,50))}),onPointerMove:(0,N.composeEventHandlers)(o.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(i,50))}),onPointerLeave:(0,N.composeEventHandlers)(o.onPointerLeave,()=>{c()})})}),eK=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...a,ref:n})});eK.displayName="SelectSeparator";var eq="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=en(r),o=ea(eq,r),l=ex(eq,r);return o.open&&"popper"===l.position?(0,t.jsx)(H.Arrow,{...i,...a,ref:n}):null});eG.displayName=eq;var e$=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(i,o),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.select,{...a,style:{...K.VISUALLY_HIDDEN_STYLES,...a.style},ref:l,defaultValue:r})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,V.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),i=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),o=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,o]}function eX(e,t,n){var r,a;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,l=(r=e,a=Math.max(o,0),r.map((e,t)=>r[(a+t)%r.length]));1===i.length&&(l=l.filter(e=>e!==n));let s=l.find(e=>e.textValue.toLowerCase().startsWith(i.toLowerCase()));return s!==n?s:void 0}e$.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>ef,"Group",()=>eP,"Icon",()=>ep,"Item",()=>eL,"ItemIndicator",()=>eB,"ItemText",()=>eH,"Label",()=>eR,"Portal",()=>eh,"Root",()=>el,"ScrollDownButton",()=>eO,"ScrollUpButton",()=>eV,"Select",()=>el,"SelectArrow",()=>eG,"SelectContent",()=>ef,"SelectGroup",()=>eP,"SelectIcon",()=>ep,"SelectItem",()=>eL,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eH,"SelectLabel",()=>eR,"SelectPortal",()=>eh,"SelectScrollDownButton",()=>eO,"SelectScrollUpButton",()=>eV,"SelectSeparator",()=>eK,"SelectTrigger",()=>ed,"SelectValue",()=>eu,"SelectViewport",()=>ek,"Separator",()=>eK,"Trigger",()=>ed,"Value",()=>eu,"Viewport",()=>ek,"createSelectScope",()=>et],83830);var eQ=e.i(83830),eQ=eQ,eJ=e.i(99105);let e0=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e1=eQ.Root;eQ.Group;let e2=eQ.Value,e5=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Trigger,{ref:a,className:(0,b.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,(0,t.jsx)(eQ.Icon,{asChild:!0,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e5.displayName=eQ.Trigger.displayName;let e3=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollUpButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e0,{className:"h-4 w-4"})}));e3.displayName=eQ.ScrollUpButton.displayName;let e4=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollDownButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4"})}));e4.displayName=eQ.ScrollDownButton.displayName;let e8=n.forwardRef(({className:e,children:n,position:r="popper",...a},i)=>(0,t.jsx)(eQ.Portal,{children:(0,t.jsxs)(eQ.Content,{ref:i,className:(0,b.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[(0,t.jsx)(e3,{}),(0,t.jsx)(eQ.Viewport,{className:(0,b.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e4,{})]})}));e8.displayName=eQ.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Label,{ref:r,className:(0,b.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eQ.Label.displayName;let e6=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Item,{ref:a,className:(0,b.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eQ.ItemIndicator,{children:(0,t.jsx)(o.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eQ.ItemText,{children:n})]}));e6.displayName=eQ.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Separator,{ref:r,className:(0,b.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eQ.Separator.displayName;var e9=e.i(21023);let e7=(0,e9.createServerReference)("40c5fa6afb192a80d6b9a2be0ccc23d202506d6cb9",e9.callServer,void 0,e9.findSourceMapURL,"updateSettingsAction");var te=e.i(17406),tt=e.i(98804),tn=e.i(44229),tr=e.i(83902);function ta(e){return(0,t.jsx)(tn.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function ti({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function to({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function ts({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function td({className:e,...n}){return(0,t.jsx)(tr.Rocket,{className:(0,b.cn)("h-4 w-4",e),...n})}ti.displayName="VsCodeIcon",to.displayName="CursorEditorIcon",tl.displayName="WindsurfIcon",ts.displayName="ZedIcon",td.displayName="AntigravityIcon";let tc={vscode:ti,cursor:to,windsurf:tl,zed:ts,antigravity:td};var tu=e.i(41413),tp=e.i(77624),th=["PageUp","PageDown"],tm=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tg="Slider",[tx,tv,tw]=(0,P.createCollection)(tg),[tb,ty]=(0,R.createContextScope)(tg,[tw]),[tj,tS]=tb(tg),tC=n.forwardRef((e,r)=>{let{name:a,min:i=0,max:o=100,step:l=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[i],value:p,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],j]=(0,W.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),h(e)}}),S=n.useRef(y);function C(e,t,{commit:n}={commit:!1}){let r,a=(String(l).split(".")[1]||"").length,s=Math.round((Math.round((e-i)/l)*l+i)*(r=Math.pow(10,a)))/r,d=(0,I.clamp)(s,[i,o]);j((e=[])=>{let r=function(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,n)=>e[n+1]-t))>=t;return!0}(r,c*l))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}})}return(0,t.jsx)(tj,{scope:e.__scopeSlider,name:a,disabled:d,min:i,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tx.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tI:tN,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,N.composeEventHandlers)(x.onPointerDown,()=>{d||(S.current=y)}),min:i,max:o,inverted:f,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}(y,e);C(e,t)},onSlideMove:d?void 0:function(e){C(e,w.current)},onSlideEnd:d?void 0:function(){let e=S.current[w.current];y[w.current]!==e&&m(y)},onHomeKeyDown:()=>!d&&C(i,0,{commit:!0}),onEndKeyDown:()=>!d&&C(o,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=th.includes(e.key)||e.shiftKey&&tm.includes(e.key),r=w.current;C(y[r]+l*(n?10:1)*t,r,{commit:!0})}}})})})})});tC.displayName=tg;var[tk,tM]=tb(tg,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tI=n.forwardRef((e,r)=>{let{min:a,max:i,dir:o,inverted:l,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[h,m]=n.useState(null),f=(0,E.useComposedRefs)(r,e=>m(e)),g=n.useRef(void 0),x=(0,T.useDirection)(o),v="ltr"===x,w=v&&!l||!v&&l;function b(e){let t=g.current||h.getBoundingClientRect(),n=tB([0,t.width],w?[a,i]:[i,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tP,{dir:x,"data-orientation":"horizontal",...p,ref:f,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);d?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=tf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tN=n.forwardRef((e,r)=>{let{min:a,max:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),h=(0,E.useComposedRefs)(r,p),m=n.useRef(void 0),f=!o;function g(e){let t=m.current||p.current.getBoundingClientRect(),n=tB([0,t.height],f?[i,a]:[a,i]);return m.current=t,n(e-t.top)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tP,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);l?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,d?.()},onStepKeyDown:e=>{let t=tf[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tP=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tS(tg,r);return(0,t.jsx)(B.Primitive.span,{...c,ref:n,onKeyDown:(0,N.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):th.concat(tm).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,N.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,N.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:(0,N.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})}),tE="SliderTrack",tR=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,i=tS(tE,r);return(0,t.jsx)(B.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:n})});tR.displayName=tE;var tT="SliderRange",tA=n.forwardRef((e,r)=>{let{__scopeSlider:a,...i}=e,o=tS(tT,a),l=tM(tT,a),s=n.useRef(null),d=(0,E.useComposedRefs)(r,s),c=o.values.length,u=o.values.map(e=>tz(e,o.min,o.max)),p=c>1?Math.min(...u):0,h=100-Math.max(...u);return(0,t.jsx)(B.Primitive.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...i,ref:d,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:h+"%"}})});tA.displayName=tT;var tD="SliderThumb",tL=n.forwardRef((e,r)=>{let a=tv(e.__scopeSlider),[i,o]=n.useState(null),l=(0,E.useComposedRefs)(r,e=>o(e)),s=n.useMemo(()=>i?a().findIndex(e=>e.ref.current===i):-1,[a,i]);return(0,t.jsx)(tF,{...e,ref:l,index:s})}),tF=n.forwardRef((e,r)=>{var a,i,o,l,s;let d,c,{__scopeSlider:u,index:p,name:h,...m}=e,f=tS(tD,u),g=tM(tD,u),[x,v]=n.useState(null),w=(0,E.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,tp.useSize)(x),j=f.values[p],S=void 0===j?0:tz(j,f.min,f.max),C=(a=p,(i=f.values.length)>2?`Value ${a+1} of ${i}`:2===i?["Minimum","Maximum"][a]:void 0),k=y?.[g.size],M=k?(o=k,l=S,s=g.direction,c=tB([0,50],[0,d=o/2]),(d-c(l)*s)*s):0;return n.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${S}% + ${M}px)`},children:[(0,t.jsx)(tx.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(B.Primitive.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":f.min,"aria-valuenow":j,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...m,ref:w,style:void 0===j?{display:"none"}:e.style,onFocus:(0,N.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tH,{name:h??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:j},p)]})});tL.displayName=tD;var tH=n.forwardRef(({__scopeSlider:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(o,i),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.input,{style:{display:"none"},...a,ref:l,defaultValue:r})});function tz(e,t,n){return(0,I.clamp)(100/(n-t)*(e-t),[0,100])}function tB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}tH.displayName="RadioBubbleInput",e.s(["Range",()=>tA,"Root",()=>tC,"Slider",()=>tC,"SliderRange",()=>tA,"SliderThumb",()=>tL,"SliderTrack",()=>tR,"Thumb",()=>tL,"Track",()=>tR,"createSliderScope",()=>ty],29991);var t_=e.i(29991),t_=t_;function tV({className:e,defaultValue:r,value:a,min:i=0,max:o=100,...l}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[i,o],[a,r,i,o]);return(0,t.jsxs)(t_.Root,{"data-slot":"slider",defaultValue:r,value:a,min:i,max:o,className:(0,b.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,t.jsx)(t_.Track,{"data-slot":"slider-track",className:(0,b.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(t_.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(t_.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]})}let tW=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tO=tW.length-1;function tU(e){let t=0,n=Math.abs(e-tW[0]);for(let r=1;r<tW.length;r++){let a=Math.abs(e-tW[r]);a<n&&(n=a,t=r)}return t}function tK({id:e,testId:r,value:a,onChange:i,onBlur:o,defaultSeconds:l=1800}){var s;let d,c,u=(""===a?l:parseInt(a,10))||l,[p,h]=(0,n.useState)(()=>tU(u)),m=tU(u);m!==p&&tW[p]!==u&&h(m);let f=(0,n.useCallback)(([e])=>{h(e),i(String(tW[e]))},[i]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tV,{id:e,"data-testid":r,min:0,max:tO,step:1,value:[p],onValueChange:f,onValueCommit:()=>o(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-right text-xs tabular-nums",children:(d=Math.floor((s=tW[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tq=[{value:te.AgentAuthMethod.Session,label:"Session"},{value:te.AgentAuthMethod.Token,label:"Token"}],tG=[{value:te.EditorType.VsCode,label:"VS Code"},{value:te.EditorType.Cursor,label:"Cursor"},{value:te.EditorType.Windsurf,label:"Windsurf"},{value:te.EditorType.Zed,label:"Zed"},{value:te.EditorType.Antigravity,label:"Antigravity"}],t$=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tY=[{id:"agent",label:"Agent",icon:l},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"stage-timeouts",label:"Timeouts",icon:v.Timer},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tZ({label:e,description:n,htmlFor:r,children:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{htmlFor:r,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function tX({label:e,description:n,id:r,testId:a,checked:i,onChange:o,disabled:l}){return(0,t.jsx)(tZ,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(C.Switch,{id:r,"data-testid":a,checked:i,onCheckedChange:o,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function tQ({icon:e,title:n,description:r,badge:a,testId:i,children:o}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":i,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),a?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:a}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:r})]}),(0,t.jsx)("div",{className:"px-4",children:o})]})}function tJ({id:e,testId:n,value:r,onChange:a,onBlur:i,placeholder:o,min:l=1,max:s,step:d=1,suffix:c}){let u=""===r?void 0:parseInt(r,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(String(Math.max(l,(u??parseInt(o,10))-d)))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:r,placeholder:o,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:i,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(o,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t0({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function t1({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function t2({settings:e,shepHome:a,dbFileSize:m,availableTerminals:f}){let{showSaving:g,showSaved:y,save:C}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(!1),l=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,l.current=setTimeout(()=>{l.current=null,s.current&&(a(!1),o(!0),setTimeout(()=>o(!1),2e3))},350)),!e&&r&&(s.current=!0,l.current||(a(!1),o(!0),setTimeout(()=>o(!1),2e3)))},[e,r]),{showSaving:r,showSaved:i,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e7(e);t.success||w.toast.error(t.error??"Failed to save settings")})},[t])}}(),M=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[I,N]=(0,n.useState)(e.agent.type),P=e.agent.authMethod,[E,R]=(0,n.useState)(e.agent.token??""),[T,A]=(0,n.useState)(!1),[D,L]=(0,n.useState)(e.environment.defaultEditor),[F,H]=(0,n.useState)(e.environment.shellPreference),[z,B]=(0,n.useState)(e.environment.terminalPreference??te.TerminalType.System),_=f?f.filter(e=>e.available):[{id:te.TerminalType.System,name:"System Terminal",available:!0}],[V,W]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[O,U]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[K,q]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[G,$]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[Y,Z]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[X,Q]=(0,n.useState)(e.workflow.enableEvidence),[J,ee]=(0,n.useState)(e.workflow.commitEvidence),[et,en]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[er,ea]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[ei,eo]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[el,es]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[ed,ec]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),eu=e.workflow.stageTimeouts,[ep,eh]=(0,n.useState)(String(Math.round((eu?.analyzeMs??18e5)/1e3))),[em,ef]=(0,n.useState)(String(Math.round((eu?.requirementsMs??18e5)/1e3))),[eg,ex]=(0,n.useState)(String(Math.round((eu?.researchMs??18e5)/1e3))),[ev,ew]=(0,n.useState)(String(Math.round((eu?.planMs??18e5)/1e3))),[eb,ey]=(0,n.useState)(String(Math.round((eu?.implementMs??18e5)/1e3))),[ej,eS]=(0,n.useState)(String(Math.round((eu?.mergeMs??18e5)/1e3))),eC=e.workflow.analyzeRepoTimeouts,[ek,eM]=(0,n.useState)(String(Math.round((eC?.analyzeMs??6e5)/1e3))),[eI,eN]=(0,n.useState)(e.notifications.inApp.enabled),[eP,eE]=(0,n.useState)(e.notifications.browser.enabled),[eR,eT]=(0,n.useState)(e.notifications.desktop.enabled),[eA,eD]=(0,n.useState)({...e.notifications.events}),[eL,eF]=(0,n.useState)({...M}),eH=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ez=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eB=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",e_=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eV=eu?.analyzeMs!=null?String(Math.round(eu.analyzeMs/1e3)):"",eW=eu?.requirementsMs!=null?String(Math.round(eu.requirementsMs/1e3)):"",eO=eu?.researchMs!=null?String(Math.round(eu.researchMs/1e3)):"",eU=eu?.planMs!=null?String(Math.round(eu.planMs/1e3)):"",eK=eu?.implementMs!=null?String(Math.round(eu.implementMs/1e3)):"",eq=eu?.mergeMs!=null?String(Math.round(eu.mergeMs/1e3)):"",eG=eC?.analyzeMs!=null?String(Math.round(eC.analyzeMs/1e3)):"";function e$(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eY(e){if(void 0===e)return;let t=e$(e);return null!=t?1e3*t:void 0}function eZ(e={}){let t=e$(e.ciTimeout??ei);return{workflow:{openPrOnImplementationComplete:e.openPr??V,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??O,allowPrd:e.allowPrd??K,allowPlan:e.allowPlan??G,allowMerge:e.allowMerge??Y},enableEvidence:e.enableEvidence??X,commitEvidence:e.commitEvidence??J,ciWatchEnabled:e.ciWatchEnabled??et,ciMaxFixAttempts:e$(e.ciMaxFix??er),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:e$(e.ciLogMax??el),ciWatchPollIntervalSeconds:e$(e.ciPollInterval??ed),stageTimeouts:{analyzeMs:eY(e.analyzeTimeout??ep),requirementsMs:eY(e.requirementsTimeout??em),researchMs:eY(e.researchTimeout??eg),planMs:eY(e.planTimeout??ev),implementMs:eY(e.implementTimeout??eb),mergeMs:eY(e.mergeTimeout??ej)},analyzeRepoTimeouts:{analyzeMs:eY(e.analyzeRepoTimeout??ek)}}}}function eX(e={}){return{notifications:{inApp:{enabled:e.inApp??eI},browser:{enabled:e.browser??eP},desktop:{enabled:e.desktop??eR},events:e.events??eA}}}let[eQ,eJ]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tY.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&eJ(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e0=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,b.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",g?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",y&&!g?"opacity-100":"opacity-0"),children:[(0,t.jsx)(o.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tY.map(e=>{let n=e.icon,r=eQ===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e0(e.id),className:(0,b.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",r?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:l,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tZ,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:I,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tZ,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e1,{value:P,disabled:!0,children:[(0,t.jsx)(e5,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tq.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),P===te.AgentAuthMethod.Token&&(0,t.jsx)(tZ,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(j.Input,{id:"agent-token","data-testid":"agent-token-input",type:T?"text":"password",value:E,onChange:e=>R(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&C(function(e={}){let t={type:I,authMethod:P,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===te.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>A(!T),"data-testid":"toggle-token-visibility","aria-label":T?"Hide token":"Show token",children:T?(0,t.jsx)(i,{className:"h-3 w-3"}):(0,t.jsx)(r.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(t1,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:s.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tZ,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e1,{value:D,onValueChange:e=>{L(e),C({environment:{defaultEditor:e,shellPreference:F,terminalPreference:z}})},children:[(0,t.jsx)(e5,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tG.map(e=>{var n;let r=(n=e.value)&&n in tc?tc[n]:ta;return(0,t.jsx)(e6,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(tZ,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(e1,{value:F,onValueChange:e=>{H(e),C({environment:{defaultEditor:D,shellPreference:e,terminalPreference:z}})},children:[(0,t.jsx)(e5,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:t$.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tZ,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(e1,{value:z,onValueChange:e=>{B(e),C({environment:{defaultEditor:D,shellPreference:F,terminalPreference:e}})},children:[(0,t.jsx)(e5,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:_.map(e=>(0,t.jsx)(e6,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(t1,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor opens files for review. The shell setting controls generated scripts. The terminal emulator is launched when opening shell sessions from the web UI."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t0,{children:"Approve"}),(0,t.jsx)(tX,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:K,onChange:e=>{q(e),C(eZ({allowPrd:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:G,onChange:e=>{$(e),C(eZ({allowPlan:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:Y,onChange:e=>{Z(e),C(eZ({allowMerge:e}))}}),(0,t.jsx)(t0,{children:"Evidence"}),(0,t.jsx)(tX,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:X,onChange:e=>{Q(e),e?C(eZ({enableEvidence:e})):(ee(!1),C(eZ({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:J,disabled:!X||!V,onChange:e=>{ee(e),C(eZ({commitEvidence:e}))}}),(0,t.jsx)(t0,{children:"Git"}),(0,t.jsx)(tX,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:O,onChange:e=>{U(e),C(eZ({pushOnComplete:e}))}}),(0,t.jsx)(tX,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:V,onChange:e=>{W(e),e?C(eZ({openPr:e})):(ee(!1),C(eZ({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Watch CI after push",description:"Monitor CI and auto-fix failures. Disable to avoid rate limits.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:et,onChange:e=>{en(e),C(eZ({ciWatchEnabled:e}))}})]}),(0,t.jsx)(t1,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tZ,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tJ,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:er,onChange:ea,onBlur:()=>{er!==eH&&C(eZ({ciMaxFix:er}))},min:1,max:10})}),(0,t.jsx)(tZ,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tJ,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:ei,onChange:eo,onBlur:()=>{ei!==ez&&C(eZ({ciTimeout:ei}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tZ,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tJ,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:el,onChange:es,onBlur:()=>{el!==eB&&C(eZ({ciLogMax:el}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tZ,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tJ,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:ed,onChange:ec,onBlur:()=>{ed!==e_&&C(eZ({ciPollInterval:ed}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(t1,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:v.Timer,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t0,{children:"Feature Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(tK,{id:"timeout-analyze",testId:"timeout-analyze-input",value:ep,onChange:eh,onBlur:()=>{ep!==eV&&C(eZ({analyzeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(tK,{id:"timeout-requirements",testId:"timeout-requirements-input",value:em,onChange:ef,onBlur:()=>{em!==eW&&C(eZ({requirementsTimeout:em}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(tK,{id:"timeout-research",testId:"timeout-research-input",value:eg,onChange:ex,onBlur:()=>{eg!==eO&&C(eZ({researchTimeout:eg}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(tK,{id:"timeout-plan",testId:"timeout-plan-input",value:ev,onChange:ew,onBlur:()=>{ev!==eU&&C(eZ({planTimeout:ev}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(tK,{id:"timeout-implement",testId:"timeout-implement-input",value:eb,onChange:ey,onBlur:()=>{eb!==eK&&C(eZ({implementTimeout:eb}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(tK,{id:"timeout-merge",testId:"timeout-merge-input",value:ej,onChange:eS,onBlur:()=>{ej!==eq&&C(eZ({mergeTimeout:ej}))},defaultSeconds:1800})}),(0,t.jsx)(t0,{children:"Analyze Repository Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(tK,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ek,onChange:eM,onBlur:()=>{ek!==eG&&C(eZ({analyzeRepoTimeout:ek}))},defaultSeconds:600})})]}),(0,t.jsx)(t1,{children:"Each agent has independently configurable stage timeouts. When a stage exceeds its timeout, the agent is terminated. Longer timeouts are useful for complex implementations. Feature agent defaults to 30 minutes per stage. Analyze repository agent defaults to 10 minutes."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t0,{children:"Channels"}),(0,t.jsx)(tX,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:eI,onChange:e=>{eN(e),C(eX({inApp:e}))}}),(0,t.jsx)(tX,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:eP,onChange:e=>{eE(e),C(eX({browser:e}))}}),(0,t.jsx)(tX,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:eR,onChange:e=>{eT(e),C(eX({desktop:e}))}}),(0,t.jsx)(t0,{children:"Agent Events"}),(0,t.jsx)(tX,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:eA.agentStarted,onChange:e=>{let t={...eA,agentStarted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:eA.phaseCompleted,onChange:e=>{let t={...eA,phaseCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:eA.waitingApproval,onChange:e=>{let t={...eA,waitingApproval:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:eA.agentCompleted,onChange:e=>{let t={...eA,agentCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:eA.agentFailed,onChange:e=>{let t={...eA,agentFailed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(t0,{children:"Pull Request Events"}),(0,t.jsx)(tX,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:eA.prMerged,onChange:e=>{let t={...eA,prMerged:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:eA.prClosed,onChange:e=>{let t={...eA,prClosed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:eA.prChecksPassed,onChange:e=>{let t={...eA,prChecksPassed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:eA.prChecksFailed,onChange:e=>{let t={...eA,prChecksFailed:e};eD(t),C(eX({events:t}))}})]}),(0,t.jsx)(t1,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tX,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:eL.skills,onChange:e=>{let t={...eL,skills:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:eL.envDeploy,onChange:e=>{let t={...eL,envDeploy:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:eL.debug,onChange:e=>{let t={...eL,debug:e};eF(t),C({featureFlags:t})}})]}),(0,t.jsx)(t1,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tZ,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:a})}),(0,t.jsx)(tZ,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(t1,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>t2],41952)}]);
|