solace-agent-mesh 1.6.3__py3-none-any.whl → 1.7.1__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 (244) hide show
  1. solace_agent_mesh/agent/adk/adk_llm.txt +12 -18
  2. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +1 -1
  3. solace_agent_mesh/agent/adk/callbacks.py +138 -20
  4. solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +2 -0
  5. solace_agent_mesh/agent/adk/models/lite_llm.py +38 -5
  6. solace_agent_mesh/agent/adk/models/models_llm.txt +82 -35
  7. solace_agent_mesh/agent/adk/runner.py +9 -0
  8. solace_agent_mesh/agent/adk/stream_parser.py +6 -1
  9. solace_agent_mesh/agent/adk/tool_wrapper.py +3 -0
  10. solace_agent_mesh/agent/agent_llm.txt +61 -70
  11. solace_agent_mesh/agent/protocol/event_handlers.py +29 -1
  12. solace_agent_mesh/agent/protocol/protocol_llm.txt +1 -1
  13. solace_agent_mesh/agent/proxies/a2a/a2a_llm.txt +190 -0
  14. solace_agent_mesh/agent/proxies/base/base_llm.txt +148 -0
  15. solace_agent_mesh/agent/proxies/proxies_llm.txt +283 -0
  16. solace_agent_mesh/agent/sac/app.py +22 -0
  17. solace_agent_mesh/agent/sac/component.py +76 -40
  18. solace_agent_mesh/agent/sac/sac_llm.txt +1 -1
  19. solace_agent_mesh/agent/sac/task_execution_context.py +21 -0
  20. solace_agent_mesh/agent/testing/testing_llm.txt +2 -1
  21. solace_agent_mesh/agent/tools/builtin_artifact_tools.py +13 -148
  22. solace_agent_mesh/agent/tools/dynamic_tool.py +2 -0
  23. solace_agent_mesh/agent/tools/tools_llm.txt +93 -80
  24. solace_agent_mesh/agent/tools/tools_llm_detail.txt +3 -2
  25. solace_agent_mesh/agent/utils/artifact_helpers.py +4 -0
  26. solace_agent_mesh/agent/utils/utils_llm.txt +16 -2
  27. solace_agent_mesh/assets/docs/404.html +3 -3
  28. solace_agent_mesh/assets/docs/assets/js/05749d90.c70b2be9.js +1 -0
  29. solace_agent_mesh/assets/docs/assets/js/15ba94aa.92fea363.js +1 -0
  30. solace_agent_mesh/assets/docs/assets/js/15e40e79.36003774.js +1 -0
  31. solace_agent_mesh/assets/docs/assets/js/2987107d.a80604f9.js +1 -0
  32. solace_agent_mesh/assets/docs/assets/js/3ac1795d.e4870a49.js +1 -0
  33. solace_agent_mesh/assets/docs/assets/js/3ff0015d.b63ee53a.js +1 -0
  34. solace_agent_mesh/assets/docs/assets/js/547e15cc.2f7790c1.js +1 -0
  35. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.45b32c2b.js +1 -0
  36. solace_agent_mesh/assets/docs/assets/js/631738c7.fa471607.js +1 -0
  37. solace_agent_mesh/assets/docs/assets/js/64195356.c498c4d0.js +1 -0
  38. solace_agent_mesh/assets/docs/assets/js/6a520c9d.b6e3f2ce.js +1 -0
  39. solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.a5b36a60.js +1 -0
  40. solace_agent_mesh/assets/docs/assets/js/71da7b71.374b9d54.js +1 -0
  41. solace_agent_mesh/assets/docs/assets/js/8024126c.fa0e7186.js +1 -0
  42. solace_agent_mesh/assets/docs/assets/js/8b032486.91a91afc.js +1 -0
  43. solace_agent_mesh/assets/docs/assets/js/94e8668d.09ed9234.js +1 -0
  44. solace_agent_mesh/assets/docs/assets/js/{ab9708a8.3e6dd091.js → ab9708a8.245ae0ef.js} +1 -1
  45. solace_agent_mesh/assets/docs/assets/js/ad87452a.9d73dad6.js +1 -0
  46. solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.f902fad8.js +1 -0
  47. solace_agent_mesh/assets/docs/assets/js/da0b5bad.b62f7b08.js +1 -0
  48. solace_agent_mesh/assets/docs/assets/js/db5d6442.3daf1696.js +1 -0
  49. solace_agent_mesh/assets/docs/assets/js/dd817ffc.c37a755e.js +1 -0
  50. solace_agent_mesh/assets/docs/assets/js/dd81e2b8.b682e9c2.js +1 -0
  51. solace_agent_mesh/assets/docs/assets/js/de915948.44a432bc.js +1 -0
  52. solace_agent_mesh/assets/docs/assets/js/e04b235d.c9c50c7b.js +1 -0
  53. solace_agent_mesh/assets/docs/assets/js/e3d9abda.d11c67a7.js +1 -0
  54. solace_agent_mesh/assets/docs/assets/js/{e6f9706b.e74a984d.js → e6f9706b.045d0fa1.js} +1 -1
  55. solace_agent_mesh/assets/docs/assets/js/e92d0134.3bda61dd.js +1 -0
  56. solace_agent_mesh/assets/docs/assets/js/f284c35a.5099c51e.js +1 -0
  57. solace_agent_mesh/assets/docs/assets/js/ff4d71f2.74710fc1.js +1 -0
  58. solace_agent_mesh/assets/docs/assets/js/main.f213fe0c.js +2 -0
  59. solace_agent_mesh/assets/docs/assets/js/runtime~main.d9606d6a.js +1 -0
  60. solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +4 -4
  61. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +4 -4
  62. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +4 -4
  63. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +4 -4
  64. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +18 -4
  65. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +4 -4
  66. solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +4 -4
  67. solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +5 -5
  68. solace_agent_mesh/assets/docs/docs/documentation/components/index.html +4 -4
  69. solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +4 -4
  70. solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +4 -4
  71. solace_agent_mesh/assets/docs/docs/documentation/components/projects/index.html +196 -0
  72. solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +4 -4
  73. solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +5 -5
  74. solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +6 -7
  75. solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +4 -4
  76. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes-deployment/index.html +47 -0
  77. solace_agent_mesh/assets/docs/docs/documentation/deploying/logging/index.html +4 -4
  78. solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +4 -4
  79. solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +4 -4
  80. solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +160 -169
  81. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +4 -4
  82. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +4 -4
  83. solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +4 -4
  84. solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +4 -4
  85. solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +4 -4
  86. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +4 -4
  87. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +5 -5
  88. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +4 -4
  89. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +4 -4
  90. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +4 -4
  91. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +4 -4
  92. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +4 -4
  93. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +4 -4
  94. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +4 -4
  95. solace_agent_mesh/assets/docs/docs/documentation/enterprise/agent-builder/index.html +59 -0
  96. solace_agent_mesh/assets/docs/docs/documentation/enterprise/connectors/index.html +62 -0
  97. solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +10 -6
  98. solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +4 -4
  99. solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +4 -4
  100. solace_agent_mesh/assets/docs/docs/documentation/enterprise/secure-user-delegated-access/index.html +440 -0
  101. solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +27 -4
  102. solace_agent_mesh/assets/docs/docs/documentation/enterprise/wheel-installation/index.html +62 -0
  103. solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +4 -4
  104. solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +5 -4
  105. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
  106. solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +3 -3
  107. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/artifact-storage/index.html +290 -0
  108. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +9 -9
  109. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +4 -4
  110. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +4 -4
  111. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +4 -4
  112. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +4 -4
  113. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/session-storage/index.html +251 -0
  114. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/user-feedback/index.html +88 -0
  115. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
  116. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +3 -3
  117. solace_agent_mesh/assets/docs/lunr-index-1762283454666.json +1 -0
  118. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  119. solace_agent_mesh/assets/docs/search-doc-1762283454666.json +1 -0
  120. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  121. solace_agent_mesh/assets/docs/sitemap.xml +1 -1
  122. solace_agent_mesh/cli/__init__.py +1 -1
  123. solace_agent_mesh/cli/commands/docs_cmd.py +4 -1
  124. solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +1 -1
  125. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-D4_RMYRh.js → authCallback-tcIFZLis.js} +1 -1
  126. solace_agent_mesh/client/webui/frontend/static/assets/{client-UZ3qU6Bq.js → client-CRYdKo2Q.js} +3 -3
  127. solace_agent_mesh/client/webui/frontend/static/assets/main-CojeY_1w.css +1 -0
  128. solace_agent_mesh/client/webui/frontend/static/assets/main-ILja9MCG.js +353 -0
  129. solace_agent_mesh/client/webui/frontend/static/assets/vendor-CINwxvwV.js +470 -0
  130. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
  131. solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
  132. solace_agent_mesh/common/a2a/a2a_llm.txt +13 -20
  133. solace_agent_mesh/common/a2a/protocol.py +5 -0
  134. solace_agent_mesh/common/a2a/types.py +1 -0
  135. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +49 -11
  136. solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +23 -6
  137. solace_agent_mesh/common/a2a_spec/schemas/feedback_event.json +51 -0
  138. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +26 -9
  139. solace_agent_mesh/common/common_llm.txt +13 -34
  140. solace_agent_mesh/common/data_parts.py +20 -4
  141. solace_agent_mesh/common/middleware/middleware_llm.txt +1 -1
  142. solace_agent_mesh/common/sac/sac_llm.txt +1 -1
  143. solace_agent_mesh/common/sam_events/sam_events_llm.txt +1 -1
  144. solace_agent_mesh/common/services/employee_service.py +1 -1
  145. solace_agent_mesh/common/services/providers/providers_llm.txt +3 -2
  146. solace_agent_mesh/common/services/services_llm.txt +9 -4
  147. solace_agent_mesh/common/utils/embeds/constants.py +1 -0
  148. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +1 -1
  149. solace_agent_mesh/common/utils/embeds/modifiers.py +2 -1
  150. solace_agent_mesh/common/utils/embeds/resolver.py +58 -6
  151. solace_agent_mesh/common/utils/embeds/types.py +8 -0
  152. solace_agent_mesh/common/utils/utils_llm.txt +5 -6
  153. solace_agent_mesh/core_a2a/core_a2a_llm.txt +1 -1
  154. solace_agent_mesh/gateway/adapter/__init__.py +1 -0
  155. solace_agent_mesh/gateway/adapter/base.py +143 -0
  156. solace_agent_mesh/gateway/adapter/types.py +221 -0
  157. solace_agent_mesh/gateway/base/app.py +29 -2
  158. solace_agent_mesh/gateway/base/base_llm.txt +10 -8
  159. solace_agent_mesh/gateway/base/component.py +573 -142
  160. solace_agent_mesh/gateway/gateway_llm.txt +55 -59
  161. solace_agent_mesh/gateway/generic/__init__.py +1 -0
  162. solace_agent_mesh/gateway/generic/app.py +50 -0
  163. solace_agent_mesh/gateway/generic/component.py +650 -0
  164. solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +99 -49
  165. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_fulltext_search_indexes.py +92 -0
  166. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_project_users_table.py +72 -0
  167. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_soft_delete_and_search.py +150 -0
  168. solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_default_agent_to_projects.py +26 -0
  169. solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_projects_table.py +135 -0
  170. solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +26 -20
  171. solace_agent_mesh/gateway/http_sse/app.py +0 -14
  172. solace_agent_mesh/gateway/http_sse/component.py +17 -56
  173. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +1 -1
  174. solace_agent_mesh/gateway/http_sse/dependencies.py +21 -3
  175. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +8 -8
  176. solace_agent_mesh/gateway/http_sse/main.py +23 -5
  177. solace_agent_mesh/gateway/http_sse/repository/__init__.py +19 -1
  178. solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +56 -98
  179. solace_agent_mesh/gateway/http_sse/repository/entities/project.py +81 -0
  180. solace_agent_mesh/gateway/http_sse/repository/entities/project_user.py +47 -0
  181. solace_agent_mesh/gateway/http_sse/repository/entities/session.py +23 -1
  182. solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +47 -0
  183. solace_agent_mesh/gateway/http_sse/repository/interfaces.py +112 -4
  184. solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +9 -1
  185. solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +51 -60
  186. solace_agent_mesh/gateway/http_sse/repository/models/project_model.py +51 -0
  187. solace_agent_mesh/gateway/http_sse/repository/models/project_user_model.py +75 -0
  188. solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +7 -1
  189. solace_agent_mesh/gateway/http_sse/repository/project_repository.py +172 -0
  190. solace_agent_mesh/gateway/http_sse/repository/project_user_repository.py +186 -0
  191. solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +125 -157
  192. solace_agent_mesh/gateway/http_sse/repository/session_repository.py +269 -8
  193. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +143 -51
  194. solace_agent_mesh/gateway/http_sse/routers/config.py +69 -0
  195. solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +198 -94
  196. solace_agent_mesh/gateway/http_sse/routers/dto/requests/project_requests.py +48 -0
  197. solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +68 -18
  198. solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +13 -0
  199. solace_agent_mesh/gateway/http_sse/routers/dto/responses/project_responses.py +30 -0
  200. solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +51 -35
  201. solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +2 -0
  202. solace_agent_mesh/gateway/http_sse/routers/feedback.py +133 -2
  203. solace_agent_mesh/gateway/http_sse/routers/projects.py +542 -0
  204. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +9 -11
  205. solace_agent_mesh/gateway/http_sse/routers/sessions.py +154 -3
  206. solace_agent_mesh/gateway/http_sse/routers/tasks.py +296 -4
  207. solace_agent_mesh/gateway/http_sse/services/project_service.py +403 -0
  208. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +16 -10
  209. solace_agent_mesh/gateway/http_sse/services/session_service.py +178 -6
  210. solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +2 -3
  211. solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +48 -14
  212. solace_agent_mesh/solace_agent_mesh_llm.txt +1 -1
  213. {solace_agent_mesh-1.6.3.dist-info → solace_agent_mesh-1.7.1.dist-info}/METADATA +3 -5
  214. {solace_agent_mesh-1.6.3.dist-info → solace_agent_mesh-1.7.1.dist-info}/RECORD +218 -175
  215. solace_agent_mesh/assets/docs/assets/js/15ba94aa.932dd2db.js +0 -1
  216. solace_agent_mesh/assets/docs/assets/js/3ac1795d.76654dd9.js +0 -1
  217. solace_agent_mesh/assets/docs/assets/js/3ff0015d.2be20244.js +0 -1
  218. solace_agent_mesh/assets/docs/assets/js/547e15cc.2cbb060a.js +0 -1
  219. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.eda4bcb2.js +0 -1
  220. solace_agent_mesh/assets/docs/assets/js/631738c7.7c4594c9.js +0 -1
  221. solace_agent_mesh/assets/docs/assets/js/6a520c9d.ba015d81.js +0 -1
  222. solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.f4b15f3b.js +0 -1
  223. solace_agent_mesh/assets/docs/assets/js/71da7b71.ddbdfbe2.js +0 -1
  224. solace_agent_mesh/assets/docs/assets/js/8024126c.56e59919.js +0 -1
  225. solace_agent_mesh/assets/docs/assets/js/94e8668d.3b883666.js +0 -1
  226. solace_agent_mesh/assets/docs/assets/js/da0b5bad.d08a9466.js +0 -1
  227. solace_agent_mesh/assets/docs/assets/js/dd817ffc.0aa9630a.js +0 -1
  228. solace_agent_mesh/assets/docs/assets/js/dd81e2b8.d590bc9e.js +0 -1
  229. solace_agent_mesh/assets/docs/assets/js/de915948.27d6b065.js +0 -1
  230. solace_agent_mesh/assets/docs/assets/js/e3d9abda.6b9493d0.js +0 -1
  231. solace_agent_mesh/assets/docs/assets/js/e92d0134.4f395c6b.js +0 -1
  232. solace_agent_mesh/assets/docs/assets/js/f284c35a.720d2ef2.js +0 -1
  233. solace_agent_mesh/assets/docs/assets/js/ff4d71f2.15b02f97.js +0 -1
  234. solace_agent_mesh/assets/docs/assets/js/main.ed05b14d.js +0 -2
  235. solace_agent_mesh/assets/docs/assets/js/runtime~main.a8a75e0b.js +0 -1
  236. solace_agent_mesh/assets/docs/lunr-index-1761744323675.json +0 -1
  237. solace_agent_mesh/assets/docs/search-doc-1761744323675.json +0 -1
  238. solace_agent_mesh/client/webui/frontend/static/assets/main--3yJYl7S.css +0 -1
  239. solace_agent_mesh/client/webui/frontend/static/assets/main-DojKHS49.js +0 -342
  240. solace_agent_mesh/client/webui/frontend/static/assets/vendor-DSqhjwq_.js +0 -405
  241. /solace_agent_mesh/assets/docs/assets/js/{main.ed05b14d.js.LICENSE.txt → main.f213fe0c.js.LICENSE.txt} +0 -0
  242. {solace_agent_mesh-1.6.3.dist-info → solace_agent_mesh-1.7.1.dist-info}/WHEEL +0 -0
  243. {solace_agent_mesh-1.6.3.dist-info → solace_agent_mesh-1.7.1.dist-info}/entry_points.txt +0 -0
  244. {solace_agent_mesh-1.6.3.dist-info → solace_agent_mesh-1.7.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,405 +0,0 @@
1
- var Zc=Object.defineProperty;var Qc=(e,t,n)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>Qc(e,typeof t!="symbol"?t+"":t,n);function Jc(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function ni(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ei={exports:{}},An={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Vo;function eu(){if(Vo)return An;Vo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var l in i)l!=="key"&&(o[l]=i[l])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:s,ref:i!==void 0?i:null,props:o}}return An.Fragment=t,An.jsx=n,An.jsxs=n,An}var Bo;function tu(){return Bo||(Bo=1,Ei.exports=eu()),Ei.exports}var _=tu(),_i={exports:{}},se={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Fo;function nu(){if(Fo)return se;Fo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),a=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function f(b){return b===null||typeof b!="object"?null:(b=d&&b[d]||b["@@iterator"],typeof b=="function"?b:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,m={};function v(b,N,L){this.props=b,this.context=N,this.refs=m,this.updater=L||h}v.prototype.isReactComponent={},v.prototype.setState=function(b,N){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,N,"setState")},v.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function w(){}w.prototype=v.prototype;function C(b,N,L){this.props=b,this.context=N,this.refs=m,this.updater=L||h}var y=C.prototype=new w;y.constructor=C,p(y,v.prototype),y.isPureReactComponent=!0;var k=Array.isArray,g={H:null,A:null,T:null,S:null,V:null},x=Object.prototype.hasOwnProperty;function S(b,N,L,V,F,Y){return L=Y.ref,{$$typeof:e,type:b,key:N,ref:L!==void 0?L:null,props:Y}}function R(b,N){return S(b.type,N,void 0,void 0,void 0,b.props)}function M(b){return typeof b=="object"&&b!==null&&b.$$typeof===e}function z(b){var N={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(L){return N[L]})}var H=/\/+/g;function I(b,N){return typeof b=="object"&&b!==null&&b.key!=null?z(""+b.key):N.toString(36)}function P(){}function E(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(P,P):(b.status="pending",b.then(function(N){b.status==="pending"&&(b.status="fulfilled",b.value=N)},function(N){b.status==="pending"&&(b.status="rejected",b.reason=N)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function j(b,N,L,V,F){var Y=typeof b;(Y==="undefined"||Y==="boolean")&&(b=null);var q=!1;if(b===null)q=!0;else switch(Y){case"bigint":case"string":case"number":q=!0;break;case"object":switch(b.$$typeof){case e:case t:q=!0;break;case u:return q=b._init,j(q(b._payload),N,L,V,F)}}if(q)return F=F(b),q=V===""?"."+I(b,0):V,k(F)?(L="",q!=null&&(L=q.replace(H,"$&/")+"/"),j(F,N,L,"",function(U){return U})):F!=null&&(M(F)&&(F=R(F,L+(F.key==null||b&&b.key===F.key?"":(""+F.key).replace(H,"$&/")+"/")+q)),N.push(F)),1;q=0;var X=V===""?".":V+":";if(k(b))for(var B=0;B<b.length;B++)V=b[B],Y=X+I(V,B),q+=j(V,N,L,Y,F);else if(B=f(b),typeof B=="function")for(b=B.call(b),B=0;!(V=b.next()).done;)V=V.value,Y=X+I(V,B++),q+=j(V,N,L,Y,F);else if(Y==="object"){if(typeof b.then=="function")return j(E(b),N,L,V,F);throw N=String(b),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return q}function T(b,N,L){if(b==null)return b;var V=[],F=0;return j(b,V,"","",function(Y){return N.call(L,Y,F++)}),V}function D(b){if(b._status===-1){var N=b._result;N=N(),N.then(function(L){(b._status===0||b._status===-1)&&(b._status=1,b._result=L)},function(L){(b._status===0||b._status===-1)&&(b._status=2,b._result=L)}),b._status===-1&&(b._status=0,b._result=N)}if(b._status===1)return b._result.default;throw b._result}var $=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)};function O(){}return se.Children={map:T,forEach:function(b,N,L){T(b,function(){N.apply(this,arguments)},L)},count:function(b){var N=0;return T(b,function(){N++}),N},toArray:function(b){return T(b,function(N){return N})||[]},only:function(b){if(!M(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},se.Component=v,se.Fragment=n,se.Profiler=i,se.PureComponent=C,se.StrictMode=r,se.Suspense=c,se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=g,se.__COMPILER_RUNTIME={__proto__:null,c:function(b){return g.H.useMemoCache(b)}},se.cache=function(b){return function(){return b.apply(null,arguments)}},se.cloneElement=function(b,N,L){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var V=p({},b.props),F=b.key,Y=void 0;if(N!=null)for(q in N.ref!==void 0&&(Y=void 0),N.key!==void 0&&(F=""+N.key),N)!x.call(N,q)||q==="key"||q==="__self"||q==="__source"||q==="ref"&&N.ref===void 0||(V[q]=N[q]);var q=arguments.length-2;if(q===1)V.children=L;else if(1<q){for(var X=Array(q),B=0;B<q;B++)X[B]=arguments[B+2];V.children=X}return S(b.type,F,void 0,void 0,Y,V)},se.createContext=function(b){return b={$$typeof:s,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:o,_context:b},b},se.createElement=function(b,N,L){var V,F={},Y=null;if(N!=null)for(V in N.key!==void 0&&(Y=""+N.key),N)x.call(N,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(F[V]=N[V]);var q=arguments.length-2;if(q===1)F.children=L;else if(1<q){for(var X=Array(q),B=0;B<q;B++)X[B]=arguments[B+2];F.children=X}if(b&&b.defaultProps)for(V in q=b.defaultProps,q)F[V]===void 0&&(F[V]=q[V]);return S(b,Y,void 0,void 0,null,F)},se.createRef=function(){return{current:null}},se.forwardRef=function(b){return{$$typeof:l,render:b}},se.isValidElement=M,se.lazy=function(b){return{$$typeof:u,_payload:{_status:-1,_result:b},_init:D}},se.memo=function(b,N){return{$$typeof:a,type:b,compare:N===void 0?null:N}},se.startTransition=function(b){var N=g.T,L={};g.T=L;try{var V=b(),F=g.S;F!==null&&F(L,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(O,$)}catch(Y){$(Y)}finally{g.T=N}},se.unstable_useCacheRefresh=function(){return g.H.useCacheRefresh()},se.use=function(b){return g.H.use(b)},se.useActionState=function(b,N,L){return g.H.useActionState(b,N,L)},se.useCallback=function(b,N){return g.H.useCallback(b,N)},se.useContext=function(b){return g.H.useContext(b)},se.useDebugValue=function(){},se.useDeferredValue=function(b,N){return g.H.useDeferredValue(b,N)},se.useEffect=function(b,N,L){var V=g.H;if(typeof L=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return V.useEffect(b,N)},se.useId=function(){return g.H.useId()},se.useImperativeHandle=function(b,N,L){return g.H.useImperativeHandle(b,N,L)},se.useInsertionEffect=function(b,N){return g.H.useInsertionEffect(b,N)},se.useLayoutEffect=function(b,N){return g.H.useLayoutEffect(b,N)},se.useMemo=function(b,N){return g.H.useMemo(b,N)},se.useOptimistic=function(b,N){return g.H.useOptimistic(b,N)},se.useReducer=function(b,N,L){return g.H.useReducer(b,N,L)},se.useRef=function(b){return g.H.useRef(b)},se.useState=function(b){return g.H.useState(b)},se.useSyncExternalStore=function(b,N,L){return g.H.useSyncExternalStore(b,N,L)},se.useTransition=function(){return g.H.useTransition()},se.version="19.1.1",se}var qo;function yn(){return qo||(qo=1,_i.exports=nu()),_i.exports}var A=yn();const Ra=ni(A),F1=Jc({__proto__:null,default:Ra},[A]);var ki={exports:{}},De={};/**
18
- * @license React
19
- * react-dom.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Yo;function ru(){if(Yo)return De;Yo=1;var e=yn();function t(c){var a="https://react.dev/errors/"+c;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+c+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(c,a,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:c,containerInfo:a,implementation:u}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,a){if(c==="font")return"";if(typeof a=="string")return a==="use-credentials"?a:""}return De.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,De.createPortal=function(c,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)throw Error(t(299));return o(c,a,null,u)},De.flushSync=function(c){var a=s.T,u=r.p;try{if(s.T=null,r.p=2,c)return c()}finally{s.T=a,r.p=u,r.d.f()}},De.preconnect=function(c,a){typeof c=="string"&&(a?(a=a.crossOrigin,a=typeof a=="string"?a==="use-credentials"?a:"":void 0):a=null,r.d.C(c,a))},De.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},De.preinit=function(c,a){if(typeof c=="string"&&a&&typeof a.as=="string"){var u=a.as,d=l(u,a.crossOrigin),f=typeof a.integrity=="string"?a.integrity:void 0,h=typeof a.fetchPriority=="string"?a.fetchPriority:void 0;u==="style"?r.d.S(c,typeof a.precedence=="string"?a.precedence:void 0,{crossOrigin:d,integrity:f,fetchPriority:h}):u==="script"&&r.d.X(c,{crossOrigin:d,integrity:f,fetchPriority:h,nonce:typeof a.nonce=="string"?a.nonce:void 0})}},De.preinitModule=function(c,a){if(typeof c=="string")if(typeof a=="object"&&a!==null){if(a.as==null||a.as==="script"){var u=l(a.as,a.crossOrigin);r.d.M(c,{crossOrigin:u,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0})}}else a==null&&r.d.M(c)},De.preload=function(c,a){if(typeof c=="string"&&typeof a=="object"&&a!==null&&typeof a.as=="string"){var u=a.as,d=l(u,a.crossOrigin);r.d.L(c,u,{crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0,type:typeof a.type=="string"?a.type:void 0,fetchPriority:typeof a.fetchPriority=="string"?a.fetchPriority:void 0,referrerPolicy:typeof a.referrerPolicy=="string"?a.referrerPolicy:void 0,imageSrcSet:typeof a.imageSrcSet=="string"?a.imageSrcSet:void 0,imageSizes:typeof a.imageSizes=="string"?a.imageSizes:void 0,media:typeof a.media=="string"?a.media:void 0})}},De.preloadModule=function(c,a){if(typeof c=="string")if(a){var u=l(a.as,a.crossOrigin);r.d.m(c,{as:typeof a.as=="string"&&a.as!=="script"?a.as:void 0,crossOrigin:u,integrity:typeof a.integrity=="string"?a.integrity:void 0})}else r.d.m(c)},De.requestFormReset=function(c){r.d.r(c)},De.unstable_batchedUpdates=function(c,a){return c(a)},De.useFormState=function(c,a,u){return s.H.useFormState(c,a,u)},De.useFormStatus=function(){return s.H.useHostTransitionStatus()},De.version="19.1.1",De}var Xo;function iu(){if(Xo)return ki.exports;Xo=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ki.exports=ru(),ki.exports}function ja(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ja(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function q1(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ja(e))&&(r&&(r+=" "),r+=t);return r}var ou=iu();const Y1=ni(ou);/**
26
- * @license lucide-react v0.511.0 - ISC
27
- *
28
- * This source code is licensed under the ISC license.
29
- * See the LICENSE file in the root directory of this source tree.
30
- */const su=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),au=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Go=e=>{const t=au(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ma=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),lu=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
31
- * @license lucide-react v0.511.0 - ISC
32
- *
33
- * This source code is licensed under the ISC license.
34
- * See the LICENSE file in the root directory of this source tree.
35
- */var cu={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"};/**
36
- * @license lucide-react v0.511.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 uu=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},c)=>A.createElement("svg",{ref:c,...cu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ma("lucide",i),...!o&&!lu(l)&&{"aria-hidden":"true"},...l},[...s.map(([a,u])=>A.createElement(a,u)),...Array.isArray(o)?o:[o]]));/**
41
- * @license lucide-react v0.511.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
- */const K=(e,t)=>{const n=A.forwardRef(({className:r,...i},o)=>A.createElement(uu,{ref:o,iconNode:t,className:Ma(`lucide-${su(Go(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Go(e),n};/**
46
- * @license lucide-react v0.511.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 fu=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],X1=K("arrow-down",fu);/**
51
- * @license lucide-react v0.511.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 du=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],G1=K("arrow-left",du);/**
56
- * @license lucide-react v0.511.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 hu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],U1=K("ban",hu);/**
61
- * @license lucide-react v0.511.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 pu=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],W1=K("book",pu);/**
66
- * @license lucide-react v0.511.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 gu=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],K1=K("bot",gu);/**
71
- * @license lucide-react v0.511.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 mu=[["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"}]],Z1=K("box",mu);/**
76
- * @license lucide-react v0.511.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 yu=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Q1=K("check",yu);/**
81
- * @license lucide-react v0.511.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 vu=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],J1=K("chevron-down",vu);/**
86
- * @license lucide-react v0.511.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 xu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ev=K("chevron-right",xu);/**
91
- * @license lucide-react v0.511.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const wu=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],tv=K("chevron-up",wu);/**
96
- * @license lucide-react v0.511.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const bu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nv=K("circle-alert",bu);/**
101
- * @license lucide-react v0.511.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const Eu=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rv=K("circle-check-big",Eu);/**
106
- * @license lucide-react v0.511.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const _u=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],iv=K("circle-x",_u);/**
111
- * @license lucide-react v0.511.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const ku=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ov=K("code",ku);/**
116
- * @license lucide-react v0.511.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const Su=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],sv=K("download",Su);/**
121
- * @license lucide-react v0.511.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const Cu=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],av=K("ellipsis-vertical",Cu);/**
126
- * @license lucide-react v0.511.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const Nu=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lv=K("ellipsis",Nu);/**
131
- * @license lucide-react v0.511.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Tu=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cv=K("eye",Tu);/**
136
- * @license lucide-react v0.511.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const Au=[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]],uv=K("file-audio",Au);/**
141
- * @license lucide-react v0.511.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const Ru=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],fv=K("file-code",Ru);/**
146
- * @license lucide-react v0.511.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const ju=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],dv=K("file-image",ju);/**
151
- * @license lucide-react v0.511.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Mu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],hv=K("file-json",Mu);/**
156
- * @license lucide-react v0.511.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const Du=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],pv=K("file-spreadsheet",Du);/**
161
- * @license lucide-react v0.511.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Ou=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],gv=K("file-text",Ou);/**
166
- * @license lucide-react v0.511.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const Pu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],mv=K("file",Pu);/**
171
- * @license lucide-react v0.511.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const Iu=[["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"}]],yv=K("git-merge",Iu);/**
176
- * @license lucide-react v0.511.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const $u=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],vv=K("grid-3x3",$u);/**
181
- * @license lucide-react v0.511.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const Lu=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],xv=K("hard-drive",Lu);/**
186
- * @license lucide-react v0.511.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const zu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],wv=K("info",zu);/**
191
- * @license lucide-react v0.511.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const Hu=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],bv=K("key",Hu);/**
196
- * @license lucide-react v0.511.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const Vu=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Ev=K("link",Vu);/**
201
- * @license lucide-react v0.511.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const Bu=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],_v=K("loader-circle",Bu);/**
206
- * @license lucide-react v0.511.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const Fu=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],kv=K("message-circle",Fu);/**
211
- * @license lucide-react v0.511.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const qu=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Sv=K("message-square",qu);/**
216
- * @license lucide-react v0.511.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const Yu=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Cv=K("network",Yu);/**
221
- * @license lucide-react v0.511.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const Xu=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Nv=K("panel-left",Xu);/**
226
- * @license lucide-react v0.511.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const Gu=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Tv=K("panel-right",Gu);/**
231
- * @license lucide-react v0.511.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const Uu=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Av=K("paperclip",Uu);/**
236
- * @license lucide-react v0.511.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const Wu=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Rv=K("pencil",Wu);/**
241
- * @license lucide-react v0.511.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const Ku=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],jv=K("refresh-ccw",Ku);/**
246
- * @license lucide-react v0.511.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const Zu=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Mv=K("refresh-cw",Zu);/**
251
- * @license lucide-react v0.511.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const Qu=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Dv=K("send",Qu);/**
256
- * @license lucide-react v0.511.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const Ju=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Ov=K("share-2",Ju);/**
261
- * @license lucide-react v0.511.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const ef=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Pv=K("square-pen",ef);/**
266
- * @license lucide-react v0.511.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const tf=[["path",{d:"M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4",key:"1fu5g2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.9 4.9 1.4 1.4",key:"b9915j"}],["path",{d:"m17.7 17.7 1.4 1.4",key:"qc3ed3"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.3 17.7-1.4 1.4",key:"5gca6"}],["path",{d:"m19.1 4.9-1.4 1.4",key:"wpu9u6"}]],Iv=K("sun-moon",tf);/**
271
- * @license lucide-react v0.511.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const nf=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$v=K("terminal",nf);/**
276
- * @license lucide-react v0.511.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const rf=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],Lv=K("thumbs-down",rf);/**
281
- * @license lucide-react v0.511.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const of=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],zv=K("thumbs-up",of);/**
286
- * @license lucide-react v0.511.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const sf=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Hv=K("trash-2",sf);/**
291
- * @license lucide-react v0.511.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const af=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Vv=K("trash",af);/**
296
- * @license lucide-react v0.511.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const lf=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bv=K("triangle-alert",lf);/**
301
- * @license lucide-react v0.511.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const cf=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Fv=K("user",cf);/**
306
- * @license lucide-react v0.511.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const uf=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qv=K("x",uf);/**
311
- * @license lucide-react v0.511.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const ff=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],Yv=K("wrench",ff);/**
316
- * @license lucide-react v0.511.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const df=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Xv=K("zap",df);var Si={exports:{}},Ci={};/**
321
- * @license React
322
- * use-sync-external-store-shim.production.js
323
- *
324
- * Copyright (c) Meta Platforms, Inc. and affiliates.
325
- *
326
- * This source code is licensed under the MIT license found in the
327
- * LICENSE file in the root directory of this source tree.
328
- */var Uo;function hf(){if(Uo)return Ci;Uo=1;var e=yn();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,v=p[1];return o(function(){m.value=h,m.getSnapshot=f,c(m)&&v({inst:m})},[d,h,f]),i(function(){return c(m)&&v({inst:m}),d(function(){c(m)&&v({inst:m})})},[d]),s(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function a(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:l;return Ci.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Ci}var Wo;function pf(){return Wo||(Wo=1,Si.exports=hf()),Si.exports}function uo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bt=uo();function Da(e){Bt=e}var Yn={exec:()=>null};function me(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Pe.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,t)};return r}var Pe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},gf=/^(?:[ \t]*(?:\n|$))+/,mf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ir=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fo=/(?:[*+-]|\d{1,9}[.)])/,Oa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pa=me(Oa).replace(/bull/g,fo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),xf=me(Oa).replace(/bull/g,fo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ho=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,wf=/^[^\n]+/,po=/(?!\s*\])(?:\\.|[^\[\]\\])+/,bf=me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",po).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ef=me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fo).getRegex(),ri="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",go=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_f=me("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",go).replace("tag",ri).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ia=me(ho).replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex(),kf=me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ia).getRegex(),mo={blockquote:kf,code:mf,def:bf,fences:yf,heading:vf,hr:ir,html:_f,lheading:Pa,list:Ef,newline:gf,paragraph:Ia,table:Yn,text:wf},Ko=me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex(),Sf={...mo,lheading:xf,table:Ko,paragraph:me(ho).replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ko).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex()},Cf={...mo,html:me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",go).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Yn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:me(ho).replace("hr",ir).replace("heading",` *#{1,6} *[^
329
- ]`).replace("lheading",Pa).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$a=/^( {2,}|\\)\n(?!\s*$)/,Af=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ii=/[\p{P}\p{S}]/u,yo=/[\s\p{P}\p{S}]/u,La=/[^\s\p{P}\p{S}]/u,Rf=me(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yo).getRegex(),za=/(?!~)[\p{P}\p{S}]/u,jf=/(?!~)[\s\p{P}\p{S}]/u,Mf=/(?:[^\s\p{P}\p{S}]|~)/u,Df=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ha=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Of=me(Ha,"u").replace(/punct/g,ii).getRegex(),Pf=me(Ha,"u").replace(/punct/g,za).getRegex(),Va="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",If=me(Va,"gu").replace(/notPunctSpace/g,La).replace(/punctSpace/g,yo).replace(/punct/g,ii).getRegex(),$f=me(Va,"gu").replace(/notPunctSpace/g,Mf).replace(/punctSpace/g,jf).replace(/punct/g,za).getRegex(),Lf=me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,La).replace(/punctSpace/g,yo).replace(/punct/g,ii).getRegex(),zf=me(/\\(punct)/,"gu").replace(/punct/g,ii).getRegex(),Hf=me(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Vf=me(go).replace("(?:-->|$)","-->").getRegex(),Bf=me("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Vf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ff=me(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ba=me(/^!?\[(label)\]\[(ref)\]/).replace("label",Hr).replace("ref",po).getRegex(),Fa=me(/^!?\[(ref)\](?:\[\])?/).replace("ref",po).getRegex(),qf=me("reflink|nolink(?!\\()","g").replace("reflink",Ba).replace("nolink",Fa).getRegex(),vo={_backpedal:Yn,anyPunctuation:zf,autolink:Hf,blockSkip:Df,br:$a,code:Tf,del:Yn,emStrongLDelim:Of,emStrongRDelimAst:If,emStrongRDelimUnd:Lf,escape:Nf,link:Ff,nolink:Fa,punctuation:Rf,reflink:Ba,reflinkSearch:qf,tag:Bf,text:Af,url:Yn},Yf={...vo,link:me(/^!?\[(label)\]\((.*?)\)/).replace("label",Hr).getRegex(),reflink:me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hr).getRegex()},Fi={...vo,emStrongRDelimAst:$f,emStrongLDelim:Pf,url:me(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Xf={...Fi,br:me($a).replace("{2,}","*").getRegex(),text:me(Fi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},br={normal:mo,gfm:Sf,pedantic:Cf},Rn={normal:vo,gfm:Fi,breaks:Xf,pedantic:Yf},Gf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zo=e=>Gf[e];function tt(e,t){if(t){if(Pe.escapeTest.test(e))return e.replace(Pe.escapeReplace,Zo)}else if(Pe.escapeTestNoEncode.test(e))return e.replace(Pe.escapeReplaceNoEncode,Zo);return e}function Qo(e){try{e=encodeURI(e).replace(Pe.percentDecode,"%")}catch{return null}return e}function Jo(e,t){var o;const n=e.replace(Pe.findPipe,(s,l,c)=>{let a=!1,u=l;for(;--u>=0&&c[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(Pe.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Pe.slashPipe,"|");return r}function jn(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Uf(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function es(e,t,n,r,i){const o=t.href,s=t.title||null,l=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:s,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function Wf(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const i=r[1];return t.split(`
330
- `).map(o=>{const s=o.match(n.other.beginningSpace);if(s===null)return o;const[l]=s;return l.length>=i.length?o.slice(i.length):o}).join(`
331
- `)}var Vr=class{constructor(e){we(this,"options");we(this,"rules");we(this,"lexer");this.options=e||Bt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:jn(n,`
332
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Wf(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=jn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:jn(t[0],`
333
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=jn(t[0],`
334
- `).split(`
335
- `),r="",i="";const o=[];for(;n.length>0;){let s=!1;const l=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),s=!0;else if(!s)l.push(n[c]);else break;n=n.slice(c);const a=l.join(`
336
- `),u=a.replace(this.rules.other.blockquoteSetextReplace,`
337
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
338
- ${a}`:a,i=i?`${i}
339
- ${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=d,n.length===0)break;const f=o.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){const h=f,p=h.raw+`
340
- `+n.join(`
341
- `),m=this.blockquote(p);o[o.length-1]=m,r=r.substring(0,r.length-h.raw.length)+m.raw,i=i.substring(0,i.length-h.text.length)+m.text;break}else if((f==null?void 0:f.type)==="list"){const h=f,p=h.raw+`
342
- `+n.join(`
343
- `),m=this.list(p);o[o.length-1]=m,r=r.substring(0,r.length-f.raw.length)+m.raw,i=i.substring(0,i.length-h.raw.length)+m.raw,n=p.substring(o.at(-1).raw.length).split(`
344
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let s=!1;for(;e;){let c=!1,a="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let d=t[2].split(`
345
- `,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),f=e.split(`
346
- `,1)[0],h=!d.trim(),p=0;if(this.options.pedantic?(p=2,u=d.trimStart()):h?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,u=d.slice(p),p+=t[1].length),h&&this.rules.other.blankLine.test(f)&&(a+=f+`
347
- `,e=e.substring(f.length+1),c=!0),!c){const w=this.rules.other.nextBulletRegex(p),C=this.rules.other.hrRegex(p),y=this.rules.other.fencesBeginRegex(p),k=this.rules.other.headingBeginRegex(p),g=this.rules.other.htmlBeginRegex(p);for(;e;){const x=e.split(`
348
- `,1)[0];let S;if(f=x,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),S=f):S=f.replace(this.rules.other.tabCharGlobal," "),y.test(f)||k.test(f)||g.test(f)||w.test(f)||C.test(f))break;if(S.search(this.rules.other.nonSpaceChar)>=p||!f.trim())u+=`
349
- `+S.slice(p);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||k.test(d)||C.test(d))break;u+=`
350
- `+f}!h&&!f.trim()&&(h=!0),a+=x+`
351
- `,e=e.substring(x.length+1),d=S.slice(p)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(s=!0));let m=null,v;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(v=m[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:a,task:!!m,checked:v,loose:!1,text:u,tokens:[]}),i.raw+=a}const l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const a=i.items[c].tokens.filter(d=>d.type==="space"),u=a.length>0&&a.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=u}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var s;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Jo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(s=t[3])!=null&&s.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
352
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(const l of i)o.rows.push(Jo(l,o.header.length).map((c,a)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[a]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
353
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=jn(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Uf(t[2],"()");if(o===-2)return;if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),es(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return es(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let s,l,c=o,a=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){a+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+a);const d=[...r[0]][0].length,f=e.slice(0,o+r.index+d+l);if(Math.min(o,l)%2){const p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ht=class qi{constructor(t){we(this,"tokens");we(this,"options");we(this,"state");we(this,"tokenizer");we(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Bt,this.options.tokenizer=this.options.tokenizer||new Vr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Pe,block:br.normal,inline:Rn.normal};this.options.pedantic?(n.block=br.pedantic,n.inline=Rn.pedantic):this.options.gfm&&(n.block=br.gfm,this.options.breaks?n.inline=Rn.breaks:n.inline=Rn.gfm),this.tokenizer.rules=n}static get rules(){return{block:br,inline:Rn}}static lex(t,n){return new qi(n).lex(t)}static lexInline(t,n){return new qi(n).inlineTokens(t)}lex(t){t=t.replace(Pe.carriageReturn,`
354
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var i,o,s;for(this.options.pedantic&&(t=t.replace(Pe.tabCharGlobal," ").replace(Pe.spaceLine,""));t;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(a=>(l=a.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const a=n.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
355
- `:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
356
- `+l.raw,a.text+=`
357
- `+l.text,this.inlineQueue.at(-1).src=a.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
358
- `+l.raw,a.text+=`
359
- `+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if((s=this.options.extensions)!=null&&s.startBlock){let a=1/0;const u=t.slice(1);let d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(c=t.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const a=n.at(-1);r&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
360
- `+l.raw,a.text+=`
361
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
362
- `+l.raw,a.text+=`
363
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(l);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,a;let r=t,i=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,s="";for(;t;){o||(s=""),o=!1;let u;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(f=>(u=f.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const f=n.at(-1);u.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,s)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let d=t;if((a=this.options.extensions)!=null&&a.startInline){let f=1/0;const h=t.slice(1);let p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},h),typeof p=="number"&&p>=0&&(f=Math.min(f,p))}),f<1/0&&f>=0&&(d=t.substring(0,f+1))}if(u=this.tokenizer.inlineText(d)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),o=!0;const f=n.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):n.push(u);continue}if(t){const f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Br=class{constructor(e){we(this,"options");we(this,"parser");this.options=e||Bt}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(Pe.notSpaceStart))==null?void 0:o[0],i=e.replace(Pe.endingNewline,"")+`
364
- `;return r?'<pre><code class="language-'+tt(r)+'">'+(n?i:tt(i,!0))+`</code></pre>
365
- `:"<pre><code>"+(n?i:tt(i,!0))+`</code></pre>
366
- `}blockquote({tokens:e}){return`<blockquote>
367
- ${this.parser.parse(e)}</blockquote>
368
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
369
- `}hr(e){return`<hr>
370
- `}list(e){const t=e.ordered,n=e.start;let r="";for(let s=0;s<e.items.length;s++){const l=e.items[s];r+=this.listitem(l)}const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
371
- `+r+"</"+i+`>
372
- `}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+tt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
373
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
374
- `}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){const o=e.rows[i];n="";for(let s=0;s<o.length;s++)n+=this.tablecell(o[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
375
- <thead>
376
- `+t+`</thead>
377
- `+r+`</table>
378
- `}tablerow({text:e}){return`<tr>
379
- ${e}</tr>
380
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
381
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${tt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=Qo(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+tt(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Qo(e);if(i===null)return tt(n);e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${tt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:tt(e.text)}},xo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},pt=class Yi{constructor(t){we(this,"options");we(this,"renderer");we(this,"textRenderer");this.options=t||Bt,this.options.renderer=this.options.renderer||new Br,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xo}static parse(t,n){return new Yi(n).parse(t)}static parseInline(t,n){return new Yi(n).parseInline(t)}parse(t,n=!0){var i,o;let r="";for(let s=0;s<t.length;s++){const l=t[s];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){const a=l,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=u||"";continue}}const c=l;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let a=c,u=this.renderer.text(a);for(;s+1<t.length&&t[s+1].type==="text";)a=t[++s],u+=`
382
- `+this.renderer.text(a);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const a='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(t,n=this.renderer){var i,o;let r="";for(let s=0;s<t.length;s++){const l=t[s];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=a||"";continue}}const c=l;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{const a='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Bi,Dr=(Bi=class{constructor(e){we(this,"options");we(this,"block");this.options=e||Bt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ht.lex:ht.lexInline}provideParser(){return this.block?pt.parse:pt.parseInline}},we(Bi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Bi),Kf=class{constructor(...e){we(this,"defaults",uo());we(this,"options",this.setOptions);we(this,"parse",this.parseMarkdown(!0));we(this,"parseInline",this.parseMarkdown(!1));we(this,"Parser",pt);we(this,"Renderer",Br);we(this,"TextRenderer",xo);we(this,"Lexer",ht);we(this,"Tokenizer",Vr);we(this,"Hooks",Dr);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const s=o;for(const l of s.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of s.rows)for(const c of l)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const s=o;n=n.concat(this.walkTokens(s.items,t));break}default:{const s=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[s.type]?this.defaults.extensions.childTokens[s.type].forEach(l=>{const c=s[l].flat(1/0);n=n.concat(this.walkTokens(c,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new Br(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const s=o,l=n.renderer[s],c=i[s];i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Vr(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const s=o,l=n.tokenizer[s],c=i[s];i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new Dr;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const s=o,l=n.hooks[s],c=i[s];Dr.passThroughHooks.has(o)?i[s]=a=>{if(this.defaults.async)return Promise.resolve(l.call(i,a)).then(d=>c.call(i,d));const u=l.call(i,a);return c.call(i,u)}:i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ht.lex(e,t??this.defaults)}parser(e,t){return pt.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const i={...r},o={...this.defaults,...i},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?ht.lex:ht.lexInline,c=o.hooks?o.hooks.provideParser():e?pt.parse:pt.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(a=>l(a,o)).then(a=>o.hooks?o.hooks.processAllTokens(a):a).then(a=>o.walkTokens?Promise.all(this.walkTokens(a,o.walkTokens)).then(()=>a):a).then(a=>c(a,o)).then(a=>o.hooks?o.hooks.postprocess(a):a).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let a=l(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let u=c(a,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(a){return s(a)}}}onError(e,t){return n=>{if(n.message+=`
383
- Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+tt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},$t=new Kf;function xe(e,t){return $t.parse(e,t)}xe.options=xe.setOptions=function(e){return $t.setOptions(e),xe.defaults=$t.defaults,Da(xe.defaults),xe};xe.getDefaults=uo;xe.defaults=Bt;xe.use=function(...e){return $t.use(...e),xe.defaults=$t.defaults,Da(xe.defaults),xe};xe.walkTokens=function(e,t){return $t.walkTokens(e,t)};xe.parseInline=$t.parseInline;xe.Parser=pt;xe.parser=pt.parse;xe.Renderer=Br;xe.TextRenderer=xo;xe.Lexer=ht;xe.lexer=ht.lex;xe.Tokenizer=Vr;xe.Hooks=Dr;xe.parse=xe;xe.options;xe.setOptions;xe.use;xe.walkTokens;xe.parseInline;pt.parse;ht.lex;var Mn={},Zt={},Er={},Nt={},Tt={},Ni={},ts;function qa(){return ts||(ts=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(r){return r.type===t.Tag||r.type===t.Script||r.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})(Ni)),Ni}var ae={},ns;function rs(){if(ns)return ae;ns=1;var e=ae&&ae.__extends||(function(){var g=function(x,S){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,M){R.__proto__=M}||function(R,M){for(var z in M)Object.prototype.hasOwnProperty.call(M,z)&&(R[z]=M[z])},g(x,S)};return function(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");g(x,S);function R(){this.constructor=x}x.prototype=S===null?Object.create(S):(R.prototype=S.prototype,new R)}})(),t=ae&&ae.__assign||function(){return t=Object.assign||function(g){for(var x,S=1,R=arguments.length;S<R;S++){x=arguments[S];for(var M in x)Object.prototype.hasOwnProperty.call(x,M)&&(g[M]=x[M])}return g},t.apply(this,arguments)};Object.defineProperty(ae,"__esModule",{value:!0}),ae.cloneNode=ae.hasChildren=ae.isDocument=ae.isDirective=ae.isComment=ae.isText=ae.isCDATA=ae.isTag=ae.Element=ae.Document=ae.CDATA=ae.NodeWithChildren=ae.ProcessingInstruction=ae.Comment=ae.Text=ae.DataNode=ae.Node=void 0;var n=qa(),r=(function(){function g(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(g.prototype,"parentNode",{get:function(){return this.parent},set:function(x){this.parent=x},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"previousSibling",{get:function(){return this.prev},set:function(x){this.prev=x},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"nextSibling",{get:function(){return this.next},set:function(x){this.next=x},enumerable:!1,configurable:!0}),g.prototype.cloneNode=function(x){return x===void 0&&(x=!1),y(this,x)},g})();ae.Node=r;var i=(function(g){e(x,g);function x(S){var R=g.call(this)||this;return R.data=S,R}return Object.defineProperty(x.prototype,"nodeValue",{get:function(){return this.data},set:function(S){this.data=S},enumerable:!1,configurable:!0}),x})(r);ae.DataNode=i;var o=(function(g){e(x,g);function x(){var S=g!==null&&g.apply(this,arguments)||this;return S.type=n.ElementType.Text,S}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),x})(i);ae.Text=o;var s=(function(g){e(x,g);function x(){var S=g!==null&&g.apply(this,arguments)||this;return S.type=n.ElementType.Comment,S}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),x})(i);ae.Comment=s;var l=(function(g){e(x,g);function x(S,R){var M=g.call(this,R)||this;return M.name=S,M.type=n.ElementType.Directive,M}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),x})(i);ae.ProcessingInstruction=l;var c=(function(g){e(x,g);function x(S){var R=g.call(this)||this;return R.children=S,R}return Object.defineProperty(x.prototype,"firstChild",{get:function(){var S;return(S=this.children[0])!==null&&S!==void 0?S:null},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"childNodes",{get:function(){return this.children},set:function(S){this.children=S},enumerable:!1,configurable:!0}),x})(r);ae.NodeWithChildren=c;var a=(function(g){e(x,g);function x(){var S=g!==null&&g.apply(this,arguments)||this;return S.type=n.ElementType.CDATA,S}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),x})(c);ae.CDATA=a;var u=(function(g){e(x,g);function x(){var S=g!==null&&g.apply(this,arguments)||this;return S.type=n.ElementType.Root,S}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),x})(c);ae.Document=u;var d=(function(g){e(x,g);function x(S,R,M,z){M===void 0&&(M=[]),z===void 0&&(z=S==="script"?n.ElementType.Script:S==="style"?n.ElementType.Style:n.ElementType.Tag);var H=g.call(this,M)||this;return H.name=S,H.attribs=R,H.type=z,H}return Object.defineProperty(x.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"tagName",{get:function(){return this.name},set:function(S){this.name=S},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"attributes",{get:function(){var S=this;return Object.keys(this.attribs).map(function(R){var M,z;return{name:R,value:S.attribs[R],namespace:(M=S["x-attribsNamespace"])===null||M===void 0?void 0:M[R],prefix:(z=S["x-attribsPrefix"])===null||z===void 0?void 0:z[R]}})},enumerable:!1,configurable:!0}),x})(c);ae.Element=d;function f(g){return(0,n.isTag)(g)}ae.isTag=f;function h(g){return g.type===n.ElementType.CDATA}ae.isCDATA=h;function p(g){return g.type===n.ElementType.Text}ae.isText=p;function m(g){return g.type===n.ElementType.Comment}ae.isComment=m;function v(g){return g.type===n.ElementType.Directive}ae.isDirective=v;function w(g){return g.type===n.ElementType.Root}ae.isDocument=w;function C(g){return Object.prototype.hasOwnProperty.call(g,"children")}ae.hasChildren=C;function y(g,x){x===void 0&&(x=!1);var S;if(p(g))S=new o(g.data);else if(m(g))S=new s(g.data);else if(f(g)){var R=x?k(g.children):[],M=new d(g.name,t({},g.attribs),R);R.forEach(function(P){return P.parent=M}),g.namespace!=null&&(M.namespace=g.namespace),g["x-attribsNamespace"]&&(M["x-attribsNamespace"]=t({},g["x-attribsNamespace"])),g["x-attribsPrefix"]&&(M["x-attribsPrefix"]=t({},g["x-attribsPrefix"])),S=M}else if(h(g)){var R=x?k(g.children):[],z=new a(R);R.forEach(function(E){return E.parent=z}),S=z}else if(w(g)){var R=x?k(g.children):[],H=new u(R);R.forEach(function(E){return E.parent=H}),g["x-mode"]&&(H["x-mode"]=g["x-mode"]),S=H}else if(v(g)){var I=new l(g.name,g.data);g["x-name"]!=null&&(I["x-name"]=g["x-name"],I["x-publicId"]=g["x-publicId"],I["x-systemId"]=g["x-systemId"]),S=I}else throw new Error("Not implemented yet: ".concat(g.type));return S.startIndex=g.startIndex,S.endIndex=g.endIndex,g.sourceCodeLocation!=null&&(S.sourceCodeLocation=g.sourceCodeLocation),S}ae.cloneNode=y;function k(g){for(var x=g.map(function(R){return y(R,!0)}),S=1;S<x.length;S++)x[S].prev=x[S-1],x[S-1].next=x[S];return x}return ae}var is;function Ya(){return is||(is=1,(function(e){var t=Tt&&Tt.__createBinding||(Object.create?(function(l,c,a,u){u===void 0&&(u=a);var d=Object.getOwnPropertyDescriptor(c,a);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[a]}}),Object.defineProperty(l,u,d)}):(function(l,c,a,u){u===void 0&&(u=a),l[u]=c[a]})),n=Tt&&Tt.__exportStar||function(l,c){for(var a in l)a!=="default"&&!Object.prototype.hasOwnProperty.call(c,a)&&t(c,l,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=qa(),i=rs();n(rs(),e);var o={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=(function(){function l(c,a,u){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof a=="function"&&(u=a,a=o),typeof c=="object"&&(a=c,c=void 0),this.callback=c??null,this.options=a??o,this.elementCB=u??null}return l.prototype.onparserinit=function(c){this.parser=c},l.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(c){this.handleCallback(c)},l.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},l.prototype.onopentag=function(c,a){var u=this.options.xmlMode?r.ElementType.Tag:void 0,d=new i.Element(c,a,void 0,u);this.addNode(d),this.tagStack.push(d)},l.prototype.ontext=function(c){var a=this.lastNode;if(a&&a.type===r.ElementType.Text)a.data+=c,this.options.withEndIndices&&(a.endIndex=this.parser.endIndex);else{var u=new i.Text(c);this.addNode(u),this.lastNode=u}},l.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=c;return}var a=new i.Comment(c);this.addNode(a),this.lastNode=a},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var c=new i.Text(""),a=new i.CDATA([c]);this.addNode(a),c.parent=a,this.lastNode=c},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(c,a){var u=new i.ProcessingInstruction(c,a);this.addNode(u)},l.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},l.prototype.addNode=function(c){var a=this.tagStack[this.tagStack.length-1],u=a.children[a.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),a.children.push(c),u&&(c.prev=u,u.next=c),c.parent=a,this.lastNode=null},l})();e.DomHandler=s,e.default=s})(Tt)),Tt}var Ti={},os;function Zf(){return os||(os=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,n){return t[n.toLowerCase()]=n,t},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})(Ti)),Ti}var ss;function Xa(){if(ss)return Nt;ss=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.formatAttributes=r,Nt.escapeSpecialCharacters=o,Nt.revertEscapedCharacters=s,Nt.formatDOM=l;var e=Ya(),t=Zf();function n(c){return t.CASE_SENSITIVE_TAG_NAMES_MAP[c]}function r(c){for(var a={},u=0,d=c.length;u<d;u++){var f=c[u];a[f.name]=f.value}return a}function i(c){c=c.toLowerCase();var a=n(c);return a||c}function o(c){return c.replace(t.CARRIAGE_RETURN_REGEX,t.CARRIAGE_RETURN_PLACEHOLDER)}function s(c){return c.replace(t.CARRIAGE_RETURN_PLACEHOLDER_REGEX,t.CARRIAGE_RETURN)}function l(c,a,u){a===void 0&&(a=null);for(var d=[],f,h=0,p=c.length;h<p;h++){var m=c[h];switch(m.nodeType){case 1:{var v=i(m.nodeName);f=new e.Element(v,r(m.attributes)),f.children=l(v==="template"?m.content.childNodes:m.childNodes,f);break}case 3:f=new e.Text(s(m.nodeValue));break;case 8:f=new e.Comment(m.nodeValue);break;default:continue}var w=d[h-1]||null;w&&(w.next=f),f.parent=a,f.prev=w,f.next=null,d.push(f)}return u&&(f=new e.ProcessingInstruction(u.substring(0,u.indexOf(" ")).toLowerCase(),u),f.next=d[0]||null,f.parent=a,d.unshift(f),d[1]&&(d[1].prev=d[0])),d}return Nt}var as;function Qf(){if(as)return Er;as=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.default=m;var e=Xa(),t="html",n="head",r="body",i=/<([a-zA-Z]+[0-9]?)/,o=/<head[^]*>/i,s=/<body[^]*>/i,l=function(v,w){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(v,w){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},a=typeof window=="object"&&window.DOMParser;if(typeof a=="function"){var u=new a,d="text/html";c=function(v,w){return w&&(v="<".concat(w,">").concat(v,"</").concat(w,">")),u.parseFromString(v,d)},l=c}if(typeof document=="object"&&document.implementation){var f=document.implementation.createHTMLDocument();l=function(v,w){if(w){var C=f.documentElement.querySelector(w);return C&&(C.innerHTML=v),f}return f.documentElement.innerHTML=v,f}}var h=typeof document=="object"&&document.createElement("template"),p;h&&h.content&&(p=function(v){return h.innerHTML=v,h.content.childNodes});function m(v){var w,C;v=(0,e.escapeSpecialCharacters)(v);var y=v.match(i),k=y&&y[1]?y[1].toLowerCase():"";switch(k){case t:{var g=c(v);if(!o.test(v)){var x=g.querySelector(n);(w=x==null?void 0:x.parentNode)===null||w===void 0||w.removeChild(x)}if(!s.test(v)){var x=g.querySelector(r);(C=x==null?void 0:x.parentNode)===null||C===void 0||C.removeChild(x)}return g.querySelectorAll(t)}case n:case r:{var S=l(v).querySelectorAll(k);return s.test(v)&&o.test(v)?S[0].parentNode.childNodes:S}default:{if(p)return p(v);var x=l(v,r).querySelector(r);return x.childNodes}}}return Er}var ls;function Jf(){if(ls)return Zt;ls=1;var e=Zt&&Zt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=i;var t=e(Qf()),n=Xa(),r=/<(![a-zA-Z\s]+)>/;function i(o){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];var s=o.match(r),l=s?s[1]:void 0;return(0,n.formatDOM)((0,t.default)(o),null,l)}return Zt}var _r={},Ke={},Dn={},cs;function ed(){if(cs)return Dn;cs=1;var e=0;Dn.SAME=e;var t=1;return Dn.CAMELCASE=t,Dn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},Dn}var us;function td(){if(us)return Ke;us=1;const e=0,t=1,n=2,r=3,i=4,o=5,s=6;function l(g){return a.hasOwnProperty(g)?a[g]:null}function c(g,x,S,R,M,z,H){this.acceptsBooleans=x===n||x===r||x===i,this.attributeName=R,this.attributeNamespace=M,this.mustUseProperty=S,this.propertyName=g,this.type=x,this.sanitizeURL=z,this.removeEmptyString=H}const a={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(g=>{a[g]=new c(g,e,!1,g,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([g,x])=>{a[g]=new c(g,t,!1,x,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(g=>{a[g]=new c(g,n,!1,g.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(g=>{a[g]=new c(g,n,!1,g,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(g=>{a[g]=new c(g,r,!1,g.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(g=>{a[g]=new c(g,r,!0,g,null,!1,!1)}),["capture","download"].forEach(g=>{a[g]=new c(g,i,!1,g,null,!1,!1)}),["cols","rows","size","span"].forEach(g=>{a[g]=new c(g,s,!1,g,null,!1,!1)}),["rowSpan","start"].forEach(g=>{a[g]=new c(g,o,!1,g.toLowerCase(),null,!1,!1)});const d=/[\-\:]([a-z])/g,f=g=>g[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(g=>{const x=g.replace(d,f);a[x]=new c(x,t,!1,g,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(g=>{const x=g.replace(d,f);a[x]=new c(x,t,!1,g,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(g=>{const x=g.replace(d,f);a[x]=new c(x,t,!1,g,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(g=>{a[g]=new c(g,t,!1,g.toLowerCase(),null,!1,!1)});const h="xlinkHref";a[h]=new c("xlinkHref",t,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(g=>{a[g]=new c(g,t,!1,g.toLowerCase(),null,!0,!0)});const{CAMELCASE:p,SAME:m,possibleStandardNames:v}=ed(),C=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",y=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+C+"]*$")),k=Object.keys(v).reduce((g,x)=>{const S=v[x];return S===m?g[x]=x:S===p?g[x.toLowerCase()]=x:g[x]=S,g},{});return Ke.BOOLEAN=r,Ke.BOOLEANISH_STRING=n,Ke.NUMERIC=o,Ke.OVERLOADED_BOOLEAN=i,Ke.POSITIVE_NUMERIC=s,Ke.RESERVED=e,Ke.STRING=t,Ke.getPropertyInfo=l,Ke.isCustomAttribute=y,Ke.possibleStandardNames=k,Ke}var On={},Qt={},Ai,fs;function nd(){if(fs)return Ai;fs=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
384
- `,a="/",u="*",d="",f="comment",h="declaration";Ai=function(m,v){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];v=v||{};var w=1,C=1;function y(P){var E=P.match(t);E&&(w+=E.length);var j=P.lastIndexOf(c);C=~j?P.length-j:C+P.length}function k(){var P={line:w,column:C};return function(E){return E.position=new g(P),R(),E}}function g(P){this.start=P,this.end={line:w,column:C},this.source=v.source}g.prototype.content=m;function x(P){var E=new Error(v.source+":"+w+":"+C+": "+P);if(E.reason=P,E.filename=v.source,E.line=w,E.column=C,E.source=m,!v.silent)throw E}function S(P){var E=P.exec(m);if(E){var j=E[0];return y(j),m=m.slice(j.length),E}}function R(){S(n)}function M(P){var E;for(P=P||[];E=z();)E!==!1&&P.push(E);return P}function z(){var P=k();if(!(a!=m.charAt(0)||u!=m.charAt(1))){for(var E=2;d!=m.charAt(E)&&(u!=m.charAt(E)||a!=m.charAt(E+1));)++E;if(E+=2,d===m.charAt(E-1))return x("End of comment missing");var j=m.slice(2,E-2);return C+=2,y(j),m=m.slice(E),C+=2,P({type:f,comment:j})}}function H(){var P=k(),E=S(r);if(E){if(z(),!S(i))return x("property missing ':'");var j=S(o),T=P({type:h,property:p(E[0].replace(e,d)),value:j?p(j[0].replace(e,d)):d});return S(s),T}}function I(){var P=[];M(P);for(var E;E=H();)E!==!1&&(P.push(E),M(P));return P}return R(),I()};function p(m){return m?m.replace(l,d):d}return Ai}var ds;function rd(){if(ds)return Qt;ds=1;var e=Qt&&Qt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default=n;var t=e(nd());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),l=typeof i=="function";return s.forEach(function(c){if(c.type==="declaration"){var a=c.property,u=c.value;l?i(a,u,c):u&&(o=o||{},o[a]=u)}}),o}return Qt}var Pn={},hs;function id(){if(hs)return Pn;hs=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(a){return!a||n.test(a)||e.test(a)},s=function(a,u){return u.toUpperCase()},l=function(a,u){return"".concat(u,"-")},c=function(a,u){return u===void 0&&(u={}),o(a)?a:(a=a.toLowerCase(),u.reactCompat?a=a.replace(i,l):a=a.replace(r,l),a.replace(t,s))};return Pn.camelCase=c,Pn}var In,ps;function od(){if(ps)return In;ps=1;var e=In&&In.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(rd()),n=id();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(s[(0,n.camelCase)(l,o)]=c)}),s}return r.default=r,In=r,In}var gs;function Ga(){return gs||(gs=1,(function(e){var t=On&&On.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=o,e.setStyleProp=l;var n=yn(),r=t(od()),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function o(u,d){return u.includes("-")?!i.has(u):!!(d&&typeof d.is=="string")}var s={reactCompat:!0};function l(u,d){if(typeof u=="string"){if(!u.trim()){d.style={};return}try{d.style=(0,r.default)(u,s)}catch{d.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var c=function(u){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(u.name)};e.canTextBeChildOfNode=c;var a=function(u){return u};e.returnFirstArg=a})(On)),On}var ms;function Ua(){if(ms)return _r;ms=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.default=o;var e=td(),t=Ga(),n=["checked","value"],r=["input","select","textarea"],i={reset:!0,submit:!0};function o(l,c){l===void 0&&(l={});var a={},u=!!(l.type&&i[l.type]);for(var d in l){var f=l[d];if((0,e.isCustomAttribute)(d)){a[d]=f;continue}var h=d.toLowerCase(),p=s(h);if(p){var m=(0,e.getPropertyInfo)(p);switch(n.includes(p)&&r.includes(c)&&!u&&(p=s("default"+h)),a[p]=f,m&&m.type){case e.BOOLEAN:a[p]=!0;break;case e.OVERLOADED_BOOLEAN:f===""&&(a[p]=!0);break}continue}t.PRESERVE_CUSTOM_ATTRIBUTES&&(a[d]=f)}return(0,t.setStyleProp)(l.style,a),a}function s(l){return e.possibleStandardNames[l]}return _r}var Jt={},ys;function sd(){if(ys)return Jt;ys=1;var e=Jt&&Jt.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.default=o;var t=yn(),n=e(Ua()),r=Ga(),i={cloneElement:t.cloneElement,createElement:t.createElement,isValidElement:t.isValidElement};function o(l,c){c===void 0&&(c={});for(var a=[],u=typeof c.replace=="function",d=c.transform||r.returnFirstArg,f=c.library||i,h=f.cloneElement,p=f.createElement,m=f.isValidElement,v=l.length,w=0;w<v;w++){var C=l[w];if(u){var y=c.replace(C,w);if(m(y)){v>1&&(y=h(y,{key:y.key||w})),a.push(d(y,C,w));continue}}if(C.type==="text"){var k=!C.data.trim().length;if(k&&C.parent&&!(0,r.canTextBeChildOfNode)(C.parent)||c.trim&&k)continue;a.push(d(C.data,C,w));continue}var g=C,x={};s(g)?((0,r.setStyleProp)(g.attribs.style,g.attribs),x=g.attribs):g.attribs&&(x=(0,n.default)(g.attribs,g.name));var S=void 0;switch(C.type){case"script":case"style":C.children[0]&&(x.dangerouslySetInnerHTML={__html:C.children[0].data});break;case"tag":C.name==="textarea"&&C.children[0]?x.defaultValue=C.children[0].data:C.children&&C.children.length&&(S=o(C.children,c));break;default:continue}v>1&&(x.key=w),a.push(d(p(C.name,x,S),C,w))}return a.length===1?a[0]:a}function s(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return Jt}var vs;function ad(){return vs||(vs=1,(function(e){var t=Mn&&Mn.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=l;var n=t(Jf());e.htmlToDOM=n.default;var r=t(Ua());e.attributesToProps=r.default;var i=t(sd());e.domToReact=i.default;var o=Ya();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return o.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return o.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return o.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return o.Text}});var s={lowerCaseAttributeNames:!1};function l(c,a){if(typeof c!="string")throw new TypeError("First argument must be a string");return c?(0,i.default)((0,n.default)(c,(a==null?void 0:a.htmlparser2)||s),a):[]}})(Mn)),Mn}var ld=ad();const xs=ni(ld),Gv=xs.default||xs;function Ce(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ce(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var cd={value:()=>{}};function oi(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Or(n)}function Or(e){this._=e}function ud(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Or.prototype=oi.prototype={constructor:Or,on:function(e,t){var n=this._,r=ud(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=fd(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=ws(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ws(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Or(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function fd(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ws(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=cd,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xi="http://www.w3.org/1999/xhtml";const bs={svg:"http://www.w3.org/2000/svg",xhtml:Xi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function si(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),bs.hasOwnProperty(t)?{space:bs[t],local:e}:e}function dd(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xi&&t.documentElement.namespaceURI===Xi?t.createElement(e):t.createElementNS(n,e)}}function hd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wa(e){var t=si(e);return(t.local?hd:dd)(t)}function pd(){}function wo(e){return e==null?pd:function(){return this.querySelector(e)}}function gd(e){typeof e!="function"&&(e=wo(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=new Array(s),c,a,u=0;u<s;++u)(c=o[u])&&(a=e.call(c,c.__data__,u,o))&&("__data__"in c&&(a.__data__=c.__data__),l[u]=a);return new Ye(r,this._parents)}function md(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yd(){return[]}function Ka(e){return e==null?yd:function(){return this.querySelectorAll(e)}}function vd(e){return function(){return md(e.apply(this,arguments))}}function xd(e){typeof e=="function"?e=vd(e):e=Ka(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],l=s.length,c,a=0;a<l;++a)(c=s[a])&&(r.push(e.call(c,c.__data__,a,s)),i.push(c));return new Ye(r,i)}function Za(e){return function(){return this.matches(e)}}function Qa(e){return function(t){return t.matches(e)}}var wd=Array.prototype.find;function bd(e){return function(){return wd.call(this.children,e)}}function Ed(){return this.firstElementChild}function _d(e){return this.select(e==null?Ed:bd(typeof e=="function"?e:Qa(e)))}var kd=Array.prototype.filter;function Sd(){return Array.from(this.children)}function Cd(e){return function(){return kd.call(this.children,e)}}function Nd(e){return this.selectAll(e==null?Sd:Cd(typeof e=="function"?e:Qa(e)))}function Td(e){typeof e!="function"&&(e=Za(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],c,a=0;a<s;++a)(c=o[a])&&e.call(c,c.__data__,a,o)&&l.push(c);return new Ye(r,this._parents)}function Ja(e){return new Array(e.length)}function Ad(){return new Ye(this._enter||this._groups.map(Ja),this._parents)}function Fr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fr.prototype={constructor:Fr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Rd(e){return function(){return e}}function jd(e,t,n,r,i,o){for(var s=0,l,c=t.length,a=o.length;s<a;++s)(l=t[s])?(l.__data__=o[s],r[s]=l):n[s]=new Fr(e,o[s]);for(;s<c;++s)(l=t[s])&&(i[s]=l)}function Md(e,t,n,r,i,o,s){var l,c,a=new Map,u=t.length,d=o.length,f=new Array(u),h;for(l=0;l<u;++l)(c=t[l])&&(f[l]=h=s.call(c,c.__data__,l,t)+"",a.has(h)?i[l]=c:a.set(h,c));for(l=0;l<d;++l)h=s.call(e,o[l],l,o)+"",(c=a.get(h))?(r[l]=c,c.__data__=o[l],a.delete(h)):n[l]=new Fr(e,o[l]);for(l=0;l<u;++l)(c=t[l])&&a.get(f[l])===c&&(i[l]=c)}function Dd(e){return e.__data__}function Od(e,t){if(!arguments.length)return Array.from(this,Dd);var n=t?Md:jd,r=this._parents,i=this._groups;typeof e!="function"&&(e=Rd(e));for(var o=i.length,s=new Array(o),l=new Array(o),c=new Array(o),a=0;a<o;++a){var u=r[a],d=i[a],f=d.length,h=Pd(e.call(u,u&&u.__data__,a,r)),p=h.length,m=l[a]=new Array(p),v=s[a]=new Array(p),w=c[a]=new Array(f);n(u,d,m,v,w,h,t);for(var C=0,y=0,k,g;C<p;++C)if(k=m[C]){for(C>=y&&(y=C+1);!(g=v[y])&&++y<p;);k._next=g||null}}return s=new Ye(s,r),s._enter=l,s._exit=c,s}function Pd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Id(){return new Ye(this._exit||this._groups.map(Ja),this._parents)}function $d(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Ld(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),c=0;c<s;++c)for(var a=n[c],u=r[c],d=a.length,f=l[c]=new Array(d),h,p=0;p<d;++p)(h=a[p]||u[p])&&(f[p]=h);for(;c<i;++c)l[c]=n[c];return new Ye(l,this._parents)}function zd(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Hd(e){e||(e=Vd);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,c=i[o]=new Array(l),a,u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new Ye(i,this._parents).order()}function Vd(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Fd(){return Array.from(this)}function qd(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Yd(){let e=0;for(const t of this)++e;return e}function Xd(){return!this.node()}function Gd(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&e.call(l,l.__data__,o,i);return this}function Ud(e){return function(){this.removeAttribute(e)}}function Wd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kd(e,t){return function(){this.setAttribute(e,t)}}function Zd(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Qd(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Jd(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function eh(e,t){var n=si(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Wd:Ud:typeof t=="function"?n.local?Jd:Qd:n.local?Zd:Kd)(n,t))}function el(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function th(e){return function(){this.style.removeProperty(e)}}function nh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rh(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ih(e,t,n){return arguments.length>1?this.each((t==null?th:typeof t=="function"?rh:nh)(e,t,n??"")):an(this.node(),e)}function an(e,t){return e.style.getPropertyValue(t)||el(e).getComputedStyle(e,null).getPropertyValue(t)}function oh(e){return function(){delete this[e]}}function sh(e,t){return function(){this[e]=t}}function ah(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function lh(e,t){return arguments.length>1?this.each((t==null?oh:typeof t=="function"?ah:sh)(e,t)):this.node()[e]}function tl(e){return e.trim().split(/^|\s+/)}function bo(e){return e.classList||new nl(e)}function nl(e){this._node=e,this._names=tl(e.getAttribute("class")||"")}nl.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function rl(e,t){for(var n=bo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function il(e,t){for(var n=bo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function ch(e){return function(){rl(this,e)}}function uh(e){return function(){il(this,e)}}function fh(e,t){return function(){(t.apply(this,arguments)?rl:il)(this,e)}}function dh(e,t){var n=tl(e+"");if(arguments.length<2){for(var r=bo(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?fh:t?ch:uh)(n,t))}function hh(){this.textContent=""}function ph(e){return function(){this.textContent=e}}function gh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mh(e){return arguments.length?this.each(e==null?hh:(typeof e=="function"?gh:ph)(e)):this.node().textContent}function yh(){this.innerHTML=""}function vh(e){return function(){this.innerHTML=e}}function xh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function wh(e){return arguments.length?this.each(e==null?yh:(typeof e=="function"?xh:vh)(e)):this.node().innerHTML}function bh(){this.nextSibling&&this.parentNode.appendChild(this)}function Eh(){return this.each(bh)}function _h(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kh(){return this.each(_h)}function Sh(e){var t=typeof e=="function"?e:Wa(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ch(){return null}function Nh(e,t){var n=typeof e=="function"?e:Wa(e),r=t==null?Ch:typeof t=="function"?t:wo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Th(){var e=this.parentNode;e&&e.removeChild(this)}function Ah(){return this.each(Th)}function Rh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Mh(e){return this.select(e?jh:Rh)}function Dh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Oh(e){return function(t){e.call(this,t,this.__data__)}}function Ph(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Ih(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function $h(e,t,n){return function(){var r=this.__on,i,o=Oh(t);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Lh(e,t,n){var r=Ph(e+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,a=l.length,u;c<a;++c)for(i=0,u=l[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(l=t?$h:Ih,i=0;i<o;++i)this.each(l(r[i],t,n));return this}function ol(e,t,n){var r=el(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function zh(e,t){return function(){return ol(this,e,t)}}function Hh(e,t){return function(){return ol(this,e,t.apply(this,arguments))}}function Vh(e,t){return this.each((typeof t=="function"?Hh:zh)(e,t))}function*Bh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var sl=[null];function Ye(e,t){this._groups=e,this._parents=t}function or(){return new Ye([[document.documentElement]],sl)}function Fh(){return this}Ye.prototype=or.prototype={constructor:Ye,select:gd,selectAll:xd,selectChild:_d,selectChildren:Nd,filter:Td,data:Od,enter:Ad,exit:Id,join:$d,merge:Ld,selection:Fh,order:zd,sort:Hd,call:Bd,nodes:Fd,node:qd,size:Yd,empty:Xd,each:Gd,attr:eh,style:ih,property:lh,classed:dh,text:mh,html:wh,raise:Eh,lower:kh,append:Sh,insert:Nh,remove:Ah,clone:Mh,datum:Dh,on:Lh,dispatch:Vh,[Symbol.iterator]:Bh};function qe(e){return typeof e=="string"?new Ye([[document.querySelector(e)]],[document.documentElement]):new Ye([[e]],sl)}function qh(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ze(e,t){if(e=qh(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Yh={passive:!1},Un={capture:!0,passive:!1};function Ri(e){e.stopImmediatePropagation()}function on(e){e.preventDefault(),e.stopImmediatePropagation()}function al(e){var t=e.document.documentElement,n=qe(e).on("dragstart.drag",on,Un);"onselectstart"in t?n.on("selectstart.drag",on,Un):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ll(e,t){var n=e.document.documentElement,r=qe(e).on("dragstart.drag",null);t&&(r.on("click.drag",on,Un),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const kr=e=>()=>e;function Gi(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:c,dy:a,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:u}})}Gi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Xh(e){return!e.ctrlKey&&!e.button}function Gh(){return this.parentNode}function Uh(e,t){return t??{x:e.x,y:e.y}}function Wh(){return navigator.maxTouchPoints||"ontouchstart"in this}function cl(){var e=Xh,t=Gh,n=Uh,r=Wh,i={},o=oi("start","drag","end"),s=0,l,c,a,u,d=0;function f(k){k.on("mousedown.drag",h).filter(r).on("touchstart.drag",v).on("touchmove.drag",w,Yh).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(k,g){if(!(u||!e.call(this,k,g))){var x=y(this,t.call(this,k,g),k,g,"mouse");x&&(qe(k.view).on("mousemove.drag",p,Un).on("mouseup.drag",m,Un),al(k.view),Ri(k),a=!1,l=k.clientX,c=k.clientY,x("start",k))}}function p(k){if(on(k),!a){var g=k.clientX-l,x=k.clientY-c;a=g*g+x*x>d}i.mouse("drag",k)}function m(k){qe(k.view).on("mousemove.drag mouseup.drag",null),ll(k.view,a),on(k),i.mouse("end",k)}function v(k,g){if(e.call(this,k,g)){var x=k.changedTouches,S=t.call(this,k,g),R=x.length,M,z;for(M=0;M<R;++M)(z=y(this,S,k,g,x[M].identifier,x[M]))&&(Ri(k),z("start",k,x[M]))}}function w(k){var g=k.changedTouches,x=g.length,S,R;for(S=0;S<x;++S)(R=i[g[S].identifier])&&(on(k),R("drag",k,g[S]))}function C(k){var g=k.changedTouches,x=g.length,S,R;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),S=0;S<x;++S)(R=i[g[S].identifier])&&(Ri(k),R("end",k,g[S]))}function y(k,g,x,S,R,M){var z=o.copy(),H=Ze(M||x,g),I,P,E;if((E=n.call(k,new Gi("beforestart",{sourceEvent:x,target:f,identifier:R,active:s,x:H[0],y:H[1],dx:0,dy:0,dispatch:z}),S))!=null)return I=E.x-H[0]||0,P=E.y-H[1]||0,function j(T,D,$){var O=H,b;switch(T){case"start":i[R]=j,b=s++;break;case"end":delete i[R],--s;case"drag":H=Ze($||D,g),b=s;break}z.call(T,k,new Gi(T,{sourceEvent:D,subject:E,target:f,identifier:R,active:b,x:H[0]+I,y:H[1]+P,dx:H[0]-O[0],dy:H[1]-O[1],dispatch:z}),S)}}return f.filter=function(k){return arguments.length?(e=typeof k=="function"?k:kr(!!k),f):e},f.container=function(k){return arguments.length?(t=typeof k=="function"?k:kr(k),f):t},f.subject=function(k){return arguments.length?(n=typeof k=="function"?k:kr(k),f):n},f.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:kr(!!k),f):r},f.on=function(){var k=o.on.apply(o,arguments);return k===o?f:k},f.clickDistance=function(k){return arguments.length?(d=(k=+k)*k,f):Math.sqrt(d)},f}function Eo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ul(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function sr(){}var Wn=.7,qr=1/Wn,sn="\\s*([+-]?\\d+)\\s*",Kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kh=/^#([0-9a-f]{3,8})$/,Zh=new RegExp(`^rgb\\(${sn},${sn},${sn}\\)$`),Qh=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),Jh=new RegExp(`^rgba\\(${sn},${sn},${sn},${Kn}\\)$`),ep=new RegExp(`^rgba\\(${it},${it},${it},${Kn}\\)$`),tp=new RegExp(`^hsl\\(${Kn},${it},${it}\\)$`),np=new RegExp(`^hsla\\(${Kn},${it},${it},${Kn}\\)$`),Es={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Eo(sr,Lt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_s,formatHex:_s,formatHex8:rp,formatHsl:ip,formatRgb:ks,toString:ks});function _s(){return this.rgb().formatHex()}function rp(){return this.rgb().formatHex8()}function ip(){return fl(this).formatHsl()}function ks(){return this.rgb().formatRgb()}function Lt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Kh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ss(t):n===3?new He(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Sr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Sr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Zh.exec(e))?new He(t[1],t[2],t[3],1):(t=Qh.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Jh.exec(e))?Sr(t[1],t[2],t[3],t[4]):(t=ep.exec(e))?Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tp.exec(e))?Ts(t[1],t[2]/100,t[3]/100,1):(t=np.exec(e))?Ts(t[1],t[2]/100,t[3]/100,t[4]):Es.hasOwnProperty(e)?Ss(Es[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function Ss(e){return new He(e>>16&255,e>>8&255,e&255,1)}function Sr(e,t,n,r){return r<=0&&(e=t=n=NaN),new He(e,t,n,r)}function op(e){return e instanceof sr||(e=Lt(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function Ui(e,t,n,r){return arguments.length===1?op(e):new He(e,t,n,r??1)}function He(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Eo(He,Ui,ul(sr,{brighter(e){return e=e==null?qr:Math.pow(qr,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wn:Math.pow(Wn,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(Pt(this.r),Pt(this.g),Pt(this.b),Yr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cs,formatHex:Cs,formatHex8:sp,formatRgb:Ns,toString:Ns}));function Cs(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}`}function sp(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}${jt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ns(){const e=Yr(this.opacity);return`${e===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${e===1?")":`, ${e})`}`}function Yr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jt(e){return e=Pt(e),(e<16?"0":"")+e.toString(16)}function Ts(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qe(e,t,n,r)}function fl(e){if(e instanceof Qe)return new Qe(e.h,e.s,e.l,e.opacity);if(e instanceof sr||(e=Lt(e)),!e)return new Qe;if(e instanceof Qe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Qe(s,l,c,e.opacity)}function ap(e,t,n,r){return arguments.length===1?fl(e):new Qe(e,t,n,r??1)}function Qe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Eo(Qe,ap,ul(sr,{brighter(e){return e=e==null?qr:Math.pow(qr,e),new Qe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wn:Math.pow(Wn,e),new Qe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new He(ji(e>=240?e-240:e+120,i,r),ji(e,i,r),ji(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qe(As(this.h),Cr(this.s),Cr(this.l),Yr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Yr(this.opacity);return`${e===1?"hsl(":"hsla("}${As(this.h)}, ${Cr(this.s)*100}%, ${Cr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function As(e){return e=(e||0)%360,e<0?e+360:e}function Cr(e){return Math.max(0,Math.min(1,e||0))}function ji(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const _o=e=>()=>e;function lp(e,t){return function(n){return e+n*t}}function cp(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function up(e){return(e=+e)==1?dl:function(t,n){return n-t?cp(t,n,e):_o(isNaN(t)?n:t)}}function dl(e,t){var n=t-e;return n?lp(e,n):_o(isNaN(e)?t:e)}const Xr=(function e(t){var n=up(t);function r(i,o){var s=n((i=Ui(i)).r,(o=Ui(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),a=dl(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=a(u),i+""}}return r.gamma=e,r})(1);function fp(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function dp(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hp(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Xn(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function pp(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gp(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Xn(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Wi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(Wi.source,"g");function mp(e){return function(){return e}}function yp(e){return function(t){return e(t)+""}}function hl(e,t){var n=Wi.lastIndex=Mi.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Wi.exec(e))&&(i=Mi.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:nt(r,i)})),n=Mi.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?yp(c[0].x):mp(t):(t=c.length,function(a){for(var u=0,d;u<t;++u)l[(d=c[u]).i]=d.x(a);return l.join("")})}function Xn(e,t){var n=typeof t,r;return t==null||n==="boolean"?_o(t):(n==="number"?nt:n==="string"?(r=Lt(t))?(t=r,Xr):hl:t instanceof Lt?Xr:t instanceof Date?pp:dp(t)?fp:Array.isArray(t)?hp:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gp:nt)(e,t)}var Rs=180/Math.PI,Ki={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pl(e,t,n,r,i,o){var s,l,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Rs,skewX:Math.atan(c)*Rs,scaleX:s,scaleY:l}}var Nr;function vp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ki:pl(t.a,t.b,t.c,t.d,t.e,t.f)}function xp(e){return e==null||(Nr||(Nr=document.createElementNS("http://www.w3.org/2000/svg","g")),Nr.setAttribute("transform",e),!(e=Nr.transform.baseVal.consolidate()))?Ki:(e=e.matrix,pl(e.a,e.b,e.c,e.d,e.e,e.f))}function gl(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function o(a,u,d,f,h,p){if(a!==d||u!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:nt(a,d)},{i:m-2,x:nt(u,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(a,u,d,f){a!==u?(a-u>180?u+=360:u-a>180&&(a+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:nt(a,u)})):u&&d.push(i(d)+"rotate("+u+r)}function l(a,u,d,f){a!==u?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:nt(a,u)}):u&&d.push(i(d)+"skewX("+u+r)}function c(a,u,d,f,h,p){if(a!==d||u!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:nt(a,d)},{i:m-2,x:nt(u,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(a,u){var d=[],f=[];return a=e(a),u=e(u),o(a.translateX,a.translateY,u.translateX,u.translateY,d,f),s(a.rotate,u.rotate,d,f),l(a.skewX,u.skewX,d,f),c(a.scaleX,a.scaleY,u.scaleX,u.scaleY,d,f),a=u=null,function(h){for(var p=-1,m=f.length,v;++p<m;)d[(v=f[p]).i]=v.x(h);return d.join("")}}}var wp=gl(vp,"px, ","px)","deg)"),bp=gl(xp,", ",")",")"),Ep=1e-12;function js(e){return((e=Math.exp(e))+1/e)/2}function _p(e){return((e=Math.exp(e))-1/e)/2}function kp(e){return((e=Math.exp(2*e))-1)/(e+1)}const Pr=(function e(t,n,r){function i(o,s){var l=o[0],c=o[1],a=o[2],u=s[0],d=s[1],f=s[2],h=u-l,p=d-c,m=h*h+p*p,v,w;if(m<Ep)w=Math.log(f/a)/t,v=function(S){return[l+S*h,c+S*p,a*Math.exp(t*S*w)]};else{var C=Math.sqrt(m),y=(f*f-a*a+r*m)/(2*a*n*C),k=(f*f-a*a-r*m)/(2*f*n*C),g=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(k*k+1)-k);w=(x-g)/t,v=function(S){var R=S*w,M=js(g),z=a/(n*C)*(M*kp(t*R+g)-_p(g));return[l+z*h,c+z*p,a*M/js(t*R+g)]}}return v.duration=w*1e3*t/Math.SQRT2,v}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,c=l*l;return e(s,l,c)},i})(Math.SQRT2,2,4);var ln=0,Bn=0,$n=0,ml=1e3,Gr,Fn,Ur=0,zt=0,ai=0,Zn=typeof performance=="object"&&performance.now?performance:Date,yl=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ko(){return zt||(yl(Sp),zt=Zn.now()+ai)}function Sp(){zt=0}function Wr(){this._call=this._time=this._next=null}Wr.prototype=vl.prototype={constructor:Wr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ko():+n)+(t==null?0:+t),!this._next&&Fn!==this&&(Fn?Fn._next=this:Gr=this,Fn=this),this._call=e,this._time=n,Zi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zi())}};function vl(e,t,n){var r=new Wr;return r.restart(e,t,n),r}function Cp(){ko(),++ln;for(var e=Gr,t;e;)(t=zt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ln}function Ms(){zt=(Ur=Zn.now())+ai,ln=Bn=0;try{Cp()}finally{ln=0,Tp(),zt=0}}function Np(){var e=Zn.now(),t=e-Ur;t>ml&&(ai-=t,Ur=e)}function Tp(){for(var e,t=Gr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Gr=n);Fn=e,Zi(r)}function Zi(e){if(!ln){Bn&&(Bn=clearTimeout(Bn));var t=e-zt;t>24?(e<1/0&&(Bn=setTimeout(Ms,e-Zn.now()-ai)),$n&&($n=clearInterval($n))):($n||(Ur=Zn.now(),$n=setInterval(Np,ml)),ln=1,yl(Ms))}}function Ds(e,t,n){var r=new Wr;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ap=oi("start","end","cancel","interrupt"),Rp=[],xl=0,Os=1,Qi=2,Ir=3,Ps=4,Ji=5,$r=6;function li(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;jp(e,n,{name:t,index:r,group:i,on:Ap,tween:Rp,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xl})}function So(e,t){var n=et(e,t);if(n.state>xl)throw new Error("too late; already scheduled");return n}function st(e,t){var n=et(e,t);if(n.state>Ir)throw new Error("too late; already running");return n}function et(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function jp(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vl(o,0,n.time);function o(a){n.state=Os,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var u,d,f,h;if(n.state!==Os)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Ir)return Ds(s);h.state===Ps?(h.state=$r,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=$r,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(Ds(function(){n.state===Ir&&(n.state=Ps,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=Qi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Qi){for(n.state=Ir,i=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function l(a){for(var u=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(c),n.state=Ji,1),d=-1,f=i.length;++d<f;)i[d].call(e,u);n.state===Ji&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=$r,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Lr(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Qi&&r.state<Ji,r.state=$r,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function Mp(e){return this.each(function(){Lr(this,e)})}function Dp(e,t){var n,r;return function(){var i=st(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Op(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=st(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var l={name:t,value:n},c=0,a=i.length;c<a;++c)if(i[c].name===t){i[c]=l;break}c===a&&i.push(l)}o.tween=i}}function Pp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=et(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?Dp:Op)(n,e,t))}function Co(e,t,n){var r=e._id;return e.each(function(){var i=st(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return et(i,r).value[t]}}function wl(e,t){var n;return(typeof t=="number"?nt:t instanceof Lt?Xr:(n=Lt(t))?(t=n,Xr):hl)(e,t)}function Ip(e){return function(){this.removeAttribute(e)}}function $p(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lp(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function zp(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function Hp(e,t,n){var r,i,o;return function(){var s,l=n(this),c;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=l+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l)))}}function Vp(e,t,n){var r,i,o;return function(){var s,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=l+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l)))}}function Bp(e,t){var n=si(e),r=n==="transform"?bp:wl;return this.attrTween(e,typeof t=="function"?(n.local?Vp:Hp)(n,r,Co(this,"attr."+e,t)):t==null?(n.local?$p:Ip)(n):(n.local?zp:Lp)(n,r,t))}function Fp(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qp(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Yp(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&qp(e,o)),n}return i._value=t,i}function Xp(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Fp(e,o)),n}return i._value=t,i}function Gp(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=si(e);return this.tween(n,(r.local?Yp:Xp)(r,t))}function Up(e,t){return function(){So(this,e).delay=+t.apply(this,arguments)}}function Wp(e,t){return t=+t,function(){So(this,e).delay=t}}function Kp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Up:Wp)(t,e)):et(this.node(),t).delay}function Zp(e,t){return function(){st(this,e).duration=+t.apply(this,arguments)}}function Qp(e,t){return t=+t,function(){st(this,e).duration=t}}function Jp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zp:Qp)(t,e)):et(this.node(),t).duration}function eg(e,t){if(typeof t!="function")throw new Error;return function(){st(this,e).ease=t}}function tg(e){var t=this._id;return arguments.length?this.each(eg(t,e)):et(this.node(),t).ease}function ng(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,e).ease=n}}function rg(e){if(typeof e!="function")throw new Error;return this.each(ng(this._id,e))}function ig(e){typeof e!="function"&&(e=Za(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],c,a=0;a<s;++a)(c=o[a])&&e.call(c,c.__data__,a,o)&&l.push(c);return new mt(r,this._parents,this._name,this._id)}function og(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),l=0;l<o;++l)for(var c=t[l],a=n[l],u=c.length,d=s[l]=new Array(u),f,h=0;h<u;++h)(f=c[h]||a[h])&&(d[h]=f);for(;l<r;++l)s[l]=t[l];return new mt(s,this._parents,this._name,this._id)}function sg(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function ag(e,t,n){var r,i,o=sg(t)?So:st;return function(){var s=o(this,e),l=s.on;l!==r&&(i=(r=l).copy()).on(t,n),s.on=i}}function lg(e,t){var n=this._id;return arguments.length<2?et(this.node(),n).on.on(e):this.each(ag(n,e,t))}function cg(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ug(){return this.on("end.remove",cg(this._id))}function fg(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wo(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var l=r[s],c=l.length,a=o[s]=new Array(c),u,d,f=0;f<c;++f)(u=l[f])&&(d=e.call(u,u.__data__,f,l))&&("__data__"in u&&(d.__data__=u.__data__),a[f]=d,li(a[f],t,n,f,a,et(u,n)));return new mt(o,this._parents,t,n)}function dg(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ka(e));for(var r=this._groups,i=r.length,o=[],s=[],l=0;l<i;++l)for(var c=r[l],a=c.length,u,d=0;d<a;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),h,p=et(u,n),m=0,v=f.length;m<v;++m)(h=f[m])&&li(h,t,n,m,f,p);o.push(f),s.push(u)}return new mt(o,s,t,n)}var hg=or.prototype.constructor;function pg(){return new hg(this._groups,this._parents)}function gg(e,t){var n,r,i;return function(){var o=an(this,e),s=(this.style.removeProperty(e),an(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function bl(e){return function(){this.style.removeProperty(e)}}function mg(e,t,n){var r,i=n+"",o;return function(){var s=an(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function yg(e,t,n){var r,i,o;return function(){var s=an(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),an(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l))}}function vg(e,t){var n,r,i,o="style."+t,s="end."+o,l;return function(){var c=st(this,e),a=c.on,u=c.value[o]==null?l||(l=bl(t)):void 0;(a!==n||i!==u)&&(r=(n=a).copy()).on(s,i=u),c.on=r}}function xg(e,t,n){var r=(e+="")=="transform"?wp:wl;return t==null?this.styleTween(e,gg(e,r)).on("end.style."+e,bl(e)):typeof t=="function"?this.styleTween(e,yg(e,r,Co(this,"style."+e,t))).each(vg(this._id,e)):this.styleTween(e,mg(e,r,t),n).on("end.style."+e,null)}function wg(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function bg(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&wg(e,s,n)),r}return o._value=t,o}function Eg(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,bg(e,t,n??""))}function _g(e){return function(){this.textContent=e}}function kg(e){return function(){var t=e(this);this.textContent=t??""}}function Sg(e){return this.tween("text",typeof e=="function"?kg(Co(this,"text",e)):_g(e==null?"":e+""))}function Cg(e){return function(t){this.textContent=e.call(this,t)}}function Ng(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cg(i)),t}return r._value=e,r}function Tg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ng(e))}function Ag(){for(var e=this._name,t=this._id,n=El(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,c,a=0;a<l;++a)if(c=s[a]){var u=et(c,t);li(c,e,n,a,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mt(r,this._parents,e,n)}function Rg(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var l={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var a=st(this,r),u=a.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),a.on=t}),i===0&&o()})}var jg=0;function mt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function El(){return++jg}var dt=or.prototype;mt.prototype={constructor:mt,select:fg,selectAll:dg,selectChild:dt.selectChild,selectChildren:dt.selectChildren,filter:ig,merge:og,selection:pg,transition:Ag,call:dt.call,nodes:dt.nodes,node:dt.node,size:dt.size,empty:dt.empty,each:dt.each,on:lg,attr:Bp,attrTween:Gp,style:xg,styleTween:Eg,text:Sg,textTween:Tg,remove:ug,tween:Pp,delay:Kp,duration:Jp,ease:tg,easeVarying:rg,end:Rg,[Symbol.iterator]:dt[Symbol.iterator]};function Mg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Dg={time:null,delay:0,duration:250,ease:Mg};function Og(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Pg(e){var t,n;e instanceof mt?(t=e._id,e=e._name):(t=El(),(n=Dg).time=ko(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,c,a=0;a<l;++a)(c=s[a])&&li(c,e,t,a,s,n||Og(c,t));return new mt(r,this._parents,e,t)}or.prototype.interrupt=Mp;or.prototype.transition=Pg;const Tr=e=>()=>e;function Ig(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function gt(e,t,n){this.k=e,this.x=t,this.y=n}gt.prototype={constructor:gt,scale:function(e){return e===1?this:new gt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new gt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ci=new gt(1,0,0);_l.prototype=gt.prototype;function _l(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ci;return e.__zoom}function Di(e){e.stopImmediatePropagation()}function Ln(e){e.preventDefault(),e.stopImmediatePropagation()}function $g(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Lg(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Is(){return this.__zoom||ci}function zg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Hg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vg(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function kl(){var e=$g,t=Lg,n=Vg,r=zg,i=Hg,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Pr,a=oi("start","zoom","end"),u,d,f,h=500,p=150,m=0,v=10;function w(E){E.property("__zoom",Is).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(E,j,T,D){var $=E.selection?E.selection():E;$.property("__zoom",Is),E!==$?g(E,j,T,D):$.interrupt().each(function(){x(this,arguments).event(D).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},w.scaleBy=function(E,j,T,D){w.scaleTo(E,function(){var $=this.__zoom.k,O=typeof j=="function"?j.apply(this,arguments):j;return $*O},T,D)},w.scaleTo=function(E,j,T,D){w.transform(E,function(){var $=t.apply(this,arguments),O=this.__zoom,b=T==null?k($):typeof T=="function"?T.apply(this,arguments):T,N=O.invert(b),L=typeof j=="function"?j.apply(this,arguments):j;return n(y(C(O,L),b,N),$,s)},T,D)},w.translateBy=function(E,j,T,D){w.transform(E,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,D)},w.translateTo=function(E,j,T,D,$){w.transform(E,function(){var O=t.apply(this,arguments),b=this.__zoom,N=D==null?k(O):typeof D=="function"?D.apply(this,arguments):D;return n(ci.translate(N[0],N[1]).scale(b.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof T=="function"?-T.apply(this,arguments):-T),O,s)},D,$)};function C(E,j){return j=Math.max(o[0],Math.min(o[1],j)),j===E.k?E:new gt(j,E.x,E.y)}function y(E,j,T){var D=j[0]-T[0]*E.k,$=j[1]-T[1]*E.k;return D===E.x&&$===E.y?E:new gt(E.k,D,$)}function k(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function g(E,j,T,D){E.on("start.zoom",function(){x(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(D).end()}).tween("zoom",function(){var $=this,O=arguments,b=x($,O).event(D),N=t.apply($,O),L=T==null?k(N):typeof T=="function"?T.apply($,O):T,V=Math.max(N[1][0]-N[0][0],N[1][1]-N[0][1]),F=$.__zoom,Y=typeof j=="function"?j.apply($,O):j,q=c(F.invert(L).concat(V/F.k),Y.invert(L).concat(V/Y.k));return function(X){if(X===1)X=Y;else{var B=q(X),U=V/B[2];X=new gt(U,L[0]-B[0]*U,L[1]-B[1]*U)}b.zoom(null,X)}})}function x(E,j,T){return!T&&E.__zooming||new S(E,j)}function S(E,j){this.that=E,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,j),this.taps=0}S.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,j){return this.mouse&&E!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var j=qe(this.that).datum();a.call(E,this.that,new Ig(E,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:a}),j)}};function R(E,...j){if(!e.apply(this,arguments))return;var T=x(this,j).event(E),D=this.__zoom,$=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),O=Ze(E);if(T.wheel)(T.mouse[0][0]!==O[0]||T.mouse[0][1]!==O[1])&&(T.mouse[1]=D.invert(T.mouse[0]=O)),clearTimeout(T.wheel);else{if(D.k===$)return;T.mouse=[O,D.invert(O)],Lr(this),T.start()}Ln(E),T.wheel=setTimeout(b,p),T.zoom("mouse",n(y(C(D,$),T.mouse[0],T.mouse[1]),T.extent,s));function b(){T.wheel=null,T.end()}}function M(E,...j){if(f||!e.apply(this,arguments))return;var T=E.currentTarget,D=x(this,j,!0).event(E),$=qe(E.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",V,!0),O=Ze(E,T),b=E.clientX,N=E.clientY;al(E.view),Di(E),D.mouse=[O,this.__zoom.invert(O)],Lr(this),D.start();function L(F){if(Ln(F),!D.moved){var Y=F.clientX-b,q=F.clientY-N;D.moved=Y*Y+q*q>m}D.event(F).zoom("mouse",n(y(D.that.__zoom,D.mouse[0]=Ze(F,T),D.mouse[1]),D.extent,s))}function V(F){$.on("mousemove.zoom mouseup.zoom",null),ll(F.view,D.moved),Ln(F),D.event(F).end()}}function z(E,...j){if(e.apply(this,arguments)){var T=this.__zoom,D=Ze(E.changedTouches?E.changedTouches[0]:E,this),$=T.invert(D),O=T.k*(E.shiftKey?.5:2),b=n(y(C(T,O),D,$),t.apply(this,j),s);Ln(E),l>0?qe(this).transition().duration(l).call(g,b,D,E):qe(this).call(w.transform,b,D,E)}}function H(E,...j){if(e.apply(this,arguments)){var T=E.touches,D=T.length,$=x(this,j,E.changedTouches.length===D).event(E),O,b,N,L;for(Di(E),b=0;b<D;++b)N=T[b],L=Ze(N,this),L=[L,this.__zoom.invert(L),N.identifier],$.touch0?!$.touch1&&$.touch0[2]!==L[2]&&($.touch1=L,$.taps=0):($.touch0=L,O=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),O&&($.taps<2&&(d=L[0],u=setTimeout(function(){u=null},h)),Lr(this),$.start())}}function I(E,...j){if(this.__zooming){var T=x(this,j).event(E),D=E.changedTouches,$=D.length,O,b,N,L;for(Ln(E),O=0;O<$;++O)b=D[O],N=Ze(b,this),T.touch0&&T.touch0[2]===b.identifier?T.touch0[0]=N:T.touch1&&T.touch1[2]===b.identifier&&(T.touch1[0]=N);if(b=T.that.__zoom,T.touch1){var V=T.touch0[0],F=T.touch0[1],Y=T.touch1[0],q=T.touch1[1],X=(X=Y[0]-V[0])*X+(X=Y[1]-V[1])*X,B=(B=q[0]-F[0])*B+(B=q[1]-F[1])*B;b=C(b,Math.sqrt(X/B)),N=[(V[0]+Y[0])/2,(V[1]+Y[1])/2],L=[(F[0]+q[0])/2,(F[1]+q[1])/2]}else if(T.touch0)N=T.touch0[0],L=T.touch0[1];else return;T.zoom("touch",n(y(b,N,L),T.extent,s))}}function P(E,...j){if(this.__zooming){var T=x(this,j).event(E),D=E.changedTouches,$=D.length,O,b;for(Di(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),O=0;O<$;++O)b=D[O],T.touch0&&T.touch0[2]===b.identifier?delete T.touch0:T.touch1&&T.touch1[2]===b.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(b=Ze(b,this),Math.hypot(d[0]-b[0],d[1]-b[1])<v)){var N=qe(this).on("dblclick.zoom");N&&N.apply(this,arguments)}}}return w.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Tr(+E),w):r},w.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Tr(!!E),w):e},w.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Tr(!!E),w):i},w.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Tr([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),w):t},w.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],w):[o[0],o[1]]},w.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(E){return arguments.length?(n=E,w):n},w.duration=function(E){return arguments.length?(l=+E,w):l},w.interpolate=function(E){return arguments.length?(c=E,w):c},w.on=function(){var E=a.on.apply(a,arguments);return E===a?w:E},w.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,w):Math.sqrt(m)},w.tapDistance=function(E){return arguments.length?(v=+E,w):v},w}const ot={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Qn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sl=["Enter"," ","Escape"],Cl={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var cn;(function(e){e.Strict="strict",e.Loose="loose"})(cn||(cn={}));var It;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(It||(It={}));var Jn;(function(e){e.Partial="partial",e.Full="full"})(Jn||(Jn={}));const Nl={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var kt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(kt||(kt={}));var Kr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Kr||(Kr={}));var ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ee||(ee={}));const $s={[ee.Left]:ee.Right,[ee.Right]:ee.Left,[ee.Top]:ee.Bottom,[ee.Bottom]:ee.Top};function Tl(e){return e===null?null:e?"valid":"invalid"}const Al=e=>"id"in e&&"source"in e&&"target"in e,Bg=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),No=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ar=(e,t=[0,0])=>{const{width:n,height:r}=yt(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},Fg=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):No(i)?i:t.nodeLookup.get(i.id));const l=s?Zr(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ui(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fi(n)},lr=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=Zr(r);n=ui(n,i)}}),fi(n)},To=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const l={...ur(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const a of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=a;if(s&&!d||f)continue;const h=u.width??a.width??a.initialWidth??null,p=u.height??a.height??a.initialHeight??null,m=er(l,fn(a)),v=(h??0)*(p??0),w=o&&m>0;(!a.internals.handleBounds||w||m>=v||a.dragging)&&c.push(a)}return c},qg=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Yg(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Xg({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const l=Yg(e,s),c=lr(l),a=Ao(c,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(a,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Rl({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:c,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},u=s.origin??r;let d=s.extent||i;if(s.extent==="parent"&&!s.expandParent)if(!l)o==null||o("005",ot.error005());else{const h=l.measured.width,p=l.measured.height;h&&p&&(d=[[c,a],[c+h,a+p]])}else l&&dn(s.extent)&&(d=[[s.extent[0][0]+c,s.extent[0][1]+a],[s.extent[1][0]+c,s.extent[1][1]+a]]);const f=dn(d)?Ht(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",ot.error015())),{position:{x:f.x-c+(s.measured.width??0)*u[0],y:f.y-a+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function Gg({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),p=!h&&f.parentId&&s.find(m=>m.id===f.parentId);(h||p)&&s.push(f)}const l=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),u=qg(s,c);for(const f of c)l.has(f.id)&&!u.find(p=>p.id===f.id)&&u.push(f);if(!i)return{edges:u,nodes:s};const d=await i({nodes:s,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:s}:{edges:[],nodes:[]}:d}const un=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ht=(e={x:0,y:0},t,n)=>({x:un(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:un(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function jl(e,t,n){const{width:r,height:i}=yt(n),{x:o,y:s}=n.internals.positionAbsolute;return Ht(e,[[o,s],[o+r,s+i]],t)}const Ls=(e,t,n)=>e<t?un(Math.abs(e-t),1,t)/t:e>n?-un(Math.abs(e-n),1,t)/t:0,Ml=(e,t,n=15,r=40)=>{const i=Ls(e.x,r,t.width-r)*n,o=Ls(e.y,r,t.height-r)*n;return[i,o]},ui=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),eo=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),fi=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),fn=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=No(e)?e.internals.positionAbsolute:ar(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Zr=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=No(e)?e.internals.positionAbsolute:ar(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Dl=(e,t)=>fi(ui(eo(e),eo(t))),er=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},zs=e=>Je(e.width)&&Je(e.height)&&Je(e.x)&&Je(e.y),Je=e=>!isNaN(e)&&isFinite(e),Ug=(e,t)=>{},cr=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ur=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?cr(l,s):l},Qr=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function en(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Wg(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=en(e,n),i=en(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=en(e.top??e.y??0,n),i=en(e.bottom??e.y??0,n),o=en(e.left??e.x??0,t),s=en(e.right??e.x??0,t);return{top:r,right:s,bottom:i,left:o,x:o+s,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Kg(e,t,n,r,i,o){const{x:s,y:l}=Qr(e,[t,n,r]),{x:c,y:a}=Qr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=o-a;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(d)}}const Ao=(e,t,n,r,i,o)=>{const s=Wg(o,t,n),l=(t-s.x)/e.width,c=(n-s.y)/e.height,a=Math.min(l,c),u=un(a,r,i),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,p=n/2-f*u,m=Kg(e,h,p,u,t,n),v={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:h-v.left+v.right,y:p-v.top+v.bottom,zoom:u}},tr=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function dn(e){return e!=null&&e!=="parent"}function yt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Ol(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Pl(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const l=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Hs(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Zg(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Qg(e){return{...Cl,...e||{}}}function Gn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=rt(e),l=ur({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:c,y:a}=n?cr(l,t):l;return{xSnapped:c,ySnapped:a,...l}}const Ro=e=>({width:e.offsetWidth,height:e.offsetHeight}),Il=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Jg=["INPUT","SELECT","TEXTAREA"];function $l(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Jg.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ll=e=>"clientX"in e,rt=(e,t)=>{var o,s;const n=Ll(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Vs=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Ro(s)}})};function zl({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:l}){const c=e*.125+i*.375+s*.375+n*.125,a=t*.125+o*.375+l*.375+r*.125,u=Math.abs(c-e),d=Math.abs(a-t);return[c,a,u,d]}function Ar(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bs({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case ee.Left:return[t-Ar(t-r,o),n];case ee.Right:return[t+Ar(r-t,o),n];case ee.Top:return[t,n-Ar(n-i,o)];case ee.Bottom:return[t,n+Ar(i-n,o)]}}function Hl({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:i,targetPosition:o=ee.Top,curvature:s=.25}){const[l,c]=Bs({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[a,u]=Bs({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,p]=zl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${r},${i}`,d,f,h,p]}function Vl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[o,l,i,s]}function e0({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:i=!1}){if(r!==void 0)return r;const o=i&&n?1e3:0,s=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return o+s}function t0({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=ui(Zr(e),Zr(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return er(s,fi(o))>0}const n0=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,r0=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),i0=(e,t)=>{if(!e.source||!e.target)return t;let n;return Al(e)?n={...e}:n={...e,id:n0(e)},r0(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Bl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,l]=Vl({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,l]}const Fs={[ee.Left]:{x:-1,y:0},[ee.Right]:{x:1,y:0},[ee.Top]:{x:0,y:-1},[ee.Bottom]:{x:0,y:1}},o0=({source:e,sourcePosition:t=ee.Bottom,target:n})=>t===ee.Left||t===ee.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},qs=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function s0({source:e,sourcePosition:t=ee.Bottom,target:n,targetPosition:r=ee.Top,center:i,offset:o,stepPosition:s}){const l=Fs[t],c=Fs[r],a={x:e.x+l.x*o,y:e.y+l.y*o},u={x:n.x+c.x*o,y:n.y+c.y*o},d=o0({source:a,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let p=[],m,v;const w={x:0,y:0},C={x:0,y:0},[,,y,k]=Vl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(m=i.x??a.x+(u.x-a.x)*s,v=i.y??(a.y+u.y)/2):(m=i.x??(a.x+u.x)/2,v=i.y??a.y+(u.y-a.y)*s);const x=[{x:m,y:a.y},{x:m,y:u.y}],S=[{x:a.x,y:v},{x:u.x,y:v}];l[f]===h?p=f==="x"?x:S:p=f==="x"?S:x}else{const x=[{x:a.x,y:u.y}],S=[{x:u.x,y:a.y}];if(f==="x"?p=l.x===h?S:x:p=l.y===h?x:S,t===r){const I=Math.abs(e[f]-n[f]);if(I<=o){const P=Math.min(o-1,o-I);l[f]===h?w[f]=(a[f]>e[f]?-1:1)*P:C[f]=(u[f]>n[f]?-1:1)*P}}if(t!==r){const I=f==="x"?"y":"x",P=l[f]===c[I],E=a[I]>u[I],j=a[I]<u[I];(l[f]===1&&(!P&&E||P&&j)||l[f]!==1&&(!P&&j||P&&E))&&(p=f==="x"?x:S)}const R={x:a.x+w.x,y:a.y+w.y},M={x:u.x+C.x,y:u.y+C.y},z=Math.max(Math.abs(R.x-p[0].x),Math.abs(M.x-p[0].x)),H=Math.max(Math.abs(R.y-p[0].y),Math.abs(M.y-p[0].y));z>=H?(m=(R.x+M.x)/2,v=p[0].y):(m=p[0].x,v=(R.y+M.y)/2)}return[[e,{x:a.x+w.x,y:a.y+w.y},...p,{x:u.x+C.x,y:u.y+C.y},n],m,v,y,k]}function a0(e,t,n,r){const i=Math.min(qs(e,t)/2,qs(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+i*a},${s}Q ${o},${s} ${o},${s+i*u}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${o},${s+i*c}Q ${o},${s} ${o+i*l},${s}`}function to({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:i,targetPosition:o=ee.Top,borderRadius:s=5,centerX:l,centerY:c,offset:a=20,stepPosition:u=.5}){const[d,f,h,p,m]=s0({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:c},offset:a,stepPosition:u});return[d.reduce((w,C,y)=>{let k="";return y>0&&y<d.length-1?k=a0(d[y-1],C,d[y+1],s):k=`${y===0?"M":"L"}${C.x} ${C.y}`,w+=k,w},""),f,h,p,m]}function Ys(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function l0(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Ys(t)||!Ys(n))return null;const r=t.internals.handleBounds||Xs(t.handles),i=n.internals.handleBounds||Xs(n.handles),o=Gs((r==null?void 0:r.source)??[],e.sourceHandle),s=Gs(e.connectionMode===cn.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(d=e.onError)==null||d.call(e,"008",ot.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||ee.Bottom,c=(s==null?void 0:s.position)||ee.Top,a=nr(t,o,l),u=nr(n,s,c);return{sourceX:a.x,sourceY:a.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:c}}function Xs(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function nr(e,t,n=ee.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??yt(e);if(r)return{x:i+s/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case ee.Top:return{x:i+s/2,y:o};case ee.Right:return{x:i+s,y:o+l/2};case ee.Bottom:return{x:i+s/2,y:o+l};case ee.Left:return{x:i,y:o+l/2}}}function Gs(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function no(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function c0(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const a=no(c,t);o.has(a)||(s.push({id:a,color:c.color||n,...c}),o.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const jo={nodeOrigin:[0,0],nodeExtent:Qn,elevateNodesOnSelect:!0,defaults:{}},u0={...jo,checkEquality:!0};function Mo(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function f0(e,t,n){const r=Mo(jo,n);for(const i of e.values())if(i.parentId)Do(i,e,t,r);else{const o=ar(i,r.nodeOrigin),s=dn(i.extent)?i.extent:r.nodeExtent,l=Ht(o,s,yt(i));i.internals.positionAbsolute=l}}function ro(e,t,n,r){var c,a;const i=Mo(u0,r);let o=e.length>0;const s=new Map(t),l=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(i.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const f=ar(u,i.nodeOrigin),h=dn(u.extent)?u.extent:i.nodeExtent,p=Ht(f,h,yt(u));d={...i.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:p,handleBounds:u.measured?d==null?void 0:d.internals.handleBounds:void 0,z:Fl(u,l),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(o=!1),u.parentId&&Do(d,t,n,r)}return o}function d0(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Do(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=Mo(jo,r),l=e.parentId,c=t.get(l);if(!c){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}d0(e,n);const a=i?1e3:0,{x:u,y:d,z:f}=h0(e,c,o,s,a),{positionAbsolute:h}=e.internals,p=u!==h.x||d!==h.y;(p||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:u,y:d}:h,z:f}})}function Fl(e,t){return(Je(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function h0(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,l=yt(e),c=ar(e,n),a=dn(e.extent)?Ht(c,e.extent,l):c;let u=Ht({x:o+a.x,y:s+a.y},r,l);e.extent==="parent"&&(u=jl(u,l,t));const d=Fl(e,i),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>=d?f+1:d}}function Oo(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const a=((s=o.get(l.parentId))==null?void 0:s.expandedRect)??fn(c),u=Dl(a,l.rect);o.set(l.parentId,{expandedRect:u,parent:c})}return o.size>0&&o.forEach(({expandedRect:l,parent:c},a)=>{var y;const u=c.internals.positionAbsolute,d=yt(c),f=c.origin??r,h=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,p=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,m=Math.max(d.width,Math.round(l.width)),v=Math.max(d.height,Math.round(l.height)),w=(m-d.width)*f[0],C=(v-d.height)*f[1];(h>0||p>0||w||C)&&(i.push({id:a,type:"position",position:{x:c.position.x-h+w,y:c.position.y-p+C}}),(y=n.get(a))==null||y.forEach(k=>{e.some(g=>g.id===k.id)||i.push({id:k.id,type:"position",position:{x:k.position.x+h,y:k.position.y+p}})})),(d.width<l.width||d.height<l.height||h||p)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?f[0]*h-w:0),height:v+(p?f[1]*p-C:0)}})}),i}function p0(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],a=window.getComputedStyle(s),{m22:u}=new window.DOMMatrixReadOnly(a.transform),d=[];for(const f of e.values()){const h=t.get(f.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),l=!0;continue}const p=Ro(f.nodeElement),m=h.measured.width!==p.width||h.measured.height!==p.height;if(!!(p.width&&p.height&&(m||!h.internals.handleBounds||f.force))){const w=f.nodeElement.getBoundingClientRect(),C=dn(h.extent)?h.extent:o;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=jl(y,p,t.get(h.parentId)):C&&(y=Ht(y,C,p));const k={...h,measured:p,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:Vs("source",f.nodeElement,w,u,h.id),target:Vs("target",f.nodeElement,w,u,h.id)}}};t.set(h.id,k),h.parentId&&Do(k,t,n,{nodeOrigin:i}),l=!0,m&&(c.push({id:h.id,type:"dimensions",dimensions:p}),h.expandParent&&h.parentId&&d.push({id:h.id,parentId:h.parentId,rect:fn(k,i)}))}}if(d.length>0){const f=Oo(d,t,n,i);c.push(...f)}return{changes:c,updatedInternals:l}}async function g0({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function Us(e,t,n,r,i,o){let s=i;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${i}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),o){s=`${i}-${e}-${o}`;const a=r.get(s)||new Map;r.set(s,a.set(n,t))}}function ql(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:l},a=`${i}-${s}--${o}-${l}`,u=`${o}-${l}--${i}-${s}`;Us("source",c,u,e,i,s),Us("target",c,a,e,o,l),t.set(r.id,r)}}function Yl(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Yl(n,t):!1}function Ws(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function m0(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Yl(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(o);l&&i.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Oi({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,c;const i=[];for(const[a,u]of t){const d=(s=n.get(a))==null?void 0:s.internals.userNode;d&&i.push({...d,position:u.position,dragging:r})}if(!e)return[i[0],i];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((c=t.get(e))==null?void 0:c.position)||o.position,dragging:r}:i[0],i]}function y0({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const o={x:n-i.distance.x,y:r-i.distance.y},s=cr(o,t);return{x:s.x-o.x,y:s.y-o.y}}function v0({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,l=new Map,c=!1,a={x:0,y:0},u=null,d=!1,f=null,h=!1,p=!1,m=null;function v({noDragClassName:C,handleSelector:y,domNode:k,isSelectable:g,nodeId:x,nodeClickDistance:S=0}){f=qe(k);function R({x:I,y:P}){const{nodeLookup:E,nodeExtent:j,snapGrid:T,snapToGrid:D,nodeOrigin:$,onNodeDrag:O,onSelectionDrag:b,onError:N,updateNodePositions:L}=t();o={x:I,y:P};let V=!1;const F=l.size>1,Y=F&&j?eo(lr(l)):null,q=F&&D?y0({dragItems:l,snapGrid:T,x:I,y:P}):null;for(const[X,B]of l){if(!E.has(X))continue;let U={x:I-B.distance.x,y:P-B.distance.y};D&&(U=q?{x:Math.round(U.x+q.x),y:Math.round(U.y+q.y)}:cr(U,T));let oe=null;if(F&&j&&!B.extent&&Y){const{positionAbsolute:J}=B.internals,W=J.x-Y.x+j[0][0],ue=J.x+B.measured.width-Y.x2+j[1][0],fe=J.y-Y.y+j[0][1],_e=J.y+B.measured.height-Y.y2+j[1][1];oe=[[W,fe],[ue,_e]]}const{position:re,positionAbsolute:Q}=Rl({nodeId:X,nextPosition:U,nodeLookup:E,nodeExtent:oe||j,nodeOrigin:$,onError:N});V=V||B.position.x!==re.x||B.position.y!==re.y,B.position=re,B.internals.positionAbsolute=Q}if(p=p||V,!!V&&(L(l,!0),m&&(r||O||!x&&b))){const[X,B]=Oi({nodeId:x,dragItems:l,nodeLookup:E});r==null||r(m,l,X,B),O==null||O(m,X,B),x||b==null||b(m,B)}}async function M(){if(!u)return;const{transform:I,panBy:P,autoPanSpeed:E,autoPanOnNodeDrag:j}=t();if(!j){c=!1,cancelAnimationFrame(s);return}const[T,D]=Ml(a,u,E);(T!==0||D!==0)&&(o.x=(o.x??0)-T/I[2],o.y=(o.y??0)-D/I[2],await P({x:T,y:D})&&R(o)),s=requestAnimationFrame(M)}function z(I){var F;const{nodeLookup:P,multiSelectionActive:E,nodesDraggable:j,transform:T,snapGrid:D,snapToGrid:$,selectNodesOnDrag:O,onNodeDragStart:b,onSelectionDragStart:N,unselectNodesAndEdges:L}=t();d=!0,(!O||!g)&&!E&&x&&((F=P.get(x))!=null&&F.selected||L()),g&&O&&x&&(e==null||e(x));const V=Gn(I.sourceEvent,{transform:T,snapGrid:D,snapToGrid:$,containerBounds:u});if(o=V,l=m0(P,j,V,x),l.size>0&&(n||b||!x&&N)){const[Y,q]=Oi({nodeId:x,dragItems:l,nodeLookup:P});n==null||n(I.sourceEvent,l,Y,q),b==null||b(I.sourceEvent,Y,q),x||N==null||N(I.sourceEvent,q)}}const H=cl().clickDistance(S).on("start",I=>{const{domNode:P,nodeDragThreshold:E,transform:j,snapGrid:T,snapToGrid:D}=t();u=(P==null?void 0:P.getBoundingClientRect())||null,h=!1,p=!1,m=I.sourceEvent,E===0&&z(I),o=Gn(I.sourceEvent,{transform:j,snapGrid:T,snapToGrid:D,containerBounds:u}),a=rt(I.sourceEvent,u)}).on("drag",I=>{const{autoPanOnNodeDrag:P,transform:E,snapGrid:j,snapToGrid:T,nodeDragThreshold:D,nodeLookup:$}=t(),O=Gn(I.sourceEvent,{transform:E,snapGrid:j,snapToGrid:T,containerBounds:u});if(m=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||x&&!$.has(x))&&(h=!0),!h){if(!c&&P&&d&&(c=!0,M()),!d){const b=O.xSnapped-(o.x??0),N=O.ySnapped-(o.y??0);Math.sqrt(b*b+N*N)>D&&z(I)}(o.x!==O.xSnapped||o.y!==O.ySnapped)&&l&&d&&(a=rt(I.sourceEvent,u),R(O))}}).on("end",I=>{if(!(!d||h)&&(c=!1,d=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:P,updateNodePositions:E,onNodeDragStop:j,onSelectionDragStop:T}=t();if(p&&(E(l,!1),p=!1),i||j||!x&&T){const[D,$]=Oi({nodeId:x,dragItems:l,nodeLookup:P,dragging:!1});i==null||i(I.sourceEvent,l,D,$),j==null||j(I.sourceEvent,D,$),x||T==null||T(I.sourceEvent,$)}}}).filter(I=>{const P=I.target;return!I.button&&(!C||!Ws(P,`.${C}`,k))&&(!y||Ws(P,y,k))});f.call(H)}function w(){f==null||f.on(".drag",null)}return{update:v,destroy:w}}function x0(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())er(i,fn(o))>0&&r.push(o);return r}const w0=250;function b0(e,t,n,r){var l,c;let i=[],o=1/0;const s=x0(e,n,t+w0);for(const a of s){const u=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((c=a.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of u){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:h}=nr(a,d,d.position,!0),p=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));p>t||(p<o?(i=[{...d,x:f,y:h}],o=p):p===o&&i.push({...d,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(u=>u.type===a)??i[0]}return i[0]}function Xl(e,t,n,r,i,o=!1){var a,u,d;const s=r.get(e);if(!s)return null;const l=i==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((u=s.internals.handleBounds)==null?void 0:u.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&o?{...c,...nr(s,c,c.position,!0)}:c}function Gl(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function E0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ul=()=>!0;function _0(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:l,nodeLookup:c,lib:a,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:m,onConnectEnd:v,isValidConnection:w=Ul,onReconnectEnd:C,updateConnection:y,getTransform:k,getFromHandle:g,autoPanSpeed:x,dragThreshold:S=1,handleDomNode:R}){const M=Il(e.target);let z=0,H;const{x:I,y:P}=rt(e),E=Gl(o,R),j=l==null?void 0:l.getBoundingClientRect();let T=!1;if(!j||!E)return;const D=Xl(i,E,r,c,t);if(!D)return;let $=rt(e,j),O=!1,b=null,N=!1,L=null;function V(){if(!u||!j)return;const[re,Q]=Ml($,j,x);f({x:re,y:Q}),z=requestAnimationFrame(V)}const F={...D,nodeId:i,type:E,position:D.position},Y=c.get(i);let X={inProgress:!0,isValid:null,from:nr(Y,F,ee.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:Y,to:$,toHandle:null,toPosition:$s[F.position],toNode:null};function B(){T=!0,y(X),p==null||p(e,{nodeId:i,handleId:r,handleType:E})}S===0&&B();function U(re){if(!T){const{x:ue,y:fe}=rt(re),_e=ue-I,le=fe-P;if(!(_e*_e+le*le>S*S))return;B()}if(!g()||!F){oe(re);return}const Q=k();$=rt(re,j),H=b0(ur($,Q,!1,[1,1]),n,c,F),O||(V(),O=!0);const J=Wl(re,{handle:H,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:M,lib:a,flowId:d,nodeLookup:c});L=J.handleDomNode,b=J.connection,N=E0(!!H,J.isValid);const W={...X,isValid:N,to:J.toHandle&&N?Qr({x:J.toHandle.x,y:J.toHandle.y},Q):$,toHandle:J.toHandle,toPosition:N&&J.toHandle?J.toHandle.position:$s[F.position],toNode:J.toHandle?c.get(J.toHandle.nodeId):null};N&&H&&X.toHandle&&W.toHandle&&X.toHandle.type===W.toHandle.type&&X.toHandle.nodeId===W.toHandle.nodeId&&X.toHandle.id===W.toHandle.id&&X.to.x===W.to.x&&X.to.y===W.to.y||(y(W),X=W)}function oe(re){if(T){(H||L)&&b&&N&&(m==null||m(b));const{inProgress:Q,...J}=X,W={...J,toPosition:X.toHandle?X.toPosition:null};v==null||v(re,W),o&&(C==null||C(re,W))}h(),cancelAnimationFrame(z),O=!1,N=!1,b=null,L=null,M.removeEventListener("mousemove",U),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",U),M.removeEventListener("touchend",oe)}M.addEventListener("mousemove",U),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",U),M.addEventListener("touchend",oe)}function Wl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:l,flowId:c,isValidConnection:a=Ul,nodeLookup:u}){const d=o==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:p}=rt(e),m=s.elementFromPoint(h,p),v=m!=null&&m.classList.contains(`${l}-flow__handle`)?m:f,w={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const C=Gl(void 0,v),y=v.getAttribute("data-nodeid"),k=v.getAttribute("data-handleid"),g=v.classList.contains("connectable"),x=v.classList.contains("connectableend");if(!y||!C)return w;const S={source:d?y:r,sourceHandle:d?k:i,target:d?r:y,targetHandle:d?i:k};w.connection=S;const M=g&&x&&(n===cn.Strict?d&&C==="source"||!d&&C==="target":y!==r||k!==i);w.isValid=M&&a(S),w.toHandle=Xl(y,C,k,u,n,!0)}return w}const io={onPointerDown:_0,isValid:Wl};function k0({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=qe(e);function o({translateExtent:l,width:c,height:a,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:h=!1}){const p=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const k=n(),g=y.sourceEvent.ctrlKey&&tr()?10:1,x=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,S=k[2]*Math.pow(2,x*g);t.scaleTo(S)};let m=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(m=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},w=y=>{const k=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const g=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],x=[g[0]-m[0],g[1]-m[1]];m=g;const S=r()*Math.max(k[2],Math.log(k[2]))*(h?-1:1),R={x:k[0]-x[0]*S,y:k[1]-x[1]*S},M=[[0,0],[c,a]];t.setViewportConstrained({x:R.x,y:R.y,zoom:k[2]},M,l)},C=kl().on("start",v).on("zoom",d?w:null).on("zoom.wheel",f?p:null);i.call(C,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:Ze}}const S0=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,di=e=>({x:e.x,y:e.y,zoom:e.k}),Pi=({x:e,y:t,zoom:n})=>ci.translate(e,t).scale(n),nn=(e,t)=>e.target.closest(`.${t}`),Kl=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),C0=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ii=(e,t=0,n=C0,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Zl=e=>{const t=e.ctrlKey&&tr()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function N0({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:a}){return u=>{if(nn(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const v=Ze(u),w=Zl(u),C=d*Math.pow(2,w);r.scaleTo(n,C,v,u);return}const f=u.deltaMode===1?20:1;let h=i===It.Vertical?0:u.deltaX*f,p=i===It.Horizontal?0:u.deltaY*f;!tr()&&u.shiftKey&&i!==It.Vertical&&(h=u.deltaY*f,p=0),r.translateBy(n,-(h/d)*o,-(p/d)*o,{internal:!0});const m=di(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,m)),e.isPanScrolling&&(c==null||c(u,m),e.panScrollTimeout=setTimeout(()=>{a==null||a(u,m),e.isPanScrolling=!1},150))}}function T0({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",s=!t&&o&&!r.ctrlKey,l=nn(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,i)}}function A0({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,l;if((o=r.sourceEvent)!=null&&o.internal)return;const i=di(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function R0({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,l;e.usedRightMouseButton=!!(n&&Kl(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((l=o.sourceEvent)!=null&&l.internal)&&(i==null||i(o.sourceEvent,di(o.transform)))}}function j0({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&Kl(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&S0(e.prevViewport,s.transform))){const c=di(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,c)},n?150:0)}}}function M0({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:l,noPanClassName:c,lib:a}){return u=>{var p;const d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(nn(u,`${a}-flow__node`)||nn(u,`${a}-flow__edge`)))return!0;if(!r&&!d&&!i&&!o&&!n||s||nn(u,l)&&u.type==="wheel"||nn(u,c)&&(u.type!=="wheel"||i&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((p=u.touches)==null?void 0:p.length)>1)return u.preventDefault(),!1;if(!d&&!i&&!f&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&h}}function D0({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=kl().clickDistance(!Je(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=qe(e).call(f);y({x:o.x,y:o.y,zoom:un(o.zoom,t,n)},[[0,0],[d.width,d.height]],i);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(Zl);function v(I,P){return h?new Promise(E=>{f==null||f.interpolate((P==null?void 0:P.interpolate)==="linear"?Xn:Pr).transform(Ii(h,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>E(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:P,onPaneContextMenu:E,userSelectionActive:j,panOnScroll:T,panOnDrag:D,panOnScrollMode:$,panOnScrollSpeed:O,preventScrolling:b,zoomOnPinch:N,zoomOnScroll:L,zoomOnDoubleClick:V,zoomActivationKeyPressed:F,lib:Y,onTransformChange:q}){j&&!u.isZoomingOrPanning&&C();const B=T&&!F&&!j?N0({zoomPanValues:u,noWheelClassName:I,d3Selection:h,d3Zoom:f,panOnScrollMode:$,panOnScrollSpeed:O,zoomOnPinch:N,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):T0({noWheelClassName:I,preventScrolling:b,d3ZoomHandler:p});if(h.on("wheel.zoom",B,{passive:!1}),!j){const oe=A0({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:l});f.on("start",oe);const re=R0({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:q});f.on("zoom",re);const Q=j0({zoomPanValues:u,panOnDrag:D,panOnScroll:T,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:a});f.on("end",Q)}const U=M0({zoomActivationKeyPressed:F,panOnDrag:D,zoomOnScroll:L,panOnScroll:T,zoomOnDoubleClick:V,zoomOnPinch:N,userSelectionActive:j,noPanClassName:P,noWheelClassName:I,lib:Y});f.filter(U),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function C(){f.on("zoom",null)}async function y(I,P,E){const j=Pi(I),T=f==null?void 0:f.constrain()(j,P,E);return T&&await v(T),new Promise(D=>D(T))}async function k(I,P){const E=Pi(I);return await v(E,P),new Promise(j=>j(E))}function g(I){if(h){const P=Pi(I),E=h.property("__zoom");(E.k!==I.zoom||E.x!==I.x||E.y!==I.y)&&(f==null||f.transform(h,P,null,{sync:!0}))}}function x(){const I=h?_l(h.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function S(I,P){return h?new Promise(E=>{f==null||f.interpolate((P==null?void 0:P.interpolate)==="linear"?Xn:Pr).scaleTo(Ii(h,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>E(!0)),I)}):Promise.resolve(!1)}function R(I,P){return h?new Promise(E=>{f==null||f.interpolate((P==null?void 0:P.interpolate)==="linear"?Xn:Pr).scaleBy(Ii(h,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>E(!0)),I)}):Promise.resolve(!1)}function M(I){f==null||f.scaleExtent(I)}function z(I){f==null||f.translateExtent(I)}function H(I){const P=!Je(I)||I<0?0:I;f==null||f.clickDistance(P)}return{update:w,destroy:C,setViewport:k,setViewportConstrained:y,getViewport:x,scaleTo:S,scaleBy:R,setScaleExtent:M,setTranslateExtent:z,syncViewport:g,setClickDistance:H}}var hn;(function(e){e.Line="line",e.Handle="handle"})(hn||(hn={}));function O0({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,l=n-r,c=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(c[0]=c[0]*-1),l&&o&&(c[1]=c[1]*-1),c}function P0(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Et(e,t){return Math.max(0,t-e)}function _t(e,t){return Math.max(0,e-t)}function Rr(e,t,n){return Math.max(0,t-e,e-n)}function Ks(e,t){return e?!t:t}function I0(e,t,n,r,i,o,s,l){let{affectsX:c,affectsY:a}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:h,ySnapped:p}=n,{minWidth:m,maxWidth:v,minHeight:w,maxHeight:C}=r,{x:y,y:k,width:g,height:x,aspectRatio:S}=e;let R=Math.floor(u?h-e.pointerX:0),M=Math.floor(d?p-e.pointerY:0);const z=g+(c?-R:R),H=x+(a?-M:M),I=-o[0]*g,P=-o[1]*x;let E=Rr(z,m,v),j=Rr(H,w,C);if(s){let $=0,O=0;c&&R<0?$=Et(y+R+I,s[0][0]):!c&&R>0&&($=_t(y+z+I,s[1][0])),a&&M<0?O=Et(k+M+P,s[0][1]):!a&&M>0&&(O=_t(k+H+P,s[1][1])),E=Math.max(E,$),j=Math.max(j,O)}if(l){let $=0,O=0;c&&R>0?$=_t(y+R,l[0][0]):!c&&R<0&&($=Et(y+z,l[1][0])),a&&M>0?O=_t(k+M,l[0][1]):!a&&M<0&&(O=Et(k+H,l[1][1])),E=Math.max(E,$),j=Math.max(j,O)}if(i){if(u){const $=Rr(z/S,w,C)*S;if(E=Math.max(E,$),s){let O=0;!c&&!a||c&&!a&&f?O=_t(k+P+z/S,s[1][1])*S:O=Et(k+P+(c?R:-R)/S,s[0][1])*S,E=Math.max(E,O)}if(l){let O=0;!c&&!a||c&&!a&&f?O=Et(k+z/S,l[1][1])*S:O=_t(k+(c?R:-R)/S,l[0][1])*S,E=Math.max(E,O)}}if(d){const $=Rr(H*S,m,v)/S;if(j=Math.max(j,$),s){let O=0;!c&&!a||a&&!c&&f?O=_t(y+H*S+I,s[1][0])/S:O=Et(y+(a?M:-M)*S+I,s[0][0])/S,j=Math.max(j,O)}if(l){let O=0;!c&&!a||a&&!c&&f?O=Et(y+H*S,l[1][0])/S:O=_t(y+(a?M:-M)*S,l[0][0])/S,j=Math.max(j,O)}}}M=M+(M<0?j:-j),R=R+(R<0?E:-E),i&&(f?z>H*S?M=(Ks(c,a)?-R:R)/S:R=(Ks(c,a)?-M:M)*S:u?(M=R/S,a=c):(R=M*S,c=a));const T=c?y+R:y,D=a?k+M:k;return{width:g+(c?-R:R),height:x+(a?-M:M),x:o[0]*R*(c?-1:1)+T,y:o[1]*M*(a?-1:1)+D}}const Ql={width:0,height:0,x:0,y:0},$0={...Ql,pointerX:0,pointerY:0,aspectRatio:1};function L0(e){return[[0,0],[e.measured.width,e.measured.height]]}function z0(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,l=n[0]*o,c=n[1]*s;return[[r-l,i-c],[r+o-l,i+s-c]]}function H0({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=qe(e);function s({controlPosition:c,boundaries:a,keepAspectRatio:u,resizeDirection:d,onResizeStart:f,onResize:h,onResizeEnd:p,shouldResize:m}){let v={...Ql},w={...$0};const C=P0(c);let y,k=null,g=[],x,S,R;const M=cl().on("start",z=>{const{nodeLookup:H,transform:I,snapGrid:P,snapToGrid:E,nodeOrigin:j,paneDomNode:T}=n();if(y=H.get(t),!y)return;k=(T==null?void 0:T.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:$}=Gn(z.sourceEvent,{transform:I,snapGrid:P,snapToGrid:E,containerBounds:k});v={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...v,pointerX:D,pointerY:$,aspectRatio:v.width/v.height},x=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(x=H.get(y.parentId),S=x&&y.extent==="parent"?L0(x):void 0),g=[],R=void 0;for(const[O,b]of H)if(b.parentId===t&&(g.push({id:O,position:{...b.position},extent:b.extent}),b.extent==="parent"||b.expandParent)){const N=z0(b,y,b.origin??j);R?R=[[Math.min(N[0][0],R[0][0]),Math.min(N[0][1],R[0][1])],[Math.max(N[1][0],R[1][0]),Math.max(N[1][1],R[1][1])]]:R=N}f==null||f(z,{...v})}).on("drag",z=>{const{transform:H,snapGrid:I,snapToGrid:P,nodeOrigin:E}=n(),j=Gn(z.sourceEvent,{transform:H,snapGrid:I,snapToGrid:P,containerBounds:k}),T=[];if(!y)return;const{x:D,y:$,width:O,height:b}=v,N={},L=y.origin??E,{width:V,height:F,x:Y,y:q}=I0(w,C,j,a,u,L,S,R),X=V!==O,B=F!==b,U=Y!==D&&X,oe=q!==$&&B;if(!U&&!oe&&!X&&!B)return;if((U||oe||L[0]===1||L[1]===1)&&(N.x=U?Y:v.x,N.y=oe?q:v.y,v.x=N.x,v.y=N.y,g.length>0)){const W=Y-D,ue=q-$;for(const fe of g)fe.position={x:fe.position.x-W+L[0]*(V-O),y:fe.position.y-ue+L[1]*(F-b)},T.push(fe)}if((X||B)&&(N.width=X&&(!d||d==="horizontal")?V:v.width,N.height=B&&(!d||d==="vertical")?F:v.height,v.width=N.width,v.height=N.height),x&&y.expandParent){const W=L[0]*(N.width??0);N.x&&N.x<W&&(v.x=W,w.x=w.x-(N.x-W));const ue=L[1]*(N.height??0);N.y&&N.y<ue&&(v.y=ue,w.y=w.y-(N.y-ue))}const re=O0({width:v.width,prevWidth:O,height:v.height,prevHeight:b,affectsX:C.affectsX,affectsY:C.affectsY}),Q={...v,direction:re};(m==null?void 0:m(z,Q))!==!1&&(h==null||h(z,Q),r(N,T))}).on("end",z=>{p==null||p(z,{...v}),i==null||i({...v})});o.call(M)}function l(){o.on(".drag",null)}return{update:s,destroy:l}}var $i={exports:{}},Li={};/**
385
- * @license React
386
- * use-sync-external-store-shim/with-selector.production.js
387
- *
388
- * Copyright (c) Meta Platforms, Inc. and affiliates.
389
- *
390
- * This source code is licensed under the MIT license found in the
391
- * LICENSE file in the root directory of this source tree.
392
- */var Zs;function V0(){if(Zs)return Li;Zs=1;var e=yn(),t=pf();function n(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Li.useSyncExternalStoreWithSelector=function(a,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=l(function(){function w(x){if(!C){if(C=!0,y=x,x=f(x),h!==void 0&&m.hasValue){var S=m.value;if(h(S,x))return k=S}return k=x}if(S=k,r(y,x))return S;var R=f(x);return h!==void 0&&h(S,R)?(y=x,S):(y=x,k=R)}var C=!1,y,k,g=d===void 0?null:d;return[function(){return w(u())},g===null?void 0:function(){return w(g())}]},[u,d,f,h]);var v=i(a,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},Li}var Qs;function B0(){return Qs||(Qs=1,$i.exports=V0()),$i.exports}var F0=B0();const q0=ni(F0),Y0={},Js=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,h))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Y0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,i,c);return c},X0=e=>e?Js(e):Js,{useDebugValue:G0}=Ra,{useSyncExternalStoreWithSelector:U0}=q0,W0=e=>e;function Jl(e,t=W0,n){const r=U0(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return G0(r),r}const ea=(e,t)=>{const n=X0(e),r=(i,o=t)=>Jl(n,i,o);return Object.assign(r,n),r},K0=(e,t)=>e?ea(e,t):ea;function Ee(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const hi=A.createContext(null),Z0=hi.Provider,ec=ot.error001();function de(e,t){const n=A.useContext(hi);if(n===null)throw new Error(ec);return Jl(n,e,t)}function be(){const e=A.useContext(hi);if(e===null)throw new Error(ec);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ta={display:"none"},Q0={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},tc="react-flow__node-desc",nc="react-flow__edge-desc",J0="react-flow__aria-live",em=e=>e.ariaLiveMessage,tm=e=>e.ariaLabelConfig;function nm({rfId:e}){const t=de(em);return _.jsx("div",{id:`${J0}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Q0,children:t})}function rm({rfId:e,disableKeyboardA11y:t}){const n=de(tm);return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:`${tc}-${e}`,style:ta,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),_.jsx("div",{id:`${nc}-${e}`,style:ta,children:n["edge.a11yDescription.default"]}),!t&&_.jsx(nm,{rfId:e})]})}const pi=A.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=`${e}`.split("-");return _.jsx("div",{className:Ce(["react-flow__panel",n,...s]),style:r,ref:o,...i,children:t})});pi.displayName="Panel";function im({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_.jsx(pi,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const om=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},jr=e=>e.id;function sm(e,t){return Ee(e.selectedNodes.map(jr),t.selectedNodes.map(jr))&&Ee(e.selectedEdges.map(jr),t.selectedEdges.map(jr))}function am({onSelectionChange:e}){const t=be(),{selectedNodes:n,selectedEdges:r}=de(om,sm);return A.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const lm=e=>!!e.onSelectionChangeHandlers;function cm({onSelectionChange:e}){const t=de(lm);return e||t?_.jsx(am,{onSelectionChange:e}):null}const rc=[0,0],um={x:0,y:0,zoom:1},fm=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],na=[...fm,"rfId"],dm=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),ra={translateExtent:Qn,nodeOrigin:rc,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function hm(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:a}=de(dm,Ee),u=be();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=ra,l()}),[]);const d=A.useRef(ra);return A.useEffect(()=>{for(const f of na){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?o(h):f==="nodeExtent"?s(h):f==="paneClickDistance"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Qg(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},na.map(f=>e[f])),null}function ia(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function pm(e){var r;const[t,n]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){n(e);return}const i=ia(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=ia())!=null&&r.matches?"dark":"light"}const oa=typeof document<"u"?document:null;function rr(e=null,t={target:oa,actInsideInputWithModifier:!0}){const[n,r]=A.useState(!1),i=A.useRef(!1),o=A.useRef(new Set([])),[s,l]=A.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
393
- `).replace(`
394
-
395
- `,`
396
- +`).split(`
397
- `)),u=a.reduce((d,f)=>d.concat(...f),[]);return[a,u]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(t==null?void 0:t.target)??oa,a=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const u=h=>{var v,w;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!a)&&$l(h))return!1;const m=aa(h.code,l);if(o.current.add(h[m]),sa(s,o.current,!1)){const C=((w=(v=h.composedPath)==null?void 0:v.call(h))==null?void 0:w[0])||h.target,y=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&h.preventDefault(),r(!0)}},d=h=>{const p=aa(h.code,l);sa(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function sa(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function aa(e,t){return t.includes(e)?"code":"key"}const gm=()=>{const e=be();return A.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:l}=e.getState(),c=Ao(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:l,y:c}=s.getBoundingClientRect(),a={x:t.x-l,y:t.y-c},u=n.snapGrid??i,d=n.snapToGrid??o;return ur(a,r,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=Qr(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function ic(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...o};for(const c of s)mm(c,l);n.push(l)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function mm(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function oc(e,t){return ic(e,t)}function sc(e,t){return ic(e,t)}function Rt(e,t){return{id:e,type:"select",selected:t}}function rn(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(Rt(o.id,s)))}return r}function la({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const l=t.get(s.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==s&&n.push({id:s.id,item:s,type:"replace"}),c===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function ca(e){return{id:e.id,type:"remove"}}const ua=e=>Bg(e),ym=e=>Al(e);function ac(e){return A.forwardRef(e)}const vm=typeof window<"u"?A.useLayoutEffect:A.useEffect;function fa(e){const[t,n]=A.useState(BigInt(0)),[r]=A.useState(()=>xm(()=>n(i=>i+BigInt(1))));return vm(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function xm(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const lc=A.createContext(null);function wm({children:e}){const t=be(),n=A.useCallback(l=>{const{nodes:c=[],setNodes:a,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f,fitViewQueued:h}=t.getState();let p=c;for(const v of l)p=typeof v=="function"?v(p):v;const m=la({items:p,lookup:f});u&&a(p),m.length>0?d==null||d(m):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:C}=t.getState();v&&C(w)})},[]),r=fa(n),i=A.useCallback(l=>{const{edges:c=[],setEdges:a,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let h=c;for(const p of l)h=typeof p=="function"?p(h):p;u?a(h):d&&d(la({items:h,lookup:f}))},[]),o=fa(i),s=A.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return _.jsx(lc.Provider,{value:s,children:e})}function bm(){const e=A.useContext(lc);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Em=e=>!!e.panZoom;function Po(){const e=gm(),t=be(),n=bm(),r=de(Em),i=A.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var w,C;const{nodeLookup:f,nodeOrigin:h}=t.getState(),p=ua(d)?d:f.get(d.id),m=p.parentId?Pl(p.position,p.measured,p.parentId,f,h):p.position,v={...p,position:m,width:((w=p.measured)==null?void 0:w.width)??p.width,height:((C=p.measured)==null?void 0:C.height)??p.height};return fn(v)},a=(d,f,h={replace:!1})=>{s(p=>p.map(m=>{if(m.id===d){const v=typeof f=="function"?f(m):f;return h.replace&&ua(v)?v:{...m,...v}}return m}))},u=(d,f,h={replace:!1})=>{l(p=>p.map(m=>{if(m.id===d){const v=typeof f=="function"?f(m):f;return h.replace&&ym(v)?v:{...m,...v}}return m}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:h}=t.getState(),[p,m,v]=h;return{nodes:d.map(w=>({...w})),edges:f.map(w=>({...w})),viewport:{x:p,y:m,zoom:v}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:h,edges:p,onNodesDelete:m,onEdgesDelete:v,triggerNodeChanges:w,triggerEdgeChanges:C,onDelete:y,onBeforeDelete:k}=t.getState(),{nodes:g,edges:x}=await Gg({nodesToRemove:d,edgesToRemove:f,nodes:h,edges:p,onBeforeDelete:k}),S=x.length>0,R=g.length>0;if(S){const M=x.map(ca);v==null||v(x),C(M)}if(R){const M=g.map(ca);m==null||m(g),w(M)}return(R||S)&&(y==null||y({nodes:g,edges:x})),{deletedNodes:g,deletedEdges:x}},getIntersectingNodes:(d,f=!0,h)=>{const p=zs(d),m=p?d:c(d),v=h!==void 0;return m?(h||t.getState().nodes).filter(w=>{const C=t.getState().nodeLookup.get(w.id);if(C&&!p&&(w.id===d.id||!C.internals.positionAbsolute))return!1;const y=fn(v?w:C),k=er(y,m);return f&&k>0||k>=y.width*y.height||k>=m.width*m.height}):[]},isNodeIntersecting:(d,f,h=!0)=>{const m=zs(d)?d:c(d);if(!m)return!1;const v=er(m,f);return h&&v>0||v>=m.width*m.height},updateNode:a,updateNodeData:(d,f,h={replace:!1})=>{a(d,p=>{const m=typeof f=="function"?f(p):f;return h.replace?{...p,data:m}:{...p,data:{...p.data,...m}}},h)},updateEdge:u,updateEdgeData:(d,f,h={replace:!1})=>{u(d,p=>{const m=typeof f=="function"?f(p):f;return h.replace?{...p,data:m}:{...p,data:{...p.data,...m}}},h)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return Fg(d,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:d,id:f,nodeId:h})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${h}-${d}${f?`-${f}`:""}`))==null?void 0:p.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:h})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${h}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:p.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??Zg();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return A.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const da=e=>e.selected,_m=typeof window<"u"?window:void 0;function km({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=be(),{deleteElements:r}=Po(),i=rr(e,{actInsideInputWithModifier:!1}),o=rr(t,{target:_m});A.useEffect(()=>{if(i){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(da),edges:s.filter(da)}),n.setState({nodesSelectionActive:!1})}},[i]),A.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function Sm(e){const t=be();A.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=Ro(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",ot.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const gi={position:"absolute",width:"100%",height:"100%",top:0,left:0},Cm=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Nm({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=It.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:a,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:h=!0,children:p,noWheelClassName:m,noPanClassName:v,onViewportChange:w,isControlledViewport:C,paneClickDistance:y}){const k=be(),g=A.useRef(null),{userSelectionActive:x,lib:S}=de(Cm,Ee),R=rr(f),M=A.useRef();Sm(g);const z=A.useCallback(H=>{w==null||w({x:H[0],y:H[1],zoom:H[2]}),C||k.setState({transform:H})},[w,C]);return A.useEffect(()=>{if(g.current){M.current=D0({domNode:g.current,minZoom:u,maxZoom:d,translateExtent:a,viewport:c,paneClickDistance:y,onDraggingChange:E=>k.setState({paneDragging:E}),onPanZoomStart:(E,j)=>{const{onViewportChangeStart:T,onMoveStart:D}=k.getState();D==null||D(E,j),T==null||T(j)},onPanZoom:(E,j)=>{const{onViewportChange:T,onMove:D}=k.getState();D==null||D(E,j),T==null||T(j)},onPanZoomEnd:(E,j)=>{const{onViewportChangeEnd:T,onMoveEnd:D}=k.getState();D==null||D(E,j),T==null||T(j)}});const{x:H,y:I,zoom:P}=M.current.getViewport();return k.setState({panZoom:M.current,transform:[H,I,P],domNode:g.current.closest(".react-flow")}),()=>{var E;(E=M.current)==null||E.destroy()}}},[]),A.useEffect(()=>{var H;(H=M.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:R,preventScrolling:h,noPanClassName:v,userSelectionActive:x,noWheelClassName:m,lib:S,onTransformChange:z})},[e,t,n,r,i,o,s,l,R,h,v,x,m,S,z]),_.jsx("div",{className:"react-flow__renderer",ref:g,style:gi,children:p})}const Tm=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Am(){const{userSelectionActive:e,userSelectionRect:t}=de(Tm,Ee);return e&&t?_.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const zi=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Rm=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function jm({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Jn.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:a,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:h}){const p=be(),{userSelectionActive:m,elementsSelectable:v,dragging:w,connectionInProgress:C}=de(Rm,Ee),y=v&&(e||m),k=A.useRef(null),g=A.useRef(),x=A.useRef(new Set),S=A.useRef(new Set),R=A.useRef(!1),M=A.useRef(!1),z=D=>{if(R.current||C){R.current=!1;return}l==null||l(D),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},H=D=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){D.preventDefault();return}c==null||c(D)},I=a?D=>a(D):void 0,P=D=>{var L,V;const{resetSelectedElements:$,domNode:O}=p.getState();if(g.current=O==null?void 0:O.getBoundingClientRect(),!v||!e||D.button!==0||D.target!==k.current||!g.current)return;(V=(L=D.target)==null?void 0:L.setPointerCapture)==null||V.call(L,D.pointerId),M.current=!0,R.current=!1;const{x:b,y:N}=rt(D.nativeEvent,g.current);$(),p.setState({userSelectionRect:{width:0,height:0,startX:b,startY:N,x:b,y:N}}),o==null||o(D)},E=D=>{const{userSelectionRect:$,transform:O,nodeLookup:b,edgeLookup:N,connectionLookup:L,triggerNodeChanges:V,triggerEdgeChanges:F,defaultEdgeOptions:Y}=p.getState();if(!g.current||!$)return;R.current=!0;const{x:q,y:X}=rt(D.nativeEvent,g.current),{startX:B,startY:U}=$,oe={startX:B,startY:U,x:q<B?q:B,y:X<U?X:U,width:Math.abs(q-B),height:Math.abs(X-U)},re=x.current,Q=S.current;x.current=new Set(To(b,oe,O,n===Jn.Partial,!0).map(W=>W.id)),S.current=new Set;const J=(Y==null?void 0:Y.selectable)??!0;for(const W of x.current){const ue=L.get(W);if(ue)for(const{edgeId:fe}of ue.values()){const _e=N.get(fe);_e&&(_e.selectable??J)&&S.current.add(fe)}}if(!Hs(re,x.current)){const W=rn(b,x.current,!0);V(W)}if(!Hs(Q,S.current)){const W=rn(N,S.current);F(W)}p.setState({userSelectionRect:oe,userSelectionActive:!0,nodesSelectionActive:!1})},j=D=>{var O,b;if(D.button!==0||!M.current)return;(b=(O=D.target)==null?void 0:O.releasePointerCapture)==null||b.call(O,D.pointerId);const{userSelectionRect:$}=p.getState();!m&&$&&D.target===k.current&&(z==null||z(D)),p.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:x.current.size>0}),s==null||s(D),(t||i)&&(R.current=!1),M.current=!1},T=r===!0||Array.isArray(r)&&r.includes(0);return _.jsxs("div",{className:Ce(["react-flow__pane",{draggable:T,dragging:w,selection:e}]),onClick:y?void 0:zi(z,k),onContextMenu:zi(H,k),onWheel:zi(I,k),onPointerEnter:y?void 0:u,onPointerDown:y?P:d,onPointerMove:y?E:d,onPointerUp:y?j:void 0,onPointerLeave:f,ref:k,style:gi,children:[h,_.jsx(Am,{})]})}function oo({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:l,onError:c}=t.getState(),a=l.get(e);if(!a){c==null||c("012",ot.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(o({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([e])}function cc({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const l=be(),[c,a]=A.useState(!1),u=A.useRef();return A.useEffect(()=>{u.current=v0({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{oo({id:d,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),A.useEffect(()=>{var d,f;if(t)(d=u.current)==null||d.destroy();else if(e.current)return(f=u.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var h;(h=u.current)==null||h.destroy()}},[n,r,t,o,e,i]),c}const Mm=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function uc(){const e=be();return A.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:l,updateNodePositions:c,nodeLookup:a,nodeOrigin:u}=e.getState(),d=new Map,f=Mm(s),h=i?o[0]:5,p=i?o[1]:5,m=n.direction.x*h*n.factor,v=n.direction.y*p*n.factor;for(const[,w]of a){if(!f(w))continue;let C={x:w.internals.positionAbsolute.x+m,y:w.internals.positionAbsolute.y+v};i&&(C=cr(C,o));const{position:y,positionAbsolute:k}=Rl({nodeId:w.id,nextPosition:C,nodeLookup:a,nodeExtent:r,nodeOrigin:u,onError:l});w.position=y,w.internals.positionAbsolute=k,d.set(w.id,w)}c(d)},[])}const Io=A.createContext(null),Dm=Io.Provider;Io.Consumer;const fc=()=>A.useContext(Io),Om=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Pm=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:l,toHandle:c,isValid:a}=s,u=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:u,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===cn.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:u&&a}};function Im({type:e="source",position:t=ee.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:l,children:c,className:a,onMouseDown:u,onTouchStart:d,...f},h){var j,T;const p=s||null,m=e==="target",v=be(),w=fc(),{connectOnClick:C,noPanClassName:y,rfId:k}=de(Om,Ee),{connectingFrom:g,connectingTo:x,clickConnecting:S,isPossibleEndHandle:R,connectionInProcess:M,clickConnectionInProcess:z,valid:H}=de(Pm(w,p,e),Ee);w||(T=(j=v.getState()).onError)==null||T.call(j,"010",ot.error010());const I=D=>{const{defaultEdgeOptions:$,onConnect:O,hasDefaultEdges:b}=v.getState(),N={...$,...D};if(b){const{edges:L,setEdges:V}=v.getState();V(i0(N,L))}O==null||O(N),l==null||l(N)},P=D=>{if(!w)return;const $=Ll(D.nativeEvent);if(i&&($&&D.button===0||!$)){const O=v.getState();io.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:m,handleId:p,nodeId:w,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:I,isValidConnection:n||O.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}$?u==null||u(D):d==null||d(D)},E=D=>{const{onClickConnectStart:$,onClickConnectEnd:O,connectionClickStartHandle:b,connectionMode:N,isValidConnection:L,lib:V,rfId:F,nodeLookup:Y,connection:q}=v.getState();if(!w||!b&&!i)return;if(!b){$==null||$(D.nativeEvent,{nodeId:w,handleId:p,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:w,type:e,id:p}});return}const X=Il(D.target),B=n||L,{connection:U,isValid:oe}=io.isValid(D.nativeEvent,{handle:{nodeId:w,id:p,type:e},connectionMode:N,fromNodeId:b.nodeId,fromHandleId:b.id||null,fromType:b.type,isValidConnection:B,flowId:F,doc:X,lib:V,nodeLookup:Y});oe&&U&&I(U);const re=structuredClone(q);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,O==null||O(D,re),v.setState({connectionClickStartHandle:null})};return _.jsx("div",{"data-handleid":p,"data-nodeid":w,"data-handlepos":t,"data-id":`${k}-${w}-${p}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,a,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,clickconnecting:S,connectingfrom:g,connectingto:x,valid:H,connectionindicator:r&&(!M||R)&&(M||z?o:i)}]),onMouseDown:P,onTouchStart:P,onClick:C?E:void 0,ref:h,...f,children:c})}const Jr=A.memo(ac(Im));function $m({data:e,isConnectable:t,sourcePosition:n=ee.Bottom}){return _.jsxs(_.Fragment,{children:[e==null?void 0:e.label,_.jsx(Jr,{type:"source",position:n,isConnectable:t})]})}function Lm({data:e,isConnectable:t,targetPosition:n=ee.Top,sourcePosition:r=ee.Bottom}){return _.jsxs(_.Fragment,{children:[_.jsx(Jr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_.jsx(Jr,{type:"source",position:r,isConnectable:t})]})}function zm(){return null}function Hm({data:e,isConnectable:t,targetPosition:n=ee.Top}){return _.jsxs(_.Fragment,{children:[_.jsx(Jr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ei={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ha={input:$m,default:Lm,output:Hm,group:zm};function Vm(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Bm=e=>{const{width:t,height:n,x:r,y:i}=lr(e.nodeLookup,{filter:o=>!!o.selected});return{width:Je(t)?t:null,height:Je(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Fm({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=be(),{width:i,height:o,transformString:s,userSelectionActive:l}=de(Bm,Ee),c=uc(),a=A.useRef(null);if(A.useEffect(()=>{var f;n||(f=a.current)==null||f.focus({preventScroll:!0})},[n]),cc({nodeRef:a}),l||!i||!o)return null;const u=e?f=>{const h=r.getState().nodes.filter(p=>p.selected);e(f,h)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(ei,f.key)&&(f.preventDefault(),c({direction:ei[f.key],factor:f.shiftKey?4:1}))};return _.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:_.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:o}})})}const pa=typeof window<"u"?window:void 0,qm=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function dc({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:a,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:y,panOnScroll:k,panOnScrollSpeed:g,panOnScrollMode:x,zoomOnDoubleClick:S,panOnDrag:R,defaultViewport:M,translateExtent:z,minZoom:H,maxZoom:I,preventScrolling:P,onSelectionContextMenu:E,noWheelClassName:j,noPanClassName:T,disableKeyboardA11y:D,onViewportChange:$,isControlledViewport:O}){const{nodesSelectionActive:b,userSelectionActive:N}=de(qm),L=rr(a,{target:pa}),V=rr(m,{target:pa}),F=V||R,Y=V||k,q=u&&F!==!0,X=L||N||q;return km({deleteKeyCode:c,multiSelectionKeyCode:p}),_.jsx(Nm,{onPaneContextMenu:o,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:y,panOnScroll:Y,panOnScrollSpeed:g,panOnScrollMode:x,zoomOnDoubleClick:S,panOnDrag:!L&&F,defaultViewport:M,translateExtent:z,minZoom:H,maxZoom:I,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:j,noPanClassName:T,onViewportChange:$,isControlledViewport:O,paneClickDistance:l,children:_.jsxs(jm,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:F,isSelecting:!!X,selectionMode:d,selectionKeyPressed:L,selectionOnDrag:q,children:[e,b&&_.jsx(Fm,{onSelectionContextMenu:E,noPanClassName:T,disableKeyboardA11y:D})]})})}dc.displayName="FlowRenderer";const Ym=A.memo(dc),Xm=e=>t=>e?To(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Gm(e){return de(A.useCallback(Xm(e),[e]),Ee)}const Um=e=>e.updateNodeInternals;function Wm(){const e=de(Um),[t]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Km({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=be(),o=A.useRef(null),s=A.useRef(null),l=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),a=A.useRef(t),u=n&&!!e.internals.handleBounds;return A.useEffect(()=>{o.current&&!e.hidden&&(!u||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[u,e.hidden]),A.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),A.useEffect(()=>{if(o.current){const d=a.current!==t,f=l.current!==e.sourcePosition,h=c.current!==e.targetPosition;(d||f||h)&&(a.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function Zm({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:c,nodesConnectable:a,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:p,rfId:m,nodeTypes:v,nodeClickDistance:w,onError:C}){const{node:y,internals:k,isParent:g}=de(B=>{const U=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:U,internals:U.internals,isParent:oe}},Ee);let x=y.type||"default",S=(v==null?void 0:v[x])||ha[x];S===void 0&&(C==null||C("003",ot.error003(x)),x="default",S=(v==null?void 0:v.default)||ha.default);const R=!!(y.draggable||l&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),z=!!(y.connectable||a&&typeof y.connectable>"u"),H=!!(y.focusable||u&&typeof y.focusable>"u"),I=be(),P=Ol(y),E=Km({node:y,nodeType:x,hasDimensions:P,resizeObserver:d}),j=cc({nodeRef:E,disabled:y.hidden||!R,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:w}),T=uc();if(y.hidden)return null;const D=yt(y),$=Vm(y),O=M||R||t||n||r||i,b=n?B=>n(B,{...k.userNode}):void 0,N=r?B=>r(B,{...k.userNode}):void 0,L=i?B=>i(B,{...k.userNode}):void 0,V=o?B=>o(B,{...k.userNode}):void 0,F=s?B=>s(B,{...k.userNode}):void 0,Y=B=>{const{selectNodesOnDrag:U,nodeDragThreshold:oe}=I.getState();M&&(!U||!R||oe>0)&&oo({id:e,store:I,nodeRef:E}),t&&t(B,{...k.userNode})},q=B=>{if(!($l(B.nativeEvent)||p)){if(Sl.includes(B.key)&&M){const U=B.key==="Escape";oo({id:e,store:I,unselect:U,nodeRef:E})}else if(R&&y.selected&&Object.prototype.hasOwnProperty.call(ei,B.key)){B.preventDefault();const{ariaLabelConfig:U}=I.getState();I.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),T({direction:ei[B.key],factor:B.shiftKey?4:1})}}},X=()=>{var W;if(p||!((W=E.current)!=null&&W.matches(":focus-visible")))return;const{transform:B,width:U,height:oe,autoPanOnNodeFocus:re,setCenter:Q}=I.getState();if(!re)return;To(new Map([[e,y]]),{x:0,y:0,width:U,height:oe},B,!0).length>0||Q(y.position.x+D.width/2,y.position.y+D.height/2,{zoom:B[2]})};return _.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${x}`,{[h]:R},y.className,{selected:y.selected,selectable:M,parent:g,draggable:R,dragging:j}]),ref:E,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:O?"all":"none",visibility:P?"visible":"hidden",...y.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:b,onMouseMove:N,onMouseLeave:L,onContextMenu:V,onClick:Y,onDoubleClick:F,onKeyDown:H?q:void 0,tabIndex:H?0:void 0,onFocus:H?X:void 0,role:y.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${tc}-${m}`,"aria-label":y.ariaLabel,...y.domAttributes,children:_.jsx(Dm,{value:e,children:_.jsx(S,{id:e,data:y.data,type:x,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:R,deletable:y.deletable??!0,isConnectable:z,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:k.z,parentId:y.parentId,...D})})})}const Qm=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hc(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=de(Qm,Ee),s=Gm(e.onlyRenderVisibleElements),l=Wm();return _.jsx("div",{className:"react-flow__nodes",style:gi,children:s.map(c=>_.jsx(Zm,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},c))})}hc.displayName="NodeRenderer";const Jm=A.memo(hc);function ey(e){return de(A.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&t0({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const ty=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return _.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ny=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return _.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ga={[Kr.Arrow]:ty,[Kr.ArrowClosed]:ny};function ry(e){const t=be();return A.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(ga,e)?ga[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ot.error009(e)),null)},[e])}const iy=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=ry(t);return c?_.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:_.jsx(c,{color:n,strokeWidth:s})}):null},pc=({defaultColor:e,rfId:t})=>{const n=de(o=>o.edges),r=de(o=>o.defaultEdgeOptions),i=A.useMemo(()=>c0(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?_.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:_.jsx("defs",{children:i.map(o=>_.jsx(iy,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};pc.displayName="MarkerDefinitions";var oy=A.memo(pc);function gc({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:a,...u}){const[d,f]=A.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",a]),p=A.useRef(null);return A.useEffect(()=>{if(p.current){const m=p.current.getBBox();f({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),n?_.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...u,children:[i&&_.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),_.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:p,style:r,children:n}),c]}):null}gc.displayName="EdgeText";const sy=A.memo(gc);function mi({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:a=20,...u}){return _.jsxs(_.Fragment,{children:[_.jsx("path",{...u,d:e,fill:"none",className:Ce(["react-flow__edge-path",u.className])}),a?_.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}):null,r&&Je(t)&&Je(n)?_.jsx(sy,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function ma({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===ee.Left||e===ee.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function mc({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:i,targetPosition:o=ee.Top}){const[s,l]=ma({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,a]=ma({pos:o,x1:r,y1:i,x2:e,y2:t}),[u,d,f,h]=zl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:a});return[`M${e},${t} C${s},${l} ${c},${a} ${r},${i}`,u,d,f,h]}function yc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s,targetPosition:l,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:v,interactionWidth:w})=>{const[C,y,k]=mc({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l}),g=e.isInternal?void 0:t;return _.jsx(mi,{id:g,path:C,labelX:y,labelY:k,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:v,interactionWidth:w})})}const ay=yc({isInternal:!1}),vc=yc({isInternal:!0});ay.displayName="SimpleBezierEdge";vc.displayName="SimpleBezierEdgeInternal";function xc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:h=ee.Bottom,targetPosition:p=ee.Top,markerEnd:m,markerStart:v,pathOptions:w,interactionWidth:C})=>{const[y,k,g]=to({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:p,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),x=e.isInternal?void 0:t;return _.jsx(mi,{id:x,path:y,labelX:k,labelY:g,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,interactionWidth:C})})}const wc=xc({isInternal:!1}),bc=xc({isInternal:!0});wc.displayName="SmoothStepEdge";bc.displayName="SmoothStepEdgeInternal";function Ec(e){return A.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return _.jsx(wc,{...n,id:r,pathOptions:A.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const ly=Ec({isInternal:!1}),_c=Ec({isInternal:!0});ly.displayName="StepEdge";_c.displayName="StepEdgeInternal";function kc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[v,w,C]=Bl({sourceX:n,sourceY:r,targetX:i,targetY:o}),y=e.isInternal?void 0:t;return _.jsx(mi,{id:y,path:v,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})})}const cy=kc({isInternal:!1}),Sc=kc({isInternal:!0});cy.displayName="StraightEdge";Sc.displayName="StraightEdgeInternal";function Cc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=ee.Bottom,targetPosition:l=ee.Top,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:v,pathOptions:w,interactionWidth:C})=>{const[y,k,g]=Hl({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l,curvature:w==null?void 0:w.curvature}),x=e.isInternal?void 0:t;return _.jsx(mi,{id:x,path:y,labelX:k,labelY:g,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:v,interactionWidth:C})})}const uy=Cc({isInternal:!1}),Nc=Cc({isInternal:!0});uy.displayName="BezierEdge";Nc.displayName="BezierEdgeInternal";const ya={default:Nc,straight:Sc,step:_c,smoothstep:bc,simplebezier:vc},va={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},fy=(e,t,n)=>n===ee.Left?e-t:n===ee.Right?e+t:e,dy=(e,t,n)=>n===ee.Top?e-t:n===ee.Bottom?e+t:e,xa="react-flow__edgeupdater";function wa({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:l}){return _.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Ce([xa,`${xa}-${l}`]),cx:fy(t,r,e),cy:dy(n,r,e),r,stroke:"transparent",fill:"transparent"})}function hy({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:l,targetPosition:c,onReconnect:a,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){const p=be(),m=(k,g)=>{if(k.button!==0)return;const{autoPanOnConnect:x,domNode:S,isValidConnection:R,connectionMode:M,connectionRadius:z,lib:H,onConnectStart:I,onConnectEnd:P,cancelConnection:E,nodeLookup:j,rfId:T,panBy:D,updateConnection:$}=p.getState(),O=g.type==="target",b=(V,F)=>{f(!1),d==null||d(V,n,g.type,F)},N=V=>a==null?void 0:a(n,V),L=(V,F)=>{f(!0),u==null||u(k,n,g.type),I==null||I(V,F)};io.onPointerDown(k.nativeEvent,{autoPanOnConnect:x,connectionMode:M,connectionRadius:z,domNode:S,handleId:g.id,nodeId:g.nodeId,nodeLookup:j,isTarget:O,edgeUpdaterType:g.type,lib:H,flowId:T,cancelConnection:E,panBy:D,isValidConnection:R,onConnect:N,onConnectStart:L,onConnectEnd:P,onReconnectEnd:b,updateConnection:$,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},v=k=>m(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=k=>m(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>h(!0),y=()=>h(!1);return _.jsxs(_.Fragment,{children:[(e===!0||e==="source")&&_.jsx(wa,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:v,onMouseEnter:C,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&_.jsx(wa,{position:c,centerX:o,centerY:s,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:y,type:"target"})]})}function py({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:a,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:p,edgeTypes:m,noPanClassName:v,onError:w,disableKeyboardA11y:C}){let y=de(Q=>Q.edgeLookup.get(e));const k=de(Q=>Q.defaultEdgeOptions);y=k?{...k,...y}:y;let g=y.type||"default",x=(m==null?void 0:m[g])||ya[g];x===void 0&&(w==null||w("011",ot.error011(g)),g="default",x=(m==null?void 0:m.default)||ya.default);const S=!!(y.focusable||t&&typeof y.focusable>"u"),R=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),z=A.useRef(null),[H,I]=A.useState(!1),[P,E]=A.useState(!1),j=be(),{zIndex:T,sourceX:D,sourceY:$,targetX:O,targetY:b,sourcePosition:N,targetPosition:L}=de(A.useCallback(Q=>{const J=Q.nodeLookup.get(y.source),W=Q.nodeLookup.get(y.target);if(!J||!W)return{zIndex:y.zIndex,...va};const ue=l0({id:e,sourceNode:J,targetNode:W,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:Q.connectionMode,onError:w});return{zIndex:e0({selected:y.selected,zIndex:y.zIndex,sourceNode:J,targetNode:W,elevateOnSelect:Q.elevateEdgesOnSelect}),...ue||va}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Ee),V=A.useMemo(()=>y.markerStart?`url('#${no(y.markerStart,p)}')`:void 0,[y.markerStart,p]),F=A.useMemo(()=>y.markerEnd?`url('#${no(y.markerEnd,p)}')`:void 0,[y.markerEnd,p]);if(y.hidden||D===null||$===null||O===null||b===null)return null;const Y=Q=>{var fe;const{addSelectedEdges:J,unselectNodesAndEdges:W,multiSelectionActive:ue}=j.getState();M&&(j.setState({nodesSelectionActive:!1}),y.selected&&ue?(W({nodes:[],edges:[y]}),(fe=z.current)==null||fe.blur()):J([e])),i&&i(Q,y)},q=o?Q=>{o(Q,{...y})}:void 0,X=s?Q=>{s(Q,{...y})}:void 0,B=l?Q=>{l(Q,{...y})}:void 0,U=c?Q=>{c(Q,{...y})}:void 0,oe=a?Q=>{a(Q,{...y})}:void 0,re=Q=>{var J;if(!C&&Sl.includes(Q.key)&&M){const{unselectNodesAndEdges:W,addSelectedEdges:ue}=j.getState();Q.key==="Escape"?((J=z.current)==null||J.blur(),W({edges:[y]})):ue([e])}};return _.jsx("svg",{style:{zIndex:T},children:_.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${g}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!i,updating:H,selectable:M}]),onClick:Y,onDoubleClick:q,onContextMenu:X,onMouseEnter:B,onMouseMove:U,onMouseLeave:oe,onKeyDown:S?re:void 0,tabIndex:S?0:void 0,role:y.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":S?`${nc}-${p}`:void 0,ref:z,...y.domAttributes,children:[!P&&_.jsx(x,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:D,sourceY:$,targetX:O,targetY:b,sourcePosition:N,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:V,markerEnd:F,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),R&&_.jsx(hy,{edge:y,isReconnectable:R,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:D,sourceY:$,targetX:O,targetY:b,sourcePosition:N,targetPosition:L,setUpdateHover:I,setReconnecting:E})]})})}const gy=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tc({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:a,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:w,elementsSelectable:C,onError:y}=de(gy,Ee),k=ey(t);return _.jsxs("div",{className:"react-flow__edges",children:[_.jsx(oy,{defaultColor:e,rfId:n}),k.map(g=>_.jsx(py,{id:g,edgesFocusable:v,edgesReconnectable:w,elementsSelectable:C,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:a,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:m},g))]})}Tc.displayName="EdgeRenderer";const my=A.memo(Tc),yy=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function vy({children:e}){const t=de(yy);return _.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function xy(e){const t=Po(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const wy=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function by(e){const t=de(wy),n=be();return A.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Ey(e){return e.connection.inProgress?{...e.connection,to:ur(e.connection.to,e.transform)}:{...e.connection}}function _y(e){return Ey}function ky(e){const t=_y();return de(t,Ee)}const Sy=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Cy({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:l,inProgress:c}=de(Sy,Ee);return!(o&&i&&c)?null:_.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:_.jsx("g",{className:Ce(["react-flow__connection",Tl(l)]),children:_.jsx(Ac,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Ac=({style:e,type:t=kt.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:l,fromPosition:c,to:a,toNode:u,toHandle:d,toPosition:f}=ky();if(!i)return;if(n)return _.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:o.x,fromY:o.y,toX:a.x,toY:a.y,fromPosition:c,toPosition:f,connectionStatus:Tl(r),toNode:u,toHandle:d});let h="";const p={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:a.x,targetY:a.y,targetPosition:f};switch(t){case kt.Bezier:[h]=Hl(p);break;case kt.SimpleBezier:[h]=mc(p);break;case kt.Step:[h]=to({...p,borderRadius:0});break;case kt.SmoothStep:[h]=to(p);break;default:[h]=Bl(p)}return _.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Ac.displayName="ConnectionLine";const Ny={};function ba(e=Ny){A.useRef(e),be(),A.useEffect(()=>{},[e])}function Ty(){be(),A.useRef(!1),A.useEffect(()=>{},[])}function Rc({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:a,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:C,selectionOnDrag:y,selectionMode:k,multiSelectionKeyCode:g,panActivationKeyCode:x,zoomActivationKeyCode:S,deleteKeyCode:R,onlyRenderVisibleElements:M,elementsSelectable:z,defaultViewport:H,translateExtent:I,minZoom:P,maxZoom:E,preventScrolling:j,defaultMarkerColor:T,zoomOnScroll:D,zoomOnPinch:$,panOnScroll:O,panOnScrollSpeed:b,panOnScrollMode:N,zoomOnDoubleClick:L,panOnDrag:V,onPaneClick:F,onPaneMouseEnter:Y,onPaneMouseMove:q,onPaneMouseLeave:X,onPaneScroll:B,onPaneContextMenu:U,paneClickDistance:oe,nodeClickDistance:re,onEdgeContextMenu:Q,onEdgeMouseEnter:J,onEdgeMouseMove:W,onEdgeMouseLeave:ue,reconnectRadius:fe,onReconnect:_e,onReconnectStart:le,onReconnectEnd:ye,noDragClassName:ke,noWheelClassName:Ve,noPanClassName:Me,disableKeyboardA11y:Ie,nodeExtent:Xe,rfId:Ge,viewport:$e,onViewportChange:Oe}){return ba(e),ba(t),Ty(),xy(n),by($e),_.jsx(Ym,{onPaneClick:F,onPaneMouseEnter:Y,onPaneMouseMove:q,onPaneMouseLeave:X,onPaneContextMenu:U,onPaneScroll:B,paneClickDistance:oe,deleteKeyCode:R,selectionKeyCode:C,selectionOnDrag:y,selectionMode:k,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:x,zoomActivationKeyCode:S,elementsSelectable:z,zoomOnScroll:D,zoomOnPinch:$,zoomOnDoubleClick:L,panOnScroll:O,panOnScrollSpeed:b,panOnScrollMode:N,panOnDrag:V,defaultViewport:H,translateExtent:I,minZoom:P,maxZoom:E,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ke,noWheelClassName:Ve,noPanClassName:Me,disableKeyboardA11y:Ie,onViewportChange:Oe,isControlledViewport:!!$e,children:_.jsxs(vy,{children:[_.jsx(my,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:_e,onReconnectStart:le,onReconnectEnd:ye,onlyRenderVisibleElements:M,onEdgeContextMenu:Q,onEdgeMouseEnter:J,onEdgeMouseMove:W,onEdgeMouseLeave:ue,reconnectRadius:fe,defaultMarkerColor:T,noPanClassName:Me,disableKeyboardA11y:Ie,rfId:Ge}),_.jsx(Cy,{style:m,type:p,component:v,containerStyle:w}),_.jsx("div",{className:"react-flow__edgelabel-renderer"}),_.jsx(Jm,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:a,onNodeContextMenu:u,nodeClickDistance:re,onlyRenderVisibleElements:M,noPanClassName:Me,noDragClassName:ke,disableKeyboardA11y:Ie,nodeExtent:Xe,rfId:Ge}),_.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rc.displayName="GraphView";const Ay=A.memo(Rc),Ea=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c=.5,maxZoom:a=2,nodeOrigin:u,nodeExtent:d}={})=>{const f=new Map,h=new Map,p=new Map,m=new Map,v=r??t??[],w=n??e??[],C=u??[0,0],y=d??Qn;ql(p,m,v);const k=ro(w,f,h,{nodeOrigin:C,nodeExtent:y,elevateNodesOnSelect:!1});let g=[0,0,1];if(s&&i&&o){const x=lr(f,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:S,y:R,zoom:M}=Ao(x,i,o,c,a,(l==null?void 0:l.padding)??.1);g=[S,R,M]}return{rfId:"1",width:0,height:0,transform:g,nodes:w,nodesInitialized:k,nodeLookup:f,parentLookup:h,edges:v,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:a,translateExtent:Qn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Nl},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ug,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Cl}},Ry=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:a,nodeOrigin:u,nodeExtent:d})=>K0((f,h)=>{async function p(){const{nodeLookup:m,panZoom:v,fitViewOptions:w,fitViewResolver:C,width:y,height:k,minZoom:g,maxZoom:x}=h();v&&(await Xg({nodes:m,width:y,height:k,panZoom:v,minZoom:g,maxZoom:x},w),C==null||C.resolve(!0),f({fitViewResolver:null}))}return{...Ea({nodes:e,edges:t,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:a,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r}),setNodes:m=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:y,fitViewQueued:k}=h(),g=ro(m,v,w,{nodeOrigin:C,nodeExtent:d,elevateNodesOnSelect:y,checkEquality:!0});k&&g?(p(),f({nodes:m,nodesInitialized:g,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:m,nodesInitialized:g})},setEdges:m=>{const{connectionLookup:v,edgeLookup:w}=h();ql(v,w,m),f({edges:m})},setDefaultNodesAndEdges:(m,v)=>{if(m){const{setNodes:w}=h();w(m),f({hasDefaultNodes:!0})}if(v){const{setEdges:w}=h();w(v),f({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:C,domNode:y,nodeOrigin:k,nodeExtent:g,debug:x,fitViewQueued:S}=h(),{changes:R,updatedInternals:M}=p0(m,w,C,y,k,g);M&&(f0(w,C,{nodeOrigin:k,nodeExtent:g}),S?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(R==null?void 0:R.length)>0&&(x&&console.log("React Flow: trigger node changes",R),v==null||v(R)))},updateNodePositions:(m,v=!1)=>{const w=[],C=[],{nodeLookup:y,triggerNodeChanges:k}=h();for(const[g,x]of m){const S=y.get(g),R=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(x!=null&&x.position)),M={id:g,type:"position",position:R?{x:Math.max(0,x.position.x),y:Math.max(0,x.position.y)}:x.position,dragging:v};R&&S.parentId&&w.push({id:g,parentId:S.parentId,rect:{...x.internals.positionAbsolute,width:x.measured.width??0,height:x.measured.height??0}}),C.push(M)}if(w.length>0){const{parentLookup:g,nodeOrigin:x}=h(),S=Oo(w,y,g,x);C.push(...S)}k(C)},triggerNodeChanges:m=>{const{onNodesChange:v,setNodes:w,nodes:C,hasDefaultNodes:y,debug:k}=h();if(m!=null&&m.length){if(y){const g=oc(m,C);w(g)}k&&console.log("React Flow: trigger node changes",m),v==null||v(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:v,setEdges:w,edges:C,hasDefaultEdges:y,debug:k}=h();if(m!=null&&m.length){if(y){const g=sc(m,C);w(g)}k&&console.log("React Flow: trigger edge changes",m),v==null||v(m)}},addSelectedNodes:m=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:C,triggerNodeChanges:y,triggerEdgeChanges:k}=h();if(v){const g=m.map(x=>Rt(x,!0));y(g);return}y(rn(C,new Set([...m]),!0)),k(rn(w))},addSelectedEdges:m=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:C,triggerNodeChanges:y,triggerEdgeChanges:k}=h();if(v){const g=m.map(x=>Rt(x,!0));k(g);return}k(rn(w,new Set([...m]))),y(rn(C,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:v}={})=>{const{edges:w,nodes:C,nodeLookup:y,triggerNodeChanges:k,triggerEdgeChanges:g}=h(),x=m||C,S=v||w,R=x.map(z=>{const H=y.get(z.id);return H&&(H.selected=!1),Rt(z.id,!1)}),M=S.map(z=>Rt(z.id,!1));k(R),g(M)},setMinZoom:m=>{const{panZoom:v,maxZoom:w}=h();v==null||v.setScaleExtent([m,w]),f({minZoom:m})},setMaxZoom:m=>{const{panZoom:v,minZoom:w}=h();v==null||v.setScaleExtent([w,m]),f({maxZoom:m})},setTranslateExtent:m=>{var v;(v=h().panZoom)==null||v.setTranslateExtent(m),f({translateExtent:m})},setPaneClickDistance:m=>{var v;(v=h().panZoom)==null||v.setClickDistance(m)},resetSelectedElements:()=>{const{edges:m,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:C,elementsSelectable:y}=h();if(!y)return;const k=v.reduce((x,S)=>S.selected?[...x,Rt(S.id,!1)]:x,[]),g=m.reduce((x,S)=>S.selected?[...x,Rt(S.id,!1)]:x,[]);w(k),C(g)},setNodeExtent:m=>{const{nodes:v,nodeLookup:w,parentLookup:C,nodeOrigin:y,elevateNodesOnSelect:k,nodeExtent:g}=h();m[0][0]===g[0][0]&&m[0][1]===g[0][1]&&m[1][0]===g[1][0]&&m[1][1]===g[1][1]||(ro(v,w,C,{nodeOrigin:y,nodeExtent:m,elevateNodesOnSelect:k,checkEquality:!1}),f({nodeExtent:m}))},panBy:m=>{const{transform:v,width:w,height:C,panZoom:y,translateExtent:k}=h();return g0({delta:m,panZoom:y,transform:v,translateExtent:k,width:w,height:C})},setCenter:async(m,v,w)=>{const{width:C,height:y,maxZoom:k,panZoom:g}=h();if(!g)return Promise.resolve(!1);const x=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await g.setViewport({x:C/2-m*x,y:y/2-v*x,zoom:x},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...Nl}})},updateConnection:m=>{f({connection:m})},reset:()=>f({...Ea()})}},Object.is);function jy({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:c,fitView:a,nodeOrigin:u,nodeExtent:d,children:f}){const[h]=A.useState(()=>Ry({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,minZoom:s,maxZoom:l,fitViewOptions:c,nodeOrigin:u,nodeExtent:d}));return _.jsx(Z0,{value:h,children:_.jsx(wm,{children:f})})}function My({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:l,fitViewOptions:c,minZoom:a,maxZoom:u,nodeOrigin:d,nodeExtent:f}){return A.useContext(hi)?_.jsx(_.Fragment,{children:e}):_.jsx(jy,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:l,initialFitViewOptions:c,initialMinZoom:a,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,children:e})}const Dy={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Oy({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:c,onInit:a,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:w,onNodeMouseEnter:C,onNodeMouseMove:y,onNodeMouseLeave:k,onNodeContextMenu:g,onNodeDoubleClick:x,onNodeDragStart:S,onNodeDrag:R,onNodeDragStop:M,onNodesDelete:z,onEdgesDelete:H,onDelete:I,onSelectionChange:P,onSelectionDragStart:E,onSelectionDrag:j,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:O,onBeforeDelete:b,connectionMode:N,connectionLineType:L=kt.Bezier,connectionLineStyle:V,connectionLineComponent:F,connectionLineContainerStyle:Y,deleteKeyCode:q="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:B=!1,selectionMode:U=Jn.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:re=tr()?"Meta":"Control",zoomActivationKeyCode:Q=tr()?"Meta":"Control",snapToGrid:J,snapGrid:W,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:fe,nodesDraggable:_e,autoPanOnNodeFocus:le,nodesConnectable:ye,nodesFocusable:ke,nodeOrigin:Ve=rc,edgesFocusable:Me,edgesReconnectable:Ie,elementsSelectable:Xe=!0,defaultViewport:Ge=um,minZoom:$e=.5,maxZoom:Oe=2,translateExtent:Re=Qn,preventScrolling:lt=!0,nodeExtent:Ne,defaultMarkerColor:vt="#b1b1b7",zoomOnScroll:Ue=!0,zoomOnPinch:Be=!0,panOnScroll:xt=!1,panOnScrollSpeed:wt=.5,panOnScrollMode:Le=It.Free,zoomOnDoubleClick:Te=!0,panOnDrag:ct=!0,onPaneClick:ie,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:pe,onPaneScroll:he,onPaneContextMenu:G,paneClickDistance:ne=0,nodeClickDistance:ge=0,children:je,onReconnect:Se,onReconnectStart:Ae,onReconnectEnd:ut,onEdgeContextMenu:ft,onEdgeDoubleClick:vn,onEdgeMouseEnter:qt,onEdgeMouseMove:bt,onEdgeMouseLeave:xn,reconnectRadius:fr=10,onNodesChange:Yt,onEdgesChange:Xt,noDragClassName:yi="nodrag",noWheelClassName:Ct="nowheel",noPanClassName:wn="nopan",fitView:dr,fitViewOptions:hr,connectOnClick:vi,attributionPosition:bn,proOptions:pr,defaultEdgeOptions:En,elevateNodesOnSelect:gr,elevateEdgesOnSelect:xi,disableKeyboardA11y:_n=!1,autoPanOnConnect:mr,autoPanOnNodeDrag:yr,autoPanSpeed:Z,connectionRadius:ve,isValidConnection:Fe,onError:ze,style:We,id:vr,nodeDragThreshold:Gt,connectionDragThreshold:Ut,viewport:wi,onViewportChange:kn,width:Sn,height:xr,colorMode:wr="light",debug:bi,onScroll:Wt,ariaLabelConfig:Cn,...Nn},Tn){const Kt=vr||"1",Wc=pm(wr),Kc=A.useCallback(Ho=>{Ho.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wt==null||Wt(Ho)},[Wt]);return _.jsx("div",{"data-testid":"rf__wrapper",...Nn,onScroll:Kc,style:{...We,...Dy},ref:Tn,className:Ce(["react-flow",i,Wc]),id:vr,role:"application",children:_.jsxs(My,{nodes:e,edges:t,width:Sn,height:xr,fitView:dr,fitViewOptions:hr,minZoom:$e,maxZoom:Oe,nodeOrigin:Ve,nodeExtent:Ne,children:[_.jsx(Ay,{onInit:a,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:y,onNodeMouseLeave:k,onNodeContextMenu:g,onNodeDoubleClick:x,nodeTypes:o,edgeTypes:s,connectionLineType:L,connectionLineStyle:V,connectionLineComponent:F,connectionLineContainerStyle:Y,selectionKeyCode:X,selectionOnDrag:B,selectionMode:U,deleteKeyCode:q,multiSelectionKeyCode:re,panActivationKeyCode:oe,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ue,defaultViewport:Ge,translateExtent:Re,minZoom:$e,maxZoom:Oe,preventScrolling:lt,zoomOnScroll:Ue,zoomOnPinch:Be,zoomOnDoubleClick:Te,panOnScroll:xt,panOnScrollSpeed:wt,panOnScrollMode:Le,panOnDrag:ct,onPaneClick:ie,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:pe,onPaneScroll:he,onPaneContextMenu:G,paneClickDistance:ne,nodeClickDistance:ge,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:O,onReconnect:Se,onReconnectStart:Ae,onReconnectEnd:ut,onEdgeContextMenu:ft,onEdgeDoubleClick:vn,onEdgeMouseEnter:qt,onEdgeMouseMove:bt,onEdgeMouseLeave:xn,reconnectRadius:fr,defaultMarkerColor:vt,noDragClassName:yi,noWheelClassName:Ct,noPanClassName:wn,rfId:Kt,disableKeyboardA11y:_n,nodeExtent:Ne,viewport:wi,onViewportChange:kn}),_.jsx(hm,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:w,nodesDraggable:_e,autoPanOnNodeFocus:le,nodesConnectable:ye,nodesFocusable:ke,edgesFocusable:Me,edgesReconnectable:Ie,elementsSelectable:Xe,elevateNodesOnSelect:gr,elevateEdgesOnSelect:xi,minZoom:$e,maxZoom:Oe,nodeExtent:Ne,onNodesChange:Yt,onEdgesChange:Xt,snapToGrid:J,snapGrid:W,connectionMode:N,translateExtent:Re,connectOnClick:vi,defaultEdgeOptions:En,fitView:dr,fitViewOptions:hr,onNodesDelete:z,onEdgesDelete:H,onDelete:I,onNodeDragStart:S,onNodeDrag:R,onNodeDragStop:M,onSelectionDrag:j,onSelectionDragStart:E,onSelectionDragStop:T,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:wn,nodeOrigin:Ve,rfId:Kt,autoPanOnConnect:mr,autoPanOnNodeDrag:yr,autoPanSpeed:Z,onError:ze,connectionRadius:ve,isValidConnection:Fe,selectNodesOnDrag:fe,nodeDragThreshold:Gt,connectionDragThreshold:Ut,onBeforeDelete:b,paneClickDistance:ne,debug:bi,ariaLabelConfig:Cn}),_.jsx(cm,{onSelectionChange:P}),je,_.jsx(im,{proOptions:pr,position:bn}),_.jsx(rm,{rfId:Kt,disableKeyboardA11y:_n})]})})}var Uv=ac(Oy);function Wv(e){const[t,n]=A.useState(e),r=A.useCallback(i=>n(o=>oc(i,o)),[]);return[t,n,r]}function Kv(e){const[t,n]=A.useState(e),r=A.useCallback(i=>n(o=>sc(i,o)),[]);return[t,n,r]}function Py({dimensions:e,lineWidth:t,variant:n,className:r}){return _.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,r])})}function Iy({radius:e,className:t}){return _.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var St;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(St||(St={}));const $y={[St.Dots]:1,[St.Lines]:1,[St.Cross]:6},Ly=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jc({id:e,variant:t=St.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:l,style:c,className:a,patternClassName:u}){const d=A.useRef(null),{transform:f,patternId:h}=de(Ly,Ee),p=r||$y[t],m=t===St.Dots,v=t===St.Cross,w=Array.isArray(n)?n:[n,n],C=[w[0]*f[2]||1,w[1]*f[2]||1],y=p*f[2],k=Array.isArray(o)?o:[o,o],g=v?[y,y]:C,x=[k[0]*f[2]||1+g[0]/2,k[1]*f[2]||1+g[1]/2],S=`${h}${e||""}`;return _.jsxs("svg",{className:Ce(["react-flow__background",a]),style:{...c,...gi,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[_.jsx("pattern",{id:S,x:f[0]%C[0],y:f[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`,children:m?_.jsx(Iy,{radius:y/2,className:u}):_.jsx(Py,{dimensions:g,lineWidth:i,variant:t,className:u})}),_.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}jc.displayName="Background";const Zv=A.memo(jc);function zy(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Hy(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vy(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function By(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Fy(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Mr({children:e,className:t,...n}){return _.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const qy=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Mc({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:a,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":h}){const p=be(),{isInteractive:m,minZoomReached:v,maxZoomReached:w,ariaLabelConfig:C}=de(qy,Ee),{zoomIn:y,zoomOut:k,fitView:g}=Po(),x=()=>{y(),o==null||o()},S=()=>{k(),s==null||s()},R=()=>{g(i),l==null||l()},M=()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),c==null||c(!m)},z=f==="horizontal"?"horizontal":"vertical";return _.jsxs(pi,{className:Ce(["react-flow__controls",z,a]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??C["controls.ariaLabel"],children:[t&&_.jsxs(_.Fragment,{children:[_.jsx(Mr,{onClick:x,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:w,children:_.jsx(zy,{})}),_.jsx(Mr,{onClick:S,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:v,children:_.jsx(Hy,{})})]}),n&&_.jsx(Mr,{className:"react-flow__controls-fitview",onClick:R,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:_.jsx(Vy,{})}),r&&_.jsx(Mr,{className:"react-flow__controls-interactive",onClick:M,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:m?_.jsx(Fy,{}):_.jsx(By,{})}),u]})}Mc.displayName="Controls";const Qv=A.memo(Mc);function Yy({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:l,strokeWidth:c,className:a,borderRadius:u,shapeRendering:d,selected:f,onClick:h}){const{background:p,backgroundColor:m}=o||{},v=s||p||m;return _.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},a]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:d,onClick:h?w=>h(w,e):void 0})}const Xy=A.memo(Yy),Gy=e=>e.nodes.map(t=>t.id),Hi=e=>e instanceof Function?e:()=>e;function Uy({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=Xy,onClick:s}){const l=de(Gy,Ee),c=Hi(t),a=Hi(e),u=Hi(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return _.jsx(_.Fragment,{children:l.map(f=>_.jsx(Ky,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:a,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:d},f))})}function Wy({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:l,onClick:c}){const{node:a,x:u,y:d,width:f,height:h}=de(p=>{const{internals:m}=p.nodeLookup.get(e),v=m.userNode,{x:w,y:C}=m.positionAbsolute,{width:y,height:k}=yt(v);return{node:v,x:w,y:C,width:y,height:k}},Ee);return!a||a.hidden||!Ol(a)?null:_.jsx(l,{x:u,y:d,width:f,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:o,shapeRendering:s,onClick:c,id:a.id})}const Ky=A.memo(Wy);var Zy=A.memo(Uy);const Qy=200,Jy=150,e1=e=>!e.hidden,t1=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Dl(lr(e.nodeLookup,{filter:e1}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},n1="react-flow__minimap-desc";function Dc({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:c,maskColor:a,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:m=!1,zoomable:v=!1,ariaLabel:w,inversePan:C,zoomStep:y=1,offsetScale:k=5}){const g=be(),x=A.useRef(null),{boundingRect:S,viewBB:R,rfId:M,panZoom:z,translateExtent:H,flowWidth:I,flowHeight:P,ariaLabelConfig:E}=de(t1,Ee),j=(e==null?void 0:e.width)??Qy,T=(e==null?void 0:e.height)??Jy,D=S.width/j,$=S.height/T,O=Math.max(D,$),b=O*j,N=O*T,L=k*O,V=S.x-(b-S.width)/2-L,F=S.y-(N-S.height)/2-L,Y=b+L*2,q=N+L*2,X=`${n1}-${M}`,B=A.useRef(0),U=A.useRef();B.current=O,A.useEffect(()=>{if(x.current&&z)return U.current=k0({domNode:x.current,panZoom:z,getTransform:()=>g.getState().transform,getViewScale:()=>B.current}),()=>{var J;(J=U.current)==null||J.destroy()}},[z]),A.useEffect(()=>{var J;(J=U.current)==null||J.update({translateExtent:H,width:I,height:P,inversePan:C,pannable:m,zoomStep:y,zoomable:v})},[m,v,C,y,H,I,P]);const oe=h?J=>{var fe;const[W,ue]=((fe=U.current)==null?void 0:fe.pointer(J))||[0,0];h(J,{x:W,y:ue})}:void 0,re=p?A.useCallback((J,W)=>{const ue=g.getState().nodeLookup.get(W).internals.userNode;p(J,ue)},[]):void 0,Q=w??E["minimap.ariaLabel"];return _.jsx(pi,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*O:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:_.jsxs("svg",{width:j,height:T,viewBox:`${V} ${F} ${Y} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:x,onClick:oe,children:[Q&&_.jsx("title",{id:X,children:Q}),_.jsx(Zy,{onClick:re,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),_.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-L},${F-L}h${Y+L*2}v${q+L*2}h${-Y-L*2}z
398
- M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Dc.displayName="MiniMap";A.memo(Dc);const r1=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,i1={[hn.Line]:"right",[hn.Handle]:"bottom-right"};function o1({nodeId:e,position:t,variant:n=hn.Handle,className:r,style:i=void 0,children:o,color:s,minWidth:l=10,minHeight:c=10,maxWidth:a=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:p,onResizeStart:m,onResize:v,onResizeEnd:w}){const C=fc(),y=typeof e=="string"?e:C,k=be(),g=A.useRef(null),x=n===hn.Handle,S=de(A.useCallback(r1(x&&h),[x,h]),Ee),R=A.useRef(null),M=t??i1[n];A.useEffect(()=>{if(!(!g.current||!y))return R.current||(R.current=H0({domNode:g.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:H,transform:I,snapGrid:P,snapToGrid:E,nodeOrigin:j,domNode:T}=k.getState();return{nodeLookup:H,transform:I,snapGrid:P,snapToGrid:E,nodeOrigin:j,paneDomNode:T}},onChange:(H,I)=>{const{triggerNodeChanges:P,nodeLookup:E,parentLookup:j,nodeOrigin:T}=k.getState(),D=[],$={x:H.x,y:H.y},O=E.get(y);if(O&&O.expandParent&&O.parentId){const b=O.origin??T,N=H.width??O.measured.width??0,L=H.height??O.measured.height??0,V={id:O.id,parentId:O.parentId,rect:{width:N,height:L,...Pl({x:H.x??O.position.x,y:H.y??O.position.y},{width:N,height:L},O.parentId,E,b)}},F=Oo([V],E,j,T);D.push(...F),$.x=H.x?Math.max(b[0]*N,H.x):void 0,$.y=H.y?Math.max(b[1]*L,H.y):void 0}if($.x!==void 0&&$.y!==void 0){const b={id:y,type:"position",position:{...$}};D.push(b)}if(H.width!==void 0&&H.height!==void 0){const N={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};D.push(N)}for(const b of I){const N={...b,type:"position"};D.push(N)}P(D)},onEnd:({width:H,height:I})=>{const P={id:y,type:"dimensions",resizing:!1,dimensions:{width:H,height:I}};k.getState().triggerNodeChanges([P])}})),R.current.update({controlPosition:M,boundaries:{minWidth:l,minHeight:c,maxWidth:a,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:v,onResizeEnd:w,shouldResize:p}),()=>{var H;(H=R.current)==null||H.destroy()}},[M,l,c,a,u,d,m,v,w,p]);const z=M.split("-");return _.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...z,n,r]),ref:g,style:{...i,scale:S,...s&&{[x?"backgroundColor":"borderColor"]:s}},children:o})}A.memo(o1);const Mt=(e,t,n,r,i)=>{if(!r)throw new Error(i??`Invalid property path: ${t}
399
- Couldn't access "${n}" in ${JSON.stringify(e)}`)},_a=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zr=e=>Array.isArray(e),Oc=(e,t)=>e.filter(((n,r)=>r!==t)),s1=(e,t,n,r={})=>{const{remove:i=!1,createNew:o=!0,noError:s=!1}=r,l=e,c=typeof(a=t)=="string"?a:typeof a=="number"?String(a):a.reduce(((f,h)=>typeof h=="number"?`${f}[${h}]`:f===""?h:`${f}.${h}`),"");var a;const u=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:s,fullData:l,fullPath:c}),d=Array.isArray(t)?t:(f=>Array.isArray(f)?f:f.split(/(\.|\[\d+\])/).filter((h=>h!=="."&&h!=="")).map((h=>{const p=/\[(\d+)\]/.exec(h);return p?Number(p[1]):h})).flat())(t).filter((f=>f!==""));return zr(e)&&i&&d.length===1?Oc(e,d[0]):qn(e,d,n,u)},qn=(e,t,n,r)=>{const i=_a(e)?Object.assign({},e):null,o=zr(e)?[...e]:null;if(t.length===0)return e;if(!i&&!o)throw new Error("Can't assign property -- invalid input object");const{createNew:s,remove:l,noError:c,fullData:a,fullPath:u}=r,d=t[0];if(o&&typeof d=="string")return o.map((m=>qn(m,t,n,r)));if(t.length===1){if(i&&typeof d=="string"){const m=a1(i,d,n,r);return m??i}return o&&typeof d=="number"?(l1(o,d,n,r),o):(Mt(a,u,d,c),e)}const f=i||o||[];if(l&&t.length===2&&typeof t[1]=="number"){const m=f[d],v=t[1];return zr(m)?f[d]=Oc(m,v):Mt(a,u,d,c,"Trying to remove an indexed item from an object that is not an array"),f}const h=t.slice(1);if(d in e){if(p=f[d],!zr(p)&&!_a(p)){if(!s)return Mt(a,u,d,c),f;f[d]={}}return f[d]=qn(f[d],h,n,r),f}var p;if(s){const m=typeof h[0]=="number"?[]:{};if(i)return f[d]=m,f[d]=qn(f[d],h,n,r),f;if(o&&Array.isArray(f)){f.push(m);const v=f.length-1;return f[v]=qn(f[v],h,n,r),f}}return Mt(a,u,d,c),f},a1=(e,t,n,r)=>{const{remove:i,createNew:o,noError:s,insertAfter:l,insertBefore:c,fullData:a,fullPath:u}=r;if(c!==void 0||l!==void 0){const f=Object.entries(e);let h=1/0;return h=typeof c=="number"?c:typeof l=="number"?l:f.findIndex((([p,m])=>p===(c??l))),l&&h++,f.splice(h,0,[t,n]),Object.fromEntries(f)}const d=t in e;i?d?delete e[t]:Mt(a,u,t,s):o||d?e[t]=n:Mt(a,u,t,s)},l1=(e,t,n,r)=>{const{noError:i,fullData:o,fullPath:s,createNew:l,insert:c}=r;c&&e.splice(t,0,n),t in e?e[t]=n:l?e.push(n):Mt(o,s,t,i)},pn=(e,t,n)=>{const r=Array.isArray(t)?t:c1(t);if(r.length===0)return e;const i=r[0];if(Array.isArray(e)&&typeof i!="number")return e.map((s=>pn(s,r)));if(typeof e!="object"||e===null||!(i in e))return u1(e,i);const o=e[i];return r.length===1?o:pn(o,r.slice(1))},c1=e=>e.split(/(\.|\[\d+\])/).filter((t=>t!=="."&&t!=="")).map((t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t})).flat(),u1=(e,t,n)=>{throw new Error(`Unable to extract object property
400
- Looking for property: ${t}
401
- In object: ${JSON.stringify(e)}`)};function Pc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function tn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(a){try{c(r.next(a))}catch(u){o(u)}}function l(a){try{c(r.throw(a))}catch(u){o(u)}}function c(a){var u;a.done?i(a.value):(u=a.value,u instanceof n?u:new n((function(d){d(u)}))).then(s,l)}c((r=r.apply(e,[])).next())}))}const Ic=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:o,textAreaRef:s})=>{if(typeof n!="string")return null;const l=n.slice(-1)===`
402
- `?n+".":n;return _.jsxs("div",{style:{display:"grid"},children:[_.jsx("textarea",{id:`${t}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},o),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:c=>r(c.target.value),autoFocus:!0,onFocus:c=>{n.length<40&&c.target.select()},onKeyDown:i}),_.jsx("span",{className:e,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},o),children:l})]})},gn=e=>e!==null&&typeof e=="object",$c=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!so(r,t,n))return!1}if(!n&&r&&!so(r,t))return!1;break;case"value":if(n&&!n(t,r)||!n&&r&&!mn(t,r))return!1}return!0},so=(e="",t,n=mn)=>{const r=t.value;return Object.entries(r).some((([i,o])=>{const s=[...t.path,i],l=Object.assign(Object.assign({},t),{key:i,path:s,level:t.level+1,value:o,size:s.length,parentData:r});return gn(o)?so(e,l,n):n(l,e)}))},mn=(e,t="")=>{const{value:n}=e;if(n===null&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||t==="1":"false".includes(t.toLowerCase())||t==="0";default:return!1}},ka=({key:e,path:t},n="")=>!!mn({value:e},n)||!!t.some((r=>mn({value:r},n))),Ft=(e,t)=>(t??"")+e.map((n=>n===""?"\0":n)).join("."),$o=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,f1=(e,t,n)=>{const r=e.key,i=$o(e);if(Array.isArray(t))return!!i&&t.includes(i);const{key:o,modifier:s}=t;return(n!=="stringLineBreak"||r!=="Enter"||i!=="Shift"||o!=="Enter"||!(s!=null&&s.includes("Shift")))&&r===o&&(s===i||Array.isArray(s)&&s.includes(i))},At={key:"Enter"},Sa={confirm:At,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},At),{modifier:["Meta","Shift","Control"]}),objectLineBreak:At,stringConfirm:At,stringLineBreak:Object.assign(Object.assign({},At),{modifier:["Shift"]}),numberConfirm:At,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:At,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},Dt=(e,t,n="next",r)=>{const i=t.slice(0,t.length-1),o=t.slice(-1)[0];if(o===void 0)return null;const s=pn(e,i),l=d1(s);Array.isArray(s)||r(l,(({key:u,value:d})=>[u,d]));const c=l.findIndex((u=>u.key===o)),a=l[c+(n==="next"?1:-1)];return a?gn(a.value)?Object.keys(a.value).length===0?Dt(e,[...i,a.key],n,r):Lc(e,[...i,a.key],n,r):[...i,a.key]:i.length===0?null:Dt(e,i,n,r)},Lc=(e,t,n="next",r)=>{const i=pn(e,t);if(!gn(i))return t;const o=Array.isArray(i)?i.map(((l,c)=>c)):Object.keys(i);r(o,(l=>[l,i]));const s=n==="next"?o[0]:o[o.length-1];return Lc(e,[...t,s],n,r)},d1=e=>Array.isArray(e)?e.map(((t,n)=>({index:n,value:t,key:n}))):Object.entries(e).map((([t,n],r)=>({key:t,value:n,index:r}))),zc=(e,t)=>{var n,r,i,o;const s=e.current,l=(n=s==null?void 0:s.selectionStart)!==null&&n!==void 0?n:1/0,c=(r=s==null?void 0:s.selectionEnd)!==null&&r!==void 0?r:1/0,a=((i=s==null?void 0:s.textContent)===null||i===void 0?void 0:i.slice(0,l))+t+((o=s==null?void 0:s.textContent)===null||o===void 0?void 0:o.slice(c));return s.value=a,s==null||s.setSelectionRange(l+1,l+1),a},ao=e=>{if(e!==Hc){if(Array.isArray(e))return e.map((t=>ao(t)));if(e&&typeof e=="object")for(const t in e)e[t]=ao(e[t]);return e}},Hc="__​undefined__",Lo={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},Vc=A.createContext({getStyles:()=>({}),icons:{}}),h1=({theme:e=Lo,icons:t={},docRoot:n,children:r})=>{const i=p1(e,n);return _.jsx(Vc.Provider,{value:{getStyles:(o,s)=>typeof i[o]=="function"?i[o](s):i[o],icons:t},children:r})},at=()=>A.useContext(Vc),p1=(e,t)=>{var n,r,i,o;const s={},l=(Array.isArray(e)?e:[e]).map((u=>g1(u)?Vi({fragments:{},styles:u},s):Vi(u,s))),c=Vi(Lo,{});Object.keys(c).forEach((u=>{const d=u;l.forEach((f=>{f[d]&&(c[d]=Object.assign(Object.assign({},c[d]),f[d]))}))}));const a=Object.assign({},c);return Object.entries(s).forEach((([u,d])=>{const f=u;a[f]=h=>{const p=d(h)||{};return Object.assign(Object.assign({},c[f]),p)}})),typeof(a==null?void 0:a.inputHighlight)!="function"&&(!((n=a==null?void 0:a.inputHighlight)===null||n===void 0)&&n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",(r=a==null?void 0:a.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof(a==null?void 0:a.iconCopy)!="function"&&(!((i=a==null?void 0:a.iconCopy)===null||i===void 0)&&i.color)&&t.style.setProperty("--jer-icon-copy-color",(o=a==null?void 0:a.iconCopy)===null||o===void 0?void 0:o.color),a},Vi=(e,t)=>{const{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach((([o,s])=>{const l=(Array.isArray(s)?s:[s]).reduce(((c,a)=>{var u,d;if(typeof a=="function")return t[o]=a,Object.assign({},c);if(typeof a=="string"){const f=(u=n==null?void 0:n[a])!==null&&u!==void 0?u:a;return typeof f=="string"?Object.assign(Object.assign({},c),{[(d=m1[o])!==null&&d!==void 0?d:"color"]:f}):Object.assign(Object.assign({},c),f)}return Object.assign(Object.assign({},c),a)}),{});i[o]=l})),i},g1=e=>!("styles"in e),m1={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},Bc=A.createContext(null),y1=({children:e,onEditEvent:t,onCollapse:n})=>{const[r,i]=A.useState(null),[o,s]=A.useState(null),[l,c]=A.useState(null),[a,u]=A.useState({path:null,pathString:null}),d=A.useRef(null),f=A.useRef("next"),h=A.useRef(null);return _.jsx(Bc.Provider,{value:{collapseState:r,setCollapseState:p=>{i(p),n&&p!==null&&(Array.isArray(p)?p.forEach((m=>n(m))):n(p)),p!==null&&setTimeout((()=>i(null)),2e3)},getMatchingCollapseState:p=>{if(Array.isArray(r)){for(const m of r)if(Ca(p,m))return m;return null}return Ca(p,r)?r:null},currentlyEditingElement:o,setCurrentlyEditingElement:(p,m)=>{const v=typeof p=="string"||p===null?p:Ft(p,m==="key"?"key_":void 0);o!==null&&v!==null&&d.current!==null&&d.current(),s(v),t&&(Array.isArray(p)||p===null)&&t(p,m==="key"),d.current=typeof m=="function"?m:null},areChildrenBeingEdited:p=>o!==null&&o.includes(p),previouslyEditedElement:h.current,setPreviouslyEditedElement:p=>{h.current=p},tabDirection:f.current,setTabDirection:p=>{f.current=p},previousValue:l,setPreviousValue:c,dragSource:a,setDragSource:u},children:e})},Vt=()=>{const e=A.useContext(Bc);if(!e)throw new Error("Missing Context Provider");return e},Ca=(e,t)=>{if(t===null)return!1;if(!t.includeChildren)return t.path.every(((n,r)=>e[r]===n))&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},lo="**INVALID_FUNCTION**",v1=({nodeData:e,showStringQuotes:t=!0,stringTruncate:n=200,pathString:r,canEdit:i,setIsEditing:o,styles:s,translate:l,value:c,TextWrapper:a=({children:u})=>u})=>{const u=c??e.value,[d,f]=A.useState(!1),h=t?'"':"",p=u.length>n,m=()=>{i?o(!0):f(!d)};return _.jsxs("div",{id:`${r}_display`,onDoubleClick:m,onClick:v=>{(v.getModifierState("Control")||v.getModifierState("Meta"))&&m()},className:"jer-value-string",style:s,children:[h,p?_.jsxs(_.Fragment,d?{children:[_.jsx(a,{children:_.jsxs("span",{children:[u,h]})}),_.jsxs("span",{className:"jer-string-expansion jer-show-less",onClick:()=>f(!1),children:[" ",l("SHOW_LESS",e)]})]}:{children:[_.jsxs(a,{children:[_.jsx("span",{children:u.slice(0,n-2).trimEnd()})," "]}),_.jsx("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>f(!0),children:"..."}),h]}):_.jsx(a,{children:`${u}${h}`})]})},x1=({styles:e,pathString:t,value:n,setValue:r,handleEdit:i,handleKeyboard:o,keyboardCommon:s})=>{const l=A.useRef(null);return _.jsx(Ic,{className:"jer-input-text",textAreaRef:l,name:t,value:n,setValue:r,handleKeyPress:c=>{o(c,Object.assign({stringConfirm:i,stringLineBreak:()=>{const a=zc(l,`
403
- `);r(a)}},s))},styles:e})},w1=e=>{var{isEditing:t,path:n,enumType:r}=e,i=Pc(e,["isEditing","path","enumType"]);const{getStyles:o}=at(),s=Ft(n),{value:l,setValue:c,nodeData:a,handleEdit:u,handleKeyboard:d,keyboardCommon:f}=i;return t&&r?_.jsxs("div",{className:"jer-select jer-select-enums",children:[_.jsx("select",{name:`${s}-value-select`,className:"jer-select-inner",onChange:h=>c(h.target.value),value:l,autoFocus:!0,onKeyDown:h=>{d(h,Object.assign({stringConfirm:u},f))},children:r.values.map((h=>_.jsx("option",{value:h,children:h},h)))}),_.jsx("span",{className:"focus"})]}):t?_.jsx(x1,Object.assign({styles:o("input",a),pathString:s},i,{setValue:i.setValue})):_.jsx(v1,Object.assign({pathString:s,styles:o("string",a)},i))},b1=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:a}=at();return n?_.jsx("input",{className:"jer-input-number",type:"text",name:Ft(r),value:e,onChange:u=>t(u.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:u=>setTimeout((()=>u.target.select()),10),onKeyDown:u=>l(u,Object.assign({numberConfirm:o,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+"em"},a("input",s))}):_.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:a("number",s),children:e})},E1=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:a}=at();return typeof e!="boolean"?null:n?_.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:Ft(r),checked:e,onChange:()=>t(!e),onKeyDown:u=>{u.key===" "&&u.preventDefault(),l(u,Object.assign({booleanConfirm:o,booleanToggle:()=>t(!e)},c))},autoFocus:!0}):_.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:a("boolean",s),children:String(e)})},_1=(e,t)=>{const n=A.useRef(void 0),r=A.useRef(t);A.useEffect((()=>{r.current=t}),[t]);const i=o=>{r.current(o)};A.useEffect((()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout((()=>{window.addEventListener("keydown",i)}),100),()=>{window.clearTimeout(n.current),window.removeEventListener("keydown",i)}}),[e])},k1=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:s})=>{const{getStyles:l}=at();return _1(t,(c=>o(c,Object.assign({confirm:r},s)))),_.jsx("div",{onDoubleClick:()=>n(!0),className:"jer-value-null",style:l("null",i),children:String(e)})},S1=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===lo&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return _.jsx("span",{className:"jer-value-invalid",children:t})},C1=({size:e,style:t,className:n})=>_.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:[_.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),_.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),N1=({size:e,style:t,className:n})=>_.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,transform:"translate(0, 0.5)",children:[_.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),_.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),T1=({size:e,style:t,className:n})=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:_.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),A1=({size:e,style:t,className:n})=>_.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[_.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),_.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),_.jsx("path",{d:"M15 10l-4 4 4 4"})]}),R1=({size:e,style:t,className:n})=>_.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[_.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),_.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),j1=({size:e,style:t,className:n})=>_.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:_.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),M1=({size:e,style:t,className:n})=>_.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:n,style:t,children:_.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),Ot=({name:e,nodeData:t})=>{var n,r,i,o,s,l,c;const{getStyles:a,icons:u}=at(),d={size:"1.4em",className:"jer-icon"};switch(e){case"add":return(n=u==null?void 0:u.add)!==null&&n!==void 0?n:_.jsx(C1,Object.assign({},d,{style:a("iconAdd",t)}));case"edit":return(r=u==null?void 0:u.edit)!==null&&r!==void 0?r:_.jsx(N1,Object.assign({},d,{style:a("iconEdit",t)}));case"delete":return(i=u==null?void 0:u.delete)!==null&&i!==void 0?i:_.jsx(T1,Object.assign({},d,{style:a("iconDelete",t),size:"1.45em"}));case"copy":return(o=u==null?void 0:u.copy)!==null&&o!==void 0?o:_.jsx(A1,Object.assign({},d,{style:a("iconCopy",t),size:"1.2em"}));case"ok":return(s=u==null?void 0:u.ok)!==null&&s!==void 0?s:_.jsx(R1,Object.assign({},d,{style:Object.assign({fontSize:"90%"},a("iconOk",t))}));case"cancel":return(l=u==null?void 0:u.cancel)!==null&&l!==void 0?l:_.jsx(j1,Object.assign({},d,{style:Object.assign({fontSize:"130%"},a("iconCancel",t))}));case"chevron":return(c=u==null?void 0:u.chevron)!==null&&c!==void 0?c:_.jsx(M1,{size:"1em",style:a("iconCollection",t)});default:return _.jsx(_.Fragment,{})}},Fc=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:o,nodeData:s,translate:l,keyboardControls:c,handleKeyboard:a,editConfirmRef:u,getNewKeyOptions:d,jsonStringify:f,onEditEvent:h,showIconTooltips:p})=>{const{getStyles:m}=at(),v=l("KEY_NEW",s),[w,C]=A.useState(v),[y,k]=A.useState(!1),{key:g,path:x,value:S}=s,R=Array.isArray(y),M=z=>{var H;if(h&&h(z?[...x,null]:null,z),!z)return void k(!1);const I=Object.keys(pn(s.fullData,x)),P=d?(H=d(s))===null||H===void 0?void 0:H.filter((E=>!I.includes(E))):null;P&&C(""),k(P==null||P)};return _.jsxs("div",{className:"jer-edit-buttons",style:{opacity:y?1:void 0},onClick:z=>z.stopPropagation(),children:[r&&_.jsx("div",{onClick:z=>{var H;z.stopPropagation();let I,P,E="value",j="",T=null;if(r){const D=$o(z);if(D&&c.clipboardModifier.includes(D)?(I=D1(x),j=I,E="path"):(I=S,j=typeof I=="object"?f(S):String(I)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:I,stringValue:j,path:x,key:g,type:E,errorMessage:"Can't access clipboard API"}));(H=navigator.clipboard)===null||H===void 0||H.writeText(j).then((()=>P=!0)).catch(($=>{P=!1,T=$.message})).finally((()=>{typeof r=="function"&&r({success:P,errorMessage:T,value:I,stringValue:j,path:x,key:g,type:E})}))}},className:"jer-copy-pulse",title:p?l("TOOLTIP_COPY",s):"",children:_.jsx(Ot,{name:"copy",nodeData:s})}),e&&_.jsx("div",{onClick:e,title:p?l("TOOLTIP_EDIT",s):"",children:_.jsx(Ot,{name:"edit",nodeData:s})}),t&&_.jsx("div",{onClick:t,title:p?l("TOOLTIP_DELETE",s):"",children:_.jsx(Ot,{name:"delete",nodeData:s})}),n&&_.jsx("div",{onClick:()=>{i==="object"?M(!0):n("")},title:p?l("TOOLTIP_ADD",s):"",children:_.jsx(Ot,{name:"add",nodeData:s})}),o==null?void 0:o.map((({Element:z,onClick:H},I)=>_.jsx("div",{onClick:P=>H&&H(s,P),children:_.jsx(z,{nodeData:s})},I))),y&&n&&i==="object"&&_.jsxs(_.Fragment,{children:[R?_.jsxs("div",{className:"jer-select jer-select-keys",children:[_.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:z=>{n(z.target.value),M(!1)},defaultValue:"",autoFocus:!0,onKeyDown:z=>{a(z,{cancel:()=>M(!1)})},children:[_.jsx("option",{value:"",disabled:!0,children:y.length>0?l("KEY_SELECT",s):l("NO_KEY_OPTIONS",s)}),y.map((z=>_.jsx("option",{value:z,children:z},z)))]}),_.jsx("span",{className:"focus"})]}):_.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:w,onChange:z=>C(z.target.value),autoFocus:!0,onFocus:z=>z.target.select(),onKeyDown:z=>{a(z,{stringConfirm:()=>{n&&(M(!1),n(w),C(v))},cancel:()=>{M(!1),C(v)}})},style:m("input",s)}),_.jsx(zo,{onOk:()=>{R&&!w||(M(!1),n(w))},onCancel:()=>{M(!1)},nodeData:s,editConfirmRef:u,hideOk:R})]})]})},zo=({onOk:e,onCancel:t,nodeData:n,editConfirmRef:r,hideOk:i=!1})=>_.jsxs("div",{className:"jer-confirm-buttons",children:[!i&&_.jsx("div",{onClick:e,ref:r,children:_.jsx(Ot,{name:"ok",nodeData:n})}),_.jsx("div",{onClick:t,children:_.jsx(Ot,{name:"cancel",nodeData:n})})]}),D1=e=>e.reduce(((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`),""),O1=["string","number","boolean","null","object","array"],qc=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:i,onEdit:o,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:a,restrictAddFilter:u,restrictDragFilter:d,translate:f,errorMessageTimeout:h}=e,{currentlyEditingElement:p,setCurrentlyEditingElement:m}=Vt(),[v,w]=A.useState(null),C=Object.assign(Object.assign({},r),{collapsed:t}),{path:y,key:k,size:g}=C,x=Ft(y),S=!c(C),R=!a(C),M=!u(C),z=!d(C)&&R&&p===null,H=$=>{l&&(w($),setTimeout((()=>w(null)),h)),console.warn("Error",$)},I=A.useCallback((($,O)=>{H($.message),s&&s({currentData:C.fullData,errorValue:O,currentValue:n,name:k,path:y,error:$})}),[s,l]),P=p===x,E=p===`key_${x}`,j=typeof y.slice(-1)[0]=="number",T={isEditing:P,isEditingKey:E,isArray:j,canEditKey:i!==null&&S&&M&&R&&!j},D=k===""&&y.length>0?f("EMPTY_STRING",C):null;return{pathString:x,nodeData:C,path:y,name:k,size:g,canEdit:S,canDelete:R,canAdd:M,canDrag:z,error:v,showError:H,onError:I,setError:w,handleEditKey:$=>{if(m(null),k===$||!i)return;const O=y.slice(0,-1);if(Object.keys(i).includes($))return void I({code:"KEY_EXISTS",message:f("ERROR_KEY_EXISTS",C)},$);const b=Object.fromEntries(Object.entries(i).map((([N,L])=>N===k?[$,L]:[N,L])));o(b,O).then((N=>{N&&I({code:"UPDATE_ERROR",message:N},$)}))},derivedValues:T,emptyStringKey:D}},Yc=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:o,translate:s})=>{const{getStyles:l}=at(),{dragSource:c,setDragSource:a}=Vt(),[u,d]=A.useState(!1),f=Ft(n),h=A.useMemo((()=>e?{onDragStart:w=>{w.stopPropagation(),a({path:n,pathString:f})},onDragEnd:w=>{w.stopPropagation(),a({path:null,pathString:null})}}:{}),[e,f]),p=A.useMemo((()=>w=>t?{onDragOver:C=>{C.stopPropagation(),C.preventDefault()},onDrop:C=>{C.stopPropagation(),v(w),a({path:null,pathString:null}),d(!1)},onDragEnter:C=>{var y;C.stopPropagation(),f.startsWith((y=c.pathString)!==null&&y!==void 0?y:"")||d(w)},onDragExit:C=>{C.stopPropagation(),d(!1)}}:{}),[c,t,f]),m=A.useMemo((()=>t&&c.pathString!==null?_.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},p("below"))):null),[c,t,n.length]),v=w=>{var C,y;const k=(C=c.path)===null||C===void 0?void 0:C.slice(-1)[0],g=(y=c.path)===null||y===void 0?void 0:y.slice(0,-1).join("."),x=n.slice(0,-1).join(""),{parentData:S}=r;typeof k=="string"&&S&&!Array.isArray(S)&&Object.keys(S).includes(k)&&k in S&&g!==x?o({code:"KEY_EXISTS",message:s("ERROR_KEY_EXISTS",r)},k):i(c.path,n,w).then((R=>{R&&o({code:"UPDATE_ERROR",message:R},r.value)}))};return{dragSourceProps:h,getDropTargetProps:p,BottomDropTarget:m,DropTargetPadding:({position:w,nodeData:C})=>u===w?_.jsx("div",{className:"jer-drag-n-drop-padding",style:l("dropZone",C)}):null,handleDrop:v}},P1=(e,t,n,r)=>{var i,o,s;if(!t.current)return 0;const l=parseInt((i=getComputedStyle(n.current).getPropertyValue("line-height"))!==null&&i!==void 0?i:"16px"),c=((s=(o=t.current)===null||o===void 0?void 0:o.offsetWidth)!==null&&s!==void 0?s:0)/(.5*l),a=r(e).replace(/\\n/g,`
404
- `).split(`
405
- `).map((u=>Math.ceil(u.length/c))).reduce(((u,d)=>u+d),0)*l;return Math.min(a+30,window.innerHeight-50)},ti=({isEditingKey:e,canEditKey:t,pathString:n,path:r,name:i,handleKeyboard:o,handleEditKey:s,handleCancel:l,handleClick:c,keyValueArray:a,styles:u,getNextOrPrevious:d,emptyStringKey:f})=>{const{setCurrentlyEditingElement:h}=Vt();return e?_.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:n,defaultValue:i,autoFocus:!0,onFocus:p=>p.target.select(),onKeyDown:p=>o(p,{stringConfirm:()=>s(p.target.value),cancel:l,tabForward:()=>{if(s(p.target.value),a){const m=a==null?void 0:a[0][0];h(m?[...r,m]:d("next"))}else h(r)},tabBack:()=>{s(p.target.value),h(d("prev"))}}),style:{width:String(i).length/1.5+.5+"em"}}):_.jsxs("span",{className:"jer-key-text",style:Object.assign(Object.assign({},u),{minWidth:`${Math.min(String(i).length+1,5)}ch`,flexShrink:i.length>10?1:0}),onDoubleClick:()=>t&&h(r,"key"),onClick:c,children:[f?_.jsx("span",{className:"jer-empty-string",children:f}):i,i!==""||f?_.jsx("span",{className:"jer-key-colon",children:":"}):null]})},Xc=e=>{const{data:t,parentData:n,onEdit:r,onDelete:i,onChange:o,onMove:s,enableClipboard:l,canDragOnto:c,restrictTypeSelection:a,searchFilter:u,searchText:d,showLabel:f,stringTruncate:h,showStringQuotes:p,indent:m,translate:v,customNodeDefinitions:w,customNodeData:C,handleKeyboard:y,keyboardControls:k,sort:g,editConfirmRef:x,jsonStringify:S,showIconTooltips:R}=e,{getStyles:M}=at(),{setCurrentlyEditingElement:z,setCollapseState:H,previouslyEditedElement:I,setPreviouslyEditedElement:P,tabDirection:E,setTabDirection:j,previousValue:T,setPreviousValue:D}=Vt(),[$,O]=A.useState(typeof t=="function"?lo:t),{pathString:b,nodeData:N,path:L,name:V,canEdit:F,canDelete:Y,canDrag:q,error:X,onError:B,handleEditKey:U,emptyStringKey:oe,derivedValues:re}=qc({props:e}),{dragSourceProps:Q,getDropTargetProps:J,BottomDropTarget:W,DropTargetPadding:ue}=Yc({canDrag:q,canDragOnto:c,path:L,nodeData:N,onMove:s,onError:B,translate:v}),[fe,_e]=A.useState(co(t,C)),le=A.useCallback((G=>{if(!o)return void O(G);const ne=o({currentData:N.fullData,newValue:G,currentValue:$,name:V,path:L});O(ne)}),[o]);A.useEffect((()=>{O(typeof t=="function"?lo:t),_e(co(t,C))}),[t,X]);const{CustomNode:ye,customNodeProps:ke,hideKey:Ve,showEditTools:Me=!0,showOnEdit:Ie,showOnView:Xe,passOriginalNode:Ge}=C,$e=[...O1,...w.filter((({showInTypesSelector:G=!1,name:ne})=>G&&!!ne)).map((({name:G})=>G))],Oe=A.useMemo((()=>{if(typeof a=="boolean")return a?[]:$e;if(Array.isArray(a))return a;const G=a(N);return typeof G=="boolean"?G?[]:$e:G}),[N,a]),[Re,lt]=A.useState(((G,ne)=>{var ge;if(typeof G!="string")return null;const je=ne.filter((Se=>Se instanceof Object&&Se.enum&&Se.values.includes(G)&&Se.matchPriority));return je.sort(((Se,Ae)=>{var ut,ft;return((ut=Ae.matchPriority)!==null&&ut!==void 0?ut:0)-((ft=Se.matchPriority)!==null&&ft!==void 0?ft:0)})),(ge=je[0])!==null&&ge!==void 0?ge:null})($,Oe)),{isEditing:Ne}=re,vt=$c("value",N,u,d);if(Ne&&(!vt||!F)){const G=Dt(N.fullData,L,E,g);z(G||I)}if(!vt)return null;const Ue=G=>{let ne;if(z(null),D(null),G===void 0||(ge=>ge&&typeof ge=="object"&&"type"in ge&&"target"in ge&&"preventDefault"in ge&&typeof ge.preventDefault=="function")(G))switch(fe){case"object":ne={[v("DEFAULT_NEW_KEY",N)]:$};break;case"array":ne=$??[];break;case"number":{const ge=Number($);ne=isNaN(ge)?0:ge;break}default:ne=$}else ne=G;r(ne,L).then((ge=>{ge&&B({code:"UPDATE_ERROR",message:ge},ne)}))},Be=()=>{z(null),T===null?(O(t),D(null)):r(T,L)},{isEditingKey:xt,canEditKey:wt}=re,Le=!Ne&&X,Te=Ne&&Oe.length>1,ct=(fe!=="invalid"||ye)&&!X&&Me,ie=f&&!Ve,te=ye&&(Ne&&Ie||!Ne&&Xe),ce={value:$,parentData:n,setValue:le,isEditing:Ne,canEdit:F,setIsEditing:F?()=>z(L):()=>{},handleEdit:Ue,handleCancel:Be,path:L,stringTruncate:h,showStringQuotes:p,nodeData:N,enumType:Re,translate:v,handleKeyboard:y,keyboardCommon:{cancel:Be,tabForward:()=>{j("next"),P(b);const G=Dt(N.fullData,L,"next",g);G&&(Ue(),z(G))},tabBack:()=>{j("prev"),P(b);const G=Dt(N.fullData,L,"prev",g);G&&(Ue(),z(G))}}},pe={canEditKey:wt,isEditingKey:xt,pathString:b,path:L,name:V,handleKeyboard:y,handleEditKey:U,handleCancel:Be,styles:M("property",N),getNextOrPrevious:G=>Dt(N.fullData,L,G,g),emptyStringKey:oe},he=te?_.jsx(ye,Object.assign({},e,{value:$,customNodeProps:ke,setValue:le,handleEdit:Ue,handleCancel:Be,handleKeyPress:G=>y(G,{stringConfirm:Ue,cancel:Be}),isEditing:Ne,setIsEditing:()=>z(L),getStyles:M,originalNode:Ge?Na(t,ce):void 0,originalNodeKey:Ge?_.jsx(ti,Object.assign({},pe)):void 0,canEdit:F,keyboardCommon:ce.keyboardCommon,onError:B})):Na(t,ce);return _.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:n!==null?m/2+"em":0,position:"relative"},draggable:q},Q,J("above"),{children:[W,_.jsx(ue,{position:"above",nodeData:N}),_.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:V.length>10?"wrap":"nowrap"},children:[ie&&_.jsx(ti,Object.assign({},pe)),_.jsxs("div",{className:"jer-value-and-buttons",children:[_.jsx("div",{className:"jer-input-component",children:he}),Ne?_.jsx(zo,{onOk:Ue,onCancel:Be,nodeData:N,editConfirmRef:x}):ct&&_.jsx(Fc,{startEdit:F?()=>{D(T),z(L,Be)}:void 0,handleDelete:Y?()=>{i($,L).then((G=>{G&&B({code:"DELETE_ERROR",message:G},$)}))}:void 0,enableClipboard:l,translate:v,customButtons:e.customButtons,nodeData:N,handleKeyboard:y,keyboardControls:k,editConfirmRef:x,jsonStringify:S,showIconTooltips:R}),Te&&_.jsxs("div",{className:"jer-select jer-select-types",children:[_.jsx("select",{name:`${V}-type-select`,className:"jer-select-inner",onChange:G=>(ne=>{const ge=w.find((Ae=>Ae.name===ne));if(ge)return r(ge.defaultValue,L),_e(ne),lt(null),z(null),void H({path:L,collapsed:!1,includeChildren:!1});const je=Oe.find((Ae=>Ae instanceof Object&&Ae.enum===ne));if(je)return typeof $=="string"&&je.values.includes($)||r(je.values[0],L).then((Ae=>{Ae&&(B({code:"UPDATE_ERROR",message:Ae},Se),z(null))})),void lt(je);const Se=I1($,ne,v("DEFAULT_NEW_KEY",N),C!=null&&C.CustomNode?v("DEFAULT_STRING",N):void 0);["string","number","boolean"].includes(ne)||z(null),r(Se,L).then((Ae=>{Ae?(B({code:"UPDATE_ERROR",message:Ae},Se),z(null)):lt(null)}))})(G.target.value),value:Re?Re.enum:fe,children:Oe.map((G=>G instanceof Object&&"enum"in G?_.jsx("option",{value:G.enum,children:G.enum},G.enum):_.jsx("option",{value:G,children:G},G)))}),_.jsx("span",{className:"focus"})]}),Le&&_.jsx("span",{className:"jer-error-slug",style:M("error",N),children:X})]})]}),_.jsx(ue,{position:"below",nodeData:N})]}))},co=(e,t)=>t!=null&&t.CustomNode&&(t!=null&&t.name)&&t.showInTypesSelector?t.name:typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":e===null?"null":"invalid",Na=(e,t)=>{const n=co(e),{value:r}=t;switch(n){case"string":return _.jsx(w1,Object.assign({},t,{value:r}));case"number":return _.jsx(b1,Object.assign({},t,{value:r}));case"boolean":return _.jsx(E1,Object.assign({},t,{value:r}));case"null":return _.jsx(k1,Object.assign({},t));default:return _.jsx(S1,Object.assign({},t))}},I1=(e,t,n,r)=>{switch(t){case"string":return r??String(e);case"number":{const i=Number(e);return isNaN(i)?0:i}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},Gc=(e=[],t)=>{const n=e.filter((({condition:p})=>p(t)));if(n.length===0)return{};const r=n[0],{element:i,wrapperElement:o,customNodeProps:s,wrapperProps:l,hideKey:c=!1,showEditTools:a=!0,showOnEdit:u=!1,showOnView:d=!0,showCollectionWrapper:f=!0}=r,h=Pc(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,customNodeProps:s,wrapperProps:l,hideKey:c,showEditTools:a,showOnEdit:u,showOnView:d,showCollectionWrapper:f},h)},Uc=e=>{const{getStyles:t}=at(),{collapseState:n,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:o,setCurrentlyEditingElement:s,areChildrenBeingEdited:l,previousValue:c,setPreviousValue:a}=Vt(),{mainContainerRef:u,data:d,nodeData:f,parentData:h,showCollectionCount:p,onEdit:m,onAdd:v,onDelete:w,canDragOnto:C,collapseFilter:y,collapseAnimationTime:k,onMove:g,enableClipboard:x,onEditEvent:S,showIconTooltips:R,searchFilter:M,searchText:z,indent:H,sort:I,showArrayIndices:P,defaultValue:E,newKeyOptions:j,translate:T,customNodeDefinitions:D,customNodeData:$,jsonParse:O,jsonStringify:b,TextEditor:N,keyboardControls:L,handleKeyboard:V,insertAtTop:F,onCollapse:Y,editConfirmRef:q,collapseClickZones:X}=e,[B,U]=A.useState(b(d)),oe=y(f),{contentRef:re,isAnimating:Q,maxHeight:J,collapsed:W,animateCollapse:ue,cssTransitionValue:fe}=((Z,ve,Fe,ze,We)=>{const[vr,Gt]=A.useState(Fe?0:void 0),[Ut,wi]=A.useState(Fe),kn=A.useRef(!1),Sn=A.useRef(null),xr=A.useRef(0),wr=A.useRef(0),bi=ve/1e3+"s",Wt=A.useCallback((Cn=>{var Nn,Tn;if(Ut!==Cn){switch(window.clearTimeout(wr.current),kn.current=!0,Cn){case!0:{const Kt=(Tn=(Nn=Sn.current)===null||Nn===void 0?void 0:Nn.offsetHeight)!==null&&Tn!==void 0?Tn:0;xr.current=Kt,Gt(Kt),setTimeout((()=>{Gt(0)}),5);break}case!1:Gt(xr.current||P1(Z,Sn,ze,We))}wi(!Ut),wr.current=window.setTimeout((()=>{kn.current=!1,Cn||Gt(void 0)}),ve)}}),[ve,Ut,Z,ze,We]);return{contentRef:Sn,isAnimating:kn.current,animateCollapse:Wt,maxHeight:vr,collapsed:Ut,cssTransitionValue:bi}})(d,k,oe,u,b),{pathString:_e,nodeData:le,path:ye,name:ke,size:Ve,canEdit:Me,canDelete:Ie,canAdd:Xe,canDrag:Ge,error:$e,setError:Oe,onError:Re,handleEditKey:lt,emptyStringKey:Ne,derivedValues:vt}=qc({props:e,collapsed:W}),{dragSourceProps:Ue,getDropTargetProps:Be,BottomDropTarget:xt,DropTargetPadding:wt}=Yc({canDrag:Ge,canDragOnto:C,path:ye,nodeData:le,onMove:g,onError:Re,translate:T}),Le=A.useRef(!oe),{isEditing:Te,isEditingKey:ct,isArray:ie,canEditKey:te}=vt;A.useEffect((()=>{U(b(d))}),[d,b]),A.useEffect((()=>{const Z=y(le)&&!Te;Le.current=!Z,ue(Z)}),[y]),A.useEffect((()=>{if(n!==null){const Z=i(ye);Z&&(Le.current=!0,ue(Z.collapsed))}}),[n]);const ce=A.useRef(null),pe=A.useCallback(((Z,ve)=>{if(typeof E!="function")return E;const Fe=E(Z,ve);return Fe!==void 0?Fe:null}),[E]),he=A.useCallback((Z=>j?typeof j!="function"?j:j(Z):null),[j]),{CustomNode:G,customNodeProps:ne,CustomWrapper:ge,wrapperProps:je={},hideKey:Se,showEditTools:Ae=!0,showOnEdit:ut,showOnView:ft,showCollectionWrapper:vn=!0}=$,qt=l(_e);if(qt&&W&&ue(!1),!($c("collection",le,M,z)||le.level===0)&&!qt)return null;const bt=Array.isArray(d)?"array":"object",xn=bt==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},fr=Z=>{if(Z.key!=="Tab"||Z.getModifierState("Shift"))V(Z,{objectConfirm:Xt,cancel:Ct});else{Z.preventDefault();const ve=zc(ce," ");U(ve)}},Yt=Z=>{Z.stopPropagation();const ve=$o(Z);if(ve&&L.collapseModifier.includes(ve))return Le.current=!0,void r({collapsed:!W,path:ye,includeChildren:!0});o&&o.includes(_e)||(Le.current=!0,r(null),Y&&Y({path:ye,collapsed:!W,includeChildren:!1}),ue(!W))},Xt=()=>{try{const Z=O(B);if(s(null),a(null),Oe(null),b(Z)===b(d))return;m(Z,ye).then((ve=>{ve&&Re({code:"UPDATE_ERROR",message:ve},Z)}))}catch{Re({code:"INVALID_JSON",message:T("ERROR_INVALID_JSON",le)},B)}},yi=ye.length>0?()=>{w(d,ye).then((Z=>{Z&&Re({code:"DELETE_ERROR",message:Z},d)}))}:void 0,Ct=()=>{s(null),c===null?(Oe(null),U(b(d)),a(null)):m(c,ye)},wn=p==="when-closed"?W:p,dr=!Te&&Ae,hr=(P||!ie)&&!Se&&ke!==void 0,vi=G&&(Te&&ut||!Te&&ft),bn=Object.entries(d).map((([Z,ve])=>[bt==="array"?Number(Z):Z,ve]));bt==="object"&&I(bn,(Z=>Z));const pr=Le.current?Te?_.jsxs("div",{className:"jer-collection-text-edit",children:[N?_.jsx(N,{value:B,onChange:U,onKeyDown:Z=>V(Z,{objectConfirm:Xt,cancel:Ct})}):_.jsx(Ic,{textAreaRef:ce,className:"jer-collection-text-area",name:_e,value:B,setValue:U,handleKeyPress:fr,styles:t("input",le)}),_.jsx("div",{className:"jer-collection-input-button-row",children:_.jsx(zo,{onOk:Xt,onCancel:Ct,nodeData:le,editConfirmRef:q})})]}):bn.map((([Z,ve],Fe)=>{const ze={key:Z,value:ve,path:[...ye,Z],level:ye.length+1,index:Fe,size:gn(ve)?Object.keys(ve).length:null,parentData:d,fullData:le.fullData},We=Gc(D,ze);return _.jsx("div",{className:"jer-collection-element",style:t("collectionElement",ze),children:gn(ve)&&!(We!=null&&We.renderCollectionAsValue)?_.jsx(Uc,Object.assign({},e,{data:ve,parentData:d,nodeData:ze,showCollectionCount:p,canDragOnto:Me,customNodeData:We}),Z):_.jsx(Xc,Object.assign({},e,{data:ve,parentData:d,nodeData:ze,canDragOnto:Me,showLabel:bt==="object"||P,customNodeData:We}),Z)},Z)})):null,En=!!vn&&W&&!qt;En||(Le.current=!0);const gr=Object.assign(Object.assign({},e),{data:d,value:d,parentData:h,nodeData:le,setValue:Z=>tn(void 0,void 0,void 0,(function*(){return yield m(Z,ye)})),handleEdit:Xt,handleCancel:Ct,handleKeyPress:fr,isEditing:Te,setIsEditing:()=>s(ye),getStyles:t,canDragOnto:Me,canEdit:Me,keyboardCommon:{},onError:Re}),xi=vi?_.jsx(G,Object.assign({customNodeProps:ne},gr,{children:pr})):pr,_n=dr&&_.jsx(Fc,{startEdit:Me?()=>{Le.current=!0,a(null),s(ye)}:void 0,handleAdd:Xe?Z=>{ue(!1);const ve=pe(le,Z);if(bt==="array"){const Fe=F.array?0:d.length,ze=F.array?{insert:!0}:{};v(ve,[...ye,Fe],ze).then((We=>{We&&Re({code:"ADD_ERROR",message:We},ve)}))}else if(Z in d)Re({code:"KEY_EXISTS",message:T("ERROR_KEY_EXISTS",le)},Z);else{const Fe=F.object?{insertBefore:0}:{};v(ve,[...ye,Z],Fe).then((ze=>{ze&&Re({code:"ADD_ERROR",message:ze},ve)}))}}:void 0,handleDelete:Ie?yi:void 0,enableClipboard:x,type:bt,nodeData:le,translate:T,customButtons:e.customButtons,keyboardControls:L,handleKeyboard:V,getNewKeyOptions:he,editConfirmRef:q,jsonStringify:b,onEditEvent:S,showIconTooltips:R}),mr={canEditKey:te,isEditingKey:ct,pathString:_e,path:ye,name:ke,handleKeyboard:V,handleEditKey:lt,handleCancel:Ct,keyValueArray:bn,styles:t("property",le),getNextOrPrevious:Z=>Dt(le.fullData,ye,Z,I),handleClick:X.includes("property")?Yt:Z=>Z.stopPropagation(),emptyStringKey:Ne},yr=_.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(ye.length===0?0:H/2)+"em"},t("collection",le)),{position:"relative"}),draggable:Ge},Ue,Be("above"),{children:[_.jsx("div",{className:"jer-clickzone",style:{width:H/2+1+"em",zIndex:10+2*le.level},onClick:X.includes("left")?Yt:void 0}),!Te&&xt,_.jsx(wt,{position:"above",nodeData:le}),vn?_.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:X.includes("header")?Yt:void 0,children:[_.jsxs("div",{className:"jer-collection-name",children:[_.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(W?" jer-rotate-90":""),style:{zIndex:11+2*le.level,transition:fe},onClick:Yt,children:_.jsx(Ot,{name:"chevron",rotate:W,nodeData:le})}),hr&&_.jsx(ti,Object.assign({},mr)),!Te&&_.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",le),children:xn.open})]}),!Te&&wn&&_.jsx("div",{className:"jer-collection-item-count"+(wn?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},t("itemCount",le)),{transition:fe}),children:Ve===1?T("ITEM_SINGLE",Object.assign(Object.assign({},le),{size:1}),1):T("ITEMS_MULTIPLE",le,Ve)}),_.jsx("div",{className:"jer-brackets"+(En?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},t("bracket",le)),{transition:fe}),children:xn.close}),_n]}):Se?_.jsx(_.Fragment,{}):_.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[_.jsx(ti,Object.assign({},mr)),_n]}),_.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:En||Q?"clip":"visible",maxHeight:qt?void 0:J},t("collectionInner",le)),{transition:fe}),ref:re,children:[xi,_.jsx("div",{className:Te?"jer-collection-error-row":"jer-collection-error-row-edit",children:$e&&_.jsx("span",{className:"jer-error-slug",style:t("error",le),children:$e})}),!Te&&vn&&_.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},t("bracket",le)),{marginLeft:(H<3?-1:H<6?-.5:0)+"em"}),children:xn.close})]}),_.jsx(wt,{position:"below",nodeData:le})]}));return ge?_.jsx(ge,Object.assign({customNodeProps:je},gr,{children:yr})):yr},$1={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>",TOOLTIP_COPY:"Copy to clipboard",TOOLTIP_EDIT:"Edit",TOOLTIP_DELETE:"Delete",TOOLTIP_ADD:"Add"},L1=(e,t)=>(n,r,i)=>((o,s,l,c,a)=>{if(s[c]){const d=s[c](l);if(d!==null)return d}const u=c in o?o[c]:$1[c];return a===void 0?u:u==null?void 0:u.replace("{{count}}",String(a))})(e,t,r,n,i);var Ta=[],zn=[];(function(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",i=t.singleTag===!0,o=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=Ta.indexOf(o);s===-1&&(s=Ta.push(o)-1,zn[s]={}),n=zn[s]&&zn[s][r]?zn[s][r]:zn[s][r]=l()}else n=l();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var c=document.createElement("style");if(c.setAttribute("type","text/css"),t.attributes)for(var a=Object.keys(t.attributes),u=0;u<a.length;u++)c.setAttribute(a[u],t.attributes[a[u]]);var d=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(d,c),c}})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const z1=({data:e,setData:t,rootName:n="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:s=r,onChange:l,onError:c,onEditEvent:a,showErrorMessages:u=!0,enableClipboard:d=!0,indent:f=2,collapse:h=!1,collapseAnimationTime:p=300,showCollectionCount:m=!0,restrictEdit:v=!1,restrictDelete:w=!1,restrictAdd:C=!1,restrictTypeSelection:y=!1,restrictDrag:k=!0,viewOnly:g,searchFilter:x,searchText:S,searchDebounceTime:R=350,keySort:M=!1,showArrayIndices:z=!0,showStringQuotes:H=!0,showIconTooltips:I=!1,defaultValue:P=null,newKeyOptions:E,minWidth:j=250,maxWidth:T="min(600px, 90vw)",rootFontSize:D,stringTruncate:$=250,translations:O={},className:b,id:N,customText:L={},customNodeDefinitions:V=[],customButtons:F=[],jsonParse:Y=JSON.parse,jsonStringify:q=(W,ue)=>JSON.stringify(W,ue,2),TextEditor:X,errorMessageTimeout:B=2500,keyboardControls:U={},externalTriggers:oe,insertAtTop:re=!1,onCollapse:Q,collapseClickZones:J=["header","left"]})=>{const{getStyles:W}=at(),{setCurrentlyEditingElement:ue}=Vt(),fe=A.useMemo((()=>Vn(h)),[h]),_e=A.useMemo((()=>L1(O,L)),[O,L]),[le,ye]=A.useState(S),[ke,Ve]=(({setData:ie,data:te})=>{const[ce,pe]=A.useState(ie?void 0:te),he=A.useCallback((G=>{ie?ie(G):pe(G)}),[ie]);return A.useEffect((()=>{ie||pe(te)}),[te]),[ie?te:ce,he]})({setData:t,data:e}),Me=A.useRef(null);A.useEffect((()=>{ue(null);const ie=setTimeout((()=>ye(S)),R);return()=>clearTimeout(ie)}),[S,R]);const Ie={key:n,path:[],level:0,index:0,value:ke,size:typeof ke=="object"&&ke!==null?Object.keys(ke).length:1,parentData:null,fullData:ke},Xe=(ie,te)=>tn(void 0,void 0,void 0,(function*(){const ce=yield ie(te);if(ce===!0||ce===void 0)return void Ve(te.newData);const pe=V1(ce)?ce:["error",ce],[he,G]=pe;if(he==="error")return Ve(te.currentData),G===!1?_e("ERROR_UPDATE",Ie):String(G);Ve(G)})),Ge=A.useMemo((()=>Vn(v,g)),[v,g]),$e=A.useMemo((()=>Vn(w,g)),[w,g]),Oe=A.useMemo((()=>Vn(C,g)),[C,g]),Re=A.useMemo((()=>Vn(k,g)),[k,g]),lt=A.useMemo((()=>H1(x)),[x]),Ne=A.useMemo((()=>(ie=>{const te=Object.assign({},Sa);for(const ce of Object.keys(Sa)){const pe=ce;if(ie[pe]){const he=ie[pe],G=["clipboardModifier","collapseModifier"].includes(ce)?Array.isArray(he)?he:[he]:typeof he=="string"?{key:he}:he;te[pe]=G,["stringConfirm","numberConfirm","booleanConfirm"].forEach((ne=>{!ie[ne]&&ie.confirm&&(te[ne]=te.confirm)}))}}return te})(U)),[U]),vt=A.useCallback(((ie,te)=>((ce,pe,he)=>{const G=Object.entries(pe);for(const[ne,ge]of G)if(f1(he,ce[ne],ne)){he.preventDefault(),ge();break}})(Ne,te,ie)),[Ne]),Ue=A.useMemo((()=>{const ie=Aa(V,"stringifyReplacer");return te=>q(te,ie)}),[V,q]),Be=A.useMemo((()=>{const ie=Aa(V,"parseReviver");return te=>{const ce=Y(te,ie);return ao(ce)}}),[V,Y]),xt=A.useRef(null);((ie,te)=>{const{setCurrentlyEditingElement:ce,currentlyEditingElement:pe,setCollapseState:he}=Vt();A.useEffect((()=>{if(!ie)return;const{collapse:G,edit:ne}=ie;G&&he(G);const ge=!(ne!=null&&ne.path)||Ft(ne.path)===pe;switch(ne==null?void 0:ne.action){case"accept":ge&&(te.current&&te.current.click(),ce(null));break;case"cancel":ge&&ce(null);break;default:ne!=null&&ne.path&&ce(ne.path)}}),[ie])})(oe,xt);const wt=A.useCallback(((ie,te)=>{M!==!1&&(typeof M!="function"?ie.sort(((ce,pe)=>{const he=te(ce)[0],G=te(pe)[0];return he<G?-1:he>G?1:0})):ie.sort(((ce,pe)=>M(te(ce),te(pe)))))}),[M]),Le=Gc(V,Ie),Te={mainContainerRef:Me,name:n,nodeData:Ie,onEdit:(ie,te)=>tn(void 0,void 0,void 0,(function*(){const{currentData:ce,newData:pe,currentValue:he,newValue:G}=Hn(ke,te,ie,"update");if(he!==G)return yield Xe(i,{currentData:ce,newData:pe,currentValue:he,newValue:G,name:te.slice(-1)[0],path:te})})),onDelete:(ie,te)=>tn(void 0,void 0,void 0,(function*(){const{currentData:ce,newData:pe,currentValue:he,newValue:G}=Hn(ke,te,ie,"delete");return yield Xe(o,{currentData:ce,newData:pe,currentValue:he,newValue:G,name:te.slice(-1)[0],path:te})})),onAdd:(ie,te,ce)=>tn(void 0,void 0,void 0,(function*(){const{currentData:pe,newData:he,currentValue:G,newValue:ne}=Hn(ke,te,ie,"add",ce);return yield Xe(s,{currentData:pe,newData:he,currentValue:G,newValue:ne,name:te.slice(-1)[0],path:te})})),onChange:l,onError:c,onEditEvent:a,showErrorMessages:u,onMove:(ie,te,ce)=>tn(void 0,void 0,void 0,(function*(){if(ie===null)return;const{currentData:pe,newData:he,currentValue:G}=Hn(ke,ie,"","delete"),ne=ie.slice(-1)[0],ge=te.slice(0,-1),je=te.slice(-1)[0];let Se=typeof je=="number"?ce==="above"?je:je+1:typeof ne=="number"?`arr_${ne}`:ne;ie.slice(0,-1).join(".")===te.slice(0,-1).join(".")&&typeof ne=="number"&&typeof Se=="number"&&ne<Se&&(Se-=1);const Ae=typeof Se=="number"?{insert:!0}:ce==="above"?{insertBefore:je}:{insertAfter:je},{newData:ut,newValue:ft}=Hn(he,[...ge,Se],G,"add",Ae);return yield Xe(i,{currentData:pe,newData:ut,currentValue:G,newValue:ft,name:te.slice(-1)[0],path:te})})),showCollectionCount:m,collapseFilter:fe,collapseAnimationTime:p,restrictEditFilter:Ge,restrictDeleteFilter:$e,restrictAddFilter:Oe,restrictTypeSelection:y,restrictDragFilter:Re,canDragOnto:!1,searchFilter:lt,searchText:le,enableClipboard:d,keySort:M,sort:wt,showArrayIndices:z,showStringQuotes:H,showIconTooltips:I,indent:f,defaultValue:P,newKeyOptions:E,stringTruncate:$,translate:_e,customNodeDefinitions:V,customNodeData:Le,customButtons:F,parentData:null,jsonParse:Be,jsonStringify:Ue,TextEditor:X,errorMessageTimeout:B,handleKeyboard:vt,keyboardControls:Ne,insertAtTop:{object:re===!0||re==="object",array:re===!0||re==="array"},onCollapse:Q,editConfirmRef:xt,collapseClickZones:J},ct=Object.assign(Object.assign({},W("container",Ie)),{minWidth:j,maxWidth:T});return ct.fontSize=D??ct.fontSize,_.jsx("div",{id:N,ref:Me,className:`jer-editor-container ${b??""}`,style:ct,children:gn(ke)&&!Le.renderCollectionAsValue?_.jsx(Uc,Object.assign({data:ke},Te)):_.jsx(Xc,Object.assign({data:ke,showLabel:!0},Te))})},Jv=e=>{var t;const[n,r]=A.useState();return A.useEffect((()=>{const i=document.documentElement;r(i)}),[]),n?_.jsx(h1,{theme:(t=e.theme)!==null&&t!==void 0?t:Lo,icons:e.icons,docRoot:n,children:_.jsx(y1,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:_.jsx(z1,Object.assign({},e))})}):null},Hn=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};const o=Object.assign({remove:r==="delete"},i),s=r!=="add"?pn(e,t):void 0;return{currentData:e,newData:s1(e,t,n,o),currentValue:s,newValue:r!=="delete"?n:void 0}},Vn=(e,t)=>t?()=>!0:typeof e=="boolean"?()=>e:typeof e=="number"?({level:n})=>n>=e:e,H1=e=>{if(e!==void 0)return e==="value"?mn:e==="key"?ka:e==="all"?(t,n)=>mn(t,n)||ka(t,n):e},V1=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]),Aa=(e,t)=>{const n=t==="stringifyReplacer"?[r=>r===void 0?Hc:r]:[];if(n.push(...e.map((r=>r[t])).filter((r=>!!r))),n.length!==0)return(r,i)=>{let o=i;for(const s of n)o=s(o);return o}};export{Mv as $,X1 as A,U1 as B,J1 as C,sv as D,av as E,mv as F,yv as G,zv as H,wv as I,Lv as J,bv as K,_v as L,Rv as M,Cv as N,Hv as O,Av as P,kv as Q,F1 as R,Dv as S,Bv as T,Vv as U,jv as V,Yv as W,qv as X,G1 as Y,lv as Z,Tv as _,ou as a,Pv as a0,Nv as a1,Hl as a2,Jr as a3,ee as a4,Sv as a5,xv as a6,Ov as a7,$v as a8,Xv as a9,iv as aa,Fv as ab,jy as ac,Wv as ad,Kv as ae,Po as af,Uv as ag,Zv as ah,Qv as ai,pi as aj,Kr as ak,Iv as al,ev as am,Jv as an,yn as ao,iu as ap,Y1 as b,q1 as c,Ra as d,Q1 as e,tv as f,nv as g,hv as h,pv as i,_ as j,gv as k,fv as l,uv as m,dv as n,cv as o,ov as p,K1 as q,A as r,W1 as s,Ev as t,Z1 as u,xe as v,Gv as w,ld as x,rv as y,vv as z};