solace-agent-mesh 1.7.1__py3-none-any.whl → 1.13.2__py3-none-any.whl

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.

Potentially problematic release.


This version of solace-agent-mesh might be problematic. Click here for more details.

Files changed (447) hide show
  1. solace_agent_mesh/agent/adk/alembic/README +74 -0
  2. solace_agent_mesh/agent/adk/alembic/env.py +77 -0
  3. solace_agent_mesh/agent/adk/alembic/script.py.mako +28 -0
  4. solace_agent_mesh/agent/adk/alembic/versions/e2902798564d_adk_session_db_upgrade.py +52 -0
  5. solace_agent_mesh/agent/adk/alembic.ini +112 -0
  6. solace_agent_mesh/agent/adk/artifacts/filesystem_artifact_service.py +164 -0
  7. solace_agent_mesh/agent/adk/artifacts/s3_artifact_service.py +163 -0
  8. solace_agent_mesh/agent/adk/callbacks.py +752 -127
  9. solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +99 -7
  10. solace_agent_mesh/agent/adk/intelligent_mcp_callbacks.py +52 -5
  11. solace_agent_mesh/agent/adk/mcp_content_processor.py +1 -1
  12. solace_agent_mesh/agent/adk/models/lite_llm.py +34 -16
  13. solace_agent_mesh/agent/adk/models/oauth2_token_manager.py +24 -137
  14. solace_agent_mesh/agent/adk/runner.py +66 -8
  15. solace_agent_mesh/agent/adk/schema_migration.py +88 -0
  16. solace_agent_mesh/agent/adk/services.py +41 -1
  17. solace_agent_mesh/agent/adk/setup.py +220 -32
  18. solace_agent_mesh/agent/adk/stream_parser.py +229 -40
  19. solace_agent_mesh/agent/protocol/event_handlers.py +219 -33
  20. solace_agent_mesh/agent/proxies/a2a/component.py +572 -75
  21. solace_agent_mesh/agent/proxies/a2a/config.py +80 -4
  22. solace_agent_mesh/agent/proxies/base/component.py +188 -22
  23. solace_agent_mesh/agent/proxies/base/proxy_task_context.py +3 -1
  24. solace_agent_mesh/agent/sac/app.py +37 -12
  25. solace_agent_mesh/agent/sac/component.py +322 -52
  26. solace_agent_mesh/agent/sac/patch_adk.py +8 -16
  27. solace_agent_mesh/agent/sac/task_execution_context.py +90 -0
  28. solace_agent_mesh/agent/tools/__init__.py +3 -0
  29. solace_agent_mesh/agent/tools/audio_tools.py +3 -3
  30. solace_agent_mesh/agent/tools/builtin_artifact_tools.py +698 -24
  31. solace_agent_mesh/agent/tools/deep_research_tools.py +2161 -0
  32. solace_agent_mesh/agent/tools/peer_agent_tool.py +82 -15
  33. solace_agent_mesh/agent/tools/time_tools.py +126 -0
  34. solace_agent_mesh/agent/tools/tool_config_types.py +54 -2
  35. solace_agent_mesh/agent/tools/web_search_tools.py +279 -0
  36. solace_agent_mesh/agent/tools/web_tools.py +125 -17
  37. solace_agent_mesh/agent/utils/artifact_helpers.py +243 -5
  38. solace_agent_mesh/agent/utils/context_helpers.py +17 -0
  39. solace_agent_mesh/assets/docs/404.html +6 -6
  40. solace_agent_mesh/assets/docs/assets/css/{styles.906a1503.css → styles.8162edfb.css} +1 -1
  41. solace_agent_mesh/assets/docs/assets/js/05749d90.19ac4f35.js +1 -0
  42. solace_agent_mesh/assets/docs/assets/js/15ba94aa.e186750d.js +1 -0
  43. solace_agent_mesh/assets/docs/assets/js/15e40e79.434bb30f.js +1 -0
  44. solace_agent_mesh/assets/docs/assets/js/17896441.e612dfb4.js +1 -0
  45. solace_agent_mesh/assets/docs/assets/js/2279.550aa580.js +2 -0
  46. solace_agent_mesh/assets/docs/assets/js/{17896441.a5e82f9b.js.LICENSE.txt → 2279.550aa580.js.LICENSE.txt} +6 -0
  47. solace_agent_mesh/assets/docs/assets/js/240a0364.83e37aa8.js +1 -0
  48. solace_agent_mesh/assets/docs/assets/js/2e32b5e0.2f0db237.js +1 -0
  49. solace_agent_mesh/assets/docs/assets/js/3a6c6137.7e61915d.js +1 -0
  50. solace_agent_mesh/assets/docs/assets/js/3ac1795d.7f7ab1c1.js +1 -0
  51. solace_agent_mesh/assets/docs/assets/js/3ff0015d.e53c9b78.js +1 -0
  52. solace_agent_mesh/assets/docs/assets/js/41adc471.0e95b87c.js +1 -0
  53. solace_agent_mesh/assets/docs/assets/js/4667dc50.bf2ad456.js +1 -0
  54. solace_agent_mesh/assets/docs/assets/js/49eed117.493d6f99.js +1 -0
  55. solace_agent_mesh/assets/docs/assets/js/{509e993c.4c7a1a6d.js → 509e993c.a1fbf45a.js} +1 -1
  56. solace_agent_mesh/assets/docs/assets/js/547e15cc.8e6da617.js +1 -0
  57. solace_agent_mesh/assets/docs/assets/js/55b7b518.29d6e75d.js +1 -0
  58. solace_agent_mesh/assets/docs/assets/js/5b8d9c11.d4eb37b8.js +1 -0
  59. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.1ee87753.js +1 -0
  60. solace_agent_mesh/assets/docs/assets/js/60702c0e.a8bdd79b.js +1 -0
  61. solace_agent_mesh/assets/docs/assets/js/64195356.09dbd087.js +1 -0
  62. solace_agent_mesh/assets/docs/assets/js/66d4869e.30340bd3.js +1 -0
  63. solace_agent_mesh/assets/docs/assets/js/6aaedf65.7253541d.js +1 -0
  64. solace_agent_mesh/assets/docs/assets/js/6d84eae0.fd23ba4a.js +1 -0
  65. solace_agent_mesh/assets/docs/assets/js/729898df.7249e9fd.js +1 -0
  66. solace_agent_mesh/assets/docs/assets/js/7e294c01.7c5f6906.js +1 -0
  67. solace_agent_mesh/assets/docs/assets/js/8024126c.e3467286.js +1 -0
  68. solace_agent_mesh/assets/docs/assets/js/81a99df0.7ed65d45.js +1 -0
  69. solace_agent_mesh/assets/docs/assets/js/82fbfb93.161823a5.js +1 -0
  70. solace_agent_mesh/assets/docs/assets/js/924ffdeb.975e428a.js +1 -0
  71. solace_agent_mesh/assets/docs/assets/js/94e8668d.16083b3f.js +1 -0
  72. solace_agent_mesh/assets/docs/assets/js/9bb13469.4523ae20.js +1 -0
  73. solace_agent_mesh/assets/docs/assets/js/a7d42657.a956689d.js +1 -0
  74. solace_agent_mesh/assets/docs/assets/js/a94703ab.3e5fbcb3.js +1 -0
  75. solace_agent_mesh/assets/docs/assets/js/ab9708a8.3e563275.js +1 -0
  76. solace_agent_mesh/assets/docs/assets/js/c93cbaa0.0e0d8baf.js +1 -0
  77. solace_agent_mesh/assets/docs/assets/js/cab03b5b.6a073091.js +1 -0
  78. solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.07e170dd.js +1 -0
  79. solace_agent_mesh/assets/docs/assets/js/e04b235d.06d23db6.js +1 -0
  80. solace_agent_mesh/assets/docs/assets/js/e1b6eeb4.deb2b62e.js +1 -0
  81. solace_agent_mesh/assets/docs/assets/js/e3d9abda.1476f570.js +1 -0
  82. solace_agent_mesh/assets/docs/assets/js/e6f9706b.acc800d3.js +1 -0
  83. solace_agent_mesh/assets/docs/assets/js/e92d0134.c147a429.js +1 -0
  84. solace_agent_mesh/assets/docs/assets/js/ee0c2fe7.94d0a351.js +1 -0
  85. solace_agent_mesh/assets/docs/assets/js/f284c35a.cc97854c.js +1 -0
  86. solace_agent_mesh/assets/docs/assets/js/main.d634009f.js +2 -0
  87. solace_agent_mesh/assets/docs/assets/js/runtime~main.27bb82a7.js +1 -0
  88. solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +68 -68
  89. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +50 -50
  90. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +42 -42
  91. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +55 -55
  92. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +75 -75
  93. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/image-tools/index.html +81 -0
  94. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +67 -50
  95. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/research-tools/index.html +136 -0
  96. solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +178 -144
  97. solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +43 -42
  98. solace_agent_mesh/assets/docs/docs/documentation/components/index.html +20 -18
  99. solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +23 -23
  100. solace_agent_mesh/assets/docs/docs/documentation/components/platform-service/index.html +33 -0
  101. solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +45 -45
  102. solace_agent_mesh/assets/docs/docs/documentation/components/projects/index.html +98 -112
  103. solace_agent_mesh/assets/docs/docs/documentation/components/prompts/index.html +147 -0
  104. solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +208 -125
  105. solace_agent_mesh/assets/docs/docs/documentation/components/speech/index.html +52 -0
  106. solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +28 -28
  107. solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +29 -29
  108. solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +14 -14
  109. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/index.html +47 -0
  110. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/kubernetes-deployment-guide/index.html +197 -0
  111. solace_agent_mesh/assets/docs/docs/documentation/deploying/logging/index.html +67 -53
  112. solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +17 -17
  113. solace_agent_mesh/assets/docs/docs/documentation/deploying/proxy_configuration/index.html +49 -0
  114. solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +38 -38
  115. solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +87 -87
  116. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +67 -49
  117. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +17 -17
  118. solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +51 -51
  119. solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +22 -22
  120. solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +27 -27
  121. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +135 -135
  122. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +66 -66
  123. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +51 -51
  124. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +50 -38
  125. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +86 -86
  126. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +51 -51
  127. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +24 -24
  128. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +30 -30
  129. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +44 -44
  130. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/teams-integration/index.html +115 -0
  131. solace_agent_mesh/assets/docs/docs/documentation/enterprise/agent-builder/index.html +50 -23
  132. solace_agent_mesh/assets/docs/docs/documentation/enterprise/connectors/index.html +29 -24
  133. solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +21 -21
  134. solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +40 -37
  135. solace_agent_mesh/assets/docs/docs/documentation/enterprise/openapi-tools/index.html +324 -0
  136. solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +96 -66
  137. solace_agent_mesh/assets/docs/docs/documentation/enterprise/secure-user-delegated-access/index.html +181 -181
  138. solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +75 -75
  139. solace_agent_mesh/assets/docs/docs/documentation/enterprise/wheel-installation/index.html +27 -27
  140. solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +44 -44
  141. solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +39 -38
  142. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +30 -30
  143. solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +18 -18
  144. solace_agent_mesh/assets/docs/docs/documentation/getting-started/vibe_coding/index.html +62 -0
  145. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/artifact-storage/index.html +135 -114
  146. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +37 -37
  147. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +14 -14
  148. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +27 -25
  149. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +69 -69
  150. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +72 -72
  151. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/session-storage/index.html +112 -112
  152. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/user-feedback/index.html +28 -28
  153. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +42 -42
  154. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +20 -20
  155. solace_agent_mesh/assets/docs/docs/documentation/migrations/platform-service-split/index.html +85 -0
  156. solace_agent_mesh/assets/docs/lunr-index-1768329217460.json +1 -0
  157. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  158. solace_agent_mesh/assets/docs/search-doc-1768329217460.json +1 -0
  159. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  160. solace_agent_mesh/assets/docs/sitemap.xml +1 -1
  161. solace_agent_mesh/cli/__init__.py +1 -1
  162. solace_agent_mesh/cli/commands/add_cmd/__init__.py +3 -1
  163. solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +6 -1
  164. solace_agent_mesh/cli/commands/add_cmd/proxy_cmd.py +100 -0
  165. solace_agent_mesh/cli/commands/eval_cmd.py +1 -1
  166. solace_agent_mesh/cli/commands/init_cmd/__init__.py +15 -0
  167. solace_agent_mesh/cli/commands/init_cmd/directory_step.py +1 -1
  168. solace_agent_mesh/cli/commands/init_cmd/env_step.py +30 -3
  169. solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +3 -4
  170. solace_agent_mesh/cli/commands/init_cmd/platform_service_step.py +85 -0
  171. solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +16 -3
  172. solace_agent_mesh/cli/commands/plugin_cmd/add_cmd.py +2 -1
  173. solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +1 -0
  174. solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +3 -3
  175. solace_agent_mesh/cli/commands/run_cmd.py +64 -49
  176. solace_agent_mesh/cli/commands/tools_cmd.py +315 -0
  177. solace_agent_mesh/cli/main.py +15 -0
  178. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-tcIFZLis.js → authCallback-KnKMP_vb.js} +1 -1
  179. solace_agent_mesh/client/webui/frontend/static/assets/client-DpBL2stg.js +25 -0
  180. solace_agent_mesh/client/webui/frontend/static/assets/main-Cd498TV2.js +435 -0
  181. solace_agent_mesh/client/webui/frontend/static/assets/main-rSf8Vu29.css +1 -0
  182. solace_agent_mesh/client/webui/frontend/static/assets/{vendor-CINwxvwV.js → vendor-CGk8Suyh.js} +189 -94
  183. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
  184. solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
  185. solace_agent_mesh/client/webui/frontend/static/mockServiceWorker.js +336 -0
  186. solace_agent_mesh/client/webui/frontend/static/ui-version.json +6 -0
  187. solace_agent_mesh/common/a2a/types.py +1 -1
  188. solace_agent_mesh/common/agent_registry.py +38 -11
  189. solace_agent_mesh/common/data_parts.py +124 -0
  190. solace_agent_mesh/common/error_handlers.py +83 -0
  191. solace_agent_mesh/common/exceptions.py +24 -0
  192. solace_agent_mesh/common/oauth/__init__.py +17 -0
  193. solace_agent_mesh/common/oauth/oauth_client.py +408 -0
  194. solace_agent_mesh/common/oauth/utils.py +50 -0
  195. solace_agent_mesh/common/rag_dto.py +156 -0
  196. solace_agent_mesh/common/sac/sam_component_base.py +73 -1
  197. solace_agent_mesh/common/sam_events/event_service.py +2 -2
  198. solace_agent_mesh/common/utils/embeds/converter.py +1 -8
  199. solace_agent_mesh/common/utils/embeds/modifiers.py +2 -27
  200. solace_agent_mesh/common/utils/embeds/resolver.py +94 -25
  201. solace_agent_mesh/common/utils/embeds/types.py +1 -0
  202. solace_agent_mesh/common/utils/log_formatters.py +20 -0
  203. solace_agent_mesh/common/utils/mime_helpers.py +12 -5
  204. solace_agent_mesh/common/utils/rbac_utils.py +69 -0
  205. solace_agent_mesh/common/utils/templates/__init__.py +8 -0
  206. solace_agent_mesh/common/utils/templates/liquid_renderer.py +210 -0
  207. solace_agent_mesh/common/utils/templates/template_resolver.py +161 -0
  208. solace_agent_mesh/config_portal/backend/common.py +12 -0
  209. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-CljP4_mv.js +103 -0
  210. solace_agent_mesh/config_portal/frontend/static/client/assets/{components-Rk0n-9cK.js → components-CaC6hG8d.js} +22 -22
  211. solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-mvZjNKiz.js → entry.client-H_TM0YBt.js} +3 -3
  212. solace_agent_mesh/config_portal/frontend/static/client/assets/{index-DzNKzXrc.js → index-CnFykb2v.js} +16 -16
  213. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-f8439d40.js +1 -0
  214. solace_agent_mesh/config_portal/frontend/static/client/assets/root-BIMqslJB.css +1 -0
  215. solace_agent_mesh/config_portal/frontend/static/client/assets/root-mJmTIdIk.js +10 -0
  216. solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
  217. solace_agent_mesh/core_a2a/service.py +3 -2
  218. solace_agent_mesh/gateway/adapter/base.py +28 -1
  219. solace_agent_mesh/gateway/adapter/types.py +9 -0
  220. solace_agent_mesh/gateway/base/app.py +10 -0
  221. solace_agent_mesh/gateway/base/auth_interface.py +103 -0
  222. solace_agent_mesh/gateway/base/component.py +451 -10
  223. solace_agent_mesh/gateway/generic/component.py +274 -30
  224. solace_agent_mesh/gateway/http_sse/alembic/env.py +0 -7
  225. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_soft_delete_and_search.py +2 -43
  226. solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_default_agent_to_projects.py +2 -2
  227. solace_agent_mesh/gateway/http_sse/alembic/versions/20251108_create_prompt_tables_with_sharing.py +154 -0
  228. solace_agent_mesh/gateway/http_sse/alembic/versions/20251115_add_parent_task_id.py +32 -0
  229. solace_agent_mesh/gateway/http_sse/alembic/versions/20251126_add_background_task_fields.py +47 -0
  230. solace_agent_mesh/gateway/http_sse/alembic/versions/20251202_add_versioned_fields_to_prompts.py +52 -0
  231. solace_agent_mesh/gateway/http_sse/alembic.ini +0 -36
  232. solace_agent_mesh/gateway/http_sse/app.py +23 -6
  233. solace_agent_mesh/gateway/http_sse/component.py +158 -73
  234. solace_agent_mesh/gateway/http_sse/dependencies.py +50 -57
  235. solace_agent_mesh/gateway/http_sse/main.py +58 -482
  236. solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +2 -2
  237. solace_agent_mesh/gateway/http_sse/repository/entities/project.py +1 -1
  238. solace_agent_mesh/gateway/http_sse/repository/entities/project_user.py +1 -1
  239. solace_agent_mesh/gateway/http_sse/repository/entities/session.py +3 -2
  240. solace_agent_mesh/gateway/http_sse/repository/entities/task.py +7 -0
  241. solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +2 -2
  242. solace_agent_mesh/gateway/http_sse/repository/interfaces.py +2 -2
  243. solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +5 -0
  244. solace_agent_mesh/gateway/http_sse/repository/models/prompt_model.py +159 -0
  245. solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +1 -1
  246. solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +8 -1
  247. solace_agent_mesh/gateway/http_sse/repository/project_repository.py +1 -1
  248. solace_agent_mesh/gateway/http_sse/repository/project_user_repository.py +1 -1
  249. solace_agent_mesh/gateway/http_sse/repository/session_repository.py +12 -107
  250. solace_agent_mesh/gateway/http_sse/repository/task_repository.py +86 -2
  251. solace_agent_mesh/gateway/http_sse/routers/agent_cards.py +38 -7
  252. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +113 -7
  253. solace_agent_mesh/gateway/http_sse/routers/auth.py +69 -132
  254. solace_agent_mesh/gateway/http_sse/routers/config.py +235 -10
  255. solace_agent_mesh/gateway/http_sse/routers/dto/project_dto.py +69 -0
  256. solace_agent_mesh/gateway/http_sse/routers/dto/prompt_dto.py +255 -0
  257. solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +1 -1
  258. solace_agent_mesh/gateway/http_sse/routers/dto/responses/base_responses.py +1 -1
  259. solace_agent_mesh/gateway/http_sse/routers/dto/responses/project_responses.py +1 -0
  260. solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +3 -2
  261. solace_agent_mesh/gateway/http_sse/routers/dto/responses/version_responses.py +31 -0
  262. solace_agent_mesh/gateway/http_sse/routers/feedback.py +2 -2
  263. solace_agent_mesh/gateway/http_sse/routers/people.py +2 -2
  264. solace_agent_mesh/gateway/http_sse/routers/projects.py +250 -24
  265. solace_agent_mesh/gateway/http_sse/routers/prompts.py +1416 -0
  266. solace_agent_mesh/gateway/http_sse/routers/sessions.py +14 -5
  267. solace_agent_mesh/gateway/http_sse/routers/speech.py +355 -0
  268. solace_agent_mesh/gateway/http_sse/routers/sse.py +117 -4
  269. solace_agent_mesh/gateway/http_sse/routers/tasks.py +509 -149
  270. solace_agent_mesh/gateway/http_sse/routers/users.py +1 -1
  271. solace_agent_mesh/gateway/http_sse/routers/version.py +343 -0
  272. solace_agent_mesh/gateway/http_sse/routers/visualization.py +2 -1
  273. solace_agent_mesh/gateway/http_sse/services/audio_service.py +1227 -0
  274. solace_agent_mesh/gateway/http_sse/services/background_task_monitor.py +186 -0
  275. solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +1 -1
  276. solace_agent_mesh/gateway/http_sse/services/feedback_service.py +1 -1
  277. solace_agent_mesh/gateway/http_sse/services/project_service.py +539 -12
  278. solace_agent_mesh/gateway/http_sse/services/prompt_builder_assistant.py +303 -0
  279. solace_agent_mesh/gateway/http_sse/services/session_service.py +198 -21
  280. solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +354 -4
  281. solace_agent_mesh/gateway/http_sse/sse_manager.py +280 -169
  282. solace_agent_mesh/gateway/http_sse/utils/artifact_copy_utils.py +370 -0
  283. solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +41 -1
  284. solace_agent_mesh/services/__init__.py +0 -0
  285. solace_agent_mesh/services/platform/__init__.py +29 -0
  286. solace_agent_mesh/services/platform/alembic/env.py +85 -0
  287. solace_agent_mesh/services/platform/alembic/script.py.mako +28 -0
  288. solace_agent_mesh/services/platform/alembic.ini +109 -0
  289. solace_agent_mesh/services/platform/api/__init__.py +3 -0
  290. solace_agent_mesh/services/platform/api/dependencies.py +154 -0
  291. solace_agent_mesh/services/platform/api/main.py +314 -0
  292. solace_agent_mesh/services/platform/api/middleware.py +51 -0
  293. solace_agent_mesh/services/platform/api/routers/__init__.py +33 -0
  294. solace_agent_mesh/services/platform/api/routers/health_router.py +31 -0
  295. solace_agent_mesh/services/platform/app.py +215 -0
  296. solace_agent_mesh/services/platform/component.py +777 -0
  297. solace_agent_mesh/shared/__init__.py +14 -0
  298. solace_agent_mesh/shared/api/__init__.py +42 -0
  299. solace_agent_mesh/shared/auth/__init__.py +26 -0
  300. solace_agent_mesh/shared/auth/dependencies.py +204 -0
  301. solace_agent_mesh/shared/auth/middleware.py +347 -0
  302. solace_agent_mesh/shared/database/__init__.py +20 -0
  303. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/base_repository.py +1 -1
  304. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_exceptions.py +1 -1
  305. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_helpers.py +1 -1
  306. solace_agent_mesh/shared/exceptions/__init__.py +36 -0
  307. solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exception_handlers.py +1 -1
  308. solace_agent_mesh/shared/utils/__init__.py +21 -0
  309. solace_agent_mesh/templates/logging_config_template.yaml +48 -0
  310. solace_agent_mesh/templates/main_orchestrator.yaml +12 -1
  311. solace_agent_mesh/templates/platform.yaml +49 -0
  312. solace_agent_mesh/templates/plugin_readme_template.md +3 -25
  313. solace_agent_mesh/templates/plugin_tool_config_template.yaml +109 -0
  314. solace_agent_mesh/templates/proxy_template.yaml +62 -0
  315. solace_agent_mesh/templates/webui.yaml +148 -6
  316. solace_agent_mesh/tools/web_search/__init__.py +18 -0
  317. solace_agent_mesh/tools/web_search/base.py +84 -0
  318. solace_agent_mesh/tools/web_search/google_search.py +247 -0
  319. solace_agent_mesh/tools/web_search/models.py +99 -0
  320. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/METADATA +29 -8
  321. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/RECORD +334 -313
  322. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/WHEEL +1 -1
  323. solace_agent_mesh/agent/adk/adk_llm.txt +0 -226
  324. solace_agent_mesh/agent/adk/adk_llm_detail.txt +0 -566
  325. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +0 -171
  326. solace_agent_mesh/agent/adk/models/models_llm.txt +0 -189
  327. solace_agent_mesh/agent/agent_llm.txt +0 -369
  328. solace_agent_mesh/agent/agent_llm_detail.txt +0 -1702
  329. solace_agent_mesh/agent/protocol/protocol_llm.txt +0 -81
  330. solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +0 -92
  331. solace_agent_mesh/agent/proxies/a2a/a2a_llm.txt +0 -190
  332. solace_agent_mesh/agent/proxies/base/base_llm.txt +0 -148
  333. solace_agent_mesh/agent/proxies/proxies_llm.txt +0 -283
  334. solace_agent_mesh/agent/sac/sac_llm.txt +0 -189
  335. solace_agent_mesh/agent/sac/sac_llm_detail.txt +0 -200
  336. solace_agent_mesh/agent/testing/testing_llm.txt +0 -58
  337. solace_agent_mesh/agent/testing/testing_llm_detail.txt +0 -68
  338. solace_agent_mesh/agent/tools/tools_llm.txt +0 -276
  339. solace_agent_mesh/agent/tools/tools_llm_detail.txt +0 -275
  340. solace_agent_mesh/agent/utils/utils_llm.txt +0 -152
  341. solace_agent_mesh/agent/utils/utils_llm_detail.txt +0 -149
  342. solace_agent_mesh/assets/docs/assets/js/05749d90.c70b2be9.js +0 -1
  343. solace_agent_mesh/assets/docs/assets/js/15ba94aa.92fea363.js +0 -1
  344. solace_agent_mesh/assets/docs/assets/js/15e40e79.36003774.js +0 -1
  345. solace_agent_mesh/assets/docs/assets/js/17896441.a5e82f9b.js +0 -2
  346. solace_agent_mesh/assets/docs/assets/js/240a0364.c39f8388.js +0 -1
  347. solace_agent_mesh/assets/docs/assets/js/2e32b5e0.33f5d75b.js +0 -1
  348. solace_agent_mesh/assets/docs/assets/js/3a6c6137.f5940cfa.js +0 -1
  349. solace_agent_mesh/assets/docs/assets/js/3ac1795d.e4870a49.js +0 -1
  350. solace_agent_mesh/assets/docs/assets/js/3ff0015d.b63ee53a.js +0 -1
  351. solace_agent_mesh/assets/docs/assets/js/547e15cc.2f7790c1.js +0 -1
  352. solace_agent_mesh/assets/docs/assets/js/55b7b518.f2b1d1ba.js +0 -1
  353. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.45b32c2b.js +0 -1
  354. solace_agent_mesh/assets/docs/assets/js/64195356.c498c4d0.js +0 -1
  355. solace_agent_mesh/assets/docs/assets/js/66d4869e.830d443f.js +0 -1
  356. solace_agent_mesh/assets/docs/assets/js/6d84eae0.4a5fbf39.js +0 -1
  357. solace_agent_mesh/assets/docs/assets/js/8024126c.fa0e7186.js +0 -1
  358. solace_agent_mesh/assets/docs/assets/js/81a99df0.07034dd9.js +0 -1
  359. solace_agent_mesh/assets/docs/assets/js/82fbfb93.139a1a1f.js +0 -1
  360. solace_agent_mesh/assets/docs/assets/js/924ffdeb.8095e148.js +0 -1
  361. solace_agent_mesh/assets/docs/assets/js/94e8668d.09ed9234.js +0 -1
  362. solace_agent_mesh/assets/docs/assets/js/9bb13469.dd1c9b54.js +0 -1
  363. solace_agent_mesh/assets/docs/assets/js/a94703ab.0438dbc2.js +0 -1
  364. solace_agent_mesh/assets/docs/assets/js/ab9708a8.245ae0ef.js +0 -1
  365. solace_agent_mesh/assets/docs/assets/js/c93cbaa0.eaff365e.js +0 -1
  366. solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.f902fad8.js +0 -1
  367. solace_agent_mesh/assets/docs/assets/js/db5d6442.3daf1696.js +0 -1
  368. solace_agent_mesh/assets/docs/assets/js/e04b235d.c9c50c7b.js +0 -1
  369. solace_agent_mesh/assets/docs/assets/js/e3d9abda.d11c67a7.js +0 -1
  370. solace_agent_mesh/assets/docs/assets/js/e6f9706b.045d0fa1.js +0 -1
  371. solace_agent_mesh/assets/docs/assets/js/e92d0134.3bda61dd.js +0 -1
  372. solace_agent_mesh/assets/docs/assets/js/f284c35a.5099c51e.js +0 -1
  373. solace_agent_mesh/assets/docs/assets/js/main.f213fe0c.js +0 -2
  374. solace_agent_mesh/assets/docs/assets/js/runtime~main.d9606d6a.js +0 -1
  375. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes-deployment/index.html +0 -47
  376. solace_agent_mesh/assets/docs/lunr-index-1762283454666.json +0 -1
  377. solace_agent_mesh/assets/docs/search-doc-1762283454666.json +0 -1
  378. solace_agent_mesh/cli/commands/add_cmd/add_cmd_llm.txt +0 -250
  379. solace_agent_mesh/cli/commands/init_cmd/init_cmd_llm.txt +0 -365
  380. solace_agent_mesh/cli/commands/plugin_cmd/plugin_cmd_llm.txt +0 -305
  381. solace_agent_mesh/client/webui/frontend/static/assets/client-CRYdKo2Q.js +0 -25
  382. solace_agent_mesh/client/webui/frontend/static/assets/main-CojeY_1w.css +0 -1
  383. solace_agent_mesh/client/webui/frontend/static/assets/main-ILja9MCG.js +0 -353
  384. solace_agent_mesh/common/a2a/a2a_llm.txt +0 -175
  385. solace_agent_mesh/common/a2a/a2a_llm_detail.txt +0 -193
  386. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +0 -445
  387. solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +0 -736
  388. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +0 -330
  389. solace_agent_mesh/common/common_llm.txt +0 -230
  390. solace_agent_mesh/common/common_llm_detail.txt +0 -2562
  391. solace_agent_mesh/common/middleware/middleware_llm.txt +0 -174
  392. solace_agent_mesh/common/middleware/middleware_llm_detail.txt +0 -185
  393. solace_agent_mesh/common/sac/sac_llm.txt +0 -71
  394. solace_agent_mesh/common/sac/sac_llm_detail.txt +0 -82
  395. solace_agent_mesh/common/sam_events/sam_events_llm.txt +0 -104
  396. solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +0 -115
  397. solace_agent_mesh/common/services/providers/providers_llm.txt +0 -81
  398. solace_agent_mesh/common/services/services_llm.txt +0 -368
  399. solace_agent_mesh/common/services/services_llm_detail.txt +0 -459
  400. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +0 -220
  401. solace_agent_mesh/common/utils/utils_llm.txt +0 -335
  402. solace_agent_mesh/common/utils/utils_llm_detail.txt +0 -572
  403. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-ByU1X1HD.js +0 -98
  404. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-61038fc6.js +0 -1
  405. solace_agent_mesh/config_portal/frontend/static/client/assets/root-BWvk5-gF.js +0 -10
  406. solace_agent_mesh/config_portal/frontend/static/client/assets/root-DxRwaWiE.css +0 -1
  407. solace_agent_mesh/core_a2a/core_a2a_llm.txt +0 -90
  408. solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +0 -101
  409. solace_agent_mesh/gateway/base/base_llm.txt +0 -226
  410. solace_agent_mesh/gateway/base/base_llm_detail.txt +0 -235
  411. solace_agent_mesh/gateway/gateway_llm.txt +0 -369
  412. solace_agent_mesh/gateway/gateway_llm_detail.txt +0 -3885
  413. solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +0 -345
  414. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_fulltext_search_indexes.py +0 -92
  415. solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +0 -161
  416. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +0 -105
  417. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +0 -299
  418. solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +0 -3278
  419. solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +0 -221
  420. solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +0 -257
  421. solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +0 -308
  422. solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +0 -450
  423. solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +0 -133
  424. solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +0 -123
  425. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +0 -312
  426. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +0 -303
  427. solace_agent_mesh/gateway/http_sse/shared/__init__.py +0 -146
  428. solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +0 -319
  429. solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +0 -47
  430. solace_agent_mesh/llm.txt +0 -228
  431. solace_agent_mesh/llm_detail.txt +0 -2835
  432. solace_agent_mesh/solace_agent_mesh_llm.txt +0 -362
  433. solace_agent_mesh/solace_agent_mesh_llm_detail.txt +0 -8599
  434. solace_agent_mesh/templates/logging_config_template.ini +0 -45
  435. solace_agent_mesh/templates/templates_llm.txt +0 -147
  436. /solace_agent_mesh/assets/docs/assets/js/{main.f213fe0c.js.LICENSE.txt → main.d634009f.js.LICENSE.txt} +0 -0
  437. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/auth_utils.py +0 -0
  438. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/pagination.py +0 -0
  439. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/response_utils.py +0 -0
  440. /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/error_dto.py +0 -0
  441. /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exceptions.py +0 -0
  442. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/enums.py +0 -0
  443. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/timestamp_utils.py +0 -0
  444. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/types.py +0 -0
  445. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/utils.py +0 -0
  446. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/entry_points.txt +0 -0
  447. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,103 @@
