@shepai/cli 1.194.2 → 1.194.3

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.
Files changed (306) hide show
  1. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
  2. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +27 -0
  3. package/dist/tsconfig.build.tsbuildinfo +1 -1
  4. package/package.json +1 -1
  5. package/web/.next/BUILD_ID +1 -1
  6. package/web/.next/build-manifest.json +2 -2
  7. package/web/.next/fallback-build-manifest.json +2 -2
  8. package/web/.next/prerender-manifest.json +3 -3
  9. package/web/.next/required-server-files.js +2 -2
  10. package/web/.next/required-server-files.json +2 -2
  11. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +3 -3
  12. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +36 -36
  13. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  14. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/chat/page/react-loadable-manifest.json +3 -3
  16. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +34 -34
  17. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page/react-loadable-manifest.json +3 -3
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +37 -37
  21. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/react-loadable-manifest.json +3 -3
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +46 -46
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/react-loadable-manifest.json +3 -3
  28. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +46 -46
  29. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +3 -3
  32. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +35 -35
  33. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/react-loadable-manifest.json +3 -3
  36. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +35 -35
  37. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/chat/page/react-loadable-manifest.json +3 -3
  40. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +34 -34
  41. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/control-center/page/react-loadable-manifest.json +3 -3
  44. package/web/.next/server/app/(dashboard)/control-center/page/server-reference-manifest.json +34 -34
  45. package/web/.next/server/app/(dashboard)/control-center/page.js.nft.json +1 -1
  46. package/web/.next/server/app/(dashboard)/control-center/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/(dashboard)/create/page/react-loadable-manifest.json +3 -3
  48. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +37 -37
  49. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/react-loadable-manifest.json +3 -3
  52. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +46 -46
  53. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/react-loadable-manifest.json +3 -3
  56. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +46 -46
  57. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  58. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  59. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +3 -3
  60. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +35 -35
  61. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/react-loadable-manifest.json +3 -3
  64. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +35 -35
  65. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/_global-error.html +2 -2
  68. package/web/.next/server/app/_global-error.rsc +1 -1
  69. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  70. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  71. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  72. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  73. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  74. package/web/.next/server/app/_not-found/page/react-loadable-manifest.json +3 -3
  75. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +8 -8
  76. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/app/application/[id]/page/react-loadable-manifest.json +3 -3
  78. package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +17 -17
  79. package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
  80. package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/applications/page/react-loadable-manifest.json +3 -3
  82. package/web/.next/server/app/applications/page/server-reference-manifest.json +18 -18
  83. package/web/.next/server/app/applications/page.js.nft.json +1 -1
  84. package/web/.next/server/app/applications/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/features/page/react-loadable-manifest.json +3 -3
  86. package/web/.next/server/app/features/page/server-reference-manifest.json +30 -30
  87. package/web/.next/server/app/features/page.js.nft.json +1 -1
  88. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  89. package/web/.next/server/app/page/react-loadable-manifest.json +3 -3
  90. package/web/.next/server/app/page/server-reference-manifest.json +8 -8
  91. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/projects/[slug]/items/[itemId]/page/react-loadable-manifest.json +3 -3
  93. package/web/.next/server/app/projects/[slug]/items/[itemId]/page/server-reference-manifest.json +15 -15
  94. package/web/.next/server/app/projects/[slug]/items/[itemId]/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/projects/[slug]/page/react-loadable-manifest.json +3 -3
  96. package/web/.next/server/app/projects/[slug]/page/server-reference-manifest.json +27 -27
  97. package/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app/projects/[slug]/pages/page/react-loadable-manifest.json +3 -3
  99. package/web/.next/server/app/projects/[slug]/pages/page/server-reference-manifest.json +11 -11
  100. package/web/.next/server/app/projects/[slug]/pages/page_client-reference-manifest.js +1 -1
  101. package/web/.next/server/app/projects/[slug]/settings/page/react-loadable-manifest.json +3 -3
  102. package/web/.next/server/app/projects/[slug]/settings/page/server-reference-manifest.json +17 -17
  103. package/web/.next/server/app/projects/[slug]/settings/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/projects/page/react-loadable-manifest.json +3 -3
  105. package/web/.next/server/app/projects/page/server-reference-manifest.json +9 -9
  106. package/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  107. package/web/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
  108. package/web/.next/server/app/settings/page/server-reference-manifest.json +11 -11
  109. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  110. package/web/.next/server/app/skills/page/react-loadable-manifest.json +3 -3
  111. package/web/.next/server/app/skills/page/server-reference-manifest.json +16 -16
  112. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  113. package/web/.next/server/app/tools/page/react-loadable-manifest.json +3 -3
  114. package/web/.next/server/app/tools/page/server-reference-manifest.json +14 -14
  115. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  116. package/web/.next/server/app/version/page/react-loadable-manifest.json +3 -3
  117. package/web/.next/server/app/version/page/server-reference-manifest.json +8 -8
  118. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  119. package/web/.next/server/chunks/[root-of-the-server]__10e976f3._.js +1 -1
  120. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_99cb41a4.js +1 -1
  121. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_99cb41a4.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_3bcbcc2f.js +1 -1
  123. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_3bcbcc2f.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_059f6735.js +1 -1
  125. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_059f6735.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_control-center_page_actions_86edeb51.js +1 -1
  127. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_control-center_page_actions_86edeb51.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_items_[itemId]_work-item-detail-client_tsx_d2e02407._.js +1 -1
  129. package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_items_[itemId]_work-item-detail-client_tsx_d2e02407._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_settings_project-settings-client_tsx_e8b85ddc._.js +1 -1
  131. package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_settings_project-settings-client_tsx_e8b85ddc._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  133. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/744ca_web_components_features_applications_applications-page-client_tsx_d0db9938._.js +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__012a0e7d._.js +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__012a0e7d._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__0462fa34._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__0462fa34._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__1973d644._.js +1 -1
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a86d5fe._.js +1 -1
  141. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a86d5fe._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/{[root-of-the-server]__a2c80b96._.js → [root-of-the-server]__252fcd17._.js} +2 -2
  143. package/web/.next/server/chunks/ssr/{[root-of-the-server]__a2c80b96._.js.map → [root-of-the-server]__252fcd17._.js.map} +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__30326387._.js +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__30326387._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__3438c354._.js +1 -1
  147. package/web/.next/server/chunks/ssr/[root-of-the-server]__3438c354._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/[root-of-the-server]__361129f0._.js +1 -1
  149. package/web/.next/server/chunks/ssr/[root-of-the-server]__361129f0._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/[root-of-the-server]__4adb4a94._.js +3 -3
  151. package/web/.next/server/chunks/ssr/[root-of-the-server]__4adb4a94._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/[root-of-the-server]__5c25ef9b._.js +2 -2
  153. package/web/.next/server/chunks/ssr/[root-of-the-server]__5c25ef9b._.js.map +1 -1
  154. package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5f9704._.js +1 -1
  155. package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5f9704._.js.map +1 -1
  156. package/web/.next/server/chunks/ssr/[root-of-the-server]__638955bc._.js +1 -1
  157. package/web/.next/server/chunks/ssr/[root-of-the-server]__78e1366f._.js +1 -1
  158. package/web/.next/server/chunks/ssr/[root-of-the-server]__78e1366f._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/[root-of-the-server]__97b6831c._.js +3 -3
  160. package/web/.next/server/chunks/ssr/[root-of-the-server]__9b16348d._.js +1 -1
  161. package/web/.next/server/chunks/ssr/[root-of-the-server]__9b16348d._.js.map +1 -1
  162. package/web/.next/server/chunks/ssr/[root-of-the-server]__b3bc9689._.js +1 -1
  163. package/web/.next/server/chunks/ssr/[root-of-the-server]__b3bc9689._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba8cbee2._.js +1 -1
  165. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba8cbee2._.js.map +1 -1
  166. package/web/.next/server/chunks/ssr/{[root-of-the-server]__51772860._.js → [root-of-the-server]__c3b6abac._.js} +2 -2
  167. package/web/.next/server/chunks/ssr/{[root-of-the-server]__51772860._.js.map → [root-of-the-server]__c3b6abac._.js.map} +1 -1
  168. package/web/.next/server/chunks/ssr/[root-of-the-server]__dbde193f._.js +1 -1
  169. package/web/.next/server/chunks/ssr/[root-of-the-server]__dbde193f._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/[root-of-the-server]__f6adb460._.js +1 -1
  171. package/web/.next/server/chunks/ssr/[root-of-the-server]__f6adb460._.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/{_69edcad8._.js → _06c1d752._.js} +2 -2
  173. package/web/.next/server/chunks/ssr/{_69edcad8._.js.map → _06c1d752._.js.map} +1 -1
  174. package/web/.next/server/chunks/ssr/{_c631c327._.js → _0a84dcd8._.js} +2 -2
  175. package/web/.next/server/chunks/ssr/{_c631c327._.js.map → _0a84dcd8._.js.map} +1 -1
  176. package/web/.next/server/chunks/ssr/_101de7c3._.js +1 -1
  177. package/web/.next/server/chunks/ssr/_101de7c3._.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/_12ba4a07._.js +1 -1
  179. package/web/.next/server/chunks/ssr/_12ba4a07._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/_15634d5b._.js +1 -1
  181. package/web/.next/server/chunks/ssr/_15634d5b._.js.map +1 -1
  182. package/web/.next/server/chunks/ssr/_27c2f774._.js +1 -1
  183. package/web/.next/server/chunks/ssr/_27c2f774._.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/_30787024._.js +1 -1
  185. package/web/.next/server/chunks/ssr/_30787024._.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/_3bd60fa3._.js +1 -1
  187. package/web/.next/server/chunks/ssr/_402d53bf._.js +1 -1
  188. package/web/.next/server/chunks/ssr/_402d53bf._.js.map +1 -1
  189. package/web/.next/server/chunks/ssr/{_2b91b410._.js → _494c9d59._.js} +2 -2
  190. package/web/.next/server/chunks/ssr/{_2b91b410._.js.map → _494c9d59._.js.map} +1 -1
  191. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  192. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  193. package/web/.next/server/chunks/ssr/_6868b4b1._.js +1 -1
  194. package/web/.next/server/chunks/ssr/_805ae1aa._.js +1 -1
  195. package/web/.next/server/chunks/ssr/_805ae1aa._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/_8a700ff4._.js +1 -1
  197. package/web/.next/server/chunks/ssr/_8a700ff4._.js.map +1 -1
  198. package/web/.next/server/chunks/ssr/_8f4f8aa1._.js +1 -1
  199. package/web/.next/server/chunks/ssr/_8f4f8aa1._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/{_c27993b2._.js → _b2c44425._.js} +2 -2
  201. package/web/.next/server/chunks/ssr/{_c27993b2._.js.map → _b2c44425._.js.map} +1 -1
  202. package/web/.next/server/chunks/ssr/_b40a4fc3._.js +1 -1
  203. package/web/.next/server/chunks/ssr/_b40a4fc3._.js.map +1 -1
  204. package/web/.next/server/chunks/ssr/_c44ec376._.js +1 -1
  205. package/web/.next/server/chunks/ssr/_c44ec376._.js.map +1 -1
  206. package/web/.next/server/chunks/ssr/{_a92fd4f0._.js → _c570d4fb._.js} +2 -2
  207. package/web/.next/server/chunks/ssr/{_a92fd4f0._.js.map → _c570d4fb._.js.map} +1 -1
  208. package/web/.next/server/chunks/ssr/_cd641c61._.js +1 -1
  209. package/web/.next/server/chunks/ssr/_cd641c61._.js.map +1 -1
  210. package/web/.next/server/chunks/ssr/_d53224a9._.js +1 -1
  211. package/web/.next/server/chunks/ssr/_d53224a9._.js.map +1 -1
  212. package/web/.next/server/chunks/ssr/_e6271303._.js +1 -1
  213. package/web/.next/server/chunks/ssr/_e6271303._.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/_ed8fd56c._.js +1 -1
  215. package/web/.next/server/chunks/ssr/_ed8fd56c._.js.map +1 -1
  216. package/web/.next/server/chunks/ssr/_f602cc9f._.js +1 -1
  217. package/web/.next/server/chunks/ssr/_f602cc9f._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/{_4f0d074c._.js → _fc1ebfd1._.js} +2 -2
  219. package/web/.next/server/chunks/ssr/{_4f0d074c._.js.map → _fc1ebfd1._.js.map} +1 -1
  220. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  221. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  223. package/web/.next/server/chunks/ssr/src_presentation_web_05bba4dc._.js +1 -1
  224. package/web/.next/server/chunks/ssr/src_presentation_web_05bba4dc._.js.map +1 -1
  225. package/web/.next/server/chunks/ssr/{src_presentation_web_8d676afa._.js → src_presentation_web_0a898c35._.js} +2 -2
  226. package/web/.next/server/chunks/ssr/{src_presentation_web_8d676afa._.js.map → src_presentation_web_0a898c35._.js.map} +1 -1
  227. package/web/.next/server/chunks/ssr/src_presentation_web_43451480._.js +1 -1
  228. package/web/.next/server/chunks/ssr/src_presentation_web_43451480._.js.map +1 -1
  229. package/web/.next/server/chunks/ssr/src_presentation_web_4b306bb3._.js +1 -1
  230. package/web/.next/server/chunks/ssr/src_presentation_web_4b306bb3._.js.map +1 -1
  231. package/web/.next/server/chunks/ssr/src_presentation_web_81dd84ae._.js +1 -1
  232. package/web/.next/server/chunks/ssr/src_presentation_web_81dd84ae._.js.map +1 -1
  233. package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js +1 -1
  234. package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js.map +1 -1
  235. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_7ab26c98._.js +3 -3
  236. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_adopt-local-directory_ts_75f1f28c._.js +1 -1
  237. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_adopt-local-directory_ts_75f1f28c._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_9453ce8b._.js +1 -1
  239. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-directory_ts_1209d917._.js +1 -1
  240. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-directory_ts_1209d917._.js.map +1 -1
  241. package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js +1 -1
  242. package/web/.next/server/chunks/ssr/src_presentation_web_b504e3e2._.js +1 -1
  243. package/web/.next/server/chunks/ssr/src_presentation_web_b504e3e2._.js.map +1 -1
  244. package/web/.next/server/chunks/ssr/src_presentation_web_b5838705._.js +1 -1
  245. package/web/.next/server/chunks/ssr/src_presentation_web_b5838705._.js.map +1 -1
  246. package/web/.next/server/chunks/ssr/src_presentation_web_b6b4baa1._.js +1 -1
  247. package/web/.next/server/chunks/ssr/src_presentation_web_b6b4baa1._.js.map +1 -1
  248. package/web/.next/server/chunks/ssr/{src_presentation_web_7cd9b825._.js → src_presentation_web_bdc7c0dd._.js} +2 -2
  249. package/web/.next/server/chunks/ssr/{src_presentation_web_7cd9b825._.js.map → src_presentation_web_bdc7c0dd._.js.map} +1 -1
  250. package/web/.next/server/chunks/ssr/src_presentation_web_c3d0de23._.js +1 -1
  251. package/web/.next/server/chunks/ssr/src_presentation_web_c3d0de23._.js.map +1 -1
  252. package/web/.next/server/chunks/ssr/src_presentation_web_components_66643378._.js +1 -1
  253. package/web/.next/server/chunks/ssr/src_presentation_web_components_66643378._.js.map +1 -1
  254. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
  255. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js.map +1 -1
  256. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  257. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  258. package/web/.next/server/chunks/ssr/src_presentation_web_fc29283f._.js +1 -1
  259. package/web/.next/server/chunks/ssr/src_presentation_web_fc29283f._.js.map +1 -1
  260. package/web/.next/server/pages/500.html +2 -2
  261. package/web/.next/server/server-reference-manifest.js +1 -1
  262. package/web/.next/server/server-reference-manifest.json +98 -98
  263. package/web/.next/static/chunks/{e905629da45b8d96.js → 03c8ee30ab88f919.js} +1 -1
  264. package/web/.next/static/chunks/{9968fecdcb083723.js → 0cc03015af924e20.js} +1 -1
  265. package/web/.next/static/chunks/{c8dc94ffb074fecf.js → 0cf016ec6f65fa24.js} +1 -1
  266. package/web/.next/static/chunks/2c61425fc96ae9f7.js +1 -0
  267. package/web/.next/static/chunks/318759d8e86dfc42.js +1 -0
  268. package/web/.next/static/chunks/{74b8a8f4b4145390.js → 331f023572696b0a.js} +1 -1
  269. package/web/.next/static/chunks/41e289ee887c8517.js +1 -0
  270. package/web/.next/static/chunks/{dbabd908bd2eb608.js → 50bb4ae3adb5eb0e.js} +1 -1
  271. package/web/.next/static/chunks/{5c76c495d17ba49d.js → 6da640312464431a.js} +1 -1
  272. package/web/.next/static/chunks/{d8e7c392fbf649d1.js → 77966d6d1929c049.js} +1 -1
  273. package/web/.next/static/chunks/{eee2cfbb53f2dc4d.js → 8e693bdf4d04fa2c.js} +1 -1
  274. package/web/.next/static/chunks/{651e062e92628d8a.js → 931795a6a581b203.js} +1 -1
  275. package/web/.next/static/chunks/{6b70e5c333a5044a.js → 953e9d92d97dcaf1.js} +3 -3
  276. package/web/.next/static/chunks/{ba06f5ed6ea82840.js → 959faf37d8e8d52b.js} +1 -1
  277. package/web/.next/static/chunks/{89a3c6dffb7d3501.js → a42c84a8e2742018.js} +1 -1
  278. package/web/.next/static/chunks/{669d597868dcffa7.js → a95cef864840e759.js} +1 -1
  279. package/web/.next/static/chunks/accd7fa108255573.js +1 -0
  280. package/web/.next/static/chunks/aea0f9b5ab3bace4.js +1 -0
  281. package/web/.next/static/chunks/{8bd9980bf65002e6.js → b10e586976309bb7.js} +1 -1
  282. package/web/.next/static/chunks/{bcba5fdd47b06d36.js → b15f7964eeaaab12.js} +1 -1
  283. package/web/.next/static/chunks/{ca2d1d848994190c.js → b207588307f7be12.js} +1 -1
  284. package/web/.next/static/chunks/b77a5bc7f8489137.js +1 -0
  285. package/web/.next/static/chunks/{c374f1981d2ab63d.js → baf694f161ce7342.js} +1 -1
  286. package/web/.next/static/chunks/{c61a7e8204559832.js → bec8ec0800020acc.js} +1 -1
  287. package/web/.next/static/chunks/c0bb71cba2d00657.js +1 -0
  288. package/web/.next/static/chunks/{b22c837d3ed3bdfe.js → c20650058ecf47b9.js} +1 -1
  289. package/web/.next/static/chunks/{dbf6f88bd4dd0059.js → cc3f38aa30b0e5bc.js} +1 -1
  290. package/web/.next/static/chunks/{95e71bd36a2166d0.js → d3257028b32efe04.js} +1 -1
  291. package/web/.next/static/chunks/{f7c208c766b52c5d.js → e0a0360221311346.js} +1 -1
  292. package/web/.next/static/chunks/{759e570a89f52936.js → f18f55bcb03d0992.js} +1 -1
  293. package/web/.next/static/chunks/{c2b2ca0c163f4806.js → f55c73d6668c343d.js} +1 -1
  294. package/web/.next/static/chunks/{dc12950bd69d798b.js → f8d7451055dafa13.js} +1 -1
  295. package/web/.next/static/chunks/{0050f8c6bd563859.js → f96f160b292fa8fe.js} +1 -1
  296. package/web/.next/static/chunks/{54faecaeb38604e9.js → fb08b36e6fb54e54.js} +1 -1
  297. package/web/.next/static/chunks/239f96d9c74a2c0e.js +0 -1
  298. package/web/.next/static/chunks/298bc02366dd29f6.js +0 -1
  299. package/web/.next/static/chunks/6b0e631a0721cc7b.js +0 -1
  300. package/web/.next/static/chunks/81b70439f2c162aa.js +0 -1
  301. package/web/.next/static/chunks/8359874b37b80bd2.js +0 -1
  302. package/web/.next/static/chunks/b3e5194e41047fc3.js +0 -1
  303. package/web/.next/static/chunks/b6fd1b3110ccc340.js +0 -1
  304. /package/web/.next/static/{T9D48ReTacJEznN7ua4Ed → edsd2kzyk0v0aunegSWUo}/_buildManifest.js +0 -0
  305. /package/web/.next/static/{T9D48ReTacJEznN7ua4Ed → edsd2kzyk0v0aunegSWUo}/_clientMiddlewareManifest.json +0 -0
  306. /package/web/.next/static/{T9D48ReTacJEznN7ua4Ed → edsd2kzyk0v0aunegSWUo}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,823622,e=>{"use strict";let t=(0,e.i(903645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",()=>t])},943698,176505,57484,e=>{"use strict";var t=e.i(903645);let a=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["default",()=>a],943698);let r=(0,t.default)("file",[["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"}]]);e.s(["default",()=>r],176505),e.s(["FileIcon",()=>r],57484)},295230,e=>{"use strict";let t=(0,e.i(903645).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])},602287,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(90033),o=e.i(860253),s=e.i(131777);let n=r.Dialog.Root,l=r.Dialog.Trigger,i=r.Dialog.Portal,d=r.Dialog.Close,c=a.forwardRef(({className:e,onClick:a,...o},n)=>(0,t.jsx)(r.Dialog.Overlay,{ref:n,className:(0,s.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),a?.(e)},...o}));c.displayName=r.Dialog.Overlay.displayName;let u=a.forwardRef(({className:e,children:a,...n},l)=>(0,t.jsxs)(i,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(r.Dialog.Content,{ref:l,className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...n,children:[a,(0,t.jsxs)(r.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(o.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));u.displayName=r.Dialog.Content.displayName;let p=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 text-center sm:text-start",e),...a});p.displayName="DialogHeader";let h=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});h.displayName="DialogFooter";let m=a.forwardRef(({className:e,...a},o)=>(0,t.jsx)(r.Dialog.Title,{ref:o,className:(0,s.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));m.displayName=r.Dialog.Title.displayName;let f=a.forwardRef(({className:e,...a},o)=>(0,t.jsx)(r.Dialog.Description,{ref:o,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));f.displayName=r.Dialog.Description.displayName,e.s(["Dialog",()=>n,"DialogClose",()=>d,"DialogContent",()=>u,"DialogDescription",()=>f,"DialogFooter",()=>h,"DialogHeader",()=>p,"DialogTitle",()=>m,"DialogTrigger",()=>l])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},48306,e=>{"use strict";var t=e.i(679606),a=e.i(131777);function r({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}e.s(["Textarea",()=>r])},650032,280436,428267,486254,e=>{"use strict";var t=e.i(679606),a=e.i(860253),r=e.i(315506),r=r,o=e.i(295230);e.s(["DownloadIcon",()=>o.default],280436);var o=o;let s=(0,e.i(903645).default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);var n=e.i(131777),l=e.i(602287),i=e.i(48306),d=e.i(102828),c=e.i(201693);e.s(["VisuallyHidden",0,c],428267);var c=c,u=e.i(57484),p=e.i(16298),p=p,h=e.i(823622),h=h,m=e.i(93752),m=m;e.i(735364);let f=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),x=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let v=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function b(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function j({name:e,size:j,mimeType:y,path:w,onRemove:N,loading:k=!1,disabled:C=!1,notes:P,onNotesChange:R}){let D,A,T=(D=e.lastIndexOf("."))>=0?e.slice(D).toLowerCase():"",S=f.has(T)?h.default:".pdf"===T?p.default:x.has(T)?m.default:u.FileIcon,M=".pdf"===T?"bg-red-50 text-red-600":f.has(T)?"bg-blue-50 text-blue-600":x.has(T)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",F=(A=e.lastIndexOf("."))>=0&&v.has(e.slice(A).toLowerCase());if(k)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(r.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(F){let r=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:b(w,y),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),P?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(s,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(d.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(l.Dialog,{children:[(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(l.DialogTrigger,{asChild:!0,children:r})}),!C&&(0,t.jsx)("button",{type:"button",onClick:N,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]}),P?(0,t.jsx)(d.TooltipContent,{side:"top",sideOffset:10,className:"z-[80] max-w-[220px]",children:(0,t.jsx)("p",{className:"line-clamp-5 text-xs leading-snug whitespace-pre-wrap",children:P})}):null]}),(0,t.jsxs)(l.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.Root,{children:(0,t.jsxs)(l.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:b(w,y),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)})]}),(0,t.jsx)("a",{href:b(w,y),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(o.default,{className:"h-4 w-4"})})]}),R?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(i.Textarea,{placeholder:"Add notes about this image…",value:P??"",onChange:e=>R(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}),P?.trim()?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"Auto-saved"}):null]}):P?(0,t.jsx)("p",{className:"text-muted-foreground text-sm whitespace-pre-wrap",children:P}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 ps-2 pe-3",children:[(0,t.jsx)("div",{className:(0,n.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",M),children:(0,t.jsx)(S,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)}),!C&&(0,t.jsx)("button",{type:"button",onClick:N,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]})}e.s(["AttachmentChip",()=>j],486254),e.s([],650032)},16298,e=>{"use strict";let t=(0,e.i(903645).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])},66459,e=>{"use strict";let t=(0,e.i(903645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},390382,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(291967),o=e.i(205978),s=e.i(922528),n=e.i(253532),l=e.i(341687),i=e.i(556720),d=e.i(713123),c=e.i(252740),u=e.i(339979),p=e.i(685995),h=e.i(287620),m=e.i(786874),f=e.i(936589),x=e.i(73772),g=e.i(813044),v="Popover",[b,j]=(0,s.createContextScope)(v,[c.createPopperScope]),y=(0,c.createPopperScope)(),[w,N]=b(v),k=e=>{let{__scopePopover:r,children:o,open:s,defaultOpen:n,onOpenChange:l,modal:i=!1}=e,u=y(r),p=a.useRef(null),[h,m]=a.useState(!1),[x,g]=(0,f.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:v});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(w,{scope:r,contentId:(0,d.useId)(),triggerRef:p,open:x,onOpenChange:g,onOpenToggle:a.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:a.useCallback(()=>m(!0),[]),onCustomAnchorRemove:a.useCallback(()=>m(!1),[]),modal:i,children:o})})};k.displayName=v;var C="PopoverAnchor",P=a.forwardRef((e,r)=>{let{__scopePopover:o,...s}=e,n=N(C,o),l=y(o),{onCustomAnchorAdd:i,onCustomAnchorRemove:d}=n;return a.useEffect(()=>(i(),()=>d()),[i,d]),(0,t.jsx)(c.Anchor,{...l,...s,ref:r})});P.displayName=C;var R="PopoverTrigger",D=a.forwardRef((e,a)=>{let{__scopePopover:s,...n}=e,l=N(R,s),i=y(s),d=(0,o.useComposedRefs)(a,l.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":_(l.open),...n,ref:d,onClick:(0,r.composeEventHandlers)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...i,children:u})});D.displayName=R;var A="PopoverPortal",[T,S]=b(A,{forceMount:void 0}),M=e=>{let{__scopePopover:a,forceMount:r,children:o,container:s}=e,n=N(A,a);return(0,t.jsx)(T,{scope:a,forceMount:r,children:(0,t.jsx)(p.Presence,{present:r||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:s,children:o})})})};M.displayName=A;var F="PopoverContent",O=a.forwardRef((e,a)=>{let r=S(F,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,n=N(F,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(L,{...s,ref:a}):(0,t.jsx)(E,{...s,ref:a})})});O.displayName=F;var z=(0,m.createSlot)("PopoverContent.RemoveScroll"),L=a.forwardRef((e,s)=>{let n=N(F,e.__scopePopover),l=a.useRef(null),i=(0,o.useComposedRefs)(s,l),d=a.useRef(!1);return a.useEffect(()=>{let e=l.current;if(e)return(0,x.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||a},{checkForDefaultPrevented:!1}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),E=a.forwardRef((e,r)=>{let o=N(F,e.__scopePopover),s=a.useRef(!1),n=a.useRef(!1);return(0,t.jsx)(I,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||o.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let a=t.target;o.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=a.forwardRef((e,a)=>{let{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:f,...x}=e,g=N(F,r),v=y(r);return(0,l.useFocusGuards)(),(0,t.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:d,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:f,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":_(g.open),role:"dialog",id:g.contentId,...v,...x,ref:a,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),H="PopoverClose",B=a.forwardRef((e,a)=>{let{__scopePopover:o,...s}=e,n=N(H,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:a,onClick:(0,r.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});B.displayName=H;var $=a.forwardRef((e,a)=>{let{__scopePopover:r,...o}=e,s=y(r);return(0,t.jsx)(c.Arrow,{...s,...o,ref:a})});function _(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>M,"PopoverTrigger",()=>D,"Portal",()=>M,"Root",()=>k,"Trigger",()=>D,"createPopoverScope",()=>j],689920);var U=e.i(689920),U=U,q=e.i(131777);let K=U.Root,V=U.Trigger;U.Anchor;let X=a.forwardRef(({className:e,align:a="center",sideOffset:r=4,...o},s)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:s,align:a,sideOffset:r,className:(0,q.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 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>K,"PopoverContent",()=>X,"PopoverTrigger",()=>V],390382)},93752,e=>{"use strict";let t=(0,e.i(903645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},276016,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],276016)},611345,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],611345)},41413,631618,926697,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(723925),o=e.i(611345),s=e.i(276016),n=e.i(710942);let l=(0,e.i(903645).default)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);var i=e.i(66459),d=e.i(508893);let c=(0,d.createServerReference)("00e1d8a2f1c0811dc30f1b067c66523cdab80b75c0",d.callServer,void 0,d.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>c],631618);let u=(0,d.createServerReference)("00590361a3fb0b7f16d4c0a1e83b0c5e1109f181df",d.callServer,void 0,d.findSourceMapURL,"checkAllAgentsStatus"),p=(0,d.createServerReference)("60bfb94367082aa6db75d53b11933e0bf9c6c6fc78",d.callServer,void 0,d.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>p],926697);var h=e.i(286782),m=e.i(229847),f=e.i(735364),x=e.i(390382),g=e.i(131777);function v({initialAgentType:e,initialModel:d,agentType:v,model:b,onAgentModelChange:j,onSave:y,saveError:w,saving:N,disabled:k,className:C,mode:P,showInstallStatus:R}){var D;let A,T,[S,M]=a.useState(!1),[F,O]=a.useState([]),[z,L]=a.useState(!0),[E,I]=a.useState({}),[H,B]=a.useState(v??e),[$,_]=a.useState(b??d),[U,q]=a.useState(!1),[K,V]=a.useState(null),[X,G]=a.useState(0),[Z,J]=a.useState(null),[Q,W]=a.useState("");a.useEffect(()=>{c().then(O).finally(()=>L(!1)),R&&u().then(I)},[R]),a.useEffect(()=>{B(v??e)},[v,e]),a.useEffect(()=>{_(b??d)},[b,d]);let Y=a.useRef(S);a.useEffect(()=>{let e=Y.current;if(Y.current=S,e&&!S){let e=setTimeout(()=>{G(0),J(null),W("")},150);return()=>clearTimeout(e)}},[S]);let ee=async(e,t)=>{if(M(!1),e===H&&t===$)return;if(V(null),"override"===P){B(e),_(t),j?.(e,t);return}let a=y??(async(e,t)=>p(e,t||null));q(!0);try{let r=await a(e,t);if(r&&"ok"in r&&!r.ok)return void V(r.error??"Failed to save");B(e),_(t),j?.(e,t)}catch{V("Failed to save")}finally{q(!1)}},et=w??K,ea=(0,h.getAgentTypeIcon)(H),er=F.find(e=>e.agentType===H)?.label??H,eo=$?(0,m.getModelMeta)($).displayName||$:null,es=Z?F.find(e=>e.agentType===Z):null;return(0,t.jsxs)("div",{className:(0,g.cn)("flex flex-col gap-1",C),children:[(0,t.jsxs)(x.Popover,{open:S,onOpenChange:M,children:[(0,t.jsx)(x.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(f.Button,{type:"button",variant:"outline",role:"combobox","aria-expanded":S,disabled:(k??!1)||z||(N??!1)||U,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(ea,{className:"h-4 w-4 shrink-0"}),z?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:er}),eo?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:eo})]}):null]})]})})}),(0,t.jsx)(x.PopoverContent,{className:"z-[70] w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",side:"bottom",avoidCollisions:!1,children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===X?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:(0,g.cn)("max-h-53.75 w-1/2 shrink-0 overflow-y-auto",1===X&&"h-0 overflow-hidden"),children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),F.map(e=>{let a=(0,h.getAgentTypeIcon)(e.agentType),o=H===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,g.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{i?(J(e.agentType),W(""),requestAnimationFrame(()=>{requestAnimationFrame(()=>G(1))})):ee(e.agentType,"")},children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-start",children:e.label}),R&&e.agentType in E?E[e.agentType]?(0,t.jsx)(n.CircleCheck,{className:"h-3 w-3 shrink-0 text-emerald-500"}):(0,t.jsx)(l,{className:"text-muted-foreground/40 h-3 w-3 shrink-0"}):null,o&&!i?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(s.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:(0,g.cn)("max-h-53.75 w-1/2 shrink-0 overflow-y-auto",0===X&&"h-0 overflow-hidden"),children:es?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{G(0),W(""),setTimeout(()=>J(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),es.label,(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto",children:es.models.length})]}),es.models.length>8?(0,t.jsx)("div",{className:"bg-background sticky top-0 z-10 border-b px-2 py-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2 h-3 w-3 -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",value:Q,onChange:e=>W(e.target.value),placeholder:"Search models…",className:"bg-muted/50 placeholder:text-muted-foreground focus:ring-ring w-full rounded-md py-1 pr-2 pl-6 text-xs outline-none focus:ring-1"})]})}):null,(D=es.models,0===(T=(A=Q.trim().toLowerCase())?D.filter(e=>e.id.toLowerCase().includes(A)||(e.displayName??"").toLowerCase().includes(A)||(e.vendor??"").toLowerCase().includes(A)||(e.description??"").toLowerCase().includes(A)):D).length?(0,t.jsxs)("div",{className:"text-muted-foreground px-3 py-4 text-center text-xs",children:["No models match “",Q,"”"]}):T.map(e=>{let a=H===es.agentType&&$===e.id,o=e.description||[e.vendor,e.contextLength?`${Math.round(e.contextLength/1e3)}k ctx`:null].filter(Boolean).join(" · ")||e.id;return(0,t.jsxs)("button",{type:"button",className:(0,g.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-start transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>ee(es.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium",children:[(0,t.jsx)("span",{className:"truncate",children:e.displayName}),e.isFree?(0,t.jsx)("span",{className:"rounded bg-emerald-100 px-1 py-0 text-[9px] font-semibold tracking-wide text-emerald-700 uppercase dark:bg-emerald-900/40 dark:text-emerald-300",children:"Free"}):null]}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:o})]}),a?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)}))]}):null})]})})]}),!!et&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:et})]})}e.s(["AgentModelPicker",()=>v],41413)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,823622,e=>{"use strict";let t=(0,e.i(903645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",()=>t])},943698,176505,57484,e=>{"use strict";var t=e.i(903645);let a=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["default",()=>a],943698);let r=(0,t.default)("file",[["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"}]]);e.s(["default",()=>r],176505),e.s(["FileIcon",()=>r],57484)},295230,e=>{"use strict";let t=(0,e.i(903645).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])},602287,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(90033),o=e.i(860253),s=e.i(131777);let n=r.Dialog.Root,l=r.Dialog.Trigger,i=r.Dialog.Portal,d=r.Dialog.Close,c=a.forwardRef(({className:e,onClick:a,...o},n)=>(0,t.jsx)(r.Dialog.Overlay,{ref:n,className:(0,s.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),a?.(e)},...o}));c.displayName=r.Dialog.Overlay.displayName;let u=a.forwardRef(({className:e,children:a,...n},l)=>(0,t.jsxs)(i,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(r.Dialog.Content,{ref:l,className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...n,children:[a,(0,t.jsxs)(r.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(o.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));u.displayName=r.Dialog.Content.displayName;let p=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 text-center sm:text-start",e),...a});p.displayName="DialogHeader";let h=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});h.displayName="DialogFooter";let m=a.forwardRef(({className:e,...a},o)=>(0,t.jsx)(r.Dialog.Title,{ref:o,className:(0,s.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));m.displayName=r.Dialog.Title.displayName;let x=a.forwardRef(({className:e,...a},o)=>(0,t.jsx)(r.Dialog.Description,{ref:o,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));x.displayName=r.Dialog.Description.displayName,e.s(["Dialog",()=>n,"DialogClose",()=>d,"DialogContent",()=>u,"DialogDescription",()=>x,"DialogFooter",()=>h,"DialogHeader",()=>p,"DialogTitle",()=>m,"DialogTrigger",()=>l])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},48306,e=>{"use strict";var t=e.i(679606),a=e.i(131777);function r({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}e.s(["Textarea",()=>r])},650032,280436,428267,486254,e=>{"use strict";var t=e.i(679606),a=e.i(860253),r=e.i(315506),r=r,o=e.i(295230);e.s(["DownloadIcon",()=>o.default],280436);var o=o;let s=(0,e.i(903645).default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);var n=e.i(131777),l=e.i(602287),i=e.i(48306),d=e.i(102828),c=e.i(201693);e.s(["VisuallyHidden",0,c],428267);var c=c,u=e.i(57484),p=e.i(16298),p=p,h=e.i(823622),h=h,m=e.i(93752),m=m;e.i(735364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let v=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function b(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function j({name:e,size:j,mimeType:y,path:w,onRemove:N,loading:k=!1,disabled:C=!1,notes:P,onNotesChange:R}){let D,A,T=(D=e.lastIndexOf("."))>=0?e.slice(D).toLowerCase():"",S=x.has(T)?h.default:".pdf"===T?p.default:f.has(T)?m.default:u.FileIcon,M=".pdf"===T?"bg-red-50 text-red-600":x.has(T)?"bg-blue-50 text-blue-600":f.has(T)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",F=(A=e.lastIndexOf("."))>=0&&v.has(e.slice(A).toLowerCase());if(k)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(r.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(F){let r=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:b(w,y),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),P?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(s,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(d.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(l.Dialog,{children:[(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(l.DialogTrigger,{asChild:!0,children:r})}),!C&&(0,t.jsx)("button",{type:"button",onClick:N,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]}),P?(0,t.jsx)(d.TooltipContent,{side:"top",sideOffset:10,className:"z-[80] max-w-[220px]",children:(0,t.jsx)("p",{className:"line-clamp-5 text-xs leading-snug whitespace-pre-wrap",children:P})}):null]}),(0,t.jsxs)(l.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.Root,{children:(0,t.jsxs)(l.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:b(w,y),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)})]}),(0,t.jsx)("a",{href:b(w,y),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(o.default,{className:"h-4 w-4"})})]}),R?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(i.Textarea,{placeholder:"Add notes about this image…",value:P??"",onChange:e=>R(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}),P?.trim()?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"Auto-saved"}):null]}):P?(0,t.jsx)("p",{className:"text-muted-foreground text-sm whitespace-pre-wrap",children:P}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 ps-2 pe-3",children:[(0,t.jsx)("div",{className:(0,n.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",M),children:(0,t.jsx)(S,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)}),!C&&(0,t.jsx)("button",{type:"button",onClick:N,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]})}e.s(["AttachmentChip",()=>j],486254),e.s([],650032)},16298,e=>{"use strict";let t=(0,e.i(903645).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])},66459,e=>{"use strict";let t=(0,e.i(903645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},390382,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(291967),o=e.i(205978),s=e.i(922528),n=e.i(253532),l=e.i(341687),i=e.i(556720),d=e.i(713123),c=e.i(252740),u=e.i(339979),p=e.i(685995),h=e.i(287620),m=e.i(786874),x=e.i(936589),f=e.i(73772),g=e.i(813044),v="Popover",[b,j]=(0,s.createContextScope)(v,[c.createPopperScope]),y=(0,c.createPopperScope)(),[w,N]=b(v),k=e=>{let{__scopePopover:r,children:o,open:s,defaultOpen:n,onOpenChange:l,modal:i=!1}=e,u=y(r),p=a.useRef(null),[h,m]=a.useState(!1),[f,g]=(0,x.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:v});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(w,{scope:r,contentId:(0,d.useId)(),triggerRef:p,open:f,onOpenChange:g,onOpenToggle:a.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:a.useCallback(()=>m(!0),[]),onCustomAnchorRemove:a.useCallback(()=>m(!1),[]),modal:i,children:o})})};k.displayName=v;var C="PopoverAnchor",P=a.forwardRef((e,r)=>{let{__scopePopover:o,...s}=e,n=N(C,o),l=y(o),{onCustomAnchorAdd:i,onCustomAnchorRemove:d}=n;return a.useEffect(()=>(i(),()=>d()),[i,d]),(0,t.jsx)(c.Anchor,{...l,...s,ref:r})});P.displayName=C;var R="PopoverTrigger",D=a.forwardRef((e,a)=>{let{__scopePopover:s,...n}=e,l=N(R,s),i=y(s),d=(0,o.useComposedRefs)(a,l.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":_(l.open),...n,ref:d,onClick:(0,r.composeEventHandlers)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...i,children:u})});D.displayName=R;var A="PopoverPortal",[T,S]=b(A,{forceMount:void 0}),M=e=>{let{__scopePopover:a,forceMount:r,children:o,container:s}=e,n=N(A,a);return(0,t.jsx)(T,{scope:a,forceMount:r,children:(0,t.jsx)(p.Presence,{present:r||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:s,children:o})})})};M.displayName=A;var F="PopoverContent",O=a.forwardRef((e,a)=>{let r=S(F,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,n=N(F,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(L,{...s,ref:a}):(0,t.jsx)(E,{...s,ref:a})})});O.displayName=F;var z=(0,m.createSlot)("PopoverContent.RemoveScroll"),L=a.forwardRef((e,s)=>{let n=N(F,e.__scopePopover),l=a.useRef(null),i=(0,o.useComposedRefs)(s,l),d=a.useRef(!1);return a.useEffect(()=>{let e=l.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||a},{checkForDefaultPrevented:!1}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),E=a.forwardRef((e,r)=>{let o=N(F,e.__scopePopover),s=a.useRef(!1),n=a.useRef(!1);return(0,t.jsx)(I,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||o.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let a=t.target;o.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=a.forwardRef((e,a)=>{let{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=N(F,r),v=y(r);return(0,l.useFocusGuards)(),(0,t.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:d,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:x,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":_(g.open),role:"dialog",id:g.contentId,...v,...f,ref:a,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),H="PopoverClose",B=a.forwardRef((e,a)=>{let{__scopePopover:o,...s}=e,n=N(H,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:a,onClick:(0,r.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});B.displayName=H;var $=a.forwardRef((e,a)=>{let{__scopePopover:r,...o}=e,s=y(r);return(0,t.jsx)(c.Arrow,{...s,...o,ref:a})});function _(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>M,"PopoverTrigger",()=>D,"Portal",()=>M,"Root",()=>k,"Trigger",()=>D,"createPopoverScope",()=>j],689920);var U=e.i(689920),U=U,q=e.i(131777);let K=U.Root,V=U.Trigger;U.Anchor;let X=a.forwardRef(({className:e,align:a="center",sideOffset:r=4,...o},s)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:s,align:a,sideOffset:r,className:(0,q.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 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>K,"PopoverContent",()=>X,"PopoverTrigger",()=>V],390382)},93752,e=>{"use strict";let t=(0,e.i(903645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},276016,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],276016)},611345,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],611345)},41413,830728,227800,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(723925),o=e.i(611345),s=e.i(276016),n=e.i(710942);let l=(0,e.i(903645).default)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);var i=e.i(66459),d=e.i(508893);let c=(0,d.createServerReference)("00a6c2aee46881b11cdb387b406998ab3ebcfa108a",d.callServer,void 0,d.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>c],830728);let u=(0,d.createServerReference)("00e3964b802b6f86c8ad684602c66660e76d7d911e",d.callServer,void 0,d.findSourceMapURL,"checkAllAgentsStatus"),p=(0,d.createServerReference)("60cb3c46518981344c02b500d8402e689d66b1ee0a",d.callServer,void 0,d.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>p],227800);var h=e.i(286782),m=e.i(229847),x=e.i(735364),f=e.i(390382),g=e.i(131777);function v({initialAgentType:e,initialModel:d,agentType:v,model:b,onAgentModelChange:j,onSave:y,saveError:w,saving:N,disabled:k,className:C,mode:P,showInstallStatus:R}){var D;let A,T,[S,M]=a.useState(!1),[F,O]=a.useState([]),[z,L]=a.useState(!0),[E,I]=a.useState({}),[H,B]=a.useState(v??e),[$,_]=a.useState(b??d),[U,q]=a.useState(!1),[K,V]=a.useState(null),[X,G]=a.useState(0),[Z,J]=a.useState(null),[Q,W]=a.useState("");a.useEffect(()=>{c().then(O).finally(()=>L(!1)),R&&u().then(I)},[R]),a.useEffect(()=>{B(v??e)},[v,e]),a.useEffect(()=>{_(b??d)},[b,d]);let Y=a.useRef(S);a.useEffect(()=>{let e=Y.current;if(Y.current=S,e&&!S){let e=setTimeout(()=>{G(0),J(null),W("")},150);return()=>clearTimeout(e)}},[S]);let ee=async(e,t)=>{if(M(!1),e===H&&t===$)return;if(V(null),"override"===P){B(e),_(t),j?.(e,t);return}let a=y??(async(e,t)=>p(e,t||null));q(!0);try{let r=await a(e,t);if(r&&"ok"in r&&!r.ok)return void V(r.error??"Failed to save");B(e),_(t),j?.(e,t)}catch{V("Failed to save")}finally{q(!1)}},et=w??K,ea=(0,h.getAgentTypeIcon)(H),er=F.find(e=>e.agentType===H)?.label??H,eo=$?(0,m.getModelMeta)($).displayName||$:null,es=Z?F.find(e=>e.agentType===Z):null;return(0,t.jsxs)("div",{className:(0,g.cn)("flex flex-col gap-1",C),children:[(0,t.jsxs)(f.Popover,{open:S,onOpenChange:M,children:[(0,t.jsx)(f.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(x.Button,{type:"button",variant:"outline",role:"combobox","aria-expanded":S,disabled:(k??!1)||z||(N??!1)||U,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(ea,{className:"h-4 w-4 shrink-0"}),z?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:er}),eo?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:eo})]}):null]})]})})}),(0,t.jsx)(f.PopoverContent,{className:"z-[70] w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",side:"bottom",avoidCollisions:!1,children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===X?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:(0,g.cn)("max-h-53.75 w-1/2 shrink-0 overflow-y-auto",1===X&&"h-0 overflow-hidden"),children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),F.map(e=>{let a=(0,h.getAgentTypeIcon)(e.agentType),o=H===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,g.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{i?(J(e.agentType),W(""),requestAnimationFrame(()=>{requestAnimationFrame(()=>G(1))})):ee(e.agentType,"")},children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-start",children:e.label}),R&&e.agentType in E?E[e.agentType]?(0,t.jsx)(n.CircleCheck,{className:"h-3 w-3 shrink-0 text-emerald-500"}):(0,t.jsx)(l,{className:"text-muted-foreground/40 h-3 w-3 shrink-0"}):null,o&&!i?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(s.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:(0,g.cn)("max-h-53.75 w-1/2 shrink-0 overflow-y-auto",0===X&&"h-0 overflow-hidden"),children:es?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{G(0),W(""),setTimeout(()=>J(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),es.label,(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto",children:es.models.length})]}),es.models.length>8?(0,t.jsx)("div",{className:"bg-background sticky top-0 z-10 border-b px-2 py-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2 h-3 w-3 -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",value:Q,onChange:e=>W(e.target.value),placeholder:"Search models…",className:"bg-muted/50 placeholder:text-muted-foreground focus:ring-ring w-full rounded-md py-1 pr-2 pl-6 text-xs outline-none focus:ring-1"})]})}):null,(D=es.models,0===(T=(A=Q.trim().toLowerCase())?D.filter(e=>e.id.toLowerCase().includes(A)||(e.displayName??"").toLowerCase().includes(A)||(e.vendor??"").toLowerCase().includes(A)||(e.description??"").toLowerCase().includes(A)):D).length?(0,t.jsxs)("div",{className:"text-muted-foreground px-3 py-4 text-center text-xs",children:["No models match “",Q,"”"]}):T.map(e=>{let a=H===es.agentType&&$===e.id,o=e.description||[e.vendor,e.contextLength?`${Math.round(e.contextLength/1e3)}k ctx`:null].filter(Boolean).join(" · ")||e.id;return(0,t.jsxs)("button",{type:"button",className:(0,g.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-start transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>ee(es.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium",children:[(0,t.jsx)("span",{className:"truncate",children:e.displayName}),e.isFree?(0,t.jsx)("span",{className:"rounded bg-emerald-100 px-1 py-0 text-[9px] font-semibold tracking-wide text-emerald-700 uppercase dark:bg-emerald-900/40 dark:text-emerald-300",children:"Free"}):null]}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:o})]}),a?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)}))]}):null})]})})]}),!!et&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:et})]})}e.s(["AgentModelPicker",()=>v],41413)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,267669,e=>{"use strict";let t=(0,e.i(903645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],267669)},48829,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>t],48829)},81846,e=>{"use strict";var t=e.i(679606),r=e.i(294237),s=e.i(131777);let a=(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)(a({variant:r}),e),...l})}e.s(["Badge",()=>l])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},787342,e=>{"use strict";var t=e.i(152155),r=e.i(922528),s=e.i(205978),a=e.i(786874),l=e.i(679606);function n(e){let n=e+"CollectionProvider",[i,o]=(0,r.createContextScope)(n),[d,c]=i(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,a=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(d,{scope:r,itemMap:n,collectionRef:a,children:s})};u.displayName=n;let p=e+"CollectionSlot",m=(0,a.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:a}=e,n=c(p,r),i=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(m,{ref:i,children:a})});f.displayName=p;let h=e+"CollectionItemSlot",x="data-radix-collection-item",v=(0,a.createSlot)(h),g=t.default.forwardRef((e,r)=>{let{scope:a,children:n,...i}=e,o=t.default.useRef(null),d=(0,s.useComposedRefs)(r,o),u=c(h,a);return t.default.useEffect(()=>(u.itemMap.set(o,{ref:o,...i}),()=>void u.itemMap.delete(o))),(0,l.jsx)(v,{...{[x]:""},ref:d,children:n})});return g.displayName=h,[{Provider:u,Slot:f,ItemSlot:g},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(`[${x}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},o]}var i=new WeakMap;function o(e,t){var r,s;let a,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let i=(r=e,s=t,a=r.length,(n=(l=d(s))>=0?l:a+l)<0||n>=a?-1:n);return -1===i?void 0:e[i]}function d(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],i.set(this,!0)}set(e,t){return i.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,a=this.has(t),l=this.#e.length,n=d(e),i=n>=0?n:l+n,o=i<0||i>=l?-1:i;if(o===this.size||a&&o===this.size-1||-1===o)return this.set(t,r),this;let c=this.size+ +!a;n<0&&i++;let u=[...this.#e],p=!1;for(let e=i;e<c;e++)if(i===e){let l=u[e];u[e]===t&&(l=u[e+1]),a&&this.delete(t),s=this.get(l),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],a=s;s=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,s){let a=new e(this);return a.insert(t,r,s),a}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=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 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=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&s.push(e),a++;return new e(s)}map(t,r){let s=[],a=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(s)}reduce(...e){let[t,r]=e,s=0,a=r??this.at(0);for(let r of this)a=0===s&&1===e.length?r:Reflect.apply(t,this,[a,r,s,this]),s++;return a}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);s=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[s,a,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,a=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;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])},141957,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(287620),a=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())}}));a.displayName="Label",e.s(["Label",()=>a,"Root",()=>a],127572);var l=e.i(127572),l=l,n=e.i(294237),i=e.i(131777);let o=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,i.cn)(o(),e),...r}));d.displayName=l.Root.displayName,e.s(["Label",()=>d],141957)},23405,e=>{"use strict";var t=e.i(152155);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])},547373,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(685446),a=e.i(527069),l=e.i(291967),n=e.i(787342),i=e.i(205978),o=e.i(922528),d=e.i(566033),c=e.i(253532),u=e.i(341687),p=e.i(556720),m=e.i(713123),f=e.i(252740),h=e.i(339979),x=e.i(287620),v=e.i(786874),g=e.i(929297),y=e.i(936589),b=e.i(305192),w=e.i(23405),j=e.i(201693),S=e.i(73772),N=e.i(813044),C=[" ","Enter","ArrowUp","ArrowDown"],k=[" ","Enter"],R="Select",[I,P,E]=(0,n.createCollection)(R),[M,T]=(0,o.createContextScope)(R,[E,f.createPopperScope]),L=(0,f.createPopperScope)(),[A,D]=M(R),[B,H]=M(R),z=e=>{let{__scopeSelect:s,children:a,open:l,defaultOpen:n,onOpenChange:i,value:o,defaultValue:c,onValueChange:u,dir:p,name:h,autoComplete:x,disabled:v,required:g,form:b}=e,w=L(s),[j,S]=r.useState(null),[N,C]=r.useState(null),[k,P]=r.useState(!1),E=(0,d.useDirection)(p),[M,T]=(0,y.useControllableState)({prop:l,defaultProp:n??!1,onChange:i,caller:R}),[D,H]=(0,y.useControllableState)({prop:o,defaultProp:c,onChange:u,caller:R}),z=r.useRef(null),V=!j||b||!!j.closest("form"),[U,O]=r.useState(new Set),_=Array.from(U).map(e=>e.props.value).join(";");return(0,t.jsx)(f.Root,{...w,children:(0,t.jsxs)(A,{required:g,scope:s,trigger:j,onTriggerChange:S,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:k,onValueNodeHasChildrenChange:P,contentId:(0,m.useId)(),value:D,onValueChange:H,open:M,onOpenChange:T,dir:E,triggerPointerDownPosRef:z,disabled:v,children:[(0,t.jsx)(I.Provider,{scope:s,children:(0,t.jsx)(B,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{O(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{O(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:a})}),V?(0,t.jsxs)(eC,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:x,value:D,onChange:e=>H(e.target.value),disabled:v,form:b,children:[void 0===D?(0,t.jsx)("option",{value:""}):null,Array.from(U)]},_):null]})})};z.displayName=R;var V="SelectTrigger",U=r.forwardRef((e,s)=>{let{__scopeSelect:a,disabled:n=!1,...o}=e,d=L(a),c=D(V,a),u=c.disabled||n,p=(0,i.useComposedRefs)(s,c.onTriggerChange),m=P(a),h=r.useRef("touch"),[v,g,y]=eR(e=>{let t=m().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),s=eI(t,e,r);void 0!==s&&c.onValueChange(s.value)}),b=e=>{u||(c.onOpenChange(!0),y()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(f.Anchor,{asChild:!0,...d,children:(0,t.jsx)(x.Primitive.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":ek(c.value)?"":void 0,...o,ref:p,onClick:(0,l.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==h.current&&b(e)}),onPointerDown:(0,l.composeEventHandlers)(o.onPointerDown,e=>{h.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:(0,l.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==v.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),(!t||" "!==e.key)&&C.includes(e.key)&&(b(),e.preventDefault())})})})});U.displayName=V;var O="SelectValue",_=r.forwardRef((e,r)=>{let{__scopeSelect:s,className:a,style:l,children:n,placeholder:o="",...d}=e,c=D(O,s),{onValueNodeHasChildrenChange:u}=c,p=void 0!==n,m=(0,i.useComposedRefs)(r,c.onValueNodeChange);return(0,b.useLayoutEffect)(()=>{u(p)},[u,p]),(0,t.jsx)(x.Primitive.span,{...d,ref:m,style:{pointerEvents:"none"},children:ek(c.value)?(0,t.jsx)(t.Fragment,{children:o}):n})});_.displayName=O;var F=r.forwardRef((e,r)=>{let{__scopeSelect:s,children:a,...l}=e;return(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...l,ref:r,children:a||"▼"})});F.displayName="SelectIcon";var K=e=>(0,t.jsx)(h.Portal,{asChild:!0,...e});K.displayName="SelectPortal";var G="SelectContent",W=r.forwardRef((e,a)=>{let l=D(G,e.__scopeSelect),[n,i]=r.useState();return((0,b.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),l.open)?(0,t.jsx)(Y,{...e,ref:a}):n?s.createPortal((0,t.jsx)($,{scope:e.__scopeSelect,children:(0,t.jsx)(I.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),n):null});W.displayName=G;var[$,q]=M(G),X=(0,v.createSlot)("SelectContent.RemoveScroll"),Y=r.forwardRef((e,s)=>{let{__scopeSelect:a,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:h,align:x,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:w,hideWhenDetached:j,avoidCollisions:C,...k}=e,R=D(G,a),[I,E]=r.useState(null),[M,T]=r.useState(null),L=(0,i.useComposedRefs)(s,e=>E(e)),[A,B]=r.useState(null),[H,z]=r.useState(null),V=P(a),[U,O]=r.useState(!1),_=r.useRef(!1);r.useEffect(()=>{if(I)return(0,S.hideOthers)(I)},[I]),(0,u.useFocusGuards)();let F=r.useCallback(e=>{let[t,...r]=V().map(e=>e.ref.current),[s]=r.slice(-1),a=document.activeElement;for(let r of e)if(r===a||(r?.scrollIntoView({block:"nearest"}),r===t&&M&&(M.scrollTop=0),r===s&&M&&(M.scrollTop=M.scrollHeight),r?.focus(),document.activeElement!==a))return},[V,M]),K=r.useCallback(()=>F([A,I]),[F,A,I]);r.useEffect(()=>{U&&K()},[U,K]);let{onOpenChange:W,triggerPointerDownPosRef:q}=R;r.useEffect(()=>{if(I){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(q.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():I.contains(r.target)||W(!1),document.removeEventListener("pointermove",t),q.current=null};return null!==q.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[I,W,q]),r.useEffect(()=>{let e=()=>W(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[W]);let[Y,Q]=eR(e=>{let t=V().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),s=eI(t,e,r);s&&setTimeout(()=>s.ref.current.focus())}),ee=r.useCallback((e,t,r)=>{let s=!_.current&&!r;(void 0!==R.value&&R.value===t||s)&&(B(e),s&&(_.current=!0))},[R.value]),et=r.useCallback(()=>I?.focus(),[I]),er=r.useCallback((e,t,r)=>{let s=!_.current&&!r;(void 0!==R.value&&R.value===t||s)&&z(e)},[R.value]),es="popper"===n?J:Z,ea=es===J?{side:f,sideOffset:h,align:x,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:w,hideWhenDetached:j,avoidCollisions:C}:{};return(0,t.jsx)($,{scope:a,content:I,viewport:M,onViewportChange:T,itemRefCallback:ee,selectedItem:A,onItemLeave:et,itemTextRefCallback:er,focusSelectedItem:K,selectedItemText:H,position:n,isPositioned:U,searchRef:Y,children:(0,t.jsx)(N.RemoveScroll,{as:X,allowPinchZoom:!0,children:(0,t.jsx)(p.FocusScope,{asChild:!0,trapped:R.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,l.composeEventHandlers)(o,e=>{R.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(c.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:(0,t.jsx)(es,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...k,...ea,onPlaced:()=>O(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:(0,l.composeEventHandlers)(k.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=V().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 r=e.target,s=t.indexOf(r);t=t.slice(s+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});Y.displayName="SelectContentImpl";var Z=r.forwardRef((e,s)=>{let{__scopeSelect:l,onPlaced:n,...o}=e,d=D(G,l),c=q(G,l),[u,p]=r.useState(null),[m,f]=r.useState(null),h=(0,i.useComposedRefs)(s,e=>f(e)),v=P(l),g=r.useRef(!1),y=r.useRef(!0),{viewport:w,selectedItem:j,selectedItemText:S,focusSelectedItem:N}=c,C=r.useCallback(()=>{if(d.trigger&&d.valueNode&&u&&m&&w&&j&&S){let e=d.trigger.getBoundingClientRect(),t=m.getBoundingClientRect(),r=d.valueNode.getBoundingClientRect(),s=S.getBoundingClientRect();if("rtl"!==d.dir){let l=s.left-t.left,n=r.left-l,i=e.left-n,o=e.width+i,d=Math.max(o,t.width),c=window.innerWidth-10,p=(0,a.clamp)(n,[10,Math.max(10,c-d)]);u.style.minWidth=o+"px",u.style.left=p+"px"}else{let l=t.right-s.right,n=window.innerWidth-r.right-l,i=window.innerWidth-e.right-n,o=e.width+i,d=Math.max(o,t.width),c=window.innerWidth-10,p=(0,a.clamp)(n,[10,Math.max(10,c-d)]);u.style.minWidth=o+"px",u.style.right=p+"px"}let l=v(),i=window.innerHeight-20,o=w.scrollHeight,c=window.getComputedStyle(m),p=parseInt(c.borderTopWidth,10),f=parseInt(c.paddingTop,10),h=parseInt(c.borderBottomWidth,10),x=p+f+o+parseInt(c.paddingBottom,10)+h,y=Math.min(5*j.offsetHeight,x),b=window.getComputedStyle(w),N=parseInt(b.paddingTop,10),C=parseInt(b.paddingBottom,10),k=e.top+e.height/2-10,R=j.offsetHeight/2,I=p+f+(j.offsetTop+R);if(I<=k){let e=l.length>0&&j===l[l.length-1].ref.current;u.style.bottom="0px";let t=Math.max(i-k,R+(e?C:0)+(m.clientHeight-w.offsetTop-w.offsetHeight)+h);u.style.height=I+t+"px"}else{let e=l.length>0&&j===l[0].ref.current;u.style.top="0px";let t=Math.max(k,p+w.offsetTop+(e?N:0)+R);u.style.height=t+(x-I)+"px",w.scrollTop=I-k+w.offsetTop}u.style.margin="10px 0",u.style.minHeight=y+"px",u.style.maxHeight=i+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[v,d.trigger,d.valueNode,u,m,w,j,S,d.dir,n]);(0,b.useLayoutEffect)(()=>C(),[C]);let[k,R]=r.useState();(0,b.useLayoutEffect)(()=>{m&&R(window.getComputedStyle(m).zIndex)},[m]);let I=r.useCallback(e=>{e&&!0===y.current&&(C(),N?.(),y.current=!1)},[C,N]);return(0,t.jsx)(Q,{scope:l,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:I,children:(0,t.jsx)("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,t.jsx)(x.Primitive.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Z.displayName="SelectItemAlignedPosition";var J=r.forwardRef((e,r)=>{let{__scopeSelect:s,align:a="start",collisionPadding:l=10,...n}=e,i=L(s);return(0,t.jsx)(f.Content,{...i,...n,ref:r,align:a,collisionPadding:l,style:{boxSizing:"border-box",...n.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)"}})});J.displayName="SelectPopperPosition";var[Q,ee]=M(G,{}),et="SelectViewport",er=r.forwardRef((e,s)=>{let{__scopeSelect:a,nonce:n,...o}=e,d=q(et,a),c=ee(et,a),u=(0,i.useComposedRefs)(s,d.onViewportChange),p=r.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:n}),(0,t.jsx)(I.Slot,{scope:a,children:(0,t.jsx)(x.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,l.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:s}=c;if(s?.current&&r){let e=Math.abs(p.current-t.scrollTop);if(e>0){let s=window.innerHeight-20,a=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(a<s){let l=a+e,n=Math.min(s,l),i=l-n;r.style.height=n+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});er.displayName=et;var es="SelectGroup",[ea,el]=M(es),en=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=(0,m.useId)();return(0,t.jsx)(ea,{scope:s,id:l,children:(0,t.jsx)(x.Primitive.div,{role:"group","aria-labelledby":l,...a,ref:r})})});en.displayName=es;var ei="SelectLabel",eo=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=el(ei,s);return(0,t.jsx)(x.Primitive.div,{id:l.id,...a,ref:r})});eo.displayName=ei;var ed="SelectItem",[ec,eu]=M(ed),ep=r.forwardRef((e,s)=>{let{__scopeSelect:a,value:n,disabled:o=!1,textValue:d,...c}=e,u=D(ed,a),p=q(ed,a),f=u.value===n,[h,v]=r.useState(d??""),[g,y]=r.useState(!1),b=(0,i.useComposedRefs)(s,e=>p.itemRefCallback?.(e,n,o)),w=(0,m.useId)(),j=r.useRef("touch"),S=()=>{o||(u.onValueChange(n),u.onOpenChange(!1))};if(""===n)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)(ec,{scope:a,value:n,disabled:o,textId:w,isSelected:f,onItemTextChange:r.useCallback(e=>{v(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(I.ItemSlot,{scope:a,value:n,disabled:o,textValue:h,children:(0,t.jsx)(x.Primitive.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:b,onFocus:(0,l.composeEventHandlers)(c.onFocus,()=>y(!0)),onBlur:(0,l.composeEventHandlers)(c.onBlur,()=>y(!1)),onClick:(0,l.composeEventHandlers)(c.onClick,()=>{"mouse"!==j.current&&S()}),onPointerUp:(0,l.composeEventHandlers)(c.onPointerUp,()=>{"mouse"===j.current&&S()}),onPointerDown:(0,l.composeEventHandlers)(c.onPointerDown,e=>{j.current=e.pointerType}),onPointerMove:(0,l.composeEventHandlers)(c.onPointerMove,e=>{j.current=e.pointerType,o?p.onItemLeave?.():"mouse"===j.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,l.composeEventHandlers)(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:(0,l.composeEventHandlers)(c.onKeyDown,e=>{(p.searchRef?.current===""||" "!==e.key)&&(k.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})});ep.displayName=ed;var em="SelectItemText",ef=r.forwardRef((e,a)=>{let{__scopeSelect:l,className:n,style:o,...d}=e,c=D(em,l),u=q(em,l),p=eu(em,l),m=H(em,l),[f,h]=r.useState(null),v=(0,i.useComposedRefs)(a,e=>h(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),g=f?.textContent,y=r.useMemo(()=>(0,t.jsx)("option",{value:p.value,disabled:p.disabled,children:g},p.value),[p.disabled,p.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:j}=m;return(0,b.useLayoutEffect)(()=>(w(y),()=>j(y)),[w,j,y]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Primitive.span,{id:p.textId,...d,ref:v}),p.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(d.children,c.valueNode):null]})});ef.displayName=em;var eh="SelectItemIndicator",ex=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e;return eu(eh,s).isSelected?(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...a,ref:r}):null});ex.displayName=eh;var ev="SelectScrollUpButton",eg=r.forwardRef((e,s)=>{let a=q(ev,e.__scopeSelect),l=ee(ev,e.__scopeSelect),[n,o]=r.useState(!1),d=(0,i.useComposedRefs)(s,l.onScrollButtonChange);return(0,b.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){o(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),n?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eg.displayName=ev;var ey="SelectScrollDownButton",eb=r.forwardRef((e,s)=>{let a=q(ey,e.__scopeSelect),l=ee(ey,e.__scopeSelect),[n,o]=r.useState(!1),d=(0,i.useComposedRefs)(s,l.onScrollButtonChange);return(0,b.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),n?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eb.displayName=ey;var ew=r.forwardRef((e,s)=>{let{__scopeSelect:a,onAutoScroll:n,...i}=e,o=q("SelectScrollButton",a),d=r.useRef(null),c=P(a),u=r.useCallback(()=>{null!==d.current&&(window.clearInterval(d.current),d.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),(0,b.useLayoutEffect)(()=>{let e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...i,ref:s,style:{flexShrink:0,...i.style},onPointerDown:(0,l.composeEventHandlers)(i.onPointerDown,()=>{null===d.current&&(d.current=window.setInterval(n,50))}),onPointerMove:(0,l.composeEventHandlers)(i.onPointerMove,()=>{o.onItemLeave?.(),null===d.current&&(d.current=window.setInterval(n,50))}),onPointerLeave:(0,l.composeEventHandlers)(i.onPointerLeave,()=>{u()})})}),ej=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e;return(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...a,ref:r})});ej.displayName="SelectSeparator";var eS="SelectArrow",eN=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=L(s),n=D(eS,s),i=q(eS,s);return n.open&&"popper"===i.position?(0,t.jsx)(f.Arrow,{...l,...a,ref:r}):null});eN.displayName=eS;var eC=r.forwardRef(({__scopeSelect:e,value:s,...a},l)=>{let n=r.useRef(null),o=(0,i.useComposedRefs)(l,n),d=(0,w.usePrevious)(s);return r.useEffect(()=>{let e=n.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(d!==s&&t){let r=new Event("change",{bubbles:!0});t.call(e,s),e.dispatchEvent(r)}},[d,s]),(0,t.jsx)(x.Primitive.select,{...a,style:{...j.VISUALLY_HIDDEN_STYLES,...a.style},ref:o,defaultValue:s})});function ek(e){return""===e||void 0===e}function eR(e){let t=(0,g.useCallbackRef)(e),s=r.useRef(""),a=r.useRef(0),l=r.useCallback(e=>{let r=s.current+e;t(r),function e(t){s.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),n=r.useCallback(()=>{s.current="",window.clearTimeout(a.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,l,n]}function eI(e,t,r){var s,a;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,n=r?e.indexOf(r):-1,i=(s=e,a=Math.max(n,0),s.map((e,t)=>s[(a+t)%s.length]));1===l.length&&(i=i.filter(e=>e!==r));let o=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return o!==r?o:void 0}eC.displayName="SelectBubbleInput",e.s(["Arrow",()=>eN,"Content",()=>W,"Group",()=>en,"Icon",()=>F,"Item",()=>ep,"ItemIndicator",()=>ex,"ItemText",()=>ef,"Label",()=>eo,"Portal",()=>K,"Root",()=>z,"ScrollDownButton",()=>eb,"ScrollUpButton",()=>eg,"Select",()=>z,"SelectArrow",()=>eN,"SelectContent",()=>W,"SelectGroup",()=>en,"SelectIcon",()=>F,"SelectItem",()=>ep,"SelectItemIndicator",()=>ex,"SelectItemText",()=>ef,"SelectLabel",()=>eo,"SelectPortal",()=>K,"SelectScrollDownButton",()=>eb,"SelectScrollUpButton",()=>eg,"SelectSeparator",()=>ej,"SelectTrigger",()=>U,"SelectValue",()=>_,"SelectViewport",()=>er,"Separator",()=>ej,"Trigger",()=>U,"Value",()=>_,"Viewport",()=>er,"createSelectScope",()=>T],483830);var eP=e.i(483830),eP=eP,eE=e.i(723925),eM=e.i(99105),eT=e.i(48829),eL=e.i(131777);let eA=eP.Root;eP.Group;let eD=eP.Value,eB=r.forwardRef(({className:e,children:r,...s},a)=>(0,t.jsxs)(eP.Trigger,{ref:a,className:(0,eL.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),...s,children:[r,(0,t.jsx)(eP.Icon,{asChild:!0,children:(0,t.jsx)(eM.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));eB.displayName=eP.Trigger.displayName;let eH=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.ScrollUpButton,{ref:s,className:(0,eL.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eT.ChevronUp,{className:"h-4 w-4"})}));eH.displayName=eP.ScrollUpButton.displayName;let ez=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.ScrollDownButton,{ref:s,className:(0,eL.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eM.ChevronDown,{className:"h-4 w-4"})}));ez.displayName=eP.ScrollDownButton.displayName;let eV=r.forwardRef(({className:e,children:r,position:s="popper",...a},l)=>(0,t.jsx)(eP.Portal,{children:(0,t.jsxs)(eP.Content,{ref:l,className:(0,eL.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"===s&&"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:s,...a,children:[(0,t.jsx)(eH,{}),(0,t.jsx)(eP.Viewport,{className:(0,eL.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,t.jsx)(ez,{})]})}));eV.displayName=eP.Content.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.Label,{ref:s,className:(0,eL.cn)("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=eP.Label.displayName;let eU=r.forwardRef(({className:e,children:r,...s},a)=>(0,t.jsxs)(eP.Item,{ref:a,className:(0,eL.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[(0,t.jsx)("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eP.ItemIndicator,{children:(0,t.jsx)(eE.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eP.ItemText,{children:r})]}));eU.displayName=eP.Item.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.Separator,{ref:s,className:(0,eL.cn)("bg-muted -mx-1 my-1 h-px",e),...r})).displayName=eP.Separator.displayName,e.s(["Select",()=>eA,"SelectContent",()=>eV,"SelectItem",()=>eU,"SelectTrigger",()=>eB,"SelectValue",()=>eD],547373)},938518,e=>{"use strict";let t=(0,e.i(903645).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],938518)},204461,264219,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(735364),a=e.i(81846),l=e.i(317406),n=e.i(508893);let i=(0,n.createServerReference)("605529d2f48506422555c1d76e4bdc88812ec524af",n.callServer,void 0,n.findSourceMapURL,"updatePmProject");e.s(["updatePmProject",()=>i],264219);let o=[{value:l.EstimateType.None,label:"None",description:"No estimates"},{value:l.EstimateType.Category,label:"T-Shirt Sizes",description:"XS, S, M, L, XL"},{value:l.EstimateType.Points,label:"Fibonacci Points",description:"1, 2, 3, 5, 8, 13, 21"}];function d({projectId:e,currentEstimateType:l,onEstimateTypeChange:n,className:d}){let[c,u]=(0,r.useState)(l),[p,m]=(0,r.useState)(!1),f=async t=>{t!==c&&(u(t),m(!0),await i(e,{estimateType:t}),m(!1),n?.(t))};return(0,t.jsxs)("div",{"data-testid":"estimate-settings",className:d,children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium",children:"Estimate System"}),p?(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:"Saving..."}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:o.map(e=>(0,t.jsx)(s.Button,{variant:c===e.value?"default":"outline",size:"sm",className:"h-auto w-full justify-start px-3 py-2 text-left",onClick:()=>f(e.value),"data-testid":`estimate-option-${e.value}`,children:(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground ml-2 text-[10px]",children:e.description})]}),c===e.value?(0,t.jsx)(a.Badge,{variant:"secondary",className:"text-[10px]",children:"Active"}):null]})},e.value))})]})}e.s(["EstimateSettings",()=>d],204461)},649749,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(711434),a=e.i(938518),l=e.i(939200),n=e.i(267669),i=e.i(3214),o=e.i(131777),d=e.i(735364),c=e.i(698127),u=e.i(81846),p=e.i(204461),m=e.i(141957),f=e.i(547373),h=e.i(317406);let x={Admin:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",Member:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300",Guest:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-300"};function v({projectId:e,members:s,currentUserId:a,onAddMember:l,onRemoveMember:n,onUpdateRole:i}){let[o,p]=(0,r.useState)(s),[v,g]=(0,r.useState)(""),[y,b]=(0,r.useState)(h.ProjectRole.Member),[w,j]=(0,r.useState)(null),[S,N]=(0,r.useState)(!1),C=o.some(e=>e.userId===a&&e.role===h.ProjectRole.Admin),k=(0,r.useCallback)(async()=>{if(!v.trim())return;N(!0),j(null);let t=await l({projectId:e,userId:v.trim(),role:y,actorId:a});t.error?j(t.error):t.member&&(p(e=>[...e,t.member]),g(""),b(h.ProjectRole.Member)),N(!1)},[v,y,e,a,l]),R=(0,r.useCallback)(async t=>{j(null);let r=await n({projectId:e,userId:t,actorId:a});r.error?j(r.error):p(e=>e.filter(e=>e.userId!==t))},[e,a,n]),I=(0,r.useCallback)(async(t,r)=>{j(null);let s=await i({projectId:e,userId:t,newRole:r,actorId:a});s.error?j(s.error):p(e=>e.map(e=>e.userId===t?{...e,role:r}:e))},[e,a,i]);return(0,t.jsxs)("div",{"data-testid":"project-members-panel",className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:"Project Members"}),w?(0,t.jsx)("div",{"data-testid":"members-error",className:"rounded border border-red-200 bg-red-50 p-3 text-sm text-red-800 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:w}):null,(0,t.jsxs)("div",{className:"divide-y rounded border",children:[o.map(e=>(0,t.jsxs)("div",{"data-testid":`member-row-${e.userId}`,className:"flex items-center justify-between p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.userId}),(0,t.jsx)(u.Badge,{className:x[e.role]??"",variant:"secondary",children:e.role})]}),C&&e.userId!==a?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(f.Select,{value:e.role,onValueChange:t=>I(e.userId,t),children:[(0,t.jsx)(f.SelectTrigger,{className:"w-[120px]",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsxs)(f.SelectContent,{children:[(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Admin,children:"Admin"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Member,children:"Member"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Guest,children:"Guest"})]})]}),(0,t.jsx)(d.Button,{variant:"destructive",size:"sm",onClick:()=>R(e.userId),children:"Remove"})]}):null]},e.id)),0===o.length&&(0,t.jsx)("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No members in this project."})]}),C?(0,t.jsxs)("div",{"data-testid":"add-member-form",className:"flex items-end gap-3 rounded border p-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(m.Label,{htmlFor:"new-user-id",children:"User ID"}),(0,t.jsx)(c.Input,{id:"new-user-id",value:v,onChange:e=>g(e.target.value),placeholder:"Enter user ID",disabled:S})]}),(0,t.jsxs)("div",{className:"w-[140px]",children:[(0,t.jsx)(m.Label,{htmlFor:"new-role",children:"Role"}),(0,t.jsxs)(f.Select,{value:y,onValueChange:e=>b(e),children:[(0,t.jsx)(f.SelectTrigger,{id:"new-role",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsxs)(f.SelectContent,{children:[(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Admin,children:"Admin"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Member,children:"Member"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Guest,children:"Guest"})]})]})]}),(0,t.jsx)(d.Button,{onClick:k,disabled:S||!v.trim(),children:S?"Adding...":"Add Member"})]}):null]})}var g=e.i(264219),y=e.i(508893);let b=(0,y.createServerReference)("40a15e51802eae21d9864f76aa01950526e0ffd76d",y.callServer,void 0,y.findSourceMapURL,"deletePmProject"),w=(0,y.createServerReference)("40e7034d1bb8cbf13bae7f63df839fff2c890a4304",y.callServer,void 0,y.findSourceMapURL,"createWorkItemState"),j=(0,y.createServerReference)("404dc155e90184476d9ef40f0998f53bde3dc2394b",y.callServer,void 0,y.findSourceMapURL,"deleteWorkItemState"),S=(0,y.createServerReference)("404a92615256abecfdb792b74c7115309aadcd262a",y.callServer,void 0,y.findSourceMapURL,"createLabel"),N=(0,y.createServerReference)("4008067d37d7cc22142a1de7f057ad7a5d1966ad70",y.callServer,void 0,y.findSourceMapURL,"deleteLabel"),C=(0,y.createServerReference)("40d8c679dad0b3db1c9b456c1752711f75b782779b",y.callServer,void 0,y.findSourceMapURL,"addProjectMember"),k=(0,y.createServerReference)("404f6568228d2a98e9c75d65289541ce37ce5fac32",y.callServer,void 0,y.findSourceMapURL,"removeProjectMember"),R=(0,y.createServerReference)("40d35784c6e8c768fff68b2ec49c2fee17bb1e9607",y.callServer,void 0,y.findSourceMapURL,"updateProjectMemberRole"),I={backlog:"bg-gray-400",unstarted:"bg-blue-400",started:"bg-yellow-400",completed:"bg-green-400",cancelled:"bg-red-400"};function P({project:e,states:m,labels:f,members:h=[],className:x}){let y=(0,s.useRouter)(),[P,E]=(0,r.useState)(e.name),[M,T]=(0,r.useState)(e.description??""),[L,A]=(0,r.useState)(!1),[D,B]=(0,r.useState)(m),[H,z]=(0,r.useState)(f),[V,U]=(0,r.useState)(""),[O,_]=(0,r.useState)(""),[F,K]=(0,r.useState)("#6366f1"),[G,W]=(0,r.useState)(""),$=(0,r.useCallback)(async()=>{A(!0),await (0,g.updatePmProject)(e.id,{name:P.trim(),description:M.trim()||void 0}),A(!1)},[e.id,P,M]),q=(0,r.useCallback)(async()=>{if(!V.trim())return;let t=await w({projectId:e.id,name:V.trim(),color:"#6366f1",stateGroup:"unstarted"});t.state&&(B(e=>[...e,t.state]),U(""))},[e.id,V]),X=(0,r.useCallback)(async e=>{(await j(e)).error||B(t=>t.filter(t=>t.id!==e))},[]),Y=(0,r.useCallback)(async()=>{if(!O.trim())return;let t=await S({projectId:e.id,name:O.trim(),color:F});t.label&&(z(e=>[...e,t.label]),_(""))},[e.id,O,F]),Z=(0,r.useCallback)(async e=>{(await N(e)).error||z(t=>t.filter(t=>t.id!==e))},[]),J=(0,r.useCallback)(async()=>{G!==e.name||(await b(e.id)).error||y.push("/projects")},[e.id,e.name,G,y]);return(0,t.jsxs)("div",{"data-testid":"project-settings",className:(0,o.cn)("max-w-2xl space-y-8",x),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>y.push(`/projects/${e.slug}`),"data-testid":"back-to-project",children:(0,t.jsx)(a.ArrowLeft,{className:"h-4 w-4"})}),(0,t.jsx)(l.Settings,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Project Settings"}),(0,t.jsx)(u.Badge,{variant:"outline",className:"text-[10px]",children:e.identifierPrefix})]}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"general-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"General"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:"Project Name"}),(0,t.jsx)(c.Input,{value:P,onChange:e=>E(e.target.value),className:"h-8 text-xs","data-testid":"project-name-input"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:"Description"}),(0,t.jsx)(c.Input,{value:M,onChange:e=>T(e.target.value),placeholder:"Optional description",className:"h-8 text-xs","data-testid":"project-description-input"})]}),(0,t.jsx)(d.Button,{size:"sm",className:"h-7 text-xs",onClick:$,disabled:L||!P.trim(),"data-testid":"save-general-btn",children:L?"Saving...":"Save Changes"})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)("section",{"data-testid":"estimate-settings-section",children:(0,t.jsx)(p.EstimateSettings,{projectId:e.id,currentEstimateType:e.estimateType})}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"states-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"Work Item States"}),(0,t.jsx)("div",{className:"space-y-1",children:D.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-sm px-2 py-1 text-xs","data-testid":`state-${e.id}`,children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1",children:e.name}),(0,t.jsx)(u.Badge,{variant:"outline",className:(0,o.cn)("text-[9px]",I[e.stateGroup]??"bg-gray-400"),children:e.stateGroup}),e.isDefault?(0,t.jsx)(u.Badge,{variant:"secondary",className:"text-[9px]",children:"default"}):(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"text-destructive hidden h-5 w-5 p-0 group-hover:flex",onClick:()=>X(e.id),title:"Delete state",children:(0,t.jsx)(n.Trash2,{className:"h-3 w-3"})})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:V,onChange:e=>U(e.target.value),placeholder:"New state name",className:"h-7 flex-1 text-xs","data-testid":"new-state-input",onKeyDown:e=>{"Enter"===e.key&&q()}}),(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:q,disabled:!V.trim(),"data-testid":"add-state-btn",children:[(0,t.jsx)(i.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"labels-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"Labels"}),0===H.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No labels yet"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-1 rounded-full border px-2 py-0.5","data-testid":`label-${e.id}`,children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"text-[10px]",children:e.name}),(0,t.jsx)("button",{type:"button",className:"text-destructive ml-0.5 hidden text-xs group-hover:inline",onClick:()=>Z(e.id),title:"Delete label",children:"×"})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"color",value:F,onChange:e=>K(e.target.value),className:"h-7 w-7 cursor-pointer rounded border-0 p-0","data-testid":"new-label-color"}),(0,t.jsx)(c.Input,{value:O,onChange:e=>_(e.target.value),placeholder:"New label name",className:"h-7 flex-1 text-xs","data-testid":"new-label-input",onKeyDown:e=>{"Enter"===e.key&&Y()}}),(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:Y,disabled:!O.trim(),"data-testid":"add-label-btn",children:[(0,t.jsx)(i.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)("section",{"data-testid":"members-settings",children:(0,t.jsx)(v,{projectId:e.id,members:h,currentUserId:"",onAddMember:C,onRemoveMember:k,onUpdateRole:R})}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"danger-zone",children:[(0,t.jsx)("h2",{className:"text-destructive text-xs font-semibold tracking-wide uppercase",children:"Danger Zone"}),(0,t.jsxs)("div",{className:"border-destructive/20 rounded-md border p-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs",children:"Permanently delete this project and all its work items, cycles, modules, and pages."}),(0,t.jsxs)("p",{className:"text-muted-foreground mb-2 text-[10px]",children:["Type ",(0,t.jsx)("strong",{children:e.name})," to confirm."]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:G,onChange:e=>W(e.target.value),placeholder:e.name,className:"h-7 flex-1 text-xs","data-testid":"delete-confirm-input"}),(0,t.jsxs)(d.Button,{variant:"destructive",size:"sm",className:"h-7 text-xs",onClick:J,disabled:G!==e.name,"data-testid":"delete-project-btn",children:[(0,t.jsx)(n.Trash2,{className:"mr-1 h-3 w-3"}),"Delete Project"]})]})]})]})]})}e.s(["ProjectSettingsClient",()=>P],649749)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,267669,e=>{"use strict";let t=(0,e.i(903645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],267669)},48829,e=>{"use strict";let t=(0,e.i(903645).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>t],48829)},81846,e=>{"use strict";var t=e.i(679606),r=e.i(294237),s=e.i(131777);let a=(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)(a({variant:r}),e),...l})}e.s(["Badge",()=>l])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},787342,e=>{"use strict";var t=e.i(152155),r=e.i(922528),s=e.i(205978),a=e.i(786874),l=e.i(679606);function n(e){let n=e+"CollectionProvider",[i,o]=(0,r.createContextScope)(n),[d,c]=i(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,a=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(d,{scope:r,itemMap:n,collectionRef:a,children:s})};u.displayName=n;let p=e+"CollectionSlot",m=(0,a.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:a}=e,n=c(p,r),i=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(m,{ref:i,children:a})});f.displayName=p;let h=e+"CollectionItemSlot",x="data-radix-collection-item",v=(0,a.createSlot)(h),g=t.default.forwardRef((e,r)=>{let{scope:a,children:n,...i}=e,o=t.default.useRef(null),d=(0,s.useComposedRefs)(r,o),u=c(h,a);return t.default.useEffect(()=>(u.itemMap.set(o,{ref:o,...i}),()=>void u.itemMap.delete(o))),(0,l.jsx)(v,{...{[x]:""},ref:d,children:n})});return g.displayName=h,[{Provider:u,Slot:f,ItemSlot:g},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(`[${x}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},o]}var i=new WeakMap;function o(e,t){var r,s;let a,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let i=(r=e,s=t,a=r.length,(n=(l=d(s))>=0?l:a+l)<0||n>=a?-1:n);return -1===i?void 0:e[i]}function d(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],i.set(this,!0)}set(e,t){return i.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,a=this.has(t),l=this.#e.length,n=d(e),i=n>=0?n:l+n,o=i<0||i>=l?-1:i;if(o===this.size||a&&o===this.size-1||-1===o)return this.set(t,r),this;let c=this.size+ +!a;n<0&&i++;let u=[...this.#e],p=!1;for(let e=i;e<c;e++)if(i===e){let l=u[e];u[e]===t&&(l=u[e+1]),a&&this.delete(t),s=this.get(l),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],a=s;s=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,s){let a=new e(this);return a.insert(t,r,s),a}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=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 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=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&s.push(e),a++;return new e(s)}map(t,r){let s=[],a=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(s)}reduce(...e){let[t,r]=e,s=0,a=r??this.at(0);for(let r of this)a=0===s&&1===e.length?r:Reflect.apply(t,this,[a,r,s,this]),s++;return a}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);s=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[s,a,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,a=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;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])},141957,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(287620),a=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())}}));a.displayName="Label",e.s(["Label",()=>a,"Root",()=>a],127572);var l=e.i(127572),l=l,n=e.i(294237),i=e.i(131777);let o=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,i.cn)(o(),e),...r}));d.displayName=l.Root.displayName,e.s(["Label",()=>d],141957)},23405,e=>{"use strict";var t=e.i(152155);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])},547373,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(685446),a=e.i(527069),l=e.i(291967),n=e.i(787342),i=e.i(205978),o=e.i(922528),d=e.i(566033),c=e.i(253532),u=e.i(341687),p=e.i(556720),m=e.i(713123),f=e.i(252740),h=e.i(339979),x=e.i(287620),v=e.i(786874),g=e.i(929297),b=e.i(936589),y=e.i(305192),w=e.i(23405),j=e.i(201693),S=e.i(73772),N=e.i(813044),C=[" ","Enter","ArrowUp","ArrowDown"],k=[" ","Enter"],R="Select",[I,P,E]=(0,n.createCollection)(R),[M,T]=(0,o.createContextScope)(R,[E,f.createPopperScope]),L=(0,f.createPopperScope)(),[A,D]=M(R),[B,H]=M(R),z=e=>{let{__scopeSelect:s,children:a,open:l,defaultOpen:n,onOpenChange:i,value:o,defaultValue:c,onValueChange:u,dir:p,name:h,autoComplete:x,disabled:v,required:g,form:y}=e,w=L(s),[j,S]=r.useState(null),[N,C]=r.useState(null),[k,P]=r.useState(!1),E=(0,d.useDirection)(p),[M,T]=(0,b.useControllableState)({prop:l,defaultProp:n??!1,onChange:i,caller:R}),[D,H]=(0,b.useControllableState)({prop:o,defaultProp:c,onChange:u,caller:R}),z=r.useRef(null),V=!j||y||!!j.closest("form"),[U,O]=r.useState(new Set),_=Array.from(U).map(e=>e.props.value).join(";");return(0,t.jsx)(f.Root,{...w,children:(0,t.jsxs)(A,{required:g,scope:s,trigger:j,onTriggerChange:S,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:k,onValueNodeHasChildrenChange:P,contentId:(0,m.useId)(),value:D,onValueChange:H,open:M,onOpenChange:T,dir:E,triggerPointerDownPosRef:z,disabled:v,children:[(0,t.jsx)(I.Provider,{scope:s,children:(0,t.jsx)(B,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{O(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{O(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:a})}),V?(0,t.jsxs)(eC,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:x,value:D,onChange:e=>H(e.target.value),disabled:v,form:y,children:[void 0===D?(0,t.jsx)("option",{value:""}):null,Array.from(U)]},_):null]})})};z.displayName=R;var V="SelectTrigger",U=r.forwardRef((e,s)=>{let{__scopeSelect:a,disabled:n=!1,...o}=e,d=L(a),c=D(V,a),u=c.disabled||n,p=(0,i.useComposedRefs)(s,c.onTriggerChange),m=P(a),h=r.useRef("touch"),[v,g,b]=eR(e=>{let t=m().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),s=eI(t,e,r);void 0!==s&&c.onValueChange(s.value)}),y=e=>{u||(c.onOpenChange(!0),b()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(f.Anchor,{asChild:!0,...d,children:(0,t.jsx)(x.Primitive.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":ek(c.value)?"":void 0,...o,ref:p,onClick:(0,l.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==h.current&&y(e)}),onPointerDown:(0,l.composeEventHandlers)(o.onPointerDown,e=>{h.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(y(e),e.preventDefault())}),onKeyDown:(0,l.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==v.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),(!t||" "!==e.key)&&C.includes(e.key)&&(y(),e.preventDefault())})})})});U.displayName=V;var O="SelectValue",_=r.forwardRef((e,r)=>{let{__scopeSelect:s,className:a,style:l,children:n,placeholder:o="",...d}=e,c=D(O,s),{onValueNodeHasChildrenChange:u}=c,p=void 0!==n,m=(0,i.useComposedRefs)(r,c.onValueNodeChange);return(0,y.useLayoutEffect)(()=>{u(p)},[u,p]),(0,t.jsx)(x.Primitive.span,{...d,ref:m,style:{pointerEvents:"none"},children:ek(c.value)?(0,t.jsx)(t.Fragment,{children:o}):n})});_.displayName=O;var F=r.forwardRef((e,r)=>{let{__scopeSelect:s,children:a,...l}=e;return(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...l,ref:r,children:a||"▼"})});F.displayName="SelectIcon";var K=e=>(0,t.jsx)(h.Portal,{asChild:!0,...e});K.displayName="SelectPortal";var G="SelectContent",W=r.forwardRef((e,a)=>{let l=D(G,e.__scopeSelect),[n,i]=r.useState();return((0,y.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),l.open)?(0,t.jsx)(Y,{...e,ref:a}):n?s.createPortal((0,t.jsx)($,{scope:e.__scopeSelect,children:(0,t.jsx)(I.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),n):null});W.displayName=G;var[$,q]=M(G),X=(0,v.createSlot)("SelectContent.RemoveScroll"),Y=r.forwardRef((e,s)=>{let{__scopeSelect:a,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:h,align:x,alignOffset:v,arrowPadding:g,collisionBoundary:b,collisionPadding:y,sticky:w,hideWhenDetached:j,avoidCollisions:C,...k}=e,R=D(G,a),[I,E]=r.useState(null),[M,T]=r.useState(null),L=(0,i.useComposedRefs)(s,e=>E(e)),[A,B]=r.useState(null),[H,z]=r.useState(null),V=P(a),[U,O]=r.useState(!1),_=r.useRef(!1);r.useEffect(()=>{if(I)return(0,S.hideOthers)(I)},[I]),(0,u.useFocusGuards)();let F=r.useCallback(e=>{let[t,...r]=V().map(e=>e.ref.current),[s]=r.slice(-1),a=document.activeElement;for(let r of e)if(r===a||(r?.scrollIntoView({block:"nearest"}),r===t&&M&&(M.scrollTop=0),r===s&&M&&(M.scrollTop=M.scrollHeight),r?.focus(),document.activeElement!==a))return},[V,M]),K=r.useCallback(()=>F([A,I]),[F,A,I]);r.useEffect(()=>{U&&K()},[U,K]);let{onOpenChange:W,triggerPointerDownPosRef:q}=R;r.useEffect(()=>{if(I){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(q.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():I.contains(r.target)||W(!1),document.removeEventListener("pointermove",t),q.current=null};return null!==q.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[I,W,q]),r.useEffect(()=>{let e=()=>W(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[W]);let[Y,Q]=eR(e=>{let t=V().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),s=eI(t,e,r);s&&setTimeout(()=>s.ref.current.focus())}),ee=r.useCallback((e,t,r)=>{let s=!_.current&&!r;(void 0!==R.value&&R.value===t||s)&&(B(e),s&&(_.current=!0))},[R.value]),et=r.useCallback(()=>I?.focus(),[I]),er=r.useCallback((e,t,r)=>{let s=!_.current&&!r;(void 0!==R.value&&R.value===t||s)&&z(e)},[R.value]),es="popper"===n?J:Z,ea=es===J?{side:f,sideOffset:h,align:x,alignOffset:v,arrowPadding:g,collisionBoundary:b,collisionPadding:y,sticky:w,hideWhenDetached:j,avoidCollisions:C}:{};return(0,t.jsx)($,{scope:a,content:I,viewport:M,onViewportChange:T,itemRefCallback:ee,selectedItem:A,onItemLeave:et,itemTextRefCallback:er,focusSelectedItem:K,selectedItemText:H,position:n,isPositioned:U,searchRef:Y,children:(0,t.jsx)(N.RemoveScroll,{as:X,allowPinchZoom:!0,children:(0,t.jsx)(p.FocusScope,{asChild:!0,trapped:R.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,l.composeEventHandlers)(o,e=>{R.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(c.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:(0,t.jsx)(es,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...k,...ea,onPlaced:()=>O(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:(0,l.composeEventHandlers)(k.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=V().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 r=e.target,s=t.indexOf(r);t=t.slice(s+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});Y.displayName="SelectContentImpl";var Z=r.forwardRef((e,s)=>{let{__scopeSelect:l,onPlaced:n,...o}=e,d=D(G,l),c=q(G,l),[u,p]=r.useState(null),[m,f]=r.useState(null),h=(0,i.useComposedRefs)(s,e=>f(e)),v=P(l),g=r.useRef(!1),b=r.useRef(!0),{viewport:w,selectedItem:j,selectedItemText:S,focusSelectedItem:N}=c,C=r.useCallback(()=>{if(d.trigger&&d.valueNode&&u&&m&&w&&j&&S){let e=d.trigger.getBoundingClientRect(),t=m.getBoundingClientRect(),r=d.valueNode.getBoundingClientRect(),s=S.getBoundingClientRect();if("rtl"!==d.dir){let l=s.left-t.left,n=r.left-l,i=e.left-n,o=e.width+i,d=Math.max(o,t.width),c=window.innerWidth-10,p=(0,a.clamp)(n,[10,Math.max(10,c-d)]);u.style.minWidth=o+"px",u.style.left=p+"px"}else{let l=t.right-s.right,n=window.innerWidth-r.right-l,i=window.innerWidth-e.right-n,o=e.width+i,d=Math.max(o,t.width),c=window.innerWidth-10,p=(0,a.clamp)(n,[10,Math.max(10,c-d)]);u.style.minWidth=o+"px",u.style.right=p+"px"}let l=v(),i=window.innerHeight-20,o=w.scrollHeight,c=window.getComputedStyle(m),p=parseInt(c.borderTopWidth,10),f=parseInt(c.paddingTop,10),h=parseInt(c.borderBottomWidth,10),x=p+f+o+parseInt(c.paddingBottom,10)+h,b=Math.min(5*j.offsetHeight,x),y=window.getComputedStyle(w),N=parseInt(y.paddingTop,10),C=parseInt(y.paddingBottom,10),k=e.top+e.height/2-10,R=j.offsetHeight/2,I=p+f+(j.offsetTop+R);if(I<=k){let e=l.length>0&&j===l[l.length-1].ref.current;u.style.bottom="0px";let t=Math.max(i-k,R+(e?C:0)+(m.clientHeight-w.offsetTop-w.offsetHeight)+h);u.style.height=I+t+"px"}else{let e=l.length>0&&j===l[0].ref.current;u.style.top="0px";let t=Math.max(k,p+w.offsetTop+(e?N:0)+R);u.style.height=t+(x-I)+"px",w.scrollTop=I-k+w.offsetTop}u.style.margin="10px 0",u.style.minHeight=b+"px",u.style.maxHeight=i+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[v,d.trigger,d.valueNode,u,m,w,j,S,d.dir,n]);(0,y.useLayoutEffect)(()=>C(),[C]);let[k,R]=r.useState();(0,y.useLayoutEffect)(()=>{m&&R(window.getComputedStyle(m).zIndex)},[m]);let I=r.useCallback(e=>{e&&!0===b.current&&(C(),N?.(),b.current=!1)},[C,N]);return(0,t.jsx)(Q,{scope:l,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:I,children:(0,t.jsx)("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,t.jsx)(x.Primitive.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Z.displayName="SelectItemAlignedPosition";var J=r.forwardRef((e,r)=>{let{__scopeSelect:s,align:a="start",collisionPadding:l=10,...n}=e,i=L(s);return(0,t.jsx)(f.Content,{...i,...n,ref:r,align:a,collisionPadding:l,style:{boxSizing:"border-box",...n.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)"}})});J.displayName="SelectPopperPosition";var[Q,ee]=M(G,{}),et="SelectViewport",er=r.forwardRef((e,s)=>{let{__scopeSelect:a,nonce:n,...o}=e,d=q(et,a),c=ee(et,a),u=(0,i.useComposedRefs)(s,d.onViewportChange),p=r.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:n}),(0,t.jsx)(I.Slot,{scope:a,children:(0,t.jsx)(x.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,l.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:s}=c;if(s?.current&&r){let e=Math.abs(p.current-t.scrollTop);if(e>0){let s=window.innerHeight-20,a=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(a<s){let l=a+e,n=Math.min(s,l),i=l-n;r.style.height=n+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});er.displayName=et;var es="SelectGroup",[ea,el]=M(es),en=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=(0,m.useId)();return(0,t.jsx)(ea,{scope:s,id:l,children:(0,t.jsx)(x.Primitive.div,{role:"group","aria-labelledby":l,...a,ref:r})})});en.displayName=es;var ei="SelectLabel",eo=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=el(ei,s);return(0,t.jsx)(x.Primitive.div,{id:l.id,...a,ref:r})});eo.displayName=ei;var ed="SelectItem",[ec,eu]=M(ed),ep=r.forwardRef((e,s)=>{let{__scopeSelect:a,value:n,disabled:o=!1,textValue:d,...c}=e,u=D(ed,a),p=q(ed,a),f=u.value===n,[h,v]=r.useState(d??""),[g,b]=r.useState(!1),y=(0,i.useComposedRefs)(s,e=>p.itemRefCallback?.(e,n,o)),w=(0,m.useId)(),j=r.useRef("touch"),S=()=>{o||(u.onValueChange(n),u.onOpenChange(!1))};if(""===n)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)(ec,{scope:a,value:n,disabled:o,textId:w,isSelected:f,onItemTextChange:r.useCallback(e=>{v(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(I.ItemSlot,{scope:a,value:n,disabled:o,textValue:h,children:(0,t.jsx)(x.Primitive.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:y,onFocus:(0,l.composeEventHandlers)(c.onFocus,()=>b(!0)),onBlur:(0,l.composeEventHandlers)(c.onBlur,()=>b(!1)),onClick:(0,l.composeEventHandlers)(c.onClick,()=>{"mouse"!==j.current&&S()}),onPointerUp:(0,l.composeEventHandlers)(c.onPointerUp,()=>{"mouse"===j.current&&S()}),onPointerDown:(0,l.composeEventHandlers)(c.onPointerDown,e=>{j.current=e.pointerType}),onPointerMove:(0,l.composeEventHandlers)(c.onPointerMove,e=>{j.current=e.pointerType,o?p.onItemLeave?.():"mouse"===j.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,l.composeEventHandlers)(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:(0,l.composeEventHandlers)(c.onKeyDown,e=>{(p.searchRef?.current===""||" "!==e.key)&&(k.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})});ep.displayName=ed;var em="SelectItemText",ef=r.forwardRef((e,a)=>{let{__scopeSelect:l,className:n,style:o,...d}=e,c=D(em,l),u=q(em,l),p=eu(em,l),m=H(em,l),[f,h]=r.useState(null),v=(0,i.useComposedRefs)(a,e=>h(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),g=f?.textContent,b=r.useMemo(()=>(0,t.jsx)("option",{value:p.value,disabled:p.disabled,children:g},p.value),[p.disabled,p.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:j}=m;return(0,y.useLayoutEffect)(()=>(w(b),()=>j(b)),[w,j,b]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Primitive.span,{id:p.textId,...d,ref:v}),p.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(d.children,c.valueNode):null]})});ef.displayName=em;var eh="SelectItemIndicator",ex=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e;return eu(eh,s).isSelected?(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...a,ref:r}):null});ex.displayName=eh;var ev="SelectScrollUpButton",eg=r.forwardRef((e,s)=>{let a=q(ev,e.__scopeSelect),l=ee(ev,e.__scopeSelect),[n,o]=r.useState(!1),d=(0,i.useComposedRefs)(s,l.onScrollButtonChange);return(0,y.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){o(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),n?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eg.displayName=ev;var eb="SelectScrollDownButton",ey=r.forwardRef((e,s)=>{let a=q(eb,e.__scopeSelect),l=ee(eb,e.__scopeSelect),[n,o]=r.useState(!1),d=(0,i.useComposedRefs)(s,l.onScrollButtonChange);return(0,y.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),n?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});ey.displayName=eb;var ew=r.forwardRef((e,s)=>{let{__scopeSelect:a,onAutoScroll:n,...i}=e,o=q("SelectScrollButton",a),d=r.useRef(null),c=P(a),u=r.useCallback(()=>{null!==d.current&&(window.clearInterval(d.current),d.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),(0,y.useLayoutEffect)(()=>{let e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...i,ref:s,style:{flexShrink:0,...i.style},onPointerDown:(0,l.composeEventHandlers)(i.onPointerDown,()=>{null===d.current&&(d.current=window.setInterval(n,50))}),onPointerMove:(0,l.composeEventHandlers)(i.onPointerMove,()=>{o.onItemLeave?.(),null===d.current&&(d.current=window.setInterval(n,50))}),onPointerLeave:(0,l.composeEventHandlers)(i.onPointerLeave,()=>{u()})})}),ej=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e;return(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...a,ref:r})});ej.displayName="SelectSeparator";var eS="SelectArrow",eN=r.forwardRef((e,r)=>{let{__scopeSelect:s,...a}=e,l=L(s),n=D(eS,s),i=q(eS,s);return n.open&&"popper"===i.position?(0,t.jsx)(f.Arrow,{...l,...a,ref:r}):null});eN.displayName=eS;var eC=r.forwardRef(({__scopeSelect:e,value:s,...a},l)=>{let n=r.useRef(null),o=(0,i.useComposedRefs)(l,n),d=(0,w.usePrevious)(s);return r.useEffect(()=>{let e=n.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(d!==s&&t){let r=new Event("change",{bubbles:!0});t.call(e,s),e.dispatchEvent(r)}},[d,s]),(0,t.jsx)(x.Primitive.select,{...a,style:{...j.VISUALLY_HIDDEN_STYLES,...a.style},ref:o,defaultValue:s})});function ek(e){return""===e||void 0===e}function eR(e){let t=(0,g.useCallbackRef)(e),s=r.useRef(""),a=r.useRef(0),l=r.useCallback(e=>{let r=s.current+e;t(r),function e(t){s.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),n=r.useCallback(()=>{s.current="",window.clearTimeout(a.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,l,n]}function eI(e,t,r){var s,a;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,n=r?e.indexOf(r):-1,i=(s=e,a=Math.max(n,0),s.map((e,t)=>s[(a+t)%s.length]));1===l.length&&(i=i.filter(e=>e!==r));let o=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return o!==r?o:void 0}eC.displayName="SelectBubbleInput",e.s(["Arrow",()=>eN,"Content",()=>W,"Group",()=>en,"Icon",()=>F,"Item",()=>ep,"ItemIndicator",()=>ex,"ItemText",()=>ef,"Label",()=>eo,"Portal",()=>K,"Root",()=>z,"ScrollDownButton",()=>ey,"ScrollUpButton",()=>eg,"Select",()=>z,"SelectArrow",()=>eN,"SelectContent",()=>W,"SelectGroup",()=>en,"SelectIcon",()=>F,"SelectItem",()=>ep,"SelectItemIndicator",()=>ex,"SelectItemText",()=>ef,"SelectLabel",()=>eo,"SelectPortal",()=>K,"SelectScrollDownButton",()=>ey,"SelectScrollUpButton",()=>eg,"SelectSeparator",()=>ej,"SelectTrigger",()=>U,"SelectValue",()=>_,"SelectViewport",()=>er,"Separator",()=>ej,"Trigger",()=>U,"Value",()=>_,"Viewport",()=>er,"createSelectScope",()=>T],483830);var eP=e.i(483830),eP=eP,eE=e.i(723925),eM=e.i(99105),eT=e.i(48829),eL=e.i(131777);let eA=eP.Root;eP.Group;let eD=eP.Value,eB=r.forwardRef(({className:e,children:r,...s},a)=>(0,t.jsxs)(eP.Trigger,{ref:a,className:(0,eL.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),...s,children:[r,(0,t.jsx)(eP.Icon,{asChild:!0,children:(0,t.jsx)(eM.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));eB.displayName=eP.Trigger.displayName;let eH=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.ScrollUpButton,{ref:s,className:(0,eL.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eT.ChevronUp,{className:"h-4 w-4"})}));eH.displayName=eP.ScrollUpButton.displayName;let ez=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.ScrollDownButton,{ref:s,className:(0,eL.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eM.ChevronDown,{className:"h-4 w-4"})}));ez.displayName=eP.ScrollDownButton.displayName;let eV=r.forwardRef(({className:e,children:r,position:s="popper",...a},l)=>(0,t.jsx)(eP.Portal,{children:(0,t.jsxs)(eP.Content,{ref:l,className:(0,eL.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"===s&&"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:s,...a,children:[(0,t.jsx)(eH,{}),(0,t.jsx)(eP.Viewport,{className:(0,eL.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,t.jsx)(ez,{})]})}));eV.displayName=eP.Content.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.Label,{ref:s,className:(0,eL.cn)("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=eP.Label.displayName;let eU=r.forwardRef(({className:e,children:r,...s},a)=>(0,t.jsxs)(eP.Item,{ref:a,className:(0,eL.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[(0,t.jsx)("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eP.ItemIndicator,{children:(0,t.jsx)(eE.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eP.ItemText,{children:r})]}));eU.displayName=eP.Item.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eP.Separator,{ref:s,className:(0,eL.cn)("bg-muted -mx-1 my-1 h-px",e),...r})).displayName=eP.Separator.displayName,e.s(["Select",()=>eA,"SelectContent",()=>eV,"SelectItem",()=>eU,"SelectTrigger",()=>eB,"SelectValue",()=>eD],547373)},938518,e=>{"use strict";let t=(0,e.i(903645).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],938518)},204461,309975,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(735364),a=e.i(81846),l=e.i(317406),n=e.i(508893);let i=(0,n.createServerReference)("60611c84e9caaf7a8effe6545d1aabce1508e45556",n.callServer,void 0,n.findSourceMapURL,"updatePmProject");e.s(["updatePmProject",()=>i],309975);let o=[{value:l.EstimateType.None,label:"None",description:"No estimates"},{value:l.EstimateType.Category,label:"T-Shirt Sizes",description:"XS, S, M, L, XL"},{value:l.EstimateType.Points,label:"Fibonacci Points",description:"1, 2, 3, 5, 8, 13, 21"}];function d({projectId:e,currentEstimateType:l,onEstimateTypeChange:n,className:d}){let[c,u]=(0,r.useState)(l),[p,m]=(0,r.useState)(!1),f=async t=>{t!==c&&(u(t),m(!0),await i(e,{estimateType:t}),m(!1),n?.(t))};return(0,t.jsxs)("div",{"data-testid":"estimate-settings",className:d,children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium",children:"Estimate System"}),p?(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:"Saving..."}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:o.map(e=>(0,t.jsx)(s.Button,{variant:c===e.value?"default":"outline",size:"sm",className:"h-auto w-full justify-start px-3 py-2 text-left",onClick:()=>f(e.value),"data-testid":`estimate-option-${e.value}`,children:(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground ml-2 text-[10px]",children:e.description})]}),c===e.value?(0,t.jsx)(a.Badge,{variant:"secondary",className:"text-[10px]",children:"Active"}):null]})},e.value))})]})}e.s(["EstimateSettings",()=>d],204461)},649749,e=>{"use strict";var t=e.i(679606),r=e.i(152155),s=e.i(711434),a=e.i(938518),l=e.i(939200),n=e.i(267669),i=e.i(3214),o=e.i(131777),d=e.i(735364),c=e.i(698127),u=e.i(81846),p=e.i(204461),m=e.i(141957),f=e.i(547373),h=e.i(317406);let x={Admin:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",Member:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300",Guest:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-300"};function v({projectId:e,members:s,currentUserId:a,onAddMember:l,onRemoveMember:n,onUpdateRole:i}){let[o,p]=(0,r.useState)(s),[v,g]=(0,r.useState)(""),[b,y]=(0,r.useState)(h.ProjectRole.Member),[w,j]=(0,r.useState)(null),[S,N]=(0,r.useState)(!1),C=o.some(e=>e.userId===a&&e.role===h.ProjectRole.Admin),k=(0,r.useCallback)(async()=>{if(!v.trim())return;N(!0),j(null);let t=await l({projectId:e,userId:v.trim(),role:b,actorId:a});t.error?j(t.error):t.member&&(p(e=>[...e,t.member]),g(""),y(h.ProjectRole.Member)),N(!1)},[v,b,e,a,l]),R=(0,r.useCallback)(async t=>{j(null);let r=await n({projectId:e,userId:t,actorId:a});r.error?j(r.error):p(e=>e.filter(e=>e.userId!==t))},[e,a,n]),I=(0,r.useCallback)(async(t,r)=>{j(null);let s=await i({projectId:e,userId:t,newRole:r,actorId:a});s.error?j(s.error):p(e=>e.map(e=>e.userId===t?{...e,role:r}:e))},[e,a,i]);return(0,t.jsxs)("div",{"data-testid":"project-members-panel",className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:"Project Members"}),w?(0,t.jsx)("div",{"data-testid":"members-error",className:"rounded border border-red-200 bg-red-50 p-3 text-sm text-red-800 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:w}):null,(0,t.jsxs)("div",{className:"divide-y rounded border",children:[o.map(e=>(0,t.jsxs)("div",{"data-testid":`member-row-${e.userId}`,className:"flex items-center justify-between p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.userId}),(0,t.jsx)(u.Badge,{className:x[e.role]??"",variant:"secondary",children:e.role})]}),C&&e.userId!==a?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(f.Select,{value:e.role,onValueChange:t=>I(e.userId,t),children:[(0,t.jsx)(f.SelectTrigger,{className:"w-[120px]",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsxs)(f.SelectContent,{children:[(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Admin,children:"Admin"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Member,children:"Member"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Guest,children:"Guest"})]})]}),(0,t.jsx)(d.Button,{variant:"destructive",size:"sm",onClick:()=>R(e.userId),children:"Remove"})]}):null]},e.id)),0===o.length&&(0,t.jsx)("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No members in this project."})]}),C?(0,t.jsxs)("div",{"data-testid":"add-member-form",className:"flex items-end gap-3 rounded border p-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(m.Label,{htmlFor:"new-user-id",children:"User ID"}),(0,t.jsx)(c.Input,{id:"new-user-id",value:v,onChange:e=>g(e.target.value),placeholder:"Enter user ID",disabled:S})]}),(0,t.jsxs)("div",{className:"w-[140px]",children:[(0,t.jsx)(m.Label,{htmlFor:"new-role",children:"Role"}),(0,t.jsxs)(f.Select,{value:b,onValueChange:e=>y(e),children:[(0,t.jsx)(f.SelectTrigger,{id:"new-role",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsxs)(f.SelectContent,{children:[(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Admin,children:"Admin"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Member,children:"Member"}),(0,t.jsx)(f.SelectItem,{value:h.ProjectRole.Guest,children:"Guest"})]})]})]}),(0,t.jsx)(d.Button,{onClick:k,disabled:S||!v.trim(),children:S?"Adding...":"Add Member"})]}):null]})}var g=e.i(309975),b=e.i(508893);let y=(0,b.createServerReference)("405f5e8fd32a6c111ddb51cce9c36164e23ceda359",b.callServer,void 0,b.findSourceMapURL,"deletePmProject"),w=(0,b.createServerReference)("408fad1db442fbd856e142d544a2d4ef36a162c2b9",b.callServer,void 0,b.findSourceMapURL,"createWorkItemState"),j=(0,b.createServerReference)("40cc5527ef0baf61df964f6ece0b93e0850ba12367",b.callServer,void 0,b.findSourceMapURL,"deleteWorkItemState"),S=(0,b.createServerReference)("40be6afd3f64f54f7d0a5b5c505bf73a6fa5e40970",b.callServer,void 0,b.findSourceMapURL,"createLabel"),N=(0,b.createServerReference)("40616a2ef77478aebc36ea46fa5ceb4b47443a6613",b.callServer,void 0,b.findSourceMapURL,"deleteLabel"),C=(0,b.createServerReference)("40a95a0008e6f940fa7b7de290ec1f8303a3158bb6",b.callServer,void 0,b.findSourceMapURL,"addProjectMember"),k=(0,b.createServerReference)("40ace5a17eeacdb935eb3c5cf8a78cc7db5d299cca",b.callServer,void 0,b.findSourceMapURL,"removeProjectMember"),R=(0,b.createServerReference)("40deddfb836e35eb0d623774d9c22b725a0c69567e",b.callServer,void 0,b.findSourceMapURL,"updateProjectMemberRole"),I={backlog:"bg-gray-400",unstarted:"bg-blue-400",started:"bg-yellow-400",completed:"bg-green-400",cancelled:"bg-red-400"};function P({project:e,states:m,labels:f,members:h=[],className:x}){let b=(0,s.useRouter)(),[P,E]=(0,r.useState)(e.name),[M,T]=(0,r.useState)(e.description??""),[L,A]=(0,r.useState)(!1),[D,B]=(0,r.useState)(m),[H,z]=(0,r.useState)(f),[V,U]=(0,r.useState)(""),[O,_]=(0,r.useState)(""),[F,K]=(0,r.useState)("#6366f1"),[G,W]=(0,r.useState)(""),$=(0,r.useCallback)(async()=>{A(!0),await (0,g.updatePmProject)(e.id,{name:P.trim(),description:M.trim()||void 0}),A(!1)},[e.id,P,M]),q=(0,r.useCallback)(async()=>{if(!V.trim())return;let t=await w({projectId:e.id,name:V.trim(),color:"#6366f1",stateGroup:"unstarted"});t.state&&(B(e=>[...e,t.state]),U(""))},[e.id,V]),X=(0,r.useCallback)(async e=>{(await j(e)).error||B(t=>t.filter(t=>t.id!==e))},[]),Y=(0,r.useCallback)(async()=>{if(!O.trim())return;let t=await S({projectId:e.id,name:O.trim(),color:F});t.label&&(z(e=>[...e,t.label]),_(""))},[e.id,O,F]),Z=(0,r.useCallback)(async e=>{(await N(e)).error||z(t=>t.filter(t=>t.id!==e))},[]),J=(0,r.useCallback)(async()=>{G!==e.name||(await y(e.id)).error||b.push("/projects")},[e.id,e.name,G,b]);return(0,t.jsxs)("div",{"data-testid":"project-settings",className:(0,o.cn)("max-w-2xl space-y-8",x),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>b.push(`/projects/${e.slug}`),"data-testid":"back-to-project",children:(0,t.jsx)(a.ArrowLeft,{className:"h-4 w-4"})}),(0,t.jsx)(l.Settings,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Project Settings"}),(0,t.jsx)(u.Badge,{variant:"outline",className:"text-[10px]",children:e.identifierPrefix})]}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"general-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"General"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:"Project Name"}),(0,t.jsx)(c.Input,{value:P,onChange:e=>E(e.target.value),className:"h-8 text-xs","data-testid":"project-name-input"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:"Description"}),(0,t.jsx)(c.Input,{value:M,onChange:e=>T(e.target.value),placeholder:"Optional description",className:"h-8 text-xs","data-testid":"project-description-input"})]}),(0,t.jsx)(d.Button,{size:"sm",className:"h-7 text-xs",onClick:$,disabled:L||!P.trim(),"data-testid":"save-general-btn",children:L?"Saving...":"Save Changes"})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)("section",{"data-testid":"estimate-settings-section",children:(0,t.jsx)(p.EstimateSettings,{projectId:e.id,currentEstimateType:e.estimateType})}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"states-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"Work Item States"}),(0,t.jsx)("div",{className:"space-y-1",children:D.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-sm px-2 py-1 text-xs","data-testid":`state-${e.id}`,children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1",children:e.name}),(0,t.jsx)(u.Badge,{variant:"outline",className:(0,o.cn)("text-[9px]",I[e.stateGroup]??"bg-gray-400"),children:e.stateGroup}),e.isDefault?(0,t.jsx)(u.Badge,{variant:"secondary",className:"text-[9px]",children:"default"}):(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"text-destructive hidden h-5 w-5 p-0 group-hover:flex",onClick:()=>X(e.id),title:"Delete state",children:(0,t.jsx)(n.Trash2,{className:"h-3 w-3"})})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:V,onChange:e=>U(e.target.value),placeholder:"New state name",className:"h-7 flex-1 text-xs","data-testid":"new-state-input",onKeyDown:e=>{"Enter"===e.key&&q()}}),(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:q,disabled:!V.trim(),"data-testid":"add-state-btn",children:[(0,t.jsx)(i.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"labels-settings",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold tracking-wide uppercase",children:"Labels"}),0===H.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No labels yet"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-1 rounded-full border px-2 py-0.5","data-testid":`label-${e.id}`,children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"text-[10px]",children:e.name}),(0,t.jsx)("button",{type:"button",className:"text-destructive ml-0.5 hidden text-xs group-hover:inline",onClick:()=>Z(e.id),title:"Delete label",children:"×"})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"color",value:F,onChange:e=>K(e.target.value),className:"h-7 w-7 cursor-pointer rounded border-0 p-0","data-testid":"new-label-color"}),(0,t.jsx)(c.Input,{value:O,onChange:e=>_(e.target.value),placeholder:"New label name",className:"h-7 flex-1 text-xs","data-testid":"new-label-input",onKeyDown:e=>{"Enter"===e.key&&Y()}}),(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:Y,disabled:!O.trim(),"data-testid":"add-label-btn",children:[(0,t.jsx)(i.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)("section",{"data-testid":"members-settings",children:(0,t.jsx)(v,{projectId:e.id,members:h,currentUserId:"",onAddMember:C,onRemoveMember:k,onUpdateRole:R})}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsxs)("section",{className:"space-y-3","data-testid":"danger-zone",children:[(0,t.jsx)("h2",{className:"text-destructive text-xs font-semibold tracking-wide uppercase",children:"Danger Zone"}),(0,t.jsxs)("div",{className:"border-destructive/20 rounded-md border p-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs",children:"Permanently delete this project and all its work items, cycles, modules, and pages."}),(0,t.jsxs)("p",{className:"text-muted-foreground mb-2 text-[10px]",children:["Type ",(0,t.jsx)("strong",{children:e.name})," to confirm."]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:G,onChange:e=>W(e.target.value),placeholder:e.name,className:"h-7 flex-1 text-xs","data-testid":"delete-confirm-input"}),(0,t.jsxs)(d.Button,{variant:"destructive",size:"sm",className:"h-7 text-xs",onClick:J,disabled:G!==e.name,"data-testid":"delete-project-btn",children:[(0,t.jsx)(n.Trash2,{className:"mr-1 h-3 w-3"}),"Delete Project"]})]})]})]})]})}e.s(["ProjectSettingsClient",()=>P],649749)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,468304,e=>{"use strict";var t=e.i(679606),s=e.i(152155),a=e.i(291967),r=e.i(922528),i=e.i(151080),n=e.i(685995),l=e.i(287620),o=e.i(566033),d=e.i(936589),c=e.i(713123),x="Tabs",[m,u]=(0,r.createContextScope)(x,[i.createRovingFocusGroupScope]),h=(0,i.createRovingFocusGroupScope)(),[p,g]=m(x),f=s.forwardRef((e,s)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:n,orientation:m="horizontal",dir:u,activationMode:h="automatic",...g}=e,f=(0,o.useDirection)(u),[b,j]=(0,d.useControllableState)({prop:r,onChange:i,defaultProp:n??"",caller:x});return(0,t.jsx)(p,{scope:a,baseId:(0,c.useId)(),value:b,onValueChange:j,orientation:m,dir:f,activationMode:h,children:(0,t.jsx)(l.Primitive.div,{dir:f,"data-orientation":m,...g,ref:s})})});f.displayName=x;var b="TabsList",j=s.forwardRef((e,s)=>{let{__scopeTabs:a,loop:r=!0,...n}=e,o=g(b,a),d=h(a);return(0,t.jsx)(i.Root,{asChild:!0,...d,orientation:o.orientation,dir:o.dir,loop:r,children:(0,t.jsx)(l.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:s})})});j.displayName=b;var v="TabsTrigger",y=s.forwardRef((e,s)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...d}=e,c=g(v,r),x=h(r),m=k(c.baseId,n),u=T(c.baseId,n),p=n===c.value;return(0,t.jsx)(i.Item,{asChild:!0,...x,focusable:!o,active:p,children:(0,t.jsx)(l.Primitive.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:m,...d,ref:s,onMouseDown:(0,a.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,a.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,a.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;p||o||!e||c.onValueChange(n)})})})});y.displayName=v;var N="TabsContent",C=s.forwardRef((e,a)=>{let{__scopeTabs:r,value:i,forceMount:o,children:d,...c}=e,x=g(N,r),m=k(x.baseId,i),u=T(x.baseId,i),h=i===x.value,p=s.useRef(h);return s.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(n.Presence,{present:o||h,children:({present:s})=>(0,t.jsx)(l.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":x.orientation,role:"tabpanel","aria-labelledby":m,hidden:!s,id:u,tabIndex:0,...c,ref:a,style:{...e.style,animationDuration:p.current?"0s":void 0},children:s&&d})})});function k(e,t){return`${e}-trigger-${t}`}function T(e,t){return`${e}-content-${t}`}C.displayName=N,e.s(["Content",()=>C,"List",()=>j,"Root",()=>f,"Tabs",()=>f,"TabsContent",()=>C,"TabsList",()=>j,"TabsTrigger",()=>y,"Trigger",()=>y,"createTabsScope",()=>u],743133);var w=e.i(743133),w=w,z=e.i(131777);let P=w.Root,L=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.List,{ref:a,className:(0,z.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...s}));L.displayName=w.List.displayName;let R=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.Trigger,{ref:a,className:(0,z.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}));R.displayName=w.Trigger.displayName;let S=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.Content,{ref:a,className:(0,z.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}));S.displayName=w.Content.displayName,e.s(["Tabs",()=>P,"TabsContent",()=>S,"TabsList",()=>L,"TabsTrigger",()=>R],468304)},791909,e=>{"use strict";let t=(0,e.i(903645).default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["default",()=>t])},812919,e=>{"use strict";let t=(0,e.i(903645).default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",()=>t],812919)},916489,235749,e=>{"use strict";let t=(0,e.i(903645).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",()=>t],916489);var s=e.i(791909);e.s(["FileEdit",()=>s.default],235749)},942944,e=>{"use strict";var t=e.i(508893);let s=(0,t.createServerReference)("60c74c9210e9289e344bd24cee7ccadf6882702ae9",t.callServer,void 0,t.findSourceMapURL,"getGitRepoInfo");e.s(["getGitRepoInfo",()=>s])},610661,e=>{"use strict";var t=e.i(679606),s=e.i(152155),a=e.i(711434),r=e.i(208986),i=e.i(338573),n=e.i(619933),l=e.i(43416),o=e.i(724042),d=e.i(64970),c=e.i(433548),x=e.i(723925),m=e.i(83428),u=e.i(916489),h=e.i(248109),p=e.i(949228),g=e.i(565530),f=e.i(958481),b=e.i(32494),j=e.i(903645);let v=(0,j.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var y=e.i(237260),N=e.i(235749),C=e.i(812919);let k=(0,j.default)("file-check-corner",[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]]);var T=e.i(131777);e.i(1650);var w=e.i(511495);e.i(199348);var z=e.i(917466),P=e.i(102828),L=e.i(468304),R=e.i(676852),S=e.i(8537),I=e.i(175921),D=e.i(928112),F=e.i(942944);let M="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",A="bg-border/60 mx-1.5 h-5 w-px shrink-0";function E({data:e,initialTab:p}){let g=(0,I.useFeatureFlags)(),f=(0,a.useRouter)(),b=(0,a.usePathname)().startsWith("/repository/"),[j,v]=(0,s.useState)(p??"overview"),[y,N]=(0,s.useState)(!1),C=(0,R.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),k=(0,s.useCallback)(()=>{f.push("/control-center")},[f]),F=(0,S.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),E="Booting"===F.status||"Ready"===F.status,$=(0,s.useCallback)(()=>{e.repositoryPath&&(navigator.clipboard.writeText(e.repositoryPath),N(!0),setTimeout(()=>N(!1),2e3))},[e.repositoryPath]),B=e.id?`repo-${e.id}`:`repo-${e.name}`;return(0,t.jsx)(w.BaseDrawer,{open:b,onClose:k,size:"lg",modal:!1,"data-testid":"repository-drawer",children:(0,t.jsxs)(L.Tabs,{value:j,onValueChange:v,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)(L.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:[(0,t.jsxs)(L.TabsTrigger,{value:"overview",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(u.LayoutDashboard,{className:"mr-1.5 size-4"}),"Overview"]}),(0,t.jsxs)(L.TabsTrigger,{value:"chat",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(h.MessageSquare,{className:"mr-1.5 size-4"}),"Chat"]})]}),(0,t.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 pe-10 pt-2.5 pb-2","data-testid":"repository-drawer-header",children:[(0,t.jsx)("h2",{className:"text-foreground min-w-0 truncate text-base font-semibold tracking-tight",children:e.name}),e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/40 text-xs",children:"/"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 truncate font-mono text-[11px]",children:e.repositoryPath})]}):null]}),e.repositoryPath?(0,t.jsx)("div",{"data-testid":"repository-drawer-toolbar",children:(0,t.jsxs)("div",{className:"flex h-9 items-center px-1.5",children:[(0,t.jsxs)(P.TooltipProvider,{delayDuration:300,children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openInIde,disabled:C.ideLoading,"aria-label":"Open in IDE",children:C.ideLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(r.Code2,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openInShell,disabled:C.shellLoading,"aria-label":"Open terminal",children:C.shellLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(i.Terminal,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openFolder,disabled:C.folderLoading,"aria-label":"Open folder",children:C.folderLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(n.FolderOpen,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:$,"aria-label":"Copy path",children:y?(0,t.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,t.jsx)(c.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:y?"Copied!":"Copy path"})]})]}),e.id&&g.gitRebaseSync?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:A}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.syncMain,disabled:C.syncLoading,"aria-label":"Sync main",children:C.syncLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(l.RefreshCw,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Sync main"})]})]}):null,g.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:A}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:F.deployLoading||F.stopLoading,onClick:E?F.stop:F.deploy,className:(0,T.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",E?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-500 hover:bg-green-500/10 hover:text-green-400"),"aria-label":E?"Stop dev server":"Start dev server",children:F.deployLoading||F.stopLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):E?(0,t.jsx)(d.Square,{className:"size-4"}):(0,t.jsx)(o.Play,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:E?"Stop dev server":"Start dev server"})]}),E?(0,t.jsx)(z.DeploymentStatusBadge,{status:F.status,url:F.url,targetId:e.repositoryPath}):null]}):null]}),(0,t.jsx)("div",{className:"flex-1"})]})}):null]}),(0,t.jsx)(L.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(O,{data:e,syncError:C.syncError})}),(0,t.jsx)(L.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(D.ChatTab,{featureId:B,worktreePath:e.repositoryPath})})]})})}function $({icon:e,title:s,children:a}){return(0,t.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,t.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,t.jsx)(e,{className:"size-4 opacity-50"}),s]}),a]})}function B({children:e,className:s}){return(0,t.jsx)("div",{className:(0,T.cn)("bg-muted/60 rounded-md border border-transparent p-3",s),children:e})}function G({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,t.jsx)("span",{className:"text-sm leading-snug",children:s})]})}function O({data:e,syncError:a}){let[r,i]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{if(!e.repositoryPath)return;let t=!1;return l(!0),(0,F.getGitRepoInfo)(e.repositoryPath,8).then(e=>{t||i(e)}).catch(()=>{}).finally(()=>{t||l(!1)}),()=>{t=!0}},[e.repositoryPath]),!e.repositoryPath)return null;let o=r?.workingTree,d=o&&(o.staged>0||o.modified>0||o.untracked>0),c=r?.diffStats;return(0,t.jsxs)("div",{className:"pb-4",children:[n?(0,t.jsxs)("div",{className:"text-foreground/40 flex items-center gap-2 px-4 py-8 text-sm",children:[(0,t.jsx)(m.Loader2,{className:"size-4 animate-spin"})," Loading repository info..."]}):null,r?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pt-3",children:[(0,t.jsx)(B,{children:(0,t.jsxs)(G,{label:"Branch",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(p.GitBranch,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,t.jsx)("code",{className:"font-mono text-sm",children:r.currentBranch??e.branch??"—"})]}),null!=e.behindCount&&e.behindCount>0?(0,t.jsxs)("span",{className:"mt-0.5 block text-xs text-orange-600 dark:text-orange-400",children:[e.behindCount," behind default"]}):null]})}),(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Working Tree",children:d?(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[o.staged>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-green-600 dark:text-green-400",children:[(0,t.jsx)(k,{className:"size-3.5"})," ",o.staged," staged"]}):null,o.modified>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(N.FileEdit,{className:"size-3.5"})," ",o.modified," modified"]}):null,o.untracked>0?(0,t.jsxs)("span",{className:"text-foreground/50 inline-flex items-center gap-1 text-sm",children:[(0,t.jsx)(C.FilePlus,{className:"size-3.5"})," ",o.untracked," untracked"]}):null]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[(0,t.jsx)(x.Check,{className:"size-3.5"})," Clean"]})})}),c?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Uncommitted Changes",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,t.jsxs)("span",{children:[c.filesChanged," file",1!==c.filesChanged?"s":""]}),(0,t.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",c.insertions]}),(0,t.jsxs)("span",{className:"text-red-500 dark:text-red-400",children:["-",c.deletions]})]})})}):null,r.remotes.length>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Remote",children:r.remotes.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(b.Globe,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.url.replace(/\.git$/,"").replace(/^https?:\/\/([^@]+@)?/,"").replace(/x-access-token:[^@]+@/,"")})]},e.name))})}):null,r.stashCount>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Stashes",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(y.Archive,{className:"text-foreground/30 size-3.5 shrink-0"}),r.stashCount," stash",1!==r.stashCount?"es":""]})})}):null,r.tags.length>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Tags",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(e=>(0,t.jsxs)("span",{className:"bg-foreground/[0.04] inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-xs",children:[(0,t.jsx)(v,{className:"text-foreground/30 size-2.5"}),e]},e))})})}):null]}):null,r&&r.commits.length>0?(0,t.jsx)($,{icon:g.GitCommitHorizontal,title:"Recent Commits",children:(0,t.jsxs)("div",{className:"relative ml-3",children:[(0,t.jsx)("div",{className:"bg-border absolute top-2 bottom-2 left-[5px] w-px"}),r.commits.map((e,s)=>(0,t.jsxs)("div",{className:"group relative flex gap-3 py-1.5",children:[(0,t.jsx)("div",{className:(0,T.cn)("relative z-10 mt-1.5 size-[11px] shrink-0 rounded-full border-2",0===s?"border-primary bg-primary":"border-border bg-background group-hover:border-foreground/30")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("p",{className:"min-w-0 truncate text-sm leading-snug",children:e.subject}),(0,t.jsx)("code",{className:"text-foreground/30 shrink-0 font-mono text-[11px]",children:e.shortHash})]}),(0,t.jsxs)("div",{className:"text-foreground/40 mt-0.5 flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{children:e.author}),(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:e.relativeDate}),e.branch?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,t.jsx)(p.GitBranch,{className:"size-3"}),e.branch]})]}):null]})]})]},e.hash))]})}):null,r&&r.branches.length>1?(0,t.jsx)($,{icon:p.GitBranch,title:"Branches",children:(0,t.jsx)("div",{className:"flex flex-col",children:[...r.branches].sort((e,t)=>{let s,a,r,i;return e.isCurrent&&!t.isCurrent?-1:!e.isCurrent&&t.isCurrent?1:(s=e.name,/^(main|master)$/.test(s)&&(a=t.name,!/^(main|master)$/.test(a)))?-1:+(r=e.name,!!(!/^(main|master)$/.test(r)&&(i=t.name,/^(main|master)$/.test(i))))}).map(e=>(0,t.jsxs)("div",{className:(0,T.cn)("flex items-center justify-between rounded px-2 py-1.5",e.isCurrent&&"bg-muted/60"),children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[e.isCurrent?(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-green-500"}):/^(main|master)$/.test(e.name)?(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-blue-500"}):(0,t.jsx)("span",{className:"bg-foreground/10 size-2 shrink-0 rounded-full"}),(0,t.jsx)("code",{className:"font-mono text-[13px]",children:e.name}),e.isCurrent?(0,t.jsx)("span",{className:"text-foreground/40 text-[10px]",children:"current"}):null]}),(0,t.jsx)("span",{className:"text-foreground/40 text-xs",children:e.lastCommitDate})]},e.name))})}):null,a?(0,t.jsx)($,{icon:f.AlertTriangle,title:"Issues",children:(0,t.jsx)(B,{className:"bg-destructive/5 border-transparent",children:(0,t.jsx)("p",{className:"text-destructive text-sm",children:a})})}):null]})}e.s(["RepositoryDrawerClient",()=>E],610661)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,468304,e=>{"use strict";var t=e.i(679606),s=e.i(152155),a=e.i(291967),r=e.i(922528),i=e.i(151080),n=e.i(685995),l=e.i(287620),o=e.i(566033),d=e.i(936589),c=e.i(713123),x="Tabs",[m,u]=(0,r.createContextScope)(x,[i.createRovingFocusGroupScope]),h=(0,i.createRovingFocusGroupScope)(),[p,g]=m(x),f=s.forwardRef((e,s)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:n,orientation:m="horizontal",dir:u,activationMode:h="automatic",...g}=e,f=(0,o.useDirection)(u),[b,j]=(0,d.useControllableState)({prop:r,onChange:i,defaultProp:n??"",caller:x});return(0,t.jsx)(p,{scope:a,baseId:(0,c.useId)(),value:b,onValueChange:j,orientation:m,dir:f,activationMode:h,children:(0,t.jsx)(l.Primitive.div,{dir:f,"data-orientation":m,...g,ref:s})})});f.displayName=x;var b="TabsList",j=s.forwardRef((e,s)=>{let{__scopeTabs:a,loop:r=!0,...n}=e,o=g(b,a),d=h(a);return(0,t.jsx)(i.Root,{asChild:!0,...d,orientation:o.orientation,dir:o.dir,loop:r,children:(0,t.jsx)(l.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:s})})});j.displayName=b;var v="TabsTrigger",y=s.forwardRef((e,s)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...d}=e,c=g(v,r),x=h(r),m=k(c.baseId,n),u=T(c.baseId,n),p=n===c.value;return(0,t.jsx)(i.Item,{asChild:!0,...x,focusable:!o,active:p,children:(0,t.jsx)(l.Primitive.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:m,...d,ref:s,onMouseDown:(0,a.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,a.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,a.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;p||o||!e||c.onValueChange(n)})})})});y.displayName=v;var N="TabsContent",C=s.forwardRef((e,a)=>{let{__scopeTabs:r,value:i,forceMount:o,children:d,...c}=e,x=g(N,r),m=k(x.baseId,i),u=T(x.baseId,i),h=i===x.value,p=s.useRef(h);return s.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(n.Presence,{present:o||h,children:({present:s})=>(0,t.jsx)(l.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":x.orientation,role:"tabpanel","aria-labelledby":m,hidden:!s,id:u,tabIndex:0,...c,ref:a,style:{...e.style,animationDuration:p.current?"0s":void 0},children:s&&d})})});function k(e,t){return`${e}-trigger-${t}`}function T(e,t){return`${e}-content-${t}`}C.displayName=N,e.s(["Content",()=>C,"List",()=>j,"Root",()=>f,"Tabs",()=>f,"TabsContent",()=>C,"TabsList",()=>j,"TabsTrigger",()=>y,"Trigger",()=>y,"createTabsScope",()=>u],743133);var w=e.i(743133),w=w,z=e.i(131777);let P=w.Root,L=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.List,{ref:a,className:(0,z.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...s}));L.displayName=w.List.displayName;let R=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.Trigger,{ref:a,className:(0,z.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}));R.displayName=w.Trigger.displayName;let S=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(w.Content,{ref:a,className:(0,z.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}));S.displayName=w.Content.displayName,e.s(["Tabs",()=>P,"TabsContent",()=>S,"TabsList",()=>L,"TabsTrigger",()=>R],468304)},791909,e=>{"use strict";let t=(0,e.i(903645).default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["default",()=>t])},812919,e=>{"use strict";let t=(0,e.i(903645).default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",()=>t],812919)},916489,235749,e=>{"use strict";let t=(0,e.i(903645).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",()=>t],916489);var s=e.i(791909);e.s(["FileEdit",()=>s.default],235749)},963112,e=>{"use strict";var t=e.i(508893);let s=(0,t.createServerReference)("60c27503ba1df41376ff84ab21cf819b323773e005",t.callServer,void 0,t.findSourceMapURL,"getGitRepoInfo");e.s(["getGitRepoInfo",()=>s])},610661,e=>{"use strict";var t=e.i(679606),s=e.i(152155),a=e.i(711434),r=e.i(208986),i=e.i(338573),n=e.i(619933),l=e.i(43416),o=e.i(724042),d=e.i(64970),c=e.i(433548),x=e.i(723925),m=e.i(83428),u=e.i(916489),h=e.i(248109),p=e.i(949228),g=e.i(565530),f=e.i(958481),b=e.i(32494),j=e.i(903645);let v=(0,j.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var y=e.i(237260),N=e.i(235749),C=e.i(812919);let k=(0,j.default)("file-check-corner",[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]]);var T=e.i(131777);e.i(1650);var w=e.i(511495);e.i(199348);var z=e.i(917466),P=e.i(102828),L=e.i(468304),R=e.i(676852),S=e.i(8537),I=e.i(175921),D=e.i(928112),F=e.i(963112);let M="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",A="bg-border/60 mx-1.5 h-5 w-px shrink-0";function E({data:e,initialTab:p}){let g=(0,I.useFeatureFlags)(),f=(0,a.useRouter)(),b=(0,a.usePathname)().startsWith("/repository/"),[j,v]=(0,s.useState)(p??"overview"),[y,N]=(0,s.useState)(!1),C=(0,R.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),k=(0,s.useCallback)(()=>{f.push("/control-center")},[f]),F=(0,S.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),E="Booting"===F.status||"Ready"===F.status,$=(0,s.useCallback)(()=>{e.repositoryPath&&(navigator.clipboard.writeText(e.repositoryPath),N(!0),setTimeout(()=>N(!1),2e3))},[e.repositoryPath]),B=e.id?`repo-${e.id}`:`repo-${e.name}`;return(0,t.jsx)(w.BaseDrawer,{open:b,onClose:k,size:"lg",modal:!1,"data-testid":"repository-drawer",children:(0,t.jsxs)(L.Tabs,{value:j,onValueChange:v,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)(L.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:[(0,t.jsxs)(L.TabsTrigger,{value:"overview",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(u.LayoutDashboard,{className:"mr-1.5 size-4"}),"Overview"]}),(0,t.jsxs)(L.TabsTrigger,{value:"chat",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(h.MessageSquare,{className:"mr-1.5 size-4"}),"Chat"]})]}),(0,t.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 pe-10 pt-2.5 pb-2","data-testid":"repository-drawer-header",children:[(0,t.jsx)("h2",{className:"text-foreground min-w-0 truncate text-base font-semibold tracking-tight",children:e.name}),e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/40 text-xs",children:"/"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 truncate font-mono text-[11px]",children:e.repositoryPath})]}):null]}),e.repositoryPath?(0,t.jsx)("div",{"data-testid":"repository-drawer-toolbar",children:(0,t.jsxs)("div",{className:"flex h-9 items-center px-1.5",children:[(0,t.jsxs)(P.TooltipProvider,{delayDuration:300,children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openInIde,disabled:C.ideLoading,"aria-label":"Open in IDE",children:C.ideLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(r.Code2,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openInShell,disabled:C.shellLoading,"aria-label":"Open terminal",children:C.shellLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(i.Terminal,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.openFolder,disabled:C.folderLoading,"aria-label":"Open folder",children:C.folderLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(n.FolderOpen,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:$,"aria-label":"Copy path",children:y?(0,t.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,t.jsx)(c.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:y?"Copied!":"Copy path"})]})]}),e.id&&g.gitRebaseSync?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:A}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:M,onClick:C.syncMain,disabled:C.syncLoading,"aria-label":"Sync main",children:C.syncLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(l.RefreshCw,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Sync main"})]})]}):null,g.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:A}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:F.deployLoading||F.stopLoading,onClick:E?F.stop:F.deploy,className:(0,T.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",E?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-500 hover:bg-green-500/10 hover:text-green-400"),"aria-label":E?"Stop dev server":"Start dev server",children:F.deployLoading||F.stopLoading?(0,t.jsx)(m.Loader2,{className:"size-3.5 animate-spin"}):E?(0,t.jsx)(d.Square,{className:"size-4"}):(0,t.jsx)(o.Play,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:E?"Stop dev server":"Start dev server"})]}),E?(0,t.jsx)(z.DeploymentStatusBadge,{status:F.status,url:F.url,targetId:e.repositoryPath}):null]}):null]}),(0,t.jsx)("div",{className:"flex-1"})]})}):null]}),(0,t.jsx)(L.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(O,{data:e,syncError:C.syncError})}),(0,t.jsx)(L.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(D.ChatTab,{featureId:B,worktreePath:e.repositoryPath})})]})})}function $({icon:e,title:s,children:a}){return(0,t.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,t.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,t.jsx)(e,{className:"size-4 opacity-50"}),s]}),a]})}function B({children:e,className:s}){return(0,t.jsx)("div",{className:(0,T.cn)("bg-muted/60 rounded-md border border-transparent p-3",s),children:e})}function G({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,t.jsx)("span",{className:"text-sm leading-snug",children:s})]})}function O({data:e,syncError:a}){let[r,i]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{if(!e.repositoryPath)return;let t=!1;return l(!0),(0,F.getGitRepoInfo)(e.repositoryPath,8).then(e=>{t||i(e)}).catch(()=>{}).finally(()=>{t||l(!1)}),()=>{t=!0}},[e.repositoryPath]),!e.repositoryPath)return null;let o=r?.workingTree,d=o&&(o.staged>0||o.modified>0||o.untracked>0),c=r?.diffStats;return(0,t.jsxs)("div",{className:"pb-4",children:[n?(0,t.jsxs)("div",{className:"text-foreground/40 flex items-center gap-2 px-4 py-8 text-sm",children:[(0,t.jsx)(m.Loader2,{className:"size-4 animate-spin"})," Loading repository info..."]}):null,r?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pt-3",children:[(0,t.jsx)(B,{children:(0,t.jsxs)(G,{label:"Branch",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(p.GitBranch,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,t.jsx)("code",{className:"font-mono text-sm",children:r.currentBranch??e.branch??"—"})]}),null!=e.behindCount&&e.behindCount>0?(0,t.jsxs)("span",{className:"mt-0.5 block text-xs text-orange-600 dark:text-orange-400",children:[e.behindCount," behind default"]}):null]})}),(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Working Tree",children:d?(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[o.staged>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-green-600 dark:text-green-400",children:[(0,t.jsx)(k,{className:"size-3.5"})," ",o.staged," staged"]}):null,o.modified>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(N.FileEdit,{className:"size-3.5"})," ",o.modified," modified"]}):null,o.untracked>0?(0,t.jsxs)("span",{className:"text-foreground/50 inline-flex items-center gap-1 text-sm",children:[(0,t.jsx)(C.FilePlus,{className:"size-3.5"})," ",o.untracked," untracked"]}):null]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[(0,t.jsx)(x.Check,{className:"size-3.5"})," Clean"]})})}),c?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Uncommitted Changes",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,t.jsxs)("span",{children:[c.filesChanged," file",1!==c.filesChanged?"s":""]}),(0,t.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",c.insertions]}),(0,t.jsxs)("span",{className:"text-red-500 dark:text-red-400",children:["-",c.deletions]})]})})}):null,r.remotes.length>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Remote",children:r.remotes.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(b.Globe,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.url.replace(/\.git$/,"").replace(/^https?:\/\/([^@]+@)?/,"").replace(/x-access-token:[^@]+@/,"")})]},e.name))})}):null,r.stashCount>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Stashes",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(y.Archive,{className:"text-foreground/30 size-3.5 shrink-0"}),r.stashCount," stash",1!==r.stashCount?"es":""]})})}):null,r.tags.length>0?(0,t.jsx)(B,{children:(0,t.jsx)(G,{label:"Tags",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(e=>(0,t.jsxs)("span",{className:"bg-foreground/[0.04] inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-xs",children:[(0,t.jsx)(v,{className:"text-foreground/30 size-2.5"}),e]},e))})})}):null]}):null,r&&r.commits.length>0?(0,t.jsx)($,{icon:g.GitCommitHorizontal,title:"Recent Commits",children:(0,t.jsxs)("div",{className:"relative ml-3",children:[(0,t.jsx)("div",{className:"bg-border absolute top-2 bottom-2 left-[5px] w-px"}),r.commits.map((e,s)=>(0,t.jsxs)("div",{className:"group relative flex gap-3 py-1.5",children:[(0,t.jsx)("div",{className:(0,T.cn)("relative z-10 mt-1.5 size-[11px] shrink-0 rounded-full border-2",0===s?"border-primary bg-primary":"border-border bg-background group-hover:border-foreground/30")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("p",{className:"min-w-0 truncate text-sm leading-snug",children:e.subject}),(0,t.jsx)("code",{className:"text-foreground/30 shrink-0 font-mono text-[11px]",children:e.shortHash})]}),(0,t.jsxs)("div",{className:"text-foreground/40 mt-0.5 flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{children:e.author}),(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:e.relativeDate}),e.branch?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,t.jsx)(p.GitBranch,{className:"size-3"}),e.branch]})]}):null]})]})]},e.hash))]})}):null,r&&r.branches.length>1?(0,t.jsx)($,{icon:p.GitBranch,title:"Branches",children:(0,t.jsx)("div",{className:"flex flex-col",children:[...r.branches].sort((e,t)=>{let s,a,r,i;return e.isCurrent&&!t.isCurrent?-1:!e.isCurrent&&t.isCurrent?1:(s=e.name,/^(main|master)$/.test(s)&&(a=t.name,!/^(main|master)$/.test(a)))?-1:+(r=e.name,!!(!/^(main|master)$/.test(r)&&(i=t.name,/^(main|master)$/.test(i))))}).map(e=>(0,t.jsxs)("div",{className:(0,T.cn)("flex items-center justify-between rounded px-2 py-1.5",e.isCurrent&&"bg-muted/60"),children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[e.isCurrent?(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-green-500"}):/^(main|master)$/.test(e.name)?(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-blue-500"}):(0,t.jsx)("span",{className:"bg-foreground/10 size-2 shrink-0 rounded-full"}),(0,t.jsx)("code",{className:"font-mono text-[13px]",children:e.name}),e.isCurrent?(0,t.jsx)("span",{className:"text-foreground/40 text-[10px]",children:"current"}):null]}),(0,t.jsx)("span",{className:"text-foreground/40 text-xs",children:e.lastCommitDate})]},e.name))})}):null,a?(0,t.jsx)($,{icon:f.AlertTriangle,title:"Issues",children:(0,t.jsx)(B,{className:"bg-destructive/5 border-transparent",children:(0,t.jsx)("p",{className:"text-destructive text-sm",children:a})})}):null]})}e.s(["RepositoryDrawerClient",()=>E],610661)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,283843,e=>{"use strict";let a=(0,e.i(903645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>a],283843)},187752,e=>{"use strict";var a=e.i(679606),t=e.i(152155),s=e.i(66459),r=e.i(131777);let o=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,r.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));o.displayName="Command";let n=t.forwardRef(({className:e,...t},o)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(s.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:o,className:(0,r.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));n.displayName="CommandInput";let l=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,r.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));l.displayName="CommandList";let c=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,r.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));c.displayName="CommandEmpty";let i=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,r.cn)("text-foreground overflow-hidden p-1",e),...t}));i.displayName="CommandGroup";let d=t.forwardRef(({className:e,selected:t,...s},o)=>(0,a.jsx)("button",{ref:o,type:"button","data-selected":t,className:(0,r.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));d.displayName="CommandItem";let m=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,r.cn)("bg-border -mx-1 h-px",e),...t}));m.displayName="CommandSeparator",e.s(["Command",()=>o,"CommandEmpty",()=>c,"CommandGroup",()=>i,"CommandInput",()=>n,"CommandItem",()=>d,"CommandList",()=>l,"CommandSeparator",()=>m])},936479,e=>{"use strict";var a=e.i(679606),t=e.i(152155),s=e.i(711434),r=e.i(360112),o=e.i(508893);let n=(0,o.createServerReference)("409da0acc186e34bccec4587d32398cd8abc7ee106",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("40d894a3f358d955a23910b42dcfd33f61041653a0",o.callServer,void 0,o.findSourceMapURL,"listBranches");var c=e.i(723925),i=e.i(197667),d=e.i(283843),m=e.i(949228),p=e.i(83428);e.i(1650);var u=e.i(511495),h=e.i(845811),x=e.i(735364),f=e.i(698127),b=e.i(141957),v=e.i(187752),g=e.i(390382),j=e.i(131777);function C({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:C,onRepositoryChange:w,branches:y=[],branchesLoading:N=!1}){let[S,k]=(0,t.useState)(""),[R,L]=(0,t.useState)(!1),[E,B]=(0,t.useState)(""),P=(0,t.useRef)(null),[D,I]=(0,t.useState)(!1),[T,U]=(0,t.useState)(""),A=(0,t.useRef)(null),G=l.find(e=>e.path===C),O=!!C;(0,t.useEffect)(()=>{e||(k(""),B(""),L(!1),I(!1),U(""))},[e]),(0,t.useEffect)(()=>{k(""),B("")},[C]);let F=(0,t.useCallback)(e=>{e.preventDefault();let a=S.trim();a&&C&&!o&&r(a,C)},[S,C,o,r]),K=(0,t.useCallback)(()=>{k(""),B(""),s()},[s]),M=(0,t.useCallback)(e=>{k(e),B(e),L(!1)},[]),$=(0,t.useCallback)(e=>{B(e.target.value),R||L(!0)},[R]),z=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=E.trim();a&&(k(a),L(!1))}"Escape"===e.key&&(L(!1),B(S))},[E,S]),W=(0,t.useCallback)(e=>{w?.(e),I(!1),U("")},[w]),q=y.filter(e=>e.toLowerCase().includes(E.toLowerCase())),H=T.trim()?l.filter(e=>e.name.toLowerCase().includes(T.toLowerCase())||e.path.toLowerCase().includes(T.toLowerCase())):l;(0,t.useEffect)(()=>{D?setTimeout(()=>A.current?.focus(),0):U("")},[D]);let J=!S.trim()||!C||o,Q=(0,a.jsxs)("div",{children:[(0,a.jsxs)(h.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(m.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(h.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:K,size:"sm",modal:!1,header:Q,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(g.Popover,{open:D,onOpenChange:I,children:[(0,a.jsx)(g.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":D,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,j.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!G&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:G?G.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(g.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:A,placeholder:"Search repositories...",value:T,onChange:e=>U(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===H.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):H.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":C===e.path,onClick:()=>W(e.path),className:(0,j.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",C===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(i.CheckIcon,{className:(0,j.cn)("h-4 w-4 shrink-0",C!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(g.Popover,{open:R,onOpenChange:L,children:[(0,a.jsx)(g.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":R,disabled:o||!O,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:O?N?"Loading branches...":S||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(g.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(v.Command,{children:[(0,a.jsx)(v.CommandInput,{ref:P,placeholder:"Search branches...",value:E,onChange:$,onKeyDown:z,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(v.CommandList,{children:[!N&&0===q.length&&(0,a.jsx)(v.CommandEmpty,{children:0===y.length?"No branches found.":E?"No match — press Enter to use this value.":"No branches available."}),N?(0,a.jsx)(v.CommandEmpty,{children:(0,a.jsx)(p.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,q.length>0&&(0,a.jsx)(v.CommandGroup,{children:q.map(e=>(0,a.jsxs)(v.CommandItem,{selected:e===S,onClick:()=>M(e),children:[(0,a.jsx)(c.Check,{className:(0,j.cn)("me-2 h-4 w-4",e===S?"opacity-100":"opacity-0")}),(0,a.jsx)(m.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:O?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{className:"text-destructive text-sm","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:K,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:J,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}function w({repositoryPath:e,repositories:o}){let c=(0,s.useRouter)(),i=(0,s.usePathname)(),[d,m]=(0,t.useState)(!1),[p,u]=(0,t.useState)(),[h,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=i.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&m(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let y=(0,t.useCallback)(()=>{c.push("/control-center")},[c]),N=(0,t.useCallback)(e=>{g(e)},[]),S=(0,t.useCallback)((e,a)=>{u(void 0),m(!0),c.push("/control-center"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),m(!1)})},[c]);return(0,a.jsx)(C,{open:w,onClose:y,onSubmit:S,isSubmitting:d,error:p,repositories:o,selectedRepositoryPath:v,onRepositoryChange:N,branches:h,branchesLoading:f})}e.s(["AdoptDrawerClient",()=>w],936479)}]);