madarx 2.9.2 → 2.9.4

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 (616) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +283 -283
  3. package/.next/standalone/.next/app-path-routes-manifest.json +79 -79
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  8. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  9. package/.next/standalone/.next/server/app/activity/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/admin/page.js +2 -2
  11. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/agents/[id]/page.js +3 -3
  13. package/.next/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/agents/page.js +1 -1
  15. package/.next/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/activity/route_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/admin/audit-export/route_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/api/admin/share-links/route_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/agent-memory/route_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/api/agent-runs/[id]/cancel/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/api/agent-runs/[id]/events/route_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/api/agent-runs/[id]/log/route_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/agent-runs/[id]/route_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/api/agent-runs/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/api/agents/[id]/chain/route_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/api/agents/[id]/memory/route_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/api/agents/[id]/reports/route_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/api/agents/[id]/run/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/agents/[id]/skills/route_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/api/agents/create/route_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/api/agents/ops/route_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/artifacts/[id]/acl/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/artifacts/[id]/protect/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/artifacts/[id]/raw/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/artifacts/[id]/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/artifacts/upload/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/audit/list/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/audit/search/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/auth/config/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/auth/join-bootstrap/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/api/brand/route_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/api/chat/sessions/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/api/chat/sessions/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/config/env/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/connections/[service]/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/connections/[service]/verify/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/connections/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/cron/tick/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/move/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/dashboard/spaces/import/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/dashboard/spaces/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/disk/files/[id]/blob/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/disk/files/[id]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/disk/files/[id]/transcribe/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/disk/files/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/disk/folders/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/events/since/[cursor]/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/events/stream/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/fs/create-folder/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/fs/pick-folder/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/blueprint/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/diagnostic/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/governance/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/interview/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/pilot/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/quarterly/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/setup-package/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/hail/engagements/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/responses/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/hail/setup-packages/[id]/apply/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/hail/setup-packages/validate/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/heartbeat/tick/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/heartbeat/worker/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/help/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/events/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/hermes/jobs/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/integrations/google/callback/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/integrations/google/oauth/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/marketplace/[id]/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/marketplace/open-design/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/marketplace/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/mines/import-roots/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/mines/portfolio/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/mines/projects/[id]/chunks/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/mines/projects/[id]/diligence/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/mines/projects/[id]/import/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/mines/projects/[id]/publish/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/mines/projects/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/missions/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/onboarding/blueprint/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/onboarding/launch/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/orchestrator/command/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/orchestrator/stream/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/org/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/[inviteId]/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/role/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/orgs/[id]/members/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/orgs/[id]/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/orgs/invites/pending/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/orgs/join/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/orgs/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/printing-press/clis/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/printing-press/install/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/printing-press/security-mode/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/privacy/config/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/privacy/verify/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/processes/[id]/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/processes/[id]/share-link/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/override/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/retry/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/submit/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/settings/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/processes/definitions/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/processes/definitions/validate/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/processes/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/processes/start-and-route/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/projects/[slug]/library/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/projects/[slug]/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/runs/approve-claude-run/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/runs/claude-code-dry-run/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/runs/competitor-report/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/runs/engine-ping/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/runs/marketing-plan/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/schedules/upsert/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/secrets/[name]/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/secrets/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/settings/trust-mode/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/share/[token]/otp/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/share/[token]/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/share/[token]/verify/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/share/space/[token]/otp/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/share/space/[token]/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/share/space/[token]/verify/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/shared/spaces/[id]/acl/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/shared/spaces/publish/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/shared/spaces/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/shared/spaces/status/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/api/shared/spaces/unpublish/route_client-reference-manifest.js +1 -1
  157. package/.next/standalone/.next/server/app/api/state/route_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/api/system/update/route_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/api/tasks/[id]/active-run/route_client-reference-manifest.js +1 -1
  160. package/.next/standalone/.next/server/app/api/tasks/[id]/attachments/route_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/[itemId]/route_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/route_client-reference-manifest.js +1 -1
  163. package/.next/standalone/.next/server/app/api/tasks/[id]/checkout/route_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/api/tasks/[id]/children/route_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/api/tasks/[id]/events/route_client-reference-manifest.js +1 -1
  167. package/.next/standalone/.next/server/app/api/tasks/[id]/live-runs/route_client-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/app/api/tasks/[id]/release/route_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
  170. package/.next/standalone/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
  171. package/.next/standalone/.next/server/app/api/tool-allowlists/[id]/route_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/api/tool-allowlists/route_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/api/tool-egress/route_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app/api/tools/[name]/approve/route_client-reference-manifest.js +1 -1
  175. package/.next/standalone/.next/server/app/api/tools/[name]/route_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/api/tools/route_client-reference-manifest.js +1 -1
  177. package/.next/standalone/.next/server/app/api/transcripts/route_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/api/voice/providers/route_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/api/voice/realtime/context/route_client-reference-manifest.js +1 -1
  180. package/.next/standalone/.next/server/app/api/voice/realtime/session/route_client-reference-manifest.js +1 -1
  181. package/.next/standalone/.next/server/app/api/voice/realtime/tool-result/route_client-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/app/api/voice/realtime/tools/route_client-reference-manifest.js +1 -1
  183. package/.next/standalone/.next/server/app/api/voice/tts/route_client-reference-manifest.js +1 -1
  184. package/.next/standalone/.next/server/app/api/whatsapp/allowlist/route_client-reference-manifest.js +1 -1
  185. package/.next/standalone/.next/server/app/api/whatsapp/messages/route_client-reference-manifest.js +1 -1
  186. package/.next/standalone/.next/server/app/api/whatsapp/qr/route_client-reference-manifest.js +1 -1
  187. package/.next/standalone/.next/server/app/api/whatsapp/send/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/whatsapp/status/route_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/approvals/page.js +2 -2
  190. package/.next/standalone/.next/server/app/approvals/page_client-reference-manifest.js +1 -1
  191. package/.next/standalone/.next/server/app/architecture/page_client-reference-manifest.js +1 -1
  192. package/.next/standalone/.next/server/app/architecture.html +2 -2
  193. package/.next/standalone/.next/server/app/architecture.rsc +1 -1
  194. package/.next/standalone/.next/server/app/audit/live/page_client-reference-manifest.js +1 -1
  195. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  196. package/.next/standalone/.next/server/app/brand/page_client-reference-manifest.js +1 -1
  197. package/.next/standalone/.next/server/app/brand.html +1 -1
  198. package/.next/standalone/.next/server/app/brand.rsc +1 -1
  199. package/.next/standalone/.next/server/app/disk/page_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/federated-ai/page_client-reference-manifest.js +1 -1
  201. package/.next/standalone/.next/server/app/federated-ai.html +2 -2
  202. package/.next/standalone/.next/server/app/federated-ai.rsc +1 -1
  203. package/.next/standalone/.next/server/app/hail/[id]/governance/page_client-reference-manifest.js +1 -1
  204. package/.next/standalone/.next/server/app/hail/[id]/interview/page.js +1 -1
  205. package/.next/standalone/.next/server/app/hail/[id]/interview/page_client-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/app/hail/[id]/page.js +2 -2
  207. package/.next/standalone/.next/server/app/hail/[id]/page_client-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/app/hail/[id]/setup/page.js +2 -2
  209. package/.next/standalone/.next/server/app/hail/[id]/setup/page_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/hail/page.js +2 -2
  211. package/.next/standalone/.next/server/app/hail/page_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/help/[slug]/page_client-reference-manifest.js +1 -1
  213. package/.next/standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/index.html +2 -2
  215. package/.next/standalone/.next/server/app/index.rsc +1 -1
  216. package/.next/standalone/.next/server/app/join/page_client-reference-manifest.js +1 -1
  217. package/.next/standalone/.next/server/app/join.html +1 -1
  218. package/.next/standalone/.next/server/app/join.rsc +1 -1
  219. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/marketplace/page.js +2 -2
  221. package/.next/standalone/.next/server/app/marketplace/page_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app/mines/[projectId]/page_client-reference-manifest.js +1 -1
  223. package/.next/standalone/.next/server/app/mines/[projectId]/results/page_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/mines/page_client-reference-manifest.js +1 -1
  225. package/.next/standalone/.next/server/app/missions/page.js +2 -2
  226. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  227. package/.next/standalone/.next/server/app/onboarding/org/page_client-reference-manifest.js +1 -1
  228. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  229. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  230. package/.next/standalone/.next/server/app/onboarding.rsc +1 -1
  231. package/.next/standalone/.next/server/app/org/page.js +1 -1
  232. package/.next/standalone/.next/server/app/org/page.js.nft.json +1 -1
  233. package/.next/standalone/.next/server/app/org/page_client-reference-manifest.js +1 -1
  234. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  235. package/.next/standalone/.next/server/app/projects/[slug]/log/page_client-reference-manifest.js +1 -1
  236. package/.next/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  237. package/.next/standalone/.next/server/app/projects/new/page.js +1 -1
  238. package/.next/standalone/.next/server/app/projects/new/page_client-reference-manifest.js +1 -1
  239. package/.next/standalone/.next/server/app/projects/new.html +1 -1
  240. package/.next/standalone/.next/server/app/projects/new.rsc +2 -2
  241. package/.next/standalone/.next/server/app/projects/page.js +11 -11
  242. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  243. package/.next/standalone/.next/server/app/reports/[file]/route_client-reference-manifest.js +1 -1
  244. package/.next/standalone/.next/server/app/reports/page_client-reference-manifest.js +1 -1
  245. package/.next/standalone/.next/server/app/runtime/page_client-reference-manifest.js +1 -1
  246. package/.next/standalone/.next/server/app/schedules/page.js +2 -2
  247. package/.next/standalone/.next/server/app/schedules/page_client-reference-manifest.js +1 -1
  248. package/.next/standalone/.next/server/app/settings/account/page_client-reference-manifest.js +1 -1
  249. package/.next/standalone/.next/server/app/settings/advanced/page_client-reference-manifest.js +1 -1
  250. package/.next/standalone/.next/server/app/settings/appearance/page_client-reference-manifest.js +1 -1
  251. package/.next/standalone/.next/server/app/settings/brand/page_client-reference-manifest.js +1 -1
  252. package/.next/standalone/.next/server/app/settings/brand.html +2 -2
  253. package/.next/standalone/.next/server/app/settings/brand.rsc +1 -1
  254. package/.next/standalone/.next/server/app/settings/connectors/page_client-reference-manifest.js +1 -1
  255. package/.next/standalone/.next/server/app/settings/engines/page_client-reference-manifest.js +1 -1
  256. package/.next/standalone/.next/server/app/settings/onboarding/page_client-reference-manifest.js +1 -1
  257. package/.next/standalone/.next/server/app/settings/onboarding.html +2 -2
  258. package/.next/standalone/.next/server/app/settings/onboarding.rsc +1 -1
  259. package/.next/standalone/.next/server/app/settings/organization/page.js +1 -1
  260. package/.next/standalone/.next/server/app/settings/organization/page.js.nft.json +1 -1
  261. package/.next/standalone/.next/server/app/settings/organization/page_client-reference-manifest.js +1 -1
  262. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  263. package/.next/standalone/.next/server/app/settings/runtime/page_client-reference-manifest.js +1 -1
  264. package/.next/standalone/.next/server/app/settings/tools/page_client-reference-manifest.js +1 -1
  265. package/.next/standalone/.next/server/app/settings.html +2 -2
  266. package/.next/standalone/.next/server/app/settings.rsc +1 -1
  267. package/.next/standalone/.next/server/app/share/[token]/page_client-reference-manifest.js +1 -1
  268. package/.next/standalone/.next/server/app/share/space/[token]/page_client-reference-manifest.js +1 -1
  269. package/.next/standalone/.next/server/app/tasks/[id]/page.js +1 -1
  270. package/.next/standalone/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  271. package/.next/standalone/.next/server/app/tasks/page.js +1 -1
  272. package/.next/standalone/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  273. package/.next/standalone/.next/server/app/team/[agentId]/page_client-reference-manifest.js +1 -1
  274. package/.next/standalone/.next/server/app/team/page_client-reference-manifest.js +1 -1
  275. package/.next/standalone/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  276. package/.next/standalone/.next/server/app/whatsapp/page_client-reference-manifest.js +1 -1
  277. package/.next/standalone/.next/server/app/whatsapp.html +1 -1
  278. package/.next/standalone/.next/server/app/whatsapp.rsc +1 -1
  279. package/.next/standalone/.next/server/app/workflows/[caseId]/page_client-reference-manifest.js +1 -1
  280. package/.next/standalone/.next/server/app/workflows/new/[caseId]/page_client-reference-manifest.js +1 -1
  281. package/.next/standalone/.next/server/app/workflows/new/definition/page_client-reference-manifest.js +1 -1
  282. package/.next/standalone/.next/server/app/workflows/new/page.js +2 -2
  283. package/.next/standalone/.next/server/app/workflows/new/page_client-reference-manifest.js +1 -1
  284. package/.next/standalone/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
  285. package/.next/standalone/.next/server/app/workflows/share/[caseId]/page_client-reference-manifest.js +1 -1
  286. package/.next/standalone/.next/server/app-paths-manifest.json +79 -79
  287. package/.next/standalone/.next/server/chunks/1699.js +2 -2
  288. package/.next/standalone/.next/server/chunks/4676.js +1 -0
  289. package/.next/standalone/.next/server/functions-config-manifest.json +43 -43
  290. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  291. package/.next/standalone/.next/server/pages/404.html +1 -1
  292. package/.next/standalone/.next/server/pages/500.html +1 -1
  293. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  294. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  295. package/.next/standalone/.next/static/chunks/1231-4acb93ac3f653de1.js +1 -0
  296. package/.next/standalone/.next/static/chunks/1255-b28ea36bf0cdbd65.js +1 -0
  297. package/.next/standalone/.next/static/chunks/1517.be5e2c446b38c681.js +1 -0
  298. package/.next/standalone/.next/static/chunks/2309-722fe8d8b26c21c6.js +1 -0
  299. package/.next/standalone/.next/static/chunks/2619-3c9e02e22d10480a.js +1 -0
  300. package/.next/standalone/.next/static/chunks/2713.4f4ae8af4e5bf2ee.js +1 -0
  301. package/.next/standalone/.next/static/chunks/2769-5ea87fab731b4c4d.js +1 -0
  302. package/.next/standalone/.next/static/chunks/3168.3b5e35036a18bdd3.js +1 -0
  303. package/.next/standalone/.next/static/chunks/4119-5297b212ff79d264.js +1 -0
  304. package/.next/standalone/.next/static/chunks/44530001.ef2edd53e6cfdfa8.js +1 -0
  305. package/.next/standalone/.next/static/chunks/4797.5d0d513a724ca684.js +1 -0
  306. package/.next/standalone/.next/static/chunks/4bd1b696-f785427dddbba9fb.js +1 -0
  307. package/.next/standalone/.next/static/chunks/566-df7d5a84a12252cd.js +1 -0
  308. package/.next/standalone/.next/static/chunks/5938.238480f58c343b6b.js +1 -0
  309. package/.next/standalone/.next/static/chunks/7130.5de172d005b1e866.js +1 -0
  310. package/.next/standalone/.next/static/chunks/8-49f6c91cb13e65ac.js +1 -0
  311. package/.next/standalone/.next/static/chunks/8217.93f3920e3c35c748.js +1 -0
  312. package/.next/standalone/.next/static/chunks/840.c27c21f4787aea90.js +59 -0
  313. package/.next/standalone/.next/static/chunks/9077-7f938e8517cad35e.js +1 -0
  314. package/.next/standalone/.next/static/chunks/930-de78056b2dc197a2.js +1 -0
  315. package/.next/standalone/.next/static/chunks/9863.8c29a80e7d210e46.js +1 -0
  316. package/.next/standalone/.next/static/chunks/9867.fc6d7dc10dd6c262.js +1 -0
  317. package/.next/standalone/.next/static/chunks/app/_not-found/page-1a04e2ed7713f80a.js +1 -0
  318. package/.next/standalone/.next/static/chunks/app/activity/loading-abb4b18098f1d93e.js +1 -0
  319. package/.next/standalone/.next/static/chunks/app/activity/page-c12b94ea10818d65.js +1 -0
  320. package/.next/standalone/.next/static/chunks/app/admin/page-e59c7cc86dec4052.js +1 -0
  321. package/.next/standalone/.next/static/chunks/app/agents/[id]/loading-abb4b18098f1d93e.js +1 -0
  322. package/.next/standalone/.next/static/chunks/app/agents/[id]/page-ba45b5f563f12313.js +1 -0
  323. package/.next/standalone/.next/static/chunks/app/agents/loading-abb4b18098f1d93e.js +1 -0
  324. package/.next/standalone/.next/static/chunks/app/agents/page-c251f7df2db0348b.js +1 -0
  325. package/.next/standalone/.next/static/chunks/app/api/activity/route-abb4b18098f1d93e.js +1 -0
  326. package/.next/standalone/.next/static/chunks/app/api/admin/audit-export/route-abb4b18098f1d93e.js +1 -0
  327. package/.next/standalone/.next/static/chunks/app/api/admin/share-links/route-abb4b18098f1d93e.js +1 -0
  328. package/.next/standalone/.next/static/chunks/app/api/agent-memory/route-abb4b18098f1d93e.js +1 -0
  329. package/.next/standalone/.next/static/chunks/app/api/agent-runs/[id]/cancel/route-abb4b18098f1d93e.js +1 -0
  330. package/.next/standalone/.next/static/chunks/app/api/agent-runs/[id]/events/route-abb4b18098f1d93e.js +1 -0
  331. package/.next/standalone/.next/static/chunks/app/api/agent-runs/[id]/log/route-abb4b18098f1d93e.js +1 -0
  332. package/.next/standalone/.next/static/chunks/app/api/agent-runs/[id]/route-abb4b18098f1d93e.js +1 -0
  333. package/.next/standalone/.next/static/chunks/app/api/agent-runs/route-abb4b18098f1d93e.js +1 -0
  334. package/.next/standalone/.next/static/chunks/app/api/agents/[id]/chain/route-abb4b18098f1d93e.js +1 -0
  335. package/.next/standalone/.next/static/chunks/app/api/agents/[id]/memory/route-abb4b18098f1d93e.js +1 -0
  336. package/.next/standalone/.next/static/chunks/app/api/agents/[id]/reports/route-abb4b18098f1d93e.js +1 -0
  337. package/.next/standalone/.next/static/chunks/app/api/agents/[id]/run/route-abb4b18098f1d93e.js +1 -0
  338. package/.next/standalone/.next/static/chunks/app/api/agents/[id]/skills/route-abb4b18098f1d93e.js +1 -0
  339. package/.next/standalone/.next/static/chunks/app/api/agents/create/route-abb4b18098f1d93e.js +1 -0
  340. package/.next/standalone/.next/static/chunks/app/api/agents/ops/route-abb4b18098f1d93e.js +1 -0
  341. package/.next/standalone/.next/static/chunks/app/api/approvals/[id]/route-abb4b18098f1d93e.js +1 -0
  342. package/.next/standalone/.next/static/chunks/app/api/approvals/route-abb4b18098f1d93e.js +1 -0
  343. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/acl/route-abb4b18098f1d93e.js +1 -0
  344. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/protect/route-abb4b18098f1d93e.js +1 -0
  345. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/raw/route-abb4b18098f1d93e.js +1 -0
  346. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/route-abb4b18098f1d93e.js +1 -0
  347. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/share-link/[linkId]/route-abb4b18098f1d93e.js +1 -0
  348. package/.next/standalone/.next/static/chunks/app/api/artifacts/[id]/share-link/route-abb4b18098f1d93e.js +1 -0
  349. package/.next/standalone/.next/static/chunks/app/api/artifacts/upload/route-abb4b18098f1d93e.js +1 -0
  350. package/.next/standalone/.next/static/chunks/app/api/audit/list/route-abb4b18098f1d93e.js +1 -0
  351. package/.next/standalone/.next/static/chunks/app/api/audit/search/route-abb4b18098f1d93e.js +1 -0
  352. package/.next/standalone/.next/static/chunks/app/api/auth/callback/route-abb4b18098f1d93e.js +1 -0
  353. package/.next/standalone/.next/static/chunks/app/api/auth/config/route-abb4b18098f1d93e.js +1 -0
  354. package/.next/standalone/.next/static/chunks/app/api/auth/join-bootstrap/route-abb4b18098f1d93e.js +1 -0
  355. package/.next/standalone/.next/static/chunks/app/api/auth/session/route-abb4b18098f1d93e.js +1 -0
  356. package/.next/standalone/.next/static/chunks/app/api/brand/route-abb4b18098f1d93e.js +1 -0
  357. package/.next/standalone/.next/static/chunks/app/api/chat/sessions/[id]/route-abb4b18098f1d93e.js +1 -0
  358. package/.next/standalone/.next/static/chunks/app/api/chat/sessions/route-abb4b18098f1d93e.js +1 -0
  359. package/.next/standalone/.next/static/chunks/app/api/config/env/route-abb4b18098f1d93e.js +1 -0
  360. package/.next/standalone/.next/static/chunks/app/api/config/route-abb4b18098f1d93e.js +1 -0
  361. package/.next/standalone/.next/static/chunks/app/api/connections/[service]/route-abb4b18098f1d93e.js +1 -0
  362. package/.next/standalone/.next/static/chunks/app/api/connections/[service]/verify/route-abb4b18098f1d93e.js +1 -0
  363. package/.next/standalone/.next/static/chunks/app/api/connections/route-abb4b18098f1d93e.js +1 -0
  364. package/.next/standalone/.next/static/chunks/app/api/cron/tick/route-abb4b18098f1d93e.js +1 -0
  365. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/[id]/move/route-abb4b18098f1d93e.js +1 -0
  366. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/[id]/route-abb4b18098f1d93e.js +1 -0
  367. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/[id]/share-link/[linkId]/route-abb4b18098f1d93e.js +1 -0
  368. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/[id]/share-link/route-abb4b18098f1d93e.js +1 -0
  369. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/import/route-abb4b18098f1d93e.js +1 -0
  370. package/.next/standalone/.next/static/chunks/app/api/dashboard/spaces/route-abb4b18098f1d93e.js +1 -0
  371. package/.next/standalone/.next/static/chunks/app/api/disk/files/[id]/blob/route-abb4b18098f1d93e.js +1 -0
  372. package/.next/standalone/.next/static/chunks/app/api/disk/files/[id]/route-abb4b18098f1d93e.js +1 -0
  373. package/.next/standalone/.next/static/chunks/app/api/disk/files/[id]/transcribe/route-abb4b18098f1d93e.js +1 -0
  374. package/.next/standalone/.next/static/chunks/app/api/disk/files/route-abb4b18098f1d93e.js +1 -0
  375. package/.next/standalone/.next/static/chunks/app/api/disk/folders/route-abb4b18098f1d93e.js +1 -0
  376. package/.next/standalone/.next/static/chunks/app/api/events/since/[cursor]/route-abb4b18098f1d93e.js +1 -0
  377. package/.next/standalone/.next/static/chunks/app/api/events/stream/route-abb4b18098f1d93e.js +1 -0
  378. package/.next/standalone/.next/static/chunks/app/api/fs/create-folder/route-abb4b18098f1d93e.js +1 -0
  379. package/.next/standalone/.next/static/chunks/app/api/fs/pick-folder/route-abb4b18098f1d93e.js +1 -0
  380. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/blueprint/route-abb4b18098f1d93e.js +1 -0
  381. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/diagnostic/route-abb4b18098f1d93e.js +1 -0
  382. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/governance/route-abb4b18098f1d93e.js +1 -0
  383. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/interview/route-abb4b18098f1d93e.js +1 -0
  384. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/pilot/route-abb4b18098f1d93e.js +1 -0
  385. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/quarterly/route-abb4b18098f1d93e.js +1 -0
  386. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/route-abb4b18098f1d93e.js +1 -0
  387. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/[id]/setup-package/route-abb4b18098f1d93e.js +1 -0
  388. package/.next/standalone/.next/static/chunks/app/api/hail/engagements/route-abb4b18098f1d93e.js +1 -0
  389. package/.next/standalone/.next/static/chunks/app/api/hail/interviews/[id]/responses/route-abb4b18098f1d93e.js +1 -0
  390. package/.next/standalone/.next/static/chunks/app/api/hail/interviews/[id]/route-abb4b18098f1d93e.js +1 -0
  391. package/.next/standalone/.next/static/chunks/app/api/hail/setup-packages/[id]/apply/route-abb4b18098f1d93e.js +1 -0
  392. package/.next/standalone/.next/static/chunks/app/api/hail/setup-packages/validate/route-abb4b18098f1d93e.js +1 -0
  393. package/.next/standalone/.next/static/chunks/app/api/heartbeat/tick/route-abb4b18098f1d93e.js +1 -0
  394. package/.next/standalone/.next/static/chunks/app/api/heartbeat/worker/route-abb4b18098f1d93e.js +1 -0
  395. package/.next/standalone/.next/static/chunks/app/api/help/route-abb4b18098f1d93e.js +1 -0
  396. package/.next/standalone/.next/static/chunks/app/api/hermes/jobs/[id]/events/route-abb4b18098f1d93e.js +1 -0
  397. package/.next/standalone/.next/static/chunks/app/api/hermes/jobs/[id]/route-abb4b18098f1d93e.js +1 -0
  398. package/.next/standalone/.next/static/chunks/app/api/hermes/jobs/route-abb4b18098f1d93e.js +1 -0
  399. package/.next/standalone/.next/static/chunks/app/api/integrations/google/callback/route-abb4b18098f1d93e.js +1 -0
  400. package/.next/standalone/.next/static/chunks/app/api/integrations/google/oauth/route-abb4b18098f1d93e.js +1 -0
  401. package/.next/standalone/.next/static/chunks/app/api/marketplace/[id]/route-abb4b18098f1d93e.js +1 -0
  402. package/.next/standalone/.next/static/chunks/app/api/marketplace/open-design/route-abb4b18098f1d93e.js +1 -0
  403. package/.next/standalone/.next/static/chunks/app/api/marketplace/route-abb4b18098f1d93e.js +1 -0
  404. package/.next/standalone/.next/static/chunks/app/api/mines/import-roots/route-abb4b18098f1d93e.js +1 -0
  405. package/.next/standalone/.next/static/chunks/app/api/mines/portfolio/route-abb4b18098f1d93e.js +1 -0
  406. package/.next/standalone/.next/static/chunks/app/api/mines/projects/[id]/chunks/route-abb4b18098f1d93e.js +1 -0
  407. package/.next/standalone/.next/static/chunks/app/api/mines/projects/[id]/diligence/route-abb4b18098f1d93e.js +1 -0
  408. package/.next/standalone/.next/static/chunks/app/api/mines/projects/[id]/import/route-abb4b18098f1d93e.js +1 -0
  409. package/.next/standalone/.next/static/chunks/app/api/mines/projects/[id]/publish/route-abb4b18098f1d93e.js +1 -0
  410. package/.next/standalone/.next/static/chunks/app/api/mines/projects/route-abb4b18098f1d93e.js +1 -0
  411. package/.next/standalone/.next/static/chunks/app/api/missions/route-abb4b18098f1d93e.js +1 -0
  412. package/.next/standalone/.next/static/chunks/app/api/models/route-abb4b18098f1d93e.js +1 -0
  413. package/.next/standalone/.next/static/chunks/app/api/onboarding/blueprint/route-abb4b18098f1d93e.js +1 -0
  414. package/.next/standalone/.next/static/chunks/app/api/onboarding/launch/route-abb4b18098f1d93e.js +1 -0
  415. package/.next/standalone/.next/static/chunks/app/api/orchestrator/command/route-abb4b18098f1d93e.js +1 -0
  416. package/.next/standalone/.next/static/chunks/app/api/orchestrator/stream/route-abb4b18098f1d93e.js +1 -0
  417. package/.next/standalone/.next/static/chunks/app/api/org/route-abb4b18098f1d93e.js +1 -0
  418. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/invites/[inviteId]/route-abb4b18098f1d93e.js +1 -0
  419. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/invites/route-abb4b18098f1d93e.js +1 -0
  420. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/members/[userId]/role/route-abb4b18098f1d93e.js +1 -0
  421. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/members/[userId]/route-abb4b18098f1d93e.js +1 -0
  422. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/members/route-abb4b18098f1d93e.js +1 -0
  423. package/.next/standalone/.next/static/chunks/app/api/orgs/[id]/route-abb4b18098f1d93e.js +1 -0
  424. package/.next/standalone/.next/static/chunks/app/api/orgs/invites/pending/route-abb4b18098f1d93e.js +1 -0
  425. package/.next/standalone/.next/static/chunks/app/api/orgs/join/route-abb4b18098f1d93e.js +1 -0
  426. package/.next/standalone/.next/static/chunks/app/api/orgs/route-abb4b18098f1d93e.js +1 -0
  427. package/.next/standalone/.next/static/chunks/app/api/printing-press/clis/route-abb4b18098f1d93e.js +1 -0
  428. package/.next/standalone/.next/static/chunks/app/api/printing-press/install/route-abb4b18098f1d93e.js +1 -0
  429. package/.next/standalone/.next/static/chunks/app/api/printing-press/security-mode/route-abb4b18098f1d93e.js +1 -0
  430. package/.next/standalone/.next/static/chunks/app/api/privacy/config/route-abb4b18098f1d93e.js +1 -0
  431. package/.next/standalone/.next/static/chunks/app/api/privacy/verify/route-abb4b18098f1d93e.js +1 -0
  432. package/.next/standalone/.next/static/chunks/app/api/processes/[id]/route-abb4b18098f1d93e.js +1 -0
  433. package/.next/standalone/.next/static/chunks/app/api/processes/[id]/share-link/route-abb4b18098f1d93e.js +1 -0
  434. package/.next/standalone/.next/static/chunks/app/api/processes/[id]/stages/[stageId]/override/route-abb4b18098f1d93e.js +1 -0
  435. package/.next/standalone/.next/static/chunks/app/api/processes/[id]/stages/[stageId]/retry/route-abb4b18098f1d93e.js +1 -0
  436. package/.next/standalone/.next/static/chunks/app/api/processes/[id]/stages/[stageId]/submit/route-abb4b18098f1d93e.js +1 -0
  437. package/.next/standalone/.next/static/chunks/app/api/processes/definitions/[slug]/route-abb4b18098f1d93e.js +1 -0
  438. package/.next/standalone/.next/static/chunks/app/api/processes/definitions/[slug]/settings/route-abb4b18098f1d93e.js +1 -0
  439. package/.next/standalone/.next/static/chunks/app/api/processes/definitions/route-abb4b18098f1d93e.js +1 -0
  440. package/.next/standalone/.next/static/chunks/app/api/processes/definitions/validate/route-abb4b18098f1d93e.js +1 -0
  441. package/.next/standalone/.next/static/chunks/app/api/processes/route-abb4b18098f1d93e.js +1 -0
  442. package/.next/standalone/.next/static/chunks/app/api/processes/start-and-route/route-abb4b18098f1d93e.js +1 -0
  443. package/.next/standalone/.next/static/chunks/app/api/projects/[slug]/library/route-abb4b18098f1d93e.js +1 -0
  444. package/.next/standalone/.next/static/chunks/app/api/projects/[slug]/route-abb4b18098f1d93e.js +1 -0
  445. package/.next/standalone/.next/static/chunks/app/api/projects/route-abb4b18098f1d93e.js +1 -0
  446. package/.next/standalone/.next/static/chunks/app/api/runs/approve-claude-run/route-abb4b18098f1d93e.js +1 -0
  447. package/.next/standalone/.next/static/chunks/app/api/runs/claude-code-dry-run/route-abb4b18098f1d93e.js +1 -0
  448. package/.next/standalone/.next/static/chunks/app/api/runs/competitor-report/route-abb4b18098f1d93e.js +1 -0
  449. package/.next/standalone/.next/static/chunks/app/api/runs/engine-ping/route-abb4b18098f1d93e.js +1 -0
  450. package/.next/standalone/.next/static/chunks/app/api/runs/marketing-plan/route-abb4b18098f1d93e.js +1 -0
  451. package/.next/standalone/.next/static/chunks/app/api/schedules/upsert/route-abb4b18098f1d93e.js +1 -0
  452. package/.next/standalone/.next/static/chunks/app/api/secrets/[name]/route-abb4b18098f1d93e.js +1 -0
  453. package/.next/standalone/.next/static/chunks/app/api/secrets/route-abb4b18098f1d93e.js +1 -0
  454. package/.next/standalone/.next/static/chunks/app/api/settings/trust-mode/route-abb4b18098f1d93e.js +1 -0
  455. package/.next/standalone/.next/static/chunks/app/api/share/[token]/otp/route-abb4b18098f1d93e.js +1 -0
  456. package/.next/standalone/.next/static/chunks/app/api/share/[token]/route-abb4b18098f1d93e.js +1 -0
  457. package/.next/standalone/.next/static/chunks/app/api/share/[token]/verify/route-abb4b18098f1d93e.js +1 -0
  458. package/.next/standalone/.next/static/chunks/app/api/share/space/[token]/otp/route-abb4b18098f1d93e.js +1 -0
  459. package/.next/standalone/.next/static/chunks/app/api/share/space/[token]/route-abb4b18098f1d93e.js +1 -0
  460. package/.next/standalone/.next/static/chunks/app/api/share/space/[token]/verify/route-abb4b18098f1d93e.js +1 -0
  461. package/.next/standalone/.next/static/chunks/app/api/shared/spaces/[id]/acl/route-abb4b18098f1d93e.js +1 -0
  462. package/.next/standalone/.next/static/chunks/app/api/shared/spaces/publish/route-abb4b18098f1d93e.js +1 -0
  463. package/.next/standalone/.next/static/chunks/app/api/shared/spaces/route-abb4b18098f1d93e.js +1 -0
  464. package/.next/standalone/.next/static/chunks/app/api/shared/spaces/status/route-abb4b18098f1d93e.js +1 -0
  465. package/.next/standalone/.next/static/chunks/app/api/shared/spaces/unpublish/route-abb4b18098f1d93e.js +1 -0
  466. package/.next/standalone/.next/static/chunks/app/api/state/route-abb4b18098f1d93e.js +1 -0
  467. package/.next/standalone/.next/static/chunks/app/api/system/update/route-abb4b18098f1d93e.js +1 -0
  468. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/active-run/route-abb4b18098f1d93e.js +1 -0
  469. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/attachments/route-abb4b18098f1d93e.js +1 -0
  470. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/checklist/[itemId]/route-abb4b18098f1d93e.js +1 -0
  471. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/checklist/route-abb4b18098f1d93e.js +1 -0
  472. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/checkout/route-abb4b18098f1d93e.js +1 -0
  473. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/children/route-abb4b18098f1d93e.js +1 -0
  474. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/comments/route-abb4b18098f1d93e.js +1 -0
  475. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/events/route-abb4b18098f1d93e.js +1 -0
  476. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/live-runs/route-abb4b18098f1d93e.js +1 -0
  477. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/release/route-abb4b18098f1d93e.js +1 -0
  478. package/.next/standalone/.next/static/chunks/app/api/tasks/[id]/route-abb4b18098f1d93e.js +1 -0
  479. package/.next/standalone/.next/static/chunks/app/api/tasks/route-abb4b18098f1d93e.js +1 -0
  480. package/.next/standalone/.next/static/chunks/app/api/tool-allowlists/[id]/route-abb4b18098f1d93e.js +1 -0
  481. package/.next/standalone/.next/static/chunks/app/api/tool-allowlists/route-abb4b18098f1d93e.js +1 -0
  482. package/.next/standalone/.next/static/chunks/app/api/tool-egress/route-abb4b18098f1d93e.js +1 -0
  483. package/.next/standalone/.next/static/chunks/app/api/tools/[name]/approve/route-abb4b18098f1d93e.js +1 -0
  484. package/.next/standalone/.next/static/chunks/app/api/tools/[name]/route-abb4b18098f1d93e.js +1 -0
  485. package/.next/standalone/.next/static/chunks/app/api/tools/route-abb4b18098f1d93e.js +1 -0
  486. package/.next/standalone/.next/static/chunks/app/api/transcripts/route-abb4b18098f1d93e.js +1 -0
  487. package/.next/standalone/.next/static/chunks/app/api/voice/providers/route-abb4b18098f1d93e.js +1 -0
  488. package/.next/standalone/.next/static/chunks/app/api/voice/realtime/context/route-abb4b18098f1d93e.js +1 -0
  489. package/.next/standalone/.next/static/chunks/app/api/voice/realtime/session/route-abb4b18098f1d93e.js +1 -0
  490. package/.next/standalone/.next/static/chunks/app/api/voice/realtime/tool-result/route-abb4b18098f1d93e.js +1 -0
  491. package/.next/standalone/.next/static/chunks/app/api/voice/realtime/tools/route-abb4b18098f1d93e.js +1 -0
  492. package/.next/standalone/.next/static/chunks/app/api/voice/tts/route-abb4b18098f1d93e.js +1 -0
  493. package/.next/standalone/.next/static/chunks/app/api/whatsapp/allowlist/route-abb4b18098f1d93e.js +1 -0
  494. package/.next/standalone/.next/static/chunks/app/api/whatsapp/messages/route-abb4b18098f1d93e.js +1 -0
  495. package/.next/standalone/.next/static/chunks/app/api/whatsapp/qr/route-abb4b18098f1d93e.js +1 -0
  496. package/.next/standalone/.next/static/chunks/app/api/whatsapp/send/route-abb4b18098f1d93e.js +1 -0
  497. package/.next/standalone/.next/static/chunks/app/api/whatsapp/status/route-abb4b18098f1d93e.js +1 -0
  498. package/.next/standalone/.next/static/chunks/app/approvals/loading-abb4b18098f1d93e.js +1 -0
  499. package/.next/standalone/.next/static/chunks/app/approvals/page-c12b94ea10818d65.js +1 -0
  500. package/.next/standalone/.next/static/chunks/app/architecture/loading-abb4b18098f1d93e.js +1 -0
  501. package/.next/standalone/.next/static/chunks/app/architecture/page-2dfc72f2a2d88f9d.js +1 -0
  502. package/.next/standalone/.next/static/chunks/app/audit/live/page-1e0efbfb119569b0.js +1 -0
  503. package/.next/standalone/.next/static/chunks/app/audit/loading-abb4b18098f1d93e.js +1 -0
  504. package/.next/standalone/.next/static/chunks/app/audit/page-c12b94ea10818d65.js +1 -0
  505. package/.next/standalone/.next/static/chunks/app/brand/loading-abb4b18098f1d93e.js +1 -0
  506. package/.next/standalone/.next/static/chunks/app/brand/page-8bb3754e7c32b642.js +1 -0
  507. package/.next/standalone/.next/static/chunks/app/disk/loading-abb4b18098f1d93e.js +1 -0
  508. package/.next/standalone/.next/static/chunks/app/disk/page-830a69b2f0aa3d19.js +1 -0
  509. package/.next/standalone/.next/static/chunks/app/federated-ai/loading-abb4b18098f1d93e.js +1 -0
  510. package/.next/standalone/.next/static/chunks/app/federated-ai/page-d2bee8a9d6cb2158.js +1 -0
  511. package/.next/standalone/.next/static/chunks/app/hail/[id]/governance/page-e2ba96c9d0d9b834.js +1 -0
  512. package/.next/standalone/.next/static/chunks/app/hail/[id]/interview/page-d1ca3290361630df.js +1 -0
  513. package/.next/standalone/.next/static/chunks/app/hail/[id]/page-51b4e30f9ffd4b73.js +1 -0
  514. package/.next/standalone/.next/static/chunks/app/hail/[id]/setup/page-51b4e30f9ffd4b73.js +1 -0
  515. package/.next/standalone/.next/static/chunks/app/hail/page-51b4e30f9ffd4b73.js +1 -0
  516. package/.next/standalone/.next/static/chunks/app/help/[slug]/page-c3195d2b23b0ac1b.js +1 -0
  517. package/.next/standalone/.next/static/chunks/app/help/loading-abb4b18098f1d93e.js +1 -0
  518. package/.next/standalone/.next/static/chunks/app/help/page-bc1c746d72f7e90c.js +1 -0
  519. package/.next/standalone/.next/static/chunks/app/join/page-ce560c39fdc1cb5a.js +1 -0
  520. package/.next/standalone/.next/static/chunks/app/layout-6728a045f5352a96.js +1 -0
  521. package/.next/standalone/.next/static/chunks/app/loading-abb4b18098f1d93e.js +1 -0
  522. package/.next/standalone/.next/static/chunks/app/login/page-df655887dbc38067.js +1 -0
  523. package/.next/standalone/.next/static/chunks/app/marketplace/loading-abb4b18098f1d93e.js +1 -0
  524. package/.next/standalone/.next/static/chunks/app/marketplace/page-edb895159388f32e.js +1 -0
  525. package/.next/standalone/.next/static/chunks/app/mines/[projectId]/page-260fec1b92312925.js +1 -0
  526. package/.next/standalone/.next/static/chunks/app/mines/[projectId]/results/page-9fe66fe1590c64f9.js +1 -0
  527. package/.next/standalone/.next/static/chunks/app/mines/page-fb7d1c7bafe73571.js +1 -0
  528. package/.next/standalone/.next/static/chunks/app/missions/loading-abb4b18098f1d93e.js +1 -0
  529. package/.next/standalone/.next/static/chunks/app/missions/page-c12b94ea10818d65.js +1 -0
  530. package/.next/standalone/.next/static/chunks/app/onboarding/loading-abb4b18098f1d93e.js +1 -0
  531. package/.next/standalone/.next/static/chunks/app/onboarding/org/page-c26d5063bbdcb192.js +1 -0
  532. package/.next/standalone/.next/static/chunks/app/onboarding/page-b4c57b0f70cae794.js +1 -0
  533. package/.next/standalone/.next/static/chunks/app/org/loading-abb4b18098f1d93e.js +1 -0
  534. package/.next/standalone/.next/static/chunks/app/org/page-c12b94ea10818d65.js +1 -0
  535. package/.next/standalone/.next/static/chunks/app/page-12446920b9aef7b5.js +1 -0
  536. package/.next/standalone/.next/static/chunks/app/projects/[slug]/loading-abb4b18098f1d93e.js +1 -0
  537. package/.next/standalone/.next/static/chunks/app/projects/[slug]/log/page-a29845d3def72e1d.js +1 -0
  538. package/.next/standalone/.next/static/chunks/app/projects/[slug]/page-bc5359a5168e8ce3.js +1 -0
  539. package/.next/standalone/.next/static/chunks/app/projects/loading-abb4b18098f1d93e.js +1 -0
  540. package/.next/standalone/.next/static/chunks/app/projects/new/page-c12b94ea10818d65.js +1 -0
  541. package/.next/standalone/.next/static/chunks/app/projects/page-8f09f3fcf7fd0e3a.js +1 -0
  542. package/.next/standalone/.next/static/chunks/app/reports/[file]/route-abb4b18098f1d93e.js +1 -0
  543. package/.next/standalone/.next/static/chunks/app/reports/loading-abb4b18098f1d93e.js +1 -0
  544. package/.next/standalone/.next/static/chunks/app/reports/page-c12b94ea10818d65.js +1 -0
  545. package/.next/standalone/.next/static/chunks/app/runtime/loading-abb4b18098f1d93e.js +1 -0
  546. package/.next/standalone/.next/static/chunks/app/runtime/page-c12b94ea10818d65.js +1 -0
  547. package/.next/standalone/.next/static/chunks/app/schedules/loading-abb4b18098f1d93e.js +1 -0
  548. package/.next/standalone/.next/static/chunks/app/schedules/page-2a68ab0e10595bcd.js +1 -0
  549. package/.next/standalone/.next/static/chunks/app/settings/account/page-3423feef4e4bfd8d.js +1 -0
  550. package/.next/standalone/.next/static/chunks/app/settings/advanced/page-8269e27543b8bdd5.js +1 -0
  551. package/.next/standalone/.next/static/chunks/app/settings/appearance/page-c12b94ea10818d65.js +1 -0
  552. package/.next/standalone/.next/static/chunks/app/settings/brand/page-f54af497deea88ab.js +1 -0
  553. package/.next/standalone/.next/static/chunks/app/settings/connectors/page-8269e27543b8bdd5.js +1 -0
  554. package/.next/standalone/.next/static/chunks/app/settings/engines/page-439cc5bb0193bfb7.js +1 -0
  555. package/.next/standalone/.next/static/chunks/app/settings/layout-78a57111f867ba6c.js +1 -0
  556. package/.next/standalone/.next/static/chunks/app/settings/loading-abb4b18098f1d93e.js +1 -0
  557. package/.next/standalone/.next/static/chunks/app/settings/onboarding/page-2c557f68cc8971d8.js +1 -0
  558. package/.next/standalone/.next/static/chunks/app/settings/organization/page-c12b94ea10818d65.js +1 -0
  559. package/.next/standalone/.next/static/chunks/app/settings/page-abb4b18098f1d93e.js +1 -0
  560. package/.next/standalone/.next/static/chunks/app/settings/runtime/page-c12b94ea10818d65.js +1 -0
  561. package/.next/standalone/.next/static/chunks/app/settings/tools/page-8269e27543b8bdd5.js +1 -0
  562. package/.next/standalone/.next/static/chunks/app/share/[token]/page-9afe594e2b42ee98.js +1 -0
  563. package/.next/standalone/.next/static/chunks/app/share/space/[token]/page-d941c8b538680771.js +1 -0
  564. package/.next/standalone/.next/static/chunks/app/tasks/[id]/loading-abb4b18098f1d93e.js +1 -0
  565. package/.next/standalone/.next/static/chunks/app/tasks/[id]/page-10b8f571ac331814.js +1 -0
  566. package/.next/standalone/.next/static/chunks/app/tasks/loading-abb4b18098f1d93e.js +1 -0
  567. package/.next/standalone/.next/static/chunks/app/tasks/page-e53905ca0f216834.js +1 -0
  568. package/.next/standalone/.next/static/chunks/app/team/[agentId]/page-c12b94ea10818d65.js +1 -0
  569. package/.next/standalone/.next/static/chunks/app/team/page-51b4e30f9ffd4b73.js +1 -0
  570. package/.next/standalone/.next/static/chunks/app/tools/loading-abb4b18098f1d93e.js +1 -0
  571. package/.next/standalone/.next/static/chunks/app/tools/page-abb4b18098f1d93e.js +1 -0
  572. package/.next/standalone/.next/static/chunks/app/whatsapp/loading-abb4b18098f1d93e.js +1 -0
  573. package/.next/standalone/.next/static/chunks/app/whatsapp/page-ab228cb0cbf3e16d.js +1 -0
  574. package/.next/standalone/.next/static/chunks/app/workflows/[caseId]/page-44cbcfc3ad541629.js +1 -0
  575. package/.next/standalone/.next/static/chunks/app/workflows/new/[caseId]/page-51b4e30f9ffd4b73.js +1 -0
  576. package/.next/standalone/.next/static/chunks/app/workflows/new/definition/page-57285f28a2156daa.js +1 -0
  577. package/.next/standalone/.next/static/chunks/app/workflows/new/page-e99f34660ca383e5.js +1 -0
  578. package/.next/standalone/.next/static/chunks/app/workflows/page-11778031fa890a8c.js +1 -0
  579. package/.next/standalone/.next/static/chunks/app/workflows/share/[caseId]/page-abb4b18098f1d93e.js +1 -0
  580. package/.next/standalone/.next/static/chunks/framework-4731550a751206fc.js +1 -0
  581. package/.next/standalone/.next/static/chunks/main-app-646d86f6b65133fa.js +1 -0
  582. package/.next/standalone/.next/static/chunks/main-f0e8527d594b1755.js +1 -0
  583. package/.next/standalone/.next/static/chunks/pages/_app-6c8c2371b16a04b8.js +1 -0
  584. package/.next/standalone/.next/static/chunks/pages/_error-94812ad32cad7365.js +1 -0
  585. package/.next/standalone/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  586. package/.next/standalone/.next/static/chunks/webpack-ce537f60727acb61.js +1 -0
  587. package/.next/standalone/.next/static/css/10f53a9c6accc597.css +1 -0
  588. package/.next/standalone/.next/static/css/67735f13057a6651.css +1 -0
  589. package/.next/standalone/.next/static/css/acf226d91614a52a.css +1 -0
  590. package/.next/standalone/.next/static/css/c3ec1669cae95a9a.css +1 -0
  591. package/.next/standalone/.next/static/media/98e207f02528a563-s.p.woff2 +0 -0
  592. package/.next/standalone/.next/static/media/99dcf268bda04fe5-s.woff2 +0 -0
  593. package/.next/standalone/.next/static/media/d29838c109ef09b4-s.woff2 +0 -0
  594. package/.next/standalone/.next/static/media/e40af3453d7c920a-s.woff2 +0 -0
  595. package/.next/standalone/.next/static/media/ef4d5661765d0e49-s.woff2 +0 -0
  596. package/.next/standalone/data/.artifacts-migrated-v1 +1 -1
  597. package/.next/standalone/data/.default-project-seeded +1 -1
  598. package/.next/standalone/data/madarx.sqlite +0 -0
  599. package/.next/standalone/data/madarx.sqlite-shm +0 -0
  600. package/.next/standalone/data/madarx.sqlite-wal +0 -0
  601. package/.next/standalone/package.json +2 -1
  602. package/.next/standalone/public/federated-ai-teams.html +10 -0
  603. package/.next/standalone/public/madarx-feasibility-use-cases.html +1 -0
  604. package/.next/standalone/public/madarx-mark.svg +9 -0
  605. package/.next/standalone/public/privacy.worker.js +117 -0
  606. package/.next/static/6oh6zIyYdQuxVczCDWeak/_buildManifest.js +1 -0
  607. package/.next/static/6oh6zIyYdQuxVczCDWeak/_ssgManifest.js +1 -0
  608. package/.next/static/chunks/app/projects/page-8f09f3fcf7fd0e3a.js +1 -0
  609. package/README.md +3 -1
  610. package/lib/seeds.js +32 -13
  611. package/package.json +2 -1
  612. package/scripts/postbuild-standalone.mjs +41 -0
  613. package/.next/standalone/.next/server/chunks/664.js +0 -1
  614. package/.next/static/chunks/app/projects/page-a1a581ac76f7a4bb.js +0 -1
  615. /package/.next/{static/0tzU0vkYYYJiZ7OPljvJo → standalone/.next/static/6oh6zIyYdQuxVczCDWeak}/_buildManifest.js +0 -0
  616. /package/.next/{static/0tzU0vkYYYJiZ7OPljvJo → standalone/.next/static/6oh6zIyYdQuxVczCDWeak}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5094],{874:(e,n,l)=>{"use strict";l.d(n,{default:()=>D});var t=l(5155),s=l(2115),a=l(63);let i=[{id:"all",label:"All"},{id:"connection",label:"Connections"},{id:"tool",label:"Tools"},{id:"skill",label:"Skills"},{id:"bundle",label:"Bundles"},{id:"agent",label:"Agents"},{id:"workflow",label:"Workflows"}],c={github:"GitHub",supabase:"Supabase",vercel:"Vercel",email:"Email",web:"Web",local_machine:"Local machine",travel:"Travel",calendar:"Calendar",design:"Design",review:"Review",security:"Security",engineering:"Engineering",engine:"Engines",integration:"Integrations",channel:"Channels",procurement:"Procurement",legal:"Legal",support:"Support",workflow:"Workflow"};function o(e){let{activeKind:n,onKindChange:l,counts:s,categories:a,categoryCounts:o={},scopeCount:r,activeCategory:d,onCategoryChange:u}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mkt-tabs",role:"tablist","aria-label":"Marketplace kind",children:i.map(e=>{let a="all"===e.id?s.all:s[e.id]||0,i=e.id===n;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":i,className:"mkt-tab ".concat(i?"on":""),onClick:()=>l(e.id),children:[e.label,(0,t.jsx)("span",{className:"mkt-tab-count",children:a})]},e.id)})}),a.length?(0,t.jsxs)("div",{className:"mkt-filters",role:"toolbar","aria-label":"Category filters",children:[(0,t.jsxs)("button",{type:"button",className:"mkt-chip ".concat(d?"":"on"),onClick:()=>u(null),children:["All categories","number"==typeof r?(0,t.jsx)("span",{className:"mkt-chip-count",children:r}):null]}),a.map(e=>(0,t.jsxs)("button",{type:"button",className:"mkt-chip ".concat(d===e?"on":""),onClick:()=>u(d===e?null:e),children:[function(e){if(c[e])return c[e];let n=String(e).replaceAll("_"," ");return n.charAt(0).toUpperCase()+n.slice(1)}(e),o[e]?(0,t.jsx)("span",{className:"mkt-chip-count",children:o[e]}):null]},e))]}):null]})}function r(e){let{value:n,onChange:l}=e,a=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){var n,t,s;(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()?(e.preventDefault(),null==(n=a.current)||n.focus(),null==(t=a.current)||t.select()):"Escape"===e.key&&document.activeElement===a.current&&(l(""),null==(s=a.current)||s.blur())}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]);let i="undefined"!=typeof navigator&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent||"")?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"mkt-search",role:"search",children:[(0,t.jsxs)("svg",{className:"mkt-search-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,t.jsx)("path",{d:"M21 21l-4.3-4.3"})]}),(0,t.jsx)("input",{ref:a,type:"search",className:"mkt-search-input",placeholder:"Search tools, skills, bundles, authors…",value:n,onChange:e=>l(e.target.value),"aria-label":"Search marketplace"}),(0,t.jsxs)("span",{className:"mkt-search-kbd","aria-hidden":"true",children:[(0,t.jsx)("kbd",{children:i}),(0,t.jsx)("kbd",{children:"K"})]})]})}var d=l(4304);function u(e){let{kind:n,category:l,size:s=18}=e,a="mkt-chip-tile kind-".concat(n);return"tool"===n?(0,t.jsx)("span",{className:a,"aria-hidden":"true",children:(0,t.jsx)(d.si,{category:l,size:s})}):(0,t.jsx)("span",{className:a,"aria-hidden":"true",children:(0,t.jsx)(d.IU,{kind:n,size:s})})}let h={tool:"Tool",skill:"Skill",bundle:"Bundle",agent:"Agent",connection:"Connection",workflow:"Workflow"};function p(e){let{kind:n}=e,l=h[n]||n;return(0,t.jsx)("span",{className:"mkt-kind-badge kind-".concat(n),children:l})}let m={low:"low",medium:"medium",high:"high",local:"local",irreversible_external:"irreversible"};function j(e){let{level:n}=e;if(!n)return null;let l="irreversible_external"===n?"irreversible":"local"===n?"low":n||"low",s=m[n]||n;return(0,t.jsxs)("span",{className:"mkt-risk",children:[(0,t.jsx)("span",{className:"mkt-risk-dot ".concat(l),"aria-hidden":"true"}),s]})}function g(e){let{action:n,itemId:l,installed:s,available:a=!0,disabled:i=!1,label:c,slugHint:o,currentKind:r}=e,d=c||"".concat(s?"Uninstall":"Install"," ").concat(l);return(0,t.jsxs)("form",{action:n,className:"mkt-toggle-form",children:[(0,t.jsx)("input",{type:"hidden",name:"item_id",value:l}),(0,t.jsx)("input",{type:"hidden",name:"installed",value:String(!s)}),o?(0,t.jsx)("input",{type:"hidden",name:"slug_hint",value:o}):null,r?(0,t.jsx)("input",{type:"hidden",name:"current_kind",value:r}):null,(0,t.jsx)("button",{className:"mkt-toggle ".concat(s?"on":""),type:"submit",role:"switch","aria-checked":s,"aria-label":d,disabled:i||!a})]})}var x=l(5649);function b(e){let{value:n,onChange:l,supportsScopes:a=["global","project","agent"],disabled:i}=e,[c,o]=s.useState([]),[r,d]=s.useState([]),[u,h]=s.useState(null),p=a.includes("project"),m=a.includes("agent");function j(e){var n,t;"global"===e?l({scope:"global",project_id:null,agent_id:null}):"project"===e?l({scope:"project",project_id:(null==(n=c[0])?void 0:n.id)||null,agent_id:null}):"agent"===e&&l({scope:"agent",project_id:null,agent_id:(null==(t=r[0])?void 0:t.id)||null})}return(s.useEffect(()=>{let e=!1;return async function(){try{let n=[];p?n.push(fetch("/api/projects").then(e=>e.json())):n.push(Promise.resolve({projects:[]})),m?n.push(fetch("/api/state").then(e=>e.json())):n.push(Promise.resolve({agents:[]}));let[l,t]=await Promise.all(n);if(e)return;o(Array.isArray(null==l?void 0:l.projects)?l.projects:[]);let s=Array.isArray(null==t?void 0:t.agents)?t.agents:[];d(s)}catch(n){e||h(String((null==n?void 0:n.message)||n))}}(),()=>{e=!0}},[p,m]),1===a.length)?(0,t.jsxs)("div",{className:"scope-picker scope-picker--locked",children:[(0,t.jsx)("span",{className:"scope-picker-label",children:"Scope"}),(0,t.jsx)("span",{className:"scope-picker-locked-value",children:a[0]})]}):(0,t.jsxs)("fieldset",{className:"scope-picker",disabled:i,children:[(0,t.jsx)("legend",{className:"scope-picker-legend",children:"Scope"}),a.includes("global")?(0,t.jsxs)("label",{className:"scope-picker-radio",children:[(0,t.jsx)("input",{type:"radio",name:"scope",value:"global",checked:"global"===n.scope,onChange:()=>j("global")}),(0,t.jsxs)("span",{className:"scope-picker-radio-body",children:[(0,t.jsx)("b",{children:"Global"}),(0,t.jsx)("small",{children:"Available to every project and every agent on this Mac."})]})]}):null,a.includes("project")?(0,t.jsxs)("label",{className:"scope-picker-radio",children:[(0,t.jsx)("input",{type:"radio",name:"scope",value:"project",checked:"project"===n.scope,onChange:()=>j("project"),disabled:0===c.length}),(0,t.jsxs)("span",{className:"scope-picker-radio-body",children:[(0,t.jsx)("b",{children:"Project"}),(0,t.jsx)("small",{children:0===c.length?"No projects yet — create one in the Projects tab.":"Resolved when a tool runs inside this project."}),"project"===n.scope&&c.length>0?(0,t.jsx)("select",{className:"scope-picker-select",value:n.project_id||"",onChange:e=>l({scope:"project",project_id:e.target.value,agent_id:null}),children:c.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))}):null]})]}):null,a.includes("agent")?(0,t.jsxs)("label",{className:"scope-picker-radio",children:[(0,t.jsx)("input",{type:"radio",name:"scope",value:"agent",checked:"agent"===n.scope,onChange:()=>j("agent"),disabled:0===r.length}),(0,t.jsxs)("span",{className:"scope-picker-radio-body",children:[(0,t.jsx)("b",{children:"Agent"}),(0,t.jsx)("small",{children:0===r.length?"No agents yet.":"Only this specific agent can use these credentials."}),"agent"===n.scope&&r.length>0?(0,t.jsx)("select",{className:"scope-picker-select",value:n.agent_id||"",onChange:e=>l({scope:"agent",project_id:null,agent_id:e.target.value}),children:r.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name||e.id},e.id))}):null]})]}):null,u?(0,t.jsxs)("small",{className:"scope-picker-error",children:["Couldn't load projects or agents: ",u]}):null]})}function f(e){var n,l,s,a,i;let{connection:c,credentials:o,onChange:r,scope:d,onScopeChange:u,onSubmit:h,onCancel:p,error:m,hint:j,busy:g}=e,x=(null==c||null==(n=c.connection)?void 0:n.credentials)||(null==c||null==(l=c.manifest)?void 0:l.credentials)||[],f=Array.isArray(null==c||null==(s=c.connection)?void 0:s.supports_scopes)?c.connection.supports_scopes:Array.isArray(null==c||null==(a=c.manifest)?void 0:a.supports_scopes)?c.manifest.supports_scopes:["global","project","agent"],k=x.filter(e=>e.required).every(e=>String(o[e.name]||"").trim().length>0),v="global"===d.scope||"project"===d.scope&&!!d.project_id||"agent"===d.scope&&!!d.agent_id;return(0,t.jsxs)("form",{className:"connection-setup-step connection-setup-step-form",onSubmit:function(e){e.preventDefault(),h(o)},children:[(0,t.jsxs)("p",{className:"connection-setup-intro",children:["Madarx will use this to ",(null==(i=c.connection)?void 0:i.benefit)||"connect to the service","."," ","Your credentials are encrypted on this Mac and never echoed back."]}),(0,t.jsx)(b,{value:d,onChange:u,supportsScopes:f,disabled:g}),x.map(e=>(0,t.jsxs)("label",{className:"connection-setup-field",children:[(0,t.jsxs)("span",{className:"connection-setup-field-label",children:[e.label,e.required?null:(0,t.jsx)("small",{children:" (optional)"})]}),(0,t.jsx)("input",{type:"password"===e.type?"password":"text",name:e.name,placeholder:e.placeholder||"",autoComplete:"off",spellCheck:!1,value:o[e.name]||"",onChange:n=>{var l,t;return l=e.name,t=n.target.value,void r({...o,[l]:t})},disabled:g}),e.help_text||e.help_url?(0,t.jsxs)("small",{className:"connection-setup-field-help",children:[e.help_text||"Find this in the provider settings.",e.help_url?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:e.help_url,target:"_blank",rel:"noreferrer noopener",children:"Where do I find this? →"})]}):null]}):null]},e.name)),m?(0,t.jsxs)("p",{className:"connection-setup-error",children:[m,j?(0,t.jsxs)("small",{children:[" ",j]}):null]}):null,(0,t.jsxs)("div",{className:"connection-setup-actions",children:[(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:p,disabled:g,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"admin-button",disabled:g||!k||!v,children:g?"Verifying…":"Connect"})]})]})}var k=l(2769);function v(e){var n;let{connection:l,onPaired:a}=e,[i,c]=s.useState(null),[o,r]=s.useState(null),[d,u]=s.useState(""),[h,p]=s.useState(null),m=s.useRef(!1);s.useEffect(()=>{let e=!1;async function n(){try{var n;let[l,t]=await Promise.all([fetch("/api/whatsapp/qr").then(e=>e.json()).catch(()=>null),fetch("/api/whatsapp/status").then(e=>e.json()).catch(()=>null)]);if(e)return;c(l||null),r((null==t?void 0:t.health)||null),p(!!t&&!!(null==t?void 0:t.health)),((null==l?void 0:l.paired)||(null==t||null==(n=t.health)?void 0:n.pairing_state)==="paired")&&!m.current&&(m.current=!0,a())}catch(n){e||p(!1)}}n();let l=setInterval(n,3500);return()=>{e=!0,clearInterval(l)}},[a]),s.useEffect(()=>{let e=!1;return async function(){if((null==i?void 0:i.paired)||!(null==i?void 0:i.qr))return u("");try{let n=await k.toDataURL(i.qr,{margin:1,width:240,errorCorrectionLevel:"M"});e||u(n)}catch(n){e||u("")}}(),()=>{e=!0}},[i]);let j=(null==o?void 0:o.pairing_state)||(!1===h?"offline":"starting"),g=(null==l||null==(n=l.connection)?void 0:n.requires_daemon)||"npm run whatsapp:bridge",x=!1===h||"offline"===j;return(0,t.jsxs)("section",{className:"connection-setup-step connection-setup-step-qr",children:[(0,t.jsxs)("p",{className:"connection-setup-intro",children:["Open WhatsApp on your phone → ",(0,t.jsx)("b",{children:"Settings"})," → ",(0,t.jsx)("b",{children:"Linked Devices"})," → ",(0,t.jsx)("b",{children:"Link a Device"}),", then scan the code below. Madarx will receive incoming WhatsApp messages through this number."]}),x?(0,t.jsxs)("div",{className:"connection-setup-warning",children:[(0,t.jsx)("p",{children:"The WhatsApp bridge daemon is not running."}),(0,t.jsxs)("p",{children:["Run ",(0,t.jsx)("code",{children:g})," in a terminal, then return to this screen. The QR code will appear automatically once the daemon is up."]})]}):null,(0,t.jsxs)("div",{className:"connection-setup-qr-row",children:[d?(0,t.jsx)("div",{className:"connection-setup-qr-box",children:(0,t.jsx)("img",{src:d,alt:"WhatsApp pairing QR code",width:240,height:240})}):"paired"===j?(0,t.jsx)("div",{className:"connection-setup-qr-pending",children:"Paired — finishing up…"}):(0,t.jsx)("div",{className:"connection-setup-qr-pending",children:x?"Waiting for the daemon…":"Waiting for QR…"}),(0,t.jsxs)("div",{className:"connection-setup-qr-copy",children:[(0,t.jsxs)("p",{children:["Pair only a ",(0,t.jsx)("b",{children:"dedicated WhatsApp number"}),", not your personal account. Baileys is an unofficial Web client and the paired account can be banned."]}),(0,t.jsx)("p",{className:"connection-setup-qr-status",children:(0,t.jsx)("span",{className:"connection-status ".concat("paired"===j?"connected":"needs_setup"),children:"paired"===j?"Paired":"qr_required"===j?"Awaiting scan":j})})]})]})]})}function y(e){var n,l,a,i,c,o,r,d;let{connection:u,credentials:h,onChange:p,onSubmit:m,onCancel:j,busy:g}=e,x=null==u||null==(n=u.connection)?void 0:n.verify_endpoint,[b,f]=s.useState(null),[k,v]=s.useState(null),[y,N]=s.useState(!1),_=s.useCallback(async()=>{if(x){N(!0),v(null);try{let e=await fetch(x,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({credentials:{},dry_run:!0})}),n=await e.json().catch(()=>({}));f(n)}catch(e){v("We couldn't probe the local Hermes path.")}finally{N(!1)}}},[x]);s.useEffect(()=>{_()},[_]);let w=((null==u||null==(l=u.connection)?void 0:l.credentials)||[]).find(e=>"HERMES_AGENT_DIR"===e.name),C=(null==b||null==(a=b.probe)?void 0:a.hermes_dir)||(null==b||null==(o=b.connection)||null==(c=o.connection)||null==(i=c.summary)?void 0:i.hermes_dir)||(null==b?void 0:b.hermes_dir)||(null==b||null==(d=b.connection)||null==(r=d.connection)?void 0:r.account_label),S=(null==b?void 0:b.ok)===!0;return(0,t.jsxs)("form",{className:"connection-setup-step connection-setup-step-form",onSubmit:function(e){e.preventDefault(),m(h)},children:[(0,t.jsxs)("p",{className:"connection-setup-intro",children:["Madarx looks for a local Hermes checkout at ",(0,t.jsx)("code",{children:"../hermes-agent"}),". Override the path below if your checkout lives elsewhere."]}),(0,t.jsx)("div",{className:"connection-setup-probe ".concat(S?"ok":"warn"),children:y?(0,t.jsx)("span",{children:"Probing…"}):S?(0,t.jsxs)("span",{children:[(0,t.jsx)("b",{children:"Hermes detected."})," Path: ",(0,t.jsx)("code",{children:C})]}):(0,t.jsxs)("span",{children:[(0,t.jsx)("b",{children:"Hermes not detected."})," ",(null==b?void 0:b.hint)||k||"Provide an override path or clone hermes-agent."]})}),w?(0,t.jsxs)("label",{className:"connection-setup-field",children:[(0,t.jsx)("span",{className:"connection-setup-field-label",children:w.label}),(0,t.jsx)("input",{type:"text",name:w.name,placeholder:w.placeholder||"",autoComplete:"off",spellCheck:!1,value:h[w.name]||"",onChange:e=>p({...h,[w.name]:e.target.value}),disabled:g}),(0,t.jsx)("small",{className:"connection-setup-field-help",children:w.help_text})]}):null,(0,t.jsxs)("div",{className:"connection-setup-actions",children:[(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:j,disabled:g,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:_,disabled:g||y,children:y?"Probing…":"Re-detect"}),(0,t.jsx)("button",{type:"submit",className:"admin-button",disabled:g||!S&&!h[null==w?void 0:w.name],children:g?"Verifying…":"Connect"})]})]})}let N={BENEFIT:"benefit",SETUP:"setup",VERIFYING:"verifying",DONE:"done"};function _(e){let{status:n}=e;return n?(0,t.jsx)("span",{className:"connection-status ".concat(n.status),children:n.label}):null}function w(e){var n,l,i,c;let{open:o,onClose:r,connection:d,prefillScope:u}=e,h=(0,a.useRouter)(),[p,m]=s.useState(N.BENEFIT),[j,g]=s.useState({}),[b,k]=s.useState({scope:"global",project_id:null,agent_id:null}),[w,C]=s.useState(null),[S,A]=s.useState(null),[E,P]=s.useState(null),[I,L]=s.useState(null),[R,T]=s.useState(!1);if(s.useEffect(()=>{var e,n;o&&(m((null==d?void 0:d.installed)?N.DONE:N.BENEFIT),g({}),(null==u?void 0:u.scope)?k({scope:u.scope,project_id:u.project_id||null,agent_id:u.agent_id||null}):k({scope:"global",project_id:null,agent_id:null}),C(null),A(null),L(null),P((null==d?void 0:d.installed)?{account_label:null==(e=d.connection)?void 0:e.account_label,last_4:null==(n=d.connection)?void 0:n.last_4}:null),T(!1))},[o,null==d?void 0:d.id,null==u?void 0:u.scope,null==u?void 0:u.project_id,null==u?void 0:u.agent_id]),!d)return null;let U=d.connection||d.manifest||{},M=(null==d||null==(n=d.connection)?void 0:n.setup_kind)||(null==d||null==(l=d.manifest)?void 0:l.setup_kind)||"api_key",q=U.verify_endpoint;U.verify_supported;let W=U.deep_link,D=Array.isArray(U.unlocks_tool_slugs)?U.unlocks_tool_slugs:[],B=Array.isArray(U.engines)?U.engines:[];async function O(e){if(!q){C("This connection is missing its setup endpoint."),m(N.SETUP);return}m(N.VERIFYING),C(null),A(null),L(null),T(!0);try{let n=await fetch(q,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({credentials:e||j,scope:b.scope,project_id:b.project_id||null,agent_id:b.agent_id||null})}),l=await n.json().catch(()=>({}));if(!n.ok||!(null==l?void 0:l.ok)){C((null==l?void 0:l.error)||"We could not verify those credentials."),A((null==l?void 0:l.hint)||null),m(N.SETUP);return}P(l.summary||null),L(l.warning||null),m(N.DONE),h.refresh()}catch(e){C("We couldn't reach the service. Check your network and try again."),m(N.SETUP)}finally{T(!1)}}async function F(){if(confirm("Disconnect ".concat(d.title,"? Stored credentials will be revoked."))){T(!0);try{let e=await fetch("/api/connections/".concat(d.slug),{method:"DELETE"}),n=await e.json().catch(()=>({}));if(!e.ok)return void C((null==n?void 0:n.error)||"Could not disconnect.");m(N.BENEFIT),g({}),P(null),h.refresh(),r()}finally{T(!1)}}}return(0,t.jsx)(x.A,{open:o,onClose:r,eyebrow:"Marketplace \xb7 Connection",title:"Connect ".concat(d.title),children:(0,t.jsxs)("div",{className:"connection-setup",children:[p===N.BENEFIT?(0,t.jsxs)("section",{className:"connection-setup-step connection-setup-step-benefit",children:[(0,t.jsx)("p",{className:"connection-setup-benefit",children:U.benefit||d.description}),D.length||B.length?(0,t.jsxs)("ul",{className:"connection-setup-unlocks",children:[B.length?(0,t.jsxs)("li",{children:[(0,t.jsx)("b",{children:"Engine:"})," ",B.join(", ")]}):null,D.length?(0,t.jsxs)("li",{children:[(0,t.jsxs)("b",{children:["Unlocks ",D.length," tool",1===D.length?"":"s",":"]})," ",D.slice(0,6).join(", "),D.length>6?", +".concat(D.length-6," more"):""]}):null]}):null,d.risk_summary?(0,t.jsxs)("p",{className:"connection-setup-risk",children:[(0,t.jsx)("b",{children:"Heads up:"})," ",d.risk_summary]}):null,(0,t.jsxs)("div",{className:"connection-setup-actions",children:[(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:r,disabled:R,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"admin-button",onClick:()=>m(N.SETUP),disabled:R,children:"Continue"})]})]}):null,p===N.SETUP?"qr_pair"===M?(0,t.jsx)(v,{connection:d,onPaired:()=>O({})}):"binary_detect"===M?(0,t.jsx)(y,{connection:d,credentials:j,onChange:g,onSubmit:e=>O(e),onCancel:r,busy:R}):(0,t.jsx)(f,{connection:d,credentials:j,onChange:g,scope:b,onScopeChange:k,onSubmit:e=>O(e),onCancel:r,error:w,hint:S,busy:R}):null,p===N.VERIFYING?(0,t.jsx)("section",{className:"connection-setup-step connection-setup-step-verify",children:(0,t.jsxs)("p",{children:["Verifying with ",d.title,"…"]})}):null,p===N.DONE?(0,t.jsxs)("section",{className:"connection-setup-step connection-setup-step-done",children:[(0,t.jsxs)("div",{className:"connection-setup-done-head",children:[(0,t.jsx)(_,{status:{status:"connected",label:"Connected"}}),(0,t.jsxs)("h3",{children:[d.title," is connected"]})]}),(null==E?void 0:E.account_label)||(null==E?void 0:E.last_4)?(0,t.jsxs)("p",{className:"connection-setup-summary",children:[E.account_label?(0,t.jsxs)("span",{children:["Account: ",E.account_label]}):null,E.last_4?(0,t.jsxs)("span",{children:[" \xb7 Key ends in ••• ",E.last_4]}):null]}):(0,t.jsx)("p",{className:"connection-setup-summary",children:"Credentials stored in your local vault."}),I?(0,t.jsxs)("p",{className:"connection-setup-warning",children:[(0,t.jsx)("b",{children:"Warning:"})," ","SUPABASE_ACCESS_TOKEN"===(i=I.field)?"Personal access token":i||"Optional field"," could not be verified (","unauthorized"===(c=I.reason)?"rejected by the provider":"invalid_key"===c?"invalid":"network"===c?"network error":c||"unknown","). Other credentials were saved."]}):null,D.length?(0,t.jsxs)("p",{className:"connection-setup-unlocked",children:[D.length," tool",1===D.length?"":"s"," now available in the marketplace."]}):null,W?(0,t.jsx)("p",{className:"connection-setup-deeplink",children:(0,t.jsxs)("a",{href:W,className:"admin-link",children:["Open ",d.title," operations →"]})}):null,(0,t.jsxs)("div",{className:"connection-setup-actions",children:[(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:F,disabled:R,children:"Disconnect"}),(0,t.jsx)("button",{type:"button",className:"admin-button",onClick:r,disabled:R,children:"Done"})]})]}):null]})})}function C(e){let n,{install:l,projectName:s,agentName:a}=e,i=(null==l?void 0:l.scope)||"global";n="project"===i?s||l.project_id||"Project":"agent"===i?a||l.agent_id||"Agent":"Global";let c=(null==l?void 0:l.account_label)||((null==l?void 0:l.last_4)?"••• ".concat(l.last_4):null);return(0,t.jsxs)("span",{className:"connection-scope-badge scope-".concat(i),children:[(0,t.jsx)("span",{className:"connection-scope-badge-scope",children:i}),(0,t.jsx)("span",{className:"connection-scope-badge-label",children:n}),c?(0,t.jsx)("span",{className:"connection-scope-badge-sub",children:c}):null]})}function S(e){let{status:n}=e;return n?(0,t.jsx)("span",{className:"connection-status ".concat(n.status),children:n.label}):null}function A(e){var n;let{item:l,status:a,prefillScope:i=null}=e,[c,o]=(0,s.useState)(!1),[r,d]=(0,s.useState)(i),[u,h]=(0,s.useState)({projects:{},agents:{}}),m=l.connection||l.manifest||{},j=Array.isArray(m.unlocks_tool_slugs)?m.unlocks_tool_slugs:[],g=Array.isArray(m.engines)?m.engines:[],x=Array.isArray(l.installs)?l.installs:[],b=(null==a?void 0:a.status)==="connected"||x.length>0;function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;d(e),o(!0)}return(0,s.useEffect)(()=>{(null==i?void 0:i.scope)&&(d(i),o(!0))},[null==i?void 0:i.scope,null==i?void 0:i.project_id,null==i?void 0:i.agent_id]),(0,s.useEffect)(()=>{if(0===x.length)return;let e=x.some(e=>"project"===e.scope&&e.project_id),n=x.some(e=>"agent"===e.scope&&e.agent_id);if(!e&&!n)return;let l=!1;return async function(){try{let t=[];t.push(e?fetch("/api/projects").then(e=>e.json()):Promise.resolve({projects:[]})),t.push(n?fetch("/api/state").then(e=>e.json()):Promise.resolve({agents:[]}));let[s,a]=await Promise.all(t);if(l)return;let i={};for(let e of(null==s?void 0:s.projects)||[])i[e.id]=e.name;let c={};for(let e of(null==a?void 0:a.agents)||[])c[e.id]=e.name||e.id;h({projects:i,agents:c})}catch(e){}}(),()=>{l=!0}},[x.length]),(0,t.jsxs)("li",{className:"mkt-card kind-connection ".concat(b?"on":""),children:[(0,t.jsxs)("div",{className:"mkt-card-head",children:[(0,t.jsx)("span",{className:"mkt-chip-tile kind-connection","aria-hidden":"true",children:(0,t.jsx)(E,{glyph:m.logo_glyph||l.slug})}),(0,t.jsx)(p,{kind:"connection"}),(0,t.jsx)(S,{status:a})]}),(0,t.jsxs)("div",{className:"mkt-card-body",children:[(0,t.jsx)("h3",{className:"mkt-card-title",children:l.title}),(0,t.jsx)("p",{className:"mkt-card-desc",children:l.description})]}),(0,t.jsxs)("div",{className:"mkt-card-meta",children:[g.length?(0,t.jsxs)("span",{children:["Engine ",(0,t.jsx)("b",{children:g.join(" \xb7 ")})]}):null,j.length?(0,t.jsxs)("span",{children:["Unlocks ",(0,t.jsxs)("b",{children:[j.length," tool",1===j.length?"":"s"]})]}):null,m.setup_kind?(0,t.jsxs)("span",{children:["Setup ",(0,t.jsx)("b",{children:"qr_pair"===(n=m.setup_kind)?"QR pairing":"binary_detect"===n?"Local binary":"API key"})]}):null,l.risk_summary?(0,t.jsxs)("span",{children:["Risk ",(0,t.jsx)("b",{children:l.risk_summary.length>40?l.risk_summary.slice(0,40)+"…":l.risk_summary})]}):null]}),x.length>0?(0,t.jsxs)("ul",{className:"connection-card-installs",children:[x.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(C,{install:e,projectName:e.project_id?u.projects[e.project_id]:null,agentName:e.agent_id?u.agents[e.agent_id]:null})},"".concat(e.scope,":").concat(e.project_id||"",":").concat(e.agent_id||""))),(0,t.jsx)("li",{children:(0,t.jsx)("button",{type:"button",className:"connection-card-add",onClick:()=>f({scope:"global",project_id:null,agent_id:null}),children:"+ Add another"})})]}):null,(0,t.jsxs)("div",{className:"mkt-card-foot",children:[(0,t.jsx)("span",{className:"mkt-availability",children:(null==a?void 0:a.footer)||(b?"Ready to use":"Not configured yet")}),(0,t.jsx)("button",{type:"button",className:"admin-button".concat(b?" secondary":""),onClick:()=>f(null),children:b?"Manage":"Configure"})]}),(0,t.jsx)(w,{open:c,onClose:()=>{o(!1),d(null)},connection:l,prefillScope:r})]})}function E(e){let{glyph:n}=e,l=String(n||"?").slice(0,1).toUpperCase();return(0,t.jsxs)("svg",{viewBox:"0 0 20 20",width:"20",height:"20","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"0",y:"0",width:"20",height:"20",rx:"5",fill:"currentColor",opacity:"0.08"}),(0,t.jsx)("text",{x:"10",y:"14",textAnchor:"middle",fontSize:"11",fontWeight:"600",fontFamily:"'IBM Plex Mono', monospace",fill:"currentColor",children:l})]})}let P={intake_form:"intake",agent_run:"agent",policy_gate:"policy",human_approval:"approval",package:"package"};function I(e){var n;let{item:l,toggleAction:s,currentKind:a}=e,i=!!l.installed,c=l.workflow||{};return(0,t.jsxs)("li",{className:"mkt-card kind-workflow ".concat(i?"on":""),children:[(0,t.jsxs)("div",{className:"mkt-card-head",children:[(0,t.jsx)(u,{kind:"workflow",size:20}),(0,t.jsx)(p,{kind:"workflow"})]}),(0,t.jsxs)("div",{className:"mkt-card-body",children:[(0,t.jsx)("h3",{className:"mkt-card-title",children:l.slug}),(0,t.jsx)("p",{className:"mkt-card-desc",children:l.description})]}),(0,t.jsxs)("div",{className:"mkt-card-meta",children:[(0,t.jsxs)("span",{children:["Stages ",(0,t.jsx)("b",{children:c.stage_count||0})]}),(0,t.jsxs)("span",{children:["Shape ",(0,t.jsx)("b",{children:Array.isArray(n=c.stage_kinds)&&n.length?n.map(e=>P[e]||e).join(" → "):"—"})]}),(0,t.jsxs)("span",{children:["By ",(0,t.jsx)("b",{children:l.author})]}),l.version?(0,t.jsxs)("span",{children:["Version ",(0,t.jsx)("b",{children:l.version})]}):null,l.risk_summary?(0,t.jsxs)("span",{children:["Risk ",(0,t.jsx)("b",{children:l.risk_summary.length>60?"".concat(l.risk_summary.slice(0,60),"…"):l.risk_summary})]}):null]}),(0,t.jsxs)("div",{className:"mkt-card-foot",children:[(0,t.jsx)("span",{className:"mkt-availability ".concat(i?"installed":""),children:i?"Installed":"Available"}),(0,t.jsx)(g,{action:s,itemId:l.id,installed:i,available:!0,label:"".concat(i?"Uninstall":"Install"," ").concat(l.slug),slugHint:l.slug,currentKind:a})]})]})}function L(e){var n;let{item:l,toggleAction:s,onBundleClick:a,onConnectionClick:i,connectionStatus:c,connectionPrefill:o,currentKind:r}=e,d="tool"===l.kind,h="skill"===l.kind,m="bundle"===l.kind,x="agent"===l.kind,b="connection"===l.kind,f="workflow"===l.kind,k=!!l.installed,v=!!l.available;return b?(0,t.jsx)(A,{item:l,status:c,prefillScope:o}):f?(0,t.jsx)(I,{item:l,toggleAction:s,currentKind:r}):(0,t.jsxs)("li",{className:"mkt-card kind-".concat(l.kind," ").concat(k?"on":""),children:[(0,t.jsxs)("div",{className:"mkt-card-head",children:[(0,t.jsx)(u,{kind:l.kind,category:l.category,size:20}),(0,t.jsx)(p,{kind:l.kind}),d&&l.tool?(0,t.jsx)(j,{level:l.tool.risk_level}):null]}),(0,t.jsxs)("div",{className:"mkt-card-body",children:[(0,t.jsx)("h3",{className:"mkt-card-title",children:l.slug}),(0,t.jsx)("p",{className:"mkt-card-desc",children:l.description})]}),(0,t.jsxs)("div",{className:"mkt-card-meta",children:[d&&l.tool?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:["Approval mode ",(0,t.jsx)("b",{children:l.tool.approval_mode})]}),(0,t.jsxs)("span",{children:["Config ",(0,t.jsx)("b",{children:(null==(n=l.tool.required_env)?void 0:n.length)?l.tool.required_env.join(" \xb7 "):"none"})]})]}):null,h&&l.skill?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:["Invocation ",(0,t.jsx)("b",{children:l.skill.invocation})]}),(0,t.jsxs)("span",{children:["Author ",(0,t.jsx)("b",{children:l.author})]})]}):null,m&&l.bundle?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:["Items ",(0,t.jsx)("b",{children:l.bundle.published_count})]}),(0,t.jsxs)("span",{children:["By ",(0,t.jsxs)("b",{children:[l.author,l.bundle.license?" \xb7 ".concat(l.bundle.license):""]})]})]}):null,x&&l.agent?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:["Role ",(0,t.jsx)("b",{children:l.agent.role})]}),(0,t.jsxs)("span",{children:["Engine ",(0,t.jsx)("b",{children:l.agent.engine_default})]}),(0,t.jsxs)("span",{children:["Installed ",(0,t.jsxs)("b",{children:[l.install_count||0,"x"]})]})]}):null,!d&&l.risk_summary?(0,t.jsxs)("span",{children:["Risk ",(0,t.jsx)("b",{children:l.risk_summary.length>40?l.risk_summary.slice(0,40)+"…":l.risk_summary})]}):null,l.version?(0,t.jsxs)("span",{children:["Version ",(0,t.jsx)("b",{children:l.version})]}):null]}),(0,t.jsxs)("div",{className:"mkt-card-foot",children:[(0,t.jsx)("span",{className:"mkt-availability ".concat(k?"installed":v?"":"warn"),children:k?"Installed":d&&!v?"Missing config":"Available"}),m?(0,t.jsx)("button",{type:"button",className:"mkt-toggle",role:"switch","aria-checked":!1,"aria-label":"Install ".concat(l.slug," (Phase 2)"),onClick:a}):(0,t.jsx)(g,{action:s,itemId:l.id,installed:k,available:v,label:"".concat(k?"Uninstall":"Install"," ").concat(l.slug),slugHint:l.slug,currentKind:r})]})]})}function R(e){let{open:n,onClose:l,action:s,mode:a="github",bundleSlug:i}=e,c="bundle"===a;return(0,t.jsx)(x.A,{open:n,onClose:l,eyebrow:c?"Bundle install \xb7 Phase 2":"Import from GitHub \xb7 Phase 2",title:c?"Installing ".concat(i||"this bundle"," lands in Phase 2"):"Importer lands in Phase 2",children:(0,t.jsxs)("form",{className:"agents-modal-form",action:s,children:[(0,t.jsx)("p",{className:"agents-modal-help",children:c?"Bundle installs walk through every contained tool and skill, surface a per-item risk roll-up, and let you confirm selectively. Phase 1 catalogs bundles so the UI shape is ready — install execution arrives in the next phase.":"Paste any public GitHub repo URL. Phase 2 will clone the repo read-only into workspace/imports/, parse skills/ and tools/ directories, classify each item by risk, and surface them for selective install with a code-review gate on JS adapters."}),c?(0,t.jsx)("input",{type:"hidden",name:"url",value:i?"bundle:".concat(i):"bundle:unknown"}):(0,t.jsx)("section",{className:"agents-modal-section",children:(0,t.jsxs)("label",{className:"agents-modal-field wide",children:[(0,t.jsx)("span",{children:"Repository URL"}),(0,t.jsx)("input",{name:"url",type:"url",placeholder:"https://github.com/owner/repo",disabled:!0,readOnly:!0,"aria-label":"GitHub repository URL"})]})}),(0,t.jsx)("p",{className:"agents-modal-help",style:{fontSize:11,color:"#9aa0aa"},children:c?"Agent personas are managed in the Agent Marketplace (coming soon).":"No code is fetched in Phase 1. Click queues an audit row so the team can prioritise."}),(0,t.jsxs)("footer",{className:"agents-modal-foot",children:[(0,t.jsx)("button",{type:"button",className:"admin-button secondary",onClick:l,children:"Close"}),(0,t.jsx)("button",{className:"admin-button",type:"submit",disabled:!0,children:c?"Coming Phase 2":"Coming next"})]})]})})}let T=["toast","slug","toast_kind"];function U(e,n,l){let t=n instanceof URLSearchParams?new URLSearchParams(n):new URLSearchParams(n.toString()),s=!1;for(let e of T)t.has(e)&&(t.delete(e),s=!0);if(!s)return;let a=t.toString();l.replace(a?"".concat(e,"?").concat(a):e,{scroll:!1})}function M(){let e=(0,a.useRouter)(),n=(0,a.usePathname)(),l=(0,a.useSearchParams)(),i=l.get("toast"),c=l.get("slug")||"",[o,r]=(0,s.useState)(()=>i?{state:i,slug:c,key:"".concat(i,":").concat(c,":").concat(Date.now())}:null),[d,u]=(0,s.useState)(!!i),h=l.toString();if((0,s.useEffect)(()=>{if(!i)return;r({state:i,slug:c,key:"".concat(i,":").concat(c,":").concat(Date.now())}),u(!0);let l=setTimeout(()=>u(!1),3800),t=setTimeout(()=>U(n,new URLSearchParams(h),e),4e3);return()=>{clearTimeout(l),clearTimeout(t)}},[i,c,h]),!d||!o)return null;let p=function(e,n){let l=n?'"'.concat(n,'"'):"item";return"installed"===e?{tone:"success",eyebrow:"Installed",text:"".concat(l," is now installed and available to your agents.")}:"uninstalled"===e?{tone:"success",eyebrow:"Uninstalled",text:"".concat(l," has been removed from your installed catalog.")}:"deferred"===e?{tone:"info",eyebrow:"Pending",text:"Bundle install for ".concat(l," lands in Phase 2 — the catalog now reflects the request.")}:"setup_required"===e?{tone:"info",eyebrow:"Setup required",text:"Open the setup assistant for ".concat(l," to finish connecting it.")}:"already_present"===e?{tone:"info",eyebrow:"Already installed",text:"A workflow with the same slug as ".concat(l," already exists. Edit it on /workflows.")}:"in_flight_cases"===e?{tone:"info",eyebrow:"Uninstall blocked",text:"".concat(l," has cases still running. Finish or cancel them before uninstalling.")}:"error"===e?{tone:"error",eyebrow:"Action failed",text:"Could not update ".concat(l,". Check the runtime panel for details.")}:null}(o.state,o.slug);return p?(0,t.jsxs)("div",{className:"mkt-toast ".concat(p.tone),role:"status","aria-live":"polite",children:[(0,t.jsx)("span",{children:p.eyebrow}),(0,t.jsx)("p",{children:p.text}),(0,t.jsx)("button",{type:"button",onClick:()=>{u(!1),U(n,l,e)},"aria-label":"Dismiss notification",children:"\xd7"})]},o.key):null}let q=["all","connection","tool","skill","bundle","agent","workflow"];function W(e,n){if(!n)return 0;let l=n.toLowerCase(),t=String(e.slug||"").toLowerCase(),s=String(e.title||"").toLowerCase();return t.startsWith(l)||s.startsWith(l)?100:t.includes(l)||s.includes(l)?80:String(e.author||"").toLowerCase().includes(l)?60:Array.isArray(e.tags)&&e.tags.join(" ").toLowerCase().includes(l)?50:30}function D(e){let{items:n,counts:l,categoriesByKind:i,toggleAction:c,importAction:d,initialKind:u="all"}=e,h=q.includes(u)?u:"all",[p,m]=(0,s.useState)(h),[j,g]=(0,s.useState)(null),[x,b]=(0,s.useState)(""),[f,k]=(0,s.useState)(!1),[v,y]=(0,s.useState)({open:!1,slug:null}),[N,_]=(0,s.useState)({open:!1,item:null}),C=(0,a.useSearchParams)(),S=(null==C?void 0:C.get("connection"))||null,A=(null==C?void 0:C.get("prefill_scope"))||null,E=(null==C?void 0:C.get("prefill_project_id"))||null,P=(null==C?void 0:C.get("prefill_agent_id"))||null,I=A?{scope:A,project_id:E,agent_id:P}:null;(0,s.useEffect)(()=>{g(null)},[p]);let T=(0,s.useMemo)(()=>{if("all"===p){let e=new Set,n=[];for(let l of Object.values(i||{}))for(let t of l)e.has(t)||(e.add(t),n.push(t));return n}return(null==i?void 0:i[p])||[]},[p,i]),U=(0,s.useMemo)(()=>{let e={};for(let l of"all"===p?n:n.filter(e=>e.kind===p))l.category&&(e[l.category]=(e[l.category]||0)+1);return e},[n,p]),D=(0,s.useMemo)(()=>{let e=n;if("all"!==p&&(e=e.filter(e=>e.kind===p)),j&&(e=e.filter(e=>e.category===j)),x.trim()){let n=x.trim();e=e.filter(e=>(function(e,n){if(!n)return!0;let l=n.toLowerCase(),t=String(e.slug||"").toLowerCase(),s=String(e.title||"").toLowerCase(),a=String(e.description||"").toLowerCase(),i=String(e.author||"").toLowerCase(),c=Array.isArray(e.tags)?e.tags.join(" ").toLowerCase():"";return t.includes(l)||s.includes(l)||a.includes(l)||i.includes(l)||c.includes(l)})(e,n)).slice().sort((e,l)=>W(l,n)-W(e,n))}return e},[n,p,j,x]),B=n.filter(e=>e.installed).length;return(0,t.jsxs)("div",{className:"mkt-page",children:[(0,t.jsx)(M,{}),(0,t.jsxs)("section",{className:"mkt-stats",children:[(0,t.jsxs)("div",{className:"mkt-stat",children:[(0,t.jsx)("b",{children:l.all}),(0,t.jsx)("span",{children:"Catalog"})]}),(0,t.jsxs)("div",{className:"mkt-stat connection",children:[(0,t.jsx)("b",{children:l.connection||0}),(0,t.jsx)("span",{children:"Connections"})]}),(0,t.jsxs)("div",{className:"mkt-stat",children:[(0,t.jsx)("b",{children:l.tool}),(0,t.jsx)("span",{children:"Tools"})]}),(0,t.jsxs)("div",{className:"mkt-stat",children:[(0,t.jsx)("b",{children:l.skill}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{className:"mkt-stat",children:[(0,t.jsx)("b",{children:l.bundle}),(0,t.jsx)("span",{children:"Bundles"})]}),(0,t.jsxs)("div",{className:"mkt-stat agent",children:[(0,t.jsx)("b",{children:l.agent||0}),(0,t.jsx)("span",{children:"Agents"})]}),(0,t.jsxs)("div",{className:"mkt-stat workflow",children:[(0,t.jsx)("b",{children:l.workflow||0}),(0,t.jsx)("span",{children:"Workflows"})]})]}),(0,t.jsxs)("section",{className:"mkt-toolbar","aria-label":"Discover",children:[(0,t.jsx)(r,{value:x,onChange:b}),(0,t.jsxs)("button",{type:"button",className:"mkt-cta",onClick:()=>k(!0),children:[(0,t.jsx)("svg",{className:"mkt-cta-mark",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.92.57.1.78-.25.78-.55v-1.93c-3.2.69-3.87-1.54-3.87-1.54-.52-1.32-1.28-1.67-1.28-1.67-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.19 1.18.92-.26 1.91-.39 2.9-.39s1.98.13 2.9.39c2.21-1.49 3.18-1.18 3.18-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.69 5.41-5.26 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.66.79.55C20.21 21.38 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z"})}),"Import from GitHub"]})]}),(0,t.jsx)(o,{activeKind:p,onKindChange:m,counts:l,categories:T,categoryCounts:U,scopeCount:"all"===p?l.all:l[p]||0,activeCategory:j,onCategoryChange:g}),(0,t.jsx)("section",{className:"mkt-section","aria-live":"polite",children:D.length?(0,t.jsx)("ul",{className:"mkt-grid",children:D.map(e=>(0,t.jsx)(L,{item:e,toggleAction:c,onBundleClick:()=>y({open:!0,slug:e.slug}),onConnectionClick:()=>_({open:!0,item:e}),connectionStatus:"connection"===e.kind?function(e){let n=e.connection;if(!n||!e.installed)return{status:"needs_setup",label:"Not connected",footer:null};let l=[];if(n.account_label&&l.push(n.account_label),n.last_4&&l.push("••• ".concat(n.last_4)),n.last_verified_at)try{let e=Math.round((Date.now()-new Date(n.last_verified_at).getTime())/6e4);e<1?l.push("verified just now"):e<60?l.push("verified ".concat(e,"m ago")):e<1440?l.push("verified ".concat(Math.round(e/60),"h ago")):l.push("verified ".concat(Math.round(e/1440),"d ago"))}catch(e){}return{status:"connected",label:"Connected",footer:l.length?l.join(" \xb7 "):null}}(e):null,connectionPrefill:"connection"===e.kind&&S&&e.slug===S?I:null,currentKind:p},e.id))}):(0,t.jsxs)("div",{className:"mkt-empty",children:[(0,t.jsx)("b",{children:"Nothing matches your search yet."}),(0,t.jsx)("p",{children:"Try a broader term, switch the kind tab, or clear the category filter. Looking for an agent persona? Those land in the Agent Marketplace (coming soon)."}),(0,t.jsxs)("small",{children:[B," installed \xb7 ",l.all," total"]})]})},"".concat(p,":").concat(j)),(0,t.jsx)(R,{open:f,onClose:()=>k(!1),action:d,mode:"github"}),(0,t.jsx)(R,{open:v.open,onClose:()=>y({open:!1,slug:null}),action:d,mode:"bundle",bundleSlug:v.slug}),(0,t.jsx)(w,{open:N.open,onClose:()=>_({open:!1,item:null}),connection:N.item})]})}},1969:(e,n,l)=>{Promise.resolve().then(l.bind(l,677)),Promise.resolve().then(l.bind(l,874))}},e=>{e.O(0,[2769,9077,8441,1255,7358],()=>e(e.s=1969)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5732],{748:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var a=r(5155),n=r(2115);let o={start:"Starting",extract:"Extracting facts (LLM)",valuation:"Valuation",narrative:"Authoring narrative (LLM)",package:"Investor presentation",reports:"Reports",complete:"Complete"},l={running:"#68707b",done:"#2A5C45",warn:"#c2452a"};function i(){return(0,a.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5L18 18M18 6l-2.5 2.5M8.5 15.5L6 18",strokeLinecap:"round"})})}function s(e){let{minesProjectId:t}=e,[r,s]=(0,n.useState)(!1),[d,c]=(0,n.useState)([]),[p,u]=(0,n.useState)([]),[h,f]=(0,n.useState)(null),[g,m]=(0,n.useState)(null),x=(0,n.useRef)(null),y=(0,n.useRef)(null),b=(0,n.useCallback)(()=>{if(x.current){try{x.current.close()}catch(e){}x.current=null}},[]),v=(0,n.useCallback)(()=>{b();let e=new EventSource("/api/events/stream");x.current=e,e.addEventListener("mines_diligence",e=>{let r;try{r=JSON.parse(e.data)}catch(e){return}r.project_id===t&&(y.current&&r.run_id&&r.run_id!==y.current||(c(e=>[...e,{phase:r.phase,status:r.status,message:r.message}]),"complete"===r.phase&&(u(Array.isArray(r.artifacts)?r.artifacts:[]),f(r.space_name||null),s(!1),b())))}),e.onerror=()=>{}},[t,b]);(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{let r=await fetch("/api/mines/projects/".concat(t,"/diligence"),{cache:"no-store"}),a=await r.json().catch(()=>({}));!e&&(null==a?void 0:a.running)&&(y.current=a.run_id||null,s(!0),c([{phase:"start",status:"running",message:"Resuming in-progress run…"}]),v())}catch(e){}})(),()=>{e=!0,b()}},[t,v,b]);let j=(0,n.useCallback)(async()=>{m(null),u([]),c([]),s(!0);try{let e=await fetch("/api/mines/projects/".concat(t,"/diligence"),{method:"POST"}),r=await e.json().catch(()=>({}));202===e.status||(null==r?void 0:r.status)==="started"?(y.current=r.run_id||null,v()):409===e.status||(null==r?void 0:r.status)==="already_running"?(y.current=r.run_id||null,c([{phase:"start",status:"running",message:"A run is already in progress — following it."}]),v()):(s(!1),m((null==r?void 0:r.reason)||(null==r?void 0:r.error)||"Could not start diligence run."))}catch(e){s(!1),m((null==e?void 0:e.message)||"Network error starting diligence run.")}},[t,v]);return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:10},children:[(0,a.jsxs)("button",{type:"button",onClick:j,disabled:r,style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 18px",borderRadius:10,border:"none",background:r?"#9aa0aa":"#2A5C45",color:"#fff",fontSize:13,fontWeight:800,letterSpacing:"-.01em",cursor:r?"wait":"pointer",boxShadow:r?"none":"0 6px 18px rgba(42,92,69,.28)"},children:[(0,a.jsx)(i,{}),r?"Generating…":"Generate diligence package"]}),g&&(0,a.jsx)("p",{"aria-live":"polite",style:{margin:0,fontSize:12,color:"#c2452a",fontWeight:700,maxWidth:340,textAlign:"right"},children:g}),d.length>0&&(0,a.jsxs)("div",{style:{width:360,maxWidth:"100%",border:"1px solid rgba(17,19,24,.10)",borderRadius:12,background:"#fff",padding:"10px 12px",boxShadow:"0 10px 30px rgba(17,19,24,.07)"},children:[(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:d.map((e,t)=>(0,a.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",fontSize:12},children:[(0,a.jsx)("span",{style:{fontFamily:"ui-monospace, Menlo, monospace",fontSize:9.5,fontWeight:800,letterSpacing:".08em",textTransform:"uppercase",color:l[e.status]||"#8a8f99",minWidth:132},children:o[e.phase]||e.phase}),(0,a.jsx)("span",{style:{color:"#313740",lineHeight:1.45},children:e.message})]},t))}),p.length>0&&(0,a.jsxs)("div",{style:{marginTop:10,paddingTop:10,borderTop:"1px solid rgba(17,19,24,.08)"},children:[(0,a.jsxs)("span",{style:{display:"block",fontSize:10,fontWeight:800,letterSpacing:".1em",textTransform:"uppercase",color:"#8a8f99",marginBottom:6},children:[p.length," artifact",1===p.length?"":"s",h?" in “".concat(h,"”"):""]}),(0,a.jsx)("ul",{style:{listStyle:"none",margin:"0 0 10px",padding:0,display:"flex",flexDirection:"column",gap:3},children:p.map(e=>(0,a.jsxs)("li",{style:{fontSize:12,color:"#111318",display:"flex",gap:6,alignItems:"baseline"},children:[(0,a.jsx)("span",{style:{width:4,height:4,borderRadius:4,background:"#c2452a",flexShrink:0,transform:"translateY(-2px)"}}),e.title]},e.id))}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("a",{href:"/",style:{fontSize:12,fontWeight:700,color:"#2A5C45",textDecoration:"none"},children:"Open dashboard space →"}),(0,a.jsx)("a",{href:"/mines/".concat(t,"/results"),style:{fontSize:12,fontWeight:700,color:"#2A5C45",textDecoration:"none"},children:"Open diligence results →"})]})]})]})]})}},3645:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var a=r(5155),n=r(2115);function o(e){let{minesProjectId:t,initialProgress:r}=e,[o,l]=(0,n.useState)(""),[i,s]=(0,n.useState)([]),[d,c]=(0,n.useState)(r||null),[p,u]=(0,n.useState)(!1),[h,f]=(0,n.useState)(!1),[g,m]=(0,n.useState)(!1),[x,y]=(0,n.useState)(null),[b,v]=(0,n.useState)(null),j=(0,n.useRef)(null),S=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/mines/projects/".concat(t,"/import"),{cache:"no-store"});if(!e.ok)return;let r=await e.json();(null==r?void 0:r.data)&&c(r.data)}catch(e){}},[t]),k=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/mines/import-roots",{cache:"no-store"});if(!e.ok)return;let t=await e.json();Array.isArray(null==t?void 0:t.roots)&&s(t.roots)}catch(e){}},[]);(0,n.useEffect)(()=>(S(),k(),j.current=setInterval(()=>{S()},5e3),()=>clearInterval(j.current)),[S,k]);let w=((null==d?void 0:d.queued)||0)+((null==d?void 0:d.running)||0)>0,C=(0,n.useCallback)(async()=>{y(null),v(null);let e=o.trim();if(!e)return y("Enter or choose the folder you want to approve for Mines import."),null;m(!0);try{let t=await fetch("/api/mines/import-roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory_path:e,label:String(e||"").split(/[\\/]+/).filter(Boolean).at(-1)||e||"Selected folder"})}),r=await t.json().catch(()=>({}));if(!t.ok||(null==r?void 0:r.status)!=="ok")return y("Could not approve folder: ".concat((null==r?void 0:r.error)||"unknown error")),null;return l(r.root_path||e),v(r.existing?"Folder was already approved for Mines import.":"Folder approved for Mines import."),k(),r.root_path||e}catch(e){return y("Could not approve folder: ".concat((null==e?void 0:e.message)||"network error")),null}finally{m(!1)}},[o,k]),_=(0,n.useCallback)(async()=>{y(null),v(null),f(!0);try{let e=await fetch("/api/fs/pick-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:"Choose a Mines data folder",start_path:o.trim()||void 0,register_import_root:!0,label:"Mines data folder"})}),t=await e.json().catch(()=>({}));if(!e.ok||(null==t?void 0:t.error)){(null==t?void 0:t.error)!=="cancelled"&&y("Folder selection failed: ".concat((null==t?void 0:t.error)||"unknown error"));return}l(t.folder_path||""),v("Folder selected and approved for Mines import."),k()}catch(e){y("Folder selection failed: ".concat((null==e?void 0:e.message)||"network error"))}finally{f(!1)}},[o,k]),M=(0,n.useCallback)(async()=>{y(null),v(null);let e=o.trim();if(!e)return void y("Choose or paste the folder containing the mine data.");if(!i.some(t=>e===t.root_path||e.startsWith("".concat(t.root_path,"/")))){let t=await C();if(!t)return;e=t}u(!0);try{let o=await fetch("/api/mines/projects/".concat(t,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory_path:e,resume:!0})}),l=await o.json().catch(()=>({}));if((null==l?void 0:l.status)==="approval_required")v("Import is waiting for approval. Approve it in the approvals queue, then run again.");else if((null==l?void 0:l.status)==="ok"){var r,a,n;v("Queued ".concat(null!=(r=l.queued)?r:0," files (").concat(null!=(a=l.catalog_only)?a:0," catalog-only, ").concat(null!=(n=l.skipped_complete)?n:0," already imported).")),S(),k()}else(null==l?void 0:l.error)?y("Import failed: ".concat(l.error)):v("Import request submitted.")}catch(e){y("Import request failed: ".concat((null==e?void 0:e.message)||"network error"))}finally{u(!1)}},[i,C,o,t,S,k]),W=function(e){let t=(null==e?void 0:e.total_files)||0;return t?Math.min(100,Math.round((((null==e?void 0:e.complete)||0)+((null==e?void 0:e.failed)||0)+((null==e?void 0:e.skipped)||0))/t*100)):0}(d),z=p||h||g;return(0,a.jsxs)("div",{style:{border:"1px solid rgba(17,19,24,.08)",borderRadius:18,background:"linear-gradient(145deg, rgba(255,255,255,.9), rgba(247,244,237,.78))",padding:18,marginBottom:20,boxShadow:"0 18px 45px rgba(17,19,24,.06)"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12,gap:12,flexWrap:"wrap"},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{style:{display:"block",fontSize:13,fontWeight:800,color:"#111318"},children:"Import mine data"}),(0,a.jsx)("span",{style:{display:"block",marginTop:3,fontSize:11.5,color:"#68707b"},children:"Choose a local source folder once; MadarX remembers approved Mines import roots."})]}),w&&(0,a.jsxs)("span",{style:{fontSize:11.5,fontWeight:700,color:"#c2452a"},children:[d.running||0," processing \xb7 ",d.queued||0," queued"]})]}),i.length>0&&(0,a.jsxs)("label",{style:{display:"block",marginBottom:10},children:[(0,a.jsx)("span",{style:{display:"block",marginBottom:5,fontSize:11.5,fontWeight:750,color:"#343943"},children:"Approved folders"}),(0,a.jsxs)("select",{value:o,onChange:e=>l(e.target.value),style:{width:"100%",padding:"9px 12px",border:"1px solid rgba(17,19,24,.14)",borderRadius:10,fontSize:13},children:[(0,a.jsx)("option",{value:"",children:"Select a previously approved folder…"}),i.map(e=>(0,a.jsxs)("option",{value:e.root_path,children:[e.label," — ",e.root_path]},e.id))]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("input",{type:"text",value:o,onChange:e=>l(e.target.value),placeholder:"Choose a folder or paste an absolute path",spellCheck:!1,"aria-label":"Mines data folder path",style:{flex:1,minWidth:260,padding:"10px 12px",border:"1px solid rgba(17,19,24,.14)",borderRadius:10,fontSize:13,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"}}),(0,a.jsx)("button",{type:"button",onClick:_,disabled:z,style:{padding:"10px 14px",borderRadius:10,border:"1px solid rgba(17,19,24,.14)",background:"#fff",color:"#111318",fontSize:13,fontWeight:750,cursor:z?"wait":"pointer"},children:h?"Choosing…":"Choose folder"}),(0,a.jsx)("button",{type:"button",onClick:C,disabled:z||!o.trim(),style:{padding:"10px 14px",borderRadius:10,border:"1px solid rgba(194,69,42,.28)",background:"rgba(194,69,42,.07)",color:"#8f321f",fontSize:13,fontWeight:750,cursor:z?"wait":"pointer"},children:g?"Approving…":"Approve folder"}),(0,a.jsx)("button",{type:"button",onClick:M,disabled:z||!o.trim(),style:{padding:"10px 18px",borderRadius:10,border:"none",background:z?"#9aa0aa":"#2A5C45",color:"#fff",fontSize:13,fontWeight:800,cursor:z?"wait":"pointer"},children:p?"Submitting…":"Run import"})]}),(0,a.jsx)("p",{style:{margin:"9px 0 0",fontSize:11.5,color:"#68707b"},children:"Approval is saved inside MadarX. Imports stay bounded to folders you approve here, and each run remains audit-logged."}),(b||x)&&(0,a.jsx)("p",{"aria-live":"polite",style:{margin:"10px 0 0",fontSize:12.5,color:x?"#c2452a":"#2A5C45",fontWeight:700},children:x||b}),d&&d.total_files>0&&(0,a.jsxs)("div",{style:{marginTop:14},children:[(0,a.jsx)("div",{style:{height:8,borderRadius:6,background:"rgba(17,19,24,.08)",overflow:"hidden"},children:(0,a.jsx)("div",{style:{width:"".concat(W,"%"),height:"100%",background:"#2A5C45",transition:"width .4s ease"}})}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:6,fontSize:11,color:"#68707b",gap:8,flexWrap:"wrap"},children:[(0,a.jsxs)("span",{children:[W,"% processed"]}),(0,a.jsxs)("span",{children:[d.complete||0," complete \xb7 ",d.failed||0," failed \xb7 ",d.skipped||0," skipped \xb7 ",d.total_files||0," total"]})]})]})]})}},4219:(e,t,r)=>{Promise.resolve().then(r.bind(r,748)),Promise.resolve().then(r.bind(r,3645)),Promise.resolve().then(r.t.bind(r,2619,23))}},e=>{e.O(0,[2619,8441,1255,7358],()=>e(e.s=4219)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1961],{702:(e,t,n)=>{"use strict";n.d(t,{default:()=>f});var o=n(5155),i=n(2115);let r="#111318",a="#8a8f99",s="rgba(17,19,24,.09)",l="rgba(17,19,24,.06)",d="#c2452a",c="ui-monospace, SFMono-Regular, Menlo, monospace";function p(e){let{artifact:t,onClose:n}=e,[p,f]=(0,i.useState)(()=>({x:Math.max(24,Math.round(.5*window.innerWidth-470)),y:64})),[h,u]=(0,i.useState)({w:940,h:640}),x=(0,i.useRef)(null),g=(0,i.useCallback)(e=>{let t=x.current;t&&("move"===t.mode?f({x:t.ox+(e.clientX-t.sx),y:Math.max(8,t.oy+(e.clientY-t.sy))}):u({w:Math.max(360,t.ow+(e.clientX-t.sx)),h:Math.max(240,t.oh+(e.clientY-t.sy))}))},[]),b=(0,i.useCallback)(()=>{x.current=null},[]);return(0,i.useEffect)(()=>{window.addEventListener("pointermove",g),window.addEventListener("pointerup",b);let e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("keydown",e)}},[g,b,n]),(0,o.jsx)("div",{onMouseDown:n,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(17,19,24,.34)",backdropFilter:"blur(2px)"},children:(0,o.jsxs)("div",{onMouseDown:e=>e.stopPropagation(),style:{position:"absolute",left:p.x,top:p.y,width:h.w,height:h.h,display:"flex",flexDirection:"column",background:"#fff",borderRadius:14,border:"1px solid ".concat(s),boxShadow:"0 24px 70px -18px rgba(17,19,24,.4)",overflow:"hidden"},children:[(0,o.jsxs)("div",{onPointerDown:e=>{e.target.closest("button, a")||(x.current={mode:"move",sx:e.clientX,sy:e.clientY,ox:p.x,oy:p.y})},style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"grab",borderBottom:"1px solid ".concat(l),background:"#fcfcfb",userSelect:"none",flexShrink:0},children:[(0,o.jsxs)("span",{style:{display:"inline-flex",gap:6},children:[(0,o.jsx)("button",{onClick:n,"aria-label":"Close",style:{width:12,height:12,borderRadius:"50%",border:"none",background:d,cursor:"pointer",padding:0}}),(0,o.jsx)("span",{style:{width:12,height:12,borderRadius:"50%",background:"rgba(17,19,24,.14)"}}),(0,o.jsx)("span",{style:{width:12,height:12,borderRadius:"50%",background:"rgba(17,19,24,.14)"}})]}),(0,o.jsx)("b",{style:{fontSize:13,fontWeight:650,color:r,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.title||"Artifact"}),(0,o.jsx)("span",{style:{fontSize:9.5,fontWeight:800,letterSpacing:".1em",textTransform:"uppercase",color:a,fontFamily:c},children:t.kind}),(0,o.jsx)("a",{href:"/api/artifacts/".concat(t.id,"/raw"),target:"_blank",rel:"noreferrer",style:{marginLeft:"auto",fontSize:11,color:a,fontWeight:600,textDecoration:"none",fontFamily:c},children:"raw ↗"})]}),(0,o.jsx)("iframe",{title:t.title,srcDoc:t.content,sandbox:"allow-scripts allow-same-origin allow-popups",style:{flex:1,width:"100%",border:0,background:"#fff"}}),(0,o.jsx)("span",{onPointerDown:e=>{e.stopPropagation(),x.current={mode:"resize",sx:e.clientX,sy:e.clientY,ow:h.w,oh:h.h}},"aria-hidden":!0,style:{position:"absolute",right:0,bottom:0,width:18,height:18,cursor:"nwse-resize",background:"linear-gradient(135deg, transparent 50%, rgba(17,19,24,.22) 50%)"}})]})})}function f(e){let{artifacts:t,projectId:n,defaultSpaceId:f}=e,[h,u]=(0,i.useState)(null),[x,g]=(0,i.useState)([]),[b,y]=(0,i.useState)(f||""),[m,w]=(0,i.useState)(!1),[v,j]=(0,i.useState)("");async function k(){if(b&&!m){w(!0),j("");try{let e=await fetch("/api/mines/projects/".concat(n,"/publish"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({space_id:b})}),t=await e.json();if(!e.ok)throw Error((null==t?void 0:t.error)||"publish_failed");let o=x.find(e=>e.id===b);j("Published to “".concat((null==o?void 0:o.name)||b,"” — ").concat(t.data.pinned_artifacts," artifacts pinned. Open the dashboard to arrange them."))}catch(e){j("Publish failed: ".concat(e.message))}finally{w(!1)}}}return(0,i.useEffect)(()=>{let e=!0;return fetch("/api/dashboard/spaces").then(e=>e.json()).then(t=>{var n,o;if(!e)return;let i=(null==t||null==(n=t.data)?void 0:n.spaces)||(null==t?void 0:t.spaces)||[];g(i),!b&&i.length&&y((null==(o=i.find(e=>e.is_active))?void 0:o.id)||i[0].id)}).catch(()=>{}),()=>{e=!1}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:16,padding:"14px 16px",border:"1px solid ".concat(l),borderRadius:14,background:"#fcfcfb"},children:[(0,o.jsx)("span",{style:{fontSize:10,fontWeight:800,letterSpacing:".13em",textTransform:"uppercase",color:a,fontFamily:c},children:"Dashboard space"}),(0,o.jsxs)("select",{value:b,onChange:e=>y(e.target.value),style:{fontSize:13,padding:"7px 10px",borderRadius:9,border:"1px solid ".concat(s),background:"#fff",color:r,fontFamily:"inherit"},children:[0===x.length&&(0,o.jsx)("option",{value:"",children:"No spaces"}),x.map(e=>(0,o.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,o.jsx)("button",{onClick:k,disabled:m||!b,style:{fontSize:13,fontWeight:650,padding:"8px 16px",borderRadius:9,border:"none",cursor:m||!b?"default":"pointer",background:m||!b?"rgba(17,19,24,.18)":d,color:"#fff"},children:m?"Publishing…":"Publish to space"}),v&&(0,o.jsx)("span",{style:{fontSize:12,color:v.startsWith("Publish failed")?d:"#5b626c"},children:v})]}),(0,o.jsx)("div",{style:{display:"grid",gap:12},children:t.map(e=>(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"14px 18px",border:"1px solid ".concat(l),borderRadius:14,background:"#fff"},children:[(0,o.jsxs)("span",{style:{display:"flex",flexDirection:"column",gap:4,minWidth:0},children:[(0,o.jsx)("span",{style:{fontSize:10,fontWeight:800,letterSpacing:".1em",textTransform:"uppercase",color:a,fontFamily:c},children:e.kind}),(0,o.jsx)("span",{style:{fontSize:15,fontWeight:650,letterSpacing:"-.01em",color:r},children:e.title})]}),(0,o.jsxs)("span",{style:{display:"flex",gap:8,flexShrink:0},children:[(0,o.jsx)("a",{href:"/api/artifacts/".concat(e.id,"/raw"),target:"_blank",rel:"noreferrer",style:{fontSize:11,color:a,fontWeight:600,textDecoration:"none",fontFamily:c,alignSelf:"center"},children:"raw ↗"}),(0,o.jsx)("button",{onClick:()=>u(e),disabled:!e.content,style:{fontSize:12.5,fontWeight:650,padding:"8px 16px",borderRadius:9,border:"1px solid ".concat(d),background:"#fff",color:d,cursor:e.content?"pointer":"default",opacity:e.content?1:.4},children:"Open"})]})]},e.id))}),h&&(0,o.jsx)(p,{artifact:h,onClose:()=>u(null)})]})}},2582:(e,t,n)=>{Promise.resolve().then(n.bind(n,702)),Promise.resolve().then(n.t.bind(n,2619,23))}},e=>{e.O(0,[2619,8441,1255,7358],()=>e(e.s=2582)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4669],{63:(e,t,l)=>{"use strict";var a=l(7260);l.o(a,"usePathname")&&l.d(t,{usePathname:function(){return a.usePathname}}),l.o(a,"useRouter")&&l.d(t,{useRouter:function(){return a.useRouter}}),l.o(a,"useSearchParams")&&l.d(t,{useSearchParams:function(){return a.useSearchParams}})},677:(e,t,l)=>{"use strict";l.d(t,{default:()=>i});var a=l(5155),s=l(2115);function i(){let[e,t]=(0,s.useState)([]),[l,i]=(0,s.useState)("");return(0,s.useEffect)(()=>{i(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>t(e.projects||[])).catch(()=>{})},[]),(0,a.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,a.jsxs)("select",{value:l,onChange:e=>{var t;i(t=e.target.value),t?localStorage.setItem("madarx.activeProjectId",t):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:t||null}}))},"aria-label":"Active project",children:[(0,a.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},3947:(e,t,l)=>{Promise.resolve().then(l.bind(l,677)),Promise.resolve().then(l.bind(l,5411))},5411:(e,t,l)=>{"use strict";l.d(t,{default:()=>f});var a=l(5155),s=l(2115),i=l(63);function n(e){let{value:t}=e,l=null==t?null:t>=.8?"full":t>=.4?"partial":"low";return l?(0,a.jsx)("span",{className:"admin-pill ".concat({full:"ready",partial:"warn",low:"danger"}[l]),children:l}):(0,a.jsx)("span",{className:"admin-muted",children:"—"})}function r(){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M8 11V4M5 7l3-3 3 3",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M3 13h10",strokeLinecap:"round"})]})}function o(){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M10 12L6 8l4-4",strokeLinecap:"round",strokeLinejoin:"round"})})}function d(){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M6 12l4-4-4-4",strokeLinecap:"round",strokeLinejoin:"round"})})}function c(){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",strokeLinecap:"round"})})}function p(e){let{onClose:t,onImported:l}=e,[i,n]=(0,s.useState)(""),[r,o]=(0,s.useState)(""),[d,p]=(0,s.useState)(null),[m,h]=(0,s.useState)(""),[u,x]=(0,s.useState)(!1);async function f(e){e.preventDefault(),x(!0),p(null);try{let e=await fetch("/api/mines/portfolio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_id:i,portfolio_name:r})}),s=await e.json();if(e.ok)if((null==s?void 0:s.status)==="approval_required")p("pending"),h("Import queued for approval. Visit the Approvals page to authorize it.");else if((null==s?void 0:s.status)==="ok"){var t,a;let e=null!=(t=s.entries_created)?t:0,i=null!=(a=s.entries_updated)?a:0;p("success"),h("Imported ".concat(e," new and ").concat(i," updated entries.")),"function"==typeof l&&l()}else p("error"),h((null==s?void 0:s.reason)||(null==s?void 0:s.error)||(null==s?void 0:s.status)||"Import failed. Check the file ID and try again.");else p("error"),h((null==s?void 0:s.error)||"Import failed. Check the file ID and try again.")}catch(e){p("error"),h("Network error. Please check your connection and try again.")}finally{x(!1)}}return(0,a.jsxs)("div",{role:"region","aria-label":"Import catalog",style:{border:"1px solid rgba(17,19,24,.10)",borderRadius:14,background:"#fff",padding:"16px 18px",marginTop:12,boxShadow:"0 8px 24px rgba(17,19,24,.08)"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:14},children:[(0,a.jsx)("span",{style:{fontSize:13,fontWeight:750,color:"#111318",letterSpacing:"-.01em"},children:"Import catalog"}),(0,a.jsx)("button",{onClick:t,"aria-label":"Close import form",style:{border:0,background:"transparent",cursor:"pointer",color:"#68707b",display:"grid",placeItems:"center",width:24,height:24,borderRadius:6},children:(0,a.jsx)(c,{})})]}),"pending"===d&&(0,a.jsxs)("div",{className:"mkt-toast info",role:"status",style:{marginBottom:12},children:[(0,a.jsx)("span",{children:"Pending"}),(0,a.jsx)("p",{children:m})]}),"success"===d&&(0,a.jsxs)("div",{className:"mkt-toast success",role:"status",style:{marginBottom:12},children:[(0,a.jsx)("span",{children:"Imported"}),(0,a.jsx)("p",{children:m})]}),"error"===d&&(0,a.jsxs)("div",{className:"mkt-toast error",role:"alert",style:{marginBottom:12},children:[(0,a.jsx)("span",{children:"Error"}),(0,a.jsx)("p",{children:m})]}),"pending"!==d&&"success"!==d&&(0,a.jsxs)("form",{onSubmit:f,className:"admin-form-grid",style:{gap:10},children:[(0,a.jsxs)("div",{className:"admin-field",children:[(0,a.jsx)("span",{children:"File ID"}),(0,a.jsx)("input",{type:"text",required:!0,placeholder:"e.g. file_abc123",value:i,onChange:e=>n(e.target.value),autoComplete:"off"})]}),(0,a.jsxs)("div",{className:"admin-field",children:[(0,a.jsx)("span",{children:"Portfolio name"}),(0,a.jsx)("input",{type:"text",required:!0,placeholder:"e.g. SPM Tabla Proyectos Q2",value:r,onChange:e=>o(e.target.value),autoComplete:"off"})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:4},children:[(0,a.jsx)("button",{type:"button",onClick:t,className:"admin-btn-sm",children:"Cancel"}),(0,a.jsx)("button",{type:"submit",disabled:u||!i.trim()||!r.trim(),className:"admin-btn-primary","aria-busy":u,children:u?"Importing…":"Import"})]})]})]})}let m=[{value:"",label:"Any completeness"},{value:"full",label:"Full"},{value:"partial",label:"Partial"},{value:"low",label:"Low"}],h=[{value:"name",label:"Name"},{value:"commodity",label:"Commodity"},{value:"data_completeness",label:"Completeness"}];function u(e){let{filters:t,onChange:l}=e;return(0,a.jsxs)("div",{role:"search","aria-label":"Portfolio filters",style:{display:"flex",flexWrap:"wrap",gap:10,alignItems:"flex-end",padding:"14px 16px",background:"rgba(245,246,248,.72)",borderRadius:14,border:"1px solid rgba(17,19,24,.07)",marginBottom:16},children:[(0,a.jsxs)("label",{className:"admin-field",style:{minWidth:140,flex:"1 1 140px"},children:[(0,a.jsx)("span",{children:"Commodity"}),(0,a.jsx)("input",{type:"text",placeholder:"e.g. gold, copper",value:t.commodity,onChange:e=>l({...t,commodity:e.target.value,offset:0}),"aria-label":"Filter by commodity"})]}),(0,a.jsxs)("label",{className:"admin-field",style:{minWidth:140,flex:"1 1 140px"},children:[(0,a.jsx)("span",{children:"Deposit type"}),(0,a.jsx)("input",{type:"text",placeholder:"e.g. porphyry",value:t.deposit_type,onChange:e=>l({...t,deposit_type:e.target.value,offset:0}),"aria-label":"Filter by deposit type"})]}),(0,a.jsxs)("label",{className:"admin-field",style:{minWidth:130,flex:"0 0 auto"},children:[(0,a.jsx)("span",{children:"Completeness"}),(0,a.jsx)("select",{className:"admin-select",value:t.data_completeness,onChange:e=>l({...t,data_completeness:e.target.value,offset:0}),"aria-label":"Filter by data completeness",children:m.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:6,flex:"0 0 auto"},children:[(0,a.jsx)("span",{style:{fontSize:10.5,fontWeight:850,letterSpacing:".10em",textTransform:"uppercase",color:"#68707b"},children:"Has drilling"}),(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer",height:38,padding:"0 10px",border:"1px solid rgba(17,19,24,.10)",borderRadius:12,background:"#fff",userSelect:"none"},children:[(0,a.jsx)("input",{type:"checkbox",checked:t.has_drilling,onChange:e=>l({...t,has_drilling:e.target.checked,offset:0}),style:{accentColor:"#111318",width:14,height:14},"aria-label":"Show only drilled projects"}),(0,a.jsx)("span",{style:{fontSize:12.5,color:"#313740"},children:"Drilled only"})]})]}),(0,a.jsxs)("label",{className:"admin-field",style:{minWidth:130,flex:"0 0 auto",marginLeft:"auto"},children:[(0,a.jsx)("span",{children:"Sort by"}),(0,a.jsx)("select",{className:"admin-select",value:t.sort,onChange:e=>l({...t,sort:e.target.value,offset:0}),"aria-label":"Sort portfolio",children:h.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})}let x={commodity:"",deposit_type:"",has_drilling:!1,data_completeness:"",sort:"name",offset:0};function f(){var e,t;let l=(0,i.useRouter)(),[c,m]=(0,s.useState)(x),[h,f]=(0,s.useState)(null),[g,j]=(0,s.useState)(!0),[y,b]=(0,s.useState)(null),[v,k]=(0,s.useState)(!1),w=(0,s.useCallback)(async e=>{j(!0),b(null);try{let t=new URLSearchParams;e.commodity.trim()&&t.set("commodity",e.commodity.trim()),e.deposit_type.trim()&&t.set("deposit_type",e.deposit_type.trim()),e.has_drilling&&t.set("has_drilling","1"),e.data_completeness&&t.set("data_completeness",e.data_completeness),t.set("sort",e.sort),t.set("limit",String(50)),t.set("offset",String(e.offset));let l=await fetch("/api/mines/portfolio?".concat(t.toString()));if(!l.ok){let e=await l.json().catch(()=>({}));throw Error((null==e?void 0:e.error)||"Request failed (HTTP ".concat(l.status,")"))}let a=await l.json();f(a)}catch(e){b(e.message||"Failed to load portfolio")}finally{j(!1)}},[]);function S(e){l.push("/mines/".concat(e.id))}(0,s.useEffect)(()=>{w(c)},[c,w]);let N=null!=(e=null==h?void 0:h.data)?e:[],C=null!=(t=null==h?void 0:h.meta)?t:{total:0,filtered:0,limit:50,offset:0},_=C.offset+N.length<C.filtered,I=C.offset>0;return(0,a.jsxs)("div",{className:"mkt-page","data-page":"mines-portfolio",children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:16,marginBottom:8},children:[(0,a.jsx)("div",{}),(0,a.jsx)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:(0,a.jsxs)("button",{onClick:()=>k(e=>!e),className:"admin-button secondary","aria-expanded":v,"aria-controls":"import-form-panel",children:[(0,a.jsx)(r,{}),"Import catalog"]})})]}),v&&(0,a.jsx)("div",{id:"import-form-panel",children:(0,a.jsx)(p,{onClose:()=>k(!1),onImported:()=>w(c)})}),h&&(0,a.jsx)("div",{style:{display:"flex",gap:0,marginTop:12,marginBottom:20,borderTop:"1px solid rgba(17,19,24,.10)",borderBottom:"1px solid rgba(17,19,24,.10)",padding:"16px 0"},children:[{label:"Total projects",value:C.total},{label:"Showing",value:C.filtered}].map(e=>{let{label:t,value:l}=e;return(0,a.jsxs)("div",{style:{paddingRight:32,marginRight:32,borderRight:"1px solid rgba(17,19,24,.07)"},children:[(0,a.jsx)("b",{style:{display:"block",fontSize:34,fontWeight:300,letterSpacing:"-.05em",lineHeight:1},children:l}),(0,a.jsx)("span",{style:{display:"block",marginTop:8,fontSize:10.5,fontWeight:650,letterSpacing:".14em",textTransform:"uppercase",color:"#8a8f99"},children:t})]},t)})}),(0,a.jsx)(u,{filters:c,onChange:m}),g&&(0,a.jsx)("div",{className:"admin-empty","aria-live":"polite","aria-busy":"true",style:{minHeight:180,display:"grid",placeItems:"center"},children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"skel",style:{width:120,height:12,borderRadius:8,marginBottom:10}}),(0,a.jsx)("div",{className:"skel",style:{width:220,height:10,borderRadius:6}})]})}),!g&&y&&(0,a.jsxs)("div",{className:"admin-record needs-action",role:"alert",children:[(0,a.jsx)("div",{className:"admin-record-top",children:(0,a.jsx)("b",{children:"Failed to load portfolio"})}),(0,a.jsx)("p",{children:y}),(0,a.jsx)("div",{className:"admin-inline-actions",children:(0,a.jsx)("button",{className:"admin-btn-sm",onClick:()=>w(c),children:"Retry"})})]}),!g&&!y&&0===C.total&&(0,a.jsxs)("div",{className:"admin-empty",style:{minHeight:240,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12},children:[(0,a.jsx)("div",{style:{width:40,height:40,borderRadius:12,background:"rgba(17,19,24,.06)",display:"grid",placeItems:"center",color:"#68707b",marginBottom:4},children:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 7h18M3 12h18M3 17h18",strokeLinecap:"round"})})}),(0,a.jsx)("b",{style:{fontSize:15,letterSpacing:"-.015em"},children:"No catalog imported yet"}),(0,a.jsx)("p",{style:{margin:0,maxWidth:320,textAlign:"center",lineHeight:1.6},children:"Use “Import catalog” to load your SPM tabla proyectos spreadsheet."}),(0,a.jsxs)("button",{className:"admin-button mars",style:{marginTop:4},onClick:()=>k(!0),children:[(0,a.jsx)(r,{}),"Import catalog"]})]}),!g&&!y&&C.total>0&&0===N.length&&(0,a.jsxs)("div",{className:"admin-empty",role:"status",children:[(0,a.jsx)("b",{children:"No results"}),(0,a.jsx)("p",{children:"No projects match the current filters. Clear filters to see all entries."})]}),!g&&!y&&N.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"admin-table-wrap",children:(0,a.jsxs)("table",{className:"admin-table","aria-label":"Portfolio screening table",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{scope:"col",style:{width:44},children:"#"}),(0,a.jsx)("th",{scope:"col",children:"Project"}),(0,a.jsx)("th",{scope:"col",children:"Commodity"}),(0,a.jsx)("th",{scope:"col",children:"Deposit / Target type"}),(0,a.jsx)("th",{scope:"col",style:{width:88},children:"Drilling"}),(0,a.jsx)("th",{scope:"col",style:{width:100},children:"Completeness"}),(0,a.jsx)("th",{scope:"col",children:"Deal terms"}),(0,a.jsx)("th",{scope:"col",children:"Available information"})]})}),(0,a.jsx)("tbody",{children:N.map(e=>{var t;return(0,a.jsxs)("tr",{onClick:()=>S(e),style:{cursor:"pointer",transition:"background .12s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(17,19,24,.025)",onMouseLeave:e=>e.currentTarget.style.background="",tabIndex:0,"aria-label":"Open ".concat(e.name),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&S(e)},children:[(0,a.jsx)("td",{style:{color:"#9aa0aa",fontVariantNumeric:"tabular-nums",fontFamily:"ui-monospace, monospace",fontSize:11},children:null!=(t=e.consecutive)?t:"—"}),(0,a.jsxs)("td",{children:[(0,a.jsx)("b",{style:{fontSize:12.5,letterSpacing:"-.01em"},children:e.name||"—"}),e.owner?(0,a.jsx)("small",{style:{display:"block",color:"#7a818c",marginTop:2},children:e.owner}):null]}),(0,a.jsx)("td",{children:(0,a.jsx)("span",{style:{fontSize:12.5,color:"#313740"},children:e.commodity||(0,a.jsx)("span",{className:"admin-muted",children:"—"})})}),(0,a.jsx)("td",{children:(0,a.jsx)("span",{style:{fontSize:12.5,color:"#313740"},children:e.deposit_type||(0,a.jsx)("span",{className:"admin-muted",children:"—"})})}),(0,a.jsx)("td",{children:e.has_drilling?(0,a.jsx)("span",{className:"admin-pill ready",children:"Yes"}):(0,a.jsx)("span",{className:"admin-pill neutral",children:"No"})}),(0,a.jsx)("td",{children:(0,a.jsx)(n,{value:e.data_completeness})}),(0,a.jsx)("td",{children:e.deal_terms?(0,a.jsx)("span",{title:e.deal_terms,style:{fontSize:12.5,color:"#555d68",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",maxWidth:200},children:e.deal_terms}):(0,a.jsx)("span",{className:"admin-muted",children:"—"})}),(0,a.jsx)("td",{children:e.available_information?(0,a.jsx)("span",{title:e.available_information,style:{fontSize:12.5,color:"#555d68",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",maxWidth:200},children:e.available_information}):(0,a.jsx)("span",{className:"admin-muted",children:"—"})})]},e.id)})})]})}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:16,gap:12},children:[(0,a.jsxs)("span",{style:{fontSize:12,color:"#68707b"},children:["Showing ",C.offset+1,"–",C.offset+N.length," of ",C.filtered,C.filtered!==C.total?" (".concat(C.total," total)"):""]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsxs)("button",{className:"admin-btn-sm",onClick:function(){m(e=>({...e,offset:Math.max(0,e.offset-50)}))},disabled:!I,"aria-label":"Previous page",children:[(0,a.jsx)(o,{}),"Prev"]}),(0,a.jsxs)("button",{className:"admin-btn-sm",onClick:function(){h&&m(e=>({...e,offset:e.offset+50}))},disabled:!_,"aria-label":"Next page",children:["Next",(0,a.jsx)(d,{})]})]})]})]})]})}}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=3947)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,72,167,178,232,332,489,497,552,658,723,767,769,796,870,888,939,972,1053,1115,1177,1426,1523,1557,1562,1581,1672,1851,1990,2008,2139,2153,2162,2164,2175,2254,2334,2343,2433,2635,2640,2711,2726,2748,2837,2873,2943,3033,3076,3159,3190,3203,3395,3437,3465,3492,3499,3554,3558,3577,3629,3630,3641,3659,3745,3756,3802,3839,3870,3886,3904,3905,3942,3975,3976,4094,4095,4104,4115,4190,4204,4209,4218,4229,4231,4269,4373,4410,4431,4475,4507,4519,4530,4537,4662,4721,4819,4890,4999,5049,5085,5092,5098,5118,5120,5130,5169,5180,5207,5223,5289,5324,5331,5441,5520,5551,5588,5610,5689,5707,5722,5743,5794,5810,5850,5887,5903,5906,6002,6079,6113,6147,6186,6234,6278,6279,6341,6365,6403,6456,6496,6591,6595,6621,6667,6701,6725,6779,6799,6816,6862,7020,7060,7070,7092,7113,7237,7276,7324,7361,7440,7750,7765,7795,7823,7903,7920,7986,8059,8093,8100,8159,8227,8252,8273,8298,8312,8397,8401,8405,8578,8591,8665,8679,8732,8765,8828,8887,8907,8994,9e3,9037,9040,9154,9160,9183,9413,9442,9504,9554,9628,9873],{4441:()=>{}},_=>{_.O(0,[8441,1255,7358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1553,2141,2494,2866,5022,6605,7423,7916,8580,8601,9840,9975],{677:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var c=a(5155),r=a(2115);function o(){let[e,t]=(0,r.useState)([]),[a,o]=(0,r.useState)("");return(0,r.useEffect)(()=>{o(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>t(e.projects||[])).catch(()=>{})},[]),(0,c.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,c.jsxs)("select",{value:a,onChange:e=>{var t;o(t=e.target.value),t?localStorage.setItem("madarx.activeProjectId",t):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:t||null}}))},"aria-label":"Active project",children:[(0,c.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,c.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},6146:(e,t,a)=>{Promise.resolve().then(a.bind(a,677))}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=6146)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,72,167,178,232,332,489,497,552,658,723,767,769,796,870,888,939,972,1053,1115,1177,1426,1523,1557,1562,1581,1672,1851,1990,2008,2139,2153,2162,2164,2175,2254,2334,2343,2433,2635,2640,2711,2726,2748,2837,2873,2943,3033,3076,3159,3190,3203,3395,3437,3465,3492,3499,3554,3558,3577,3629,3630,3641,3659,3745,3756,3802,3839,3870,3886,3904,3905,3942,3975,3976,4094,4095,4104,4115,4190,4204,4209,4218,4229,4231,4269,4373,4410,4431,4475,4507,4519,4530,4537,4662,4721,4819,4890,4999,5049,5085,5092,5098,5118,5120,5130,5169,5180,5207,5223,5289,5324,5331,5441,5520,5551,5588,5610,5689,5707,5722,5743,5794,5810,5850,5887,5903,5906,6002,6079,6113,6147,6186,6234,6278,6279,6341,6365,6403,6456,6496,6591,6595,6621,6667,6701,6725,6779,6799,6816,6862,7020,7060,7070,7092,7113,7237,7276,7324,7361,7440,7750,7765,7795,7823,7903,7920,7986,8059,8093,8100,8159,8227,8252,8273,8298,8312,8397,8401,8405,8578,8591,8665,8679,8732,8765,8828,8887,8907,8994,9e3,9037,9040,9154,9160,9183,9413,9442,9504,9554,9628,9873],{4441:()=>{}},_=>{_.O(0,[8441,1255,7358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5295],{63:(e,t,a)=>{"use strict";var n=a(7260);a.o(n,"usePathname")&&a.d(t,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(t,{useRouter:function(){return n.useRouter}}),a.o(n,"useSearchParams")&&a.d(t,{useSearchParams:function(){return n.useSearchParams}})},677:(e,t,a)=>{"use strict";a.d(t,{default:()=>r});var n=a(5155),i=a(2115);function r(){let[e,t]=(0,i.useState)([]),[a,r]=(0,i.useState)("");return(0,i.useEffect)(()=>{r(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>t(e.projects||[])).catch(()=>{})},[]),(0,n.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,n.jsxs)("select",{value:a,onChange:e=>{var t;r(t=e.target.value),t?localStorage.setItem("madarx.activeProjectId",t):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:t||null}}))},"aria-label":"Active project",children:[(0,n.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},2447:(e,t,a)=>{Promise.resolve().then(a.bind(a,677)),Promise.resolve().then(a.bind(a,7057))},7057:(e,t,a)=>{"use strict";a.d(t,{default:()=>s});var n=a(5155),i=a(2115),r=a(63);function s(e){let{email:t="",pendingInvites:a=[]}=e,s=(0,r.useRouter)(),[o,c]=(0,i.useState)(""),[l,d]=(0,i.useState)(""),[h,m]=(0,i.useState)(""),[u,p]=(0,i.useState)("");async function g(e){e.preventDefault(),p(""),m("create");try{let e=o.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"org",t=await fetch("/api/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.trim(),slug:e})});if(!t.ok)throw Error((await t.json().catch(()=>({}))).error||"Could not create organization");s.push("/"),s.refresh()}catch(e){p(e.message)}finally{m("")}}async function v(e){e.preventDefault(),p(""),m("join");try{let e=await fetch("/api/orgs/join",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l.trim()})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.message||"This invite is invalid or has expired.");s.push("/"),s.refresh()}catch(e){p(e.message)}finally{m("")}}async function j(){p(""),m("accept");try{let e=await fetch("/api/orgs/invites/pending",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.message||t.error||"Couldn't accept the invite.");s.push("/"),s.refresh()}catch(e){p(e.message)}finally{m("")}}return(0,i.useEffect)(()=>{let e="";try{e=sessionStorage.getItem("madarx_pending_invite_token")||""}catch(e){}if(e){try{sessionStorage.removeItem("madarx_pending_invite_token")}catch(e){}m("join"),fetch("/api/orgs/join",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.message||"This invite is no longer valid.");s.push("/"),s.refresh()}).catch(e=>p(e.message)).finally(()=>m(""))}},[s]),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,maxWidth:560},children:[u?(0,n.jsx)("div",{className:"admin-panel",role:"alert",style:{borderColor:"var(--accent-500)"},children:u}):null,a.length>0?(0,n.jsxs)("div",{className:"admin-panel",children:[(0,n.jsx)("div",{className:"admin-panel-head",children:"Pending invitations"}),a.map(e=>(0,n.jsxs)("div",{className:"admin-record",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:e.org_name||e.org_id})," invited you \xb7 ",e.role]}),(0,n.jsx)("button",{className:"admin-btn-primary admin-btn-sm",disabled:"accept"===h,onClick:j,children:"accept"===h?"Joining…":"Accept"})]},e.id))]}):null,(0,n.jsxs)("form",{className:"admin-panel",onSubmit:g,children:[(0,n.jsx)("div",{className:"admin-panel-head",children:"Create an organization"}),(0,n.jsx)("p",{className:"account-meta",children:"Start fresh. You'll be the owner."}),(0,n.jsx)("label",{htmlFor:"org-name",style:{display:"block",marginBottom:6},children:"Organization name"}),(0,n.jsx)("input",{id:"org-name",value:o,onChange:e=>c(e.target.value),placeholder:"Acme Robotics",required:!0,style:{width:"100%",marginBottom:12}}),(0,n.jsx)("button",{className:"admin-btn-primary",type:"submit",disabled:"create"===h||!o.trim(),children:"create"===h?"Creating…":"Create org →"})]}),(0,n.jsxs)("form",{className:"admin-panel",onSubmit:v,children:[(0,n.jsx)("div",{className:"admin-panel-head",children:"Join with an invite"}),(0,n.jsx)("p",{className:"account-meta",children:"Paste an invite code, or open the invite link you were sent."}),(0,n.jsx)("label",{htmlFor:"invite-code",style:{display:"block",marginBottom:6},children:"Invite code"}),(0,n.jsx)("input",{id:"invite-code",value:l,onChange:e=>d(e.target.value),placeholder:"paste invite code",style:{width:"100%",marginBottom:12}}),(0,n.jsx)("button",{className:"admin-btn-primary",type:"submit",disabled:"join"===h||!l.trim(),children:"join"===h?"Joining…":"Join →"})]})]})}}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=2447)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9566],{5136:(e,s,_)=>{Promise.resolve().then(_.bind(_,8))}},e=>{e.O(0,[2619,8,8441,1255,7358],()=>e(e.s=5136)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,72,167,178,232,332,489,497,552,658,723,767,769,796,870,888,939,972,1053,1115,1177,1426,1523,1557,1562,1581,1672,1851,1990,2008,2139,2153,2162,2164,2175,2254,2334,2343,2433,2635,2640,2711,2726,2748,2837,2873,2943,3033,3076,3159,3190,3203,3395,3437,3465,3492,3499,3554,3558,3577,3629,3630,3641,3659,3745,3756,3802,3839,3870,3886,3904,3905,3942,3975,3976,4094,4095,4104,4115,4190,4204,4209,4218,4229,4231,4269,4373,4410,4431,4475,4507,4519,4530,4537,4662,4721,4819,4890,4999,5049,5085,5092,5098,5118,5120,5130,5169,5180,5207,5223,5289,5324,5331,5441,5520,5551,5588,5610,5689,5707,5722,5743,5794,5810,5850,5887,5903,5906,6002,6079,6113,6147,6186,6234,6278,6279,6341,6365,6403,6456,6496,6591,6595,6621,6667,6701,6725,6779,6799,6816,6862,7020,7060,7070,7092,7113,7237,7276,7324,7361,7440,7750,7765,7795,7823,7903,7920,7986,8059,8093,8100,8159,8227,8252,8273,8298,8312,8397,8401,8405,8578,8591,8665,8679,8732,8765,8828,8887,8907,8994,9e3,9037,9040,9154,9160,9183,9413,9442,9504,9554,9628,9873],{4441:()=>{}},_=>{_.O(0,[8441,1255,7358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1553,2141,2494,2866,5022,6605,7423,7916,8580,8601,9840,9975],{677:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var c=a(5155),r=a(2115);function o(){let[e,t]=(0,r.useState)([]),[a,o]=(0,r.useState)("");return(0,r.useEffect)(()=>{o(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>t(e.projects||[])).catch(()=>{})},[]),(0,c.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,c.jsxs)("select",{value:a,onChange:e=>{var t;o(t=e.target.value),t?localStorage.setItem("madarx.activeProjectId",t):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:t||null}}))},"aria-label":"Active project",children:[(0,c.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,c.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},6146:(e,t,a)=>{Promise.resolve().then(a.bind(a,677))}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=6146)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{2930:(e,t,n)=>{Promise.resolve().then(n.bind(n,7688))},3247:(e,t,n)=>{"use strict";n.d(t,{q:()=>r,r:()=>l});var a=n(2115);let s="madarx:main-agent-draft:v1";function i(e){try{let t=String(e||"");t.trim()?window.localStorage.setItem(s,t):window.localStorage.removeItem(s)}catch(e){}}function r(){try{window.localStorage.removeItem(s)}catch(e){}}function l(){let[e,t]=(0,a.useState)("");return(0,a.useEffect)(()=>{let e=function(){try{return window.localStorage.getItem(s)||""}catch(e){return""}}();e&&t(t=>t||e)},[]),(0,a.useEffect)(()=>{let t=window.setTimeout(()=>i(e),250);return()=>window.clearTimeout(t)},[e]),(0,a.useEffect)(()=>{let t=()=>i(e);return window.addEventListener("pagehide",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("pagehide",t),document.removeEventListener("visibilitychange",t)}},[e]),{prompt:e,setPrompt:t}}},7355:(e,t,n)=>{"use strict";n.d(t,{q:()=>v,M:()=>j});var a=n(5155),s=n(2115);async function i(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(await n.text());return n.json()}let r={width:900,height:620};function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=Math.max(1,e.length),a=Math.max(320,t.width||900),s=Math.max(360,t.height||620),i=a<640?10:16,l=a<640?10:14,{cols:o,rows:c}=a<640?{cols:1,rows:n}:n<=1?{cols:1,rows:1}:n<=3?{cols:n,rows:1}:n<=4?{cols:2,rows:2}:n<=6?{cols:3,rows:2}:n<=8?{cols:4,rows:2}:{cols:Math.ceil(n/2),rows:2},d=Math.max(280*o,a-2*i-l*(o-1)),u=Math.max(180*c,s-2*i-l*(c-1)),h=Math.floor(d/o),m=Math.floor(u/c),p=d-h*o,f=u-m*c;return e.map((e,t)=>{let n=t%o,a=Math.floor(t/o);return{x:i+n*(h+l),y:i+a*(m+l),width:Math.max(280,h+(n===o-1?p:0)),height:Math.max(180,m+(a===c-1?f:0))}})}var o=n(8219);let c="madarx:spaces-v1",d={id:"default",name:"main",is_active:!0},u="madarx:last-chat-session-id:v1";function h(e){try{e?window.localStorage.setItem(u,e):window.localStorage.removeItem(u)}catch(e){}}function m(){try{return window.localStorage.getItem(u)}catch(e){return null}}var p=n(3247);let f=[{key:"claude-code",label:"Local CLI"},{key:"codex",label:"Local CLI"},{key:"ollama",label:"Ollama"},{key:"anthropic",label:"Anthropic"}],g=["claude-code","codex","ollama","anthropic"],x=(0,s.createContext)(null);function v(e){let{children:t}=e,n=function(){let[e,t]=(0,s.useState)(null),[n,a]=(0,s.useState)([{role:"agent",text:"Fresh workspace ready. I am the madarX Main Agent. No demo agents, cron jobs, reports, or old runtime data are loaded. Tell me what to create first."}]),[u,x]=(0,s.useState)({model:"",input:0,output:0,cache_read:0,cache_creation:0,context:0}),[v,j]=(0,s.useState)(null),[w,b]=(0,s.useState)(null),[y,k]=(0,s.useState)(!1),[N,S]=(0,s.useState)(!1),[_,C]=(0,s.useState)(()=>{try{return localStorage.getItem("madarx:selected-project")||"personal"}catch(e){return"personal"}}),E=(0,s.useCallback)(e=>{C(e);try{e?localStorage.setItem("madarx:selected-project",e):localStorage.removeItem("madarx:selected-project")}catch(e){}},[]),[L,M]=(0,s.useState)(!1),I=function(){let[e,t]=(0,s.useState)(!1),[n,a]=(0,s.useState)("instructions"),[r,l]=(0,s.useState)(""),[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)([]),[h,m]=(0,s.useState)({}),[p,f]=(0,s.useState)(!1),[g,x]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[w,b]=(0,s.useState)([]),[y,k]=(0,s.useState)(!1),[N,S]=(0,s.useState)({}),[_,C]=(0,s.useState)(!1),[E,L]=(0,s.useState)("balanced");async function M(){try{let e=await i("/api/secrets");b(e.secrets||[])}catch(e){}}async function I(){try{let e=await i("/api/tool-allowlists");S(e.allowlists||{})}catch(e){}}async function A(){var e;t(!0),k(!0),C(!0);let[n,a,s,r]=await Promise.all([i("/api/config"),i("/api/config/env"),i("/api/secrets").catch(()=>({secrets:[]})),i("/api/tool-allowlists").catch(()=>({allowlists:{}}))]);l(n.instructions),c(n.tools||[]),u(a.env||[]),m({}),x(!1),L(null!=(e=n.designStyle)?e:"balanced"),b(s.secrets||[]),k(!1),S(r.allowlists||{}),C(!1)}async function D(e,t){c(n=>n.map(n=>n.name===e.name?{...n,enabled:t}:n));try{let n=await fetch("/api/tools/".concat(encodeURIComponent(e.name)),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!n.ok)throw Error(await n.text());let a=await n.json();c(t=>t.map(t=>t.name===e.name?a.tool:t))}catch(t){c(t=>t.map(t=>t.name===e.name?{...t,enabled:e.enabled}:t))}}async function T(){let e=Object.fromEntries(Object.entries(h).filter(e=>{let[,t]=e;return String(t||"").trim()}));if(Object.keys(e).length){f(!0),x(!1);try{let t=await fetch("/api/config/env",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({values:e})});if(!t.ok)throw Error(await t.text());let n=await t.json();u(n.env||[]),m({}),x(!0);let a=await i("/api/config");c(a.tools||[])}finally{f(!1)}}}async function R(){j(!0);try{await fetch("/api/config",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({instructions:r})})}finally{j(!1)}}async function O(e){L(e),await fetch("/api/config",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({designStyle:e})})}return{configOpen:e,setConfigOpen:t,configTab:n,setConfigTab:a,configInstructions:r,setConfigInstructions:l,configTools:o,setConfigTools:c,configEnv:d,setConfigEnv:u,configEnvValues:h,setConfigEnvValues:m,configEnvSaving:p,configEnvSaved:g,setConfigEnvSaved:x,configSaving:v,secrets:w,secretsLoading:y,allowlists:N,allowlistsLoading:_,designStyle:E,setDesignStyle:L,openConfig:A,saveInstructions:R,saveDesignStyle:O,saveEnvValues:T,toggleTool:D,handleAddSecret:async function(e){let{name:t,value:n,scope:a}=e,s=await fetch("/api/secrets",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,value:n,scope:a})});if(!s.ok)throw Error(await s.text()||"Failed to save secret");await M()},handleRotateSecret:async function(e,t,n){let a=await fetch("/api/secrets/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({value:t,scope:n})});if(!a.ok)throw Error(await a.text()||"Failed to rotate secret");await M()},handleDeleteSecret:async function(e,t){let n="/api/secrets/".concat(encodeURIComponent(e),"?scope=").concat(encodeURIComponent(t||"global")),a=await fetch(n,{method:"DELETE"});if(!a.ok)throw Error(await a.text()||"Failed to delete secret");await M()},handleAddAllowlistEntry:async function(e){let{tool_name:t,scope_key:n,scope_value:a,label:s}=e,i=await fetch("/api/tool-allowlists",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tool_name:t,scope_key:n,scope_value:a,label:s})});if(!i.ok)throw Error(await i.text()||"Failed to add allowlist entry");await I()},handleRemoveAllowlistEntry:async function(e){let t=await fetch("/api/tool-allowlists/".concat(encodeURIComponent(e)),{method:"DELETE"});if(!t.ok)throw Error(await t.text()||"Failed to remove allowlist entry");await I()}}}(),A=function(){let[e,t]=(0,s.useState)("approval_required"),[n,a]=(0,s.useState)(!1),[i,r]=(0,s.useState)(!1);async function l(e){a(!0);try{let n=await fetch("/api/settings/trust-mode",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e,confirm:"auto"===e})});if(!n.ok)throw Error(await n.text());let a=await n.json();t(a.mode||e)}catch(e){}finally{a(!1)}}async function o(){await l("auto"),r(!1)}return{trustMode:e,setTrustMode:t,trustModeBusy:n,trustModePromptOpen:i,applyTrustMode:l,toggleTrustMode:function(){let t="auto"===e?"approval_required":"auto";if("auto"===t)return void r(!0);l(t)},confirmEnableTrustMode:o,cancelEnableTrustMode:function(){r(!1)}}}(),D=function(){let[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)([]),[i,r]=(0,s.useState)(!1),l=(0,s.useMemo)(()=>g.reduce((e,t)=>{var a,s;let i=n.filter(e=>e.engine===t);return i.length&&e.push({engine:t,label:null!=(s=null==(a=f.find(e=>e.key===t))?void 0:a.label)?s:t,items:i}),e},[]),[n]),o=(0,s.useCallback)(async e=>{t(e),r(!1),await fetch("/api/config",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({model:e})})},[t,r]);return{selectedModel:e,setSelectedModel:t,models:n,setModels:a,modelOpen:i,setModelOpen:r,grouped:l,pickModel:o}}(),{selectedModel:T,setSelectedModel:R}=D,O=(null==T?void 0:T.startsWith("claude-"))?2e5:32768,P=Math.min(100,Math.round((u.context||0)/O*100));async function z(e){t(await i(_?"/api/state?project_id=".concat(encodeURIComponent(_)):"/api/state",e?{signal:e}:void 0))}let W=function(){let{onArtifactMoved:e,refresh:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,a]=(0,s.useState)([d]),[i,r]=(0,s.useState)(d.id),[l,o]=(0,s.useState)(!1),[u,h]=(0,s.useState)(!1),m=(0,s.useRef)(null),p=(0,s.useRef)(e),f=(0,s.useRef)(t);p.current=e,f.current=t,(0,s.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){try{var t,n,s;let i=await fetch("/api/dashboard/spaces",{cache:"no-store"}).then(e=>e.json()).catch(()=>null),l=i&&Array.isArray(i.spaces)&&1===i.spaces.length&&(null==(t=i.spaces[0])?void 0:t.id)==="default"&&0===((null==(s=i.spaces[0])||null==(n=s.artifact_ids)?void 0:n.length)||0)?function(){try{let e=localStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);if(!t||!Array.isArray(t.spaces)||0===t.spaces.length)return null;let n=t.spaces.filter(e=>e&&"string"==typeof e.id).map(e=>({id:String(e.id),name:String(e.name||"Space"),artifactIds:Array.isArray(e.artifactIds)?e.artifactIds.map(String):[]}));if(0===n.length)return null;let a=n.some(e=>e.id===t.activeSpaceId)?t.activeSpaceId:n[0].id;return{spaces:n,activeSpaceId:a}}catch(e){return null}}():null,o=i;if(l){let e=await fetch("/api/dashboard/spaces/import",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({spaces:l.spaces,active_space_id:l.activeSpaceId})}).then(e=>e.json()).catch(()=>null);if(e&&e.imported){o=e;try{localStorage.removeItem(c)}catch(e){}}}if(e)return;let u=function(e){if(!e||!Array.isArray(e.spaces)||0===e.spaces.length)return{spaces:[d],activeSpaceId:d.id};let t=e.spaces.map(e=>({id:String(e.id),name:String(e.name||"Space"),is_active:!!e.is_active})),n=e.active_space_id&&t.some(t=>t.id===e.active_space_id)?String(e.active_space_id):t[0].id;return{spaces:t,activeSpaceId:n}}(o);a(u.spaces),r(u.activeSpaceId)}catch(t){if(e)return;a([d]),r(d.id)}finally{e||h(!0)}}(),()=>{e=!0}},[]);let g=(0,s.useCallback)(e=>{r(e),fetch("/api/dashboard/spaces/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({is_active:!0})}).catch(()=>{})},[]),x=(0,s.useCallback)(e=>{e!==i&&n.some(t=>t.id===e)&&(m.current&&(clearTimeout(m.current),m.current=null),o(!0),m.current=setTimeout(()=>{g(e),m.current=setTimeout(()=>{o(!1),m.current=null},20)},Math.floor(110)))},[i,n,g]),v=(0,s.useCallback)(async()=>{let e="Space ".concat(n.length+1);try{let t=await fetch("/api/dashboard/spaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e})}),n=await t.json().catch(()=>({}));if(!t.ok||!(null==n?void 0:n.space))return null;let s={id:String(n.space.id),name:n.space.name,is_active:!1};return a(e=>[...e,s]),m.current&&(clearTimeout(m.current),m.current=null),o(!0),m.current=setTimeout(()=>{g(s.id),m.current=setTimeout(()=>{o(!1),m.current=null},20)},Math.floor(110)),s.id}catch(e){return null}},[n.length,g]),j=(0,s.useCallback)((e,t)=>{let n=String(t||"").trim().slice(0,32);n&&(a(t=>t.map(t=>t.id===e?{...t,name:n}:t)),fetch("/api/dashboard/spaces/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({name:n})}).catch(()=>{}))},[]),w=(0,s.useCallback)(e=>{let t=null;a(n=>{var a;if(n.length<=1)return n;let s=n.filter(t=>t.id!==e);return s.length===n.length?n:(t=(null==(a=s[0])?void 0:a.id)||null,s)}),fetch("/api/dashboard/spaces/".concat(encodeURIComponent(e)),{method:"DELETE"}).then(()=>{var e;return null==(e=f.current)?void 0:e.call(f)}).catch(()=>{}),i===e&&t&&x(t)},[i,x]),b=(0,s.useCallback)((e,t)=>{var a;n.some(e=>e.id===t)&&(null==(a=p.current)||a.call(p,e,t),fetch("/api/dashboard/spaces/".concat(encodeURIComponent(t),"/move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({artifact_id:e})}).then(()=>{var e;return null==(e=f.current)?void 0:e.call(f)}).catch(()=>{}))},[n]),y=n.find(e=>e.id===i)||n[0];return{spaces:n,activeSpaceId:i,activeSpace:y,isSwitching:l,ready:u,setActiveSpaceId:x,createSpace:v,renameSpace:j,deleteSpace:w,moveArtifactToSpace:b}}({onArtifactMoved:(0,s.useCallback)((e,n)=>{t(t=>{if(!t||!Array.isArray(t.artifacts))return t;let a=!1,s=t.artifacts.map(t=>t.id!==e||t.space_id===n?t:(a=!0,{...t,space_id:n}));return a?{...t,artifacts:s}:t})},[]),refresh:z}),F=(0,s.useMemo)(()=>((null==e?void 0:e.artifacts)||[]).filter(e=>e.content).filter(e=>(e.space_id||"default")===W.activeSpaceId).map(e=>e.id),[null==e?void 0:e.artifacts,W.activeSpaceId]),B=function(e){let{state:t,refresh:n,spaceArtifactIds:a,activeSpaceId:i,moveArtifactToSpace:c}=e,[d,u]=(0,s.useState)(null),[h,m]=(0,s.useState)({}),[p,f]=(0,s.useState)(null),[g,x]=(0,s.useState)(null),[v,j]=(0,s.useState)(null),[w,b]=(0,s.useState)({}),[y,k]=(0,s.useState)({}),[N,S]=(0,s.useState)({}),[_,C]=(0,s.useState)(null),[E,L]=(0,s.useState)(null),[M,I]=(0,s.useState)(null),[A,D]=(0,s.useState)("auto"),[T,R]=(0,s.useState)(null),[O,P]=(0,s.useState)({width:0,height:0}),z=(0,s.useRef)(20),W=(0,s.useRef)(!1);function F(e){z.current+=1;let t=z.current;u(e),S(n=>n[e]===t?n:{...n,[e]:t})}async function B(e){let t=await fetch("/api/artifacts/".concat(encodeURIComponent(e)),{method:"DELETE"});if(!t.ok&&404!==t.status)throw Error(await t.text());m(t=>{let n={...t};return delete n[e],n}),b(t=>{let n={...t};return delete n[e],n}),k(t=>{let n={...t};return delete n[e],n}),S(t=>{let n={...t};return delete n[e],n}),j(null),await n()}return(0,s.useEffect)(()=>{if(!T)return;let e=()=>P({width:T.clientWidth,height:T.clientHeight});e();let t=new ResizeObserver(e);return t.observe(T),()=>t.disconnect()},[T]),(0,s.useEffect)(()=>{W.current&&O.width&&O.height&&(b(e=>{let t=!1,n={...e},a=Math.max(280,O.width-16),s=Math.max(180,O.height-16);for(let i in e){let r=e[i],l=Math.max(280,Math.min(a,r.width)),o=Math.max(180,Math.min(s,r.height));(l!==r.width||o!==r.height)&&(n[i]={width:l,height:o},t=!0)}return t?n:e}),k(e=>{let t=!1,n={...e};for(let i in e){var a,s;let r=e[i],l=(null==(a=w[i])?void 0:a.width)||520,o=(null==(s=w[i])?void 0:s.height)||380,c=Math.max(8,O.width-l-8),d=Math.max(8,O.height-o-8),u=Math.max(8,Math.min(c,r.x)),h=Math.max(8,Math.min(d,r.y));(u!==r.x||h!==r.y)&&(n[i]={x:u,y:h},t=!0)}return t?n:e}))},[O]),(0,s.useEffect)(()=>(document.body.classList.toggle("is-dragging",!!_),document.body.classList.toggle("is-resizing",!!E),()=>{document.body.classList.remove("is-dragging"),document.body.classList.remove("is-resizing")}),[_,E]),(0,s.useEffect)(()=>{try{let e=localStorage.getItem("madarx:artifact-layout-v2");if(e){let t=JSON.parse(e);t.positions&&k(t.positions),t.sizes&&b(t.sizes),t.z&&S(t.z),t.minimized&&m(t.minimized),("manual"===t.layoutMode||"auto"===t.layoutMode)&&D(t.layoutMode),"number"==typeof t.nextZ&&(z.current=t.nextZ)}}catch(e){}W.current=!0},[]),(0,s.useEffect)(()=>{if(!t)return;let e=a?new Set(a):null,n=(t.artifacts||[]).filter(t=>t.content&&!h[t.id]&&(!e||e.has(t.id)));if("auto"===A){let e=l(n,O),t={},a={};n.forEach((n,s)=>{let i=e[s];t[n.id]={x:i.x,y:i.y},a[n.id]={width:i.width,height:i.height}}),k(t),b(a);return}let s=[];k(e=>{if(0===(s=n.filter(t=>!e[t.id]).map(e=>e.id)).length)return e;let t={...e},a=Object.values(e),i=a.length?Math.max(...a.map(e=>e.x)):24,r=a.length?Math.max(...a.map(e=>e.y)):24,l=Math.max(320,(O.width||900)-320),o=Math.max(180,(O.height||620)-200);return s.forEach((e,n)=>{let a=(n+1)*32;t[e]={x:Math.max(16,Math.min(l,i+a)),y:Math.max(16,Math.min(o,r+a))}}),t}),0!==s.length&&(b(e=>{let t={...e};return s.forEach(e=>{t[e]||(t[e]={width:520,height:380})}),t}),S(e=>{let t={...e};return s.forEach(e=>{z.current+=1,t[e]=z.current}),t}),u(s[s.length-1]))},[t,O,A,h,a]),(0,s.useEffect)(()=>{if(!W.current)return;let e=setTimeout(()=>{try{localStorage.setItem("madarx:artifact-layout-v2",JSON.stringify({positions:y,sizes:w,z:N,minimized:h,layoutMode:A,nextZ:z.current}))}catch(e){}},200);return()=>clearTimeout(e)},[y,w,N,h,A]),{selectedArtifactId:d,minimizedIds:h,cardZ:N,hoveredDockId:p,setHoveredDockId:f,fullscreenId:g,setFullscreenId:x,confirmDeleteId:v,setConfirmDeleteId:j,draggingId:_,resizingId:E,pointerDropSpaceId:M,layoutMode:A,setBoardEl:R,toggleMinimize:function(e){m(t=>({...t,[e]:!t[e]}))},getLayout:function(e,n){var s,i,o,c;let d=y[e],u=w[e],m=a?new Set(a):null,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;return l(Array.from({length:t},(e,t)=>({id:String(t)})),n)[e]||{x:16,y:16,width:520,height:380}}(Math.max(0,n),Math.max(1,((null==t?void 0:t.artifacts)||[]).filter(e=>e.content&&!h[e.id]&&(!m||m.has(e.id))).length),O);return{x:null!=(s=null==d?void 0:d.x)?s:p.x,y:null!=(i=null==d?void 0:d.y)?i:p.y,width:null!=(o=null==u?void 0:u.width)?o:p.width,height:null!=(c=null==u?void 0:u.height)?c:p.height}},bringToFront:F,resetArtifactLayout:function(){z.current=20,D("auto"),S({})},deleteArtifactById:B,downloadArtifact:function(e){let t=(0,o.o0)(e.kind),n=new Blob([t?e.content||"":e.source_md||e.content||""],{type:t?"text/html":"text/markdown"}),a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=(e.title||"artifact").toLowerCase().replace(/\s+/g,"-")+(t?".html":".md"),s.click(),URL.revokeObjectURL(a)},startDrag:function(e,t){var n,a;if(e.target.closest("button, .winbar i, .winbar-dl, .artifact-kind-badge, .confirm-label"))return;e.preventDefault();let s=e.currentTarget.closest(".artifact-window-wrap"),r=null==s?void 0:s.closest(".canvas-board");if(!s)return;null==(n=(a=e.currentTarget).setPointerCapture)||n.call(a,e.pointerId),D("manual"),C(t),F(t);let l=null==r?void 0:r.getBoundingClientRect(),o=s.getBoundingClientRect(),d=l?o.left-l.left+r.scrollLeft:0,u=l?o.top-l.top+r.scrollTop:0,h=l?e.clientX-l.left+r.scrollLeft-d:0,m=l?e.clientY-l.top+r.scrollTop-u:0,p=e.currentTarget;document.body.style.userSelect="none";let f=null,g=!1;function x(e){e.preventDefault();let n=null==r?void 0:r.getBoundingClientRect(),a=n?Math.max(0,e.clientX-n.left+r.scrollLeft-h):d,s=n?Math.max(0,e.clientY-n.top+r.scrollTop-m):u;k(e=>({...e,[t]:{x:a,y:s}}));let l=function(e,t){let n=document.elementFromPoint(e,t);if(!n)return null;let a=n.closest(".space-chip");if(!a)return null;let s=a.getAttribute("data-space-id");return!s||i&&s===i?null:s}(e.clientX,e.clientY);l!==f&&(f=l,I(l)),l&&(g=!0)}function v(e){var n;p.removeEventListener("pointermove",x),p.removeEventListener("pointerup",v),p.removeEventListener("pointercancel",v),null==(n=p.releasePointerCapture)||n.call(p,e.pointerId),document.body.style.userSelect="",C(null),I(null),g&&f&&"function"==typeof c&&(c(t,f),k(e=>{if(!(t in e))return e;let n={...e};return n[t]={x:d,y:u},n}))}p.addEventListener("pointermove",x),p.addEventListener("pointerup",v),p.addEventListener("pointercancel",v)},startResize:function(e,t,n){var a,s;e.preventDefault(),e.stopPropagation();let i=e.currentTarget.closest(".artifact-window-wrap"),r=i.closest(".canvas-board");null==(a=(s=e.currentTarget).setPointerCapture)||a.call(s,e.pointerId),D("manual"),F(t);let l=e.clientX,o=e.clientY,c=null==r?void 0:r.getBoundingClientRect(),d=i.getBoundingClientRect(),u=d.width,h=d.height,m=c?d.left-c.left+r.scrollLeft:0,p=c?d.top-c.top+r.scrollTop:0,f=r?r.clientWidth:1/0,g=r?r.clientHeight:1/0,x={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",sw:"nesw-resize",nw:"nwse-resize",se:"nwse-resize"}[n]||"nwse-resize",v=e.currentTarget;function j(e){e.preventDefault();let a=e.clientX-l,s=e.clientY-o,i=m,r=p,c=u,d=h;n.includes("w")&&(u-a<280&&(a=u-280),m+a<8&&(a=8-m),i=m+a,c=u-a),n.includes("e")&&(u+a<280&&(a=280-u),m+u+a>f-8&&(a=f-8-m-u),c=u+a),n.includes("n")&&(h-s<180&&(s=h-180),p+s<8&&(s=8-p),r=p+s,d=h-s),n.includes("s")&&(h+s<180&&(s=180-h),p+h+s>g-8&&(s=g-8-p-h),d=h+s),b(e=>({...e,[t]:{width:c,height:d}})),(n.includes("w")||n.includes("n"))&&k(e=>({...e,[t]:{x:i,y:r}}))}function w(e){var t;v.removeEventListener("pointermove",j),v.removeEventListener("pointerup",w),v.removeEventListener("pointercancel",w),null==(t=v.releasePointerCapture)||t.call(v,e.pointerId),document.body.style.userSelect="",document.body.style.cursor="",L(null)}L(t),document.body.style.userSelect="none",document.body.style.cursor=x,v.addEventListener("pointermove",j),v.addEventListener("pointerup",w),v.addEventListener("pointercancel",w)}}}({state:e,refresh:z,spaceArtifactIds:F,activeSpaceId:W.activeSpaceId,moveArtifactToSpace:W.moveArtifactToSpace}),U=function(e){let{sessionId:t,setSessionId:n,setChat:a,setUsage:r,setSelectedModel:l,setSessionArtifactId:o}=e,[c,d]=(0,s.useState)([]),[u,p]=(0,s.useState)(!1);async function f(){try{let e=await i("/api/chat/sessions");d(e.sessions||[])}catch(e){}}async function g(e){if(p(!1),e!==t){o(null);try{let t=(await i("/api/chat/sessions/".concat(encodeURIComponent(e)))).session;n(t.id),h(t.id),a(function(e){let t=((null==e?void 0:e.messages)||[]).filter(e=>("user"===e.role||"assistant"===e.role)&&e.content).map(e=>({role:"assistant"===e.role?"agent":"user",text:e.content}));return t.length||t.push({role:"agent",text:"Fresh workspace ready. I am the madarX Main Agent. Tell me what to create first."}),t}(t)),r(e=>({...e,model:t.model||e.model,input:t.total_input_tokens||0,output:t.total_output_tokens||0,cache_read:t.total_cache_read_tokens||0,cache_creation:t.total_cache_creation_tokens||0,context:t.last_context_tokens||0})),t.model&&l(t.model)}catch(e){}}}function x(){p(!1),n(null),h(null),o(null),a([{role:"agent",text:"Fresh workspace ready. I am the madarX Main Agent. Tell me what to create first."}]),r(e=>({...e,input:0,output:0,cache_read:0,cache_creation:0,context:0}))}async function v(e){try{await fetch("/api/chat/sessions/".concat(encodeURIComponent(e)),{method:"DELETE"})}catch(e){}if(e===t)x();else try{m()===e&&h(null)}catch(e){}await f()}return{sessions:c,setSessions:d,sessionsOpen:u,setSessionsOpen:p,refreshSessions:f,openSession:g,newSession:x,deleteSession:v}}({sessionId:v,setSessionId:j,setChat:a,setUsage:x,setSelectedModel:R,setSessionArtifactId:b}),J=function(e){let{bgAgentList:t,hasBgActivity:n}=function(e){let{refresh:t,runs:n}=e,[a,i]=(0,s.useState)({}),r=(0,s.useRef)(t);(0,s.useEffect)(()=>{r.current=t},[t]),(0,s.useEffect)(()=>{if(!window.EventSource)return;let e=new EventSource("/api/events/stream");return e.addEventListener("agent_tool_start",e=>{try{var t=JSON.parse(e.data);let n=t.agent_id;n&&i(e=>{let a=e[n]||{agent_id:n,agent_name:t.agent_name||n,status:"running",started_at:Date.now(),steps:[]};return{...e,[n]:{...a,agent_name:t.agent_name||a.agent_name,status:"running",current_tool:t.tool,current_input_summary:t.input_summary,steps:[...a.steps,{tool:t.tool,input_summary:t.input_summary,status:"running",ts:t.ts||Date.now()}].slice(-12)}}})}catch(e){}}),e.addEventListener("agent_tool_result",e=>{try{var t=JSON.parse(e.data);let n=t.agent_id;n&&i(e=>{let a=e[n]||{agent_id:n,agent_name:t.agent_name||n,status:"running",started_at:Date.now(),steps:[]},s=[...a.steps],i=!1;for(let e=s.length-1;e>=0;e--)if(s[e].tool===t.tool&&"running"===s[e].status){s[e]={...s[e],status:t.isError?"error":"done"},i=!0;break}return!i&&(s.push({tool:t.tool,status:t.isError?"error":"done",ts:Date.now()}),s.length>12&&s.shift()),{...e,[n]:{...a,current_tool:null,steps:s}}})}catch(e){}}),e.addEventListener("agent_run_start",e=>{try{var t=JSON.parse(e.data);let n=t.agent_id;n&&i(e=>{var a,s,i;return{...e,[n]:{agent_id:n,agent_name:t.agent_name||n,triggered_by:t.triggered_by,status:"running",started_at:Date.now(),steps:null!=(i=null==(s=e[n])||null==(a=s.steps)?void 0:a.slice(-6))?i:[]}}})}catch(e){}}),e.addEventListener("agent_run_complete",e=>{try{var t;!function(e){let t=e.agent_id;if(!t)return;let n=Date.now();i(a=>{let s=a[t];return s?{...a,[t]:{...s,status:e.isError?"failed":"complete",finished_at:n,current_tool:null}}:a}),setTimeout(()=>{i(e=>{let a=e[t];if(!a||"running"===a.status||a.finished_at!==n)return e;let s={...e};return delete s[t],s})},3e4)}(JSON.parse(e.data)),null==(t=r.current)||t.call(r)}catch(e){}}),e.addEventListener("agent_created",()=>{var e;null==(e=r.current)||e.call(r)}),e.onerror=()=>{},()=>{e.close()}},[]),(0,s.useEffect)(()=>{Array.isArray(n)&&0!==n.length&&i(e=>{let t=Object.keys(e);if(0===t.length)return e;let a=!1,s={...e};for(let r of t){let t=e[r];if(!t||"running"!==t.status)continue;let l=n.find(e=>e&&e.agent_id===r&&("complete"===e.status||"failed"===e.status)&&e.at&&new Date(e.at).getTime()>=(t.started_at||0)-1e3);if(l){s[r]={...t,status:l.status,finished_at:Date.now(),current_tool:null},a=!0;let e=s[r].finished_at;setTimeout(()=>{i(t=>{let n=t[r];if(!n||"running"===n.status||n.finished_at!==e)return t;let a={...t};return delete a[r],a})},3e4)}}return a?s:e})},[n]),(0,s.useEffect)(()=>{let e=window.setInterval(()=>{let e=Date.now()-12e4;i(t=>{let n=Object.keys(t);if(0===n.length)return t;let a=!1,s={...t};for(let r of n){var i;let n=t[r];if(!n||"running"!==n.status)continue;let l=(null==(i=n.steps)?void 0:i.length)?n.steps[n.steps.length-1].ts:0,o=Math.max(n.started_at||0,l||0);o>0&&o<e&&(delete s[r],a=!0)}return a?s:t})},15e3);return()=>window.clearInterval(e)},[]);let l=Object.values(a),o=l.some(e=>"running"===e.status);return{bgAgents:a,bgAgentList:l,hasBgActivity:o}}({refresh:e.refresh,runs:e.runs}),a=function(e){let{chat:t,setChat:n,selectedModel:a,sessionId:i,setSessionId:r,sessionArtifactId:l,setSessionArtifactId:o,setUsage:c,refresh:d,refreshSessions:u,bringToFront:m,projectId:f}=e,[g,x]=(0,s.useState)(!1),[v,j]=(0,s.useState)(""),[w,b]=(0,s.useState)(null),[y,k]=(0,s.useState)(!1),[N,S]=(0,s.useState)([]),[_,C]=(0,s.useState)(null),[E,L]=(0,s.useState)("idle"),M=(0,s.useRef)([]),I=(0,s.useRef)(null),A=(0,s.useRef)(!1),D=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=D.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<200;(g||t)&&(e.scrollTop=e.scrollHeight)},[t,v,g]);let T=(0,s.useRef)(null),R=(0,s.useRef)(null);async function O(e,t,a){var s,i;if(e){try{let a=await fetch("/api/approvals/".concat(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({decision:t})});if(!a.ok){let e=await a.text().catch(()=>"");n(t=>[...t,{role:"agent",text:"Approval failed: ".concat(e||a.status)}]);return}}catch(e){n(t=>[...t,{role:"agent",text:"Approval error: ".concat(e.message)}]);return}S(n=>n.map(n=>n.approval_id===e?{...n,status:"approved"===t?"approved":"denied"}:n)),"approved"===t&&a?(M.current.push({approval_id:e,tool_name:a}),null==(s=T.current)||s.call(T,"Approved — please continue.")):"denied"===t&&(null==(i=T.current)||i.call(T,"Denied — try a different approach."))}}T.current=async function e(e){if(g)return;let s=(null!=e?e:"").trim();if(!s)return;n(e=>[...e,{role:"user",text:s}]),(0,p.q)(),S([]),L("thinking"),C(Date.now()),x(!0);let v=t.filter(e=>"user"===e.role||"agent"===e.role).map(e=>({role:"agent"===e.role?"assistant":"user",content:e.text}));for(;v.length&&"assistant"===v[0].role;)v.shift();v.push({role:"user",content:s});let w=new AbortController;I.current=w,A.current=!1;try{let e=M.current.slice();M.current=[];let t=await fetch("/api/orchestrator/stream",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({messages:v,model:a,session_id:i,session_artifact_id:l,project_id:f||"personal",pending_approvals:e}),signal:w.signal});if(!t.ok||!t.body){let e=await t.text();n(t=>[...t,{role:"agent",text:"Stream error: ".concat(e)}]);return}let s=t.body.getReader(),p=new TextDecoder,g="",x="";for(n(e=>[...e,{role:"agent",text:""}]);;){let{done:e,value:t}=await s.read();if(e)break;let a=(g+=p.decode(t,{stream:!0})).split("\n");g=a.pop();let l="";for(let e of a)if(e.startsWith("event:"))l=e.slice(6).trim();else if(e.startsWith("data:")){let t=e.slice(5).trim();try{var y,N,_,E;let e=JSON.parse(t);if("session"===l&&e.id)h(e.id),e.id!==i&&r(e.id);else if("cli_stream"===l&&e.text)L(e=>"thinking"===e?"responding":e),n(t=>{let n=[...t];return n[n.length-1]={role:"agent",text:e.text,streaming:!0},n});else if("text"===l&&e.delta)x+=e.delta,L(e=>"thinking"===e?"responding":e),j(t=>t+e.delta),n(e=>{let t=[...e];return t[t.length-1]={role:"agent",text:x},t});else if("tool_start"===l)b(e.name),L("tool"),S(t=>[...t,{id:"".concat(e.name,"-").concat(Date.now()),name:e.name,input:e.input,status:"running"}]);else if("tool_result"===l){b(null),L("synthesis");let t=(null==(N=e.output)?void 0:N.status)==="approval_required"&&"string"==typeof(null==(_=e.output)?void 0:_.approval_request_id);S(n=>{let a=[...n];for(let n=a.length-1;n>=0;n--)if(a[n].name===e.name&&"running"===a[n].status){a[n]={...a[n],status:t?"awaiting_approval":e.isError?"error":"done",approval_id:t?e.output.approval_request_id:a[n].approval_id||null,approval_reason:t&&e.output.reason||null};break}return a}),("create_artifact"===e.name||"generate_ui"===e.name||"send_to_hermes"===e.name||"start_hermes_job"===e.name)&&(null==(E=e.output)?void 0:E.artifact_id)&&m(e.output.artifact_id)}else if("artifacts"===l&&(null==(y=e.created)?void 0:y.length)){for(let t of e.created)t.artifact_id&&m(t.artifact_id);d()}else if("agent_created"===l&&e.agent)d();else if("session_artifact"===l&&e.artifact_id)o(e.artifact_id);else if("artifact_updated"===l&&e.artifact_id)o(e.artifact_id),m(e.artifact_id),d();else if("usage"===l)c(e);else if("pending_approvals"===l&&Array.isArray(null==e?void 0:e.approvals))for(let t of e.approvals)(null==t?void 0:t.approval_id)&&(null==t?void 0:t.tool_name)&&M.current.push({approval_id:t.approval_id,tool_name:t.tool_name});else"error"===l&&(x+="\nError: ".concat(e.message),n(e=>{let t=[...e];return t[t.length-1]={role:"agent",text:x},t}))}catch(e){}l=""}}x||n(e=>{let t=[...e];return t[t.length-1]={role:"agent",text:"Done."},t}),await d(),await u()}catch(e){A.current||(null==e?void 0:e.name)==="AbortError"?n(e=>{let t=[...e],n=t[t.length-1];if(n&&"agent"===n.role){let e=(n.text||"").trim();t[t.length-1]={role:"agent",text:e?"".concat(e,"\n\n_(stopped by user)_"):"_(stopped by user)_"}}else t.push({role:"agent",text:"_(stopped by user)_"});return t}):n(t=>[...t,{role:"agent",text:"Action failed: ".concat(e.message)}])}finally{I.current=null,A.current=!1,x(!1),C(null),L("idle"),j(""),b(null),setTimeout(()=>{S(e=>e.some(e=>"awaiting_approval"===e.status)?e:[])},1200),k(!1)}},R.current=function(){if(g){A.current=!0;try{var e;null==(e=I.current)||e.abort()}catch(e){}}};let P=(0,s.useRef)(null);P.current=O;let z=(0,s.useCallback)(e=>T.current(e),[]);return{busy:g,liveText:v,liveTool:w,liveExpanded:y,setLiveExpanded:k,liveSteps:N,busyStartTime:_,agentPhase:E,feedRef:D,command:z,stop:(0,s.useCallback)(()=>R.current(),[]),decideApproval:(0,s.useCallback)((e,t,n)=>P.current(e,t,n),[])}}(e);return{busy:a.busy,liveText:a.liveText,liveTool:a.liveTool,liveExpanded:a.liveExpanded,setLiveExpanded:a.setLiveExpanded,liveSteps:a.liveSteps,busyStartTime:a.busyStartTime,agentPhase:a.agentPhase,bgAgentList:t,hasBgActivity:n,feedRef:a.feedRef,command:a.command,stop:a.stop,decideApproval:a.decideApproval}}({chat:n,setChat:a,selectedModel:T,sessionId:v,setSessionId:j,sessionArtifactId:w,setSessionArtifactId:b,setUsage:x,refresh:z,refreshSessions:U.refreshSessions,bringToFront:B.bringToFront,projectId:_,runs:(null==e?void 0:e.runs)||null}),q=function(e){let{refresh:t,setChat:n}=e,[a,i]=(0,s.useState)(null),[r,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(null);async function d(e){if(!e||a)return;i(e);let s="Approved Claude Code run. Starting local execution...\n";n(e=>[...e,{role:"agent",text:s}]);try{let a=await fetch("/api/runs/approve-claude-run",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({run_id:e})});if(!a.ok||!a.body){let e=await a.text();try{e=JSON.parse(e).error||e}catch(e){}n(t=>{let n=[...t];return n[n.length-1]={role:"agent",text:"".concat(s,"\n").concat(e)},n}),await t();return}let i=a.body.getReader(),r=new TextDecoder,l="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let a=(l+=r.decode(t,{stream:!0})).split("\n");l=a.pop();let o="";for(let e of a)if(e.startsWith("event:"))o=e.slice(6).trim();else if(e.startsWith("data:")){try{let t=JSON.parse(e.slice(5).trim());"stdout"===o&&t.line?s+="".concat(t.line,"\n"):"stderr"===o&&t.line?s+="stderr: ".concat(t.line,"\n"):"done"===o?s+="\nClaude run ".concat(t.status,"."):"error"===o&&(s+="\nError: ".concat(t.message)),n(e=>{let t=[...e];return t[t.length-1]={role:"agent",text:s},t})}catch(e){}o=""}}await t()}catch(e){n(t=>{let n=[...t];return n[n.length-1]={role:"agent",text:"".concat(s,"\nAction failed: ").concat(e.message)},n})}finally{i(null)}}async function u(e,s){if(e&&!a){i(e);try{let n=await fetch("/api/approvals/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({decision:s})});if(!n.ok)throw Error(await n.text());await t()}catch(e){n(t=>[...t,{role:"agent",text:"Approval update failed: ".concat(e.message)}])}finally{i(null)}}}return{approvalBusyId:a,runtimeOpen:r,setRuntimeOpen:l,runtimeActionBusy:o,approveClaudeRun:d,decideGenericApproval:u,ensureOpsAgentAction:async function(){c("ops");try{let e=await fetch("/api/agents/ops",{method:"POST"});if(!e.ok)throw Error(await e.text());n(e=>[...e,{role:"agent",text:"Caretaker is ready: daily 08:00 schedule, scoped tools, and approval gates configured."}]),await t()}catch(e){n(t=>[...t,{role:"agent",text:"Caretaker setup failed: ".concat(e.message)}])}finally{c(null)}},processHeartbeatOnceAction:async function(){c("worker");try{let e=await fetch("/api/heartbeat/worker",{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!e.ok)throw Error(await e.text());let a=await e.json();n(e=>[...e,{role:"agent",text:"Heartbeat worker processed once: ".concat(a.worked?a.status||"worked":"no queued task",".")}]),await t()}catch(e){n(t=>[...t,{role:"agent",text:"Heartbeat worker failed: ".concat(e.message)}])}finally{c(null)}}}}({refresh:z,setChat:a}),H=(0,s.useRef)(_),X=(0,s.useRef)(J),V=(0,s.useRef)(U),G=(0,s.useRef)(null),K=(0,s.useRef)(I),Y=(0,s.useRef)(A),Z=(0,s.useRef)(D);H.current=_,X.current=J,V.current=U,G.current=I.openConfig,K.current=I,Y.current=A,Z.current=D;let Q=(0,s.useRef)(null);null===Q.current&&(Q.current=new WeakSet);let $=(0,s.useCallback)(e=>{e&&Q.current.add(e)},[]);(0,s.useEffect)(()=>{let t=null==e?void 0:e.projects;if(!Array.isArray(t)||0===t.length||_&&t.some(e=>(null==e?void 0:e.id)===_))return;let n=_?t.find(e=>(null==e?void 0:e.slug)===_):null,a=t.find(e=>(null==e?void 0:e.slug)==="personal"||(null==e?void 0:e.id)==="personal"),s=t.find(e=>(null==e?void 0:e.status)==="active"),i=n||a||s||t[0];(null==i?void 0:i.id)&&E(i.id)},[null==e?void 0:e.projects,_,E]),(0,s.useEffect)(()=>{let e=!1,n=null,a=null,s=null,r=null,l=null,o=["agents","runs","artifacts","heartbeat","approvals","connectors","schedules","sessions","local_actions","local_processes","hermes_jobs","projects"];async function c(){if("hidden"===document.visibilityState||n)return;let l=new AbortController;n=l;try{let n=await i(function(){let e=H.current;return e?"/api/state?project_id=".concat(encodeURIComponent(e)):"/api/state"}(),{signal:l.signal});!e&&(t(n),(null==n?void 0:n.main_agent_trust_mode)&&Y.current.setTrustMode(n.main_agent_trust_mode),(null==n?void 0:n.live_deltas_enabled)&&!r&&(function(){try{for(let e of(r=new EventSource("/api/events/stream"),o))r.addEventListener("state.".concat(e,".changed"),d);r.addEventListener("error",()=>{})}catch(e){r=null}s=setInterval(c,6e4)}(),a&&(clearInterval(a),a=null)))}catch(e){}finally{n===l&&(n=null)}}function d(){l||(l=setTimeout(()=>{l=null,c()},250))}function u(e){if(e.origin!==window.location.origin||!e.source||!Q.current.has(e.source))return;let t=null==e?void 0:e.data;if(!t||"object"!=typeof t||"madarx:prompt"!==t.type)return;let n="string"==typeof t.text?t.text.trim():"";if(!n)return;let a=X.current;a&&!a.busy&&a.command(n)}function h(){"visible"===document.visibilityState&&c()}return c().then(()=>{e||a||s||r||(a=setInterval(c,5e3))}),window.addEventListener("message",u),document.addEventListener("visibilitychange",h),i("/api/config").then(e=>{var t;K.current.setDesignStyle(null!=(t=e.designStyle)?t:"balanced"),K.current.setConfigTools(e.tools||[]),e.model&&(Z.current.setSelectedModel(e.model),x(t=>({...t,model:e.model})))}).catch(()=>{}),i("/api/models").then(e=>Z.current.setModels(e.models||[])).catch(()=>{}),i("/api/config/env").then(e=>K.current.setConfigEnv(e.env||[])).catch(()=>{}),i("/api/settings/trust-mode").then(e=>Y.current.setTrustMode(e.mode||"approval_required")).catch(()=>{}),i("/api/chat/sessions").then(async e=>{let t=e.sessions||[],n=V.current;if(n.setSessions(t),t.length){let e=m(),a=t.find(t=>t.id===e)||t[0];await n.openSession(a.id)}}).catch(()=>{}).finally(()=>{e||S(!0)}),()=>{if(e=!0,n&&n.abort(),a&&clearInterval(a),s&&clearInterval(s),l&&(clearTimeout(l),l=null),r)try{r.close()}catch(e){}window.removeEventListener("message",u),document.removeEventListener("visibilitychange",h)}},[]),(0,s.useEffect)(()=>{function e(){var e;null==(e=G.current)||e.call(G)}return window.addEventListener("madarx:open-config",e),()=>window.removeEventListener("madarx:open-config",e)},[]);let ee=null===e||!N,et=e||{agents:[],runs:[],schedules:[],connectors:[],artifacts:[],hermes_jobs:[]},en=(0,s.useMemo)(()=>(et.runs||[]).find(e=>"claude-code-dry-run"===e.kind&&"approval-needed"===e.status),[et.runs]),ea=(0,s.useMemo)(()=>(et.hermes_jobs||[]).filter(e=>"queued"===e.status||"running"===e.status),[et.hermes_jobs]),es=et.pending_approvals||[],ei=et.heartbeat_tasks||[],er=et.local_tool_audit||[],el=et.local_processes||[],eo=es.length+ei.length+er.length+el.length,ec=(0,s.useMemo)(()=>(et.artifacts||[]).filter(e=>e.content),[et.artifacts]),ed=(0,s.useMemo)(()=>ec.filter(e=>(e.space_id||"default")===W.activeSpaceId&&!B.minimizedIds[e.id]),[ec,W.activeSpaceId,B.minimizedIds]),eu=(0,s.useMemo)(()=>ec.filter(e=>(e.space_id||"default")===W.activeSpaceId&&B.minimizedIds[e.id]),[ec,W.activeSpaceId,B.minimizedIds]),eh=(0,s.useCallback)(e=>{var t,n;let a=ec.findIndex(t=>t.id===e.id);return null!=(n=null==(t=B.cardZ)?void 0:t[e.id])?n:10+Math.max(0,a)},[ec,B.cardZ]),em=(0,s.useMemo)(()=>ed.reduce((e,t)=>{if(!e)return t.id;let n=ed.find(t=>t.id===e);return eh(t)>=eh(n)?t.id:e},null),[ed,eh]);return{state:e,chat:n,chatHydrated:N,chatHidden:y,setChatHidden:k,usage:u,setUsage:x,sessionId:v,sessionArtifactId:w,selectedProjectId:_,setSelectedProjectId:E,voiceOpen:L,setVoiceOpen:M,initializing:ee,counts:et,approvalRun:en,activeHermesJobs:ea,pendingApprovals:es,heartbeatTasks:ei,localActions:er,localProcesses:el,runtimeSignalCount:eo,artifacts:ec,visibleArtifacts:ed,dockedArtifacts:eu,zForArtifact:eh,frontArtifactId:em,ctxLimit:O,ctxPct:P,...I,...A,...D,spaces:W,artifactLayout:B,sessions:U,mainAgent:J,runtimeActions:q,registerArtifactFrame:$}}();return(0,a.jsx)(x.Provider,{value:n,children:t})}function j(){let e=(0,s.useContext)(x);if(null===e)throw Error("useDashboard must be used inside <DashboardProvider>");return e}},7688:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var a=n(5155),s=n(7909),i=n(7355),r=n(2115),l=n(6504),o=n(5459);function c(){return(0,a.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",children:(0,a.jsx)("circle",{cx:"5.5",cy:"5.5",r:"4",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"6 4",strokeLinecap:"round",children:(0,a.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 5.5 5.5",to:"360 5.5 5.5",dur:"0.75s",repeatCount:"indefinite"})})})}function d(){return(0,a.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",children:(0,a.jsx)("path",{d:"M2 5.5L4.5 8L9 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function u(){return(0,a.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",children:(0,a.jsx)("path",{d:"M2.5 2.5L8.5 8.5M8.5 2.5L2.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function h(e){let{startTime:t}=e,[n,s]=(0,r.useState)(0);return((0,r.useEffect)(()=>{s(Math.floor((Date.now()-t)/1e3));let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[t]),n<60)?(0,a.jsxs)(a.Fragment,{children:[n,"s"]}):(0,a.jsxs)(a.Fragment,{children:[Math.floor(n/60),"m ",n%60,"s"]})}let m={Bash:"run command",WebSearch:"web search",WebFetch:"fetch",Read:"read",Write:"write",Edit:"edit",MultiEdit:"edit",NotebookEdit:"edit notebook",Glob:"find files",Grep:"search files",LS:"list",TodoWrite:"plan",Task:"subagent",Skill:"skill",SlashCommand:"command",ExitPlanMode:"exit plan",AskUserQuestion:"ask"};function p(e){if(!e)return"";let t=String(e);return t.split("/").filter(Boolean).pop()||t}function f(e){try{return new URL(String(e)).hostname}catch(t){return String(e).slice(0,52)}}function g(e,t){return t?"web_search"===e&&t.query?'"'.concat(String(t.query).slice(0,52),'"'):"web_fetch"===e&&t.url?f(t.url):"browser_harness_run"===e&&t.script?"browser script":"create_artifact"===e&&t.title?'"'.concat(String(t.title).slice(0,40),'"'):"create_agent"===e&&t.name?'"'.concat(String(t.name).slice(0,40),'"'):("file_read"===e||"file_write"===e)&&t.path?p(t.path).slice(0,40):"Bash"===e&&t.command?String(t.command).slice(0,80):"WebSearch"===e&&t.query?'"'.concat(String(t.query).slice(0,52),'"'):"WebFetch"===e&&t.url?f(t.url):("Read"===e||"Write"===e||"Edit"===e||"MultiEdit"===e||"NotebookEdit"===e)&&t.file_path?p(t.file_path).slice(0,40):("Glob"===e||"Grep"===e)&&(t.pattern||t.path)?String(t.pattern||t.path).slice(0,52):"LS"===e&&t.path?p(t.path).slice(0,40)||"/":"TodoWrite"===e&&Array.isArray(t.todos)?"".concat(t.todos.length," item").concat(1===t.todos.length?"":"s"):"Task"===e&&t.description?'"'.concat(String(t.description).slice(0,52),'"'):"Skill"===e&&t.skill?"/".concat(t.skill):"SlashCommand"===e&&t.command?String(t.command).slice(0,52):null:null}var x=n(3247);let v=(0,r.memo)(function(){var e,t,n;let{initializing:s,models:p,selectedModel:f,modelOpen:v,setModelOpen:j,usage:w,ctxLimit:b,ctxPct:y,grouped:k,pickModel:N,sessions:S,sessionId:_,openConfig:C,chat:E,mainAgent:L,setChatHidden:M,setVoiceOpen:I}=(0,i.M)(),{prompt:A,setPrompt:D}=(0,x.r)(),T=S.sessionsOpen,R=S.setSessionsOpen,O=S.newSession,P=S.openSession,z=S.deleteSession,W=S.sessions||[],F=L.feedRef,B=L.liveSteps,U=L.busyStartTime,J=L.agentPhase,q=L.busy,H=L.command,X=L.stop,V=L.decideApproval,G=(0,r.useCallback)(()=>M(!0),[M]),K=(0,r.useCallback)(()=>I(!0),[I]),Y=(0,r.useRef)(null),Z=(0,r.useCallback)(()=>{var e,t;if(q)return;let n=null!=(t=null==(e=Y.current)?void 0:e.value)?t:"";n.trim()&&(D(""),H(n))},[q,D,H]);return(0,r.useEffect)(()=>{function e(){var e,t;null==(e=Y.current)||e.focus(),null==(t=Y.current)||t.scrollIntoView({block:"center",behavior:"smooth"})}function t(){O(),window.setTimeout(e,0)}return window.addEventListener("madarx:focus-composer",e),window.addEventListener("madarx:new-chat",t),()=>{window.removeEventListener("madarx:focus-composer",e),window.removeEventListener("madarx:new-chat",t)}},[O]),(0,a.jsxs)("section",{className:"chat",children:[(0,a.jsxs)("div",{className:"chat-top",children:[(0,a.jsxs)("div",{className:"model-pill-wrap",children:[(0,a.jsxs)("button",{className:"model-pill",onClick:()=>j(e=>!e),"aria-haspopup":"listbox","aria-expanded":v,title:w.context>0?"Context: ".concat((w.context/1e3).toFixed(1),"K / ").concat((b/1e3).toFixed(0),"K (").concat(y,"%) \xb7 cache read ").concat(w.cache_read||0):"Pick model",children:[(0,a.jsx)("span",{className:"model-name",children:null!=(n=null!=(t=null==(e=p.find(e=>e.id===f))?void 0:e.label)?t:f)?n:"Pick model"}),w.context>0?(0,a.jsxs)("span",{className:"ctx-tokens",children:[(w.context/1e3).toFixed(1),"K \xb7 ",y,"%"]}):w.input+w.output>0?(0,a.jsxs)("span",{className:"ctx-tokens",children:[((w.input+w.output)/1e3).toFixed(1),"K ctx"]}):null,(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),v&&(0,a.jsx)("ul",{className:"model-dropdown",role:"listbox",children:k.map(e=>(0,a.jsxs)("li",{className:"model-group",children:[(0,a.jsx)("span",{className:"model-group-label",children:e.label}),(0,a.jsx)("ul",{children:e.items.map(e=>(0,a.jsx)("li",{role:"option","aria-selected":e.id===f,className:"model-option"+(e.id===f?" selected":""),onClick:()=>N(e.id),children:"ollama"===e.engine?e.id:e.label},e.id))})]},e.engine))})]}),(0,a.jsxs)("div",{className:"chat-actions",children:[(0,a.jsxs)("div",{className:"chat-session-menu",children:[(0,a.jsx)("button",{className:"config-btn",style:{marginLeft:0},onClick:()=>R(e=>!e),title:"Conversations","aria-label":"Conversations","aria-haspopup":"listbox","aria-expanded":T,children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"7",width:"14",height:"14",rx:"3"}),(0,a.jsx)("path",{d:"M7 7V5.5A2.5 2.5 0 0 1 9.5 3H18.5A2.5 2.5 0 0 1 21 5.5V14.5A2.5 2.5 0 0 1 18.5 17H17"})]})}),T&&(0,a.jsxs)("ul",{className:"model-dropdown sessions-dropdown",role:"listbox",children:[(0,a.jsxs)("li",{className:"model-option session-new-option",onClick:O,children:[(0,a.jsx)("span",{children:"+"})," New chat"]}),0===W.length&&(0,a.jsx)("li",{className:"model-option session-empty-option",children:"No saved sessions"}),W.map(e=>{let t=e.total_input_tokens+e.total_output_tokens>0?"".concat((((e.total_input_tokens||0)+(e.total_output_tokens||0))/1e3).toFixed(1),"K"):"0";return(0,a.jsxs)("li",{role:"option","aria-selected":e.id===_,className:"model-option session-option"+(e.id===_?" selected":""),onClick:()=>P(e.id),children:[(0,a.jsx)("span",{className:"session-title",children:e.title||"Untitled chat"}),(0,a.jsx)("span",{className:"session-tokens",children:t}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),z(e.id)},title:"Delete session","aria-label":"Delete session",className:"session-delete-btn",children:"x"})]},e.id)})]})]}),K?(0,a.jsx)("button",{className:"config-btn voice-launch",style:{marginLeft:0},onClick:K,title:"Open voice console","aria-label":"Open voice console",children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"9",y:"3",width:"6",height:"12",rx:"3"}),(0,a.jsx)("path",{d:"M5 11a7 7 0 0 0 14 0"}),(0,a.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"21"}),(0,a.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"})]})}):null,G?(0,a.jsx)("button",{className:"config-btn",style:{marginLeft:0},onClick:G,title:"Minimize","aria-label":"Minimize chat",children:(0,a.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M5 12h14"})})}):null,(0,a.jsx)("button",{className:"config-btn",style:{marginLeft:0},onClick:C,title:"Settings","aria-label":"Agent settings",children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),(0,a.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,a.jsx)("line",{x1:"4",y1:"17",x2:"20",y2:"17"}),(0,a.jsx)("circle",{cx:"15",cy:"7",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("circle",{cx:"9",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("circle",{cx:"17",cy:"17",r:"2",fill:"currentColor",stroke:"none"})]})})]})]}),(0,a.jsxs)("div",{className:"feed",ref:F,children:[s?(0,a.jsxs)("div",{className:"feed-skeleton","aria-hidden":"true",children:[(0,a.jsxs)("div",{className:"msg agent msg--skel",children:[(0,a.jsx)("div",{className:"skel sk-line sk-line--w90"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w70"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w55"})]}),(0,a.jsxs)("div",{className:"msg user msg--skel",children:[(0,a.jsx)("div",{className:"skel sk-line sk-line--w65"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w40"})]}),(0,a.jsxs)("div",{className:"msg agent msg--skel",children:[(0,a.jsx)("div",{className:"skel sk-line sk-line--w85"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w50"})]})]}):E.map((e,t)=>"agent"!==e.role||e.text?(0,a.jsx)("div",{className:"msg "+e.role+(e.streaming?" msg--streaming":""),children:(0,a.jsx)(l.oz,{remarkPlugins:[o.A],children:e.text})},t):null),B.length>0&&(0,a.jsxs)("div",{className:"tool-steps",children:[B.map(e=>{let t="claude_code_cli"===e.name||"codex_cli"===e.name,n=g(e.name,e.input),s="awaiting_approval"===e.status;return(0,a.jsxs)("div",{className:"tool-step tool-step--".concat(e.status)+(t?" tool-step--cli":""),children:[(0,a.jsxs)("span",{className:"tool-step-icon","aria-hidden":"true",children:["running"===e.status&&(0,a.jsx)(c,{}),"done"===e.status&&(0,a.jsx)(d,{}),"approved"===e.status&&(0,a.jsx)(d,{}),("error"===e.status||"denied"===e.status)&&(0,a.jsx)(u,{}),s&&(0,a.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:4,background:"#c2452a"}})]}),!t&&(0,a.jsx)("code",{className:"tool-step-name",children:function(e){if(!e)return"";if(m[e])return m[e];if("string"==typeof e&&e.startsWith("mcp__")){let t=e.split("__");return t[t.length-1].replace(/_/g," ")}return e.replace(/_/g," ")}(e.name)}),n&&(0,a.jsx)("span",{className:"tool-step-sub",children:n}),s&&e.approval_id?(0,a.jsxs)("span",{className:"tool-step-approve",style:{marginLeft:"auto",display:"inline-flex",gap:6},children:[(0,a.jsx)("button",{type:"button",onClick:()=>V(e.approval_id,"approved",e.name),style:{appearance:"none",border:0,background:"#c2452a",color:"#fff",padding:"4px 10px",borderRadius:999,font:"600 11.5px/1 ui-sans-serif,system-ui",cursor:"pointer"},children:"Approve"}),(0,a.jsx)("button",{type:"button",onClick:()=>V(e.approval_id,"denied",e.name),style:{appearance:"none",border:"1px solid rgba(17,19,24,.16)",background:"#fff",color:"#313740",padding:"4px 10px",borderRadius:999,font:"600 11.5px/1 ui-sans-serif,system-ui",cursor:"pointer"},children:"Deny"})]}):null]},e.id)}),q&&U&&("synthesis"===J||"tool"===J)&&(0,a.jsx)("div",{className:"tool-step-elapsed",children:(0,a.jsx)(h,{startTime:U})})]}),q&&0===B.length&&(0,a.jsxs)("div",{className:"typing-indicator",children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]}),(0,a.jsxs)("form",{className:"composer",onSubmit:e=>{e.preventDefault(),Z()},children:[(0,a.jsx)("textarea",{ref:Y,"data-madarx-composer":"true",value:A,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Z())},placeholder:"Start fresh: ask the main agent to create the first agent, report, schedule, or UI task…",rows:3}),q?(0,a.jsx)("button",{type:"button",className:"send-btn send-btn--stop",onClick:e=>{e.preventDefault(),X&&X()},"aria-label":"Stop main agent",title:"Stop main agent",children:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:(0,a.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1.5",fill:"currentColor"})})}):(0,a.jsx)("button",{className:"send-btn",disabled:!A.trim(),"aria-label":"Send",children:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:(0,a.jsx)("path",{d:"M9 14V4M9 4L4.5 8.5M9 4L13.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})});var j=n(8219),w=n(7650);function b(){return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]})}function y(e){var t;let{spaceId:n,spaceName:s,onClose:i}=e,[l,o]=(0,r.useState)([]),[c,d]=(0,r.useState)(!0),[u,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(null),[x,v]=(0,r.useState)(7),[j,y]=(0,r.useState)(50),[k,N]=(0,r.useState)(!1),[S,_]=(0,r.useState)(!1),[C,E]=(0,r.useState)(null),[L,M]=(0,r.useState)("org"),[I,A]=(0,r.useState)(!1),[D,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{T(!0)},[]),(0,r.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[]);let R=window.location.origin,O=(0,r.useCallback)(e=>"".concat(R,"/share/space/").concat(e),[R]),P=(0,r.useCallback)(async()=>{d(!0);try{let[e,t]=await Promise.all([fetch("/api/dashboard/spaces/".concat(n,"/share-link"),{cache:"no-store"}),fetch("/api/shared/spaces/status?local_space_id=".concat(encodeURIComponent(n),"&space_type=dashboard_space"),{cache:"no-store"})]),a=await e.json().catch(()=>({}));e.ok&&o(a.data||[]);let s=await t.json().catch(()=>({}));t.ok&&(_(!!s.cloud_ready),E(s.status||null))}catch(e){p("Failed to load share state.")}finally{d(!1)}},[n]);async function z(e){e.preventDefault(),h(!0),p("");try{let e=await fetch("/api/dashboard/spaces/".concat(n,"/share-link"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({expires_in_days:Number(x)||null,max_views:Number(j)||null,require_email_otp:k})}),t=await e.json().catch(()=>({}));if(!e.ok)return void p(t.error||"Failed to create link.");await P()}catch(e){p("Failed to create link.")}finally{h(!1)}}async function W(e){try{(await fetch("/api/dashboard/spaces/".concat(n,"/share-link/").concat(e),{method:"DELETE"})).ok&&o(t=>t.filter(t=>t.id!==e))}catch(e){}}async function F(e,t){try{await navigator.clipboard.writeText(O(e)),g(t),setTimeout(()=>g(null),1500)}catch(e){}}async function B(){A(!0),p("");try{let e=await fetch("/api/shared/spaces/publish",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({space_type:"dashboard_space",space_id:n,visibility:L})}),t=await e.json().catch(()=>({}));if(!e.ok)return void p("shared_cloud_not_configured"===t.error?"Supabase cloud is not configured.":t.error||"Publish failed.");E(t.status||null)}catch(e){p("Publish failed.")}finally{A(!1)}}async function U(){A(!0),p("");try{let e=await fetch("/api/shared/spaces/unpublish",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({local_space_id:n,space_type:"dashboard_space"})}),t=await e.json().catch(()=>({}));if(!e.ok)return void p(t.error||"Unpublish failed.");E(t.status||null)}catch(e){p("Unpublish failed.")}finally{A(!1)}}(0,r.useEffect)(()=>{n&&P()},[n,P]);let J=(null==C?void 0:C.shared)||(null==C?void 0:C.status)==="published";return D?(0,w.createPortal)((0,a.jsx)("div",{className:"space-share-overlay",onClick:i,children:(0,a.jsxs)("div",{className:"space-share-modal",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Share ".concat(s),children:[(0,a.jsxs)("div",{className:"ssm-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"ssm-eyebrow",children:"Share space"}),(0,a.jsx)("h2",{className:"ssm-title",children:s})]}),(0,a.jsx)("button",{type:"button",className:"ssm-close",onClick:i,"aria-label":"Close",children:(0,a.jsx)(b,{})})]}),m?(0,a.jsx)("div",{className:"ssm-error",children:m}):null,(0,a.jsxs)("section",{className:"ssm-section",children:[(0,a.jsx)("h3",{className:"ssm-section-title",children:"Public link"}),(0,a.jsx)("p",{className:"ssm-note",children:"Anyone with the link can view every artifact in this space. New and moved-in artifacts are included automatically."}),(0,a.jsxs)("form",{className:"ssm-form",onSubmit:z,children:[(0,a.jsxs)("label",{className:"ssm-field",children:[(0,a.jsx)("span",{children:"Expires in (days)"}),(0,a.jsx)("input",{type:"number",min:"0",max:"90",value:x,onChange:e=>v(e.target.value)})]}),(0,a.jsxs)("label",{className:"ssm-field",children:[(0,a.jsx)("span",{children:"Max views"}),(0,a.jsx)("input",{type:"number",min:"0",value:j,onChange:e=>y(e.target.value)})]}),(0,a.jsxs)("label",{className:"ssm-check",children:[(0,a.jsx)("input",{type:"checkbox",checked:k,onChange:e=>N(e.target.checked)}),(0,a.jsx)("span",{children:"Require email verification"})]}),(0,a.jsx)("button",{type:"submit",className:"ssm-btn ssm-btn-primary",disabled:u,children:u?"Creating…":"Create link"})]}),(0,a.jsxs)("div",{className:"ssm-links",children:[c?(0,a.jsx)("div",{className:"ssm-muted",children:"Loading…"}):null,c||0!==l.length?null:(0,a.jsx)("div",{className:"ssm-muted",children:"No active links."}),l.map(e=>(0,a.jsxs)("div",{className:"ssm-link",children:[(0,a.jsxs)("div",{className:"ssm-link-main",children:[(0,a.jsx)("input",{className:"ssm-link-url",readOnly:!0,value:O(e.token),onFocus:e=>e.target.select()}),(0,a.jsx)("button",{type:"button",className:"ssm-btn ssm-btn-sm",onClick:()=>F(e.token,e.id),children:f===e.id?"Copied":"Copy"}),(0,a.jsx)("button",{type:"button",className:"ssm-btn ssm-btn-sm ssm-btn-danger",onClick:()=>W(e.id),children:"Revoke"})]}),(0,a.jsxs)("div",{className:"ssm-link-meta",children:["Expires ",function(e){if(!e)return"never";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch(t){return e}}(e.expires_at)," \xb7 ",e.access_count,null!=e.max_views?"/".concat(e.max_views):""," views",e.require_email_otp?" \xb7 email-gated":""]})]},e.id))]})]}),S?(0,a.jsxs)("section",{className:"ssm-section",children:[(0,a.jsx)("h3",{className:"ssm-section-title",children:"Org workspace"}),(0,a.jsx)("p",{className:"ssm-note",children:"Publish this space to your organization. Only signed-in teammates can see it."}),J?(0,a.jsxs)("div",{className:"ssm-cloud-status",children:[(0,a.jsx)("span",{className:"ssm-badge ssm-badge-on",children:"Published"}),(0,a.jsxs)("span",{className:"ssm-muted",children:[(null==C?void 0:C.visibility)||"org"," \xb7 ",null!=(t=null==C?void 0:C.resource_count)?t:0," artifacts indexed"]}),(0,a.jsx)("button",{type:"button",className:"ssm-btn ssm-btn-sm ssm-btn-danger",onClick:U,disabled:I,children:I?"…":"Unpublish"})]}):(0,a.jsxs)("div",{className:"ssm-form",children:[(0,a.jsxs)("label",{className:"ssm-field",children:[(0,a.jsx)("span",{children:"Visibility"}),(0,a.jsxs)("select",{value:L,onChange:e=>M(e.target.value),children:[(0,a.jsx)("option",{value:"org",children:"Whole organization"}),(0,a.jsx)("option",{value:"team",children:"Team"}),(0,a.jsx)("option",{value:"private",children:"Private"})]})]}),(0,a.jsx)("button",{type:"button",className:"ssm-btn ssm-btn-primary",onClick:B,disabled:I,children:I?"Publishing…":"Publish to org"})]})]}):null]})}),document.body):null}function k(e){let{space:t,active:n,count:s,onActivate:i,onRename:l,onDelete:o,onShare:c,isEmpty:d,canDelete:u,onMoveArtifactHere:h,dragOverSpaceId:m,setDragOverSpaceId:p,pointerDropSpaceId:f}=e,[g,x]=(0,r.useState)(!1),[v,j]=(0,r.useState)(t.name),[w,b]=(0,r.useState)(!1),y=(0,r.useRef)(null),k=(0,r.useRef)(null);function N(){x(!1);let e=v.trim();e&&e!==t.name?l(t.id,e):j(t.name)}return(0,r.useEffect)(()=>{j(t.name)},[t.name]),(0,r.useEffect)(()=>{if(w)return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e);function e(e){var t;(null==(t=y.current)?void 0:t.contains(e.target))||b(!1)}},[w]),(0,r.useEffect)(()=>{if(g){var e,t;null==(e=k.current)||e.focus(),null==(t=k.current)||t.select()}},[g]),(0,a.jsxs)("div",{"data-space-id":t.id,className:"space-chip"+(n?" is-active":"")+(m===t.id||f===t.id?" is-drop-target":""),onClick:()=>{g||i(t.id)},onDoubleClick:e=>{e.stopPropagation(),x(!0)},onContextMenu:e=>{e.preventDefault(),b(!0)},onDragOver:e=>{e.preventDefault(),p(t.id)},onDragLeave:()=>p(e=>e===t.id?null:e),onDrop:e=>{e.preventDefault();let n=e.dataTransfer.getData("text/x-artifact-id");n&&h(n,t.id),p(null)},title:g?"":"Click to switch \xb7 Double-click to rename \xb7 Right-click for more",children:[g?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{ref:k,className:"space-chip-input",value:v,onChange:e=>j(e.target.value),onBlur:N,onKeyDown:e=>{"Enter"===e.key?N():"Escape"===e.key&&(x(!1),j(t.name))},maxLength:32}),d&&u&&(0,a.jsx)("button",{type:"button",className:"space-chip-action space-chip-action--delete",onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),o(t.id)},"aria-label":"Delete ".concat(t.name),title:"Delete empty space",tabIndex:-1,children:(0,a.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"3.5",y1:"3.5",x2:"12.5",y2:"12.5"}),(0,a.jsx)("line",{x1:"12.5",y1:"3.5",x2:"3.5",y2:"12.5"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"space-chip-name",children:t.name}),s>0&&(0,a.jsx)("span",{className:"space-chip-count",children:s})]}),w&&(0,a.jsxs)("div",{className:"space-chip-menu",ref:y,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("button",{type:"button",onClick:()=>{b(!1),x(!0)},children:"Rename"}),(0,a.jsx)("button",{type:"button",onClick:()=>{b(!1),c(t.id)},children:"Share"}),(0,a.jsxs)("button",{type:"button",disabled:!u||!d,onClick:()=>{b(!1),u&&d&&o(t.id)},title:d?u?"Delete this empty space":"Cannot delete the last space":"Move or delete its artifacts first",children:["Delete",d?"":" (not empty)"]})]})]})}function N(e){let{artifact:t,spaces:n,activeSpaceId:s,hoveredDockId:i,setHoveredDockId:c,onRestore:d,onMove:u}=e,h=(0,j.o0)(t.kind),[m,p]=(0,r.useState)(!1),f=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(m)return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e);function e(e){var t;(null==(t=f.current)?void 0:t.contains(e.target))||p(!1)}},[m]);let g=n.filter(e=>e.id!==s);return(0,a.jsxs)("div",{className:"dock-item",onMouseEnter:()=>c(t.id),onMouseLeave:()=>c(e=>e===t.id?null:e),onContextMenu:e=>{e.preventDefault(),p(!0)},draggable:!0,onDragStart:e=>{e.dataTransfer.setData("text/x-artifact-id",t.id),e.dataTransfer.effectAllowed="move"},children:[(0,a.jsx)("button",{type:"button",className:"dock-card",onClick:()=>d(t.id),"aria-label":"Restore: ".concat(t.title),title:t.title||"Artifact",children:(0,a.jsx)("div",{className:"dock-thumb",children:t.content?h?(0,a.jsx)("iframe",{srcDoc:(0,j.sV)(t.content),sandbox:"allow-same-origin",title:"Thumbnail: ".concat(t.title),tabIndex:-1,"aria-hidden":"true",loading:"lazy"}):(0,a.jsx)("div",{className:"win-md",children:(0,a.jsx)(l.oz,{remarkPlugins:[o.A],children:t.content})}):(0,a.jsx)("div",{className:"dock-thumb-empty",children:t.kind||"doc"})})}),i===t.id&&!m&&(0,a.jsxs)("div",{className:"dock-preview",role:"tooltip",children:[(0,a.jsxs)("div",{className:"dock-preview-title",children:[(0,a.jsx)("span",{className:"artifact-kind-badge "+(t.kind||"text"),children:t.kind}),(0,a.jsx)("b",{children:t.title||"Artifact"})]}),(0,a.jsx)("div",{className:"dock-preview-body"+(h?" is-html":" is-md"),children:h?(0,a.jsx)("iframe",{srcDoc:(0,j.sV)(t.content),sandbox:"allow-scripts allow-same-origin",title:"Preview: ".concat(t.title),tabIndex:-1,"aria-hidden":"true"}):(0,a.jsx)("div",{className:"win-md",children:(0,a.jsx)(l.oz,{remarkPlugins:[o.A],children:t.content||""})})})]}),m&&(0,a.jsxs)("div",{className:"dock-item-menu",ref:f,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"dock-item-menu-label",children:"Move to space"}),0===g.length?(0,a.jsx)("div",{className:"dock-item-menu-empty",children:"No other spaces"}):g.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{u(t.id,e.id),p(!1)},children:e.name},e.id)),(0,a.jsx)("div",{className:"dock-item-menu-divider"}),(0,a.jsx)("button",{type:"button",onClick:()=>{d(t.id),p(!1)},children:"Restore"})]})]})}function S(e){let{spaces:t,activeSpaceId:n,setActiveSpaceId:s,createSpace:i,renameSpace:l,deleteSpace:o,moveArtifactToSpace:c,artifacts:d,dockedArtifacts:u,minimizedIds:h,hoveredDockId:m,setHoveredDockId:p,toggleMinimize:f,pointerDropSpaceId:g}=e,[x,v]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),b=(0,r.useMemo)(()=>{let e=new Map;for(let n of t)e.set(n.id,[]);for(let t of d||[]){let n=t.space_id||"default";e.has(n)&&e.get(n).push(t.id)}return e},[t,d]);function S(e,t){c(e,t)}return(0,a.jsxs)("div",{className:"artifact-dock",role:"toolbar","aria-label":"Spaces and minimized artifacts",children:[(0,a.jsxs)("div",{className:"dock-spaces",children:[t.map(e=>(0,a.jsx)(k,{space:e,active:e.id===n,count:(b.get(e.id)||[]).filter(e=>!h[e]).length,isEmpty:0===(b.get(e.id)||[]).length,onActivate:s,onRename:l,onDelete:o,onShare:w,canDelete:t.length>1,onMoveArtifactHere:S,dragOverSpaceId:x,setDragOverSpaceId:v,pointerDropSpaceId:g},e.id)),(0,a.jsx)("button",{type:"button",className:"space-add",onClick:()=>i(),"aria-label":"Create new space",title:"New space",children:(0,a.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),u.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"dock-divider","aria-hidden":"true"}),(0,a.jsx)("div",{className:"dock-items",children:u.map(e=>(0,a.jsx)(N,{artifact:e,spaces:t,activeSpaceId:n,hoveredDockId:m,setHoveredDockId:p,onRestore:f,onMove:S},e.id))})]}),j?(0,a.jsx)(y,{spaceId:j,spaceName:(t.find(e=>e.id===j)||{}).name||"Space",onClose:()=>w(null)}):null]})}function _(e){let{onActivate:t}=e,n=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=n.current;if(!e)return;let t=e=>(0,j.x2)(e);return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]),(0,a.jsx)("div",{ref:n,className:"iframe-focus-shield","aria-hidden":"true",onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),t()}})}function C(e){let{confirmDeleteId:t,setConfirmDeleteId:n,deleteArtifactById:s,setMoveMenu:r}=e,{artifacts:c,visibleArtifacts:d,frontArtifactId:u,zForArtifact:h,artifactLayout:m,registerArtifactFrame:p}=(0,i.M)(),f=m.setBoardEl,g=m.getLayout,x=m.draggingId,v=m.resizingId,w=m.selectedArtifactId,b=m.toggleMinimize,y=m.setFullscreenId,k=m.downloadArtifact,N=m.startDrag,S=m.startResize,C=m.bringToFront;return(0,a.jsx)("div",{ref:f,className:"canvas-board canvas-board--docked",children:d.map(e=>{let i=c.findIndex(t=>t.id===e.id),d=g(e.id,i),m=h(e),f=(0,j.o0)(e.kind),E=e.id===u;return(0,a.jsxs)("div",{className:"artifact-window-wrap"+(x===e.id?" is-dragging":""),"data-dragging":x===e.id?"true":"false","data-resizing":v===e.id?"true":"false",style:{transform:"translate3d(".concat(d.x,"px, ").concat(d.y,"px, 0)"),width:d.width,height:d.height,zIndex:m},onPointerDown:()=>C(e.id),children:[(0,a.jsxs)("div",{className:"window artifact-window"+(e.id===w?" artifact-window--new":""),children:[(0,a.jsx)("div",{className:"winbar",onPointerDown:t=>N(t,e.id),onDoubleClick:t=>{t.target.closest("button, i, .confirm-label")||y(e.id)},onContextMenu:t=>{t.target.closest("button, i, .confirm-label")||(t.preventDefault(),r({artifactId:e.id,x:t.clientX,y:t.clientY}))},title:"Drag onto a space chip to move \xb7 Right-click for more \xb7 Double-click to expand",children:t===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"confirm-label",children:"Delete permanently?"}),(0,a.jsx)("button",{className:"confirm-cancel",onClick:()=>n(null),children:"Cancel"}),(0,a.jsx)("button",{className:"confirm-delete",onClick:()=>s(e.id),children:"Delete"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"dot-close",onClick:()=>n(e.id),title:"Delete"}),(0,a.jsx)("i",{className:"dot-minimize",onClick:()=>b(e.id),title:"Minimize"}),(0,a.jsx)("i",{className:"dot-zoom",onClick:()=>y(e.id),title:"Expand"}),(0,a.jsx)("b",{children:e.title||"Artifact"}),(0,a.jsx)("span",{className:"artifact-kind-badge "+(e.kind||"text"),children:e.kind}),(0,a.jsx)("button",{className:"winbar-dl",onClick:()=>k(e),title:(0,j.o0)(e.kind)?"Download .html":"Download .md",children:(0,a.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M8 2v9M4 7l4 4 4-4"}),(0,a.jsx)("line",{x1:"2",y1:"14",x2:"14",y2:"14"})]})})]})}),(0,a.jsxs)("div",{className:"win-content",onWheelCapture:j.qE,children:[x===e.id&&(0,a.jsx)("div",{className:"drag-blocker"}),v===e.id&&(0,a.jsx)("div",{className:"resize-blocker"}),f?(0,a.jsxs)(a.Fragment,{children:[!E&&(0,a.jsx)(_,{onActivate:()=>C(e.id)}),(0,a.jsx)("iframe",{ref:(0,j.Jw)(p),srcDoc:(0,j.sV)(e.content),sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",title:e.title,onLoad:j.MZ})]}):(0,a.jsx)("div",{className:"win-md",children:(0,a.jsx)(l.oz,{remarkPlugins:[o.A],children:e.content||""})})]})]}),["nw","n","ne","e","se","s","sw","w"].map(t=>(0,a.jsx)("div",{className:"resize-edge resize-"+t,onPointerDown:n=>S(n,e.id,t)},t))]},e.id)})})}function E(e){let{artifact:t,docked:n,onClose:s,confirmDeleteId:i,setConfirmDeleteId:c,deleteArtifactById:d,toggleMinimize:u,downloadArtifact:h,registerArtifactFrame:m}=e,[p,f]=(0,r.useState)("enter"),g=(0,r.useRef)(!1);function x(e){g.current||(g.current=!0,f("exit"),setTimeout(()=>{"function"==typeof e&&e(),s()},260))}return(0,r.useEffect)(()=>{let e={first:0,second:0};return e.first=requestAnimationFrame(()=>{e.second=requestAnimationFrame(()=>f("open"))}),()=>{e.first&&cancelAnimationFrame(e.first),e.second&&cancelAnimationFrame(e.second)}},[]),(0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&x()}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,a.jsxs)("div",{className:"artifact-fs"+(n?" artifact-fs--docked":""),"data-phase":p,children:[(0,a.jsx)("div",{className:"winbar artifact-fs-bar",onDoubleClick:e=>{e.target.closest("button, i, .confirm-label")||x()},title:"Double-click to exit fullscreen",children:i===t.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"confirm-label",children:"Delete permanently?"}),(0,a.jsx)("button",{className:"confirm-cancel",onClick:()=>c(null),children:"Cancel"}),(0,a.jsx)("button",{className:"confirm-delete",onClick:()=>x(()=>d(t.id)),children:"Delete"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"dot-close",onClick:()=>c(t.id),title:"Delete"}),(0,a.jsx)("i",{className:"dot-minimize",onClick:()=>x(()=>u(t.id)),title:"Minimize"}),(0,a.jsx)("i",{className:"dot-zoom",onClick:()=>x(),title:"Exit fullscreen"}),(0,a.jsx)("b",{children:t.title||"Artifact"}),(0,a.jsx)("span",{className:"artifact-kind-badge "+(t.kind||"text"),children:t.kind}),(0,a.jsx)("button",{className:"winbar-dl",onClick:()=>h(t),title:(0,j.o0)(t.kind)?"Download .html":"Download .md",children:(0,a.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M8 2v9M4 7l4 4 4-4"}),(0,a.jsx)("line",{x1:"2",y1:"14",x2:"14",y2:"14"})]})})]})}),(0,a.jsx)("div",{className:"artifact-fs-content",children:(0,j.o0)(t.kind)?(0,a.jsx)("iframe",{ref:(0,j.Jw)(m),srcDoc:(0,j.sV)(t.content),sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",title:t.title,onLoad:j.MZ}):(0,a.jsx)("div",{className:"win-md",children:(0,a.jsx)(l.oz,{remarkPlugins:[o.A],children:t.content||""})})})]})}function L(){let{mainAgent:e,runtimeActions:t,runtimeSignalCount:n,pendingApprovals:s,heartbeatTasks:r,localProcesses:l,localActions:o}=(0,i.M)(),m=t.runtimeOpen,p=t.setRuntimeOpen,f=e.busy,x=e.hasBgActivity,v=e.bgAgentList,j=e.busyStartTime,w=e.agentPhase,b=e.liveSteps,y=t.decideGenericApproval,k=t.approvalBusyId,N=t.ensureOpsAgentAction,S=t.processHeartbeatOnceAction,_=t.runtimeActionBusy;return(0,a.jsxs)("div",{className:"runtime-menu-wrap",children:[(0,a.jsxs)("button",{className:"runtime-menu-btn"+(m?" on":"")+(f||x?" runtime-menu-btn--busy":""),onClick:()=>p(e=>!e),title:f?"Main agent is working — click to see live activity":x?"".concat(v.filter(e=>"running"===e.status).length," background agent(s) working"):"Runtime activity","aria-label":"Runtime activity","aria-expanded":m,children:[(0,a.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M4 12h4l2-7 4 14 2-7h4"})}),(f||x)&&(0,a.jsx)("span",{className:"runtime-busy-dot","aria-hidden":"true"}),!f&&!x&&n>0&&(0,a.jsx)("span",{children:n})]}),m&&(0,a.jsxs)("div",{className:"runtime-popover",children:[(0,a.jsxs)("div",{className:"runtime-popover-head",children:[(0,a.jsx)("b",{children:"Operator Command Center"}),(0,a.jsx)("small",{children:"Approvals, running work, failed runs, and task queues"}),(0,a.jsxs)("div",{className:"runtime-quick-links","aria-label":"Operator quick links",children:[(0,a.jsx)("a",{href:"/approvals",children:"Approvals"}),(0,a.jsx)("a",{href:"/tasks",children:"Tasks"}),(0,a.jsx)("a",{href:"/activity",children:"Activity"}),(0,a.jsx)("a",{href:"/runtime",children:"Runtime"})]})]}),f&&(0,a.jsxs)("div",{className:"runtime-live-section",children:[(0,a.jsxs)("div",{className:"runtime-live-header",children:[(0,a.jsxs)("div",{className:"runtime-live-title-row",children:[(0,a.jsx)("span",{className:"runtime-section-title",children:"Main Agent"}),(0,a.jsxs)("span",{className:"runtime-live-phase",children:["thinking"===w&&"thinking","responding"===w&&"responding","tool"===w&&"using tools","synthesis"===w&&"synthesizing"]})]}),(0,a.jsxs)("div",{className:"runtime-live-meta",children:[j&&(0,a.jsx)("span",{className:"runtime-live-elapsed",children:(0,a.jsx)(h,{startTime:j})}),(0,a.jsxs)("span",{className:"runtime-live-badge",children:[(0,a.jsx)("span",{className:"runtime-live-badge-dot","aria-hidden":"true"}),"Live"]})]})]}),b.length>0?(0,a.jsx)("div",{className:"runtime-live-steps",children:b.map(e=>(0,a.jsxs)("div",{className:"runtime-live-step runtime-live-step--".concat(e.status),children:[(0,a.jsxs)("span",{className:"runtime-live-step-icon","aria-hidden":"true",children:["running"===e.status&&(0,a.jsx)(c,{}),"done"===e.status&&(0,a.jsx)(d,{}),"error"===e.status&&(0,a.jsx)(u,{})]}),(0,a.jsx)("code",{className:"runtime-live-step-name",children:e.name.replace(/_/g," ")}),g(e.name,e.input)&&(0,a.jsx)("span",{className:"runtime-live-step-sub",children:g(e.name,e.input)})]},e.id))}):(0,a.jsxs)("div",{className:"runtime-live-thinking",children:[(0,a.jsx)("span",{className:"runtime-live-thinking-icon",children:(0,a.jsx)(c,{})}),(0,a.jsxs)("span",{children:["thinking"===w&&"Waiting for first response…","responding"===w&&"Streaming response…","synthesis"===w&&"Synthesizing results…","idle"===w&&"Processing…"]})]})]}),v.length>0&&(0,a.jsxs)("div",{className:"runtime-section",children:[(0,a.jsxs)("span",{className:"runtime-section-title",children:["Background agents",x&&(0,a.jsxs)("span",{className:"runtime-live-badge",style:{marginLeft:8},children:[(0,a.jsx)("span",{className:"runtime-live-badge-dot","aria-hidden":"true"}),"Live"]})]}),(0,a.jsx)("div",{className:"runtime-live-steps",children:v.map(e=>(0,a.jsxs)("div",{className:"runtime-live-step runtime-live-step--".concat("running"===e.status?"running":"failed"===e.status?"error":"done"),children:[(0,a.jsxs)("span",{className:"runtime-live-step-icon","aria-hidden":"true",children:["running"===e.status&&(0,a.jsx)(c,{}),"complete"===e.status&&(0,a.jsx)(d,{}),"failed"===e.status&&(0,a.jsx)(u,{})]}),(0,a.jsx)("code",{className:"runtime-live-step-name",children:e.agent_name}),(0,a.jsx)("span",{className:"runtime-live-step-sub",children:e.current_tool?"".concat(e.current_tool.replace(/_/g," ")).concat(g(e.current_tool,e.current_input)?" ".concat(g(e.current_tool,e.current_input)):""):"running"===e.status?e.triggered_by?"".concat(e.triggered_by," tick"):"starting…":"complete"===e.status?"done":"failed"})]},e.agent_id))})]}),(0,a.jsx)("div",{className:"runtime-compact-stats",children:[["Approvals",s.length],["Heartbeat",r.length],["Processes",l.length],["Audit",o.length]].map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{className:"runtime-compact-stat"+(n>0?" has-value":""),children:[(0,a.jsx)("b",{children:n}),(0,a.jsx)("span",{children:t})]},t)})}),s.length>0&&(0,a.jsxs)("div",{className:"runtime-section",children:[(0,a.jsx)("span",{className:"runtime-section-title",children:"Pending approvals"}),s.slice(0,3).map(e=>(0,a.jsxs)("div",{className:"runtime-approval",children:[(0,a.jsx)("span",{children:e.summary}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>y(e.id,"approved"),disabled:k===e.id,children:"Approve"}),(0,a.jsx)("button",{className:"secondary",onClick:()=>y(e.id,"denied"),disabled:k===e.id,children:"Deny"})]})]},e.id))]}),(r.length>0||l.length>0||o.length>0)&&(0,a.jsxs)("div",{className:"runtime-section",children:[(0,a.jsx)("span",{className:"runtime-section-title",children:"Recent activity"}),r.slice(0,2).map(e=>(0,a.jsxs)("div",{className:"runtime-row",children:[(0,a.jsx)("span",{children:e.type}),(0,a.jsx)("b",{children:e.status})]},e.id)),l.slice(0,2).map(e=>(0,a.jsxs)("div",{className:"runtime-row",children:[(0,a.jsx)("span",{children:e.command}),(0,a.jsx)("b",{children:e.status})]},e.id)),o.slice(0,3).map(e=>(0,a.jsxs)("div",{className:"runtime-row",children:[(0,a.jsx)("span",{children:e.summary||e.type}),(0,a.jsx)("b",{children:e.status})]},e.id))]}),!f&&0===n&&0===v.length&&(0,a.jsx)("div",{className:"runtime-empty",children:"No active tasks right now."}),(0,a.jsxs)("div",{className:"runtime-dev-tools",children:[(0,a.jsx)("span",{className:"runtime-section-title",children:"System tools"}),(0,a.jsxs)("div",{className:"runtime-dev-row",children:[(0,a.jsx)("button",{onClick:N,disabled:"ops"===_,className:"runtime-dev-btn",children:"ops"===_?"Creating…":"Caretaker"}),(0,a.jsx)("button",{onClick:S,disabled:"worker"===_,className:"runtime-dev-btn",children:"worker"===_?"Processing…":"Heartbeat once"})]})]})]})]})}function M(e){let{x:t,y:n,spaces:s,activeSpaceId:i,onMove:l,onClose:o}=e,c=(0,r.useRef)(null),[d,u]=(0,r.useState)({left:t,top:n});(0,r.useEffect)(()=>{function e(e){var t;(null==(t=c.current)?void 0:t.contains(e.target))||o()}function t(e){"Escape"===e.key&&o()}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[o]),(0,r.useEffect)(()=>{let e=c.current;if(!e)return;let a=e.getBoundingClientRect(),s=t,i=n;s+a.width+8>window.innerWidth&&(s=Math.max(8,window.innerWidth-a.width-8)),i+a.height+8>window.innerHeight&&(i=Math.max(8,window.innerHeight-a.height-8)),u({left:s,top:i})},[t,n]);let h=s.filter(e=>e.id!==i);return"undefined"==typeof document?null:(0,w.createPortal)((0,a.jsxs)("div",{className:"winbar-move-menu",ref:c,style:{left:d.left,top:d.top},onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"winbar-move-menu-label",children:"Move to space"}),0===h.length?(0,a.jsx)("div",{className:"winbar-move-menu-empty",children:"No other spaces"}):h.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{l(e.id),o()},children:e.name},e.id))]}),document.body)}let I=(0,r.memo)(function(){let{initializing:e,activeHermesJobs:t,runtimeActions:n,mainAgent:s,approvalRun:l,artifacts:o,visibleArtifacts:c,dockedArtifacts:d,artifactLayout:u,spaces:h,registerArtifactFrame:m,designStyle:p}=(0,i.M)(),f=n.approveClaudeRun,g=n.approvalBusyId,x=u.resetArtifactLayout,v=u.layoutMode,j=u.fullscreenId,w=u.setFullscreenId,b=u.confirmDeleteId,y=u.setConfirmDeleteId,k=u.deleteArtifactById,N=u.toggleMinimize,_=u.downloadArtifact,I=u.minimizedIds,A=u.hoveredDockId,D=u.setHoveredDockId,T=u.pointerDropSpaceId,R=s.busy,O=s.liveTool,P=s.liveText,z=s.command,W=h.spaces,F=h.activeSpaceId,B=h.setActiveSpaceId,U=h.createSpace,J=h.renameSpace,q=h.deleteSpace,H=h.moveArtifactToSpace,X=h.isSwitching,[V,G]=(0,r.useState)(null);return(0,a.jsxs)("section",{className:"canvas fresh-canvas"+(X?" is-space-switching":""),children:[(0,a.jsxs)("div",{className:"toolbar fresh-toolbar",children:[(0,a.jsxs)("span",{className:"tb-wordmark","aria-label":"madarX OS",children:["madar",(0,a.jsx)("b",{children:"X"}),(0,a.jsx)("i",{children:"OS"})]}),l&&(0,a.jsx)("button",{onClick:()=>f(l.id),disabled:g===l.id,style:{border:0,borderRadius:999,padding:"7px 10px",background:"#111318",color:"#fff",fontSize:12,fontWeight:700,cursor:g?"wait":"pointer"},children:g===l.id?"Running Claude...":"Approve & Run"}),(0,a.jsxs)("div",{className:"hermes-wrap",children:[(0,a.jsxs)("span",{className:"tb-icon-btn"+(t.length>0?" on":""),role:"status","aria-label":t.length>0?"Hermes ".concat(t.length," running"):"Hermes idle",children:[(0,a.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})}),t.length>0&&(0,a.jsx)("span",{children:t.length})]}),(0,a.jsxs)("div",{className:"hermes-tooltip",role:"tooltip",children:[(0,a.jsx)("b",{children:"Hermes"}),(0,a.jsx)("small",{children:t.length>0?"".concat(t.length," running"):"idle"}),t.length>0&&(0,a.jsx)("ul",{children:t.map(e=>(0,a.jsx)("li",{children:e.title||(e.prompt?e.prompt.slice(0,60):"Untitled job")},e.id))})]})]}),(0,a.jsx)(L,{}),o.length>0&&(0,a.jsx)("button",{className:"tb-icon-btn",style:{marginLeft:"auto"},onClick:x,title:"manual"===v?"Reset to auto layout":"Auto layout active","aria-label":"manual"===v?"Reset to auto layout":"Auto layout active",children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"14",y:"3",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"14",y:"14",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"3",y:"14",width:"7",height:"7"})]})})]}),e?(0,a.jsx)("div",{className:"canvas-board canvas-board--skel","aria-hidden":"true",children:(0,a.jsx)("div",{className:"artifact-window-wrap artifact-skel-wrap artifact-skel-wrap--solo",children:(0,a.jsxs)("div",{className:"window artifact-window",children:[(0,a.jsxs)("div",{className:"winbar",children:[(0,a.jsx)("i",{className:"dot-close"}),(0,a.jsx)("i",{className:"dot-minimize"}),(0,a.jsx)("i",{className:"dot-zoom"}),(0,a.jsx)("div",{className:"skel sk-winbar-title"}),(0,a.jsx)("div",{className:"skel sk-kind-badge"})]}),(0,a.jsxs)("div",{className:"win-content artifact-skel-content",children:[(0,a.jsx)("div",{className:"skel sk-art-hero"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w90"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w80"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w65"}),(0,a.jsx)("div",{className:"skel sk-art-block"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w75"}),(0,a.jsx)("div",{className:"skel sk-line sk-line--w55"})]})]})})}):R&&0===c.length&&0===d.length?(0,a.jsx)("div",{className:"building-card-wrap",children:(0,a.jsxs)("div",{className:"building-card",children:[(0,a.jsxs)("div",{className:"building-winbar",children:[(0,a.jsxs)("div",{className:"building-dots",children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]}),(0,a.jsx)("span",{className:"building-winbar-title",children:"generate_ui"===O?"Designing ".concat(p," UI…"):"create_artifact"===O?"Building artifact…":O?"Running ".concat(O.replace(/_/g," "),"…"):"Agent composing…"}),(0,a.jsxs)("div",{className:"building-pill",children:[(0,a.jsx)("div",{className:"building-pill-dot"}),"Live"]})]}),(0,a.jsxs)("div",{className:"building-body",children:[(0,a.jsxs)("div",{className:"building-illustration",children:[(0,a.jsx)("div",{className:"building-mesh"}),(0,a.jsxs)("div",{className:"building-skeleton",children:[(0,a.jsx)("div",{className:"skel hd"}),(0,a.jsx)("div",{className:"skel la"}),(0,a.jsx)("div",{className:"skel lb"}),(0,a.jsx)("div",{className:"skel lc"}),(0,a.jsx)("div",{className:"skel ld"})]})]}),(0,a.jsxs)("div",{className:"building-footer",children:[(0,a.jsx)("div",{className:"building-footer-label",children:O?"Active tool":"Status"}),(0,a.jsx)("div",{className:"building-footer-tool",children:"generate_ui"===O?"".concat(p," design rules active"):O?O.replace(/_/g," "):"Agent is thinking…"}),P&&(0,a.jsx)("div",{className:"building-stream-text",children:P.slice(-320)})]})]})]})}):(0,a.jsxs)(a.Fragment,{children:[c.length>0?(0,a.jsx)(C,{confirmDeleteId:b,setConfirmDeleteId:y,deleteArtifactById:k,setMoveMenu:G}):0===d.length&&0===o.length?(0,a.jsx)("div",{className:"fresh-workspace",children:(0,a.jsxs)("div",{className:"fresh-hero full-width",children:[(0,a.jsx)("small",{children:"Clean workspace"}),(0,a.jsx)("h1",{children:"Start from zero."}),(0,a.jsx)("p",{children:"Your local-first agent workspace. Create agents that research competitors, generate reports, run scheduled tasks, and prepare actions for your approval — all running on your machine, backed by SQLite, with no cloud dependencies."}),(0,a.jsxs)("div",{className:"fresh-actions",children:[(0,a.jsx)("button",{onClick:()=>z("Create the first Client Workspace competitor research agent with browser scraper and report writer daily at 07:30"),children:"Create first agent"}),(0,a.jsx)("button",{className:"secondary",onClick:()=>z("Look for all Client Workspace competitors and provide the daily report"),children:"Test report flow"})]})]})}):null,(0,a.jsx)(S,{spaces:W,activeSpaceId:F,setActiveSpaceId:B,createSpace:U,renameSpace:J,deleteSpace:q,moveArtifactToSpace:H,artifacts:o,dockedArtifacts:d,minimizedIds:I,hoveredDockId:A,setHoveredDockId:D,toggleMinimize:N,pointerDropSpaceId:T})]}),j&&(()=>{let e=o.find(e=>e.id===j);return e?(0,a.jsx)(E,{artifact:e,docked:!0,onClose:()=>w(null),confirmDeleteId:b,setConfirmDeleteId:y,deleteArtifactById:k,toggleMinimize:N,downloadArtifact:_,registerArtifactFrame:m},e.id):null})(),V&&(0,a.jsx)(M,{x:V.x,y:V.y,spaces:W,activeSpaceId:F,onMove:e=>H(V.artifactId,e),onClose:()=>G(null)})]})}),A=(0,s.default)(()=>Promise.all([n.e(2769),n.e(4119),n.e(3168)]).then(n.bind(n,3168)),{loadableGenerated:{webpack:()=>[require.resolveWeak("./components/dashboard/config-panel")]},ssr:!1}),D=(0,s.default)(()=>n.e(8217).then(n.bind(n,8217)),{loadableGenerated:{webpack:()=>[require.resolveWeak("./components/dashboard/voice-panel")]},ssr:!1}),T=(0,s.default)(()=>n.e(5938).then(n.bind(n,5938)),{loadableGenerated:{webpack:()=>[require.resolveWeak("./components/dashboard/trust-mode-confirm-modal")]},ssr:!1}),R=(0,s.default)(()=>n.e(7130).then(n.bind(n,7130)),{loadableGenerated:{webpack:()=>[require.resolveWeak("./components/update-banner")]},ssr:!1});function O(){let{chatHidden:e,setChatHidden:t,configOpen:n,trustModePromptOpen:s,trustModeBusy:r,confirmEnableTrustMode:l,cancelEnableTrustMode:o,voiceOpen:c}=(0,i.M)();return(0,a.jsxs)("main",{className:"visual-frame fresh-frame"+(e?" frame-chat-hidden":""),"aria-label":"madarX OS product",children:[(0,a.jsx)(R,{}),(0,a.jsx)(v,{}),(0,a.jsx)(I,{}),e?(0,a.jsx)("button",{type:"button",className:"chat-restore-bubble",onClick:()=>t(!1),title:"Show chat panel","aria-label":"Show chat panel",children:(0,a.jsx)("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.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"})})}):null,n?(0,a.jsx)(A,{}):null,s?(0,a.jsx)(T,{open:s,busy:r,onConfirm:l,onCancel:o}):null,c?(0,a.jsx)(D,{}):null]})}function P(){return(0,a.jsx)(i.q,{children:(0,a.jsx)(O,{})})}}},e=>{e.O(0,[930,1231,8441,1255,7358],()=>e(e.s=2930)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,72,167,178,232,332,489,497,552,658,723,767,769,796,870,888,939,972,1053,1115,1177,1426,1523,1557,1562,1581,1672,1851,1990,2008,2139,2153,2162,2164,2175,2254,2334,2343,2433,2635,2640,2711,2726,2748,2837,2873,2943,3033,3076,3159,3190,3203,3395,3437,3465,3492,3499,3554,3558,3577,3629,3630,3641,3659,3745,3756,3802,3839,3870,3886,3904,3905,3942,3975,3976,4094,4095,4104,4115,4190,4204,4209,4218,4229,4231,4269,4373,4410,4431,4475,4507,4519,4530,4537,4662,4721,4819,4890,4999,5049,5085,5092,5098,5118,5120,5130,5169,5180,5207,5223,5289,5324,5331,5441,5520,5551,5588,5610,5689,5707,5722,5743,5794,5810,5850,5887,5903,5906,6002,6079,6113,6147,6186,6234,6278,6279,6341,6365,6403,6456,6496,6591,6595,6621,6667,6701,6725,6779,6799,6816,6862,7020,7060,7070,7092,7113,7237,7276,7324,7361,7440,7750,7765,7795,7823,7903,7920,7986,8059,8093,8100,8159,8227,8252,8273,8298,8312,8397,8401,8405,8578,8591,8665,8679,8732,8765,8828,8887,8907,8994,9e3,9037,9040,9154,9160,9183,9413,9442,9504,9554,9628,9873],{4441:()=>{}},_=>{_.O(0,[8441,1255,7358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1226],{677:(e,t,a)=>{"use strict";a.d(t,{default:()=>s});var r=a(5155),c=a(2115);function s(){let[e,t]=(0,c.useState)([]),[a,s]=(0,c.useState)("");return(0,c.useEffect)(()=>{s(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>t(e.projects||[])).catch(()=>{})},[]),(0,r.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,r.jsxs)("select",{value:a,onChange:e=>{var t;s(t=e.target.value),t?localStorage.setItem("madarx.activeProjectId",t):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:t||null}}))},"aria-label":"Active project",children:[(0,r.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},1537:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var r=a(5155),c=a(6504),s=a(5459);function o(e){let{markdown:t}=e;return(0,r.jsx)(c.oz,{remarkPlugins:[s.A],children:t})}},2438:(e,t,a)=>{Promise.resolve().then(a.bind(a,677)),Promise.resolve().then(a.bind(a,1537)),Promise.resolve().then(a.t.bind(a,2619,23))}},e=>{e.O(0,[2619,930,8441,1255,7358],()=>e(e.s=2438)),_N_E=e.O()}]);