1
+ import{j as r,r as j,t as yr,v as di}from"./index-CnFykb2v.js";function Kt({steps:e,currentStepIndex:t,onStepClick:n}){return r.jsxs("div",{className:"relative w-full",children:[r.jsx("div",{className:"absolute top-5 left-0 right-0 h-1 bg-gray-300 mr-9 ml-9",children:r.jsx("div",{className:"h-full bg-solace-green transition-all duration-300 ease-in-out",style:{width:t===0?"0%":`${t/(e.length-1)*100}%`}})}),r.jsx("div",{className:"flex items-center justify-between w-full relative z-10",children:e.map((i,s)=>{const a=s===t,o=s<t;return r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("button",{onClick:()=>n==null?void 0:n(s),disabled:!n,className:`
2
+ w-10 h-10 rounded-full flex items-center justify-center
3
+ font-bold transition-colors duration-300
4
+ ${a?"bg-solace-green text-white":""}
5
+ ${o?"bg-solace-dark-green text-white":""}
6
+ ${!a&&!o?"bg-gray-200 text-gray-600":""}
7
+ ${n?"cursor-pointer":"cursor-default"}
8
+ `,children:o?r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):s+1}),r.jsx("span",{className:`
9
+ mt-2 text-xs font-medium text-center
10
+ ${a?"text-solace-green":""}
11
+ ${o?"text-solace-dark-green":""}
12
+ ${!a&&!o?"text-gray-500":""}
13
+ `,children:i.title})]},i.id)})})]})}function X({children:e,onClick:t,disabled:n=!1,variant:i="primary",type:s="button",className:a=""}){const o="py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",l={primary:"bg-solace-green hover:bg-solace-dark-green text-white focus:ring-solace-green disabled:bg-solace-green/50",secondary:"bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500 disabled:bg-gray-100 disabled:text-gray-400",outline:"border border-gray-300 hover:bg-gray-50 text-gray-700 focus:ring-solace-green disabled:text-gray-400"};return r.jsx("button",{type:s,className:`${o} ${l[i]} ${a}`,onClick:t,disabled:n,children:e})}const br=()=>r.jsx("svg",{className:"w-4 h-4 mr-1.5 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),_r={quick:{title:"Get Started Quickly",timeEstimate:"2 minutes",timeColor:"green",description:"Simple setup with recommended defaults",features:["Connect AI provider","Uses sensible defaults for everything else"]},advanced:{title:"Advanced Setup",timeEstimate:"10 minutes",timeColor:"blue",description:"Full control over all configuration options",features:["Set namespace for topic prefixes","Specify broker settings","Connect AI provider","Configure main orchestrator","Configure Web UI Gateway"]}},mi=["Ready-to-use Solace Agent Mesh with basic capabilities","Chat interface for immediate testing","Foundation for adding more agents later"],pi=({pathType:e,isSelected:t,onSelect:n})=>{const i=_r[e];return r.jsxs("div",{role:"button",tabIndex:0,className:`
14
+ border rounded-lg p-6 cursor-pointer transition-all
15
+ ${t?"border-solace-blue bg-solace-light-blue/10 shadow-md":"border-gray-200 hover:border-solace-blue/50 hover:bg-gray-50"}
16
+ `,onClick:n,onKeyDown:s=>s.key==="Enter"&&n(),children:[r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsx("h3",{className:"text-xl font-bold text-solace-blue",children:i.title}),r.jsx("span",{className:`bg-${i.timeColor}-100 text-${i.timeColor}-800 text-xs font-medium px-2.5 py-0.5 rounded`,children:i.timeEstimate})]}),r.jsx("p",{className:"text-gray-600 mb-4",children:i.description}),r.jsx("div",{children:r.jsx("ul",{className:"space-y-2 text-sm text-gray-600",children:i.features.map(s=>r.jsxs("li",{className:"flex items-center",children:[r.jsx(br,{}),s]},s))})})]})};function hi({data:e,updateData:t,onNext:n}){const{setupPath:i}=e,[s,a]=j.useState(i??null),o=u=>{a(u),t({setupPath:u})},l=()=>{s&&n()};return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:Object.keys(_r).map(u=>r.jsx(pi,{pathType:u,isSelected:s===u,onSelect:()=>o(u)},u))}),r.jsxs("div",{className:"mt-6 p-4 border rounded-lg",children:[r.jsx("h3",{className:"text-lg font-semibold text-solace-blue mb-3",children:"What you'll get after setup:"}),r.jsx("ul",{className:"space-y-2 text-gray-700",children:mi.map(u=>r.jsxs("li",{className:"flex items-center",children:[r.jsx(br,{}),u]},u))})]}),r.jsx("div",{className:"mt-8 flex justify-end",children:r.jsx(X,{onClick:l,disabled:!s,children:"Continue"})})]})}function P({label:e,htmlFor:t,helpText:n,error:i,required:s=!1,children:a}){return r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 mb-1",children:[e,s&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),r.jsx("div",{className:"mt-1",children:a}),n&&r.jsx("p",{className:"mt-1 text-sm text-gray-500",children:n}),i&&r.jsx("p",{className:"mt-1 text-sm text-red-600",children:i})]})}function H({id:e,name:t,value:n,onChange:i,placeholder:s="",required:a=!1,disabled:o=!1,type:l="text",className:u="",onKeyDown:c}){return r.jsx("input",{id:e,name:t||e,type:l,value:n,onChange:i,onKeyDown:c,placeholder:s,required:a,disabled:o,className:`
17
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
18
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
19
+ disabled:bg-gray-100 disabled:text-gray-500
20
+ ${u}
21
+ `})}function fe({children:e,className:t=""}){return r.jsx("div",{className:`p-4 bg-blue-50 rounded-md ${t}`,children:r.jsx("p",{className:"text-sm text-blue-800",children:e})})}function vr({children:e,className:t=""}){return r.jsx("div",{className:`p-4 bg-yellow-50 rounded-md ${t}`,children:r.jsx("p",{className:"text-sm text-yellow-800",children:e})})}function fi({children:e,variant:t="info",className:n=""}){const i={info:"bg-blue-50 text-blue-800",success:"bg-green-50 text-green-800",error:"bg-red-50 text-red-800",loading:"bg-blue-50 text-blue-800"};return r.jsx("div",{className:`p-3 rounded-md ${i[t]} ${n}`,children:r.jsx("p",{className:"text-sm",children:e})})}function gi({data:e,updateData:t,onNext:n,onPrevious:i}){const{namespace:s}=e,a=l=>{t({[l.target.name]:l.target.value})},o=l=>{l.preventDefault(),n()};return r.jsxs("form",{onSubmit:o,children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx(fe,{className:"mb-4",children:"The namespace is a unique identifier that will be prefixed to all your event topics in the Solace Agent Mesh. Choose something meaningful to your organization or project."}),r.jsx(P,{label:"Project Namespace",htmlFor:"namespace",helpText:"Any simple text identifier that makes sense for your project (e.g., 'my-project', 'acme-corp')",required:!0,children:r.jsx(H,{id:"namespace",name:"namespace",value:s||"",onChange:a,placeholder:"Enter a namespace (e.g., my-project)",required:!0})})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:i,variant:"outline",children:"Previous"}),r.jsx(X,{type:"submit",disabled:!(s!=null&&s.trim()),children:"Next"})]})]})}function ae({id:e,options:t,value:n,onChange:i,name:s,required:a=!1,disabled:o=!1,className:l=""}){return r.jsxs("div",{className:"relative",children:[r.jsx("select",{id:e,name:s||e,value:n,onChange:i,required:a,disabled:o,className:`
22
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
23
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
24
+ disabled:bg-gray-100 disabled:text-gray-500
25
+ appearance-none
26
+ pr-10
27
+ ${l}
28
+ `,children:t.map(u=>r.jsx("option",{value:u.value,children:u.label},u.value))}),r.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2",children:r.jsx("svg",{className:"h-6 w-6 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})}const xi=[{value:"solace",label:"Existing Solace Pub/Sub+ broker"},{value:"container",label:"New local Solace PubSub+ broker container"},{value:"dev_mode",label:"Dev mode (simplified setup)"}],yi=[{value:"podman",label:"Podman"},{value:"docker",label:"Docker"}],hn=({message:e})=>{const t=/(https?:\/\/[^\s]+)/g,n=e.split(t);return r.jsx("span",{children:n.map((i,s)=>i.match(t)?r.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:i},s):i)})};function bi({data:e,updateData:t,onNext:n,onPrevious:i}){const{broker_type:s,broker_url:a,broker_vpn:o,broker_username:l,broker_password:u,container_engine:c,container_started:d}=e,[m,h]=j.useState({}),[p,w]=j.useState(!1),[v,N]=j.useState({isRunning:!1,success:d===!0,message:d?"Container already started successfully":""});j.useEffect(()=>{!c&&s==="container"&&t({container_engine:"podman"}),c&&s!=="container"&&t({container_engine:""}),s!=="dev_mode"?t({dev_mode:!1}):s==="dev_mode"&&t({dev_mode:!0})},[s,c,t]);const f=O=>{t({[O.target.name]:O.target.value})},b=()=>{const O={};let q=!0;return s==="solace"&&(a||(O.broker_url="Broker URL is required",q=!1),o||(O.broker_vpn="VPN name is required",q=!1),l||(O.broker_username="Username is required",q=!1)),s==="container"&&!v.success&&(O.container="You must successfully run the container before proceeding",q=!1),h(O),q},k=async()=>{w(!0),N({isRunning:!0,success:!1,message:"Starting container..."});try{const q=await(await fetch("api/runcontainer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({container_engine:c})})).json();if(q.status==="success")N({isRunning:!1,success:!0,message:q.message??"Container started successfully!"}),t({container_engine:c,container_started:!0});else{const y=q.message??"Failed to start container. Please try again.";N({isRunning:!1,success:!1,message:r.jsx(hn,{message:y})}),t({container_started:!1})}}catch(O){const q=O instanceof Error?O.message:"An unexpected error occurred";N({isRunning:!1,success:!1,message:r.jsx(hn,{message:q})}),t({container_started:!1})}finally{w(!1)}},M=O=>{O.preventDefault(),b()&&(s==="container"&&(e.broker_url="ws://localhost:8008",e.broker_vpn="default",e.broker_username="default",e.broker_password="default"),n())},L=s==="solace",_=s==="container",I=()=>v.isRunning?"loading":v.success?"success":"error",D=()=>p?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Starting Container..."]}):v.success?r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Container Running"]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download and Run Container"]});return r.jsxs("form",{onSubmit:M,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Broker Type",htmlFor:"broker_type",required:!0,children:r.jsx(ae,{id:"broker_type",name:"broker_type",options:xi,value:s||"",onChange:f,disabled:v.success&&e.broker_type==="container"})}),L&&r.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[r.jsx(fe,{className:"mb-4",children:"Connect to an existing Solace PubSub+ broker running locally or in the cloud. You will need your broker credentials."}),r.jsx(P,{label:"Broker URL",htmlFor:"broker_url",error:m.broker_url,required:!0,children:r.jsx(H,{id:"broker_url",name:"broker_url",value:a||"",onChange:f,placeholder:"ws://localhost:8008"})}),r.jsx(P,{label:"VPN Name",htmlFor:"broker_vpn",error:m.broker_vpn,required:!0,children:r.jsx(H,{id:"broker_vpn",name:"broker_vpn",value:o||"",onChange:f,placeholder:"default"})}),r.jsx(P,{label:"Username",htmlFor:"broker_username",error:m.broker_username,required:!0,children:r.jsx(H,{id:"broker_username",name:"broker_username",value:l||"",onChange:f,placeholder:"default"})}),r.jsx(P,{label:"Password",htmlFor:"broker_password",error:m.broker_password,children:r.jsx(H,{id:"broker_password",name:"broker_password",type:"password",value:u||"",onChange:f,placeholder:"Enter password"})})]}),_&&r.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[r.jsx(fe,{className:"mb-4",children:"This option will download and run a local Solace PubSub+ broker container on your machine using Docker or Podman. You need to have Docker or Podman installed on your system."}),r.jsx(P,{label:"Container Engine",htmlFor:"container_engine",helpText:"Select the container engine installed on your system",required:!0,children:r.jsx(ae,{id:"container_engine",name:"container_engine",options:yi,value:c??"",onChange:f,disabled:v.isRunning||v.success})}),m.container&&r.jsx("div",{className:"text-sm text-red-600 mt-1 bg-red-50 p-2 border-l-4 border-red-500",children:m.container}),v.message&&r.jsx(fi,{variant:I(),children:v.message}),r.jsx("div",{className:"relative",children:r.jsxs("div",{className:"flex flex-col",children:[r.jsx(X,{onClick:k,disabled:p||v.success,variant:"primary",type:"button",className:"flex items-center justify-center gap-2",children:D()}),v.success&&r.jsxs("div",{className:"mt-2 flex items-center text-sm text-green-600",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Container is running. You may proceed to the next step."]}),!v.success&&!p&&!v.message&&r.jsxs("div",{className:"mt-2 flex items-center text-sm text-blue-600",children:[r.jsxs("svg",{className:"h-4 w-4 mr-1",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),r.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"8"})]}),"You must start the container before proceeding to the next step"]})]})})]}),s==="dev_mode"&&r.jsxs(vr,{children:[r.jsx("strong",{children:"Warning:"})," Dev mode runs everything in a single process and is not recommended for production use."]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:i,variant:"outline",type:"button",children:"Previous"}),r.jsxs(X,{type:"submit",disabled:p||s==="container"&&!v.success,variant:s==="container"&&!v.success?"secondary":"primary",children:[s==="container"&&!v.success&&!p&&r.jsxs("span",{className:"flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Run Container First"]}),!(s==="container"&&!v.success&&!p)&&"Next"]})]})]})}function _i({title:e="Confirmation Required",message:t,onConfirm:n,onCancel:i}){return r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:e}),r.jsx("p",{className:"mb-6 text-gray-700",children:t}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx(X,{variant:"outline",onClick:i,children:"Cancel"}),r.jsx(X,{onClick:n,children:"Continue"})]})]})})}function kr({id:e,name:t,value:n,onChange:i,placeholder:s="",required:a=!1,disabled:o=!1,className:l="",suggestions:u,onFocus:c,fetchSuggestions:d,showLoadingIndicator:m=!1}){const[h,p]=j.useState(!1),[w,v]=j.useState([]),[N,f]=j.useState(!1),b=j.useRef(null),k=j.useRef(null);j.useEffect(()=>{if(u&&u.length>0){const I=u.filter(D=>D!=null).filter(D=>D.toLowerCase().includes((n||"").toLowerCase()));v(I)}else v([])},[n,u]),j.useEffect(()=>{const I=D=>{b.current&&!b.current.contains(D.target)&&k.current&&!k.current.contains(D.target)&&p(!1)};return document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}},[]);const M=async()=>{if(c&&c(),d)try{f(!0);const I=await d();I&&I.length>0&&v(I)}catch(I){console.error("Error fetching suggestions:",I)}finally{f(!1)}},L=()=>{p(!0)},_=I=>{var O;i({target:{name:t||e,value:I}}),p(!1),(O=b.current)==null||O.focus()};return r.jsxs("div",{className:"relative w-full",children:[r.jsx("input",{ref:b,id:e,name:t||e,type:"text",value:n||"",onChange:i,onFocus:M,onClick:L,placeholder:s,required:a,disabled:o,className:`
29
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
30
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
31
+ disabled:bg-gray-100 disabled:text-gray-500
32
+ ${l}
33
+ `,autoComplete:"off"}),N&&m&&r.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:r.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-solace-green"})}),h&&w.length>0&&r.jsx("div",{ref:k,className:"absolute z-10 w-full mt-1 border bg-white border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:r.jsx("ul",{children:w.map((I,D)=>r.jsx("li",{onClick:()=>_(I),onKeyDown:O=>O.key==="Enter"&&_(I),className:"px-3 py-2 cursor-pointer hover:bg-stone-300",tabIndex:0,children:I},D))})})]})}const fn={openai:"https://api.openai.com/v1",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com/v1beta/openai",aws:"https://bedrock-runtime.us-east-1.amazonaws.com",cohere:"https://api.cohere.ai/compatibility/v1"},vi=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google Gemini"},{value:"azure",label:"Azure"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],wr={openai:"openai",anthropic:"anthropic",google:"openai",openai_compatible:"openai",azure:"azure"},ki={openai:["o3-mini","o3-mini-high","o3-mini-low","o1","o1-preview","o1-mini","gpt-4.5-preview","gpt-4o","gpt-4o-mini"],anthropic:["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","claude-3-opus-20240229","claude-3-haiku-20240307"],google:["gemini-2.0-flash-001","gemini-2.0-pro-exp-02-05","gemini-2.0-flash-lite-001","gemini-2.0-flash-thinking-exp-01-21","gemini-1.5-flash-002","gemini-1.5-pro-002"],bedrock:["amazon.nova-pro-v1:0","amazon.nova-pro-latency-optimized-v1:0","amazon.nova-lite-v1:0","amazon.nova-micro-v1:0","anthropic.claude-3-7-sonnet-20250219-v1:0","anthropic.claude-3-5-sonnet-20241022-v2:0","anthropic.claude-3-5-haiku-20241022-v1:0","anthropic.claude-3-5-sonnet-20240620-v1:0","anthropic.claude-3-opus-20240229-v1:0","anthropic.claude-3-sonnet-20240229-v1:0","anthropic.claude-3-haiku-20240307-v1:0"],custom:[]};async function wi(e,t){try{const n=e.endsWith("/")?e:`${e}/`,i=await fetch(`${n}v1/models`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!i.ok)throw new Error(`Failed to fetch models: ${i.status}`);const s=await i.json();return s.data&&Array.isArray(s.data)?s.data.filter(a=>a.id).map(a=>a.id):s.models&&Array.isArray(s.models)?s.models.filter(a=>a.id??a.name).map(a=>a.id??a.name):Array.isArray(s)?s.filter(a=>a.id??a.name).map(a=>a.id??a.name):[]}catch(n){return console.error("Error fetching models:",n),[]}}const jr=(e,t)=>e.includes("/")?e:`${wr[t]||t}/${e}`;function Sr({data:e,updateData:t,onNext:n,onPrevious:i}){const{llm_provider:s,llm_endpoint_url:a,llm_api_key:o,llm_model_name:l}=e,[u,c]=j.useState({}),[d,m]=j.useState(!1),[h,p]=j.useState(null),[w,v]=j.useState(!1),[N,f]=j.useState([]),[b,k]=j.useState(!1),[M,L]=j.useState(null);j.useEffect(()=>{const y={};s||(y.llm_provider="openai"),Object.keys(y).length>0&&t(y)},[e,t]),j.useEffect(()=>{if(s){const y={};if(M!==null&&M!==s){if(y.llm_model_name="",s!=="openai_compatible"){const C=fn[s]||"";y.llm_endpoint_url=C}else y.llm_endpoint_url="";Object.keys(y).length>0&&t(y)}L(s)}},[s,M,t]),j.useEffect(()=>{f(s&&s!=="openai_compatible"?ki[s]||[]:[])},[s]);const _=y=>{t({[y.target.name]:y.target.value})},I=j.useCallback(async()=>{if(s==="openai_compatible"&&a&&o){k(!0);try{const y=await wi(a,o);f(y)}catch(y){console.error("Error fetching models:",y)}finally{k(!1)}}return[]},[s,a,o]),D=()=>{const y={};let C=!0;return s||(y.llm_provider="LLM provider is required",C=!1),s==="openai_compatible"&&!a&&(y.llm_endpoint_url="LLM endpoint is required for OpenAI compatible endpoint}",C=!1),l||(y.llm_model_name="LLM model name is required",C=!1),o||(y.llm_api_key="LLM API key is required",C=!1),c(y),C},O=async()=>{m(!0),p(null);try{const y=s!=="openai_compatible"&&fn[s]||a,C=jr(l||"",s||""),R=await(await fetch("/api/test_llm_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:C,api_key:o,base_url:y})})).json();R.status==="success"?(m(!1),n()):(p(R.message??"Failed to test LLM configuration"),v(!0),m(!1))}catch(y){p(y instanceof Error?`Error: ${y.message}`:"An unexpected error occurred while testing the LLM configuration"),v(!0),m(!1)}},q=y=>{y.preventDefault(),D()&&O()};return r.jsxs("form",{onSubmit:q,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{className:"mb-4",children:'Configure your AI service provider for language models. To use a LLM provider not in the dropdown choose "OpenAI Compatible Provider" and enter your base URL, API key and model name.'}),r.jsxs("div",{className:"border-b border-gray-200 pb-4 mb-4",children:[r.jsx("h3",{className:"text-lg font-medium mb-4 text-gray-700 font-semibold",children:"Language Model Configuration"}),r.jsx(P,{label:"LLM Provider",htmlFor:"llm_provider",error:u.llm_provider,required:!0,children:r.jsx(ae,{id:"llm_provider",name:"llm_provider",value:s||"",onChange:_,options:vi})}),(s==="openai_compatible"||s==="azure")&&r.jsx(P,{label:"LLM Endpoint URL",htmlFor:"llm_endpoint_url",error:u.llm_endpoint_url,required:!0,children:r.jsx(H,{id:"llm_endpoint_url",name:"llm_endpoint_url",value:a||"",onChange:_,placeholder:"https://api.example.com/v1"})}),r.jsx(P,{label:"LLM API Key",htmlFor:"llm_api_key",error:u.llm_api_key,required:!0,children:r.jsx(H,{id:"llm_api_key",name:"llm_api_key",type:"password",value:o||"",onChange:_,placeholder:"Enter your API key"})}),s==="azure"&&r.jsxs(vr,{className:"mb-4",children:[r.jsx("strong",{children:"Important:"}),' For Azure, in the "LLM Model Name" field, enter your ',r.jsx("strong",{children:"deployment name"})," (not the underlying model name). Your Azure deployment name is the name you assigned when you deployed the model in Azure OpenAI Service. For more details, refer to the"," ",r.jsx("a",{href:"https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal#deploy-a-model",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Azure documentation"}),"."]}),r.jsx(P,{label:"LLM Model Name",htmlFor:"llm_model_name",error:u.llm_model_name,helpText:"Select or type a model name",required:!0,children:r.jsx(kr,{id:"llm_model_name",name:"llm_model_name",value:l||"",onChange:_,placeholder:"Select or type a model name",suggestions:N,onFocus:s==="openai_compatible"?I:void 0,showLoadingIndicator:b})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:i,disabled:e.setupPath==="quick",variant:"outline",children:"Previous"}),r.jsx(X,{type:"submit",children:"Next"})]}),d&&r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full text-center",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Testing LLM Configuration"}),r.jsx("div",{className:"flex justify-center mb-4",children:r.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-solace-green"})}),r.jsx("p",{children:"Please wait while we test your LLM configuration..."})]})}),w&&r.jsx(_i,{title:"Connection Test Failed",message:`We couldn't connect to your AI provider: ${h}
34
+ Please check your API key, model name, and endpoint URL (if applicable).
35
+ Do you want to skip this check and continue anyway?`,onConfirm:()=>{v(!1),n()},onCancel:()=>{v(!1)}})]})}const Ae=({id:e,label:t,values:n,onChange:i,placeholder:s,helpText:a,error:o,required:l,inputButtonText:u="Add",inputPlaceholder:c="Type and press Add..."})=>{const[d,m]=j.useState(""),h=N=>{m(N.target.value)},p=()=>{if(d.trim()!==""){if(n.includes(d.trim())){m("");return}i([...n,d.trim()]),m("")}},w=N=>{i(n.filter(f=>f!==N))},v=N=>{N.key==="Enter"&&(N.preventDefault(),p())};return r.jsxs(P,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx(H,{id:e,name:e,value:d,onChange:h,onKeyDown:v,placeholder:c,className:"flex-grow"}),r.jsx(X,{onClick:p,variant:"secondary",type:"button",children:u})]}),n.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 mt-2 p-2 border border-gray-200 rounded-md min-h-[40px]",children:n.map((N,f)=>r.jsxs("div",{className:"flex items-center bg-gray-100 text-gray-700 text-sm font-medium px-3 py-1 rounded-full",children:[r.jsx("span",{children:N}),r.jsx("button",{type:"button",onClick:()=>w(N),className:"ml-2 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":`Remove ${N}`,children:"×"})]},f))}),n.length===0&&s&&r.jsx("div",{className:"mt-2 p-2 border border-dashed border-gray-300 rounded-md min-h-[40px] flex items-center justify-center",children:r.jsx("p",{className:"text-sm text-gray-400",children:s})})]})};function ye({id:e,checked:t,onChange:n,label:i,disabled:s=!1,className:a=""}){const o=l=>{n(l.target.checked)};return r.jsxs("div",{className:`flex items-center ${a}`,children:[r.jsx("input",{id:e,type:"checkbox",checked:t,onChange:o,disabled:s,className:"h-4 w-4 text-solace-green focus:ring-solace-green border-gray-300 rounded"}),i&&r.jsx("label",{htmlFor:e,className:"ml-2 block text-sm text-gray-700",children:i})]})}const ji=[{value:"memory",label:"Memory: Store artifacts in memory (temporary)"},{value:"filesystem",label:"Filesystem: Store artifacts on disk"},{value:"gcs",label:"GCS: Store artifacts in Google Cloud Storage"}],Si=[{value:"namespace",label:"Namespace: Share artifacts within the namespace"},{value:"app",label:"App: Isolate artifacts by app name"},{value:"custom",label:"Custom: Use a custom scope identifier"}],Ni=[{value:"ignore",label:"Ignore: Do not include artifacts in messages"},{value:"embed",label:"Embed: Include base64 data in messages"},{value:"reference",label:"Reference: Include fetch URI in messages"}];function Ci({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=j.useState({}),[o,l]=j.useState(!1),u=(E,ee)=>{if(E==null)return ee;if(Array.isArray(E))return E.map(ie=>String(ie).trim()).filter(ie=>ie.length>0);const ke=String(E).trim();return ke===""?[]:ke.split(",").map(ie=>ie.trim()).filter(ie=>ie.length>0)},c=e,[d,m]=j.useState(c.agent_name||"OrchestratorAgent"),[h,p]=j.useState(c.supports_streaming!==!1),[w,v]=j.useState(c.session_service_type||"sql"),[N,f]=j.useState(c.orchestrator_database_url||""),[b,k]=j.useState(c.session_service_behavior||"PERSISTENT"),[M,L]=j.useState(c.artifact_service_type||"filesystem"),[_,I]=j.useState(c.artifact_service_base_path||"/tmp/samv2"),[D,O]=j.useState(c.artifact_service_scope||"namespace"),[q,y]=j.useState(c.artifact_handling_mode||"reference"),[C,T]=j.useState(c.enable_embed_resolution!==!1),[R,B]=j.useState(c.enable_artifact_content_instruction!==!1),[V,z]=j.useState(c.agent_card_description||"The Orchestrator component. It manages tasks, and coordinating multi-agent workflows."),[U,$]=j.useState(u(c.agent_card_default_input_modes,["text"])),[g,ne]=j.useState(u(c.agent_card_default_output_modes,["text","file"])),[le,x]=j.useState(c.agent_discovery_enabled!==!1),[se,be]=j.useState(c.agent_card_publishing_interval||10),[re,Ee]=j.useState(u(c.inter_agent_communication_allow_list,["*"])),[_e,Ne]=j.useState(u(c.inter_agent_communication_deny_list,[])),[ve,Pe]=j.useState(c.inter_agent_communication_timeout||180);j.useEffect(()=>{o||(c.agent_name&&m(c.agent_name),c.supports_streaming!==void 0&&p(c.supports_streaming),c.session_service_type&&v(c.session_service_type),c.session_service_behavior&&k(c.session_service_behavior),c.artifact_service_type&&L(c.artifact_service_type),c.artifact_service_base_path&&I(c.artifact_service_base_path),c.artifact_service_scope&&O(c.artifact_service_scope),c.artifact_handling_mode&&y(c.artifact_handling_mode),c.enable_embed_resolution!==void 0&&T(c.enable_embed_resolution),c.enable_artifact_content_instruction!==void 0&&B(c.enable_artifact_content_instruction),c.agent_card_description&&z(c.agent_card_description),c.agent_card_default_input_modes!==void 0&&$(u(c.agent_card_default_input_modes,["text"])),c.agent_card_default_output_modes!==void 0&&ne(u(c.agent_card_default_output_modes,["text","file"])),c.agent_discovery_enabled!==void 0&&x(c.agent_discovery_enabled),c.agent_card_publishing_interval&&be(c.agent_card_publishing_interval),c.inter_agent_communication_allow_list!==void 0&&Ee(u(c.inter_agent_communication_allow_list,["*"])),c.inter_agent_communication_deny_list!==void 0&&Ne(u(c.inter_agent_communication_deny_list,[])),c.inter_agent_communication_timeout&&Pe(c.inter_agent_communication_timeout),l(!0))},[e,o]);const xt=E=>{m(E.target.value),t({agent_name:E.target.value})},yt=E=>{p(E),t({supports_streaming:E})},bt=E=>{L(E.target.value),t({artifact_service_type:E.target.value})},tt=E=>{I(E.target.value),t({artifact_service_base_path:E.target.value})},nt=E=>{O(E.target.value),t({artifact_service_scope:E.target.value})},rt=E=>{y(E.target.value),t({artifact_handling_mode:E.target.value})},_t=E=>{T(E),t({enable_embed_resolution:E})},it=E=>{B(E),t({enable_artifact_content_instruction:E})},st=E=>{z(E.target.value),t({agent_card_description:E.target.value})},vt=E=>{$(E),t({agent_card_default_input_modes:E})},kt=E=>{ne(E),t({agent_card_default_output_modes:E})},wt=E=>{x(E),t({agent_discovery_enabled:E})},jt=E=>{be(Number(E.target.value)),t({agent_card_publishing_interval:Number(E.target.value)})},St=E=>{Ee(E),t({inter_agent_communication_allow_list:E})},S=E=>{Ne(E),t({inter_agent_communication_deny_list:E})},F=E=>{Pe(Number(E.target.value)),t({inter_agent_communication_timeout:Number(E.target.value)})},G=()=>{const E={};let ee=!0;return d?/^[a-zA-Z0-9_]+$/.test(d)||(E.agentName="Agent name can only contain letters, numbers, and underscores.",ee=!1):(E.agentName="Agent name is required",ee=!1),M==="filesystem"&&!_&&(E.artifactBasePath="Artifact base path is required for filesystem service",ee=!1),(!se||se<=0)&&(E.cardPublishingInterval="Publishing interval must be a positive number",ee=!1),(!ve||ve<=0)&&(E.communicationTimeout="Communication timeout must be a positive number",ee=!1),a(E),ee},J=E=>{E.preventDefault(),G()&&n()};return r.jsxs("form",{onSubmit:J,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{className:"mb-4",children:"Configure the main orchestrator for your Solace Agent Mesh system. This will set up the agent that orchestrates communication between components."}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx("div",{className:"col-span-2",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Basic Configuration"})}),r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",error:s.agentName,required:!0,helpText:"The name can only contain letters, numbers, and underscores.",children:r.jsx(H,{id:"agent_name",value:d,onChange:xt,placeholder:"OrchestratorAgent",required:!0})}),r.jsx(P,{label:"Supports Streaming",htmlFor:"supports_streaming",helpText:"Enable streaming support for the agent",children:r.jsx(ye,{id:"supports_streaming",checked:h,onChange:yt,label:"Enable streaming support"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Artifact Service"})}),r.jsx(P,{label:"Artifact Service Type",htmlFor:"artifact_service_type",required:!0,children:r.jsx(ae,{id:"artifact_service_type",options:ji,value:M,onChange:bt})}),M==="filesystem"&&r.jsx(P,{label:"Artifact Base Path",htmlFor:"artifact_base_path",error:s.artifactBasePath,required:!0,children:r.jsx(H,{id:"artifact_base_path",value:_,onChange:tt,placeholder:"/tmp/samv2"})}),r.jsx(P,{label:"Artifact Scope",htmlFor:"artifact_scope",required:!0,children:r.jsx(ae,{id:"artifact_scope",options:Si,value:D,onChange:nt})}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",required:!0,children:r.jsx(ae,{id:"artifact_handling_mode",options:Ni,value:q,onChange:rt})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Feature Flags"})}),r.jsx(P,{label:"Enable Embed Resolution",htmlFor:"enable_embed_resolution",children:r.jsx(ye,{id:"enable_embed_resolution",checked:C,onChange:_t,label:"Enable embed resolution"})}),r.jsx(P,{label:"Enable Artifact Content Instruction",htmlFor:"enable_artifact_content_instruction",children:r.jsx(ye,{id:"enable_artifact_content_instruction",checked:R,onChange:it,label:"Enable artifact content instruction"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Card"})}),r.jsx("div",{className:"col-span-2",children:r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",required:!0,children:r.jsx(H,{id:"agent_card_description",value:V,onChange:st,placeholder:"A helpful assistant accessed via a custom endpoint, capable of delegating tasks."})})}),r.jsx(Ae,{id:"default_input_modes",label:"Default Input Modes",values:U,onChange:vt,helpText:"Enter input modes (e.g., text). Press Enter or comma to add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"default_output_modes",label:"Default Output Modes",values:g,onChange:kt,helpText:"Enter output modes (e.g., text, file). Press Enter or comma to add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., text, file"}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Discovery"})}),r.jsx(P,{label:"Enable Agent Discovery",htmlFor:"agent_discovery_enabled",children:r.jsx(ye,{id:"agent_discovery_enabled",checked:le,onChange:wt,label:"Enable agent discovery"})}),r.jsx(P,{label:"Card Publishing Interval",htmlFor:"card_publishing_interval",error:s.cardPublishingInterval,helpText:"Interval in seconds for publishing agent card",required:!0,children:r.jsx(H,{id:"card_publishing_interval",type:"number",value:se.toString(),onChange:jt,placeholder:"10"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Inter-Agent Communication"})}),r.jsx(Ae,{id:"allow_list",label:"Allow List",values:re,onChange:St,helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*). Press Enter or comma to add.",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"deny_list",label:"Deny List",values:_e,onChange:S,helpText:"Agent name patterns to deny delegation to. Press Enter or comma to add.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Communication Timeout",htmlFor:"communication_timeout",error:s.communicationTimeout,helpText:"Timeout in seconds for inter-agent communication",required:!0,children:r.jsx(H,{id:"communication_timeout",type:"number",value:ve.toString(),onChange:F,placeholder:"30"})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:i,variant:"outline",children:"Previous"}),r.jsx(X,{type:"submit",children:"Next"})]})]})}function Ai({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=j.useState({}),o=e;j.useEffect(()=>{const m={add_webui_gateway:o.add_webui_gateway??!1,webui_session_secret_key:o.webui_session_secret_key??"",webui_fastapi_host:o.webui_fastapi_host??"127.0.0.1",webui_fastapi_port:o.webui_fastapi_port??8e3,webui_enable_embed_resolution:o.webui_enable_embed_resolution??!0,webui_frontend_welcome_message:o.webui_frontend_welcome_message??"",webui_frontend_bot_name:o.webui_frontend_bot_name??"Solace Agent Mesh",webui_frontend_logo_url:o.webui_frontend_logo_url??"",webui_frontend_collect_feedback:o.webui_frontend_collect_feedback??!1,platform_api_host:o.platform_api_host??"127.0.0.1",platform_api_port:o.platform_api_port??8001},h={};for(const p in m)o[p]===void 0&&m[p]!==void 0&&(h[p]=m[p]);Object.keys(h).length>0&&t(h)},[]);const l=m=>{const{name:h,value:p,type:w}=m.target;t(w==="number"?{[h]:p===""?"":Number(p)}:{[h]:p})},u=(m,h)=>{t({[m]:h})},c=()=>{const m={};let h=!0;return o.add_webui_gateway&&(o.webui_session_secret_key||(m.webui_session_secret_key="Session Secret Key is required.",h=!1),o.webui_fastapi_host||(m.webui_fastapi_host="FastAPI Host is required.",h=!1),o.webui_fastapi_port===void 0?(m.webui_fastapi_port="FastAPI Port is required.",h=!1):(isNaN(Number(o.webui_fastapi_port))||Number(o.webui_fastapi_port)<=0)&&(m.webui_fastapi_port="FastAPI Port must be a positive number.",h=!1),o.platform_api_host||(m.platform_api_host="Platform API Host is required.",h=!1),o.platform_api_port===void 0?(m.platform_api_port="Platform API Port is required.",h=!1):(isNaN(Number(o.platform_api_port))||Number(o.platform_api_port)<=0||Number(o.platform_api_port)>65535)&&(m.platform_api_port="Platform API Port must be between 1 and 65535.",h=!1)),a(m),h},d=m=>{m.preventDefault(),c()&&n()};return r.jsxs("form",{onSubmit:d,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{className:"mb-4",children:"Optionally, configure a Web UI Gateway to interact with your Solace Agent Mesh. This provides a Web UI chat interface."}),r.jsx(P,{label:"",htmlFor:"add_webui_gateway",children:r.jsx(ye,{id:"add_webui_gateway",checked:o.add_webui_gateway||!1,onChange:m=>u("add_webui_gateway",m),label:"Add Web UI Gateway"})}),o.add_webui_gateway&&r.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md mt-4",children:[r.jsx("h3",{className:"text-md font-medium text-gray-800 mb-3",children:"Web UI Gateway Configuration"}),r.jsx(P,{label:"Session Secret Key",htmlFor:"webui_session_secret_key",error:s.webui_session_secret_key,required:!0,children:r.jsx(H,{id:"webui_session_secret_key",name:"webui_session_secret_key",type:"password",value:o.webui_session_secret_key||"",onChange:l,placeholder:"Enter a strong secret key"})}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx(P,{label:"FastAPI Host",htmlFor:"webui_fastapi_host",error:s.webui_fastapi_host,required:!0,children:r.jsx(H,{id:"webui_fastapi_host",name:"webui_fastapi_host",value:o.webui_fastapi_host||"127.0.0.1",onChange:l,placeholder:"127.0.0.1"})}),r.jsx(P,{label:"FastAPI Port",htmlFor:"webui_fastapi_port",error:s.webui_fastapi_port,required:!0,children:r.jsx(H,{id:"webui_fastapi_port",name:"webui_fastapi_port",type:"number",value:o.webui_fastapi_port===void 0?"":String(o.webui_fastapi_port),onChange:l,placeholder:"8000"})})]}),r.jsx(P,{label:"",htmlFor:"webui_enable_embed_resolution",children:r.jsx(ye,{id:"webui_enable_embed_resolution",checked:o.webui_enable_embed_resolution||!1,onChange:m=>u("webui_enable_embed_resolution",m),label:"Enable Embed Resolution in Web UI"})}),r.jsx("h4",{className:"text-sm font-medium text-gray-700 mt-3 mb-2",children:"Frontend Customization"}),r.jsx(P,{label:"Frontend Welcome Message",htmlFor:"webui_frontend_welcome_message",error:s.webui_frontend_welcome_message,children:r.jsx(H,{id:"webui_frontend_welcome_message",name:"webui_frontend_welcome_message",value:o.webui_frontend_welcome_message||"",onChange:l,placeholder:"Welcome to the Solace Agent Mesh!"})}),r.jsx(P,{label:"Frontend Bot Name",htmlFor:"webui_frontend_bot_name",error:s.webui_frontend_bot_name,children:r.jsx(H,{id:"webui_frontend_bot_name",name:"webui_frontend_bot_name",value:o.webui_frontend_bot_name||"Solace Agent Mesh",onChange:l,placeholder:"Solace Agent Mesh"})}),r.jsx(P,{label:"Frontend Logo URL",htmlFor:"webui_frontend_logo_url",error:s.webui_frontend_logo_url,helpText:"URL to a custom logo image (PNG, SVG, JPG) or a data URI",children:r.jsx(H,{id:"webui_frontend_logo_url",name:"webui_frontend_logo_url",value:o.webui_frontend_logo_url||"",onChange:l,placeholder:"https://example.com/logo.png or data:image/svg+xml;base64,..."})}),r.jsx(P,{label:"",htmlFor:"webui_frontend_collect_feedback",children:r.jsx(ye,{id:"webui_frontend_collect_feedback",checked:o.webui_frontend_collect_feedback||!1,onChange:m=>u("webui_frontend_collect_feedback",m),label:"Enable Feedback Collection in Frontend"})}),r.jsx("h4",{className:"text-sm font-medium text-gray-700 mt-4 mb-2",children:"Platform Service Configuration"}),r.jsx(fe,{className:"mb-3",children:"Configure the Platform Service used for the management of agents, connectors, deployments, and more."}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx(P,{label:"Platform API Host",htmlFor:"platform_api_host",error:s.platform_api_host,required:!0,children:r.jsx(H,{id:"platform_api_host",name:"platform_api_host",value:o.platform_api_host||"127.0.0.1",onChange:l,placeholder:"127.0.0.1"})}),r.jsx(P,{label:"Platform API Port",htmlFor:"platform_api_port",error:s.platform_api_port,required:!0,children:r.jsx(H,{id:"platform_api_port",name:"platform_api_port",type:"number",value:o.platform_api_port===void 0?"":String(o.platform_api_port),onChange:l,placeholder:"8001"})})]})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:i,variant:"outline",type:"button",children:"Previous"}),r.jsx(X,{type:"submit",children:"Next"})]})]})}const Ei=["llm","ai","api","url","vpn"],Ii=["broker_password","llm_api_key","webui_session_secret_key"],gn={Project:["namespace"],Broker:["dev_mode","broker_type","broker_url","broker_vpn","broker_username","broker_password"],"AI Provider":["llm_model_name","llm_endpoint_url","llm_api_key"],Orchestrator:["agent_name","supports_streaming","session_service_type","session_service_behavior","artifact_service_type","artifact_service_base_path","artifact_service_scope","artifact_handling_mode","enable_embed_resolution","enable_artifact_content_instruction","agent_card_description","agent_card_default_input_modes","agent_card_default_output_modes","agent_discovery_enabled","agent_card_publishing_interval","inter_agent_communication_allow_list","inter_agent_communication_deny_list","inter_agent_communication_timeout"],"Web UI & Platform Service":["add_webui_gateway","webui_frontend_welcome_message","webui_frontend_bot_name","webui_frontend_collect_feedback","webui_session_secret_key","webui_fastapi_host","webui_fastapi_port","webui_enable_embed_resolution","platform_api_host","platform_api_port"]};function Nr({data:e,updateData:t,onPrevious:n}){const[i,s]=j.useState(!1),[a,o]=j.useState(null),l=f=>f===void 0||f===""||Array.isArray(f)&&f.length===0,u=f=>f.split("_").map(b=>Ei.includes(b.toLowerCase())?b.toUpperCase():b.charAt(0).toUpperCase()+b.slice(1)).join(" "),c=(f,b)=>Ii.includes(f)||f.toUpperCase().includes("API_KEY")?b?"••••••••":"Not provided":typeof b=="boolean"?b?"Yes":"No":Array.isArray(b)?b.join(", "):b?String(b):"Not provided",d=f=>{switch(f){case"solace":return"Existing Solace Pub/Sub+ broker";case"container":return"New local Solace PubSub+ broker container (podman/docker)";case"dev_mode":return"Run in 'dev mode' - all in one process (not recommended for production)";default:return f}},m=()=>{const f=e.broker_type;return e.dev_mode?r.jsx("div",{children:r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d("dev_mode")})]})}):r.jsxs("div",{children:[r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d(f)})]}),f==="container"&&r.jsx("div",{className:"pl-4 border-l-2 border-gray-300 mb-2",children:r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Container Engine:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.container_engine)??"Docker"})]})}),(f==="solace"||f==="container")&&r.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker URL:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_url)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker VPN:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_vpn)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Username:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_username)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Password:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c("broker_password",e.broker_password)})]})]})]})},h=(f,b)=>b.some(M=>!l(e[M]))?r.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[r.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:f}),r.jsx("div",{className:"space-y-3",children:b.map(M=>l(e[M])?null:M==="dev_mode"?r.jsx("div",{children:m()},M):r.jsxs("div",{className:"flex mb-1",children:[r.jsxs("span",{className:"text-gray-600",children:[u(M),":"]}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c(M,e[M])})]},M))})]},f):null,p=f=>{const b={...f};return b.namespace&&!String(b.namespace).endsWith("/")&&(b.namespace+="/"),b.container_started&&delete b.container_started,b.llm_provider&&(b.llm_provider=wr[b.llm_provider]),b.llm_model_name&&b.llm_provider&&(b.llm_model_name=jr(String(b.llm_model_name),String(b.llm_provider)),delete b.llm_provider),e.broker_type==="container"&&(e.broker_type="solace"),b},w=async(f=!0)=>{const b=p(e);console.log("Submitting configuration:",b);try{const k=await fetch("api/save_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f?{...b,force:!0}:b)}),M=await k.json();if(!k.ok)throw new Error(`HTTP error ${k.status}: ${M.message??"Unknown error"}`);if(M.status==="success"){console.log("Configuration sent successfully!"),t({showSuccess:!0});try{const L=await fetch("api/shutdown",{method:"POST"});L.ok?console.log("Shutdown request sent successfully"):console.warn("Shutdown request failed:",L.status)}catch(L){console.error("Error sending shutdown request:",L)}}else throw new Error(M.message??"Failed to save configuration")}catch(k){o(k instanceof Error?k.message:"An unknown error occurred"),console.error("Error saving configuration:",k)}finally{s(!1)}},v=async()=>{s(!0),o(null),await w()},N=f=>{f.preventDefault(),v()};return r.jsx("div",{className:"space-y-6",children:r.jsxs("form",{onSubmit:N,children:[r.jsx("div",{className:"bg-gray-100 border border-gray-300 rounded-md p-5 space-y-4",children:e.setupPath==="quick"?h("AI Provider",gn["AI Provider"]):Object.entries(gn).map(([f,b])=>h(f,b))}),a&&r.jsxs("div",{className:"p-4 bg-red-50 text-red-700 rounded-md border border-red-200",children:[r.jsx("p",{className:"font-medium",children:"Error initializing project"}),r.jsx("p",{children:a})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(X,{onClick:n,variant:"outline",type:"button",children:"Previous"}),r.jsx(X,{type:"submit",disabled:i,children:i?r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("span",{children:"Initializing..."})]}):"Initialize Project"})]})]})})}const Ti=({icon:e,title:t,description:n,time:i,link:s})=>r.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"block bg-white rounded-lg shadow-sm border border-gray-100 hover:shadow-md transition-all duration-200 hover:border-solace-blue/30 group h-full",children:r.jsxs("div",{className:"p-5 flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-2xl mr-3",children:e}),r.jsx("h4",{className:"text-lg font-medium text-gray-800 group-hover:text-solace-blue transition-colors",children:t})]}),r.jsx("div",{className:"bg-gray-100 text-gray-600 px-3 py-1 rounded-full text-xs font-medium",children:i})]}),r.jsx("p",{className:"text-gray-600 text-sm flex-grow mb-4",children:n}),r.jsx("div",{className:"mt-auto flex justify-end",children:r.jsxs("span",{className:"text-solace-blue text-sm font-medium flex items-center group-hover:translate-x-1 transition-transform",children:["View Tutorial",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})}),Pi=({icon:e,title:t,description:n,link:i})=>r.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex p-4 bg-gray-50 hover:bg-gray-100 rounded-lg border border-gray-200 transition-colors group items-center",children:[r.jsx("div",{className:"mr-4 flex-shrink-0 bg-solace-blue bg-opacity-10 p-3 rounded-lg text-solace-blue group-hover:bg-opacity-20",children:e}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-gray-800",children:t}),r.jsx("p",{className:"text-sm text-gray-600",children:n})]})]});function Mi({text:e}){const[t,n]=j.useState(!1),i=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy text:",a)}},s=()=>t?r.jsx("svg",{className:"w-5 h-5 text-green-500 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):r.jsx("svg",{className:"w-5 h-5 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})});return r.jsx("button",{onClick:i,className:"text-white transition-colors opacity-100","aria-label":t?"Copied":"Copy to clipboard",children:s()})}function Zt({title:e,message:t,initTab:n}){const[i,s]=j.useState(n??"getting-started"),a=3,o=i==="getting-started"?0:i==="tutorials"?1:2,l="Operation Successful!",u="Your configuration has been saved. You're now ready to proceed.",c=f=>f===0?"tutorials":f===1?"documentation":"getting-started",d=f=>f===1?"getting-started":f===2?"tutorials":"documentation",m=()=>{if(o<a-1){const f=c(o);s(f)}},h=()=>{if(o>0){const f=d(o);s(f)}},p=f=>{const b="px-4 py-3 text-sm font-medium ";return i===f?b+"text-solace-blue border-b-2 border-solace-blue":b+"text-gray-500 hover:text-solace-blue"},w=[{icon:"🌤️",title:"Weather Agent",description:"Build an agent that gives Solace Agent Mesh the ability to access real-time weather information.",time:"~5 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/custom-agent"},{icon:"🗃️",title:"SQL Database Integration",description:"Enable Solace Agent Mesh to answer company-specific questions using a sample coffee company database.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/sql-database"},{icon:"🧠",title:"MCP Integration",description:"Integrating a Model Context Protocol (MCP) Server into Solace Agent Mesh.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/mcp-integration"},{icon:"💬",title:"Slack Integration",description:"Chat with Solace Agent Mesh directly from Slack.",time:"~20-30 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/slack-integration"}],v=[{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:"Getting Started",description:"Introduction and basic concepts",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),title:"Architecture",description:"System architecture and design",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/architecture"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})}),title:"Tutorials",description:"Step-by-step guides",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/custom-agent"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),title:"Developing",description:"Development guides for various components",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/"}],N=()=>i==="getting-started"?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"})}),"Your Configuration Files"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Your configurations have been saved in the following files:"}),r.jsxs("div",{className:"flex space-x-4 mb-4",children:[r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:".env"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Environment variables"})]}),r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:"configs/shared_config.yaml"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Config file"})]})]})]}),r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"})}),"Start the Service"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"To start Solace Agent Mesh directly, return to your terminal and run:"}),r.jsxs("div",{className:"bg-gray-800 text-gray-200 p-4 rounded-md font-mono text-sm mb-4 flex items-center justify-between group relative",children:[r.jsx("code",{children:"sam run"}),r.jsx(Mi,{text:"sam run"})]}),r.jsxs("p",{className:"text-gray-600",children:["You can use"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"sam"})," as a shorthand for"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"solace-agent-mesh"})," ","in all commands."]})]})]}):i==="tutorials"?r.jsxs("div",{children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-800 mb-2",children:"Hands-on Tutorials"}),r.jsx("p",{className:"text-gray-600",children:"Ready to go further? Here are some practical tutorials to help you leverage the full potential of Solace Agent Mesh."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(f=>r.jsx(Ti,{icon:f.icon,title:f.title,description:f.description,time:f.time,link:f.link},f.title))})]}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"Documentation Resources"]}),r.jsx("p",{className:"text-gray-600 mb-6",children:"Explore our comprehensive documentation to get the most out of Solace Agent Mesh:"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:v.map(f=>r.jsx(Pi,{icon:f.icon,title:f.title,description:f.description,link:f.link},f.title))}),r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("a",{href:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-5 py-2 rounded-md bg-solace-blue text-white hover:bg-solace-blue-dark transition-colors",children:["View Documentation",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})]}),r.jsxs("div",{className:"p-6 bg-gradient-to-b from-solace-blue-light to-blue-50 rounded-lg text-center",children:[r.jsx("h3",{className:"text-lg font-medium text-solace-blue mb-2",children:"Connect with the Community"}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Solace Agent Mesh is open source! We welcome contributions and discussions from the community."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row justify-center items-stretch gap-4",children:[r.jsxs("a",{href:"https://github.com/SolaceLabs/solace-agent-mesh",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",className:"mb-2 text-solace-blue group-hover:text-white transition-colors",children:r.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",fill:"currentColor"})}),r.jsx("span",{className:"font-medium",children:"GitHub Repository"})]}),r.jsxs("a",{href:"https://solace.community/c/solace-agent-mesh/16",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("img",{src:"data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAACnCAMAAAC1m4byAAAAM1BMVEUAAAAAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJWmhxYbAAAAEHRSTlMAECAwQFBgcICPn6+/z9/vIxqCigAAFnJJREFUeNrs1w1ymzAQQGH9IYQQ0t7/tJ2606ndJHhxiZt433eAZVj0hpEDAAAAAAAAAAAAAAAA8NWFpOEAfGdFNByA74zQAQMIHTCA0AEDpo3QAQNCboQOGBBWQgcMyIQOGDATOmBAJ3Tg9S2EDry+idCB15cIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB04U/rNu/P4lHK5SCl+hdDTlU/cZLnIZy3Tp5+CA/5ByEsbcmWr5U0FWUSkOL041ya3eiuT/0+hp7y0Tf7SWy1n9hPnyyZvtJqDe1gq11scbcnRAceFeZN3tRLdH74fCn2qQz6wzeHZocfSZEdf5xPq8Xkd8oG+xIc+TXt3WE0OOCStsqPX7N0vVfShxzpk15b980KPS5db+hT18ir7+uwPTmw7w4p3gFZoctdWc0q5iTr01OS+UcJTQve5i1YvwT3Gl6F6Z3/exLGQOpSKHFWUmZ947GWHMhe9Gh7MXGfMTkczcfBXh4bf5PTQwyp6I39y6PMQBUXq5z1li+6+1EWlc1fHXXHIW62VsrRNEbr6zPdlSj/YO9flxlEgjDY3CSQu/f5PuzvZma3EQvhrhFJKDedvBJYxp2laxP6XpbZvj/pG0U06lhdX+wvv9ywNZvircAlOEZFZM1dY6Q1qq4yhNaTscvjLzN8nYs/Lp2KuDVkugdormjv6n6UcnXC3ie5fLV/U14p2bqy6MGstPW8v9hs1MbmR+ajAX0nzYdtE5vmugM22F81Q5vA2EoR7RFfxfURxmesUyJ76G0qKPmG4QlR0zvKmR1f4C2WaPjlHHTxf6IBNgOiHGdjsdOMDu7pBdJUOslQ9BU3H0/YNqXfudEqoed6OBAtNJickbOcYcNEXPhKAF65IiIuOel4U1blkuinv34tmBgamEQiLphfCNH1yBBN4B5dpL/E80hFdYNP7RVcJFUtlrpMV4DlgJSWu4VDPeQWysZm9T6pYfqEocDb7lufQ/PMMmA6LDvpi6QzHJ+yA54CVtDXiCHBtrofpuU+fAGR+waPz2Qs836DqwAepU3RUXtscizoW8Byw0uPP8DbwOsOvpPmUbYJoqegc8150yzU0VQlAUEBFR9PxFRiMRvABtyC84KIXOrDCg5grm/7J5O08iXBc8I3FDcx9DddYx4nuRTtuxWc46anCQhU82rvFo81W624yqYqLrwdbW3SVZJ5kWabMDeD+I/AAotEG23kHiegbsqXhgGYheSbvkxeS9NCnysDW8gBQ8gfqgXLRXd0r4HYaaTOSZbORiJ6hB30WToo8TSaf0fJJYltXOrRqjTfARcfjzgJIi24nTGmoC4rO0KDgY1Lm90xN3k3sjd6wnYuuitAS0lzHjRE9M7NEBMtnRFm2H2SiG2AUk+AGNppMPhGxtajupgcW0N4nWkUNEZ1P2MSiM9XxknccGRkgL7vnCAwfjvOTR2GtoesIrDzq7GFN6JwoUpEbiLzVjbK7RF1dwJvBRdfCtMgjF+PoZefJs8i7t3QFwxUiuqR7dB6nni+20QNFx0VgYYtdlOh7QHRxWuTBGgGOWiJPnsa+KOrFAfvjCltd9AXa38KNbhVdXu0LklTfC0UH6hwsqysYuoTZePI4dkd9+L7/1rL12ZwZmPa4i/ZO0aNY9CjJxa0sqmU0GOAjGOgieqr+QPKi+kWXn5bONX8dlPXiau13il7kokv6V1TFANlCBvY/QKeZLmNmAv9Aytotutz0UBM9YmszrpYeJjrugaz/CIeRtsUauOUoHEFD13GFJ48j22Gic2n3ZSqia0ZFR+NDuCy6Hpi6s6D7KBvwHSjF8SYUfaUBqFmBfyK76hRdfIoy/mIBT4+y6hO9DDkwU2cfIXpohKg6qrw7vlPkHwjwDvtZefI8ih0mOidhX4VPAUr4VZxUdLzztVt0VErcGwdtNrxw5AuNwcz0/Yl4oegtdk04js/pvYftsuiGT9By0QVv2Uni2oLlRYs0J9IEYNcQP9qXGMNqqYJOPBHzrPR9HfdLJYFPSb2il8ui0w6EkF7R966ihG9+9XQC+gRFdz2/z7qvml5R0/QnkhTBWOZRqmc+JXYHGycRHd8Uc9EjRC98hoGfWm0KfH256L7z91l3N03/EQhM18yw6v09xe5gE0Si41tMSwNEd8CldUz4kCwfl087UPTY1Dw3T2VM038CAtMzA+yW3rLcInq6LjqZBJUs5aIH+FKcdaDoiU5xmT+AK7Eq8+R54KZvDBHthS06792i8wDRSXnkxxzloqcbRN96+ox4C/zheFCz9v58kqBWPkb1yOf4ftGtUPQ62mc0PRkTdKiXOFJ0fem4WzYvM2XyQDYCKYwSHSAIJjredJWI3kI7/wtLTdSC92/vEJ1HYqmGZ5TXA1GTB7IQRhhzxlbfJHoQi96P8YkF/a+PF32hClv3cjELck+k6AF1dzyBtzeJHr9LdBcyv0EQIqkTyyPxiOe46YYnDyQOKMfhp+XWm0TP3yK62wozC0WPP1H0jWVsM3l/PCtBqDLikK2/SXQeIzpuOd5/vkH05eZYv12aRWpW3p9IUeLCe/9WPfxQ0QHL+29Fjr9X9IXluC/tJw9ku5y84+bGu0Q3N9plPiz/e0Q3l4s989jMI9EEoRJLSeq7RLd32aV95gMlwf3b7xY9RylhyOm2CCzpzTvOfEqJ0Xu/xxlA7l3S+/dexfxs0ZedD+RgyY4R3dwguqeL+AHFngJLHpyiP1if+Mi2aPqDqu6hNvubwDWy/c1aabJzjVRpYj9IZ9d+Ggj7H4UPrNXbWH/30yJF+8HRoOof6mjCMD2m/1zRta9OKiIaJbq9wcVI19Ajij0e1Hx5N+bFq8NhpXI6cXT7kIWtNHFcY6k0OZvB8XXK2fO8xlZvwwIfXGR9Mp8svt/yBGJSh+k/VPRarC9eEw0U3T1Q9J17CcJoUVaqsLz91gQVTidO4gqmJTr9096ZrkmqIgE0QERElnj/p53pWxlf3xbEYLHLmuH86s5SEk0OBIFLwAxihOjghopu84U6+phBBC6iwXT5E0XXHlOMABgqunlAdA9dKGxHVnUXfrm9Il/zlhdN8ToND0XRd0w5YIjocqjoqHI/UPrpoJHFYi3+54muA6Y4CTBY9P0B0RG6sGOuvNGtt04uF55LtVyaboqRxFYWfcEUPUZ0MCNFz4/dtuq6Y/voM7z3HyZ6VvO4AgwX3b1OdIkdRABCsD0X+oj/7Pz1eA2bMVTZgF+b6KzpphhJyLLoEArH0Sm6CBWiB/ObzzBtfhMuBm9ZtcwRoQLpsBL1k0TPao5ewgOihydEV9DBNur2GM9M3WwRf+O0SONn6XJXYR3nhiNlvsUf9MfUMCUpds+Me4vsFx0UU/S8CuZ+Om4zndW4xqFj6xLr8ZToYpDoymEOK+AJ0fEJ0VfowGMPR7mKaTwtLP5JTHI7S8x2JiKerd0pkshsv2cNW7fCTNouA0SHY6ToqJOoS2Y2HDhZFDtWoX/Ite5iL05txouuHhDddEXufQjmcYf7jIAhzy86MnMWPZBZmSqFrGHKU+eWVk5E6BLdLtQfDRQ9nM+azX3J0MmiPLAC97TocYjoKhY8bxRdMga2alYscDwcufOiCcHp+c19n+Gv1utFPIXuXxbpbBiOedFR5g56/yqnT3Tj6IwOFJ2G9IYBnYBqlEM+C7XQN9+PbvjmqJ7gol9KhQX8+EX0lsgw3PfL8j4/rK//ZE8NBy35n3Q9FkVedIrd08Z69IpOnbgfKXoUfxz6Xh+GLfCo6vvDD544+kUXB+YJokv0OD4bN37iT4Rx98e4++Zg78f8cH0JnjqLHtNCP59FhLzoFLsnHaXAXtGpmstA0ekPMtGezQotLBZ5hIefGWe6RRe+0Af2iO7aOtiuFYhWBPbCyyOo+28jSwqdQDyJjmsaNO6fjyBr2Of863Q6tfWKrpAij32k6OR2Yj0XA21IWxcxhOY6yJp+CgtUem6hT3T7xCQdn8nGKexFsES/v6jGlwqx5NzJWkv+J2H4peiUqj8nsv0A0ak/CwNFp2g9/pbe1U6uHlVd0yTwmcc9y17RHV4QRafo26AsKD9MOL5RdAXEenvQ9v4YXCk+NGdr09g9kMdXoqep+uMzqoRu0ame60jRKf9W2LmjwfWrTh2JeeQFDgE6RC9Xy1ZXpk4eMT5pFqEVM1B0dZto8/edfmREBLQxBXbqXIwuiJ7G7voTbrt+0eko3ADR0xU1GtB7RB+vumM0e9csuq0VnV/20is6YBH9gJHq5aIb9oP6iz+K+rM8T0NFSMLwS9Epdk/W3ceIHiUF2sNEp4M3n200jhR9Ub+AAsJEdjZuvOi6U/RQqHe36B5L+Adi7P37RN+AUE0WE6q4icqJ7sjS/c+TK/Fa9CR2p3X3MaLT38w40alM4QU13YGiO+rr2lWHD8cTr02WfaKbgjP9ou9YRI5Pj4eXi854VAKpXCm6/lfB9N+tIDqVtZ7W3UeJTlliP1B0yvGRFeNFV1BGWEbz162Dmynt2Cd6xEt0v+gKi9gHFryXd4fu5Gmn6MtZ9CR2pzC8IDql6k/r7qNED4KKaRS97KqIT4hu4A7l8QrOWNTaCLc+0TVeo/pFh4glohh/27j9vxA9GdHPsftB3UFB9FOq3tL43i16cm3QMNFxBcLgE6L7ngbISRi3Jppln+iuuHG/6BaLmPGvcIjvXl5TdGEEdxO+6Jp2+51AL4pO2qyndfdhoiPd3DJQ9AAfZHxEdBQdLZDTREXb0vEBXaILfFj0FccP6QKL6FdfMMPIuuu2ZBxd03oKwy9FP8XutO4+UnRPzX6c6KjbHwdkOKLr9veuRk4kq9rulF77RNdPiw7hgSHdj0nHaSuGvqUVOkTnb0Id6Fl0iu62UxheFD1Ss6WP9VDRcaMdh4lOM3+JD4l+AAd3EzGYNtELjbpP9P1x0Q0WiXL8DaWaPQOI21+/qcWyb3txpVHD5ETfyABKoN+KTqn63+vuY0WPZOU40VE1p1RWlrui+eEFlhN1mqZYVXeK7h4SnZ8bPcbH7qFipu+XB29T5V8Cy9/EUWUzolPsTmF4vBf9oPrSuvtQ0al8MK8QfWGJvgEHe+OwZYjOVytAp+gBCywjRAc75t7BRY9N8Wna9m8/eII9Z9KlYws50VHSfjv94050StXTjWuDRSctRXiD6MASPTQ//0RxBjjXkmbWvaJzFewQXeKIfNwS0bATZ1GyPfd/+1FS1PJj452sC9U1EZ3+I2irgyM6xe607p4X/erm7502vBKdtFEvEN0xRM9bxdSMNWcNDUu8Hh4Vfa9fxmZkKBMc9+UZ9nbKQXiu56j++sMhaXG5aRM6WVtWdLqmlcJwjugUux8kfFZ0dRHz6Pwtaqm3cKD5btENU/TQmI47eO/rrCiTUM+KHqDa26b3U1qG56cNNaNIjuf733/cc6Bl4PtNrn/ykBWd7kejMPxedBqsN1p3z4pO89bl6r7Rgui0jYjfLrrimqsbRE93W+urEcqtuV90RpV4ilUlydknVvqkS3Y9plv84L/jBQ4rnciG50cekLfW/bvjEpRAZ4hOqXpad09EL90iT2fZF0WnIOS7RY9sc6NoED3d66gNLCRvcjtedFfrOUIW12f6ElMtFTabLj1+iMt3vJLJ0bfVPxHai+SEmkwiaaVWwxHd/95lxUT04tOt6E5ULIpOPZv6ZtEt39yDKXq5fBEYVjFigBX6RY9YZKudb0MWGXt+BB2pY6uS0gnIssXL/mX5Oy9Z1PeRjsme70PQjono6UrJfid6WnN7Lbqh3yLzxhl7Izr9cN8s+lphrm64akty09ai7hr6HQaI7qqmNeLAG5ofme7l7XsllrqZP0Z98/Re+02vTY6StrQRiXhsi0mXNtWBhFOnCCcn+g5E4Iq+pac0FT3K5J0GVsLNo16J/Q2iR6gQPS7VWXfLbvdb1RTdwwjRbU1QrSM339FgUDQ3b8DS9demB30uzSVx8JhZehSsnHv6zcr8w7rQnslztsX6tYU8ZSbzosfT6WGI7tMpRyo6unN9xKk6BdFRvUB0wxGdb/rKeraCrVF3qVwqxgJL9VB7UFduAn9gE6bh3fJhE0Ck37k13VcaraZDXrSNiIlK3DL5c5yIPNNTDCvE8ZgRPQlQ7Z3oaRM9SqKjLVanLLp/geiSIzrfdMvrRzxmUMUi2dXAAqphVuqt2V1ABlSvJeCWJtQYHJuCD3Ld/U0zs8gjOOcC7wwKjy04VrqypHHaeKOCHCpgUXQ6UZEvuqFwpig6WpE/YQzRcft20W1tdi2uNde6h0K3zEzHiViXplY1okPAanzRdAVii4i41JpORPdfzhvbPiv5PeXSVJisPqPR3McTVmYzFmXRI0WWfNEDRXdl0dGr3MyKJXqU3y265ItO7IK/8QIF03n67twNm17xZrCWQzjEhuhUYxXcsLHf8/5qri37B3Nqe2qPeMIup5cDRbwRnSpz8EWnVuqvRSfcCv9C6IDIEx2PbxbdQr3oGNaOwJ0QnjfxVpWew151r5hscG5HDrpDIe5pFHac54TtmqCLiHy83dQXZneYJR5mVb9YzRHy85JfxPMHf+j5C59sUfgg0i7X9dHGYQZ/taNz+Wr4iyMKeIWnv1cQRZ3ohFOcNkJa8U33AhgRr4YSoe6dCXt9o1bIwGcz6Ez4x2vHeU7YnnBjx8kL2YAlOk916VJti9h705dY2UphqxwcRUA2lKAI3Mi9dZ5eSkr1xwleQhHb7vmCkxfiel71FXYF/2I9kO05sV2pRGyR2Ur5LumOZ6U5WbVSnCI91uIElFlCdZIBYJzp+ylKm7yPKFtFJ9xujNLGWMdp6ymLxwSnxceKLWDCXixVGLzFtmbJ4gYfZLtLe9/0vH+iHrehj37WMAP316OBL3rHSFRvZqD8ypmgoIA0ERlEu7SY7iRbhB2uUQH5+AU4rGF0iSoih7CcTuTkhVioEt2vIDc//J3ri0Mu0Qi4gl03mnZUNmuv2M9hjSu/b+NfrM4qs38451/Wn4ZXS8TJ+3BQJbqv8cktwEcxVbdy4ItGXFWz9vrsQeyYAkvb2q3xy+wvcQ11fR+I6fkb8aJK9CiAWPaARZyCOhTnng8JMFR0frO2in+tSlA8LSOWCYmU3DL7NSd0uLthZibiXg95zhVdn+Jkdz0DZmvOD7yPFYhRonObtd8E/wsdP9jWB/N4+YjNDy5Ru6viFEzPfwJ8z8HlvRDr7jJZ+BVakdpmVfNU5mOiE+pcgWC1KOX+wqmiss7L/AEHuwpoRW5H7P9Vyl16PLSA6fmPoMJz2N1/UZBlWY053C+sMWqBXoTajHOOUu/WaMUffKrYIcuijfvCGCXgjmX7bG7NKjsOOH4ubTSbEtCLXM3uvjiG/Cpq27+qGH7VMFveMj1/I4eAyWQcaubh3oiByWQgG07eR1QwmYxDOJzUMcP2yY9Dz7D9hYQ5nE9Gsszh/IUEDZPJOKTFSQVT88kPZJmav5BjhclkGELPpfP3ceiZgpuMQ+oDJ+/CH2Ym4CZDWc3kTWilJEwmk8lkMplMJpPJZDKZTCaTyWQymUwmk8lkMplMJpPJZDKZTCb/8/wHtHUhcGqvStMAAAAASUVORK5CYII=",alt:"Solace Community Forum Logo",className:"max-h-8 mb-2 object-contain"}),r.jsx("span",{className:"font-medium",children:"Community Forum"})]})]})]})]});return r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs("div",{className:"p-8 bg-gradient-to-br from-green-50 to-blue-50 rounded-xl mb-8 text-center relative overflow-hidden",children:[r.jsxs("div",{className:"relative z-10",children:[r.jsx("div",{className:"inline-block bg-green-100 p-3 rounded-full mb-4",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:e||l}),r.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:t||u}),r.jsxs("div",{className:"inline-flex items-center px-4 py-2 bg-solace-blue text-white rounded-full shadow-sm",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z",clipRule:"evenodd"})}),"Configuration saved successfully"]})]}),r.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 h-40 w-40 bg-green-200 opacity-50 rounded-full"}),r.jsx("div",{className:"absolute bottom-0 left-0 -mb-10 -ml-10 h-32 w-32 bg-green-200 opacity-50 rounded-full"})]}),r.jsxs("div",{className:"flex items-center mb-6 border-b",children:[r.jsxs("div",{className:"flex-1 flex",children:[r.jsx("button",{onClick:()=>s("getting-started"),className:p("getting-started"),children:"Getting Started"}),r.jsx("button",{onClick:()=>s("tutorials"),className:p("tutorials"),children:"Tutorials"}),r.jsx("button",{onClick:()=>s("documentation"),className:p("documentation"),children:"Documentation"})]}),r.jsxs("div",{className:"text-gray-500 text-sm mr-4 flex items-center",children:["Page ",o+1," of ",a]})]}),N(),r.jsxs("div",{className:"mt-8 flex justify-between items-center",children:[r.jsx("div",{className:"text-sm text-gray-500",children:r.jsxs("span",{className:"md:hidden",children:["Page ",o+1," of ",a]})}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsx("div",{className:"w-24",children:o>0&&r.jsx(X,{onClick:h,variant:"outline",type:"button",children:"Previous"})}),r.jsx("div",{className:"w-20",children:o<a-1&&r.jsx(X,{onClick:m,type:"button",children:"Next"})})]})]})]})}const Nt={id:"path-selection",title:"Setup Path",description:"Choose your setup path",component:hi},xn=[{id:"project-setup",title:"Project Structure",description:"Set up your project namespace",component:gi},{id:"broker-setup",title:"Broker Setup",description:"Configure your Solace PubSub+ broker connection",component:bi},{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"orchestrator-setup",title:"Orchestrator",description:"Configure your main orchestrator",component:Ci},{id:"webui-gateway-setup",title:"Web UI & Platform Service",description:"Configure Web UI Gateway and Platform Service",component:Ai},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}],yn=[{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}];function Fi(){const[e,t]=j.useState(0),[n,i]=j.useState({}),[s,a]=j.useState(!1),[o,l]=j.useState(null),[u,c]=j.useState(null),[d,m]=j.useState(!1),[h,p]=j.useState([Nt]);j.useEffect(()=>{u&&(a(!0),fetch(`/api/default_options?path=${u}`).then(L=>{if(!L.ok)throw new Error("Failed to fetch default options");return L.json()}).then(L=>{if(L!=null&&L.default_options){const _=L.default_options;i(I=>({...I,..._})),a(!1)}else throw new Error("Invalid response format")}).catch(L=>{console.error("Error fetching default options:",L),l("Failed to connect to server, is the init process still running?"),a(!1)}))},[u]),j.useEffect(()=>{u==="quick"?p([Nt,...yn]):u==="advanced"&&p([Nt,...xn])},[u]);const w=h[e],v=L=>{L.setupPath&&typeof L.setupPath=="string"&&L.setupPath!==u&&c(L.setupPath),L.showSuccess&&m(!0),i(_=>({..._,...L}))},N=()=>{e<h.length-1&&t(e+1)},f=()=>{e>0&&t(e-1)};if(s&&e>0)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6 flex flex-col items-center justify-center min-h-[400px]",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 w-full text-center",children:[r.jsxs("div",{className:"animate-pulse flex flex-col items-center",children:[r.jsx("div",{className:"h-4 w-1/2 bg-gray-200 rounded mb-4"}),r.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded"})]}),r.jsx("p",{className:"mt-4",children:"Loading configuration options..."})]})]});if(o)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsxs("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert",children:[r.jsx("p",{className:"font-bold",children:"Error"}),r.jsx("p",{children:o})]}),r.jsx("div",{className:"mt-4 flex justify-center",children:r.jsx("button",{onClick:()=>window.location.reload(),className:"bg-solace-blue hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Retry"})})]})]});if(d)return r.jsx("div",{className:"max-w-4xl mx-auto p-6",children:r.jsx(Zt,{title:"Solace Agent Mesh Initialized Successfully!",message:"Your project configuration has been saved. You are now ready to start building and running agents."})});const b=w==null?void 0:w.component;if(!b)return r.jsx("div",{className:"text-center p-10 text-red-600",children:"Error: Setup step not found."});const k=e>0,M=()=>u==="quick"?yn:u==="advanced"?xn:[];return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),k&&r.jsx("div",{className:"mb-8",children:r.jsx(Kt,{steps:M(),currentStepIndex:e>0?e-1:0,onStepClick:()=>{}})}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsx("h2",{className:"text-xl font-bold mb-2 text-solace-blue",children:w.title}),r.jsx("p",{className:"text-gray-600 mb-6",children:w.description}),r.jsx(b,{data:n,updateData:v,onNext:N,onPrevious:f})]})]})}const Li=[{value:"planning",label:"Planning Model (*planning_model)"},{value:"general",label:"General Model (*general_model)"},{value:"image_gen",label:"Image Generation Model (*image_gen_model)"},{value:"report_gen",label:"Report Generation Model (*report_gen_model)"},{value:"multimodal",label:"Multimodal Model (*multimodal_model)"},{value:"gemini_pro",label:"Gemini Pro Model (*gemini_pro_model)"}],Ri=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=l=>{const{name:u,value:c,type:d}=l.target,m=d==="checkbox"?l.target.checked:c;t({[u]:m})},a=()=>{if(!e.agent_name||e.agent_name.trim()===""){alert("Agent Name is required.");return}let l=e.instruction;if(typeof l=="string"&&l.includes("__AGENT_NAME__")){const u=e.agent_name;l=l.replace(/__AGENT_NAME__/g,u),t({instruction:l})}n()},o=e.instruction||`You are a helpful assistant named ${e.agent_name||"NewAgent"}, accessed via a custom endpoint.`;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",required:!0,helpText:"Unique name for this agent (will be PascalCase by the system).",children:r.jsx(H,{id:"agent_name",name:"agent_name",value:e.agent_name||"",onChange:s,placeholder:"MyNewAgent",required:!0})}),r.jsx(P,{label:"A2A Namespace",htmlFor:"namespace",helpText:"A2A topic namespace (e.g., myorg/dev). Can use ${NAMESPACE} for environment variable.",children:r.jsx(H,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:s,placeholder:"${NAMESPACE}"})}),r.jsx(P,{label:"Model Type",htmlFor:"model_type",required:!0,children:r.jsx(ae,{id:"model_type",name:"model_type",value:e.model_type||"planning",onChange:s,options:Li})}),r.jsx(P,{label:"Instruction",htmlFor:"instruction",helpText:"System instruction for the agent. Use __AGENT_NAME__ to refer to the agent's name.",children:r.jsx("textarea",{id:"instruction",name:"instruction",value:e.instruction!==void 0?e.instruction:o.replace("__AGENT_NAME__",e.agent_name||"NewAgent"),onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"You are a helpful assistant..."})}),r.jsx(P,{label:"",htmlFor:"supports_streaming",children:r.jsx(ye,{id:"supports_streaming",checked:e.supports_streaming===void 0?!0:!!e.supports_streaming,onChange:l=>t({supports_streaming:l}),label:"Supports Streaming (host capability for A2A tasks/sendSubscribe)"})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",disabled:!0,children:"Previous"}),r.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},bn="use_default_shared_session",ut="use_default_shared_artifact",zi=[{value:ut,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process, temporary)"},{value:"filesystem",label:"Filesystem (Local disk storage)"},{value:"gcs",label:"Google Cloud Storage (GCS)"}],Oi=[{value:"namespace",label:"Namespace (Shared by all agents in namespace)"},{value:"app",label:"App (Isolated to this agent instance)"}],Di=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=u=>{const{name:c,value:d}=u.target,m={[c]:d};c==="session_service_type"?(d===bn?m.session_service_behavior=void 0:e.session_service_behavior||(m.session_service_behavior="PERSISTENT"),d==="sql"?m.database_url="default_agent_db":m.database_url=void 0):c==="artifact_service_type"&&(d===ut?(m.artifact_service_base_path=void 0,m.artifact_service_scope=void 0):(e.artifact_service_scope||(m.artifact_service_scope="namespace"),d==="filesystem"&&!e.artifact_service_base_path&&(m.artifact_service_base_path="/tmp/samv2"))),t(m)},a=u=>{t({[u.target.name]:u.target.value})},o=()=>{if(e.artifact_service_type==="filesystem"&&(!e.artifact_service_base_path||e.artifact_service_base_path.trim()==="")){alert("Artifact Service Base Path is required when type is Filesystem and not using default.");return}n()};e.session_service_type;const l=e.artifact_service_type!==ut;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{children:"Configure how your agent handles artifacts (files). You can use default settings from a shared project configuration or define them specifically for this agent."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Artifact Service"}),r.jsx(P,{label:"Artifact Service Configuration",htmlFor:"artifact_service_type",required:!0,children:r.jsx(ae,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||ut,onChange:s,options:zi})}),l&&e.artifact_service_type==="filesystem"&&r.jsx(P,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:!0,helpText:"Base directory path for filesystem artifact storage.",children:r.jsx(H,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"/tmp/samv2",onChange:a,placeholder:"/tmp/samv2",required:!0})}),l&&r.jsx(P,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:!0,children:r.jsx(ae,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"namespace",onChange:a,options:Oi})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},Cr=({title:e,onClose:t,children:n})=>r.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50 flex justify-center items-center p-4",children:r.jsxs("div",{className:"relative bg-white w-full max-w-2xl mx-auto rounded-lg shadow-xl p-6",children:[r.jsxs("div",{className:"flex justify-between items-center border-b pb-3 mb-4",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e}),r.jsx("button",{onClick:t,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center","aria-label":"Close modal",children:r.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),r.jsx("div",{children:n})]})}),_n=({id:e,label:t,values:n,onChange:i,placeholder:s,helpText:a,error:o,required:l,keyPlaceholder:u="Key",valuePlaceholder:c="Value"})=>{const[d,m]=j.useState(""),[h,p]=j.useState(""),w=()=>{const k=d.trim(),M=h.trim();k===""||M===""||k in n||(i({...n,[k]:M}),m(""),p(""))},v=k=>{const M={...n};delete M[k],i(M)},N=(k,M)=>{i({...n,[k]:M})},f=k=>{k.key==="Enter"&&(k.preventDefault(),w())},b=Object.entries(n);return r.jsx(P,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(H,{id:`${e}-key`,name:`${e}-key`,value:d,onChange:k=>m(k.target.value),onKeyDown:f,placeholder:u,className:"flex-1"}),r.jsx(H,{id:`${e}-value`,name:`${e}-value`,value:h,onChange:k=>p(k.target.value),onKeyDown:f,placeholder:c,className:"flex-1"}),r.jsx(X,{onClick:w,variant:"secondary",type:"button",children:"Add"})]}),b.length>0&&r.jsx("div",{className:"border border-gray-200 rounded-md divide-y divide-gray-200",children:b.map(([k,M])=>r.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-gray-50",children:[r.jsx("div",{className:"flex-1 font-mono text-sm text-gray-700 px-2 py-1 bg-gray-100 rounded",children:k}),r.jsx(H,{id:`${e}-value-${k}`,value:M,onChange:L=>N(k,L.target.value),className:"flex-1 text-sm",placeholder:"Value"}),r.jsx("button",{type:"button",onClick:()=>v(k),className:"text-red-500 hover:text-red-700 focus:outline-none px-2","aria-label":`Remove ${k}`,children:"×"})]},k))}),b.length===0&&s&&r.jsx("div",{className:"p-3 border border-dashed border-gray-300 rounded-md flex items-center justify-center",children:r.jsx("p",{className:"text-sm text-gray-400",children:s})})]})})},Bi=({id:e,label:t,values:n,onChange:i,placeholder:s,helpText:a,error:o,required:l,itemPlaceholder:u="Enter value"})=>{const[c,d]=j.useState(""),m=()=>{c.trim()!==""&&(i([...n,c.trim()]),d(""))},h=f=>{i(n.filter((b,k)=>k!==f))},p=(f,b)=>{const k=[...n];k[f]=b,i(k)},w=f=>{f.key==="Enter"&&(f.preventDefault(),m())},v=f=>{if(f===0)return;const b=[...n];[b[f-1],b[f]]=[b[f],b[f-1]],i(b)},N=f=>{if(f===n.length-1)return;const b=[...n];[b[f],b[f+1]]=[b[f+1],b[f]],i(b)};return r.jsx(P,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(H,{id:e,name:e,value:c,onChange:f=>d(f.target.value),onKeyDown:w,placeholder:u,className:"flex-1"}),r.jsx(X,{onClick:m,variant:"secondary",type:"button",children:"Add"})]}),n.length>0&&r.jsx("div",{className:"border border-gray-200 rounded-md divide-y divide-gray-200",children:n.map((f,b)=>r.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-gray-50",children:[r.jsxs("div",{className:"flex flex-col space-y-1",children:[r.jsx("button",{type:"button",onClick:()=>v(b),disabled:b===0,className:`text-xs ${b===0?"text-gray-300 cursor-not-allowed":"text-gray-500 hover:text-gray-700"} focus:outline-none`,"aria-label":"Move up",children:"▲"}),r.jsx("button",{type:"button",onClick:()=>N(b),disabled:b===n.length-1,className:`text-xs ${b===n.length-1?"text-gray-300 cursor-not-allowed":"text-gray-500 hover:text-gray-700"} focus:outline-none`,"aria-label":"Move down",children:"▼"})]}),r.jsx("span",{className:"text-sm text-gray-500 w-6",children:b}),r.jsx(H,{id:`${e}-item-${b}`,value:f,onChange:k=>p(b,k.target.value),className:"flex-1 text-sm",placeholder:u}),r.jsx("button",{type:"button",onClick:()=>h(b),className:"text-red-500 hover:text-red-700 focus:outline-none px-2","aria-label":`Remove item ${b}`,children:"×"})]},`${e}-${b}-${f}`))}),n.length===0&&s&&r.jsx("div",{className:"p-3 border border-dashed border-gray-300 rounded-md flex items-center justify-center",children:r.jsx("p",{className:"text-sm text-gray-400",children:s})})]})})},Ct={id:void 0,tool_type:"",tool_name:"",tool_description:"",group_name:"",component_module:"",function_name:"",component_base_path:"",connection_params:void 0,environment_variables:void 0,required_scopes:[],tool_config:void 0,environment_variables_ui:{},tool_config_ui:{},transport_type:"",stdio_command:"",stdio_args:[],sse_url:"",streamable_http_url:"",mcp_timeout:30,auth_type:"",auth_token:"",auth_header_name:""},qi=({data:e,updateData:t,onNext:n,onPrevious:i,availableTools:s})=>{var q;const[a,o]=j.useState(!1),[l,u]=j.useState(Ct),[c,d]=j.useState("initial"),[m,h]=j.useState(null),[p,w]=j.useState({}),v=Array.isArray(e.tools)?e.tools:[],N=()=>{u({...Ct,id:Date.now().toString()}),h(null),w({}),d("initial"),o(!0)},f=y=>{y.tool_type==="builtin-group"?d("builtin-group"):y.tool_type==="builtin"?d("builtin-tool"):d("custom");let C={};const T={};y.environment_variables&&typeof y.environment_variables=="object"&&Object.entries(y.environment_variables).forEach(([V,z])=>{T[V]=String(z)});const R={};if(y.tool_config&&typeof y.tool_config=="object"&&Object.entries(y.tool_config).forEach(([V,z])=>{R[V]=String(z)}),y.tool_type==="mcp"&&y.connection_params){const V=y.connection_params,z=V.type;z==="stdio"?C={transport_type:"stdio",stdio_command:V.command||"",stdio_args:Array.isArray(V.args)?V.args:[],mcp_timeout:V.timeout||30}:z==="sse"?C={transport_type:"sse",sse_url:V.url||"",mcp_timeout:V.timeout||30}:z==="streamable-http"&&(C={transport_type:"streamable-http",streamable_http_url:V.url||"",mcp_timeout:V.timeout||30})}const B={...Ct,...y,...C,id:y.id||Date.now().toString(),tool_type:y.tool_type||"",required_scopes:Array.isArray(y.required_scopes)?y.required_scopes:[],environment_variables_ui:T,tool_config_ui:R};u(B),h(y.id||null),w({}),o(!0)},b=y=>{const{name:C,value:T}=y.target;if(C==="mcp_timeout"){const R=T===""?30:parseInt(T,10);u(B=>({...B,[C]:R}))}else u(R=>({...R,[C]:T}))},k=(y,C)=>{u(T=>({...T,[y]:C}))},M=(y,C)=>{u(T=>({...T,[y]:C}))},L=(y,C)=>{u(T=>({...T,[y]:C}))},_=()=>{const y={};return l.tool_type||(y.tool_type="Tool type is required."),l.tool_type==="builtin-group"?l.group_name||(y.group_name="Group name is required."):l.tool_type==="builtin"?l.tool_name||(y.tool_name="Tool name is required."):l.tool_type==="python"?(l.component_module||(y.component_module="Component module is required."),l.function_name||(y.function_name="Function name is required.")):l.tool_type==="mcp"&&(l.transport_type?l.transport_type==="stdio"?l.stdio_command||(y.stdio_command="Command is required for stdio transport."):l.transport_type==="sse"?l.sse_url||(y.sse_url="URL is required for SSE transport."):l.transport_type==="streamable-http"&&(l.streamable_http_url||(y.streamable_http_url="URL is required for streamable-http transport.")):y.transport_type="Transport type is required for MCP tools.",l.auth_type==="api_key"?(l.auth_header_name||(y.auth_header_name="Header name is required for API key authentication."),l.auth_token||(y.auth_token="API key is required for API key authentication.")):l.auth_type==="bearer"&&(l.auth_token||(y.auth_token="Bearer token is required for bearer authentication."))),w(y),Object.keys(y).length===0},I=()=>{var B;if(!_())return;const y={id:l.id||Date.now().toString(),tool_type:l.tool_type};let C;switch(l.tool_type){case"builtin-group":C={...y,group_name:l.group_name};break;case"builtin":C={...y,tool_name:l.tool_name};break;case"python":C={...y,tool_name:l.tool_name||void 0,tool_description:l.tool_description||void 0,component_module:l.component_module||void 0,function_name:l.function_name||void 0,component_base_path:l.component_base_path||void 0,tool_config:l.tool_config_ui&&Object.keys(l.tool_config_ui).length>0?l.tool_config_ui:void 0,required_scopes:l.required_scopes||[]};break;case"mcp":{let V={};if(l.transport_type==="stdio")V={type:"stdio",command:l.stdio_command,args:l.stdio_args||[],timeout:l.mcp_timeout||30};else if(l.transport_type==="sse"){V={type:"sse",url:l.sse_url,timeout:l.mcp_timeout||30};const g={};l.auth_type==="bearer"&&l.auth_token?g.Authorization=`Bearer ${l.auth_token}`:l.auth_type==="api_key"&&l.auth_token&&l.auth_header_name&&(g[l.auth_header_name]=l.auth_token),Object.keys(g).length>0&&(V.headers=g)}else if(l.transport_type==="streamable-http"){V={type:"streamable-http",url:l.streamable_http_url,timeout:l.mcp_timeout||30};const g={};l.auth_type==="bearer"&&l.auth_token?g.Authorization=`Bearer ${l.auth_token}`:l.auth_type==="api_key"&&l.auth_token&&l.auth_header_name&&(g[l.auth_header_name]=l.auth_token),Object.keys(g).length>0&&(V.headers=g)}const z=l.environment_variables_ui&&Object.keys(l.environment_variables_ui).length>0?l.environment_variables_ui:void 0,U=l.tool_config_ui&&Object.keys(l.tool_config_ui).length>0?l.tool_config_ui:void 0,$={id:y.id,tool_type:y.tool_type};l.tool_name&&($.tool_name=l.tool_name),$.connection_params=V,z&&($.environment_variables=z),U&&($.tool_config=U),l.required_scopes&&l.required_scopes.length>0&&($.required_scopes=l.required_scopes),l.auth_type&&l.auth_type!=="none"&&($.auth_type=l.auth_type,l.auth_token&&($.auth_token=l.auth_token),l.auth_type==="api_key"&&l.auth_header_name&&($.auth_header_name=l.auth_header_name)),C=$;break}default:o(!1);return}let T;m?T=v.map(V=>V.id===m?C:V):T=[...v,C];const R=((B=C.connection_params)==null?void 0:B.type)??l.transport_type;if(C.tool_type==="mcp"&&(R==="sse"||R==="streamable-http")&&!T.some(z=>z.tool_type==="builtin-group"&&z.group_name==="web"||z.tool_type==="builtin"&&z.tool_name==="web_request")){const z={id:`web_auto_${Date.now()}`,tool_type:"builtin-group",group_name:"web"};T.push(z)}t({tools:T}),o(!1),h(null)},D=y=>{y&&t({tools:v.filter(C=>C.id!==y)})},O=y=>{var T;const C=[];if(y.tool_type==="builtin-group")C.push(`Group: ${y.group_name}`);else if(y.tool_type==="mcp"){const R=(T=y.connection_params)==null?void 0:T.type;R&&C.push(`Transport: ${R}`)}else y.tool_name?C.push(`Name: ${y.tool_name}`):y.tool_type==="python"&&y.function_name&&C.push(`Func: ${y.function_name}`);return y.component_module&&C.push(`Module: ${y.component_module}`),C.join(", ")||"No details"};return r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{children:"Define custom tools for your agent. Tools can be Python functions, MCP servers, or built-in ADK capabilities. The final tools configuration will be submitted as a list of tool objects."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Custom Tools"}),r.jsx(X,{onClick:N,variant:"secondary",children:"+ Add Tool"}),v.length>0?r.jsx("div",{className:"mt-4 space-y-3",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Details"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:v.map((y,C)=>{var T;return r.jsxs("tr",{children:[r.jsxs("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-700",children:[y.tool_type,((T=y.id)==null?void 0:T.startsWith("web_auto_"))&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:"Auto-added"})]}),r.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-500 max-w-xs truncate",title:O(y),children:O(y)}),r.jsxs("td",{className:"px-4 py-2 whitespace-nowrap text-sm space-x-2",children:[r.jsx(X,{onClick:()=>f(y),variant:"outline",children:"Edit"}),r.jsx(X,{onClick:()=>D(y.id),variant:"outline",className:"text-red-600 border-red-300 hover:bg-red-50",children:"Delete"})]})]},y.id||C)})})]})}):r.jsx("p",{className:"text-gray-500 mt-4",children:"No tools configured yet."}),a&&r.jsx(Cr,{title:m?"Edit Tool":"Add New Tool",onClose:()=>o(!1),children:r.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto p-1",children:[c==="initial"&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-gray-600",children:"What kind of tool do you want to add?"}),r.jsx(X,{onClick:()=>{u(y=>({...y,tool_type:"builtin-group"})),d("builtin-group")},variant:"secondary",className:"w-full justify-start",children:"Group of Built-in Tools"}),r.jsx(X,{onClick:()=>{u(y=>({...y,tool_type:"builtin"})),d("builtin-tool")},variant:"secondary",className:"w-full justify-start",children:"Single Built-in Tool"}),r.jsx(X,{onClick:()=>{u(y=>({...y,tool_type:"python"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"Python Tool"}),r.jsx(X,{onClick:()=>{u(y=>({...y,tool_type:"mcp"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"MCP Tool"})]}),c==="builtin-group"&&r.jsx(P,{label:"Built-in Tool Group",htmlFor:"group_name",error:p.group_name,required:!0,children:r.jsx(ae,{id:"group_name",name:"group_name",value:l.group_name||"",onChange:b,options:[{value:"",label:"Select a group..."},...s&&"groups"in s&&s.groups?Object.keys(s.groups).map(y=>({value:y,label:`${y.replace(/_/g," ").replace(/\b\w/g,C=>C.toUpperCase())} - ${s.groups[y].description}`})):[]]})}),c==="builtin-tool"&&r.jsx(P,{label:"Built-in Tool Name",htmlFor:"tool_name",error:p.tool_name,required:!0,children:r.jsx(kr,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:b,suggestions:s&&"tools"in s&&s.tools?Object.keys(s.tools):[],placeholder:"Select a built-in tool..."})}),c==="custom"&&r.jsxs(r.Fragment,{children:[l.tool_type==="python"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Optional: A descriptive name for this Python tool. Overwrites the python function name",children:r.jsx(H,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:b})}),r.jsx(P,{label:"Tool Description (Optional)",htmlFor:"tool_description",error:p.tool_description,helpText:"Optional: A brief description of what this tool does. Overwrites the python function docs",children:r.jsx(H,{id:"tool_description",name:"tool_description",value:l.tool_description||"",onChange:b,placeholder:"e.g., Fetch user profile data"})}),r.jsx(P,{label:"Component Module",htmlFor:"component_module",error:p.component_module,required:!0,children:r.jsx(H,{id:"component_module",name:"component_module",value:l.component_module||"",onChange:b,placeholder:"e.g., my_agent.custom_tools"})}),r.jsx(P,{label:"Function Name",htmlFor:"function_name",error:p.function_name,required:!0,children:r.jsx(H,{id:"function_name",name:"function_name",value:l.function_name||"",onChange:b,placeholder:"e.g., my_tool_function"})}),r.jsx(P,{label:"Component Base Path (Optional)",htmlFor:"component_base_path",error:p.component_base_path,helpText:"Base path for module resolution if not in PYTHONPATH.",children:r.jsx(H,{id:"component_base_path",name:"component_base_path",value:l.component_base_path||"",onChange:b,placeholder:"e.g., src/plugins"})})]}),l.tool_type==="mcp"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"MCP Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Name of the specific MCP tool (optional if using all tools from MCP server)",children:r.jsx(H,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:b})}),r.jsx(P,{label:"Transport Type",htmlFor:"transport_type",error:p.transport_type,required:!0,children:r.jsx(ae,{id:"transport_type",name:"transport_type",value:l.transport_type||"",onChange:b,options:[{value:"",label:"Select transport type..."},{value:"stdio",label:"stdio - Standard Input/Output"},{value:"sse",label:"sse - Server-Sent Events"},{value:"streamable-http",label:"streamable-http - Streamable HTTP"}]})}),l.transport_type==="stdio"&&r.jsxs(r.Fragment,{children:[r.jsxs(fe,{children:[r.jsx("strong",{children:"Example stdio configuration:"}),r.jsx("br",{}),"Command: ",r.jsx("code",{children:"npx"}),r.jsx("br",{}),"Arguments (in order):",r.jsx("br",{}),"  1. ",r.jsx("code",{children:"-y"}),r.jsx("br",{}),"  2. ",r.jsx("code",{children:"@modelcontextprotocol/server-filesystem"}),r.jsx("br",{}),"  3. ",r.jsx("code",{children:"/path/to/allowed/directory"}),r.jsx("br",{}),r.jsx("em",{children:"Do not include quotation marks when entering arguments."})]}),r.jsx(P,{label:"Command",htmlFor:"stdio_command",error:p.stdio_command,required:!0,helpText:"The command to execute (e.g., 'python', 'node', 'npx')",children:r.jsx(H,{id:"stdio_command",name:"stdio_command",value:l.stdio_command||"",onChange:b,placeholder:"e.g., npx"})}),r.jsx(Bi,{id:"stdio_args",label:"Arguments",values:l.stdio_args||[],onChange:y=>M("stdio_args",y),error:p.stdio_args,helpText:"Command line arguments in order. Enter each argument separately without quotes.",placeholder:"No arguments added yet",itemPlaceholder:"e.g., -y or /path/to/directory"})]}),l.transport_type==="sse"&&r.jsxs(r.Fragment,{children:[r.jsxs(fe,{children:[r.jsx("strong",{children:"📡 Remote MCP Server"}),r.jsx("br",{}),"SSE transport connects to remote servers over HTTP. The ",r.jsx("strong",{children:"web"})," builtin tool group will be automatically included in your agent configuration to enable network access."]}),r.jsx(P,{label:"URL",htmlFor:"sse_url",error:p.sse_url,required:!0,helpText:"The SSE endpoint URL",children:r.jsx(H,{id:"sse_url",name:"sse_url",value:l.sse_url||"",onChange:b,placeholder:"https://mcp.example.com/v1/sse"})})]}),l.transport_type==="streamable-http"&&r.jsxs(r.Fragment,{children:[r.jsxs(fe,{children:[r.jsx("strong",{children:"📡 Remote MCP Server"}),r.jsx("br",{}),"Streamable HTTP transport connects to remote servers over HTTP. The ",r.jsx("strong",{children:"web"})," builtin tool group will be automatically included in your agent configuration to enable network access."]}),r.jsx(P,{label:"URL",htmlFor:"streamable_http_url",error:p.streamable_http_url,required:!0,helpText:"The streamable HTTP endpoint URL",children:r.jsx(H,{id:"streamable_http_url",name:"streamable_http_url",value:l.streamable_http_url||"",onChange:b,placeholder:"https://mcp.example.com:port/mcp/message"})})]}),l.transport_type==="stdio"&&r.jsx(_n,{id:"environment_variables_ui",label:"Environment Variables (Optional)",values:l.environment_variables_ui||{},onChange:y=>L("environment_variables_ui",y),error:p.environment_variables_ui,helpText:"Environment variables passed to the MCP server process (e.g., API keys, paths). Can use ${VAR} syntax.",placeholder:"No environment variables added",keyPlaceholder:"Variable name (e.g., CONFLUENCE_URL)",valuePlaceholder:"Variable value (e.g., ${CONFLUENCE_URL})"}),(l.transport_type==="sse"||l.transport_type==="streamable-http")&&r.jsx(P,{label:"Authentication Type (Optional)",htmlFor:"auth_type",helpText:"Configure authentication for the MCP server (added as headers)",children:r.jsx(ae,{id:"auth_type",name:"auth_type",value:l.auth_type||"",onChange:b,options:[{value:"",label:"No authentication"},{value:"api_key",label:"API Key"},{value:"bearer",label:"Bearer Token"}]})}),(l.transport_type==="sse"||l.transport_type==="streamable-http")&&l.auth_type==="api_key"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"Header Name",htmlFor:"auth_header_name",required:!0,error:p.auth_header_name,helpText:"The HTTP header name for the API key",children:r.jsx(H,{id:"auth_header_name",name:"auth_header_name",value:l.auth_header_name||"",onChange:b,placeholder:"e.g., X-API-Key"})}),r.jsx(P,{label:"API Key",htmlFor:"auth_token",required:!0,error:p.auth_token,helpText:"The API key value (can use environment variables like ${API_KEY})",children:r.jsx(H,{id:"auth_token",name:"auth_token",value:l.auth_token||"",onChange:b,placeholder:"e.g., ${MCP_API_KEY}"})})]}),(l.transport_type==="sse"||l.transport_type==="streamable-http")&&l.auth_type==="bearer"&&r.jsx(P,{label:"Bearer Token",htmlFor:"auth_token",required:!0,error:p.auth_token,helpText:"The bearer token value (can use environment variables like ${TOKEN})",children:r.jsx(H,{id:"auth_token",name:"auth_token",value:l.auth_token||"",onChange:b,placeholder:"e.g., ${MCP_BEARER_TOKEN}"})}),r.jsx(P,{label:"Connection Timeout (seconds)",htmlFor:"mcp_timeout",helpText:"Timeout for MCP server connections (default: 30 seconds)",children:r.jsx(H,{id:"mcp_timeout",name:"mcp_timeout",type:"number",value:((q=l.mcp_timeout)==null?void 0:q.toString())||"30",onChange:b,placeholder:"30"})})]})]}),(c==="builtin-tool"||c==="custom")&&r.jsxs(r.Fragment,{children:[r.jsx(Ae,{id:"required_scopes",label:"Required Scopes (Optional)",values:l.required_scopes||[],onChange:y=>k("required_scopes",y),helpText:"Enter required OAuth scopes and press Add.",placeholder:"No scopes added yet.",inputPlaceholder:"e.g., read:profile"}),r.jsx(_n,{id:"tool_config_ui",label:"Tool Config (Optional)",values:l.tool_config_ui||{},onChange:y=>L("tool_config_ui",y),error:p.tool_config_ui,helpText:"Tool-specific configuration like API keys, model names etc.",placeholder:"No configuration added",keyPlaceholder:"Config key (e.g., api_key)",valuePlaceholder:"Config value"})]}),c!=="initial"&&r.jsxs("div",{className:"flex justify-end space-x-2 mt-6 pt-4 border-t",children:[r.jsx(X,{onClick:()=>o(!1),variant:"outline",children:"Cancel"}),r.jsx(X,{onClick:I,children:m?"Update Tool":"Add Tool"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx(X,{type:"button",onClick:i,variant:"outline",children:"Previous"}),r.jsx(X,{type:"button",onClick:n,children:"Next"})]})]})},Ui=[{value:"ignore",label:"Ignore (Do not include artifacts in A2A messages)"},{value:"embed",label:"Embed (Include base64 artifact data in A2A messages)"},{value:"reference",label:"Reference (Include artifact fetch URI in A2A messages)"}],Hi=({data:e,updateData:t,onNext:n,onPrevious:i})=>r.jsxs("div",{className:"space-y-6",children:[r.jsx(fe,{children:"Configure various features and behaviors for your agent, such as built-in tools and how artifacts are handled."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Built-in Tools & Features"}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",helpText:"How artifacts created by this agent are represented in A2A messages.",children:r.jsx(ae,{id:"artifact_handling_mode",name:"artifact_handling_mode",value:e.artifact_handling_mode||"ignore",onChange:s=>t({artifact_handling_mode:s.target.value}),options:Ui})}),r.jsxs("div",{className:"space-y-3 mt-4",children:[r.jsx(P,{label:"",htmlFor:"enable_embed_resolution",children:r.jsx(ye,{id:"enable_embed_resolution",checked:e.enable_embed_resolution===void 0?!0:!!e.enable_embed_resolution,onChange:s=>t({enable_embed_resolution:s}),label:"Enable Embed Resolution (for dynamic content like state, math in prompts)"})}),r.jsx(P,{label:"",htmlFor:"enable_artifact_content_instruction",children:r.jsx(ye,{id:"enable_artifact_content_instruction",checked:e.enable_artifact_content_instruction===void 0?!0:!!e.enable_artifact_content_instruction,onChange:s=>t({enable_artifact_content_instruction:s}),label:"Enable Artifact Content Instruction (for late-stage artifact content embedding)"})})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]}),Vi=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),Wi=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),Gi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const[s,a]=j.useState(!1),[o,l]=j.useState(null),[u,c]=j.useState(null),[d,m]=j.useState({}),[h,p]=j.useState(null);j.useEffect(()=>{s&&(o?(m(o),c(o.id)):(m({}),c(null)),p(null))},[o,s]);const w=_=>{const{name:I,value:D,type:O}=_.target,q=O==="checkbox"?_.target.checked:D;t({[I]:q})},v=_=>{const{name:I,value:D}=_.target;m(O=>({...O,[I]:D}))},N=()=>{if(!d.id||d.id.trim()===""||!d.name||d.name.trim()===""||!d.description||d.description.trim()===""){p("Skill ID, Name, and Description are required and cannot be empty.");return}p(null);const _=Array.isArray(e.agent_card_skills)?[...e.agent_card_skills]:[],I=d.id,D=_.findIndex(O=>O.id===I);if(o){if(u!==I&&D!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}const O=_.findIndex(q=>q.id===u);if(O!==-1)_[O]={...d};else{p("Error finding the original skill to update.");return}}else{if(D!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}_.push({...d})}t({agent_card_skills:_}),a(!1),l(null),c(null)},f=_=>{l(_),a(!0)},b=()=>{l(null),a(!0)},k=_=>{const I=Array.isArray(e.agent_card_skills)?e.agent_card_skills:[];t({agent_card_skills:I.filter(D=>D.id!==_)})},M=_=>{const{name:I,value:D}=_.target;t({[I]:D===""?void 0:Number(D)})},L="A helpful assistant capable of complex tasks.";return r.jsxs("div",{className:"space-y-6",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Agent Card & Discovery"}),r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",helpText:"A concise description of the agent's capabilities.",children:r.jsx("textarea",{id:"agent_card_description",name:"agent_card_description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:e.agent_card_description||L,onChange:w,placeholder:L})}),r.jsx(Ae,{id:"agent_card_default_input_modes",label:"Default Input Modes",values:e.agent_card_default_input_modes||[],onChange:_=>t({agent_card_default_input_modes:_}),helpText:"Enter input modes (e.g., text, file) and press Add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"agent_card_default_output_modes",label:"Default Output Modes",values:e.agent_card_default_output_modes||[],onChange:_=>t({agent_card_default_output_modes:_}),helpText:"Enter output modes (e.g., text, file) and press Add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., file"}),r.jsxs(P,{label:"Skills",htmlFor:"add_skill_button",children:[r.jsx("div",{className:"mb-2",children:r.jsx(X,{type:"button",variant:"outline",onClick:b,children:"Add New Skill"})}),e.agent_card_skills&&e.agent_card_skills.length>0?r.jsx("div",{className:"overflow-x-auto border rounded-md",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"ID"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Name"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Description"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.agent_card_skills.map(_=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-3 py-2 whitespace-nowrap font-mono text-xs",children:_.id}),r.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:_.name}),r.jsx("td",{className:"px-3 py-2 break-words max-w-xs",children:_.description}),r.jsxs("td",{className:"px-3 py-2 whitespace-nowrap space-x-2",children:[r.jsx(X,{variant:"secondary",onClick:()=>f(_),"aria-label":"Edit skill",children:r.jsx(Vi,{})}),r.jsx(X,{variant:"secondary",onClick:()=>k(_.id),className:"text-red-600 hover:text-red-800","aria-label":"Delete skill",children:r.jsx(Wi,{})})]})]},_.id))})]})}):r.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"No skills defined yet."})]}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Discovery & Communication"}),r.jsx(P,{label:"Agent Card Publishing Interval (seconds)",htmlFor:"agent_card_publishing_interval",helpText:"Set to 0 to disable periodic publishing.",children:r.jsx(H,{id:"agent_card_publishing_interval",name:"agent_card_publishing_interval",type:"number",value:e.agent_card_publishing_interval===void 0?"10":String(e.agent_card_publishing_interval),onChange:M,placeholder:"10"})}),r.jsx(P,{label:"",htmlFor:"agent_discovery_enabled",children:r.jsx(ye,{id:"agent_discovery_enabled",checked:e.agent_discovery_enabled===void 0?!1:!!e.agent_discovery_enabled,onChange:_=>t({agent_discovery_enabled:_}),label:"Enable Agent Discovery (allows this agent to find and delegate to peers)"})}),r.jsx(Ae,{id:"inter_agent_communication_allow_list",label:"Inter-Agent Allow List",values:e.inter_agent_communication_allow_list||[],onChange:_=>t({inter_agent_communication_allow_list:_}),helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*).",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"inter_agent_communication_deny_list",label:"Inter-Agent Deny List",values:e.inter_agent_communication_deny_list||[],onChange:_=>t({inter_agent_communication_deny_list:_}),helpText:"Agent name patterns to deny delegation to.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Inter-Agent Request Timeout (seconds)",htmlFor:"inter_agent_communication_timeout",children:r.jsx(H,{id:"inter_agent_communication_timeout",name:"inter_agent_communication_timeout",type:"number",value:e.inter_agent_communication_timeout===void 0?"30":String(e.inter_agent_communication_timeout),onChange:M,placeholder:"30"})}),s&&r.jsx(Cr,{onClose:()=>{a(!1),l(null),c(null)},title:o?"Edit Skill":"Add New Skill",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx(P,{label:"Skill ID (e.g., function_name)",htmlFor:"skill_id",required:!0,helpText:"Unique identifier for the skill.",children:r.jsx(H,{id:"skill_id",name:"id",value:d.id||"",onChange:v,placeholder:"e.g., getWeather",disabled:!1})}),r.jsx(P,{label:"Skill Name (Display Name)",htmlFor:"skill_name",required:!0,children:r.jsx(H,{id:"skill_name",name:"name",value:d.name||"",onChange:v,placeholder:"e.g., Data Analysis"})}),r.jsx(P,{label:"Skill Description",htmlFor:"skill_description",required:!0,children:r.jsx("textarea",{id:"skill_description",name:"description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:d.description||"",onChange:v,placeholder:"e.g., Can analyze CSV data and generate reports."})}),h&&r.jsx("p",{className:"text-sm text-red-600",children:h}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-2",children:[r.jsx(X,{type:"button",variant:"secondary",onClick:()=>{a(!1),l(null),c(null)},children:"Cancel"}),r.jsx(X,{type:"button",onClick:N,children:o?"Update Skill":"Add Skill"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},$i=({data:e,updateData:t,onPrevious:n,serverUrl:i=""})=>{const s=async()=>{console.log("Submitting agent configuration:",e);try{const a=JSON.parse(JSON.stringify(e));if(!Array.isArray(a.agent_card_skills)&&a.agent_card_skills_str)try{const c=JSON.parse(a.agent_card_skills_str);Array.isArray(c)?a.agent_card_skills=c:(console.warn("Parsed agent_card_skills_str was not an array, ensuring agent_card_skills is empty array."),a.agent_card_skills=[])}catch(c){console.warn("Could not parse agent_card_skills_str as JSON, ensuring agent_card_skills is empty array.",c),a.agent_card_skills=[]}else Array.isArray(a.agent_card_skills)||(a.agent_card_skills=[]);delete a.agent_card_skills_str,Array.isArray(a.tools)&&(a.tools=a.tools.map(c=>{if(!c.tool_type)return console.error("Tool is missing tool_type:",c),null;const d={tool_type:c.tool_type};return c.tool_name&&(d.tool_name=c.tool_name),c.tool_description&&(d.tool_description=c.tool_description),c.group_name&&(d.group_name=c.group_name),c.component_module&&(d.component_module=c.component_module),c.function_name&&(d.function_name=c.function_name),c.component_base_path&&(d.component_base_path=c.component_base_path),c.connection_params&&(d.connection_params=c.connection_params),c.environment_variables&&(d.environment_variables=c.environment_variables),c.required_scopes&&c.required_scopes.length>0&&(d.required_scopes=c.required_scopes),c.tool_config&&(d.tool_config=c.tool_config),d}).filter(c=>c!==null));const o={agent_name_input:e.agent_name,config:a},l=await fetch(`${i}/api/save_agent_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),u=await l.json();l.ok&&u.status==="success"?(setTimeout(async()=>{try{await fetch(`${i}/api/shutdown`,{method:"POST"})}catch{}},200),t&&t({showSuccessScreen_agent:!0})):alert(`Error saving agent: ${u.message||"Unknown error"}`)}catch(a){alert(`Failed to save agent: ${a instanceof Error?a.message:String(a)}`)}};return r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Review and Submit Agent Configuration"}),r.jsx("pre",{className:"bg-gray-100 p-3 rounded overflow-x-auto text-xs max-h-96",children:JSON.stringify(e,null,2)}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{onClick:s,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Save Agent & Finish"})]})]})},at=[{id:"agent-basic",title:"Basic Info",description:"Name, model, instruction",component:Ri},{id:"agent-services",title:"Services",description:"Session & artifact services",component:Di},{id:"agent-features",title:"Features",description:"Enable built-in features",component:Hi},{id:"agent-tools",title:"Custom Tools",description:"Define custom tools for the agent",component:qi},{id:"agent-card",title:"Agent Card & Comms",description:"Discovery and communication settings",component:Gi},{id:"agent-review",title:"Review & Submit",description:"Review and save configuration",component:$i}];function Yi(){var v;const[e,t]=j.useState(0),[n,i]=j.useState({}),[s,a]=j.useState(!0),[o,l]=j.useState(null),[u,c]=j.useState([]),d="";j.useEffect(()=>{Promise.all([fetch("/api/form_schema?type=agent"),fetch("/api/available_tools")]).then(async([N,f])=>{if(!N.ok)throw new Error(`Failed to fetch agent form schema (status: ${N.status})`);if(!f.ok)throw new Error(`Failed to fetch available tools (status: ${f.status})`);const b=await N.json(),k=await f.json();if((b==null?void 0:b.status)!=="success"||!(b!=null&&b.defaults))throw new Error((b==null?void 0:b.message)||"Invalid response for agent form schema");if((k==null?void 0:k.status)!=="success")throw new Error((k==null?void 0:k.message)||"Invalid response for available tools");c(k);const M=b.defaults,L={...M,agent_card_default_input_modes:(M.agent_card_default_input_modes_str||"text").split(",").map(_=>_.trim()).filter(Boolean),agent_card_default_output_modes:(M.agent_card_default_output_modes_str||"text,file").split(",").map(_=>_.trim()).filter(Boolean),inter_agent_communication_allow_list:(M.inter_agent_communication_allow_list_str||"*").split(",").map(_=>_.trim()).filter(Boolean),inter_agent_communication_deny_list:(M.inter_agent_communication_deny_list_str||"").split(",").map(_=>_.trim()).filter(Boolean),agent_card_skills_str:M.agent_card_skills_str||"[]",agent_card_skills:[],tools:Array.isArray(M.tools)?M.tools:[],showSuccessScreen_agent:!1};delete L.agent_card_default_input_modes_str,delete L.agent_card_default_output_modes_str,delete L.inter_agent_communication_allow_list_str,delete L.inter_agent_communication_deny_list_str;try{const _=JSON.parse(L.agent_card_skills_str||"[]");Array.isArray(_)&&(L.agent_card_skills=_.filter(I=>typeof I=="object"&&I!==null&&"id"in I&&typeof I.id=="string"&&"name"in I&&typeof I.name=="string"&&"description"in I&&typeof I.description=="string"))}catch(_){console.warn("Could not parse agent_card_skills_str from defaults:",_),L.agent_card_skills=[]}i(L)}).catch(N=>{console.error("Error fetching initial data:",N),l(`Failed to load agent configuration form: ${N instanceof Error?N.message:String(N)}`)}).finally(()=>a(!1))},[]);const m=j.useCallback(N=>{i(f=>({...f,...N}))},[]);j.useEffect(()=>{if(s)return;const N=[];N.push({id:"default-artifact-management",tool_type:"builtin-group",group_name:"artifact_management"}),m({tools:N})},[m,s]);const h=j.useCallback(()=>{e<at.length-1&&t(N=>N+1)},[e]),p=j.useCallback(()=>{e>0&&t(N=>N-1)},[e]);if(s)return r.jsx("div",{className:"text-center p-10",children:"Loading agent configuration form..."});if(o)return r.jsx("div",{className:"text-center p-10 text-red-600",children:r.jsxs("p",{children:["Error: ",o]})});if(n.showSuccessScreen_agent){let N="Agent Configured Successfully!";return n.agent_name&&(N=`Agent "${n.agent_name}" configured successfully!`),r.jsx("div",{className:"max-w-2xl mx-auto p-6",children:r.jsx(Zt,{title:N,message:"Your new agent configuration has been saved.",initTab:"tutorials"})})}const w=(v=at[e])==null?void 0:v.component;return w?r.jsxs("div",{className:"max-w-2xl mx-auto p-4",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center text-solace-purple",children:"Add New Agent"}),at.length>1&&r.jsx("div",{className:"mb-8",children:r.jsx(Kt,{steps:at,currentStepIndex:e})}),r.jsx("div",{className:"bg-white rounded-lg shadow-xl p-6 min-h-[500px]",children:r.jsx(w,{data:n,updateData:m,onNext:h,onPrevious:p,serverUrl:d,availableTools:u})})]}):r.jsxs("div",{className:"text-center p-10 text-red-600",children:["Error: Configuration step not found for index ",e,"."]})}/**
36
+ * @license lucide-react v0.542.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */const Ji=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),vn=e=>{const t=Xi(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ar=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),Qi=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
41
+ * @license lucide-react v0.542.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */var Ki={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
46
+ * @license lucide-react v0.542.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */const Zi=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:a,iconNode:o,...l},u)=>j.createElement("svg",{ref:u,...Ki,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Ar("lucide",s),...!a&&!Qi(l)&&{"aria-hidden":"true"},...l},[...o.map(([c,d])=>j.createElement(c,d)),...Array.isArray(a)?a:[a]]));/**
51
+ * @license lucide-react v0.542.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const Me=(e,t)=>{const n=j.forwardRef(({className:i,...s},a)=>j.createElement(Zi,{ref:a,iconNode:t,className:Ar(`lucide-${Ji(vn(e))}`,`lucide-${e}`,i),...s}));return n.displayName=vn(e),n};/**
56
+ * @license lucide-react v0.542.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const es=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],ts=Me("box",es);/**
61
+ * @license lucide-react v0.542.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const ns=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rs=Me("circle-check-big",ns);/**
66
+ * @license lucide-react v0.542.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const is=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],ss=Me("cpu",is);/**
71
+ * @license lucide-react v0.542.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const as=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],os=Me("git-merge",as);/**
76
+ * @license lucide-react v0.542.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const ls=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],cs=Me("server",ls);/**
81
+ * @license lucide-react v0.542.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const us=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],ds=Me("tag",us);/**
86
+ * @license lucide-react v0.542.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const ms=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ps=Me("wrench",ms),kn=({variant:e="secondary",className:t,children:n,...i})=>r.jsx("button",{...i,className:`px-3 py-1.5 text-xs rounded font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ${e==="primary"?"bg-green-500 hover:bg-green-600 text-white dark:bg-green-600 dark:hover:bg-green-700":"bg-gray-200 hover:bg-gray-300 text-gray-700 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-200"} ${t||""}`,children:n}),wn=({label:e,value:t,icon:n})=>t==null||typeof t=="string"&&!t.trim()?null:r.jsxs("div",{className:"flex items-center text-xs mb-1",children:[r.jsxs("div",{className:"flex items-center font-medium text-gray-500 dark:text-gray-400 w-20 flex-shrink-0",children:[n&&r.jsx("span",{className:"mr-1.5",children:n}),e,":"]}),r.jsx("div",{className:"text-gray-700 dark:text-gray-200 truncate",title:t,children:t})]}),hs=({plugin:e,onReadMore:t,onInstall:n})=>{const i=e.pyproject.description||"No description available.",s=a=>{switch(a==null?void 0:a.toLowerCase()){case"agent":return r.jsx(ss,{size:12});case"gateway":return r.jsx(cs,{size:12});case"tool":return r.jsx(ps,{size:12});default:return r.jsx(ds,{size:12})}};return r.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xl rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col h-[280px]",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700",children:[r.jsxs("div",{className:"flex items-center min-w-0",children:[r.jsx(ts,{className:"w-5 h-5 text-blue-500 dark:text-blue-400 mr-2 flex-shrink-0"}),r.jsx("h2",{className:"text-md font-semibold text-gray-800 dark:text-gray-100 truncate",title:e.pyproject.name,children:e.pyproject.name})]}),e.is_official&&r.jsx("span",{title:"Verified Official Plugin",className:"ml-2 flex-shrink-0",children:r.jsx(rs,{className:"w-4 h-4 text-green-500 dark:text-green-400"})})]}),r.jsxs("div",{className:"p-3 space-y-2 overflow-y-auto flex-grow scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-100 dark:scrollbar-track-gray-700",children:[r.jsx(wn,{label:"Version",value:e.pyproject.version,icon:r.jsx(os,{size:12})}),r.jsx(wn,{label:"Type",value:e.pyproject.plugin_type||"custom",icon:s(e.pyproject.plugin_type)}),r.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3",title:i,children:i})]}),r.jsxs("div",{className:"flex justify-end space-x-2 p-2 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700",children:[r.jsx(kn,{onClick:t,variant:"secondary",children:"More"}),r.jsx(kn,{onClick:n,variant:"primary",children:"Install"})]})]})};function fs(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const gs=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xs=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ys={};function jn(e,t){return(ys.jsx?xs:gs).test(e)}const bs=/[ \t\n\f\r]/g;function _s(e){return typeof e=="object"?e.type==="text"?Sn(e.value):!1:Sn(e)}function Sn(e){return e.replace(bs,"")===""}class Ze{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ze.prototype.normal={};Ze.prototype.property={};Ze.prototype.space=void 0;function Er(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new Ze(n,i,t)}function qt(e){return e.toLowerCase()}class de{constructor(t,n){this.attribute=n,this.property=t}}de.prototype.attribute="";de.prototype.booleanish=!1;de.prototype.boolean=!1;de.prototype.commaOrSpaceSeparated=!1;de.prototype.commaSeparated=!1;de.prototype.defined=!1;de.prototype.mustUseProperty=!1;de.prototype.number=!1;de.prototype.overloadedBoolean=!1;de.prototype.property="";de.prototype.spaceSeparated=!1;de.prototype.space=void 0;let vs=0;const Y=Fe(),te=Fe(),Ut=Fe(),A=Fe(),K=Fe(),Oe=Fe(),he=Fe();function Fe(){return 2**++vs}const Ht=Object.freeze(Object.defineProperty({__proto__:null,boolean:Y,booleanish:te,commaOrSpaceSeparated:he,commaSeparated:Oe,number:A,overloadedBoolean:Ut,spaceSeparated:K},Symbol.toStringTag,{value:"Module"})),At=Object.keys(Ht);class en extends de{constructor(t,n,i,s){let a=-1;if(super(t,n),Nn(this,"space",s),typeof i=="number")for(;++a<At.length;){const o=At[a];Nn(this,At[a],(i&Ht[o])===Ht[o])}}}en.prototype.defined=!0;function Nn(e,t,n){n&&(e[t]=n)}function Be(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const a=new en(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[qt(i)]=i,n[qt(a.attribute)]=i}return new Ze(t,n,e.space)}const Ir=Be({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:te,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:K,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:A,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:K,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:te,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Tr(e,t){return t in e?e[t]:t}function Pr(e,t){return Tr(e,t.toLowerCase())}const ks=Be({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:K,autoFocus:Y,autoPlay:Y,blocking:K,capture:null,charSet:null,checked:Y,cite:null,className:K,cols:A,colSpan:null,content:null,contentEditable:te,controls:Y,controlsList:K,coords:A|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:Ut,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:K,height:A,hidden:Ut,high:A,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:K,itemRef:K,itemScope:Y,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Y,optimum:A,pattern:null,ping:K,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:K,required:Y,reversed:Y,rows:A,rowSpan:A,sandbox:K,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:te,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Y,disableRemotePlayback:Y,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:Pr}),ws=Be({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:he,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:K,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:he,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:he,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:he,rev:he,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:he,requiredFeatures:he,requiredFonts:he,requiredFormats:he,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:he,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:he,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:he,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Tr}),Mr=Be({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fr=Be({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pr}),Lr=Be({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),js={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ss=/[A-Z]/g,Cn=/-[a-z]/g,Ns=/^data[-\w.:]+$/i;function Cs(e,t){const n=qt(t);let i=t,s=de;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ns.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Cn,Es);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Cn.test(a)){let o=a.replace(Ss,As);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=en}return new s(i,t)}function As(e){return"-"+e.toLowerCase()}function Es(e){return e.charAt(1).toUpperCase()}const Is=Er([Ir,ks,Mr,Fr,Lr],"html"),tn=Er([Ir,ws,Mr,Fr,Lr],"svg");function Ts(e){return e.join(" ").trim()}var Re={},Et,An;function Ps(){if(An)return Et;An=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
91
+ `,c="/",d="*",m="",h="comment",p="declaration";Et=function(v,N){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];N=N||{};var f=1,b=1;function k(T){var R=T.match(t);R&&(f+=R.length);var B=T.lastIndexOf(u);b=~B?T.length-B:b+T.length}function M(){var T={line:f,column:b};return function(R){return R.position=new L(T),D(),R}}function L(T){this.start=T,this.end={line:f,column:b},this.source=N.source}L.prototype.content=v;function _(T){var R=new Error(N.source+":"+f+":"+b+": "+T);if(R.reason=T,R.filename=N.source,R.line=f,R.column=b,R.source=v,!N.silent)throw R}function I(T){var R=T.exec(v);if(R){var B=R[0];return k(B),v=v.slice(B.length),R}}function D(){I(n)}function O(T){var R;for(T=T||[];R=q();)R!==!1&&T.push(R);return T}function q(){var T=M();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var R=2;m!=v.charAt(R)&&(d!=v.charAt(R)||c!=v.charAt(R+1));)++R;if(R+=2,m===v.charAt(R-1))return _("End of comment missing");var B=v.slice(2,R-2);return b+=2,k(B),v=v.slice(R),b+=2,T({type:h,comment:B})}}function y(){var T=M(),R=I(i);if(R){if(q(),!I(s))return _("property missing ':'");var B=I(a),V=T({type:p,property:w(R[0].replace(e,m)),value:B?w(B[0].replace(e,m)):m});return I(o),V}}function C(){var T=[];O(T);for(var R;R=y();)R!==!1&&(T.push(R),O(T));return T}return D(),C()};function w(v){return v?v.replace(l,m):m}return Et}var En;function Ms(){if(En)return Re;En=1;var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=n;var t=e(Ps());function n(i,s){var a=null;if(!i||typeof i!="string")return a;var o=(0,t.default)(i),l=typeof s=="function";return o.forEach(function(u){if(u.type==="declaration"){var c=u.property,d=u.value;l?s(c,d,u):d&&(a=a||{},a[c]=d)}}),a}return Re}var Ve={},In;function Fs(){if(In)return Ve;In=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),a(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(s,l):c=c.replace(i,l),c.replace(t,o))};return Ve.camelCase=u,Ve}var We,Tn;function Ls(){if(Tn)return We;Tn=1;var e=We&&We.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Ms()),n=Fs();function i(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return i.default=i,We=i,We}var Rs=Ls();const zs=yr(Rs),Os=Ds("start");function Ds(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pn(e.position):"start"in e||"end"in e?Pn(e):"line"in e||"column"in e?Vt(e):""}function Vt(e){return Mn(e&&e.line)+":"+Mn(e&&e.column)}function Pn(e){return Vt(e&&e.start)+"-"+Vt(e&&e.end)}function Mn(e){return e&&typeof e=="number"?e:1}let oe=class extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?a.ruleId=i:(a.source=i.slice(0,u),a.ruleId=i.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=l?l.line:void 0,this.name=Bs(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}};oe.prototype.file="";oe.prototype.name="";oe.prototype.reason="";oe.prototype.message="";oe.prototype.stack="";oe.prototype.column=void 0;oe.prototype.line=void 0;oe.prototype.ancestors=void 0;oe.prototype.cause=void 0;oe.prototype.fatal=void 0;oe.prototype.place=void 0;oe.prototype.ruleId=void 0;oe.prototype.source=void 0;const nn={}.hasOwnProperty,qs=new Map,Us=/[A-Z]/g,Hs=new Set(["table","tbody","thead","tfoot","tr"]),Vs=new Set(["td","th"]),Rr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ws(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Zs(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Ks(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?tn:Is,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zr(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function zr(e,t,n){if(t.type==="element")return Gs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $s(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Js(e,t,n);if(t.type==="mdxjsEsm")return Ys(e,t);if(t.type==="root")return Xs(e,t,n);if(t.type==="text")return Qs(e,t)}function Gs(e,t,n){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=tn,e.schema=s),e.ancestors.push(t);const a=Dr(e,t.tagName,!1),o=ea(e,t);let l=sn(e,t);return Hs.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!_s(u):!0})),Or(e,o,a,t),rn(o,l),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function $s(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ke(e,t.position)}function Ys(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ke(e,t.position)}function Js(e,t,n){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=tn,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Dr(e,t.name,!0),o=ta(e,t),l=sn(e,t);return Or(e,o,a,t),rn(o,l),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function Xs(e,t,n){const i={};return rn(i,sn(e,t)),e.create(t,e.Fragment,i,n)}function Qs(e,t){return t.value}function Or(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function rn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ks(e,t,n){return i;function i(s,a,o,l){const c=Array.isArray(o.children)?n:t;return l?c(a,o,l):c(a,o)}}function Zs(e,t){return n;function n(i,s,a,o){const l=Array.isArray(a.children),u=Os(i);return t(s,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function ea(e,t){const n={};let i,s;for(s in t.properties)if(s!=="children"&&nn.call(t.properties,s)){const a=na(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Vs.has(t.tagName)?i=l:n[o]=l}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function ta(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Ke(e,t.position);else{const s=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Ke(e,t.position);else a=i.value===null?!0:i.value;n[s]=a}return n}function sn(e,t){const n=[];let i=-1;const s=e.passKeys?new Map:qs;for(;++i<t.children.length;){const a=t.children[i];let o;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const c=s.get(u)||0;o=u+"-"+c,s.set(u,c+1)}}const l=zr(e,a,o);l!==void 0&&n.push(l)}return n}function na(e,t,n){const i=Cs(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?fs(n):Ts(n)),i.property==="style"){let s=typeof n=="object"?n:ra(e,String(n));return e.stylePropertyNameCase==="css"&&(s=ia(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?js[i.property]||i.property:i.attribute,n]}}function ra(e,t){try{return zs(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,s=new oe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Rr+"#cannot-parse-style-attribute",s}}function Dr(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,o;for(;++a<s.length;){const l=jn(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}i=o}else i=jn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return nn.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ke(e)}function Ke(e,t){const n=new oe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Rr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ia(e){const t={};let n;for(n in e)nn.call(e,n)&&(t[sa(n)]=e[n]);return t}function sa(e){let t=e.replace(Us,aa);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aa(e){return"-"+e.toLowerCase()}const It={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oa={};function la(e,t){const n=oa,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Br(e,i,s)}function Br(e,t,n){if(ca(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fn(e.children,t,n)}return Array.isArray(e)?Fn(e,t,n):""}function Fn(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=Br(e[s],t,n);return i.join("")}function ca(e){return!!(e&&typeof e=="object")}const Ln=document.createElement("i");function an(e){const t="&"+e+";";Ln.innerHTML=t;const n=Ln.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Se(e,t,n,i){const s=e.length;let a=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<i.length;)o=i.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function xe(e,t){return e.length>0?(Se(e,e.length,0,t),e):t}const Rn={}.hasOwnProperty;function ua(e){const t={};let n=-1;for(;++n<e.length;)da(t,e[n]);return t}function da(e,t){let n;for(n in t){const s=(Rn.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){Rn.call(s,o)||(s[o]=[]);const l=a[o];ma(s[o],Array.isArray(l)?l:l?[l]:[])}}}function ma(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Se(e,0,0,i)}function qr(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function De(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const je=Te(/[A-Za-z]/),ge=Te(/[\dA-Za-z]/),pa=Te(/[#-'*+\--9=?A-Z^-~]/);function Wt(e){return e!==null&&(e<32||e===127)}const Gt=Te(/\d/),ha=Te(/[\dA-Fa-f]/),fa=Te(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function ue(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}const ga=Te(new RegExp("\\p{P}|\\p{S}","u")),xa=Te(/\s/);function Te(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qe(e){const t=[];let n=-1,i=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&ge(e.charCodeAt(n+1))&&ge(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(i)}function Z(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return Q(u)?(e.enter(n),l(u)):t(u)}function l(u){return Q(u)&&a++<s?(e.consume(u),l):(e.exit(n),t(u))}}const ya={tokenize:ba};function ba(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Z(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return W(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const _a={tokenize:va},zn={tokenize:ka};function va(e){const t=this,n=[];let i=0,s,a,o;return l;function l(k){if(i<n.length){const M=n[i];return t.containerState=M[1],e.attempt(M[0].continuation,u,c)(k)}return c(k)}function u(k){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&b();const M=t.events.length;let L=M,_;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){_=t.events[L][1].end;break}f(i);let I=M;for(;I<t.events.length;)t.events[I][1].end={..._},I++;return Se(t.events,L+1,0,t.events.slice(M)),t.events.length=I,c(k)}return l(k)}function c(k){if(i===n.length){if(!s)return h(k);if(s.currentConstruct&&s.currentConstruct.concrete)return w(k);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zn,d,m)(k)}function d(k){return s&&b(),f(i),h(k)}function m(k){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,w(k)}function h(k){return t.containerState={},e.attempt(zn,p,w)(k)}function p(k){return i++,n.push([t.currentConstruct,t.containerState]),h(k)}function w(k){if(k===null){s&&b(),f(0),e.consume(k);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),v(k)}function v(k){if(k===null){N(e.exit("chunkFlow"),!0),f(0),e.consume(k);return}return W(k)?(e.consume(k),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,l):(e.consume(k),v)}function N(k,M){const L=t.sliceStream(k);if(M&&L.push(null),k.previous=a,a&&(a.next=k),a=k,s.defineSkip(k.start),s.write(L),t.parser.lazy[k.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<o&&(!s.events[_][1].end||s.events[_][1].end.offset>o))return;const I=t.events.length;let D=I,O,q;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(O){q=t.events[D][1].end;break}O=!0}for(f(i),_=I;_<t.events.length;)t.events[_][1].end={...q},_++;Se(t.events,D+1,0,t.events.slice(I)),t.events.length=_}}function f(k){let M=n.length;for(;M-- >k;){const L=n[M];t.containerState=L[1],L[0].exit.call(t,e)}n.length=k}function b(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function ka(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function On(e){if(e===null||ue(e)||xa(e))return 1;if(ga(e))return 2}function on(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const $t={name:"attention",resolveAll:wa,tokenize:ja};function wa(e,t){let n=-1,i,s,a,o,l,u,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},h={...e[n][1].start};Dn(m,-u),Dn(h,u),o={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:u>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},c=[],e[i][1].end.offset-e[i][1].start.offset&&(c=xe(c,[["enter",e[i][1],t],["exit",e[i][1],t]])),c=xe(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=xe(c,on(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),c=xe(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=xe(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Se(e,i-1,n-i+3,c),n=i+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ja(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=On(i);let a;return o;function o(u){return a=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===a)return e.consume(u),l;const c=e.exit("attentionSequence"),d=On(u),m=!d||d===2&&s||n.includes(u),h=!s||s===2&&d||n.includes(i);return c._open=!!(a===42?m:m&&(s||!h)),c._close=!!(a===42?h:h&&(d||!m)),t(u)}}function Dn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Sa={name:"autolink",tokenize:Na};function Na(e,t,n){let i=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return je(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||ge(p)?(i=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),i=0,u):(p===43||p===45||p===46||ge(p))&&i++<32?(e.consume(p),l):(i=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wt(p)?n(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),d):pa(p)?(e.consume(p),c):n(p)}function d(p){return ge(p)?m(p):n(p)}function m(p){return p===46?(e.consume(p),i=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||ge(p))&&i++<63){const w=p===45?h:m;return e.consume(p),w}return n(p)}}const ht={partial:!0,tokenize:Ca};function Ca(e,t,n){return i;function i(a){return Q(a)?Z(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||W(a)?t(a):n(a)}}const Ur={continuation:{tokenize:Ea},exit:Ia,name:"blockQuote",tokenize:Aa};function Aa(e,t,n){const i=this;return s;function s(o){if(o===62){const l=i.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Q(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Ea(e,t,n){const i=this;return s;function s(o){return Q(o)?Z(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(Ur,t,n)(o)}}function Ia(e){e.exit("blockQuote")}const Hr={name:"characterEscape",tokenize:Ta};function Ta(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return fa(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Vr={name:"characterReference",tokenize:Pa};function Pa(e,t,n){const i=this;let s=0,a,o;return l;function l(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),u}function u(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,o=ge,d(m))}function c(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=ha,d):(e.enter("characterReferenceValue"),a=7,o=Gt,d(m))}function d(m){if(m===59&&s){const h=e.exit("characterReferenceValue");return o===ge&&!an(i.sliceSerialize(h))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&s++<a?(e.consume(m),d):n(m)}}const Bn={partial:!0,tokenize:Fa},qn={concrete:!0,name:"codeFenced",tokenize:Ma};function Ma(e,t,n){const i=this,s={partial:!0,tokenize:L};let a=0,o=0,l;return u;function u(_){return c(_)}function c(_){const I=i.events[i.events.length-1];return a=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,l=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(_)}function d(_){return _===l?(o++,e.consume(_),d):o<3?n(_):(e.exit("codeFencedFenceSequence"),Q(_)?Z(e,m,"whitespace")(_):m(_))}function m(_){return _===null||W(_)?(e.exit("codeFencedFence"),i.interrupt?t(_):e.check(Bn,v,M)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||W(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(_)):Q(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Z(e,p,"whitespace")(_)):_===96&&_===l?n(_):(e.consume(_),h)}function p(_){return _===null||W(_)?m(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===null||W(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(_)):_===96&&_===l?n(_):(e.consume(_),w)}function v(_){return e.attempt(s,M,N)(_)}function N(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),f}function f(_){return a>0&&Q(_)?Z(e,b,"linePrefix",a+1)(_):b(_)}function b(_){return _===null||W(_)?e.check(Bn,v,M)(_):(e.enter("codeFlowValue"),k(_))}function k(_){return _===null||W(_)?(e.exit("codeFlowValue"),b(_)):(e.consume(_),k)}function M(_){return e.exit("codeFenced"),t(_)}function L(_,I,D){let O=0;return q;function q(B){return _.enter("lineEnding"),_.consume(B),_.exit("lineEnding"),y}function y(B){return _.enter("codeFencedFence"),Q(B)?Z(_,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B)}function C(B){return B===l?(_.enter("codeFencedFenceSequence"),T(B)):D(B)}function T(B){return B===l?(O++,_.consume(B),T):O>=o?(_.exit("codeFencedFenceSequence"),Q(B)?Z(_,R,"whitespace")(B):R(B)):D(B)}function R(B){return B===null||W(B)?(_.exit("codeFencedFence"),I(B)):D(B)}}}function Fa(e,t,n){const i=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Tt={name:"codeIndented",tokenize:Ra},La={partial:!0,tokenize:za};function Ra(e,t,n){const i=this;return s;function s(c){return e.enter("codeIndented"),Z(e,a,"linePrefix",5)(c)}function a(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):W(c)?e.attempt(La,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||W(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function za(e,t,n){const i=this;return s;function s(o){return i.parser.lazy[i.now().line]?n(o):W(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Z(e,a,"linePrefix",5)(o)}function a(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):W(o)?s(o):n(o)}}const Oa={name:"codeText",previous:Ba,resolve:Da,tokenize:qa};function Da(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function Ba(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qa(e,t,n){let i=0,s,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),i++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(a=e.enter("codeTextSequence"),s=0,d(m)):W(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(m))}function c(m){return m===null||m===32||m===96||W(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),c)}function d(m){return m===96?(e.consume(m),s++,d):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",c(m))}}class Ua{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&Ge(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ge(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ge(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ge(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ge(this.left,n.reverse())}}}function Ge(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Wr(e){const t={};let n=-1,i,s,a,o,l,u,c;const d=new Ua(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=i[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,Ha(d,n)),n=t[n],c=!0);else if(i[1]._container){for(a=n,s=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(i[1].end={...d.get(s)[1].start},l=d.slice(s,n),l.unshift(i),d.splice(s,n-s+1,l))}}return Se(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Ha(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const a=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,u=[],c={};let d,m,h=-1,p=n,w=0,v=0;const N=[v];for(;p;){for(;e.get(++s)[1]!==p;);a.push(s),p._tokenizer||(d=i.sliceStream(p),p.next||d.push(null),m&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(v=h+1,N.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):N.pop(),h=N.length;h--;){const f=l.slice(N[h],N[h+1]),b=a.pop();u.push([b,b+f.length-1]),e.splice(b,2,f)}for(u.reverse(),h=-1;++h<u.length;)c[w+u[h][0]]=w+u[h][1],w+=u[h][1]-u[h][0]-1;return c}const Va={resolve:Ga,tokenize:$a},Wa={partial:!0,tokenize:Ya};function Ga(e){return Wr(e),e}function $a(e,t){let n;return i;function i(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):W(l)?e.check(Wa,o,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Ya(e,t,n){const i=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Z(e,a,"linePrefix")}function a(o){if(o===null||W(o))return n(o);const l=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function Gr(e,t,n,i,s,a,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return m;function m(f){return f===60?(e.enter(i),e.enter(s),e.enter(a),e.consume(f),e.exit(a),h):f===null||f===32||f===41||Wt(f)?n(f):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(f))}function h(f){return f===62?(e.enter(a),e.consume(f),e.exit(a),e.exit(s),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===62?(e.exit("chunkString"),e.exit(l),h(f)):f===null||f===60||W(f)?n(f):(e.consume(f),f===92?w:p)}function w(f){return f===60||f===62||f===92?(e.consume(f),p):p(f)}function v(f){return!d&&(f===null||f===41||ue(f))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(f)):d<c&&f===40?(e.consume(f),d++,v):f===41?(e.consume(f),d--,v):f===null||f===32||f===40||Wt(f)?n(f):(e.consume(f),f===92?N:v)}function N(f){return f===40||f===41||f===92?(e.consume(f),v):v(f)}}function $r(e,t,n,i,s,a){const o=this;let l=0,u;return c;function c(p){return e.enter(i),e.enter(s),e.consume(p),e.exit(s),e.enter(a),d}function d(p){return l>999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(s),e.consume(p),e.exit(s),e.exit(i),t):W(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),m(p))}function m(p){return p===null||p===91||p===93||W(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!Q(p)),p===92?h:m)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,m):m(p)}}function Yr(e,t,n,i,s,a){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,u):n(h)}function u(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(i),t):(e.enter(a),c(h))}function c(h){return h===o?(e.exit(a),u(o)):h===null?n(h):W(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||W(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?m:d)}function m(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Je(e,t){let n;return i;function i(s){return W(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):Q(s)?Z(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const Ja={name:"definition",tokenize:Qa},Xa={partial:!0,tokenize:Ka};function Qa(e,t,n){const i=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return $r.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=De(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return ue(p)?Je(e,c)(p):c(p)}function c(p){return Gr(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Xa,m,m)(p)}function m(p){return Q(p)?Z(e,h,"whitespace")(p):h(p)}function h(p){return p===null||W(p)?(e.exit("definition"),i.parser.defined.push(s),t(p)):n(p)}}function Ka(e,t,n){return i;function i(l){return ue(l)?Je(e,s)(l):n(l)}function s(l){return Yr(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Q(l)?Z(e,o,"whitespace")(l):o(l)}function o(l){return l===null||W(l)?t(l):n(l)}}const Za={name:"hardBreakEscape",tokenize:eo};function eo(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return W(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const to={name:"headingAtx",resolve:no,tokenize:ro};function no(e,t){let n=e.length-2,i=3,s,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Se(e,i,n-i+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function ro(e,t,n){let i=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ue(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||W(d)?(e.exit("atxHeading"),t(d)):Q(d)?Z(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||ue(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const io=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Un=["pre","script","style","textarea"],so={concrete:!0,name:"htmlFlow",resolveTo:lo,tokenize:co},ao={partial:!0,tokenize:mo},oo={partial:!0,tokenize:uo};function lo(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function co(e,t,n){const i=this;let s,a,o,l,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),m}function m(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),a=!0,v):x===63?(e.consume(x),s=3,i.interrupt?t:g):je(x)?(e.consume(x),o=String.fromCharCode(x),N):n(x)}function h(x){return x===45?(e.consume(x),s=2,p):x===91?(e.consume(x),s=5,l=0,w):je(x)?(e.consume(x),s=4,i.interrupt?t:g):n(x)}function p(x){return x===45?(e.consume(x),i.interrupt?t:g):n(x)}function w(x){const se="CDATA[";return x===se.charCodeAt(l++)?(e.consume(x),l===se.length?i.interrupt?t:C:w):n(x)}function v(x){return je(x)?(e.consume(x),o=String.fromCharCode(x),N):n(x)}function N(x){if(x===null||x===47||x===62||ue(x)){const se=x===47,be=o.toLowerCase();return!se&&!a&&Un.includes(be)?(s=1,i.interrupt?t(x):C(x)):io.includes(o.toLowerCase())?(s=6,se?(e.consume(x),f):i.interrupt?t(x):C(x)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(x):a?b(x):k(x))}return x===45||ge(x)?(e.consume(x),o+=String.fromCharCode(x),N):n(x)}function f(x){return x===62?(e.consume(x),i.interrupt?t:C):n(x)}function b(x){return Q(x)?(e.consume(x),b):q(x)}function k(x){return x===47?(e.consume(x),q):x===58||x===95||je(x)?(e.consume(x),M):Q(x)?(e.consume(x),k):q(x)}function M(x){return x===45||x===46||x===58||x===95||ge(x)?(e.consume(x),M):L(x)}function L(x){return x===61?(e.consume(x),_):Q(x)?(e.consume(x),L):k(x)}function _(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,I):Q(x)?(e.consume(x),_):D(x)}function I(x){return x===u?(e.consume(x),u=null,O):x===null||W(x)?n(x):(e.consume(x),I)}function D(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||ue(x)?L(x):(e.consume(x),D)}function O(x){return x===47||x===62||Q(x)?k(x):n(x)}function q(x){return x===62?(e.consume(x),y):n(x)}function y(x){return x===null||W(x)?C(x):Q(x)?(e.consume(x),y):n(x)}function C(x){return x===45&&s===2?(e.consume(x),V):x===60&&s===1?(e.consume(x),z):x===62&&s===4?(e.consume(x),ne):x===63&&s===3?(e.consume(x),g):x===93&&s===5?(e.consume(x),$):W(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ao,le,T)(x)):x===null||W(x)?(e.exit("htmlFlowData"),T(x)):(e.consume(x),C)}function T(x){return e.check(oo,R,le)(x)}function R(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),B}function B(x){return x===null||W(x)?T(x):(e.enter("htmlFlowData"),C(x))}function V(x){return x===45?(e.consume(x),g):C(x)}function z(x){return x===47?(e.consume(x),o="",U):C(x)}function U(x){if(x===62){const se=o.toLowerCase();return Un.includes(se)?(e.consume(x),ne):C(x)}return je(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),U):C(x)}function $(x){return x===93?(e.consume(x),g):C(x)}function g(x){return x===62?(e.consume(x),ne):x===45&&s===2?(e.consume(x),g):C(x)}function ne(x){return x===null||W(x)?(e.exit("htmlFlowData"),le(x)):(e.consume(x),ne)}function le(x){return e.exit("htmlFlow"),t(x)}}function uo(e,t,n){const i=this;return s;function s(o){return W(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function mo(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ht,t,n)}}const po={name:"htmlText",tokenize:ho};function ho(e,t,n){const i=this;let s,a,o;return l;function l(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),c):g===47?(e.consume(g),L):g===63?(e.consume(g),k):je(g)?(e.consume(g),D):n(g)}function c(g){return g===45?(e.consume(g),d):g===91?(e.consume(g),a=0,w):je(g)?(e.consume(g),b):n(g)}function d(g){return g===45?(e.consume(g),p):n(g)}function m(g){return g===null?n(g):g===45?(e.consume(g),h):W(g)?(o=m,z(g)):(e.consume(g),m)}function h(g){return g===45?(e.consume(g),p):m(g)}function p(g){return g===62?V(g):g===45?h(g):m(g)}function w(g){const ne="CDATA[";return g===ne.charCodeAt(a++)?(e.consume(g),a===ne.length?v:w):n(g)}function v(g){return g===null?n(g):g===93?(e.consume(g),N):W(g)?(o=v,z(g)):(e.consume(g),v)}function N(g){return g===93?(e.consume(g),f):v(g)}function f(g){return g===62?V(g):g===93?(e.consume(g),f):v(g)}function b(g){return g===null||g===62?V(g):W(g)?(o=b,z(g)):(e.consume(g),b)}function k(g){return g===null?n(g):g===63?(e.consume(g),M):W(g)?(o=k,z(g)):(e.consume(g),k)}function M(g){return g===62?V(g):k(g)}function L(g){return je(g)?(e.consume(g),_):n(g)}function _(g){return g===45||ge(g)?(e.consume(g),_):I(g)}function I(g){return W(g)?(o=I,z(g)):Q(g)?(e.consume(g),I):V(g)}function D(g){return g===45||ge(g)?(e.consume(g),D):g===47||g===62||ue(g)?O(g):n(g)}function O(g){return g===47?(e.consume(g),V):g===58||g===95||je(g)?(e.consume(g),q):W(g)?(o=O,z(g)):Q(g)?(e.consume(g),O):V(g)}function q(g){return g===45||g===46||g===58||g===95||ge(g)?(e.consume(g),q):y(g)}function y(g){return g===61?(e.consume(g),C):W(g)?(o=y,z(g)):Q(g)?(e.consume(g),y):O(g)}function C(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),s=g,T):W(g)?(o=C,z(g)):Q(g)?(e.consume(g),C):(e.consume(g),R)}function T(g){return g===s?(e.consume(g),s=void 0,B):g===null?n(g):W(g)?(o=T,z(g)):(e.consume(g),T)}function R(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||ue(g)?O(g):(e.consume(g),R)}function B(g){return g===47||g===62||ue(g)?O(g):n(g)}function V(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),t):n(g)}function z(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return Q(g)?Z(e,$,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):$(g)}function $(g){return e.enter("htmlTextData"),o(g)}}const ln={name:"labelEnd",resolveAll:yo,resolveTo:bo,tokenize:_o},fo={tokenize:vo},go={tokenize:ko},xo={tokenize:wo};function yo(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&Se(e,0,e.length,n),e}function bo(e,t){let n=e.length,i=0,s,a,o,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(o=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+i+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=xe(l,e.slice(a+1,a+i+3)),l=xe(l,[["enter",d,t]]),l=xe(l,on(t.parser.constructs.insideSpan.null,e.slice(a+i+4,o-3),t)),l=xe(l,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),l=xe(l,e.slice(o+1)),l=xe(l,[["exit",u,t]]),Se(e,a,e.length,l),e}function _o(e,t,n){const i=this;let s=i.events.length,a,o;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){a=i.events[s][1];break}return l;function l(h){return a?a._inactive?m(h):(o=i.parser.defined.includes(De(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(fo,d,o?d:m)(h):h===91?e.attempt(go,d,o?c:m)(h):o?d(h):m(h)}function c(h){return e.attempt(xo,d,m)(h)}function d(h){return t(h)}function m(h){return a._balanced=!0,n(h)}}function vo(e,t,n){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return ue(m)?Je(e,a)(m):a(m)}function a(m){return m===41?d(m):Gr(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return ue(m)?Je(e,u)(m):d(m)}function l(m){return n(m)}function u(m){return m===34||m===39||m===40?Yr(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):d(m)}function c(m){return ue(m)?Je(e,d)(m):d(m)}function d(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function ko(e,t,n){const i=this;return s;function s(l){return $r.call(i,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return i.parser.defined.includes(De(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function wo(e,t,n){return i;function i(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const jo={name:"labelStartImage",resolveAll:ln.resolveAll,tokenize:So};function So(e,t,n){const i=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const No={name:"labelStartLink",resolveAll:ln.resolveAll,tokenize:Co};function Co(e,t,n){const i=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Pt={name:"lineEnding",tokenize:Ao};function Ao(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Z(e,t,"linePrefix")}}const dt={name:"thematicBreak",tokenize:Eo};function Eo(e,t,n){let i=0,s;return a;function a(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,l(c)}function l(c){return c===s?(e.enter("thematicBreakSequence"),u(c)):i>=3&&(c===null||W(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),i++,u):(e.exit("thematicBreakSequence"),Q(c)?Z(e,l,"whitespace")(c):l(c))}}const ce={continuation:{tokenize:Mo},exit:Lo,name:"list",tokenize:Po},Io={partial:!0,tokenize:Ro},To={partial:!0,tokenize:Fo};function Po(e,t,n){const i=this,s=i.events[i.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const w=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:Gt(p)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(dt,n,c)(p):c(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return Gt(p)&&++o<10?(e.consume(p),u):(!i.interrupt||o<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(ht,i.interrupt?n:d,e.attempt(Io,h,m))}function d(p){return i.containerState.initialBlankLine=!0,a++,h(p)}function m(p){return Q(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Mo(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(ht,s,a);function s(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Z(e,t,"listItemIndent",i.containerState.size+1)(l)}function a(l){return i.containerState.furtherBlankLines||!Q(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(To,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Z(e,e.attempt(ce,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Fo(e,t,n){const i=this;return Z(e,s,"listItemIndent",i.containerState.size+1);function s(a){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(a):n(a)}}function Lo(e){e.exit(this.containerState.type)}function Ro(e,t,n){const i=this;return Z(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=i.events[i.events.length-1];return!Q(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Hn={name:"setextUnderline",resolveTo:zo,tokenize:Oo};function zo(e,t){let n=e.length,i,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Oo(e,t,n){const i=this;let s;return a;function a(c){let d=i.events.length,m;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){m=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===s?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Q(c)?Z(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||W(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Do={tokenize:Bo};function Bo(e){const t=this,n=e.attempt(ht,i,e.attempt(this.parser.constructs.flowInitial,s,Z(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Va,s)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qo={resolveAll:Xr()},Uo=Jr("string"),Ho=Jr("text");function Jr(e){return{resolveAll:Xr(e==="text"?Vo:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return c(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const m=s[d];let h=-1;if(m)for(;++h<m.length;){const p=m[h];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function Xr(e){return t;function t(n,i){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,i):n}}function Vo(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let a=s.length,o=-1,l=0,u;for(;a--;){const c=s[a];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(c===-2)u=!0,l++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Wo={42:ce,43:ce,45:ce,48:ce,49:ce,50:ce,51:ce,52:ce,53:ce,54:ce,55:ce,56:ce,57:ce,62:Ur},Go={91:Ja},$o={[-2]:Tt,[-1]:Tt,32:Tt},Yo={35:to,42:dt,45:[Hn,dt],60:so,61:Hn,95:dt,96:qn,126:qn},Jo={38:Vr,92:Hr},Xo={[-5]:Pt,[-4]:Pt,[-3]:Pt,33:jo,38:Vr,42:$t,60:[Sa,po],91:No,92:[Za,Hr],93:ln,95:$t,96:Oa},Qo={null:[$t,qo]},Ko={null:[42,95]},Zo={null:[]},el=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ko,contentInitial:Go,disable:Zo,document:Wo,flow:Yo,flowInitial:$o,insideSpan:Qo,string:Jo,text:Xo},Symbol.toStringTag,{value:"Module"}));function tl(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let o=[],l=[];const u={attempt:I(L),check:I(_),consume:b,enter:k,exit:M,interrupt:I(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:w,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:m};let d=t.tokenize.call(c,u);return t.resolveAll&&a.push(t),c;function m(y){return o=xe(o,y),N(),o[o.length-1]!==null?[]:(D(t,0),c.events=on(a,c.events,c),c.events)}function h(y,C){return rl(p(y),C)}function p(y){return nl(o,y)}function w(){const{_bufferIndex:y,_index:C,line:T,column:R,offset:B}=i;return{_bufferIndex:y,_index:C,line:T,column:R,offset:B}}function v(y){s[y.line]=y.column,q()}function N(){let y;for(;i._index<o.length;){const C=o[i._index];if(typeof C=="string")for(y=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===y&&i._bufferIndex<C.length;)f(C.charCodeAt(i._bufferIndex));else f(C)}}function f(y){d=d(y)}function b(y){W(y)?(i.line++,i.column=1,i.offset+=y===-3?2:1,q()):y!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=y}function k(y,C){const T=C||{};return T.type=y,T.start=w(),c.events.push(["enter",T,c]),l.push(T),T}function M(y){const C=l.pop();return C.end=w(),c.events.push(["exit",C,c]),C}function L(y,C){D(y,C.from)}function _(y,C){C.restore()}function I(y,C){return T;function T(R,B,V){let z,U,$,g;return Array.isArray(R)?le(R):"tokenize"in R?le([R]):ne(R);function ne(re){return Ee;function Ee(_e){const Ne=_e!==null&&re[_e],ve=_e!==null&&re.null,Pe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return le(Pe)(_e)}}function le(re){return z=re,U=0,re.length===0?V:x(re[U])}function x(re){return Ee;function Ee(_e){return g=O(),$=re,re.partial||(c.currentConstruct=re),re.name&&c.parser.constructs.disable.null.includes(re.name)?be():re.tokenize.call(C?Object.assign(Object.create(c),C):c,u,se,be)(_e)}}function se(re){return y($,g),B}function be(re){return g.restore(),++U<z.length?x(z[U]):V}}}function D(y,C){y.resolveAll&&!a.includes(y)&&a.push(y),y.resolve&&Se(c.events,C,c.events.length-C,y.resolve(c.events.slice(C),c)),y.resolveTo&&(c.events=y.resolveTo(c.events,c))}function O(){const y=w(),C=c.previous,T=c.currentConstruct,R=c.events.length,B=Array.from(l);return{from:R,restore:V};function V(){i=y,c.previous=C,c.currentConstruct=T,c.events.length=R,l=B,q()}}function q(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function nl(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(i,a)];else{if(o=e.slice(n,s),i>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function rl(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
92
+ `;break}case-3:{o=`\r
93
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(a)}s=a===-2,i.push(o)}return i.join("")}function il(e){const i={constructs:ua([el,...(e||{}).extensions||[]]),content:s(ya),defined:[],document:s(_a),flow:s(Do),lazy:{},string:s(Uo),text:s(Ho)};return i;function s(a){return o;function o(l){return tl(i,a,l)}}}function sl(e){for(;!Wr(e););return e}const Vn=/[\0\t\n\r]/g;function al(){let e=1,t="",n=!0,i;return s;function s(a,o,l){const u=[];let c,d,m,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Vn.lastIndex=m,c=Vn.exec(a),h=c&&c.index!==void 0?c.index:a.length,p=a.charCodeAt(h),!c){t=a.slice(m);break}if(p===10&&m===h&&i)u.push(-3),i=void 0;else switch(i&&(u.push(-5),i=void 0),m<h&&(u.push(a.slice(m,h)),e+=h-m),p){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:i=!0,e=1}m=h+1}return l&&(i&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ol=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ll(e){return e.replace(ol,cl)}function cl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return qr(n.slice(a?2:1),a?16:10)}return an(n)||e}function Xe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wn(e.position):"start"in e||"end"in e?Wn(e):"line"in e||"column"in e?Yt(e):""}function Yt(e){return Gn(e&&e.line)+":"+Gn(e&&e.column)}function Wn(e){return Yt(e&&e.start)+"-"+Yt(e&&e.end)}function Gn(e){return e&&typeof e=="number"?e:1}const Qr={}.hasOwnProperty;function ul(e,t,n){return typeof t!="string"&&(n=t,t=void 0),dl(n)(sl(il(n).document().write(al()(e,t,!0))))}function dl(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(it),autolinkProtocol:O,autolinkEmail:O,atxHeading:a(tt),blockQuote:a(ve),characterEscape:O,characterReference:O,codeFenced:a(Pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Pe,o),codeText:a(xt,o),codeTextData:O,data:O,codeFlowValue:O,definition:a(yt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(bt),hardBreakEscape:a(nt),hardBreakTrailing:a(nt),htmlFlow:a(rt,o),htmlFlowData:O,htmlText:a(rt,o),htmlTextData:O,image:a(_t),label:o,link:a(it),listItem:a(vt),listItemValue:h,listOrdered:a(st,m),listUnordered:a(st),paragraph:a(kt),reference:x,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(tt),strong:a(wt),thematicBreak:a(St)},exit:{atxHeading:u(),atxHeadingSequence:L,autolink:u(),autolinkEmail:Ne,autolinkProtocol:_e,blockQuote:u(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:re,characterReference:Ee,codeFenced:u(N),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:u(f),codeText:u(B),codeTextData:q,data:q,definition:u(),definitionDestinationString:M,definitionLabelString:b,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(C),hardBreakTrailing:u(C),htmlFlow:u(T),htmlFlowData:q,htmlText:u(R),htmlTextData:q,image:u(z),label:$,labelText:U,lineEnding:y,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:se,resourceDestinationString:g,resourceTitleString:ne,resource:le,setextHeading:u(D),setextHeadingLineSequence:I,setextHeadingText:_,strong:u(),thematicBreak:u()}};Kr(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(S){let F={type:"root",children:[]};const G={stack:[F],tokenStack:[],config:t,enter:l,exit:c,buffer:o,resume:d,data:n},J=[];let E=-1;for(;++E<S.length;)if(S[E][1].type==="listOrdered"||S[E][1].type==="listUnordered")if(S[E][0]==="enter")J.push(E);else{const ee=J.pop();E=s(S,ee,E)}for(E=-1;++E<S.length;){const ee=t[S[E][0]];Qr.call(ee,S[E][1].type)&&ee[S[E][1].type].call(Object.assign({sliceSerialize:S[E][2].sliceSerialize},G),S[E][1])}if(G.tokenStack.length>0){const ee=G.tokenStack[G.tokenStack.length-1];(ee[1]||$n).call(G,void 0,ee[0])}for(F.position={start:Ie(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Ie(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},E=-1;++E<t.transforms.length;)F=t.transforms[E](F)||F;return F}function s(S,F,G){let J=F-1,E=-1,ee=!1,ke,ie,Ue,He;for(;++J<=G;){const pe=S[J];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?E++:E--,He=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(ke&&!He&&!E&&!Ue&&(Ue=J),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!E&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||E===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(ke){let Le=J;for(ie=void 0;Le--;){const Ce=S[Le];if(Ce[1].type==="lineEnding"||Ce[1].type==="lineEndingBlank"){if(Ce[0]==="exit")continue;ie&&(S[ie][1].type="lineEndingBlank",ee=!0),Ce[1].type="lineEnding",ie=Le}else if(!(Ce[1].type==="linePrefix"||Ce[1].type==="blockQuotePrefix"||Ce[1].type==="blockQuotePrefixWhitespace"||Ce[1].type==="blockQuoteMarker"||Ce[1].type==="listItemIndent"))break}Ue&&(!ie||Ue<ie)&&(ke._spread=!0),ke.end=Object.assign({},ie?S[ie][1].start:pe[1].end),S.splice(ie||J,0,["exit",ke,pe[2]]),J++,G++}if(pe[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};ke=Le,S.splice(J,0,["enter",Le,pe[2]]),J++,G++,Ue=void 0,He=!0}}}return S[F][1]._spread=ee,G}function a(S,F){return G;function G(J){l.call(this,S(J),J),F&&F.call(this,J)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(S,F,G){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([F,G||void 0]),S.position={start:Ie(F.start),end:void 0}}function u(S){return F;function F(G){S&&S.call(this,G),c.call(this,G)}}function c(S,F){const G=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==S.type&&(F?F.call(this,S,J[0]):(J[1]||$n).call(this,S,J[0]));else throw new Error("Cannot close `"+S.type+"` ("+Xe({start:S.start,end:S.end})+"): it’s not open");G.position.end=Ie(S.end)}function d(){return la(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function h(S){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function p(){const S=this.resume(),F=this.stack[this.stack.length-1];F.lang=S}function w(){const S=this.resume(),F=this.stack[this.stack.length-1];F.meta=S}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const S=this.resume(),F=this.stack[this.stack.length-1];F.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){const S=this.resume(),F=this.stack[this.stack.length-1];F.value=S.replace(/(\r?\n|\r)$/g,"")}function b(S){const F=this.resume(),G=this.stack[this.stack.length-1];G.label=F,G.identifier=De(this.sliceSerialize(S)).toLowerCase()}function k(){const S=this.resume(),F=this.stack[this.stack.length-1];F.title=S}function M(){const S=this.resume(),F=this.stack[this.stack.length-1];F.url=S}function L(S){const F=this.stack[this.stack.length-1];if(!F.depth){const G=this.sliceSerialize(S).length;F.depth=G}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(S){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function O(S){const G=this.stack[this.stack.length-1].children;let J=G[G.length-1];(!J||J.type!=="text")&&(J=jt(),J.position={start:Ie(S.start),end:void 0},G.push(J)),this.stack.push(J)}function q(S){const F=this.stack.pop();F.value+=this.sliceSerialize(S),F.position.end=Ie(S.end)}function y(S){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=F.children[F.children.length-1];G.position.end=Ie(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&(O.call(this,S),q.call(this,S))}function C(){this.data.atHardBreak=!0}function T(){const S=this.resume(),F=this.stack[this.stack.length-1];F.value=S}function R(){const S=this.resume(),F=this.stack[this.stack.length-1];F.value=S}function B(){const S=this.resume(),F=this.stack[this.stack.length-1];F.value=S}function V(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=F,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function z(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=F,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function U(S){const F=this.sliceSerialize(S),G=this.stack[this.stack.length-2];G.label=ll(F),G.identifier=De(F).toLowerCase()}function $(){const S=this.stack[this.stack.length-1],F=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const J=S.children;G.children=J}else G.alt=F}function g(){const S=this.resume(),F=this.stack[this.stack.length-1];F.url=S}function ne(){const S=this.resume(),F=this.stack[this.stack.length-1];F.title=S}function le(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function se(S){const F=this.resume(),G=this.stack[this.stack.length-1];G.label=F,G.identifier=De(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function be(S){this.data.characterReferenceType=S.type}function re(S){const F=this.sliceSerialize(S),G=this.data.characterReferenceType;let J;G?(J=qr(F,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=an(F);const E=this.stack[this.stack.length-1];E.value+=J}function Ee(S){const F=this.stack.pop();F.position.end=Ie(S.end)}function _e(S){q.call(this,S);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(S)}function Ne(S){q.call(this,S);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(S)}function ve(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function yt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function tt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function rt(){return{type:"html",value:""}}function _t(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function st(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function vt(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function wt(){return{type:"strong",children:[]}}function jt(){return{type:"text",value:""}}function St(){return{type:"thematicBreak"}}}function Ie(e){return{line:e.line,column:e.column,offset:e.offset}}function Kr(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Kr(e,i):ml(e,i)}}function ml(e,t){let n;for(n in t)if(Qr.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function $n(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xe({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xe({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xe({start:t.start,end:t.end})+") is still open")}function pl(e){const t=this;t.parser=n;function n(i){return ul(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hl(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function fl(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
94
+ `}]}function gl(e,t){const n=t.value?t.value+`
95
+ `:"",i={};t.lang&&(i.className=["language-"+t.lang]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function xl(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yl(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bl(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),s=qe(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(i,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function _l(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vl(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Zr(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=i:s.push({type:"text",value:i}),s}function kl(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Zr(e,t);const s={src:qe(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function wl(e,t){const n={src:qe(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function jl(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Sl(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Zr(e,t);const s={href:qe(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Nl(e,t){const n={href:qe(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Cl(e,t,n){const i=e.all(t),s=n?Al(n):ei(t),a={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let m;d&&d.type==="element"&&d.tagName==="p"?m=d:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<i.length;){const d=i[l];(s||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
96
+ `}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const u=i[i.length-1];u&&(s||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
97
+ `});const c={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,c),e.applyData(t,c)}function Al(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=ei(n[i])}return t}function ei(e){const t=e.spread;return t??e.children.length>1}function El(e,t){const n={},i=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<i.length;){const o=i[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Il(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tl(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Pl(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ti=ri("end"),ni=ri("start");function ri(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Ml(e){const t=ni(e),n=ti(e);if(t&&n)return{start:t,end:n}}function Fl(e,t){const n=e.all(t),i=n.shift(),s=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ni(t.children[1]),u=ti(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Ll(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const m=t.children[u],h={},p=o?o[u]:void 0;p&&(h.align=p);let w={type:"element",tagName:a,properties:h,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),c.push(w)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function Rl(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Yn=9,Jn=32;function zl(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),s=0;const a=[];for(;i;)a.push(Xn(t.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=n.exec(t);return a.push(Xn(t.slice(s),s>0,!1)),a.join("")}function Xn(e,t,n){let i=0,s=e.length;if(t){let a=e.codePointAt(i);for(;a===Yn||a===Jn;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(s-1);for(;a===Yn||a===Jn;)s--,a=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function Ol(e,t){const n={type:"text",value:zl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Dl(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Bl={blockquote:hl,break:fl,code:gl,delete:xl,emphasis:yl,footnoteReference:bl,heading:_l,html:vl,imageReference:kl,image:wl,inlineCode:jl,linkReference:Sl,link:Nl,listItem:Cl,list:El,paragraph:Il,root:Tl,strong:Pl,table:Fl,tableCell:Rl,tableRow:Ll,text:Ol,thematicBreak:Dl,toml:ot,yaml:ot,definition:ot,footnoteDefinition:ot};function ot(){}const ii=-1,ft=0,Qe=1,mt=2,cn=3,un=4,dn=5,mn=6,si=7,ai=8,Qn=typeof self=="object"?self:globalThis,ql=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),i=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case ft:case ii:return n(o,s);case Qe:{const l=n([],s);for(const u of o)l.push(i(u));return l}case mt:{const l=n({},s);for(const[u,c]of o)l[i(u)]=i(c);return l}case cn:return n(new Date(o),s);case un:{const{source:l,flags:u}=o;return n(new RegExp(l,u),s)}case dn:{const l=n(new Map,s);for(const[u,c]of o)l.set(i(u),i(c));return l}case mn:{const l=n(new Set,s);for(const u of o)l.add(i(u));return l}case si:{const{name:l,message:u}=o;return n(new Qn[l](u),s)}case ai:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new Qn[a](o),s)};return i},Kn=e=>ql(new Map,e)(0),ze="",{toString:Ul}={},{keys:Hl}=Object,$e=e=>{const t=typeof e;if(t!=="object"||!e)return[ft,t];const n=Ul.call(e).slice(8,-1);switch(n){case"Array":return[Qe,ze];case"Object":return[mt,ze];case"Date":return[cn,ze];case"RegExp":return[un,ze];case"Map":return[dn,ze];case"Set":return[mn,ze];case"DataView":return[Qe,n]}return n.includes("Array")?[Qe,n]:n.includes("Error")?[si,n]:[mt,n]},lt=([e,t])=>e===ft&&(t==="function"||t==="symbol"),Vl=(e,t,n,i)=>{const s=(o,l)=>{const u=i.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=$e(o);switch(l){case ft:{let d=o;switch(u){case"bigint":l=ai,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([ii],o)}return s([l,d],o)}case Qe:{if(u){let h=o;return u==="DataView"?h=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(o)),s([u,[...h]],o)}const d=[],m=s([l,d],o);for(const h of o)d.push(a(h));return m}case mt:{if(u)switch(u){case"BigInt":return s([u,o.toString()],o);case"Boolean":case"Number":case"String":return s([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],m=s([l,d],o);for(const h of Hl(o))(e||!lt($e(o[h])))&&d.push([a(h),a(o[h])]);return m}case cn:return s([l,o.toISOString()],o);case un:{const{source:d,flags:m}=o;return s([l,{source:d,flags:m}],o)}case dn:{const d=[],m=s([l,d],o);for(const[h,p]of o)(e||!(lt($e(h))||lt($e(p))))&&d.push([a(h),a(p)]);return m}case mn:{const d=[],m=s([l,d],o);for(const h of o)(e||!lt($e(h)))&&d.push(a(h));return m}}const{message:c}=o;return s([l,{name:u,message:c}],o)};return a},Zn=(e,{json:t,lossy:n}={})=>{const i=[];return Vl(!(t||n),!!t,new Map,i)(e),i},pt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kn(Zn(e,t)):structuredClone(e):(e,t)=>Kn(Zn(e,t));function Wl(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Gl(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $l(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Wl,i=e.options.footnoteBackLabel||Gl,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),m=String(c.identifier).toUpperCase(),h=qe(m.toLowerCase());let p=0;const w=[],v=e.footnoteCounts.get(m);for(;v!==void 0&&++p<=v;){w.length>0&&w.push({type:"text",value:" "});let b=typeof n=="string"?n:n(u,p);typeof b=="string"&&(b={type:"text",value:b}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(u,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const N=d[d.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const b=N.children[N.children.length-1];b&&b.type==="text"?b.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else d.push(...w);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,f),l.push(f)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...pt(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
98
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
99
+ `}]}}const oi=function(e){if(e==null)return Ql;if(typeof e=="function")return gt(e);if(typeof e=="object")return Array.isArray(e)?Yl(e):Jl(e);if(typeof e=="string")return Xl(e);throw new Error("Expected function, string, or object as test")};function Yl(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=oi(e[n]);return gt(i);function i(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function Jl(e){const t=e;return gt(n);function n(i){const s=i;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function Xl(e){return gt(t);function t(n){return n&&n.type===e}}function gt(e){return t;function t(n,i,s){return!!(Kl(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function Ql(){return!0}function Kl(e){return e!==null&&typeof e=="object"&&"type"in e}const li=[],Zl=!0,er=!1,ec="skip";function tc(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const a=oi(s),o=i?-1:1;l(e,void 0,[])();function l(u,c,d){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const p=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=li,w,v,N;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=nc(n(u,d)),p[0]===er))return p;if("children"in u&&u.children){const f=u;if(f.children&&p[0]!==ec)for(v=(i?f.children.length:-1)+o,N=d.concat(f);v>-1&&v<f.children.length;){const b=f.children[v];if(w=l(b,v,N)(),w[0]===er)return w;v=typeof w[1]=="number"?w[1]:v+o}}return p}}}function nc(e){return Array.isArray(e)?e:typeof e=="number"?[Zl,e]:e==null?li:[e]}function ci(e,t,n,i){let s,a,o;typeof t=="function"?(a=void 0,o=t,s=n):(a=t,o=n,s=i),tc(e,a,l,s);function l(u,c){const d=c[c.length-1],m=d?d.children.indexOf(u):void 0;return o(u,m,d)}}const Jt={}.hasOwnProperty,rc={};function ic(e,t){const n=t||rc,i=new Map,s=new Map,a=new Map,o={...Bl,...n.handlers},l={all:c,applyData:ac,definitionById:i,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:sc,wrap:lc};return ci(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const m=d.type==="definition"?i:s,h=String(d.identifier).toUpperCase();m.has(h)||m.set(h,d)}}),l;function u(d,m){const h=d.type,p=l.handlers[h];if(Jt.call(l.handlers,h)&&p)return p(l,d,m);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:v,...N}=d,f=pt(N);return f.children=l.all(d),f}return pt(d)}return(l.options.unknownHandler||oc)(l,d,m)}function c(d){const m=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const w=l.one(h[p],d);if(w){if(p&&h[p-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=tr(w.value)),!Array.isArray(w)&&w.type==="element")){const v=w.children[0];v&&v.type==="text"&&(v.value=tr(v.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function sc(e,t){e.position&&(t.position=Ml(e))}function ac(e,t){let n=t;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,pt(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function oc(e,t){const n=t.data||{},i="value"in t&&!(Jt.call(n,"hProperties")||Jt.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function lc(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
100
+ `});++i<e.length;)i&&n.push({type:"text",value:`
101
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
102
+ `}),n}function tr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nr(e,t){const n=ic(e,t),i=n.one(e,void 0),s=$l(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
103
+ `},s),a}function cc(e,t){return e&&"run"in e?async function(n,i){const s=nr(n,{file:i,...t});await e.run(s,i)}:function(n,i){return nr(n,{file:i,...e||t})}}function rr(e){if(e)throw e}var Mt,ir;function uc(){if(ir)return Mt;ir=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),m=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!m)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(i)return i(c,d).value}else return;return c[d]};return Mt=function u(){var c,d,m,h,p,w,v=arguments[0],N=1,f=arguments.length,b=!1;for(typeof v=="boolean"&&(b=v,v=arguments[1]||{},N=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});N<f;++N)if(c=arguments[N],c!=null)for(d in c)m=l(v,d),h=l(c,d),v!==h&&(b&&h&&(a(h)||(p=s(h)))?(p?(p=!1,w=m&&s(m)?m:[]):w=m&&a(m)?m:{},o(v,{name:d,newValue:u(b,w,h)})):typeof h<"u"&&o(v,{name:d,newValue:h}));return v},Mt}var dc=uc();const Ft=yr(dc);function Xt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function mc(){const e=[],t={run:n,use:i};return t;function n(...s){let a=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(u,...c){const d=e[++a];let m=-1;if(u){o(u);return}for(;++m<s.length;)(c[m]===null||c[m]===void 0)&&(c[m]=s[m]);s=c,d?pc(d,l)(...c):o(null,...c)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function pc(e,t){let n;return i;function i(...o){const l=e.length>o.length;let u;l&&o.push(s);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return s(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}class me extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?a.ruleId=i:(a.source=i.slice(0,u),a.ruleId=i.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=l?l.line:void 0,this.name=Xe(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}me.prototype.file="";me.prototype.name="";me.prototype.reason="";me.prototype.message="";me.prototype.stack="";me.prototype.column=void 0;me.prototype.line=void 0;me.prototype.ancestors=void 0;me.prototype.cause=void 0;me.prototype.fatal=void 0;me.prototype.place=void 0;me.prototype.ruleId=void 0;me.prototype.source=void 0;const we={basename:hc,dirname:fc,extname:gc,join:xc,sep:"/"};function hc(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');et(e);let n=0,i=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else i<0&&(a=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(i=s):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function fc(e){if(et(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function gc(e){et(e);let t=e.length,n=-1,i=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function xc(...e){let t=-1,n;for(;++t<e.length;)et(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yc(n)}function yc(e){et(e);const t=e.codePointAt(0)===47;let n=bc(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function bc(e,t){let n="",i=0,s=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||a===1))if(s!==o-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",i=0):(n=n.slice(0,u),i=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",i=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function et(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _c={cwd:vc};function vc(){return"/"}function Qt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kc(e){if(typeof e=="string")e=new URL(e);else if(!Qt(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return wc(e)}function wc(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Lt=["history","path","basename","stem","extname","dirname"];class ui{constructor(t){let n;t?Qt(t)?n={path:t}:typeof t=="string"||jc(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_c.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Lt.length;){const a=Lt[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Lt.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?we.basename(this.path):void 0}set basename(t){zt(t,"basename"),Rt(t,"basename"),this.path=we.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?we.dirname(this.path):void 0}set dirname(t){sr(this.basename,"dirname"),this.path=we.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?we.extname(this.path):void 0}set extname(t){if(Rt(t,"extname"),sr(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=we.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qt(t)&&(t=kc(t)),zt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?we.basename(this.path,this.extname):void 0}set stem(t){zt(t,"stem"),Rt(t,"stem"),this.path=we.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const s=this.message(t,n,i);throw s.fatal=!0,s}info(t,n,i){const s=this.message(t,n,i);return s.fatal=void 0,s}message(t,n,i){const s=new me(t,n,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rt(e,t){if(e&&e.includes(we.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+we.sep+"`")}function zt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sr(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function jc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Sc=function(e){const i=this.constructor.prototype,s=i[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,i),a},Nc={}.hasOwnProperty;class pn extends Sc{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=mc()}copy(){const t=new pn;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Ft(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bt("data",this.frozen),this.namespace[t]=n,this):Nc.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=n.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ct(t),i=this.parser||this.Parser;return Ot("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Ot("process",this.parser||this.Parser),Dt("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const l=ct(t),u=i.parse(l);i.run(u,l,function(d,m,h){if(d||!m||!h)return c(d);const p=m,w=i.stringify(p,h);Ec(w)?h.value=w:h.result=w,c(d,h)});function c(d,m){d||!m?o(d):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),Ot("processSync",this.parser||this.Parser),Dt("processSync",this.compiler||this.Compiler),this.process(t,s),or("processSync","process",n),i;function s(a,o){n=!0,rr(a),i=o}}run(t,n,i){ar(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(o,l){const u=ct(n);s.run(t,u,c);function c(d,m,h){const p=m||t;d?l(d):o?o(p):i(void 0,p,h)}}}runSync(t,n){let i=!1,s;return this.run(t,n,a),or("runSync","run",i),s;function a(o,l){rr(o),s=l,i=!0}}stringify(t,n){this.freeze();const i=ct(n),s=this.compiler||this.Compiler;return Dt("stringify",s),ar(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(Bt("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...m]=c;u(d,m)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(s.settings=Ft(!0,s.settings,c.settings))}function l(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const m=c[d];a(m)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let m=-1,h=-1;for(;++m<i.length;)if(i[m][0]===c){h=m;break}if(h===-1)i.push([c,...d]);else if(d.length>0){let[p,...w]=d;const v=i[h][1];Xt(v)&&Xt(p)&&(p=Ft(!0,v,p)),i[h]=[c,p,...w]}}}}const Cc=new pn().freeze();function Ot(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ar(e){if(!Xt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function or(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ct(e){return Ac(e)?e:new ui(e)}function Ac(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ec(e){return typeof e=="string"||Ic(e)}function Ic(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Tc="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lr=[],cr={allowDangerousHtml:!0},Pc=/^(https?|ircs?|mailto|xmpp)$/i,Mc=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fc(e){const t=Lc(e),n=Rc(e);return zc(t.runSync(t.parse(n),n),e)}function Lc(e){const t=e.rehypePlugins||lr,n=e.remarkPlugins||lr,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cr}:cr;return Cc().use(pl).use(n).use(cc,i).use(t)}function Rc(e){const t=e.children||"",n=new ui;return typeof t=="string"&&(n.value=t),n}function zc(e,t){const n=t.allowedElements,i=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Oc;for(const d of Mc)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Tc+d.id,void 0);return ci(e,c),Ws(e,{Fragment:r.Fragment,components:s,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function c(d,m,h){if(d.type==="raw"&&h&&typeof m=="number")return o?h.children.splice(m,1):h.children[m]={type:"text",value:d.value},m;if(d.type==="element"){let p;for(p in It)if(Object.hasOwn(It,p)&&Object.hasOwn(d.properties,p)){const w=d.properties[p],v=It[p];(v===null||v.includes(d.tagName))&&(d.properties[p]=u(String(w||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&i&&typeof m=="number"&&(p=!i(d,m,h)),p&&h&&typeof m=="number")return l&&d.children?h.children.splice(m,1,...d.children):h.children.splice(m,1),m}}}function Oc(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||i!==-1&&t>i||Pc.test(e.slice(0,t))?e:""}const ur=({variant:e="default",className:t,children:n,...i})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-500 hover:bg-green-600 text-white dark:bg-green-600 dark:hover:bg-green-700",o="bg-indigo-600 hover:bg-indigo-700 text-white dark:bg-indigo-500 dark:hover:bg-indigo-600";let u="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"?u=a:e==="secondary"&&(u=o),r.jsx("button",{...i,className:`${s} ${u} ${t||""}`.trim(),children:n})},Dc=({plugin:e,isOpen:t,onClose:n,onInstall:i})=>{if(!t)return null;const s=a=>!a||a.length===0?r.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No skills defined for this plugin."}):r.jsx("ul",{className:"list-disc list-inside space-y-1 pl-1",children:a.map((o,l)=>r.jsxs("li",{className:"text-sm text-gray-700 dark:text-gray-300",children:[r.jsx("strong",{className:"font-semibold text-gray-800 dark:text-gray-200",children:o.name||"Unnamed Skill"}),o.description&&`: ${o.description}`]},l))});return r.jsx("div",{role:"button",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&n()},children:r.jsxs("div",{role:"dialog",className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-2xl w-full max-h-[90vh] flex flex-col",onClick:a=>a.stopPropagation(),onKeyDown:a=>{a.key==="Escape"&&n(),a.stopPropagation()},children:[r.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",children:[r.jsxs("h2",{id:"readMoreModalTitle",className:"text-xl font-semibold text-gray-800 dark:text-gray-100",children:[e.pyproject.name," ",r.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["v",e.pyproject.version]})]}),r.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsxs("div",{className:"p-5 space-y-5 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-100 dark:scrollbar-track-gray-700 flex-grow",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Description"}),r.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:e.pyproject.description||"No description provided."})]}),e.pyproject.authors&&e.pyproject.authors.length>0&&r.jsxs("div",{children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Author(s)"}),r.jsx("ul",{className:"list-disc list-inside pl-1",children:e.pyproject.authors.map((a,o)=>r.jsxs("li",{className:"text-sm text-gray-600 dark:text-gray-400",children:[a.name||"N/A"," ",a.email&&r.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:`<${a.email}>`})]},o))})]}),e.pyproject.custom_metadata&&Object.keys(e.pyproject.custom_metadata).length>0&&r.jsxs("div",{children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Additional Metadata"}),r.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2",children:r.jsx("ul",{className:"space-y-1",children:Object.entries(e.pyproject.custom_metadata).map(([a,o])=>r.jsxs("li",{className:"text-sm text-gray-700 dark:text-gray-300 flex",children:[r.jsxs("strong",{className:"font-medium w-1/3 min-w-[100px] flex-shrink-0 text-gray-600 dark:text-gray-200 break-words",children:[a,":"]}),r.jsx("span",{className:"text-gray-600 dark:text-gray-400 break-words",children:String(o)})]},a))})})]}),e.agent_card?r.jsxs("div",{children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Agent Card Details"}),r.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2",children:[e.agent_card.displayName&&r.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[r.jsx("strong",{className:"font-medium text-gray-700 dark:text-gray-200",children:"Display Name:"})," ",e.agent_card.displayName]}),e.agent_card.shortDescription&&r.jsxs("p",{className:"text-sm mt-1 text-gray-600 dark:text-gray-300",children:[r.jsx("strong",{className:"font-medium text-gray-700 dark:text-gray-200",children:"Card Description:"})," ",e.agent_card.shortDescription]}),e.agent_card.Skill&&e.agent_card.Skill.length>0&&r.jsxs("div",{className:"mt-2.5",children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200 mb-1",children:"Skills:"}),s(e.agent_card.Skill)]}),!e.agent_card.displayName&&!e.agent_card.shortDescription&&(!e.agent_card.Skill||e.agent_card.Skill.length===0)&&r.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No specific agent card details provided."})]})]}):r.jsxs("div",{className:"p-3 bg-gray-100 dark:bg-gray-700/30 rounded-md border border-gray-200 dark:border-gray-600",children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1",children:"Agent Card Details"}),r.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No agent card data available for this plugin."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"README"}),e.readme_content?r.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2 text-gray-700 dark:text-gray-200",children:r.jsx(Fc,{children:e.readme_content})}):r.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No README content available."})]}),r.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 pt-3 border-t border-gray-200 dark:border-gray-600 space-y-1",children:[r.jsxs("p",{children:[r.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Source:"})," ",e.source_registry_name||"Unnamed Registry"," (",e.source_type,")"]}),r.jsxs("p",{children:[r.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Location:"})," ",e.source_type==="git"?r.jsx("a",{href:e.source_registry_location,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline break-all",children:e.source_registry_location}):r.jsx("span",{className:"break-all",children:e.source_registry_location})]}),r.jsxs("p",{children:[r.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Plugin Subpath:"})," ",e.plugin_subpath]})]})]}),r.jsxs("div",{className:"mt-auto p-4 border-t border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 flex justify-end space-x-3",children:[r.jsx(ur,{onClick:n,variant:"default",children:"Close"}),r.jsx(ur,{onClick:()=>i(e),variant:"primary",children:"Install"})]})]})})},dr=({variant:e="default",className:t,children:n,...i})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-600 hover:bg-green-700 text-white dark:bg-green-500 dark:hover:bg-green-600";let l="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"&&(l=a),r.jsx("button",{...i,className:`${s} ${l} ${t||""}`.trim(),children:n})},Bc=({className:e,...t})=>r.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),qc=({className:e,children:t,...n})=>r.jsx("label",{...n,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1 ${e||""}`,children:t}),Uc=({pluginName:e,isOpen:t,onClose:n,onInstall:i,isLoading:s=!1})=>{const[a,o]=j.useState(""),[l,u]=j.useState(null);if(!t)return null;const c=()=>{o(""),u(null),n()},d=async m=>{m.preventDefault();const h=a.trim();if(!h){u("Component name is required.");return}if(!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(h)){u("Component name must start with a letter and can only contain letters, numbers, hyphens (-), and underscores (_).");return}u(null),await i(h)};return r.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"installModalTitle",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",children:r.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-md w-full p-6",children:[r.jsxs("div",{className:"flex justify-between items-center pb-3 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 -m-6 p-4 rounded-t-lg mb-4",children:[r.jsxs("h2",{id:"installModalTitle",className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:["Install Plugin: ",r.jsx("span",{className:"font-bold",children:e})]}),r.jsx("button",{onClick:c,disabled:s,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsxs("form",{onSubmit:d,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(qc,{htmlFor:"componentName",children:"Component Name:"}),r.jsx(Bc,{type:"text",id:"componentName",value:a,onChange:m=>{o(m.target.value),l&&u(null)},placeholder:"e.g., my-new-plugin",disabled:s,required:!0}),l&&r.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:l}),r.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"This name will be used for the component configuration file."})]}),r.jsxs("div",{className:"mt-6 flex justify-end space-x-3 pt-4 border-t border-gray-200 dark:border-gray-600",children:[r.jsx(dr,{type:"button",onClick:c,disabled:s,variant:"default",children:"Cancel"}),r.jsx(dr,{type:"submit",disabled:s||!a.trim(),variant:"primary",children:s?"Installing...":"Install Plugin"})]})]})]})})},mr=({variant:e="default",className:t,children:n,...i})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-blue-600 hover:bg-blue-700 text-white dark:bg-blue-500 dark:hover:bg-blue-600";let l="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"&&(l=a),r.jsx("button",{...i,className:`${s} ${l} ${t||""}`.trim(),children:n})},pr=({className:e,...t})=>r.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),hr=({className:e,children:t,...n})=>r.jsx("label",{...n,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1 ${e||""}`,children:t}),Hc=({isOpen:e,onClose:t,onAddRegistry:n,isLoading:i=!1})=>{const[s,a]=j.useState(""),[o,l]=j.useState(""),[u,c]=j.useState(null);if(!e)return null;const d=async h=>{h.preventDefault();const p=s.trim(),w=o.trim();if(!p){c("Registry Path or URL is required.");return}c(null),await n(p,w===""?void 0:w)},m=()=>{a(""),l(""),c(null),t()};return r.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"addRegistryModalTitle",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",children:r.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-md w-full p-6",children:[r.jsxs("div",{className:"flex justify-between items-center pb-3 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 -m-6 p-4 rounded-t-lg mb-4",children:[r.jsx("h2",{id:"addRegistryModalTitle",className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:"Add New Plugin Registry"}),r.jsx("button",{onClick:m,disabled:i,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsxs("form",{onSubmit:d,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx(hr,{htmlFor:"registryPathOrUrl",children:"Registry Path or URL:"}),r.jsx(pr,{type:"text",id:"registryPathOrUrl",value:s,onChange:h=>{a(h.target.value),u&&c(null)},placeholder:"https://github.com/user/plugins.git or /path/to/local/plugins",disabled:i,required:!0}),u&&r.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:u}),r.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Enter a Git URL (HTTPS/Git) or an absolute local filesystem path."})]}),r.jsxs("div",{children:[r.jsx(hr,{htmlFor:"registryName",children:"Registry Name (Optional):"}),r.jsx(pr,{type:"text",id:"registryName",value:o,onChange:h=>l(h.target.value),placeholder:"My Custom Plugins",disabled:i}),r.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"An optional name for this registry. If blank, a name will be derived."})]}),r.jsxs("div",{className:"mt-6 flex justify-end space-x-3 pt-4 border-t border-gray-200 dark:border-gray-600",children:[r.jsx(mr,{type:"button",onClick:m,disabled:i,variant:"default",children:"Cancel"}),r.jsx(mr,{type:"submit",disabled:i||!s.trim(),variant:"primary",children:i?"Adding...":"Add Registry"})]})]})]})})},fr=({variant:e="default",className:t,children:n,...i})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-600 hover:bg-green-700 text-white dark:bg-green-500 dark:hover:bg-green-600",o="bg-indigo-600 hover:bg-indigo-700 text-white dark:bg-indigo-500 dark:hover:bg-indigo-600";let u="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-700 dark:hover:bg-gray-600 dark:text-gray-100";return e==="primary"?u=a:e==="secondary"&&(u=o),r.jsx("button",{...i,className:`${s} ${u} ${t||""}`,children:n})},Vc=({className:e,...t})=>r.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),Wc=({className:e,children:t,...n})=>r.jsx("select",{...n,className:`flex h-10 rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`,children:t}),gr=()=>r.jsx("div",{className:"w-5 h-5 border-2 border-current border-t-transparent rounded-full animate-spin"}),xr=({variant:e,title:t,description:n,className:i})=>r.jsxs("div",{role:"alert",className:`relative w-full rounded-lg border p-4 ${e==="destructive"?"bg-red-50 dark:bg-red-900/30 border-red-500/50 text-red-700 dark:text-red-300":"bg-green-50 dark:bg-green-900/30 border-green-500/50 text-green-700 dark:text-green-300"} ${i||""}`,children:[t&&r.jsx("h5",{className:"mb-1 font-semibold leading-none tracking-tight",children:t}),r.jsx("div",{className:"text-sm opacity-90",children:n})]}),Gc=()=>{const[e,t]=j.useState([]),[n,i]=j.useState([]),[,s]=j.useState([]),[a,o]=j.useState(""),[l,u]=j.useState("all"),[c,d]=j.useState(!0),[m,h]=j.useState(null),[p,w]=j.useState(null),[v,N]=j.useState(null),[f,b]=j.useState(!1),[k,M]=j.useState(null),[L,_]=j.useState(!1),[I,D]=j.useState(!1),O=j.useCallback(async(z=!0)=>{z&&d(!0),h(null);try{const U=await fetch("/api/plugin_catalog/plugins");if(!U.ok)throw new Error(`Failed to fetch plugins: ${U.statusText} (${U.status})`);const $=await U.json();t($),i($)}catch(U){const $=U instanceof Error?U.message:String(U);h($),y("destructive",$)}finally{z&&d(!1)}},[]),q=j.useCallback(async()=>{try{const z=await fetch("/api/plugin_catalog/registries");if(!z.ok)throw new Error("Failed to fetch registries");const U=await z.json();s(U)}catch(z){const U=z instanceof Error?z.message:String(z);console.error("Failed to fetch registries:",U)}},[]);j.useEffect(()=>{O(),q()},[O,q]),j.useEffect(()=>{const z=a.toLowerCase();i(e.filter(U=>{var le;const $=U.pyproject.name.toLowerCase().includes(z)||U.pyproject.description&&U.pyproject.description.toLowerCase().includes(z),g=((le=U.pyproject.plugin_type)==null?void 0:le.toLowerCase())||"custom";return $&&(l==="all"||l==="agents"&&g==="agent"||l==="gateways"&&g==="gateway"||l==="tools"&&g==="tool"||l==="custom"&&g==="custom")}))},[a,l,e]);const y=(z,U)=>{w({type:z,message:U}),setTimeout(()=>w(null),7e3)},C=z=>{N(z),b(!0)},T=z=>{M(z),_(!0)},R=async z=>{if(k){d(!0);try{const U=await fetch("/api/plugin_catalog/plugins/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pluginId:k.id,componentName:z})}),$=await U.json();if(!U.ok||$.status==="failure")throw new Error($.error||"Installation failed");y("success",$.message||"Plugin installed successfully!")}catch(U){const $=U instanceof Error?U.message:String(U);y("destructive",$)}finally{d(!1),_(!1),M(null)}}},B=async()=>{d(!0),h(null);try{const z=await fetch("/api/plugin_catalog/registries/refresh",{method:"POST"}),U=await z.json();if(!z.ok||U.status!=="success")throw new Error(U.message||"Failed to refresh registries");y("success",U.message),await O(!1)}catch(z){const U=z instanceof Error?z.message:String(z);h(U),y("destructive",U)}finally{d(!1)}},V=async(z,U)=>{d(!0);try{const $={path_or_url:z};U&&U.trim()!==""&&($.name=U.trim());const g=await fetch("/api/plugin_catalog/registries",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)}),ne=await g.json();if(!g.ok||ne.status!=="success")throw new Error(ne.error||"Failed to add registry");y("success",ne.message),await q(),await O(!1),D(!1)}catch($){const g=$ instanceof Error?$.message:String($);y("destructive",g)}finally{d(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-gray-100 dark:bg-gray-900 overflow-auto",children:r.jsxs("div",{className:"p-4 md:p-6 lg:p-8",children:[r.jsx("header",{className:"mb-8",children:r.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-gray-800 dark:text-gray-100",children:"SAM Plugin Catalog"})}),p&&r.jsx(xr,{variant:p.type,description:p.message,className:"mb-6"}),m&&!p&&r.jsx(xr,{variant:"destructive",title:"Error",description:m,className:"mb-6"}),r.jsx("div",{className:"mb-8 p-4 bg-white dark:bg-gray-800 shadow-md rounded-lg",children:r.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:flex-grow",children:[r.jsx(Vc,{type:"text",placeholder:"Search plugins by name or description...",value:a,onChange:z=>o(z.target.value),className:"w-full sm:flex-grow"}),r.jsxs(Wc,{value:l,onChange:z=>u(z.target.value),className:"w-full sm:w-auto sm:min-w-[140px]",children:[r.jsx("option",{value:"all",children:"All Types"}),r.jsx("option",{value:"agents",children:"Agents"}),r.jsx("option",{value:"gateways",children:"Gateways"}),r.jsx("option",{value:"tools",children:"Tools"}),r.jsx("option",{value:"custom",children:"Custom"})]})]}),r.jsxs("div",{className:"flex gap-3 flex-shrink-0",children:[r.jsx(fr,{onClick:()=>D(!0),variant:"primary",children:"+ Add Registry"}),r.jsx(fr,{onClick:B,disabled:c&&e.length===0,variant:"secondary",children:c&&e.length===0?r.jsx(gr,{}):"Refresh All"})]})]})}),c&&e.length===0&&r.jsxs("div",{className:"flex flex-col justify-center items-center mt-12 h-64 text-gray-500 dark:text-gray-400",children:[r.jsx(gr,{}),r.jsx("p",{className:"ml-3 mt-3 text-lg",children:"Loading plugins..."})]}),!c&&e.length>0&&n.length===0&&a&&r.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mt-12 text-lg",children:"No plugins found matching your search criteria."}),!c&&e.length===0&&!m&&r.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mt-12 text-lg",children:'No plugins found. Try adding a new registry or click "Refresh All".'}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:n.map(z=>r.jsx(hs,{plugin:z,onReadMore:()=>C(z),onInstall:()=>T(z)},z.id))}),f&&v&&r.jsx(Dc,{plugin:v,isOpen:f,onClose:()=>b(!1),onInstall:T}),L&&k&&r.jsx(Uc,{pluginName:k.pyproject.name,isOpen:L,onClose:()=>_(!1),onInstall:R,isLoading:c}),I&&r.jsx(Hc,{isOpen:I,onClose:()=>D(!1),onAddRegistry:V,isLoading:c})]})})},$c=({data:e,updateData:t,onNext:n})=>{const i=a=>{t({[a.target.name]:a.target.value})},s=e.gateway_name_input&&e.namespace&&e.gateway_id;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Gateway Name",htmlFor:"gateway_name_input",required:!0,helpText:"A unique name for your gateway. Will be used for directory and class naming (e.g., my_cool_gateway, MyCoolGateway).",children:r.jsx(H,{id:"gateway_name_input",name:"gateway_name_input",value:e.gateway_name_input||"",onChange:i,placeholder:"e.g., custom-monitor",required:!0})}),r.jsx(P,{label:"A2A Namespace",htmlFor:"namespace",required:!0,helpText:"The namespace this gateway will operate under.",children:r.jsx(H,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:i,placeholder:"e.g., myorg/dev or ${NAMESPACE}",required:!0})}),r.jsx(P,{label:"Gateway ID",htmlFor:"gateway_id",required:!0,helpText:"A unique identifier for this gateway instance.",children:r.jsx(H,{id:"gateway_id",name:"gateway_id",value:e.gateway_id||"",onChange:i,placeholder:"e.g., custom-monitor-gateway-gw-01",required:!0})}),r.jsx("div",{className:"flex justify-end mt-8",children:r.jsx("button",{type:"button",onClick:n,disabled:!s,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})})]})},Yc=[{value:"use_default_shared_artifact",label:"Use Default Shared Artifact Service"},{value:"memory",label:"Memory"},{value:"filesystem",label:"Filesystem"},{value:"gcs",label:"Google Cloud Storage (GCS)"},{value:"s3",label:"Amazon S3 Compatible"}],Jc=[{value:"namespace",label:"Namespace"},{value:"app",label:"Application (Gateway ID specific)"},{value:"custom",label:"Custom (requires specific GDK handling)"}],Xc=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=c=>{const{name:d,value:m}=c.target;t({[d]:m}),d==="artifact_service_type"&&(m!=="filesystem"&&t({artifact_service_base_path:void 0}),m!=="s3"&&t({s3_bucket_name:void 0,s3_endpoint_url:void 0,s3_region:void 0}))},a=e.artifact_service_type&&e.artifact_service_type!=="use_default_shared_artifact",o=e.artifact_service_type==="filesystem",l=e.artifact_service_type==="s3";let u=!0;return a&&(e.artifact_service_scope||(u=!1),o&&!e.artifact_service_base_path&&(u=!1),l&&(e.s3_bucket_name||(u=!1),e.s3_region||(u=!1))),r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Artifact Service Type",htmlFor:"artifact_service_type",helpText:"Determines how gateway artifacts are stored and managed.",children:r.jsx(ae,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||"",onChange:s,options:Yc})}),a&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:a,helpText:"Scope for the custom artifact service.",children:r.jsx(ae,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"",onChange:s,options:Jc,required:a})}),o&&r.jsx(P,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:o,helpText:"Base directory path if 'Filesystem' type is selected.",children:r.jsx(H,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"",onChange:s,placeholder:"/tmp/samv2",required:o})}),l&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"S3 Bucket Name",htmlFor:"s3_bucket_name",required:l,helpText:"Name of the S3 bucket to store artifacts.",children:r.jsx(H,{id:"s3_bucket_name",name:"s3_bucket_name",value:e.s3_bucket_name||"",onChange:s,placeholder:"my-artifacts-bucket",required:l})}),r.jsx(P,{label:"S3 Endpoint URL",htmlFor:"s3_endpoint_url",helpText:"S3 endpoint URL (leave empty for AWS S3, required for S3-compatible services like MinIO).",children:r.jsx(H,{id:"s3_endpoint_url",name:"s3_endpoint_url",value:e.s3_endpoint_url||"",onChange:s,placeholder:"https://s3.amazonaws.com or https://minio.example.com"})}),r.jsx(P,{label:"S3 Region",htmlFor:"s3_region",required:l,helpText:"AWS region or S3-compatible service region.",children:r.jsx(H,{id:"s3_region",name:"s3_region",value:e.s3_region||"",onChange:s,placeholder:"us-east-1",required:l})})]})]}),r.jsxs("div",{className:"flex justify-between mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,disabled:!u,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})]})]})},Qc=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=a=>{t({[a.target.name]:a.target.value})};return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"System Purpose",htmlFor:"system_purpose",helpText:"Define the overall purpose and persona of the gateway.",children:r.jsx("textarea",{id:"system_purpose",name:"system_purpose",value:e.system_purpose||"",onChange:s,rows:6,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"e.g., The system is an AI Chatbot..."})}),r.jsx(P,{label:"Response Format",htmlFor:"response_format",helpText:"Define how the gateway should format its responses.",children:r.jsx("textarea",{id:"response_format",name:"response_format",value:e.response_format||"",onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"e.g., Responses should be clear, concise..."})}),r.jsxs("div",{className:"flex justify-between mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,disabled:!1,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})]})]})},Kc=({data:e,onPrevious:t,onSubmit:n,isLoading:i})=>r.jsxs("div",{className:"space-y-6",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Review Gateway Configuration"}),r.jsx("div",{className:"bg-white shadow-sm rounded-lg p-6 border border-gray-200",children:r.jsxs("dl",{className:"divide-y divide-gray-200",children:[r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Gateway Name"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.gateway_name_input||"-"})]}),r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"A2A Namespace"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.namespace||"-"})]}),r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Gateway ID"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.gateway_id||"-"})]}),r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Type"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_type||"-"})]}),e.artifact_service_type&&e.artifact_service_type!=="use_default_shared_artifact"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Scope"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_scope||"-"})]}),e.artifact_service_type==="filesystem"&&r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Base Path"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_base_path||"-"})]})]}),r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"System Purpose"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:r.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:e.system_purpose||"-"})})]}),r.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[r.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Response Format"}),r.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:r.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:e.response_format||"-"})})]})]})}),r.jsxs("div",{className:"flex justify-between mt-8",children:[r.jsx("button",{type:"button",onClick:t,disabled:i,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 disabled:opacity-50",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,disabled:i,className:"px-6 py-2 bg-solace-green text-white rounded-md hover:bg-solace-green-dark focus:outline-none focus:ring-2 focus:ring-solace-green focus:ring-opacity-50 disabled:opacity-50",children:i?"Creating Gateway...":"Create Gateway"})]})]}),Ye=[{id:"basicInfo",title:"Basic Information",description:"Enter the core details for your new gateway.",component:$c},{id:"artifactConfig",title:"Artifact Service",description:"Configure how artifacts are stored and managed.",component:Xc},{id:"responseCustomization",title:"Response Customization",description:"Define the gateway's system purpose and response format.",component:Qc},{id:"review",title:"Review & Create",description:"Review your gateway configuration before creation.",component:Kc}],Zc=()=>{var N;const[e,t]=j.useState(0),[n,i]=j.useState({}),[s,a]=j.useState(!0),[o,l]=j.useState(null),[u,c]=j.useState(!1),d="http://localhost:5002";j.useEffect(()=>{a(!0),fetch(`${d}/api/form_schema?type=gateway`).then(f=>{if(!f.ok)throw new Error(`HTTP error! status: ${f.status}`);return f.json()}).then(f=>{if(f.status==="success"&&f.defaults)i({...f.defaults,gateway_name_input:f.defaults.gateway_name_input||""}),l(null);else throw new Error(f.message||"Failed to load gateway defaults.")}).catch(f=>{console.error("Error fetching gateway schema:",f),l(f.message||"Could not fetch gateway configuration defaults."),i({})}).finally(()=>a(!1))},[d]);const m=j.useCallback(f=>{i(b=>({...b,...f}))},[]),h=j.useCallback(()=>{e<Ye.length-1?t(f=>f+1):w()},[e,Ye.length]),p=j.useCallback(()=>{e>0&&t(f=>f-1)},[e]),w=async()=>{a(!0),l(null);try{const f=await fetch(`${d}/api/save_gateway_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gateway_name_input:n.gateway_name_input||n.name||"DefaultGatewayName",config:n})}),b=await f.json();if(f.ok&&b.status==="success")c(!0),setTimeout(()=>{fetch(`${d}/api/shutdown`,{method:"POST"}).catch(k=>console.error("Error shutting down server:",k))},3e3);else throw new Error(b.message||"Failed to save gateway configuration.")}catch(f){console.error("Error submitting gateway config:",f),f instanceof Error?l(f.message):l("An unexpected error occurred during submission.")}finally{a(!1)}};if(u)return r.jsx(Zt,{title:"Gateway Created!",message:"Your new gateway configuration has been saved. The CLI will now generate the necessary files."});if(s&&!Object.keys(n).length)return r.jsx("div",{className:"text-center p-8",children:"Loading gateway configuration..."});if(o)return r.jsxs("div",{className:"text-center p-8 text-red-600",children:["Error: ",o]});const v=(N=Ye[e])==null?void 0:N.component;return r.jsxs("div",{className:"p-4",children:[r.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center text-gray-700",children:"Add New Gateway"}),r.jsx(Kt,{steps:Ye,currentStepIndex:e}),r.jsx("div",{className:"mt-6 bg-gray-50 p-6 rounded-lg shadow min-h-[300px]",children:v?r.jsx(v,{data:n,updateData:m,onNext:h,onPrevious:p,onSubmit:w,isLoading:s&&e===Ye.length-1}):r.jsx("p",{className:"text-center",children:"End of flow or step not found."})}),o&&r.jsx("p",{className:"mt-4 text-sm text-red-500 text-center",children:o})]})},nu=()=>[{title:"Solace Agent Mesh - Config Portal"},{name:"description",content:"Initialize your Solace Agent Mesh project or add new components."}];function ru(){const[e,t]=j.useState("initialize"),[n]=di();return j.useEffect(()=>{const i=n.get("config_mode");t(i==="addAgent"?"addAgent":i==="pluginCatalog"?"pluginCatalog":i==="addGateway"?"addGateway":"initialize")},[n]),r.jsx("div",{className:"min-h-screen bg-gray-100 py-8 px-4",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsx("div",{className:"mb-8 text-center",children:r.jsx("h1",{className:"text-3xl font-bold text-solace-purple",children:"Solace Agent Mesh Configuration Portal"})}),r.jsxs("div",{className:"bg-white shadow-xl rounded-lg p-6 md:p-8 min-h-[500px]",children:[e==="initialize"&&r.jsx(Fi,{}),e==="addAgent"&&r.jsx(Yi,{}),e==="pluginCatalog"&&r.jsx(Gc,{}),e==="addGateway"&&r.jsx(Zc,{})]}),r.jsx("footer",{className:"mt-12 text-center text-sm text-gray-500",children:r.jsxs("p",{children:["© ",new Date().getFullYear()," Solace Agent Mesh. All rights reserved."]})})]})})}export{ru as default,nu as meta};