@aoagents/ao-web 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +211 -197
  3. package/.next/app-path-routes-manifest.json +18 -16
  4. package/.next/build-manifest.json +6 -6
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +22 -22
  7. package/.next/react-loadable-manifest.json +5 -3
  8. package/.next/required-server-files.json +4 -5
  9. package/.next/server/app/_not-found/page.js +2 -2
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +8 -8
  14. package/.next/server/app/api/backlog/route.js +1 -1
  15. package/.next/server/app/api/backlog/route.js.nft.json +1 -1
  16. package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/browse-directory/route.js +1 -1
  18. package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/filesystem/browse/route.js +1 -1
  20. package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/issues/route.js +1 -1
  22. package/.next/server/app/api/issues/route.js.nft.json +1 -1
  23. package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/observability/route.js +1 -1
  25. package/.next/server/app/api/observability/route.js.nft.json +1 -1
  26. package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/orchestrators/route.js +1 -1
  28. package/.next/server/app/api/orchestrators/route.js.nft.json +1 -1
  29. package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/projects/[id]/route.js +5 -1
  31. package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/projects/reload/route.js +1 -1
  34. package/.next/server/app/api/projects/reload/route.js.nft.json +1 -1
  35. package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/projects/route.js +1 -1
  37. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  38. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
  40. package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
  41. package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/runtime/terminal/route.js +1 -1
  43. package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
  45. package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  46. package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
  48. package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
  49. package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
  51. package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
  52. package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
  54. package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  55. package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  57. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
  60. package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  61. package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/sessions/patches/route.js +1 -1
  63. package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -1
  64. package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/sessions/route.js +1 -1
  66. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  67. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/setup-labels/route.js +1 -1
  69. package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
  70. package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/spawn/route.js +1 -1
  72. package/.next/server/app/api/spawn/route.js.nft.json +1 -1
  73. package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/update/route.js +1 -0
  75. package/.next/server/app/api/update/route.js.nft.json +1 -0
  76. package/.next/server/app/api/update/route_client-reference-manifest.js +1 -0
  77. package/.next/server/app/api/verify/route.js +1 -1
  78. package/.next/server/app/api/verify/route.js.nft.json +1 -1
  79. package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/version/route.js +1 -0
  81. package/.next/server/app/api/version/route.js.nft.json +1 -0
  82. package/.next/server/app/api/version/route_client-reference-manifest.js +1 -0
  83. package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
  84. package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
  85. package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/apple-icon/route.js +1 -1
  87. package/.next/server/app/apple-icon/route.js.nft.json +1 -1
  88. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/apple-icon.body +0 -0
  90. package/.next/server/app/dev/terminal-test/page.js +3 -3
  91. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  92. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/dev/terminal-test.html +1 -1
  94. package/.next/server/app/dev/terminal-test.rsc +9 -9
  95. package/.next/server/app/icon/route.js +1 -1
  96. package/.next/server/app/icon/route.js.nft.json +1 -1
  97. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/icon-192/route.js +1 -1
  99. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  100. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/icon-512/route.js +1 -1
  102. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  103. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/icon.body +0 -0
  105. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  106. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  107. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/manifest.webmanifest.body +1 -1
  109. package/.next/server/app/orchestrators/page.js +2 -2
  110. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  111. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/page.js +2 -2
  113. package/.next/server/app/page.js.nft.json +1 -1
  114. package/.next/server/app/page_client-reference-manifest.js +1 -1
  115. package/.next/server/app/projects/[projectId]/page.js +2 -2
  116. package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  117. package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  118. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -2
  119. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -1
  120. package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -1
  121. package/.next/server/app/projects/[projectId]/settings/page.js +2 -2
  122. package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -1
  123. package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/prs/page.js +2 -2
  125. package/.next/server/app/prs/page.js.nft.json +1 -1
  126. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/sessions/[id]/page.js +2 -2
  128. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  129. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  130. package/.next/server/app/test-direct/page.js +2 -2
  131. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  132. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/test-direct.html +1 -1
  134. package/.next/server/app/test-direct.rsc +9 -9
  135. package/.next/server/app-paths-manifest.json +18 -16
  136. package/.next/server/chunks/1271.js +1 -1
  137. package/.next/server/chunks/1876.js +2 -2
  138. package/.next/server/chunks/3714.js +1 -1
  139. package/.next/server/chunks/4520.js +1 -1
  140. package/.next/server/chunks/6013.js +884 -0
  141. package/.next/server/chunks/6848.js +1 -0
  142. package/.next/server/chunks/7167.js +1 -1
  143. package/.next/server/chunks/7173.js +1 -1
  144. package/.next/server/chunks/7227.js +604 -0
  145. package/.next/server/chunks/9291.js +3 -0
  146. package/.next/server/middleware-build-manifest.js +1 -1
  147. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  148. package/.next/server/pages/404.html +1 -1
  149. package/.next/server/pages/500.html +1 -1
  150. package/.next/server/server-reference-manifest.json +1 -1
  151. package/.next/static/9ARsRA8WlFgsAl-7NPrHh/_buildManifest.js +1 -0
  152. package/.next/static/chunks/1654.ac304fc9e36ec94a.js +1 -0
  153. package/.next/static/chunks/3764.cdef4e76dbc23af8.js +1 -0
  154. package/.next/static/chunks/3780-7bdc52d8370adf2f.js +1 -0
  155. package/.next/static/chunks/{5795-b96fd46c8c7344fc.js → 5795-a4dd81606df09bc4.js} +1 -1
  156. package/.next/static/chunks/6231-57dd9c1e306c7069.js +1 -0
  157. package/.next/static/chunks/app/_not-found/page-8b5044bdc951ae98.js +1 -0
  158. package/.next/static/chunks/app/api/backlog/route-8b5044bdc951ae98.js +1 -0
  159. package/.next/static/chunks/app/api/browse-directory/route-8b5044bdc951ae98.js +1 -0
  160. package/.next/static/chunks/app/api/filesystem/browse/route-8b5044bdc951ae98.js +1 -0
  161. package/.next/static/chunks/app/api/issues/route-8b5044bdc951ae98.js +1 -0
  162. package/.next/static/chunks/app/api/observability/route-8b5044bdc951ae98.js +1 -0
  163. package/.next/static/chunks/app/api/orchestrators/route-8b5044bdc951ae98.js +1 -0
  164. package/.next/static/chunks/app/api/projects/[id]/route-8b5044bdc951ae98.js +1 -0
  165. package/.next/static/chunks/app/api/projects/reload/route-8b5044bdc951ae98.js +1 -0
  166. package/.next/static/chunks/app/api/projects/route-8b5044bdc951ae98.js +1 -0
  167. package/.next/static/chunks/app/api/prs/[id]/merge/route-8b5044bdc951ae98.js +1 -0
  168. package/.next/static/chunks/app/api/runtime/terminal/route-8b5044bdc951ae98.js +1 -0
  169. package/.next/static/chunks/app/api/sessions/[id]/kill/route-8b5044bdc951ae98.js +1 -0
  170. package/.next/static/chunks/app/api/sessions/[id]/message/route-8b5044bdc951ae98.js +1 -0
  171. package/.next/static/chunks/app/api/sessions/[id]/remap/route-8b5044bdc951ae98.js +1 -0
  172. package/.next/static/chunks/app/api/sessions/[id]/restore/route-8b5044bdc951ae98.js +1 -0
  173. package/.next/static/chunks/app/api/sessions/[id]/route-8b5044bdc951ae98.js +1 -0
  174. package/.next/static/chunks/app/api/sessions/[id]/send/route-8b5044bdc951ae98.js +1 -0
  175. package/.next/static/chunks/app/api/sessions/patches/route-8b5044bdc951ae98.js +1 -0
  176. package/.next/static/chunks/app/api/sessions/route-8b5044bdc951ae98.js +1 -0
  177. package/.next/static/chunks/app/api/setup-labels/route-8b5044bdc951ae98.js +1 -0
  178. package/.next/static/chunks/app/api/spawn/route-8b5044bdc951ae98.js +1 -0
  179. package/.next/static/chunks/app/api/update/route-8b5044bdc951ae98.js +1 -0
  180. package/.next/static/chunks/app/api/verify/route-8b5044bdc951ae98.js +1 -0
  181. package/.next/static/chunks/app/api/version/route-8b5044bdc951ae98.js +1 -0
  182. package/.next/static/chunks/app/api/webhooks/[...slug]/route-8b5044bdc951ae98.js +1 -0
  183. package/.next/static/chunks/app/apple-icon/route-8b5044bdc951ae98.js +1 -0
  184. package/.next/static/chunks/app/dev/terminal-test/page-a6f86436c4a06eeb.js +1 -0
  185. package/.next/static/chunks/app/{error-684a1c5596fa1e14.js → error-d4f7c3a8dd722e8f.js} +1 -1
  186. package/.next/static/chunks/app/{global-error-1a79bacfbd9b1ba4.js → global-error-cb3a4148c223622a.js} +1 -1
  187. package/.next/static/chunks/app/icon/route-8b5044bdc951ae98.js +1 -0
  188. package/.next/static/chunks/app/icon-192/route-8b5044bdc951ae98.js +1 -0
  189. package/.next/static/chunks/app/icon-512/route-8b5044bdc951ae98.js +1 -0
  190. package/.next/static/chunks/app/layout-e4c02836878bea2d.js +1 -0
  191. package/.next/static/chunks/app/loading-8b5044bdc951ae98.js +1 -0
  192. package/.next/static/chunks/app/manifest.webmanifest/route-8b5044bdc951ae98.js +1 -0
  193. package/.next/static/chunks/app/not-found-982c28ba7f6492be.js +1 -0
  194. package/.next/static/chunks/app/orchestrators/{page-e3a2c53b57dd8391.js → page-11a10c8b0bea320d.js} +1 -1
  195. package/.next/static/chunks/app/page-31df8f5f0d079eba.js +1 -0
  196. package/.next/static/chunks/app/projects/[projectId]/loading-8b5044bdc951ae98.js +1 -0
  197. package/.next/static/chunks/app/projects/[projectId]/{page-19a6d4cc9951a9e4.js → page-f076731a5810b255.js} +1 -1
  198. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-7e46ee5c902c28aa.js +1 -0
  199. package/.next/static/chunks/app/projects/[projectId]/settings/page-40047db90c406c9e.js +1 -0
  200. package/.next/static/chunks/app/prs/page-5015d39fb7984d26.js +1 -0
  201. package/.next/static/chunks/app/sessions/[id]/{error-62e9972b39d9cd16.js → error-147fb962bda03d23.js} +1 -1
  202. package/.next/static/chunks/app/sessions/[id]/loading-8b5044bdc951ae98.js +1 -0
  203. package/.next/static/chunks/app/sessions/[id]/not-found-982c28ba7f6492be.js +1 -0
  204. package/.next/static/chunks/app/sessions/[id]/page-0a74680de719ca58.js +1 -0
  205. package/.next/static/chunks/app/test-direct/{page-ee0944bcd355194e.js → page-cbca94d9a5985aea.js} +1 -1
  206. package/.next/static/chunks/main-app-113c48dd1c080c52.js +1 -0
  207. package/.next/static/chunks/{webpack-83d2d8248a30259c.js → webpack-ecf0988dbb79e19b.js} +1 -1
  208. package/.next/static/css/b93232cd4a58743d.css +1 -0
  209. package/dist-server/direct-terminal-ws.js +12 -2
  210. package/dist-server/mux-websocket.js +270 -70
  211. package/dist-server/start-all.js +28 -6
  212. package/dist-server/tmux-utils.js +124 -2
  213. package/next.config.js +26 -0
  214. package/package.json +26 -12
  215. package/.next/server/chunks/1172.js +0 -1
  216. package/.next/server/chunks/6811.js +0 -3
  217. package/.next/server/chunks/801.js +0 -658
  218. package/.next/server/chunks/9223.js +0 -440
  219. package/.next/static/chunks/1383.8f5f7d4606d356cc.js +0 -1
  220. package/.next/static/chunks/3764.88619fb0d047cae8.js +0 -1
  221. package/.next/static/chunks/3780-52c4733ce6591b8d.js +0 -1
  222. package/.next/static/chunks/4465-17154f7a01abfe85.js +0 -1
  223. package/.next/static/chunks/app/_not-found/page-3b8a01e726e988c8.js +0 -1
  224. package/.next/static/chunks/app/api/backlog/route-3b8a01e726e988c8.js +0 -1
  225. package/.next/static/chunks/app/api/browse-directory/route-3b8a01e726e988c8.js +0 -1
  226. package/.next/static/chunks/app/api/filesystem/browse/route-3b8a01e726e988c8.js +0 -1
  227. package/.next/static/chunks/app/api/issues/route-3b8a01e726e988c8.js +0 -1
  228. package/.next/static/chunks/app/api/observability/route-3b8a01e726e988c8.js +0 -1
  229. package/.next/static/chunks/app/api/orchestrators/route-3b8a01e726e988c8.js +0 -1
  230. package/.next/static/chunks/app/api/projects/[id]/route-3b8a01e726e988c8.js +0 -1
  231. package/.next/static/chunks/app/api/projects/reload/route-3b8a01e726e988c8.js +0 -1
  232. package/.next/static/chunks/app/api/projects/route-3b8a01e726e988c8.js +0 -1
  233. package/.next/static/chunks/app/api/prs/[id]/merge/route-3b8a01e726e988c8.js +0 -1
  234. package/.next/static/chunks/app/api/runtime/terminal/route-3b8a01e726e988c8.js +0 -1
  235. package/.next/static/chunks/app/api/sessions/[id]/kill/route-3b8a01e726e988c8.js +0 -1
  236. package/.next/static/chunks/app/api/sessions/[id]/message/route-3b8a01e726e988c8.js +0 -1
  237. package/.next/static/chunks/app/api/sessions/[id]/remap/route-3b8a01e726e988c8.js +0 -1
  238. package/.next/static/chunks/app/api/sessions/[id]/restore/route-3b8a01e726e988c8.js +0 -1
  239. package/.next/static/chunks/app/api/sessions/[id]/route-3b8a01e726e988c8.js +0 -1
  240. package/.next/static/chunks/app/api/sessions/[id]/send/route-3b8a01e726e988c8.js +0 -1
  241. package/.next/static/chunks/app/api/sessions/patches/route-3b8a01e726e988c8.js +0 -1
  242. package/.next/static/chunks/app/api/sessions/route-3b8a01e726e988c8.js +0 -1
  243. package/.next/static/chunks/app/api/setup-labels/route-3b8a01e726e988c8.js +0 -1
  244. package/.next/static/chunks/app/api/spawn/route-3b8a01e726e988c8.js +0 -1
  245. package/.next/static/chunks/app/api/verify/route-3b8a01e726e988c8.js +0 -1
  246. package/.next/static/chunks/app/api/webhooks/[...slug]/route-3b8a01e726e988c8.js +0 -1
  247. package/.next/static/chunks/app/apple-icon/route-3b8a01e726e988c8.js +0 -1
  248. package/.next/static/chunks/app/dev/terminal-test/page-59decd1aad4e02ad.js +0 -1
  249. package/.next/static/chunks/app/icon/route-3b8a01e726e988c8.js +0 -1
  250. package/.next/static/chunks/app/icon-192/route-3b8a01e726e988c8.js +0 -1
  251. package/.next/static/chunks/app/icon-512/route-3b8a01e726e988c8.js +0 -1
  252. package/.next/static/chunks/app/layout-0cda720d75f111b8.js +0 -1
  253. package/.next/static/chunks/app/loading-3b8a01e726e988c8.js +0 -1
  254. package/.next/static/chunks/app/manifest.webmanifest/route-3b8a01e726e988c8.js +0 -1
  255. package/.next/static/chunks/app/not-found-315f4e5c106b425d.js +0 -1
  256. package/.next/static/chunks/app/page-e2e589ea11a0780a.js +0 -1
  257. package/.next/static/chunks/app/projects/[projectId]/loading-3b8a01e726e988c8.js +0 -1
  258. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-75c536c9755754f7.js +0 -1
  259. package/.next/static/chunks/app/projects/[projectId]/settings/page-f8c323b91978efff.js +0 -1
  260. package/.next/static/chunks/app/prs/page-08f17d7dc341b6f1.js +0 -1
  261. package/.next/static/chunks/app/sessions/[id]/loading-3b8a01e726e988c8.js +0 -1
  262. package/.next/static/chunks/app/sessions/[id]/not-found-315f4e5c106b425d.js +0 -1
  263. package/.next/static/chunks/app/sessions/[id]/page-d0b08722dec5a04a.js +0 -1
  264. package/.next/static/chunks/main-app-b95f197c38e3b0a3.js +0 -1
  265. package/.next/static/css/cf9226160e230bf4.css +0 -1
  266. package/.next/static/h0RXs0prE87a8wlbEXQKM/_buildManifest.js +0 -1
  267. /package/.next/static/{h0RXs0prE87a8wlbEXQKM → 9ARsRA8WlFgsAl-7NPrHh}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5795],{1712:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},2466:(e,r,s)=>{s.d(r,{I:()=>t});let t=(0,s(6749).createContext)(null)},2537:(e,r,s)=>{s.d(r,{X:()=>l});var t=s(3817),a=s(8713),n=s.n(a);function l(e){let{ariaLabel:r,activeTab:s,dashboardHref:a,prsHref:l,showOrchestrator:o=!0,orchestratorHref:i=null}=e;return(0,t.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":r,children:[(0,t.jsxs)(n(),{href:a,className:"mobile-bottom-nav__item","data-active":"dashboard"===s?"true":"false","aria-current":"dashboard"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.jsxs)(n(),{href:l,className:"mobile-bottom-nav__item","data-active":"prs"===s?"true":"false","aria-current":"prs"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,t.jsx)("span",{children:"PRs"})]}),o?i?(0,t.jsxs)(n(),{href:i,className:"mobile-bottom-nav__item","data-active":"orchestrator"===s?"true":"false","aria-current":"orchestrator"===s?"page":void 0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):(0,t.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):null]})}},5468:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return o}});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class t{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return a?new a:new t}function l(e){return a?a.bind(e):t.bind(e)}function o(){return a?a.snapshot():function(e,...r){return e(...r)}}},5795:(e,r,s)=>{s.r(r),s.d(r,{default:()=>W});var t=s(3817),a=s(6749),n=s(7594),l=s(5425),o=s(9120),i=s(545),c=s(9891),d=s(7387),u=s(2466),h=s(8450),p=s(9293),m=s(2537),b=s(4901);let f={active:{label:"Active",color:"var(--color-status-working)"},ready:{label:"Ready",color:"var(--color-status-ready)"},idle:{label:"Idle",color:"var(--color-status-idle)"},waiting_input:{label:"Waiting for input",color:"var(--color-status-attention)"},blocked:{label:"Blocked",color:"var(--color-status-error)"},exited:{label:"Exited",color:"var(--color-status-error)"}};function v(e){if(e.includes("\x3c!-- DESCRIPTION START --\x3e")||e.includes("### ")){let r=e.match(/###\s+(.+?)(?:\n|$)/),s=r?r[1].replace(/\*\*/g,"").trim():"Comment",t=e.match(/<!-- DESCRIPTION START -->\s*([\s\S]*?)\s*<!-- DESCRIPTION END -->/);return{title:s,description:t?t[1].trim():e.split("\n")[0]||"No description"}}return{title:"Comment",description:e.trim()}}function x(e){let{comments:r,unresolvedThreads:s,sendingUrls:a,sentUrls:n,errorUrls:l,onAskAgentToFix:o}=e;return 0===r.length?null:(0,t.jsxs)("details",{className:"session-detail-comments-strip",children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comments-strip__toggle",children:[(0,t.jsx)("svg",{className:"session-detail-comments-strip__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comments-strip__label",children:"Unresolved Comments"}),(0,t.jsx)("span",{className:"session-detail-comments-strip__count",children:s}),(0,t.jsx)("span",{className:"session-detail-comments-strip__hint",children:"click to expand"})]})}),(0,t.jsx)("div",{className:"session-detail-comments-strip__body",children:r.map((e,r)=>{let{title:s,description:i}=v(e.body),c=a.has(e.url),d=n.has(e.url),u=l.has(e.url);return(0,t.jsxs)("details",{className:"session-detail-comment",open:0===r,children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comment__row",children:[(0,t.jsx)("svg",{className:"session-detail-comment__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comment__title",children:s}),(0,t.jsxs)("span",{className:"session-detail-comment__author",children:["\xb7 ",e.author]}),(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"session-detail-comment__view",children:"view →"})]})}),(0,t.jsxs)("div",{className:"session-detail-comment__body",children:[(0,t.jsx)("div",{className:"session-detail-comment__file",children:e.path}),(0,t.jsx)("p",{className:"session-detail-comment__text",children:i}),(0,t.jsx)("button",{onClick:()=>o(e),disabled:c,className:(0,b.cn)("session-detail-comment__fix-btn",d&&"session-detail-comment__fix-btn--sent",u&&"session-detail-comment__fix-btn--error"),children:c?"Sending…":d?"Sent ✓":u?"Failed":"Ask Agent to Fix"})]})]},e.url)})})]})}function j(e){return!(0,i.sZ)(e)&&!(0,i.fZ)(e)&&"merged"!==e.state&&!e.mergeability.noConflicts}function g(e){var r;let{pr:s,metadata:n,lifecyclePrReason:o,onAskAgentToFix:c}=e,[d,u]=(0,a.useState)(new Set),[h,p]=(0,a.useState)(new Set),[m,f]=(0,a.useState)(new Set),[v,g]=(0,a.useState)(!1),y=(0,a.useRef)(new Map);(0,a.useEffect)(()=>()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear()},[]);let w=async e=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>{let s=new Set(r);return s.delete(e.url),s}),u(r=>new Set(r).add(e.url)),await c(e,()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),p(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)},()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{f(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)})},N=(0,i.QN)(s),_=function(e,r,s){let t=[],a=!!r.lastCIFailureDispatchHash,n="true"===r.lastMergeConflictDispatched,o=!!r.lastPendingReviewDispatchHash,i=r.status,c=e.ciStatus===l.U1.FAILING||"ci_failing"===s||"ci_failed"===i,d="changes_requested"===e.reviewDecision||"changes_requested"===s||"changes_requested"===i,u=j(e);if(c){let r=e.ciChecks.filter(e=>"failed"===e.status).length;t.push({icon:"✗",variant:"fail",text:r>0?"".concat(r," check").concat(1!==r?"s":""," failing"):"CI failing",notified:a})}else e.ciStatus===l.U1.PENDING&&t.push({icon:"●",variant:"warn",text:"CI pending"});return d?t.push({icon:"✗",variant:"fail",text:"Changes requested",notified:o}):e.mergeability.approved||t.push({icon:"○",variant:"muted",text:"Awaiting reviewer"}),u&&t.push({icon:"✗",variant:"fail",text:"Merge conflicts",notified:n}),e.isDraft&&t.push({icon:"○",variant:"muted",text:"Draft"}),t}(s,n,o),k=null!=(r=s.changedFiles)?r:0,C=j(s)&&"open"===s.state,S=C?function(e){let r=encodeURIComponent(e.owner),s=encodeURIComponent(e.repo),t=encodeURIComponent(e.baseBranch),a=encodeURIComponent(e.branch);return"https://github.com/".concat(r,"/").concat(s,"/compare/").concat(t,"...").concat(a)}(s):"";return(0,t.jsxs)("div",{className:(0,b.cn)("session-detail-pr-card",N&&"session-detail-pr-card--green"),children:[(0,t.jsxs)("div",{className:"session-detail-pr-card__row",children:[(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-card__title-link",children:["PR #",s.number,": ",s.title]}),(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-stats",children:[(0,t.jsxs)("span",{className:"session-detail-diff--add",children:["+",s.additions]})," ",(0,t.jsxs)("span",{className:"session-detail-diff--del",children:["-",s.deletions]})]}),k>0?(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-label",children:[k," file",1!==k?"s":""]}):null,s.isDraft?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Draft"}):null,"merged"===s.state?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Merged"}):null]}),C?(0,t.jsxs)("div",{className:"session-detail-pr-card__merge-actions",role:"group","aria-label":"Resolve merge conflicts",children:[(0,t.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-merge-action",children:"Compare with base branch"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;let r=null==(e=navigator.clipboard)?void 0:e.writeText(s.branch);r&&r.then(()=>{g(!0);let e="__copy-branch",r=y.current.get(e);r&&clearTimeout(r);let s=setTimeout(()=>{g(!1),y.current.delete(e)},2e3);y.current.set(e,s)}).catch(()=>{})},"aria-label":v?"Head branch name copied":"Copy head branch name",className:"session-detail-pr-merge-action session-detail-pr-merge-action--btn",children:v?"Copied branch name":"Copy head branch name"})]}):null,(0,t.jsxs)("div",{className:"session-detail-pr-card__details",children:[N?(0,t.jsxs)("div",{className:"session-detail-merge-banner",children:[(0,t.jsx)("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})}),"Ready to merge"]}):_.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-blocker-chip","fail"===e.variant&&"session-detail-blocker-chip--fail","warn"===e.variant&&"session-detail-blocker-chip--warn","muted"===e.variant&&"session-detail-blocker-chip--muted"),children:[e.icon," ",e.text,e.notified?(0,t.jsx)("span",{className:"session-detail-blocker-chip__note",children:"\xb7 notified"}):null]},e.text)),s.ciChecks.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"session-detail-pr-sep"}),s.ciChecks.map((e,r)=>{var s;let a=null!=(s=e.url)?s:"".concat(e.name,"-").concat(r),n=(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-ci-chip","passed"===e.status&&"session-detail-ci-chip--pass","failed"===e.status&&"session-detail-ci-chip--fail","pending"===e.status&&"session-detail-ci-chip--pending","passed"!==e.status&&"failed"!==e.status&&"pending"!==e.status&&"session-detail-ci-chip--queued"),children:["passed"===e.status?"✓":"failed"===e.status?"✗":"pending"===e.status?"●":"○"," ",e.name]});return e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:no-underline",onClick:e=>e.stopPropagation(),children:n},a):(0,t.jsx)("span",{children:n},a)})]}):null]}),(0,t.jsx)(x,{comments:s.unresolvedComments,unresolvedThreads:s.unresolvedThreads,sendingUrls:d,sentUrls:h,errorUrls:m,onAskAgentToFix:w})]})}function y(e,r){let s=e.trim();return s.length<=r?s:"".concat(s.slice(0,Math.max(0,r-1)).trimEnd(),"…")}async function w(e,r,s,t){try{let t=function(e){let{title:r,description:s}=v(e.body),t=["Please address this review comment:\n","File: ".concat(y(e.path,500)),"Comment: ".concat(y(r,240)),"Description: ".concat(y(s,7500)),"","Resolve the comment at ".concat(e.url," after fixing it.")].join("\n");return y(t,9500)}(r),a=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})});if(!a.ok)throw Error("HTTP ".concat(a.status));s()}catch(e){console.error("Failed to send message to agent:",e),t()}}function N(e){let{zones:r}=e,s=[{value:r.merge,label:"merge",toneClass:"topbar-zone-pill--merge"},{value:r.respond,label:"respond",toneClass:"topbar-zone-pill--respond"},{value:r.review,label:"review",toneClass:"topbar-zone-pill--review"},{value:r.working,label:"working",toneClass:"topbar-zone-pill--working"},{value:r.pending,label:"pending",toneClass:"topbar-zone-pill--pending"},{value:r.done,label:"done",toneClass:"topbar-zone-pill--done"}].filter(e=>e.value>0);return 0===s.length?null:(0,t.jsx)(t.Fragment,{children:s.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("topbar-zone-pill",e.toneClass),children:[(0,t.jsx)("span",{className:"topbar-zone-pill__value",children:e.value}),(0,t.jsx)("span",{className:"topbar-zone-pill__label",children:e.label})]},e.label))})}function _(e){var r,s,n,o;let{session:c,isOrchestrator:d,isMobile:u,terminalEnded:h,isRestorable:p,activity:m,headline:f,projects:v,orchestratorHref:x,orchestratorZones:j,onToggleSidebar:y,onRestore:_,onKill:k}=e,C=c.pr,S=!!C&&(0,i.QN)(C),[I,M]=(0,a.useState)(!1),R=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!I)return;let e=e=>{R.current&&!R.current.contains(e.target)&&M(!1)},r=e=>{"Escape"===e.key&&M(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",r)}},[I]);let T=null!=(n=null==(r=v.find(e=>e.id===c.projectId))?void 0:r.name)?n:c.projectId,P="agent orchestrator"!==T.trim().toLowerCase();return(0,t.jsxs)("header",{className:"dashboard-app-header",children:[v.length>0?(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:y,"aria-label":"Toggle sidebar",children:u?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}):null,(0,t.jsx)("div",{className:"dashboard-app-header__brand dashboard-app-header__brand--hide-mobile",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),P&&(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"topbar-project-pills-group",children:[(0,t.jsxs)("div",{className:"topbar-project-line",children:[P&&(0,t.jsx)("span",{className:"dashboard-app-header__project",children:T}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-mobile-only",children:c.id}),d&&(0,t.jsx)("span",{className:"session-detail-mode-badge",children:"orchestrator"})]}),(0,t.jsxs)("div",{className:"topbar-session-pills",children:[(0,t.jsxs)("div",{className:(0,b.cn)("topbar-status-pill","topbar-status-pill--".concat(m.label.toLowerCase().replace(/\s+/g,"-"))),children:[(0,t.jsx)("span",{className:"topbar-status-pill__dot",style:{background:m.color}}),(0,t.jsx)("span",{className:"topbar-status-pill__label",children:m.label})]}),c.branch?C?(0,t.jsx)("a",{href:function(e){let r="https://github.com";try{r=new URL(e.url).origin}catch(e){}return"".concat(r,"/").concat(e.owner,"/").concat(e.repo,"/tree/").concat(e.branch)}(C),target:"_blank",rel:"noopener noreferrer",className:"topbar-branch-pill topbar-branch-pill--link",children:c.branch}):(0,t.jsx)("span",{className:"topbar-branch-pill",children:c.branch}):null,d&&j?(0,t.jsx)(N,{zones:j}):null]})]}),(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsx)("span",{className:"dashboard-app-header__session-title topbar-desktop-only",children:f}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-desktop-only",children:c.id}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,t.jsxs)("div",{className:"dashboard-app-header__actions",children:[C?(0,t.jsxs)("div",{className:"topbar-pr-btn-wrap",ref:R,children:[(0,t.jsxs)("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:(0,b.cn)("dashboard-app-btn topbar-pr-btn",I&&"topbar-pr-btn--open"),onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),M(e=>!e))},"aria-expanded":I,"aria-label":"PR #".concat(C.number),children:[(0,t.jsx)("span",{className:(0,b.cn)("topbar-pr-dot",S?"topbar-pr-dot--green":C.ciStatus===l.U1.FAILING||"changes_requested"===C.reviewDecision?"topbar-pr-dot--red":"topbar-pr-dot--amber")}),"PR #",C.number,(0,t.jsx)("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:I?"M18 15l-6-6-6 6":"M6 9l6 6 6-6"})})]}),I&&(0,t.jsx)("div",{className:"topbar-pr-popover",children:(0,t.jsx)(g,{pr:C,metadata:c.metadata,lifecyclePrReason:null!=(o=null==(s=c.lifecycle)?void 0:s.prReason)?o:void 0,onAskAgentToFix:(e,r,s)=>w(c.id,e,r,s)})})]}):null,p?(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--restore",onClick:_,children:[(0,t.jsxs)("svg",{className:"topbar-action-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,t.jsx)("path",{d:"M4 5v4h4"}),(0,t.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,t.jsx)("path",{d:"M20 19v-4h-4"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Restore"})]}):d||h?null:(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--danger",onClick:k,children:[(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Kill"})]}),x?(0,t.jsxs)("a",{href:x,className:"dashboard-app-btn dashboard-app-btn--amber topbar-desktop-only","aria-label":"Orchestrator",children:[(0,t.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,t.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Orchestrator"})]}):null]})]})}function k(e){var r,s,a,n,l,o,i,c,u,h;let{session:p,headline:m,pr:b,dashboardHref:f}=e,v=(null==(h=p.lifecycle)?void 0:h.runtime.reasonLabel)?p.lifecycle.runtime.reasonLabel:"killed"===p.status?"Manually stopped":"terminated"===p.status?"Runtime unavailable":"done"===p.status||"merged"===p.status?"Work completed":"Terminal ended",x=function(e,r){var s;let t=e.metadata.pinnedSummary;return t||(e.summary&&!e.summaryIsFallback?e.summary:(null==(s=e.lifecycle)?void 0:s.summary)?e.lifecycle.summary:e.userPrompt?e.userPrompt:e.summary?e.summary:r)}(p,m),j=null!=(c=null!=(i=null!=(o=null==(r=p.lifecycle)?void 0:r.session.terminatedAt)?o:null==(s=p.lifecycle)?void 0:s.session.completedAt)?i:null==(a=p.lifecycle)?void 0:a.session.lastTransitionAt)?c:p.lastActivityAt,g=null!=(u=null==(n=p.lifecycle)?void 0:n.runtime.label)?u:"Unavailable",y=b?"merged"===b.state?"Merged":"closed"===b.state?"Closed":b.mergeability.mergeable?"Open, merge-ready":"Open":"No PR";return(0,t.jsx)("section",{className:"session-ended-summary","aria-label":"Session ended summary",children:(0,t.jsxs)("div",{className:"session-ended-summary__panel",children:[(0,t.jsx)("div",{className:"session-ended-summary__eyebrow",children:"Terminal ended"}),(0,t.jsxs)("div",{className:"session-ended-summary__header",children:[(0,t.jsx)("div",{className:"session-ended-summary__icon","aria-hidden":"true",children:(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),(0,t.jsx)("path",{d:"M7 10l3 2-3 2"}),(0,t.jsx)("path",{d:"M13 15h4"})]})}),(0,t.jsxs)("div",{className:"session-ended-summary__title-group",children:[(0,t.jsx)("h2",{className:"session-ended-summary__title",children:m}),(0,t.jsxs)("p",{className:"session-ended-summary__subtitle",children:[v,". The live terminal is gone, but the session context is still available."]})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__body",children:[(0,t.jsxs)("div",{className:"session-ended-summary__section",children:[(0,t.jsx)("div",{className:"session-ended-summary__label",children:"What happened"}),(0,t.jsx)("p",{className:"session-ended-summary__copy",children:x})]}),(0,t.jsxs)("div",{className:"session-ended-summary__facts","aria-label":"Session facts",children:[(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Session"}),(0,t.jsx)("strong",{children:p.id})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Ended"}),(0,t.jsx)("strong",{children:function(e){if(!e)return"Unknown";let r=new Date(e).getTime();return Number.isFinite(r)?(0,d.fw)(r):"Unknown"}(j)})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Runtime"}),(0,t.jsx)("strong",{children:g})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"PR"}),(0,t.jsx)("strong",{children:y})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__links",children:[b?(0,t.jsxs)("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"session-ended-summary__primary",children:["Open PR #",b.number]}):null,(0,t.jsx)("a",{href:f,className:"session-ended-summary__secondary",children:"Back to dashboard"})]}),(null==(l=p.lifecycle)?void 0:l.evidence)?(0,t.jsxs)("div",{className:"session-ended-summary__evidence",children:[(0,t.jsx)("span",{children:"Evidence"}),(0,t.jsx)("code",{children:p.lifecycle.evidence})]}):null]})]})})}let C=(0,c.default)(()=>Promise.all([s.e(8944),s.e(1383)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full animate-pulse rounded bg-[var(--color-bg-primary)]"})});function S(e){var r,s,l;let{session:c,isOrchestrator:b=!1,orchestratorZones:v,projectOrchestratorId:x=null,projects:j=[],sidebarSessions:g=[],sidebarOrchestrators:y,sidebarLoading:w=!1,sidebarError:N=!1,onRetrySidebar:S}=e,I=(0,n.useRouter)(),M=(0,n.useSearchParams)(),R=(0,o.U)(o.D),T="true"===M.get("fullscreen"),[P,E]=(0,a.useState)(!1),[O,A]=(0,a.useState)(!1),[D,L]=(0,a.useState)(!1),F=c.pr,B=i.CM.has(c.status),U=B&&!i.N_.has(c.status),W=null!=(l=c.activity&&f[c.activity])?l:{label:null!=(s=c.activity)?s:"unknown",color:"var(--color-text-muted)"},z=(0,d.Pn)(c),H=b?"orchestrator":"agent",q="opencode"===c.metadata.agent,V="string"==typeof c.metadata.opencodeSessionId&&c.metadata.opencodeSessionId.length>0?c.metadata.opencodeSessionId:void 0,J=c.projectId?(0,h.bn)(c.projectId):"/",G=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/kill"),{method:"POST"});if(!e.ok)throw Error("HTTP ".concat(e.status));if(x)return void I.push((0,h.Nc)(c.projectId,x));I.push(J)}catch(e){console.error("Failed to kill session:",e)}},[J,x,I,c.id,c.projectId]),K=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/restore"),{method:"POST"});if(!e.ok){let r=await e.text().catch(()=>"");throw Error(r||"HTTP ".concat(e.status))}window.location.reload()}catch(e){console.error("Failed to restore session:",e)}},[c.id]),Z=(0,a.useMemo)(()=>b?(0,h.Nc)(c.projectId,c.id):x?(0,h.Nc)(c.projectId,x):null,[b,x,c.id,c.projectId]);(0,a.useEffect)(()=>{let e=window.requestAnimationFrame(()=>L(!0));return()=>{window.cancelAnimationFrame(e),L(!1)}},[c.id]);let X=(0,a.useCallback)(()=>{R?A(e=>!e):E(e=>!e)},[R]);return(0,t.jsx)(u.I.Provider,{value:{onToggleSidebar:X,mobileSidebarOpen:O},children:(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsx)(_,{session:c,isOrchestrator:b,isMobile:R,terminalEnded:B,isRestorable:U,activity:W,headline:z,projects:j,orchestratorHref:Z,orchestratorZones:v,onToggleSidebar:X,onRestore:K,onKill:G}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(P?" dashboard-shell--sidebar-collapsed":""),children:[j.length>0?(0,t.jsx)("div",{className:"sidebar-wrapper".concat(O?" sidebar-wrapper--mobile-open":""),children:(0,t.jsx)(p.u,{projects:j,sessions:g,orchestrators:y,loading:w,error:N,onRetry:S,activeProjectId:c.projectId,activeSessionId:c.id,collapsed:P,onToggleCollapsed:()=>E(e=>!e),onMobileClose:()=>A(!1)})}):null,O&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>A(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:D?B?(0,t.jsx)(k,{session:c,headline:z,pr:F,dashboardHref:J}):(0,t.jsx)(C,{sessionId:c.id,projectId:c.projectId,tmuxName:null==(r=c.metadata)?void 0:r.tmuxName,startFullscreen:T,variant:H,appearance:"dark",height:"100%",isOpenCodeSession:q,reloadCommand:q&&V?"/exit\nopencode --session ".concat(V,"\n"):void 0,autoFocus:!0}):(0,t.jsx)("div",{className:"session-detail-terminal-placeholder h-full"})})})})]}),(0,t.jsx)(m.X,{ariaLabel:"Session navigation",activeTab:b?"orchestrator":void 0,dashboardHref:J,prsHref:c.projectId?"/?project=".concat(encodeURIComponent(c.projectId),"&tab=prs"):"/",showOrchestrator:!!Z,orchestratorHref:Z})]})})}var I=s(9789);let M={active:"⚡",ready:"\uD83D\uDFE2",idle:"\uD83D\uDCA4",waiting_input:"❓",blocked:"\uD83D\uDEA7",exited:"\uD83D\uDC80"};var R=s(5184),T=s(3394);let P=null,E=null,O=new Set(Object.values(l.SB)),A=new Set(Object.values(l.u3)),D=new Set;function L(e){if(e instanceof DOMException)return"AbortError"===e.name;if(e instanceof Error){let r=e.message.toLowerCase();return r.includes("aborted")||r.includes("aborterror")}return!1}function F(e){let{message:r}=e;return(0,t.jsx)("div",{className:"project-sidebar h-full",children:(0,t.jsxs)("div",{className:"space-y-3 px-3 py-4",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--color-text-tertiary)]",children:"Projects"}),(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:3},(e,r)=>(0,t.jsx)("div",{className:"h-10 animate-pulse border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)]"},"sidebar-placeholder-".concat(r)))}),(0,t.jsx)("div",{className:"pt-2 text-[12px] text-[var(--color-text-tertiary)]",children:r})]})})}function B(e){let{projects:r,projectsLoading:s,sidebarSessions:n,sidebarOrchestrators:l,sidebarLoading:i,sidebarError:c,onRetrySidebar:d,activeProjectId:u,activeSessionId:h,children:m}=e,b=(0,o.U)(o.D),[f,v]=(0,a.useState)(!1),[x,j]=(0,a.useState)(!1),g=(0,a.useCallback)(()=>{if(b)return void j(e=>!e);v(e=>!e)},[b]);return(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsxs)("header",{className:"dashboard-app-header",children:[(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:g,"aria-label":"Toggle sidebar",children:b?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}),(0,t.jsx)("div",{className:"dashboard-app-header__brand",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"})]}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(f?" dashboard-shell--sidebar-collapsed":""),children:[(0,t.jsx)("div",{className:"sidebar-wrapper".concat(x?" sidebar-wrapper--mobile-open":""),children:r.length>0?(0,t.jsx)(p.u,{projects:r,sessions:n,orchestrators:l,loading:i,error:c,onRetry:d,activeProjectId:u,activeSessionId:h,collapsed:f,onToggleCollapsed:()=>v(e=>!e),onMobileClose:()=>j(!1)}):(0,t.jsx)(F,{message:s?"Loading projects...":"Projects unavailable."})}),x&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>j(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0",children:m})})})]})]})}function U(e,r){if(!e||0===r.length)return e;let s=new Map(r.map(e=>[e.id,e])),t=!1,a=e.map(e=>{var r,a;let n=s.get(e.id);if(!n)return e;if(r=n.status,!O.has(r)){let r="status:".concat(n.status);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown status",{sessionId:n.id,status:n.status})),e}if(null!==n.activity&&(a=n.activity,!A.has(a))){let r="activity:".concat(n.activity);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown activity",{sessionId:n.id,activity:n.activity})),e}return e.status===n.status&&e.activity===n.activity&&e.lastActivityAt===n.lastActivityAt?e:(t=!0,{...e,status:n.status,activity:n.activity,lastActivityAt:n.lastActivityAt})});return t?a:e}function W(){var e,r,s;let o=(0,n.useParams)(),c=(0,n.usePathname)(),u=(0,n.useRouter)(),p=o.id,m="string"==typeof o.projectId?o.projectId:Array.isArray(o.projectId)?o.projectId[0]:null,b=(0,R.eT)(),f=(()=>{if("undefined"==typeof sessionStorage)return null;try{let e=sessionStorage.getItem("ao-session-nav:".concat(p));if(e)return sessionStorage.removeItem("ao-session-nav:".concat(p)),JSON.parse(e)}catch(e){}return null})(),[v,x]=(0,a.useState)(f),[j,g]=(0,a.useState)(null),[y,w]=(0,a.useState)(void 0),[N,_]=(0,a.useState)([]),[k,C]=(0,a.useState)(null===P),[O,A]=(0,a.useState)(()=>E),[D,F]=(0,a.useState)(void 0),[W,z]=(0,a.useState)(null===f),[H,q]=(0,a.useState)(null),[V,J]=(0,a.useState)(!1),[G,K]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(new Map),Q=null!=(e=null==v?void 0:v.projectId)?e:null,Y=[...Z.values()],$=!!v&&(0,l.tT)(v,Z.get(v.projectId),Y),ee=(0,a.useRef)(null),er=(0,a.useRef)(!1),es=(0,a.useRef)(null),et=(0,a.useRef)(new Map),ea=(0,a.useRef)(null!==f),en=(0,a.useRef)(null),el=(0,a.useRef)(!1),eo=(0,a.useRef)(!1),ei=(0,a.useRef)(!1),ec=(0,a.useRef)(null),ed=(0,a.useRef)(null),eu=(0,a.useRef)(null),eh=(0,a.useRef)(!1);(0,a.useEffect)(()=>{et.current=Z},[Z]);let ep=(0,a.useCallback)(async()=>{P&&(_(P),X(new Map(P.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))),C(!1));try{var e,r;let s=await (0,T.u)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after ".concat(5e3,"ms")});if(!(null==s?void 0:s.projects))return;e=P,r=s.projects,e&&e.length===r.length&&e.every((e,s)=>{let t=r[s];return JSON.stringify(e)===JSON.stringify(t)})||(P=s.projects,_(s.projects),X(new Map(s.projects.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))))}catch(e){console.error("Failed to fetch projects:",e)}finally{C(!1)}},[]),em=function(e){let r=(0,R.eT)(),s=null==r?void 0:r.sessions.find(r=>r.id===e);return(0,a.useMemo)(()=>{var e;return s?{activity:null!=(e=s.activity)?e:null}:null},[s])}(p);(0,a.useEffect)(()=>{v?document.title=function(e,r,s){var t;let a,n=e.id,o=void 0!==s?s:e.activity,i=o&&null!=(t=M[o])?t:"",c=[...r.values()];return a=(0,l.tT)(e,r.get(e.projectId),c)?"Orchestrator Terminal":function(e,r){let s=Array.from(e);return s.length>40?s.slice(0,40).join("")+"...":e}((0,d.Pn)(e),40),i?"".concat(i," ").concat(n," | ").concat(a):"".concat(n," | ").concat(a)}(v,Z,null==em?void 0:em.activity):document.title="".concat(p," | Session Detail")},[v,p,Z,em]),(0,a.useEffect)(()=>{ee.current=Q},[Q]),(0,a.useEffect)(()=>{if(v&&N.some(e=>e.id===v.projectId)){if(null==c?void 0:c.startsWith("/sessions/"))return void u.replace((0,h.Nc)(v.projectId,v.id));(null==c?void 0:c.startsWith("/projects/"))&&m&&v.projectId!==m&&u.replace((0,h.Nc)(v.projectId,v.id))}},[m,c,N,u,v]),(0,a.useEffect)(()=>{er.current=$},[$]);let eb=(0,a.useCallback)(async()=>{if(el.current)return;el.current=!0;let e=new AbortController;ec.current=e;try{let r=await (0,T.u)("/api/sessions/".concat(encodeURIComponent(p)),{signal:e.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after ".concat(8e3,"ms")});x(r),q(null),J(!1),ea.current=!0}catch(s){if(eh.current||e.signal.aborted||L(s))return;let r=(s instanceof Error?s.message:"Failed to load session").toLowerCase();if(r.includes("session not found")||r.includes("http 404")){ea.current||J(!0),z(!1);return}console.error("Failed to fetch session:",s),ea.current||q(s instanceof Error?s:Error("Failed to load session"))}finally{z(!1),el.current=!1,ec.current===e&&(ec.current=null)}},[p]),ef=(0,a.useCallback)(async()=>{if(eo.current)return;let e=ee.current;if(!e)return;let r=er.current,s="".concat(e,":").concat(r?"orchestrator":"worker");if(!r&&es.current===s)return;eo.current=!0;let t=new AbortController;ed.current=t;try{var a,n,o,c,d;let u=r?"/api/sessions?project=".concat(encodeURIComponent(e),"&fresh=true"):"/api/sessions?project=".concat(encodeURIComponent(e),"&orchestratorOnly=true&fresh=true"),h=await (0,T.u)(u,{signal:t.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after ".concat(5e3,"ms")}),p=null!=(o=h.sessions)?o:[],m=null!=(d=null!=(c=h.orchestratorId)?c:null==(n=h.orchestrators)||null==(a=n.find(r=>r.projectId===e))?void 0:a.id)?d:null;if(w(e=>e===m?e:m),!r){es.current=s;return}let b={merge:0,respond:0,review:0,pending:0,working:0,done:0},f=[...et.current.values()];for(let e of p)if(!(0,l.tT)(e,et.current.get(e.projectId),f)){let r=(0,i.ng)(e);if("action"===r)continue;b[r]++}g(b)}catch(e){if(eh.current||t.signal.aborted||L(e))return;console.error("Failed to fetch project sessions:",e)}finally{eo.current=!1,ed.current===t&&(ed.current=null)}},[]),ev=(0,a.useCallback)(async()=>{if(ei.current)return;ei.current=!0;let e=new AbortController;eu.current=e;try{var r,s,t;let a=await (0,T.u)("/api/sessions?fresh=true",{signal:e.signal,timeoutMs:5e3,timeoutMessage:"Sidebar sessions request timed out after ".concat(5e3,"ms")}),n=null!=(r=null==a?void 0:a.sessions)?r:[],l=null!=(t=U(n,null!=(s=en.current)?s:[]))?t:n;E=l,F(null==a?void 0:a.orchestrators),K(!1),A(e=>e&&e.length===l.length&&e.every((e,r)=>{let s=l[r];return JSON.stringify(e)===JSON.stringify(s)})?e:l)}catch(r){if(eh.current||e.signal.aborted||L(r))return;console.error("Failed to fetch sidebar sessions:",r),K(!0),A(e=>null===e?[]:e)}finally{ei.current=!1,eu.current===e&&(eu.current=null)}},[]);return((0,a.useEffect)(()=>{if(!(null==b?void 0:b.sessions))return;if("connected"!==b.status){en.current=null;return}en.current=b.sessions;let e=U(E,b.sessions);if(e!==E&&(E=e,A(e)),0===b.sessions.length||!E)return;let r=new Set(E.map(e=>e.id)),s=new Set(b.sessions.map(e=>e.id));if(r.size!==s.size)return void ev();for(let e of s)if(!r.has(e))return void ev()},[ev,null==b?void 0:b.sessions,null==b?void 0:b.status]),(0,a.useEffect)(()=>{$||g(null)},[$]),(0,a.useEffect)(()=>{Promise.all([ep(),eb(),ev()])},[ep,eb,ev]),(0,a.useEffect)(()=>{Q&&ef()},[ef,$,Q]),(0,a.useEffect)(()=>{let e=setInterval(()=>{eb(),ef(),ev()},2e3);return()=>clearInterval(e)},[eb,ef,ev]),(0,a.useEffect)(()=>{eh.current=!1;let e=()=>{eh.current=!0};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[]),(0,a.useEffect)(()=>()=>{var e,r,s;null==(e=ec.current)||e.abort(),null==(r=ed.current)||r.abort(),null==(s=eu.current)||s.abort()},[]),W)?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,t.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}):V?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},secondaryAction:{label:"Retry",onClick:()=>void eb()},compact:!0,chrome:"card"})}):H?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=(s=null!=(r=null==v?void 0:v.projectId)?r:m)?s:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Failed to load session",message:function(e){let r=e.message.toLowerCase();return r.includes("timed out")?"The session request is taking too long, so the page stopped waiting instead of spinning forever. You can retry, or return to the project and reopen a different session.":r.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":r.includes("404")?"This session is no longer available. It may have been removed while the page was open.":r.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(H),tone:"error",primaryAction:{label:"Try again",onClick:()=>{q(null),J(!1),z(!0),Promise.all([ep(),eb(),ev()])}},secondaryAction:{label:"Back to dashboard",href:(null==v?void 0:v.projectId)?"/projects/".concat(v.projectId):"/"},error:H,compact:!0,chrome:"card"})}):v?(0,t.jsx)(S,{session:v,isOrchestrator:$,orchestratorZones:null!=j?j:void 0,projectOrchestratorId:y,projects:N,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev}):(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void eb()},secondaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},compact:!0,chrome:"card"})})}},5864:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let t=s(3817),a=s(6749),n=s(6943);function l(e){return{default:e&&"default"in e?e.default:e}}s(6418);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let r={...o,...e},s=(0,a.lazy)(()=>r.loader().then(l)),i=r.loading;function c(e){let l=i?(0,t.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!r.ssr||!!r.loading,c=o?a.Suspense:a.Fragment,d=r.ssr?(0,t.jsxs)(t.Fragment,{children:[null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},8394:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9789:(e,r,s)=>{s.d(r,{ErrorDisplay:()=>c});var t=s(3817),a=s(8713),n=s.n(a);let l={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function o(e){let{accent:r}=e;return(0,t.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(r," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(r," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,t.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:r},viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,t.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function i(e){let{action:r,primary:s=!1}=e,a=s?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",l=s?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return r.href?(0,t.jsx)(n(),{href:r.href,className:a,style:l,children:r.label}):(0,t.jsx)("button",{type:"button",onClick:r.onClick,className:a,style:l,children:r.label})}function c(e){let{title:r,message:s,tone:a="error",detailsTitle:n="Technical details",error:c,primaryAction:d,secondaryAction:u,compact:h=!1,chrome:p="page",children:m}=e,b=l[a],f=!!((null==c?void 0:c.digest)||(null==c?void 0:c.message)||(null==c?void 0:c.stack));return(0,t.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(h?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===p?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,t.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,t.jsx)(o,{accent:b.accent}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:b.accent,background:b.bg,borderColor:b.border},children:b.label}),(0,t.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:r}),(0,t.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:s})]})]}),(d||u)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,t.jsx)(i,{action:d,primary:!0}):null,u?(0,t.jsx)(i,{action:u}):null]}),m,f?(0,t.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:n}),(0,t.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==c?void 0:c.digest)?(0,t.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",c.digest]}):null,(null==c?void 0:c.message)?(0,t.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:c.message}):null,(null==c?void 0:c.stack)?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:c.stack}):null]})]}):null]})})})}},9891:(e,r,s)=>{s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5795],{1712:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},2466:(e,r,s)=>{s.d(r,{I:()=>t});let t=(0,s(6749).createContext)(null)},2537:(e,r,s)=>{s.d(r,{X:()=>l});var t=s(3817),a=s(8713),n=s.n(a);function l(e){let{ariaLabel:r,activeTab:s,dashboardHref:a,prsHref:l,showOrchestrator:o=!0,orchestratorHref:i=null}=e;return(0,t.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":r,children:[(0,t.jsxs)(n(),{href:a,className:"mobile-bottom-nav__item","data-active":"dashboard"===s?"true":"false","aria-current":"dashboard"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.jsxs)(n(),{href:l,className:"mobile-bottom-nav__item","data-active":"prs"===s?"true":"false","aria-current":"prs"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,t.jsx)("span",{children:"PRs"})]}),o?i?(0,t.jsxs)(n(),{href:i,className:"mobile-bottom-nav__item","data-active":"orchestrator"===s?"true":"false","aria-current":"orchestrator"===s?"page":void 0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):(0,t.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):null]})}},5468:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return o}});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class t{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return a?new a:new t}function l(e){return a?a.bind(e):t.bind(e)}function o(){return a?a.snapshot():function(e,...r){return e(...r)}}},5795:(e,r,s)=>{s.r(r),s.d(r,{default:()=>W});var t=s(3817),a=s(6749),n=s(7594),l=s(5425),o=s(9120),i=s(545),c=s(9891),d=s(7387),u=s(2466),h=s(8450),p=s(9293),m=s(2537),b=s(4901);let f={active:{label:"Active",color:"var(--color-status-working)"},ready:{label:"Ready",color:"var(--color-status-ready)"},idle:{label:"Idle",color:"var(--color-status-idle)"},waiting_input:{label:"Waiting for input",color:"var(--color-status-attention)"},blocked:{label:"Blocked",color:"var(--color-status-error)"},exited:{label:"Exited",color:"var(--color-status-error)"}};function v(e){if(e.includes("\x3c!-- DESCRIPTION START --\x3e")||e.includes("### ")){let r=e.match(/###\s+(.+?)(?:\n|$)/),s=r?r[1].replace(/\*\*/g,"").trim():"Comment",t=e.match(/<!-- DESCRIPTION START -->\s*([\s\S]*?)\s*<!-- DESCRIPTION END -->/);return{title:s,description:t?t[1].trim():e.split("\n")[0]||"No description"}}return{title:"Comment",description:e.trim()}}function x(e){let{comments:r,unresolvedThreads:s,sendingUrls:a,sentUrls:n,errorUrls:l,onAskAgentToFix:o}=e;return 0===r.length?null:(0,t.jsxs)("details",{className:"session-detail-comments-strip",children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comments-strip__toggle",children:[(0,t.jsx)("svg",{className:"session-detail-comments-strip__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comments-strip__label",children:"Unresolved Comments"}),(0,t.jsx)("span",{className:"session-detail-comments-strip__count",children:s}),(0,t.jsx)("span",{className:"session-detail-comments-strip__hint",children:"click to expand"})]})}),(0,t.jsx)("div",{className:"session-detail-comments-strip__body",children:r.map((e,r)=>{let{title:s,description:i}=v(e.body),c=a.has(e.url),d=n.has(e.url),u=l.has(e.url);return(0,t.jsxs)("details",{className:"session-detail-comment",open:0===r,children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comment__row",children:[(0,t.jsx)("svg",{className:"session-detail-comment__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comment__title",children:s}),(0,t.jsxs)("span",{className:"session-detail-comment__author",children:["\xb7 ",e.author]}),(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"session-detail-comment__view",children:"view →"})]})}),(0,t.jsxs)("div",{className:"session-detail-comment__body",children:[(0,t.jsx)("div",{className:"session-detail-comment__file",children:e.path}),(0,t.jsx)("p",{className:"session-detail-comment__text",children:i}),(0,t.jsx)("button",{onClick:()=>o(e),disabled:c,className:(0,b.cn)("session-detail-comment__fix-btn",d&&"session-detail-comment__fix-btn--sent",u&&"session-detail-comment__fix-btn--error"),children:c?"Sending…":d?"Sent ✓":u?"Failed":"Ask Agent to Fix"})]})]},e.url)})})]})}function j(e){return!(0,i.sZ)(e)&&!(0,i.fZ)(e)&&"merged"!==e.state&&!e.mergeability.noConflicts}function g(e){var r;let{pr:s,metadata:n,lifecyclePrReason:o,onAskAgentToFix:c}=e,[d,u]=(0,a.useState)(new Set),[h,p]=(0,a.useState)(new Set),[m,f]=(0,a.useState)(new Set),[v,g]=(0,a.useState)(!1),y=(0,a.useRef)(new Map);(0,a.useEffect)(()=>()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear()},[]);let w=async e=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>{let s=new Set(r);return s.delete(e.url),s}),u(r=>new Set(r).add(e.url)),await c(e,()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),p(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)},()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{f(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)})},N=(0,i.QN)(s),_=function(e,r,s){let t=[],a=!!r.lastCIFailureDispatchHash,n="true"===r.lastMergeConflictDispatched,o=!!r.lastPendingReviewDispatchHash,i=r.status,c=e.ciStatus===l.U1.FAILING||"ci_failing"===s||"ci_failed"===i,d="changes_requested"===e.reviewDecision||"changes_requested"===s||"changes_requested"===i,u=j(e);if(c){let r=e.ciChecks.filter(e=>"failed"===e.status).length;t.push({icon:"✗",variant:"fail",text:r>0?"".concat(r," check").concat(1!==r?"s":""," failing"):"CI failing",notified:a})}else e.ciStatus===l.U1.PENDING&&t.push({icon:"●",variant:"warn",text:"CI pending"});return d?t.push({icon:"✗",variant:"fail",text:"Changes requested",notified:o}):e.mergeability.approved||t.push({icon:"○",variant:"muted",text:"Awaiting reviewer"}),u&&t.push({icon:"✗",variant:"fail",text:"Merge conflicts",notified:n}),e.isDraft&&t.push({icon:"○",variant:"muted",text:"Draft"}),t}(s,n,o),k=null!=(r=s.changedFiles)?r:0,C=j(s)&&"open"===s.state,S=C?function(e){let r=encodeURIComponent(e.owner),s=encodeURIComponent(e.repo),t=encodeURIComponent(e.baseBranch),a=encodeURIComponent(e.branch);return"https://github.com/".concat(r,"/").concat(s,"/compare/").concat(t,"...").concat(a)}(s):"";return(0,t.jsxs)("div",{className:(0,b.cn)("session-detail-pr-card",N&&"session-detail-pr-card--green"),children:[(0,t.jsxs)("div",{className:"session-detail-pr-card__row",children:[(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-card__title-link",children:["PR #",s.number,": ",s.title]}),(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-stats",children:[(0,t.jsxs)("span",{className:"session-detail-diff--add",children:["+",s.additions]})," ",(0,t.jsxs)("span",{className:"session-detail-diff--del",children:["-",s.deletions]})]}),k>0?(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-label",children:[k," file",1!==k?"s":""]}):null,s.isDraft?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Draft"}):null,"merged"===s.state?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Merged"}):null]}),C?(0,t.jsxs)("div",{className:"session-detail-pr-card__merge-actions",role:"group","aria-label":"Resolve merge conflicts",children:[(0,t.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-merge-action",children:"Compare with base branch"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;let r=null==(e=navigator.clipboard)?void 0:e.writeText(s.branch);r&&r.then(()=>{g(!0);let e="__copy-branch",r=y.current.get(e);r&&clearTimeout(r);let s=setTimeout(()=>{g(!1),y.current.delete(e)},2e3);y.current.set(e,s)}).catch(()=>{})},"aria-label":v?"Head branch name copied":"Copy head branch name",className:"session-detail-pr-merge-action session-detail-pr-merge-action--btn",children:v?"Copied branch name":"Copy head branch name"})]}):null,(0,t.jsxs)("div",{className:"session-detail-pr-card__details",children:[N?(0,t.jsxs)("div",{className:"session-detail-merge-banner",children:[(0,t.jsx)("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})}),"Ready to merge"]}):_.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-blocker-chip","fail"===e.variant&&"session-detail-blocker-chip--fail","warn"===e.variant&&"session-detail-blocker-chip--warn","muted"===e.variant&&"session-detail-blocker-chip--muted"),children:[e.icon," ",e.text,e.notified?(0,t.jsx)("span",{className:"session-detail-blocker-chip__note",children:"\xb7 notified"}):null]},e.text)),s.ciChecks.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"session-detail-pr-sep"}),s.ciChecks.map((e,r)=>{var s;let a=null!=(s=e.url)?s:"".concat(e.name,"-").concat(r),n=(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-ci-chip","passed"===e.status&&"session-detail-ci-chip--pass","failed"===e.status&&"session-detail-ci-chip--fail","pending"===e.status&&"session-detail-ci-chip--pending","passed"!==e.status&&"failed"!==e.status&&"pending"!==e.status&&"session-detail-ci-chip--queued"),children:["passed"===e.status?"✓":"failed"===e.status?"✗":"pending"===e.status?"●":"○"," ",e.name]});return e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:no-underline",onClick:e=>e.stopPropagation(),children:n},a):(0,t.jsx)("span",{children:n},a)})]}):null]}),(0,t.jsx)(x,{comments:s.unresolvedComments,unresolvedThreads:s.unresolvedThreads,sendingUrls:d,sentUrls:h,errorUrls:m,onAskAgentToFix:w})]})}function y(e,r){let s=e.trim();return s.length<=r?s:"".concat(s.slice(0,Math.max(0,r-1)).trimEnd(),"…")}async function w(e,r,s,t){try{let t=function(e){let{title:r,description:s}=v(e.body),t=["Please address this review comment:\n","File: ".concat(y(e.path,500)),"Comment: ".concat(y(r,240)),"Description: ".concat(y(s,7500)),"","Resolve the comment at ".concat(e.url," after fixing it.")].join("\n");return y(t,9500)}(r),a=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})});if(!a.ok)throw Error("HTTP ".concat(a.status));s()}catch(e){console.error("Failed to send message to agent:",e),t()}}function N(e){let{zones:r}=e,s=[{value:r.merge,label:"merge",toneClass:"topbar-zone-pill--merge"},{value:r.respond,label:"respond",toneClass:"topbar-zone-pill--respond"},{value:r.review,label:"review",toneClass:"topbar-zone-pill--review"},{value:r.working,label:"working",toneClass:"topbar-zone-pill--working"},{value:r.pending,label:"pending",toneClass:"topbar-zone-pill--pending"},{value:r.done,label:"done",toneClass:"topbar-zone-pill--done"}].filter(e=>e.value>0);return 0===s.length?null:(0,t.jsx)(t.Fragment,{children:s.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("topbar-zone-pill",e.toneClass),children:[(0,t.jsx)("span",{className:"topbar-zone-pill__value",children:e.value}),(0,t.jsx)("span",{className:"topbar-zone-pill__label",children:e.label})]},e.label))})}function _(e){var r,s,n,o;let{session:c,isOrchestrator:d,isMobile:u,terminalEnded:h,isRestorable:p,activity:m,headline:f,projects:v,orchestratorHref:x,orchestratorZones:j,onToggleSidebar:y,onRestore:_,onKill:k}=e,C=c.pr,S=!!C&&(0,i.QN)(C),[I,M]=(0,a.useState)(!1),R=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!I)return;let e=e=>{R.current&&!R.current.contains(e.target)&&M(!1)},r=e=>{"Escape"===e.key&&M(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",r)}},[I]);let T=null!=(n=null==(r=v.find(e=>e.id===c.projectId))?void 0:r.name)?n:c.projectId,P="agent orchestrator"!==T.trim().toLowerCase();return(0,t.jsxs)("header",{className:"dashboard-app-header",children:[v.length>0?(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:y,"aria-label":"Toggle sidebar",children:u?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}):null,(0,t.jsx)("div",{className:"dashboard-app-header__brand dashboard-app-header__brand--hide-mobile",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),P&&(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"topbar-project-pills-group",children:[(0,t.jsxs)("div",{className:"topbar-project-line",children:[P&&(0,t.jsx)("span",{className:"dashboard-app-header__project",children:T}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-mobile-only",children:c.id}),d&&(0,t.jsx)("span",{className:"session-detail-mode-badge",children:"orchestrator"})]}),(0,t.jsxs)("div",{className:"topbar-session-pills",children:[(0,t.jsxs)("div",{className:(0,b.cn)("topbar-status-pill","topbar-status-pill--".concat(m.label.toLowerCase().replace(/\s+/g,"-"))),children:[(0,t.jsx)("span",{className:"topbar-status-pill__dot",style:{background:m.color}}),(0,t.jsx)("span",{className:"topbar-status-pill__label",children:m.label})]}),c.branch?C?(0,t.jsx)("a",{href:function(e){let r="https://github.com";try{r=new URL(e.url).origin}catch(e){}return"".concat(r,"/").concat(e.owner,"/").concat(e.repo,"/tree/").concat(e.branch)}(C),target:"_blank",rel:"noopener noreferrer",className:"topbar-branch-pill topbar-branch-pill--link",children:c.branch}):(0,t.jsx)("span",{className:"topbar-branch-pill",children:c.branch}):null,d&&j?(0,t.jsx)(N,{zones:j}):null]})]}),(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsx)("span",{className:"dashboard-app-header__session-title topbar-desktop-only",children:f}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-desktop-only",children:c.id}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,t.jsxs)("div",{className:"dashboard-app-header__actions",children:[C?(0,t.jsxs)("div",{className:"topbar-pr-btn-wrap",ref:R,children:[(0,t.jsxs)("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:(0,b.cn)("dashboard-app-btn topbar-pr-btn",I&&"topbar-pr-btn--open"),onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),M(e=>!e))},"aria-expanded":I,"aria-label":"PR #".concat(C.number),children:[(0,t.jsx)("span",{className:(0,b.cn)("topbar-pr-dot",S?"topbar-pr-dot--green":C.ciStatus===l.U1.FAILING||"changes_requested"===C.reviewDecision?"topbar-pr-dot--red":"topbar-pr-dot--amber")}),"PR #",C.number,(0,t.jsx)("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:I?"M18 15l-6-6-6 6":"M6 9l6 6 6-6"})})]}),I&&(0,t.jsx)("div",{className:"topbar-pr-popover",children:(0,t.jsx)(g,{pr:C,metadata:c.metadata,lifecyclePrReason:null!=(o=null==(s=c.lifecycle)?void 0:s.prReason)?o:void 0,onAskAgentToFix:(e,r,s)=>w(c.id,e,r,s)})})]}):null,p?(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--restore",onClick:_,children:[(0,t.jsxs)("svg",{className:"topbar-action-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,t.jsx)("path",{d:"M4 5v4h4"}),(0,t.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,t.jsx)("path",{d:"M20 19v-4h-4"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Restore"})]}):d||h?null:(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--danger",onClick:k,children:[(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Kill"})]}),x?(0,t.jsxs)("a",{href:x,className:"dashboard-app-btn dashboard-app-btn--amber topbar-desktop-only","aria-label":"Orchestrator",children:[(0,t.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,t.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Orchestrator"})]}):null]})]})}function k(e){var r,s,a,n,l,o,i,c,u,h;let{session:p,headline:m,pr:b,dashboardHref:f}=e,v=(null==(h=p.lifecycle)?void 0:h.runtime.reasonLabel)?p.lifecycle.runtime.reasonLabel:"killed"===p.status?"Manually stopped":"terminated"===p.status?"Runtime unavailable":"done"===p.status||"merged"===p.status?"Work completed":"Terminal ended",x=function(e,r){var s;let t=e.metadata.pinnedSummary;return t||(e.summary&&!e.summaryIsFallback?e.summary:(null==(s=e.lifecycle)?void 0:s.summary)?e.lifecycle.summary:e.userPrompt?e.userPrompt:e.summary?e.summary:r)}(p,m),j=null!=(c=null!=(i=null!=(o=null==(r=p.lifecycle)?void 0:r.session.terminatedAt)?o:null==(s=p.lifecycle)?void 0:s.session.completedAt)?i:null==(a=p.lifecycle)?void 0:a.session.lastTransitionAt)?c:p.lastActivityAt,g=null!=(u=null==(n=p.lifecycle)?void 0:n.runtime.label)?u:"Unavailable",y=b?"merged"===b.state?"Merged":"closed"===b.state?"Closed":b.mergeability.mergeable?"Open, merge-ready":"Open":"No PR";return(0,t.jsx)("section",{className:"session-ended-summary","aria-label":"Session ended summary",children:(0,t.jsxs)("div",{className:"session-ended-summary__panel",children:[(0,t.jsx)("div",{className:"session-ended-summary__eyebrow",children:"Terminal ended"}),(0,t.jsxs)("div",{className:"session-ended-summary__header",children:[(0,t.jsx)("div",{className:"session-ended-summary__icon","aria-hidden":"true",children:(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),(0,t.jsx)("path",{d:"M7 10l3 2-3 2"}),(0,t.jsx)("path",{d:"M13 15h4"})]})}),(0,t.jsxs)("div",{className:"session-ended-summary__title-group",children:[(0,t.jsx)("h2",{className:"session-ended-summary__title",children:m}),(0,t.jsxs)("p",{className:"session-ended-summary__subtitle",children:[v,". The live terminal is gone, but the session context is still available."]})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__body",children:[(0,t.jsxs)("div",{className:"session-ended-summary__section",children:[(0,t.jsx)("div",{className:"session-ended-summary__label",children:"What happened"}),(0,t.jsx)("p",{className:"session-ended-summary__copy",children:x})]}),(0,t.jsxs)("div",{className:"session-ended-summary__facts","aria-label":"Session facts",children:[(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Session"}),(0,t.jsx)("strong",{children:p.id})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Ended"}),(0,t.jsx)("strong",{children:function(e){if(!e)return"Unknown";let r=new Date(e).getTime();return Number.isFinite(r)?(0,d.fw)(r):"Unknown"}(j)})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Runtime"}),(0,t.jsx)("strong",{children:g})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"PR"}),(0,t.jsx)("strong",{children:y})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__links",children:[b?(0,t.jsxs)("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"session-ended-summary__primary",children:["Open PR #",b.number]}):null,(0,t.jsx)("a",{href:f,className:"session-ended-summary__secondary",children:"Back to dashboard"})]}),(null==(l=p.lifecycle)?void 0:l.evidence)?(0,t.jsxs)("div",{className:"session-ended-summary__evidence",children:[(0,t.jsx)("span",{children:"Evidence"}),(0,t.jsx)("code",{children:p.lifecycle.evidence})]}):null]})]})})}let C=(0,c.default)(()=>Promise.all([s.e(8944),s.e(3764)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full animate-pulse rounded bg-[var(--color-bg-primary)]"})});function S(e){var r,s,l;let{session:c,isOrchestrator:b=!1,orchestratorZones:v,projectOrchestratorId:x=null,projects:j=[],sidebarSessions:g=[],sidebarOrchestrators:y,sidebarLoading:w=!1,sidebarError:N=!1,onRetrySidebar:S}=e,I=(0,n.useRouter)(),M=(0,n.useSearchParams)(),R=(0,o.U)(o.D),T="true"===M.get("fullscreen"),[P,E]=(0,a.useState)(!1),[O,A]=(0,a.useState)(!1),[D,L]=(0,a.useState)(!1),F=c.pr,B=i.CM.has(c.status),U=B&&!i.N_.has(c.status),W=null!=(l=c.activity&&f[c.activity])?l:{label:null!=(s=c.activity)?s:"unknown",color:"var(--color-text-muted)"},z=(0,d.Pn)(c),H=b?"orchestrator":"agent",q="opencode"===c.metadata.agent,V="string"==typeof c.metadata.opencodeSessionId&&c.metadata.opencodeSessionId.length>0?c.metadata.opencodeSessionId:void 0,J=c.projectId?(0,h.bn)(c.projectId):"/",G=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/kill"),{method:"POST"});if(!e.ok)throw Error("HTTP ".concat(e.status));if(x)return void I.push((0,h.Nc)(c.projectId,x));I.push(J)}catch(e){console.error("Failed to kill session:",e)}},[J,x,I,c.id,c.projectId]),K=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/restore"),{method:"POST"});if(!e.ok){let r=await e.text().catch(()=>"");throw Error(r||"HTTP ".concat(e.status))}window.location.reload()}catch(e){console.error("Failed to restore session:",e)}},[c.id]),Z=(0,a.useMemo)(()=>b?(0,h.Nc)(c.projectId,c.id):x?(0,h.Nc)(c.projectId,x):null,[b,x,c.id,c.projectId]);(0,a.useEffect)(()=>{let e=window.requestAnimationFrame(()=>L(!0));return()=>{window.cancelAnimationFrame(e),L(!1)}},[c.id]);let X=(0,a.useCallback)(()=>{R?A(e=>!e):E(e=>!e)},[R]);return(0,t.jsx)(u.I.Provider,{value:{onToggleSidebar:X,mobileSidebarOpen:O},children:(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsx)(_,{session:c,isOrchestrator:b,isMobile:R,terminalEnded:B,isRestorable:U,activity:W,headline:z,projects:j,orchestratorHref:Z,orchestratorZones:v,onToggleSidebar:X,onRestore:K,onKill:G}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(P?" dashboard-shell--sidebar-collapsed":""),children:[j.length>0?(0,t.jsx)("div",{className:"sidebar-wrapper".concat(O?" sidebar-wrapper--mobile-open":""),children:(0,t.jsx)(p.u,{projects:j,sessions:g,orchestrators:y,loading:w,error:N,onRetry:S,activeProjectId:c.projectId,activeSessionId:c.id,collapsed:P,onToggleCollapsed:()=>E(e=>!e),onMobileClose:()=>A(!1)})}):null,O&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>A(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:D?B?(0,t.jsx)(k,{session:c,headline:z,pr:F,dashboardHref:J}):(0,t.jsx)(C,{sessionId:c.id,projectId:c.projectId,tmuxName:null==(r=c.metadata)?void 0:r.tmuxName,startFullscreen:T,variant:H,appearance:"dark",height:"100%",isOpenCodeSession:q,reloadCommand:q&&V?"/exit\nopencode --session ".concat(V,"\n"):void 0,autoFocus:!0}):(0,t.jsx)("div",{className:"session-detail-terminal-placeholder h-full"})})})})]}),(0,t.jsx)(m.X,{ariaLabel:"Session navigation",activeTab:b?"orchestrator":void 0,dashboardHref:J,prsHref:c.projectId?"/?project=".concat(encodeURIComponent(c.projectId),"&tab=prs"):"/",showOrchestrator:!!Z,orchestratorHref:Z})]})})}var I=s(9789);let M={active:"⚡",ready:"\uD83D\uDFE2",idle:"\uD83D\uDCA4",waiting_input:"❓",blocked:"\uD83D\uDEA7",exited:"\uD83D\uDC80"};var R=s(5184),T=s(3394);let P=null,E=null,O=new Set(Object.values(l.SB)),A=new Set(Object.values(l.u3)),D=new Set;function L(e){if(e instanceof DOMException)return"AbortError"===e.name;if(e instanceof Error){let r=e.message.toLowerCase();return r.includes("aborted")||r.includes("aborterror")}return!1}function F(e){let{message:r}=e;return(0,t.jsx)("div",{className:"project-sidebar h-full",children:(0,t.jsxs)("div",{className:"space-y-3 px-3 py-4",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--color-text-tertiary)]",children:"Projects"}),(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:3},(e,r)=>(0,t.jsx)("div",{className:"h-10 animate-pulse border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)]"},"sidebar-placeholder-".concat(r)))}),(0,t.jsx)("div",{className:"pt-2 text-[12px] text-[var(--color-text-tertiary)]",children:r})]})})}function B(e){let{projects:r,projectsLoading:s,sidebarSessions:n,sidebarOrchestrators:l,sidebarLoading:i,sidebarError:c,onRetrySidebar:d,activeProjectId:u,activeSessionId:h,children:m}=e,b=(0,o.U)(o.D),[f,v]=(0,a.useState)(!1),[x,j]=(0,a.useState)(!1),g=(0,a.useCallback)(()=>{if(b)return void j(e=>!e);v(e=>!e)},[b]);return(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsxs)("header",{className:"dashboard-app-header",children:[(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:g,"aria-label":"Toggle sidebar",children:b?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}),(0,t.jsx)("div",{className:"dashboard-app-header__brand",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"})]}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(f?" dashboard-shell--sidebar-collapsed":""),children:[(0,t.jsx)("div",{className:"sidebar-wrapper".concat(x?" sidebar-wrapper--mobile-open":""),children:r.length>0?(0,t.jsx)(p.u,{projects:r,sessions:n,orchestrators:l,loading:i,error:c,onRetry:d,activeProjectId:u,activeSessionId:h,collapsed:f,onToggleCollapsed:()=>v(e=>!e),onMobileClose:()=>j(!1)}):(0,t.jsx)(F,{message:s?"Loading projects...":"Projects unavailable."})}),x&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>j(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0",children:m})})})]})]})}function U(e,r){if(!e||0===r.length)return e;let s=new Map(r.map(e=>[e.id,e])),t=!1,a=e.map(e=>{var r,a;let n=s.get(e.id);if(!n)return e;if(r=n.status,!O.has(r)){let r="status:".concat(n.status);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown status",{sessionId:n.id,status:n.status})),e}if(null!==n.activity&&(a=n.activity,!A.has(a))){let r="activity:".concat(n.activity);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown activity",{sessionId:n.id,activity:n.activity})),e}return e.status===n.status&&e.activity===n.activity&&e.lastActivityAt===n.lastActivityAt?e:(t=!0,{...e,status:n.status,activity:n.activity,lastActivityAt:n.lastActivityAt})});return t?a:e}function W(){var e,r,s;let o=(0,n.useParams)(),c=(0,n.usePathname)(),u=(0,n.useRouter)(),p=o.id,m="string"==typeof o.projectId?o.projectId:Array.isArray(o.projectId)?o.projectId[0]:null,b=(0,R.eT)(),f=(()=>{if("undefined"==typeof sessionStorage)return null;try{let e=sessionStorage.getItem("ao-session-nav:".concat(p));if(e)return sessionStorage.removeItem("ao-session-nav:".concat(p)),JSON.parse(e)}catch(e){}return null})(),[v,x]=(0,a.useState)(f),[j,g]=(0,a.useState)(null),[y,w]=(0,a.useState)(void 0),[N,_]=(0,a.useState)([]),[k,C]=(0,a.useState)(null===P),[O,A]=(0,a.useState)(()=>E),[D,F]=(0,a.useState)(void 0),[W,z]=(0,a.useState)(null===f),[H,q]=(0,a.useState)(null),[V,J]=(0,a.useState)(!1),[G,K]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(new Map),Q=null!=(e=null==v?void 0:v.projectId)?e:null,Y=[...Z.values()],$=!!v&&(0,l.tT)(v,Z.get(v.projectId),Y),ee=(0,a.useRef)(null),er=(0,a.useRef)(!1),es=(0,a.useRef)(null),et=(0,a.useRef)(new Map),ea=(0,a.useRef)(null!==f),en=(0,a.useRef)(null),el=(0,a.useRef)(!1),eo=(0,a.useRef)(!1),ei=(0,a.useRef)(!1),ec=(0,a.useRef)(null),ed=(0,a.useRef)(null),eu=(0,a.useRef)(null),eh=(0,a.useRef)(!1);(0,a.useEffect)(()=>{et.current=Z},[Z]);let ep=(0,a.useCallback)(async()=>{P&&(_(P),X(new Map(P.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))),C(!1));try{var e,r;let s=await (0,T.u)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after ".concat(5e3,"ms")});if(!(null==s?void 0:s.projects))return;e=P,r=s.projects,e&&e.length===r.length&&e.every((e,s)=>{let t=r[s];return JSON.stringify(e)===JSON.stringify(t)})||(P=s.projects,_(s.projects),X(new Map(s.projects.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))))}catch(e){console.error("Failed to fetch projects:",e)}finally{C(!1)}},[]),em=function(e){let r=(0,R.eT)(),s=null==r?void 0:r.sessions.find(r=>r.id===e);return(0,a.useMemo)(()=>{var e;return s?{activity:null!=(e=s.activity)?e:null}:null},[s])}(p);(0,a.useEffect)(()=>{v?document.title=function(e,r,s){var t;let a,n=e.id,o=void 0!==s?s:e.activity,i=o&&null!=(t=M[o])?t:"",c=[...r.values()];return a=(0,l.tT)(e,r.get(e.projectId),c)?"Orchestrator Terminal":function(e,r){let s=Array.from(e);return s.length>40?s.slice(0,40).join("")+"...":e}((0,d.Pn)(e),40),i?"".concat(i," ").concat(n," | ").concat(a):"".concat(n," | ").concat(a)}(v,Z,null==em?void 0:em.activity):document.title="".concat(p," | Session Detail")},[v,p,Z,em]),(0,a.useEffect)(()=>{ee.current=Q},[Q]),(0,a.useEffect)(()=>{if(v&&N.some(e=>e.id===v.projectId)){if(null==c?void 0:c.startsWith("/sessions/"))return void u.replace((0,h.Nc)(v.projectId,v.id));(null==c?void 0:c.startsWith("/projects/"))&&m&&v.projectId!==m&&u.replace((0,h.Nc)(v.projectId,v.id))}},[m,c,N,u,v]),(0,a.useEffect)(()=>{er.current=$},[$]);let eb=(0,a.useCallback)(async()=>{if(el.current)return;el.current=!0;let e=new AbortController;ec.current=e;try{let r=await (0,T.u)("/api/sessions/".concat(encodeURIComponent(p)),{signal:e.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after ".concat(8e3,"ms")});x(r),q(null),J(!1),ea.current=!0}catch(s){if(eh.current||e.signal.aborted||L(s))return;let r=(s instanceof Error?s.message:"Failed to load session").toLowerCase();if(r.includes("session not found")||r.includes("http 404")){ea.current||J(!0),z(!1);return}console.error("Failed to fetch session:",s),ea.current||q(s instanceof Error?s:Error("Failed to load session"))}finally{z(!1),el.current=!1,ec.current===e&&(ec.current=null)}},[p]),ef=(0,a.useCallback)(async()=>{if(eo.current)return;let e=ee.current;if(!e)return;let r=er.current,s="".concat(e,":").concat(r?"orchestrator":"worker");if(!r&&es.current===s)return;eo.current=!0;let t=new AbortController;ed.current=t;try{var a,n,o,c,d;let u=r?"/api/sessions?project=".concat(encodeURIComponent(e),"&fresh=true"):"/api/sessions?project=".concat(encodeURIComponent(e),"&orchestratorOnly=true&fresh=true"),h=await (0,T.u)(u,{signal:t.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after ".concat(5e3,"ms")}),p=null!=(o=h.sessions)?o:[],m=null!=(d=null!=(c=h.orchestratorId)?c:null==(n=h.orchestrators)||null==(a=n.find(r=>r.projectId===e))?void 0:a.id)?d:null;if(w(e=>e===m?e:m),!r){es.current=s;return}let b={merge:0,respond:0,review:0,pending:0,working:0,done:0},f=[...et.current.values()];for(let e of p)if(!(0,l.tT)(e,et.current.get(e.projectId),f)){let r=(0,i.ng)(e);if("action"===r)continue;b[r]++}g(b)}catch(e){if(eh.current||t.signal.aborted||L(e))return;console.error("Failed to fetch project sessions:",e)}finally{eo.current=!1,ed.current===t&&(ed.current=null)}},[]),ev=(0,a.useCallback)(async()=>{if(ei.current)return;ei.current=!0;let e=new AbortController;eu.current=e;try{var r,s,t;let a=await (0,T.u)("/api/sessions?fresh=true",{signal:e.signal,timeoutMs:5e3,timeoutMessage:"Sidebar sessions request timed out after ".concat(5e3,"ms")}),n=null!=(r=null==a?void 0:a.sessions)?r:[],l=null!=(t=U(n,null!=(s=en.current)?s:[]))?t:n;E=l,F(null==a?void 0:a.orchestrators),K(!1),A(e=>e&&e.length===l.length&&e.every((e,r)=>{let s=l[r];return JSON.stringify(e)===JSON.stringify(s)})?e:l)}catch(r){if(eh.current||e.signal.aborted||L(r))return;console.error("Failed to fetch sidebar sessions:",r),K(!0),A(e=>null===e?[]:e)}finally{ei.current=!1,eu.current===e&&(eu.current=null)}},[]);return((0,a.useEffect)(()=>{if(!(null==b?void 0:b.sessions))return;if("connected"!==b.status){en.current=null;return}en.current=b.sessions;let e=U(E,b.sessions);if(e!==E&&(E=e,A(e)),0===b.sessions.length||!E)return;let r=new Set(E.map(e=>e.id)),s=new Set(b.sessions.map(e=>e.id));if(r.size!==s.size)return void ev();for(let e of s)if(!r.has(e))return void ev()},[ev,null==b?void 0:b.sessions,null==b?void 0:b.status]),(0,a.useEffect)(()=>{$||g(null)},[$]),(0,a.useEffect)(()=>{Promise.all([ep(),eb(),ev()])},[ep,eb,ev]),(0,a.useEffect)(()=>{Q&&ef()},[ef,$,Q]),(0,a.useEffect)(()=>{let e=setInterval(()=>{eb(),ef(),ev()},2e3);return()=>clearInterval(e)},[eb,ef,ev]),(0,a.useEffect)(()=>{eh.current=!1;let e=()=>{eh.current=!0};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[]),(0,a.useEffect)(()=>()=>{var e,r,s;null==(e=ec.current)||e.abort(),null==(r=ed.current)||r.abort(),null==(s=eu.current)||s.abort()},[]),W)?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,t.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}):V?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},secondaryAction:{label:"Retry",onClick:()=>void eb()},compact:!0,chrome:"card"})}):H?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=(s=null!=(r=null==v?void 0:v.projectId)?r:m)?s:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Failed to load session",message:function(e){let r=e.message.toLowerCase();return r.includes("timed out")?"The session request is taking too long, so the page stopped waiting instead of spinning forever. You can retry, or return to the project and reopen a different session.":r.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":r.includes("404")?"This session is no longer available. It may have been removed while the page was open.":r.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(H),tone:"error",primaryAction:{label:"Try again",onClick:()=>{q(null),J(!1),z(!0),Promise.all([ep(),eb(),ev()])}},secondaryAction:{label:"Back to dashboard",href:(null==v?void 0:v.projectId)?"/projects/".concat(v.projectId):"/"},error:H,compact:!0,chrome:"card"})}):v?(0,t.jsx)(S,{session:v,isOrchestrator:$,orchestratorZones:null!=j?j:void 0,projectOrchestratorId:y,projects:N,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev}):(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void eb()},secondaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},compact:!0,chrome:"card"})})}},5864:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let t=s(3817),a=s(6749),n=s(6943);function l(e){return{default:e&&"default"in e?e.default:e}}s(6418);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let r={...o,...e},s=(0,a.lazy)(()=>r.loader().then(l)),i=r.loading;function c(e){let l=i?(0,t.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!r.ssr||!!r.loading,c=o?a.Suspense:a.Fragment,d=r.ssr?(0,t.jsxs)(t.Fragment,{children:[null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},8394:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9789:(e,r,s)=>{s.d(r,{ErrorDisplay:()=>c});var t=s(3817),a=s(8713),n=s.n(a);let l={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function o(e){let{accent:r}=e;return(0,t.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(r," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(r," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,t.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:r},viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,t.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function i(e){let{action:r,primary:s=!1}=e,a=s?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",l=s?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return r.href?(0,t.jsx)(n(),{href:r.href,className:a,style:l,children:r.label}):(0,t.jsx)("button",{type:"button",onClick:r.onClick,className:a,style:l,children:r.label})}function c(e){let{title:r,message:s,tone:a="error",detailsTitle:n="Technical details",error:c,primaryAction:d,secondaryAction:u,compact:h=!1,chrome:p="page",children:m}=e,b=l[a],f=!!((null==c?void 0:c.digest)||(null==c?void 0:c.message)||(null==c?void 0:c.stack));return(0,t.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(h?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===p?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,t.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,t.jsx)(o,{accent:b.accent}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:b.accent,background:b.bg,borderColor:b.border},children:b.label}),(0,t.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:r}),(0,t.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:s})]})]}),(d||u)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,t.jsx)(i,{action:d,primary:!0}):null,u?(0,t.jsx)(i,{action:u}):null]}),m,f?(0,t.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:n}),(0,t.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==c?void 0:c.digest)?(0,t.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",c.digest]}):null,(null==c?void 0:c.message)?(0,t.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:c.message}):null,(null==c?void 0:c.stack)?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:c.stack}):null]})]}):null]})})})}},9891:(e,r,s)=>{s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6231],{2466:(e,s,t)=>{t.d(s,{I:()=>r});let r=(0,t(6749).createContext)(null)},6231:(e,s,t)=>{t.d(s,{Dashboard:()=>q});var r=t(3817),a=t(6749),n=t(8713),l=t.n(n),o=t(7594),i=t(9120),c=t(545),d=t(4901),h=t(7387),u=t(4906),m=t(1237),x=t(8450);let p=new Set,b=(0,a.memo)(function(e){var s,t,n,l,o,i;let{session:b,onSend:v,onKill:g,onMerge:j,onRestore:f}=e,[_,N]=(0,a.useState)(!1),[y,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(null),[M,S]=(0,a.useState)(null),[P,R]=(0,a.useState)(null),[T,I]=(0,a.useState)(!1),[W,D]=(0,a.useState)(""),A=(0,a.useRef)(null),B=(0,a.useRef)(null),[O]=(0,a.useState)(()=>p.has(b.id));(0,a.useEffect)(()=>{if(O)return;let e=window.requestAnimationFrame(()=>{p.add(b.id)});return()=>{window.cancelAnimationFrame(e)}},[O,b.id]);let E=(0,c.ng)(b),F=b.pr,L=async e=>{let s=e.trim();if(!s||null!==M)return!1;S(s),R(null);try{return await Promise.resolve(null==v?void 0:v(b.id,s)),R(s),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>R(null),2e3),!0}catch(e){return!1}finally{S(null)}},H=async e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),await L(W)&&D(""))};(0,a.useEffect)(()=>()=>{A.current&&clearTimeout(A.current),B.current&&clearTimeout(B.current)},[]);let U=async(e,s)=>{if(null===y){w(e),C(null);try{await Promise.resolve(null==v?void 0:v(b.id,s)),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>w(null),2e3)}catch(s){w(null),C(e),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>C(null),2e3)}}},q=!!F&&(0,c.fZ)(F),K=!!F&&(0,c.sZ)(F),Z=function(e){var s,t,a,n,l;let o=e.pr;if(!o||"open"!==o.state||(0,c.fZ)(o)||(0,c.sZ)(o))return[];let i=e.metadata,d=[],h=null!=(t=null==(s=e.lifecycle)?void 0:s.prReason)?t:null,u=i.status,m=o.ciStatus===c.U1.FAILING||"ci_failing"===h||"ci_failed"===u,x="changes_requested"===o.reviewDecision||"changes_requested"===h||"changes_requested"===u,p=!o.mergeability.noConflicts;if(m){let e=o.ciChecks.find(e=>"failed"===e.status),s=o.ciChecks.filter(e=>"failed"===e.status).length;0===s&&o.ciStatus!==c.U1.FAILING?d.push({key:"ci-fail",type:"ci",icon:"✗",label:"CI failing",url:o.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(o.url)}):0===s?d.push({key:"ci-unknown",type:"ci",icon:"?",label:"CI unknown",url:o.url+"/checks"}):d.push({key:"ci-fail",type:"ci",icon:"✗",count:s,label:"check".concat(s>1?"s":""," failing"),url:null!=(a=null==e?void 0:e.url)?a:o.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(o.url)})}if(x?d.push({key:"changes",type:"changes",icon:"↻",label:"changes requested",url:o.url,notified:!!i.lastPendingReviewDispatchHash,actionLabel:"Ask to address",actionMessage:"Please address the requested changes on ".concat(o.url)}):o.isDraft||"pending"!==o.reviewDecision&&"none"!==o.reviewDecision||d.push({key:"review",type:"review",icon:(0,r.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"})]}),label:"needs review",url:o.url,actionLabel:"Ask to post",actionMessage:"Post ".concat(o.url," on slack asking for a review.")}),p&&d.push({key:"conflict",type:"conflict",icon:"⚠",label:"merge conflict",url:o.url,notified:"true"===i.lastMergeConflictDispatched,actionLabel:"Ask to fix",actionMessage:"Please resolve the merge conflicts on ".concat(o.url," by rebasing on the base branch")}),o.unresolvedThreads>0){let e=null!=(l=null==(n=o.unresolvedComments[0])?void 0:n.url)?l:o.url+"/files";d.push({key:"comments",type:"comment",icon:"\uD83D\uDCAC",label:"unresolved comments",count:o.unresolvedThreads,url:e,actionLabel:"Ask to resolve",actionMessage:"Please address all unresolved review comments on ".concat(o.url)})}return d}(b),z=!q&&(null==F?void 0:F.mergeability.mergeable)&&"open"===F.state,V=(0,c.nH)(b),G=(0,c.wy)(b),J=(0,h.Pn)(b),Y=(n=b,l=E,z||"merge"===l?"mergeable":(null==(o=n.lifecycle)?void 0:o.sessionState)==="detecting"?"detecting":"respond"===l?(0,c.Ou)(n):(null==(i=n.lifecycle)?void 0:i.prReason)==="ci_failing"||"ci_failed"===n.status?"ci failing":"review"===l?(0,c.of)(n):(0,c.Ou)(n)),Q=q||!F||K?[]:F.ciChecks.filter(e=>"passed"===e.status).slice(0,3),$=(0,c.dG)(b)||"done"===E,X=b.lifecycle?["Session ".concat((0,c.Ou)(b)),"PR ".concat((0,c.of)(b)),"Runtime ".concat((0,c.Kw)(b))].join(" \xb7 "):null,ee=b.issueLabel?"".concat(b.issueLabel).concat(b.issueTitle?" \xb7 ".concat(b.issueTitle):""):null!=(s=b.issueTitle)?s:b.summary&&b.summary!==J?b.summary:null,es=z?"session-card--merge-frame":Z.length>0?"session-card--alert-frame":"session-card--fixed",et=z?"session-card--accent-merge":"working"===E?"session-card--accent-working":"respond"===E?"session-card--accent-respond":"review"===E||"pending"===E?"session-card--accent-attention":"session-card--accent-default";if($){let e=function(e){var s,t,a,n;let l=e.activity,o=e.status,i=null!=(n=null==(s=e.lifecycle)?void 0:s.prState)?n:null==(t=e.pr)?void 0:t.state;return"merged"===i||"merged"===o?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===i?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M9 12h6"})]})}:(null==(a=e.lifecycle)?void 0:a.sessionState)==="terminated"||"killed"===o||"terminated"===o?{label:(0,c.Ou)(e),pillClass:"done-status-pill--killed",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===l?"exited":(0,c.Ou)(e),pillClass:"done-status-pill--exited",icon:(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M9 12h6"})]})}}(b);return(0,r.jsxs)("div",{className:(0,d.cn)("session-card-done",_&&"done-expanded"),onClick:e=>{e.target.closest("a, button, textarea")||N(!_)},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,r.jsxs)("span",{className:(0,d.cn)("done-status-pill",e.pillClass),children:[e.icon,e.label]}),(0,r.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:b.id}),(0,r.jsx)("div",{className:"flex-1"}),G&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(b.id)},className:"done-restore-btn",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,r.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,r.jsx)("div",{className:"px-3.5 pb-2",children:(0,r.jsx)("p",{className:"session-card-done__title text-[13px] font-semibold leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden",children:J})}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[b.branch&&(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,r.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),b.branch]}),F&&(0,r.jsxs)("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",F.number]}),F&&!q&&(K?(0,r.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",F.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",F.deletions]})," ",(0,m.i_)(F.additions,F.deletions),(0,r.jsx)("span",{className:"sr-only",children:"+".concat(F.additions," -").concat(F.deletions," ").concat((0,m.i_)(F.additions,F.deletions))})]})),(0,r.jsx)("a",{href:(0,x.Nc)(b.projectId,b.id),onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),_&&(0,r.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[b.summary&&(null==F?void 0:F.title)&&b.summary!==F.title&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,r.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:b.summary})]}),b.issueUrl&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,r.jsxs)("a",{href:b.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[b.issueLabel||b.issueUrl,b.issueTitle&&": ".concat(b.issueTitle)]})]}),F&&F.ciChecks.length>0&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,r.jsx)(u.zm,{checks:F.ciChecks})]}),F&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4"}),(0,r.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,r.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,r.jsx)("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"hover:underline",children:F.title}),K?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,r.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,r.jsx)("span",{children:"PR details loading..."})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",F.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",F.deletions]})]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",F.mergeability.mergeable?"yes":"no"]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",F.reviewDecision]})]})]})]})]}),!F&&(0,r.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let er=V?"exited":z||"merge"===E||"review"===E?"ready":"respond"===E?"waiting":"pending"===E?"idle":"working"===E?"working":"idle";return(0,r.jsxs)("div",{className:(0,d.cn)("session-card border",!O&&"kanban-card-enter",es,et,z&&"card-merge-ready"),children:[(0,r.jsxs)("div",{className:"session-card__header",children:[(0,r.jsx)("span",{className:(0,d.cn)("card__adot","working"===er&&"card__adot--working","ready"===er&&"card__adot--ready","idle"===er&&"card__adot--idle","waiting"===er&&"card__adot--waiting","exited"===er&&"card__adot--exited")}),(0,r.jsx)("span",{className:"card__id",children:b.id}),(0,r.jsx)("div",{className:"flex-1"}),G&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(b.id)},className:"session-card__control session-card__restore-control",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,r.jsx)("path",{d:"M4 5v4h4"}),(0,r.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,r.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!V&&(0,r.jsxs)("a",{href:(0,x.$l)(b.projectId,b.id,"#session-terminal-section"),onClick:e=>e.stopPropagation(),className:"session-card__control session-card__terminal-link",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,r.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,r.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,r.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,r.jsx)("div",{className:"card__title-wrap",children:(0,r.jsx)("p",{className:"card__title",children:J})}),(0,r.jsxs)("div",{className:"card__meta",children:[b.branch&&(0,r.jsx)("span",{className:"card__branch",children:b.branch}),b.branch&&F?(0,r.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,F&&(0,r.jsxs)("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"card__pr",children:["#",F.number]}),F&&!q&&(K?(0,r.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,r.jsxs)("span",{className:"card__diff inline-flex items-center",children:[(0,r.jsxs)("span",{className:"card__diff-add",children:["+",F.additions]})," ",(0,r.jsxs)("span",{className:"card__diff-del",children:["-",F.deletions]})," ",(0,r.jsx)("span",{className:"card__diff-size",children:(0,m.i_)(F.additions,F.deletions)}),(0,r.jsx)("span",{className:"sr-only",children:"+".concat(F.additions," -").concat(F.deletions," ").concat((0,m.i_)(F.additions,F.deletions))})]}))]}),ee&&(0,r.jsx)("div",{className:"px-[10px] pb-[5px]",children:"merge"===E||z?(0,r.jsxs)("p",{className:"session-card__secondary session-card__secondary--merge",children:[(0,r.jsx)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,r.jsx)("span",{children:ee})]}):(0,r.jsx)("p",{className:"session-card__secondary",children:ee})}),X&&(0,r.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,r.jsx)("p",{className:"text-[10px] leading-relaxed text-[var(--color-text-tertiary)]",children:X})}),q&&(null==F?void 0:F.state)==="open"&&(0,r.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,r.jsxs)("svg",{className:"h-3 w-3 text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),Q.length>0&&(0,r.jsx)("div",{className:"card__ci",children:Q.map(e=>{let s=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{width:"8",height:"8",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})}),e.name]});return e.url?(0,r.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"ci-chip ci-chip--pass",onClick:e=>e.stopPropagation(),children:s},e.name):(0,r.jsx)("span",{className:"ci-chip ci-chip--pass",children:s},e.name)})}),!q&&Z.length>0&&(0,r.jsx)("div",{className:"card__alerts flex flex-col",children:Z.slice(0,3).map(e=>(0,r.jsxs)("div",{className:(0,d.cn)("alert-row","alert-row--".concat(e.type)),children:[(0,r.jsx)("span",{className:"alert-row__icon",children:e.icon}),(0,r.jsxs)("span",{className:"alert-row__text",children:[(0,r.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:[void 0!==e.count&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"font-bold",children:e.count})," "]}),e.label]}),e.notified&&(0,r.jsxs)("span",{className:"alert-row__notified",title:"Agent has been notified",children:[" ","\xb7 notified"]})]}),e.actionLabel&&(0,r.jsx)("button",{onClick:s=>{var t;s.stopPropagation(),U(e.key,null!=(t=e.actionMessage)?t:"")},disabled:y===e.key,className:"alert-row__action",children:y===e.key?"sent!":k===e.key?"failed":e.actionLabel})]},e.key))}),"respond"===E&&(0,r.jsxs)("div",{className:"quick-reply",onClick:e=>e.stopPropagation(),children:[b.summary&&!b.summaryIsFallback&&(0,r.jsxs)("div",{className:"card__agent-msg",children:[(0,r.jsx)("svg",{className:"card__agent-msg-icon",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,r.jsx)("span",{children:b.summary})]}),(0,r.jsx)("a",{href:(0,x.Nc)(b.projectId,b.id),onClick:e=>e.stopPropagation(),className:"card__view-context",children:"View current context →"}),!V&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"card__presets",children:[(0,r.jsx)("button",{className:"card__preset",onClick:()=>void L("continue"),disabled:null!==M,children:"continue"===M?"Sending...":"continue"===P?"Sent":"Continue"}),(0,r.jsx)("button",{className:"card__preset",onClick:()=>void L("abort"),disabled:null!==M,children:"abort"===M?"Sending...":"abort"===P?"Sent":"Abort"}),(0,r.jsx)("button",{className:"card__preset",onClick:()=>void L("skip"),disabled:null!==M,children:"skip"===M?"Sending...":"skip"===P?"Sent":"Skip"})]}),(0,r.jsx)("div",{className:"card__reply-wrap",children:(0,r.jsx)("textarea",{className:"card__reply",placeholder:null!==M?"Sending...":"Type a reply... (Enter to send)","aria-label":"Type a reply to the agent",value:W,onChange:e=>D(e.target.value),onKeyDown:e=>{H(e)},rows:1,disabled:null!==M})})]})]}),(0,r.jsxs)("div",{className:"session-card__footer",children:[(0,r.jsx)("span",{className:"card__status min-w-0 truncate",title:null!=(t=b.userPrompt)?t:void 0,children:!b.issueUrl&&b.userPrompt?b.userPrompt.length>60?b.userPrompt.slice(0,60)+"…":b.userPrompt:Y}),z&&F?(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==j||j(F.number)},className:"session-card__control session-card__merge-control",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,r.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",F.number]}):!V&&(0,r.jsx)("button",{onClick:e=>{if(e.stopPropagation(),!T)return void I(!0);I(!1),null==g||g(b.id)},onMouseLeave:()=>I(!1),onBlur:()=>I(!1),"aria-label":T?"Confirm terminate session":"Terminate session",className:(0,d.cn)("session-card__control session-card__terminate btn--danger",T&&"is-confirming"),children:T?(0,r.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})},function(e,s){return e.session===s.session&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore}),v={merge:{label:"Ready",emptyMessage:"Nothing cleared to land yet."},action:{label:"Action",emptyMessage:"No agents need your input."},respond:{label:"Respond",emptyMessage:"No agents need your input."},review:{label:"Review",emptyMessage:"No code waiting for review."},pending:{label:"Pending",emptyMessage:"Nothing blocked."},working:{label:"Working",emptyMessage:"No agents running."},done:{label:"Done",emptyMessage:"No completed sessions."}},g=(0,a.memo)(function(e){let{level:s,sessions:t,onSend:n,onKill:l,onMerge:o,onRestore:i,collapsed:c,onToggle:d,compactMobile:h,onPreview:u,resetKey:m}=e,x=v[s],p=void 0!==d,[g,f]=(0,a.useState)(!1),_=p&&h&&!g?t.slice(0,5):t,N=t.length-_.length;return((0,a.useEffect)(()=>{c&&f(!1)},[c]),(0,a.useEffect)(()=>{f(!1)},[m]),p)?(0,r.jsxs)("div",{className:"accordion-section".concat(c?" accordion-section--collapsed":" accordion-section--expanded"),"data-level":s,children:[(0,r.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>d(s),"aria-expanded":!c,"aria-controls":"accordion-body-".concat(s),children:[(0,r.jsx)("span",{className:"accordion-header__dot","data-level":s}),(0,r.jsx)("span",{className:"accordion-header__label",children:x.label}),(0,r.jsx)("span",{className:"accordion-header__count",children:t.length}),(0,r.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,r.jsx)("div",{id:"accordion-body-".concat(s),className:"accordion-body",children:t.length>0?(0,r.jsxs)("div",{className:h?"mobile-session-list":"flex flex-col gap-2 p-3",children:[_.map(e=>h?(0,r.jsx)(j,{session:e,level:s,onPreview:u},e.id):(0,r.jsx)(b,{session:e,onSend:n,onKill:l,onMerge:o,onRestore:i},e.id)),h&&N>0?(0,r.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>f(!0),children:["View all ",t.length]}):null]}):h?(0,r.jsx)("div",{className:"mobile-session-list",children:(0,r.jsx)("div",{className:"mobile-session-list__empty",children:x.emptyMessage})}):null})]}):(0,r.jsxs)("div",{className:"kanban-column","data-level":s,children:[(0,r.jsx)("div",{className:"kanban-column__header",children:(0,r.jsxs)("div",{className:"kanban-column__title-row",children:[(0,r.jsx)("div",{className:"kanban-column__dot","data-level":s}),(0,r.jsx)("span",{className:"kanban-column__title",children:x.label}),(0,r.jsx)("span",{className:"kanban-column__count",children:t.length})]})}),(0,r.jsx)("div",{className:"kanban-column-body",children:t.length>0?(0,r.jsx)("div",{className:"kanban-column__stack",children:t.map(e=>(0,r.jsx)(b,{session:e,onSend:n,onKill:l,onMerge:o,onRestore:i},e.id))}):null})]})},function(e,s){return e.level===s.level&&e.collapsed===s.collapsed&&e.onToggle===s.onToggle&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore&&e.compactMobile===s.compactMobile&&e.onPreview===s.onPreview&&e.resetKey===s.resetKey&&e.sessions.length===s.sessions.length&&e.sessions.every((e,t)=>e===s.sessions[t])});function j(e){let{session:s,level:t,onPreview:a}=e,n=[s.branch,s.pr?"PR #".concat(s.pr.number):null,s.issueLabel].filter(Boolean);return(0,r.jsxs)("div",{className:"mobile-session-row",children:[(0,r.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>null==a?void 0:a(s),"aria-label":"Open ".concat((0,h.Pn)(s)),children:[(0,r.jsxs)("div",{className:"mobile-session-row__line",children:[(0,r.jsx)("span",{className:"mobile-session-row__dot","data-level":t,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mobile-session-row__title",children:(0,h.Pn)(s)})]}),(0,r.jsx)("div",{className:"mobile-session-row__meta",children:n.length>0?n.join(" \xb7 "):"No branch or PR metadata"})]}),(0,r.jsxs)("div",{className:"mobile-session-row__side",children:[(0,r.jsx)(f,{session:s,level:t}),(0,r.jsx)("a",{href:(0,x.Nc)(s.projectId,s.id),className:"mobile-session-row__open","aria-label":"Go to ".concat((0,h.Pn)(s)),children:(0,r.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"}),(0,r.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function f(e){var s,t,a,n;let{session:l,level:o}=e,i=v[o].label.toLowerCase();return"merge"===o&&l.pr&&(0,c.QN)(l.pr)?i="ready":"action"===o?i="needs_input"===l.status?"needs input":"stuck"===l.status?"stuck":"errored"===l.status?"errored":"waiting_input"===l.activity?"waiting":"exited"===l.activity?"crashed":"blocked"===l.activity?"blocked":"ci_failed"===l.status?"ci failed":"changes_requested"===l.status?"changes":(null==(a=l.pr)?void 0:a.ciStatus)==="failing"?"ci failed":(null==(n=l.pr)?void 0:n.reviewDecision)==="changes_requested"?"changes":l.pr&&!l.pr.mergeability.noConflicts?"conflicts":"action":"respond"===o?i="waiting_input"===l.activity?"waiting":"needs input":"review"===o?i=(null==(s=l.pr)?void 0:s.reviewDecision)==="changes_requested"?"changes":"review":"pending"===o?i=(null==(t=l.pr)?void 0:t.unresolvedThreads)?"threads":"pending":"working"===o&&(i="idle"===l.activity?"idle":"active"),(0,r.jsx)("span",{className:"mobile-session-row__chip",children:i})}var _=t(7848),N=t(5309),y=t(5184),w=t(9293);let k=["Working","Pending","Review","Respond","Merge"];function C(e){let{message:s,orchestratorHref:t,onSpawnOrchestrator:a=null,spawnLabel:n="Spawn Orchestrator",spawnDisabled:l=!1}=e;return(0,r.jsxs)("div",{className:"board-wrapper",children:[(0,r.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:k.map(e=>(0,r.jsx)("div",{className:"kanban-ghost__col",children:(0,r.jsx)("div",{className:"kanban-ghost__head",children:e})},e))}),(0,r.jsx)("div",{className:"board-center",children:(0,r.jsxs)("div",{className:"empty-state",role:"status",children:[(0,r.jsx)("div",{className:"empty-state__icon",children:(0,r.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"rgba(249,115,22,0.18)",stroke:"#f97316",strokeWidth:"1.5"}),(0,r.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,r.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:"12",y1:"8",x2:"6.7",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,r.jsx)("line",{x1:"12",y1:"8",x2:"17.3",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,r.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),s?(0,r.jsx)("p",{className:"empty-state__text",children:s}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,r.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),t?(0,r.jsxs)("a",{href:t,className:"empty-state__cta",children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):a?(0,r.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:a,disabled:l,children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),n]}):null]})]})})]})}var M=t(2446);function S(e){let{status:s}=e;return"connected"===s?null:"disconnected"===s?(0,r.jsx)("button",{type:"button",className:"connection-bar connection-bar--disconnected","aria-live":"assertive","aria-atomic":"true",onClick:()=>window.location.reload(),children:"Offline \xb7 tap to retry"}):(0,r.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}let P="ao.updateBanner.dismissedFor";function R(){let[e,s]=(0,a.useState)(null),[t,n]=(0,a.useState)("idle"),[l,o]=(0,a.useState)(null),[i,c]=(0,a.useState)(null);(0,a.useEffect)(()=>{try{c(window.localStorage.getItem(P))}catch(e){}},[]),(0,a.useEffect)(()=>{if("function"!=typeof fetch)return;let e=!1;return Promise.resolve(fetch("/api/version",{cache:"no-store"})).then(e=>e&&e.ok?e.json():null).then(t=>{e||s(t)}).catch(()=>{}),()=>{e=!0}},[]);let d=(0,a.useCallback)(()=>{if(null==e?void 0:e.latest){try{window.localStorage.setItem(P,e.latest)}catch(e){}c(e.latest),n("idle"),o(null)}},[e]),h=(0,a.useCallback)(async()=>{n("starting"),o(null);try{var e;let s=await fetch("/api/update",{method:"POST"}),t=await s.json();if(s.ok)return void n("started");if(409===s.status){n("blocked"),o(t.message);return}n("error"),o(null!=(e=t.message)?e:"Update failed")}catch(e){n("error"),o(e instanceof Error?e.message:String(e))}},[]);if(!e||!e.isOutdated||!e.latest||"manual"===e.channel||i===e.latest&&"idle"===t||"started"===t)return null;let u="nightly"===e.channel?" (nightly)":"";return(0,r.jsxs)("div",{role:"status","aria-live":"polite",className:"flex w-full items-center justify-between gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-amber-dim)] px-4 py-2 text-sm text-[var(--color-text-primary)]",children:[(0,r.jsxs)("div",{className:"flex flex-1 items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 flex-shrink-0 rounded-full bg-[var(--color-accent-amber)]"}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-2",children:[(0,r.jsxs)("span",{className:"font-medium",children:["Update available",u,": ",e.current," → ",e.latest]}),"blocked"===t&&l||"error"===t&&l?(0,r.jsx)("span",{className:"text-xs text-[var(--color-status-error)]",children:l}):"starting"===t?(0,r.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Starting…"}):(0,r.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Click Update to install. The dashboard will restart."})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void h(),disabled:"starting"===t,className:"rounded-sm border border-[var(--color-accent-amber-border)] bg-[var(--color-accent-amber)] px-3 py-1 text-xs font-medium text-[var(--color-text-inverse)] hover:bg-[color-mix(in_srgb,var(--color-accent-amber)_85%,black)] disabled:cursor-wait disabled:opacity-60",children:"starting"===t?"Updating…":"Update"}),(0,r.jsx)("button",{type:"button",onClick:d,"aria-label":"Dismiss",className:"rounded-sm px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]",children:"Dismiss"})]})]})}let T=[/\bBearer\s+[A-Za-z0-9._\-+/=]+\b/gi,/\bsk-[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g];function I(e){let{projectId:s}=e,{showToast:t}=(0,M.d)(),[n,l]=(0,a.useState)(!1),o=(0,a.useCallback)(async()=>{if(!n){l(!0);try{let e,r=await fetch("/api/observability",{credentials:"same-origin"});if(!r.ok)return void t("Could not fetch observability snapshot","error");let a=r.headers.get("x-correlation-id");try{e=await r.json()}catch(e){t("Could not parse observability snapshot","error");return}let n=function e(s){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof s)return T.reduce((e,s)=>e.replace(s,"[REDACTED]"),s);if(Array.isArray(s))return s.map(s=>e(s,t));if(s&&"object"==typeof s){if(t.has(s))return"[Circular]";t.add(s);let r={};for(let[a,n]of Object.entries(s))r[a]=e(n,t);return r}return s}(function(e,s){if(!s||!e||"object"!=typeof e)return e;let t={...e},r=t.projects;if(r&&"object"==typeof r&&!Array.isArray(r)){let e=r[s];t.projects=void 0===e?{}:{[s]:e}}return t}(e,s)),l={copiedAt:new Date().toISOString(),pageHref:"".concat(window.location.origin).concat(window.location.pathname),projectId:null!=s?s:null,correlationId:a,userAgent:navigator.userAgent,observability:n};await navigator.clipboard.writeText(JSON.stringify(l,null,2)),t("Debug bundle copied to clipboard","success")}catch(e){t("Could not copy debug bundle","error")}finally{l(!1)}}},[n,s,t]);return(0,r.jsxs)("button",{type:"button",className:"orchestrator-btn flex min-h-[44px] min-w-[44px] items-center gap-2 px-4 py-2 text-[12px] font-semibold text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-hover)] disabled:opacity-50",onClick:()=>void o(),disabled:n,"aria-label":"Copy debug bundle for issue reports",children:[(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy debug info"]})}var W=t(2466);function D(e){let s=Date.now(),t=Math.floor((s-new Date(e).getTime())/1e3);if(t<60)return"".concat(t,"s ago");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return"".concat(n,"d ago")}function A(e){return e.replaceAll("_"," ")}function B(e){return null!==e}function O(e){var s,t;let{session:n,mode:l,onCancel:o,onConfirm:i,onRequestKill:d,onMerge:u,isMergeReady:m=!1}=e,p=(0,a.useRef)(null),b=(0,a.useRef)(null),v=(0,a.useRef)(null),g=null!=(t=null==n||null==(s=n.pr)?void 0:s.number)?t:null;if((0,a.useEffect)(()=>{if(!n){v.current=null;return}function e(e){"Escape"===e.key&&o()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,o]),(0,a.useEffect)(()=>{if(!n||!b.current)return;let e=b.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===e.length)return;let s=e[0],t=e[e.length-1],r=v.current!==n.id;function a(e){"Tab"===e.key&&(e.shiftKey&&document.activeElement===s?(e.preventDefault(),t.focus()):e.shiftKey||document.activeElement!==t||(e.preventDefault(),s.focus()))}v.current=n.id,r&&s.focus();let l=b.current;return l.addEventListener("keydown",a),()=>l.removeEventListener("keydown",a)},[n,l]),!n)return null;let j=(0,h.Pn)(n),f=(0,c.ng)(n),_=n.summary&&!n.summaryIsFallback?n.summary:null,N="done"!==f&&"merge"!==f&&"terminated"!==n.status,y=n.pr,w=!!(y&&!(0,c.fZ)(y)&&!(0,c.sZ)(y)),k="done"===f||"terminated"===n.status||"exited"===n.activity,C=[{label:A(f),tone:"accent"},{label:A(n.status),tone:"neutral"},n.activity?{label:A(n.activity),tone:"neutral"}:null,n.branch?{label:n.branch,tone:"mono"}:null,n.pr?{label:"PR #".concat(n.pr.number),tone:"neutral"}:null,n.issueLabel?{label:n.issueLabel,tone:"neutral"}:null].filter(B);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"bottom-sheet-backdrop",onClick:o,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:b,className:"bottom-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"bottom-sheet-title",onTouchStart:function(e){var s,t;p.current=null!=(t=null==(s=e.touches[0])?void 0:s.clientY)?t:null},onTouchEnd:function(e){var s,t;if(null===p.current)return;let r=(null!=(t=null==(s=e.changedTouches[0])?void 0:s.clientY)?t:0)-p.current;p.current=null,r>80&&o()},children:[(0,r.jsx)("div",{className:"bottom-sheet__handle","aria-hidden":"true"}),"confirm-kill"===l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bottom-sheet__header",children:[(0,r.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:"Terminate session?"}),(0,r.jsx)("p",{className:"bottom-sheet__subtitle",children:"This action cannot be undone."})]}),(0,r.jsxs)("div",{className:"bottom-sheet__session-info",children:[(0,r.jsx)("div",{className:"bottom-sheet__session-name",children:j}),(0,r.jsx)("div",{className:"bottom-sheet__session-meta",children:C.map(e=>(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--".concat(e.tone),children:e.label},"".concat(e.tone,"-").concat(e.label)))}),_?(0,r.jsx)("p",{className:"bottom-sheet__summary",children:_}):null]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bottom-sheet__preview-card",children:[(0,r.jsx)("div",{className:"bottom-sheet__preview-strip","data-level":f}),(0,r.jsxs)("div",{className:"bottom-sheet__preview-content",children:[(0,r.jsxs)("div",{className:"bottom-sheet__preview-header",children:[(0,r.jsx)("span",{className:"bottom-sheet__preview-id",children:n.id}),(0,r.jsx)("span",{className:"bottom-sheet__preview-time",children:D(n.lastActivityAt)})]}),(0,r.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:j}),(0,r.jsxs)("p",{className:"bottom-sheet__subtitle",children:[A(f)," \xb7 started ",D(n.createdAt)]}),(0,r.jsxs)("div",{className:"bottom-sheet__preview-meta",children:[n.branch?(0,r.jsx)("span",{className:"bottom-sheet__preview-branch",children:n.branch}):null,y?(0,r.jsxs)("span",{className:"bottom-sheet__preview-pr",children:["#",y.number]}):null,w&&y?(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff",children:[(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff-add",children:["+",y.additions]})," ",(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff-del",children:["-",y.deletions]})]}):null]}),w&&y?(0,r.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:"passing"===y.ciStatus?"CI passing":"failing"===y.ciStatus?"CI failed":"CI pending"}),(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:"approved"===y.reviewDecision?"approved":"changes_requested"===y.reviewDecision?"changes requested":"needs review"}),k?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:A(n.status)}):null,k&&n.activity?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:A(n.activity)}):null]}):(0,r.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:A(n.status)}),n.activity?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:A(n.activity)}):null]})]})]}),_?(0,r.jsx)("p",{className:"bottom-sheet__summary",children:_}):null]}),(0,r.jsx)("div",{className:"bottom-sheet__actions",children:"confirm-kill"===l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--cancel",onClick:o,children:"Cancel"}),(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:i,children:"Terminate"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:(0,x.Nc)(n.projectId,n.id),className:"bottom-sheet__btn bottom-sheet__btn--primary",children:"Open session"}),m&&n.pr&&u?(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--secondary",onClick:()=>{null!==g&&u(g)},children:"Merge"}):N&&d?(0,r.jsxs)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:d,children:[(0,r.jsxs)("svg",{className:"bottom-sheet__btn-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,r.jsx)("path",{d:"M10 11v6M14 11v6"})]}),"Terminate"]}):null]})})]})]})}let E=["working","pending","action","merge"],F=["working","pending","review","respond","merge"],L=[];function H(e){var s;let{session:t,onRestore:a}=e,n=!t.summaryIsFallback&&t.summary||t.issueTitle||t.summary||t.id,l=(null==(s=t.pr)?void 0:s.state)==="merged"||"merged"===t.status,o="killed"===t.status||"terminated"===t.status,i=!c.N_.has(t.status);return(0,r.jsxs)("div",{className:"done-card",children:[(0,r.jsx)("p",{className:"done-card__title",children:n}),(0,r.jsxs)("div",{className:"done-card__meta",children:[(0,r.jsx)("span",{className:"done-card__badge ".concat(o?"done-card__badge--terminated":"done-card__badge--merged"),children:l?"merged":o?"terminated":"done"}),t.pr?(0,r.jsxs)("a",{href:t.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,r.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",t.pr.number]}):null,(0,r.jsx)("span",{className:"done-card__age",children:function(e){if(!e)return"just now";let s=new Date(e).getTime();if(!Number.isFinite(s))return"just now";let t=Date.now()-s;if(t<=0)return"just now";let r=Math.floor(t/1e3),a=Math.floor(r/60),n=Math.floor(a/60),l=Math.floor(n/24);return r<60?"".concat(r,"s ago"):a<60?"".concat(a,"m ago"):n<24?"".concat(n,"h ago"):"".concat(l,"d ago")}(t.lastActivityAt)}),i&&!l?(0,r.jsx)("button",{type:"button",className:"done-card__restore",onClick:e=>{e.stopPropagation(),a(t.id)},children:"Restore"}):null]})]})}function U(e){var s,t,n,d;let{initialSessions:h,projectId:u,projectName:m,projects:p=[],orchestrators:b,attentionZones:v="simple",dashboardLoadError:j}=e,f=null!=b?b:L,k=(0,y.eT)(),P="detailed"===v?F:E,T=(0,a.useMemo)(()=>{let e={};for(let s of h)e[s.id]=(0,c.ng)(s,v);return e},[h,v]),{sessions:D,attentionLevels:A,liveSessionsResolved:B,loadError:U}=(0,N.D)({initialSessions:h,muxSessions:(null==k?void 0:k.status)==="connected"?k.sessions:void 0,muxLastError:null==k?void 0:k.lastError,initialAttentionLevels:T,attentionZones:v}),q=(0,a.useMemo)(()=>u?D.filter(e=>e.projectId===u):D,[D,u]),Z=(null==k?void 0:k.status)==="disconnected"?"disconnected":(null==k?void 0:k.status)==="connected"?"connected":"reconnecting",z=null!=U?U:j&&B?void 0:j,V=(0,o.useSearchParams)(),G=(0,o.useRouter)(),J=(0,a.useRef)(G);J.current=G;let Y=null!=(s=V.get("session"))?s:void 0,[Q,$]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(f),[es,et]=(0,a.useState)([]),[er,ea]=(0,a.useState)({}),[en,el]=(0,a.useState)(!1),[eo,ei]=(0,a.useState)(!1),ec=(0,i.U)(i.D),[ed,eh]=(0,a.useState)(()=>new Set(["done","working"])),[eu,em]=(0,a.useState)(null),[ex,ep]=(0,a.useState)("preview"),eb=V.get("debug"),ev=!ec&&("1"===eb||"true"===eb),{showToast:eg}=(0,M.d)(),[ej,ef]=(0,a.useState)(!1),e_=(0,a.useRef)(D);e_.current=D;let eN=p.length>1&&void 0===u,ey=(0,a.useMemo)(()=>{var e;return u&&null!=(e=X.find(e=>e.projectId===u))?e:null},[X,u]),ew=ey?(0,x.Nc)(ey.projectId,ey.id):null,ek=!eN&&!!u&&p.some(e=>e.id===u&&!e.resolveError)&&!ew,eC=u&&null!=(t=p.find(e=>e.id===u))?t:null,eM=!!u&&es.includes(u),eS=u&&null!=(n=er[u])?n:null,eP=(0,a.useMemo)(()=>eN||!Y?q:q.filter(e=>e.id===Y),[q,eN,Y]);(0,a.useEffect)(()=>{ee(e=>(function(e,s){let t=new Map(e.map(e=>[e.projectId,e]));for(let e of s)t.set(e.projectId,e);return[...t.values()]})(e,f))},[f]),(0,a.useEffect)(()=>{let e=(0,_.S)(A),s=null!=m?m:"ao";document.title=e>0?"".concat(s," (").concat(e," need attention)"):s},[A,m]),(0,a.useEffect)(()=>{ei(!1)},[V]);let eR=(0,a.useMemo)(()=>{let e={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let s of eP)e[(0,c.ng)(s,v)].push(s);return e},[eP,v]),eT=(0,a.useMemo)(()=>{let e=new Map;for(let s of D){let t=e.get(s.projectId);if(t){t.push(s);continue}e.set(s.projectId,[s])}return e},[D]),eI=(0,a.useMemo)(()=>eN?p.map(e=>{var s,t;let r=null!=(s=eT.get(e.id))?s:[],a={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let e of r)a[(0,c.ng)(e,v)]++;return{project:e,orchestrator:null!=(t=X.find(s=>s.projectId===e.id))?t:null,sessionCount:r.length,openPRCount:r.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,counts:a}}):[],[X,eN,v,p,eT]),eW=(0,a.useCallback)(async(e,s)=>{try{let t=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s})});if(!t.ok){let s=await t.text()||"Unknown error";console.error("Failed to send message to ".concat(e,":"),s),eg("Send failed: ".concat(s),"error");let r=Error(s);throw r.toastShown=!0,r}}catch(s){throw s instanceof Error&&"toastShown"in s&&s.toastShown||(console.error("Network error sending message to ".concat(e,":"),s),eg("Network error while sending message","error")),s}},[eg]),eD=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/kill"),{method:"POST"});if(s.ok)eg("Session terminated","success");else{let t=await s.text();console.error("Failed to kill ".concat(e,":"),t),eg("Terminate failed: ".concat(t),"error")}}catch(s){console.error("Network error killing ".concat(e,":"),s),eg("Network error while terminating session","error")}},[eg]),eA=(0,a.useCallback)(e=>{var s;let t=null!=(s=e_.current.find(s=>s.id===e))?s:null;t&&eD(t.id)},[eD]),eB=(0,a.useCallback)(e=>{em(e),ep("preview")},[]),eO=(0,a.useCallback)(()=>{ep("confirm-kill")},[]),eE=(0,a.useCallback)(()=>{em(null),ep("preview")},[]),eF=(0,a.useCallback)(()=>{eu&&eD(eu.id),em(null),ep("preview")},[eu,eD]),eL=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/prs/".concat(e,"/merge"),{method:"POST"});if(s.ok)eg("PR #".concat(e," merged"),"success");else{let t=await s.text();console.error("Failed to merge PR #".concat(e,":"),t),eg("Merge failed: ".concat(t),"error");return}}catch(s){console.error("Network error merging PR #".concat(e,":"),s),eg("Network error while merging PR","error")}},[eg]),eH=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/restore"),{method:"POST"});if(s.ok)eg("Session restored","success"),J.current.refresh();else{let t=await s.text();console.error("Failed to restore ".concat(e,":"),t),eg("Restore failed: ".concat(t),"error")}}catch(s){console.error("Network error restoring ".concat(e,":"),s),eg("Network error while restoring session","error")}},[eg]),eU=async e=>{et(s=>s.includes(e.id)?s:[...s,e.id]),ea(s=>{let{[e.id]:t,...r}=s;return r});try{let t=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e.id})}),r=await t.json().catch(()=>null);if(!t.ok||!(null==r?void 0:r.orchestrator)){var s;throw Error(null!=(s=null==r?void 0:r.error)?s:"Failed to spawn orchestrator for ".concat(e.name))}let a=r.orchestrator;ee(s=>{let t=s.filter(s=>s.projectId!==e.id);return t.push(a),t})}catch(t){let s=t instanceof Error?t.message:"Failed to spawn orchestrator";ea(t=>({...t,[e.id]:s})),console.error("Failed to spawn orchestrator for ".concat(e.id,":"),t)}finally{et(s=>s.filter(s=>s!==e.id))}},eq=P.some(e=>eR[e].length>0),eK=!eN&&!eq&&!z,eZ=z?(0,r.jsxs)("div",{className:"dashboard-alert mb-6 flex flex-col gap-1.5 border border-[color-mix(in_srgb,var(--color-status-error)_28%,transparent)] bg-[color-mix(in_srgb,var(--color-status-error)_10%,transparent)] px-3.5 py-2.5 text-[11px] md:mb-4",role:"alert","aria-live":"assertive",children:[(0,r.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,r.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:z}),(0,r.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,r.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,r.jsx)("span",{className:"font-mono text-[10px]",children:"ao doctor"})," for diagnostics."]})]}):null,ez=(0,a.useMemo)(()=>D.some(e=>e.pr&&(0,c.fZ)(e.pr)),[D]),eV="agent orchestrator"===(null==m?void 0:m.trim().toLowerCase())?null!=(d=null!=u?u:m)?d:eN?"All projects":"Dashboard":null!=m?m:eN?"All projects":"Dashboard",eG=!eN&&eV.trim().length>0,eJ=e=>{eh(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},eY=()=>{window.innerWidth<768?ei(e=>!e):el(e=>!e)};return(0,r.jsx)(W.I.Provider,{value:{onToggleSidebar:eY,mobileSidebarOpen:eo},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R,{}),(0,r.jsx)(S,{status:Z}),(0,r.jsxs)("div",{className:"dashboard-app-shell",children:[(0,r.jsxs)("header",{className:"dashboard-app-header",children:[(0,r.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:eY,"aria-label":"Toggle sidebar",children:ec?(0,r.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,r.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,r.jsx)("path",{d:"M9 3v18"})]})}),(0,r.jsxs)("div",{className:"dashboard-app-header__brand",children:[(0,r.jsx)("span",{className:"dashboard-app-header__brand-dot","aria-hidden":"true"}),(0,r.jsx)("span",{children:"Agent Orchestrator"})]}),eG?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"dashboard-app-header__sep","aria-hidden":"true"}),(0,r.jsx)("span",{className:"dashboard-app-header__project",children:eV})]}):null,ev?(0,r.jsx)(I,{projectId:u}):null,(0,r.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,r.jsx)("div",{className:"dashboard-app-header__actions",children:!eN&&ew?(0,r.jsxs)(l(),{href:ew,className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Orchestrator",children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):ek&&eC?(0,r.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Spawn Orchestrator",onClick:()=>void eU(eC),disabled:eM,children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),eM?"Spawning...":"Spawn Orchestrator"]}):null})]}),(0,r.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(en?" dashboard-shell--sidebar-collapsed":""),children:[(0,r.jsx)("div",{className:"sidebar-wrapper".concat(eo?" sidebar-wrapper--mobile-open":""),children:(0,r.jsx)(w.u,{projects:p,sessions:D,orchestrators:X,activeProjectId:u,activeSessionId:Y,collapsed:en,onToggleCollapsed:()=>el(e=>!e),onMobileClose:()=>ei(!1)})}),eo&&(0,r.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>ei(!1)}),(0,r.jsxs)("main",{className:"dashboard-main dashboard-main--desktop",children:[(0,r.jsx)(_.u,{attentionLevels:A,projectName:m}),(0,r.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,r.jsx)("h1",{className:"dashboard-main__title",children:"Dashboard"}),(0,r.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions, pull requests, and merge status."})]}),(0,r.jsxs)("div",{className:"dashboard-main__body",children:[eZ,ez&&!Q&&(0,r.jsxs)("div",{className:"dashboard-alert mb-4 flex items-center gap-2.5 border border-[color-mix(in_srgb,var(--color-status-attention)_25%,transparent)] bg-[var(--color-tint-yellow)] px-3.5 py-2.5 text-[11px] text-[var(--color-status-attention)]",children:[(0,r.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,r.jsx)("span",{className:"flex-1",children:"GitHub API rate limited — PR data (CI status, review state, sizes) may be stale. Will retry automatically on next refresh."}),(0,r.jsx)("button",{onClick:()=>$(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),eN&&(0,r.jsx)(K,{overviews:eI,onSpawnOrchestrator:eU,spawningProjectIds:es,spawnErrors:er,attentionZones:v}),!eN&&eq&&(0,r.jsx)("div",{className:"kanban-board-wrap",children:(0,r.jsx)("div",{className:"kanban-board","data-columns":P.length,style:{"--kanban-column-count":P.length},children:P.map(e=>(0,r.jsx)(g,{level:e,sessions:eR[e],onSend:eW,onKill:eA,onMerge:eL,onRestore:eH,compactMobile:ec,collapsed:ec&&ed.has(e),onToggle:ec?eJ:void 0,onPreview:ec?eB:void 0},e))})}),eK?(0,r.jsx)(C,{orchestratorHref:ew,onSpawnOrchestrator:ek&&eC?()=>{eU(eC)}:null,spawnLabel:eM?"Spawning...":"Spawn Orchestrator",spawnDisabled:eM}):null,!eN&&eS?(0,r.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:eS}):null,!eN&&eR.done.length>0&&(0,r.jsxs)("div",{className:"done-bar mt-6",children:[(0,r.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>ef(e=>!e),"aria-expanded":ej,children:[(0,r.jsx)("svg",{className:"done-bar__chevron".concat(ej?" done-bar__chevron--open":""),fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,r.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,r.jsx)("span",{className:"done-bar__count",children:eR.done.length})]}),ej&&(0,r.jsx)("div",{className:"done-bar__cards",children:eR.done.map(e=>(0,r.jsx)(H,{session:e,onRestore:eH},e.id))})]})]})]})]})]}),(0,r.jsx)(O,{session:eu,mode:ex,onCancel:eE,onConfirm:eF,onRequestKill:eO,onMerge:eL,isMergeReady:!!eu&&"merge"===A[eu.id]})]})})}function q(e){return(0,r.jsx)(M.t,{children:(0,r.jsx)(U,{...e})})}function K(e){let{overviews:s,onSpawnOrchestrator:t,spawningProjectIds:a,spawnErrors:n,attentionZones:o}=e;return(0,r.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:s.map(e=>{let{project:s,orchestrator:i,sessionCount:c,openPRCount:d,counts:h}=e,u=!!s.resolveError,m=(0,x.bn)(s.id);return(0,r.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:s.name}),(0,r.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:u?"Config needs repair":(0,r.jsxs)(r.Fragment,{children:[c," active session",1!==c?"s":"",d>0?" \xb7 ".concat(d," open PR").concat(1!==d?"s":""):""]})})]}),(0,r.jsx)(l(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Open project"})]}),(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,r.jsx)(Z,{label:"Merge",value:h.merge,tone:"ready"}),"detailed"===o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z,{label:"Respond",value:h.respond,tone:"error"}),(0,r.jsx)(Z,{label:"Review",value:h.review,tone:"orange"})]}):(0,r.jsx)(Z,{label:"Action",value:h.action,tone:"orange"}),(0,r.jsx)(Z,{label:"Pending",value:h.pending,tone:"attention"}),(0,r.jsx)(Z,{label:"Working",value:h.working,tone:"working"})]}),(0,r.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:u?"Project config could not be resolved":i?"Per-project orchestrator available":"No running orchestrator"}),u?(0,r.jsx)(l(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-semibold text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Repair project"}):i?(0,r.jsxs)(l(),{href:(0,x.Nc)(i.projectId,i.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,r.jsx)("button",{type:"button",onClick:()=>void t(s),disabled:a.includes(s.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:a.includes(s.id)?"Spawning...":"Spawn Orchestrator"})]}),n[s.id]?(0,r.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:n[s.id]}):null]})]},s.id)})})}function Z(e){let{label:s,value:t,tone:a}=e;return(0,r.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:s}),(0,r.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":a,children:t})]})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2437,2438,2922,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);