@guidify-ai/vapi-studio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/agent/AGENTS.md +42 -0
  4. package/agent/CLAUDE.md +15 -0
  5. package/agent/claude/rules/ui-and-api-identity.md +9 -0
  6. package/agent/claude/rules/vapi-studio-best-practices.md +36 -0
  7. package/agent/cursor/ui-and-api-identity.mdc +16 -0
  8. package/agent/cursor/vapi-studio-best-practices.mdc +43 -0
  9. package/dist/adapters/vapi/vapi-sse.compiler.d.ts +61 -0
  10. package/dist/adapters/vapi/vapi-sse.compiler.d.ts.map +1 -0
  11. package/dist/adapters/vapi/vapi-sse.compiler.js +396 -0
  12. package/dist/adapters/vapi/vapi-sse.compiler.js.map +1 -0
  13. package/dist/analytics/analytics-tags.d.ts +60 -0
  14. package/dist/analytics/analytics-tags.d.ts.map +1 -0
  15. package/dist/analytics/analytics-tags.js +27 -0
  16. package/dist/analytics/analytics-tags.js.map +1 -0
  17. package/dist/brain/adapters/chatgpt-brain.adapter.d.ts +27 -0
  18. package/dist/brain/adapters/chatgpt-brain.adapter.d.ts.map +1 -0
  19. package/dist/brain/adapters/chatgpt-brain.adapter.js +94 -0
  20. package/dist/brain/adapters/chatgpt-brain.adapter.js.map +1 -0
  21. package/dist/brain/adapters/claude-brain.adapter.d.ts +24 -0
  22. package/dist/brain/adapters/claude-brain.adapter.d.ts.map +1 -0
  23. package/dist/brain/adapters/claude-brain.adapter.js +96 -0
  24. package/dist/brain/adapters/claude-brain.adapter.js.map +1 -0
  25. package/dist/brain/adapters/gemini-brain.adapter.d.ts +24 -0
  26. package/dist/brain/adapters/gemini-brain.adapter.d.ts.map +1 -0
  27. package/dist/brain/adapters/gemini-brain.adapter.js +106 -0
  28. package/dist/brain/adapters/gemini-brain.adapter.js.map +1 -0
  29. package/dist/brain/adapters/grok-brain.adapter.d.ts +24 -0
  30. package/dist/brain/adapters/grok-brain.adapter.d.ts.map +1 -0
  31. package/dist/brain/adapters/grok-brain.adapter.js +90 -0
  32. package/dist/brain/adapters/grok-brain.adapter.js.map +1 -0
  33. package/dist/brain/adapters/json-llm-brain.base.d.ts +63 -0
  34. package/dist/brain/adapters/json-llm-brain.base.d.ts.map +1 -0
  35. package/dist/brain/adapters/json-llm-brain.base.js +511 -0
  36. package/dist/brain/adapters/json-llm-brain.base.js.map +1 -0
  37. package/dist/brain/adapters/mock-brain.adapter.d.ts +32 -0
  38. package/dist/brain/adapters/mock-brain.adapter.d.ts.map +1 -0
  39. package/dist/brain/adapters/mock-brain.adapter.js +201 -0
  40. package/dist/brain/adapters/mock-brain.adapter.js.map +1 -0
  41. package/dist/brain/adapters/mock-provider-brains.adapter.d.ts +22 -0
  42. package/dist/brain/adapters/mock-provider-brains.adapter.d.ts.map +1 -0
  43. package/dist/brain/adapters/mock-provider-brains.adapter.js +48 -0
  44. package/dist/brain/adapters/mock-provider-brains.adapter.js.map +1 -0
  45. package/dist/brain/brain-clarify.d.ts +75 -0
  46. package/dist/brain/brain-clarify.d.ts.map +1 -0
  47. package/dist/brain/brain-clarify.js +146 -0
  48. package/dist/brain/brain-clarify.js.map +1 -0
  49. package/dist/brain/brain-config.d.ts +20 -0
  50. package/dist/brain/brain-config.d.ts.map +1 -0
  51. package/dist/brain/brain-config.js +20 -0
  52. package/dist/brain/brain-config.js.map +1 -0
  53. package/dist/brain/brain-judge.d.ts +68 -0
  54. package/dist/brain/brain-judge.d.ts.map +1 -0
  55. package/dist/brain/brain-judge.js +111 -0
  56. package/dist/brain/brain-judge.js.map +1 -0
  57. package/dist/brain/brain-ranking.d.ts +41 -0
  58. package/dist/brain/brain-ranking.d.ts.map +1 -0
  59. package/dist/brain/brain-ranking.js +103 -0
  60. package/dist/brain/brain-ranking.js.map +1 -0
  61. package/dist/brain/brain-usage.tracker.d.ts +48 -0
  62. package/dist/brain/brain-usage.tracker.d.ts.map +1 -0
  63. package/dist/brain/brain-usage.tracker.js +106 -0
  64. package/dist/brain/brain-usage.tracker.js.map +1 -0
  65. package/dist/brain/brain.port.d.ts +63 -0
  66. package/dist/brain/brain.port.d.ts.map +1 -0
  67. package/dist/brain/brain.port.js +7 -0
  68. package/dist/brain/brain.port.js.map +1 -0
  69. package/dist/brain/brain.service.d.ts +14 -0
  70. package/dist/brain/brain.service.d.ts.map +1 -0
  71. package/dist/brain/brain.service.js +27 -0
  72. package/dist/brain/brain.service.js.map +1 -0
  73. package/dist/brain/claude-cheap-models.d.ts +18 -0
  74. package/dist/brain/claude-cheap-models.d.ts.map +1 -0
  75. package/dist/brain/claude-cheap-models.js +53 -0
  76. package/dist/brain/claude-cheap-models.js.map +1 -0
  77. package/dist/brain/gemini-cheap-models.d.ts +18 -0
  78. package/dist/brain/gemini-cheap-models.d.ts.map +1 -0
  79. package/dist/brain/gemini-cheap-models.js +53 -0
  80. package/dist/brain/gemini-cheap-models.js.map +1 -0
  81. package/dist/brain/grok-cheap-models.d.ts +18 -0
  82. package/dist/brain/grok-cheap-models.d.ts.map +1 -0
  83. package/dist/brain/grok-cheap-models.js +53 -0
  84. package/dist/brain/grok-cheap-models.js.map +1 -0
  85. package/dist/brain/llm-model-pricing.d.ts +29 -0
  86. package/dist/brain/llm-model-pricing.d.ts.map +1 -0
  87. package/dist/brain/llm-model-pricing.js +38 -0
  88. package/dist/brain/llm-model-pricing.js.map +1 -0
  89. package/dist/brain/openai-cheap-models.d.ts +34 -0
  90. package/dist/brain/openai-cheap-models.d.ts.map +1 -0
  91. package/dist/brain/openai-cheap-models.js +72 -0
  92. package/dist/brain/openai-cheap-models.js.map +1 -0
  93. package/dist/brain/prompt-injection-guard.d.ts +34 -0
  94. package/dist/brain/prompt-injection-guard.d.ts.map +1 -0
  95. package/dist/brain/prompt-injection-guard.js +109 -0
  96. package/dist/brain/prompt-injection-guard.js.map +1 -0
  97. package/dist/channel/channel-tools.d.ts +72 -0
  98. package/dist/channel/channel-tools.d.ts.map +1 -0
  99. package/dist/channel/channel-tools.js +131 -0
  100. package/dist/channel/channel-tools.js.map +1 -0
  101. package/dist/conversation/call-turn-queue.d.ts +64 -0
  102. package/dist/conversation/call-turn-queue.d.ts.map +1 -0
  103. package/dist/conversation/call-turn-queue.js +156 -0
  104. package/dist/conversation/call-turn-queue.js.map +1 -0
  105. package/dist/conversation/conversation-bootstrap.service.d.ts +60 -0
  106. package/dist/conversation/conversation-bootstrap.service.d.ts.map +1 -0
  107. package/dist/conversation/conversation-bootstrap.service.js +383 -0
  108. package/dist/conversation/conversation-bootstrap.service.js.map +1 -0
  109. package/dist/conversation/conversation-entry.d.ts +38 -0
  110. package/dist/conversation/conversation-entry.d.ts.map +1 -0
  111. package/dist/conversation/conversation-entry.js +17 -0
  112. package/dist/conversation/conversation-entry.js.map +1 -0
  113. package/dist/conversation/conversation-history.d.ts +31 -0
  114. package/dist/conversation/conversation-history.d.ts.map +1 -0
  115. package/dist/conversation/conversation-history.js +53 -0
  116. package/dist/conversation/conversation-history.js.map +1 -0
  117. package/dist/conversation/conversation-limits.d.ts +49 -0
  118. package/dist/conversation/conversation-limits.d.ts.map +1 -0
  119. package/dist/conversation/conversation-limits.js +44 -0
  120. package/dist/conversation/conversation-limits.js.map +1 -0
  121. package/dist/conversation/conversation-resume.service.d.ts +39 -0
  122. package/dist/conversation/conversation-resume.service.d.ts.map +1 -0
  123. package/dist/conversation/conversation-resume.service.js +234 -0
  124. package/dist/conversation/conversation-resume.service.js.map +1 -0
  125. package/dist/conversation/conversation-schema.d.ts +23 -0
  126. package/dist/conversation/conversation-schema.d.ts.map +1 -0
  127. package/dist/conversation/conversation-schema.js +3 -0
  128. package/dist/conversation/conversation-schema.js.map +1 -0
  129. package/dist/conversation/listen-expectation.d.ts +145 -0
  130. package/dist/conversation/listen-expectation.d.ts.map +1 -0
  131. package/dist/conversation/listen-expectation.js +219 -0
  132. package/dist/conversation/listen-expectation.js.map +1 -0
  133. package/dist/conversation/listen-timeout.d.ts +42 -0
  134. package/dist/conversation/listen-timeout.d.ts.map +1 -0
  135. package/dist/conversation/listen-timeout.js +57 -0
  136. package/dist/conversation/listen-timeout.js.map +1 -0
  137. package/dist/conversation/supervised-conversation.d.ts +64 -0
  138. package/dist/conversation/supervised-conversation.d.ts.map +1 -0
  139. package/dist/conversation/supervised-conversation.js +198 -0
  140. package/dist/conversation/supervised-conversation.js.map +1 -0
  141. package/dist/conversation/supervised-conversation.registry.d.ts +14 -0
  142. package/dist/conversation/supervised-conversation.registry.d.ts.map +1 -0
  143. package/dist/conversation/supervised-conversation.registry.js +47 -0
  144. package/dist/conversation/supervised-conversation.registry.js.map +1 -0
  145. package/dist/conversation/types.d.ts +52 -0
  146. package/dist/conversation/types.d.ts.map +1 -0
  147. package/dist/conversation/types.js +3 -0
  148. package/dist/conversation/types.js.map +1 -0
  149. package/dist/events/conversation-console.d.ts +17 -0
  150. package/dist/events/conversation-console.d.ts.map +1 -0
  151. package/dist/events/conversation-console.js +863 -0
  152. package/dist/events/conversation-console.js.map +1 -0
  153. package/dist/events/daily-log.driver.d.ts +35 -0
  154. package/dist/events/daily-log.driver.d.ts.map +1 -0
  155. package/dist/events/daily-log.driver.js +206 -0
  156. package/dist/events/daily-log.driver.js.map +1 -0
  157. package/dist/events/event.service.d.ts +24 -0
  158. package/dist/events/event.service.d.ts.map +1 -0
  159. package/dist/events/event.service.js +141 -0
  160. package/dist/events/event.service.js.map +1 -0
  161. package/dist/events/route-forensics.d.ts +38 -0
  162. package/dist/events/route-forensics.d.ts.map +1 -0
  163. package/dist/events/route-forensics.js +85 -0
  164. package/dist/events/route-forensics.js.map +1 -0
  165. package/dist/events/studio-event-bus.d.ts +17 -0
  166. package/dist/events/studio-event-bus.d.ts.map +1 -0
  167. package/dist/events/studio-event-bus.js +37 -0
  168. package/dist/events/studio-event-bus.js.map +1 -0
  169. package/dist/events/studio-event.d.ts +44 -0
  170. package/dist/events/studio-event.d.ts.map +1 -0
  171. package/dist/events/studio-event.js +27 -0
  172. package/dist/events/studio-event.js.map +1 -0
  173. package/dist/flow/condition.d.ts +35 -0
  174. package/dist/flow/condition.d.ts.map +1 -0
  175. package/dist/flow/condition.js +246 -0
  176. package/dist/flow/condition.js.map +1 -0
  177. package/dist/flow/flow-loader.d.ts +71 -0
  178. package/dist/flow/flow-loader.d.ts.map +1 -0
  179. package/dist/flow/flow-loader.js +182 -0
  180. package/dist/flow/flow-loader.js.map +1 -0
  181. package/dist/forms/form-html.d.ts +30 -0
  182. package/dist/forms/form-html.d.ts.map +1 -0
  183. package/dist/forms/form-html.js +130 -0
  184. package/dist/forms/form-html.js.map +1 -0
  185. package/dist/forms/form.tokens.d.ts +3 -0
  186. package/dist/forms/form.tokens.d.ts.map +1 -0
  187. package/dist/forms/form.tokens.js +6 -0
  188. package/dist/forms/form.tokens.js.map +1 -0
  189. package/dist/forms/form.types.d.ts +81 -0
  190. package/dist/forms/form.types.d.ts.map +1 -0
  191. package/dist/forms/form.types.js +36 -0
  192. package/dist/forms/form.types.js.map +1 -0
  193. package/dist/forms/forms.service.d.ts +52 -0
  194. package/dist/forms/forms.service.d.ts.map +1 -0
  195. package/dist/forms/forms.service.js +434 -0
  196. package/dist/forms/forms.service.js.map +1 -0
  197. package/dist/forms/noop-form-dispose.adapter.d.ts +12 -0
  198. package/dist/forms/noop-form-dispose.adapter.d.ts.map +1 -0
  199. package/dist/forms/noop-form-dispose.adapter.js +27 -0
  200. package/dist/forms/noop-form-dispose.adapter.js.map +1 -0
  201. package/dist/forms/twilio-sms-form-dispose.adapter.d.ts +33 -0
  202. package/dist/forms/twilio-sms-form-dispose.adapter.d.ts.map +1 -0
  203. package/dist/forms/twilio-sms-form-dispose.adapter.js +125 -0
  204. package/dist/forms/twilio-sms-form-dispose.adapter.js.map +1 -0
  205. package/dist/forms/twilio-sms.env.d.ts +62 -0
  206. package/dist/forms/twilio-sms.env.d.ts.map +1 -0
  207. package/dist/forms/twilio-sms.env.js +147 -0
  208. package/dist/forms/twilio-sms.env.js.map +1 -0
  209. package/dist/forms/twilio-sms.sender.d.ts +27 -0
  210. package/dist/forms/twilio-sms.sender.d.ts.map +1 -0
  211. package/dist/forms/twilio-sms.sender.js +75 -0
  212. package/dist/forms/twilio-sms.sender.js.map +1 -0
  213. package/dist/identity/email-parse.d.ts +20 -0
  214. package/dist/identity/email-parse.d.ts.map +1 -0
  215. package/dist/identity/email-parse.js +102 -0
  216. package/dist/identity/email-parse.js.map +1 -0
  217. package/dist/identity/index.d.ts +17 -0
  218. package/dist/identity/index.d.ts.map +1 -0
  219. package/dist/identity/index.js +23 -0
  220. package/dist/identity/index.js.map +1 -0
  221. package/dist/index.d.ts +108 -0
  222. package/dist/index.d.ts.map +1 -0
  223. package/dist/index.js +300 -0
  224. package/dist/index.js.map +1 -0
  225. package/dist/integrations/integration-client.d.ts +41 -0
  226. package/dist/integrations/integration-client.d.ts.map +1 -0
  227. package/dist/integrations/integration-client.js +152 -0
  228. package/dist/integrations/integration-client.js.map +1 -0
  229. package/dist/integrations/jwt-hmac.d.ts +33 -0
  230. package/dist/integrations/jwt-hmac.d.ts.map +1 -0
  231. package/dist/integrations/jwt-hmac.js +108 -0
  232. package/dist/integrations/jwt-hmac.js.map +1 -0
  233. package/dist/intention/code-intention.d.ts +94 -0
  234. package/dist/intention/code-intention.d.ts.map +1 -0
  235. package/dist/intention/code-intention.js +89 -0
  236. package/dist/intention/code-intention.js.map +1 -0
  237. package/dist/intention/intention-constants.d.ts +37 -0
  238. package/dist/intention/intention-constants.d.ts.map +1 -0
  239. package/dist/intention/intention-constants.js +37 -0
  240. package/dist/intention/intention-constants.js.map +1 -0
  241. package/dist/intentions/standard-intentions.d.ts +26 -0
  242. package/dist/intentions/standard-intentions.d.ts.map +1 -0
  243. package/dist/intentions/standard-intentions.js +28 -0
  244. package/dist/intentions/standard-intentions.js.map +1 -0
  245. package/dist/node/agent-node.d.ts +156 -0
  246. package/dist/node/agent-node.d.ts.map +1 -0
  247. package/dist/node/agent-node.js +179 -0
  248. package/dist/node/agent-node.js.map +1 -0
  249. package/dist/node/catch-directive.d.ts +33 -0
  250. package/dist/node/catch-directive.d.ts.map +1 -0
  251. package/dist/node/catch-directive.js +41 -0
  252. package/dist/node/catch-directive.js.map +1 -0
  253. package/dist/output/conversation-output.d.ts +113 -0
  254. package/dist/output/conversation-output.d.ts.map +1 -0
  255. package/dist/output/conversation-output.js +100 -0
  256. package/dist/output/conversation-output.js.map +1 -0
  257. package/dist/persistence/conversation.entity.d.ts +27 -0
  258. package/dist/persistence/conversation.entity.d.ts.map +1 -0
  259. package/dist/persistence/conversation.entity.js +115 -0
  260. package/dist/persistence/conversation.entity.js.map +1 -0
  261. package/dist/persistence/conversation.repository.d.ts +82 -0
  262. package/dist/persistence/conversation.repository.d.ts.map +1 -0
  263. package/dist/persistence/conversation.repository.js +277 -0
  264. package/dist/persistence/conversation.repository.js.map +1 -0
  265. package/dist/persistence/project.entity.d.ts +12 -0
  266. package/dist/persistence/project.entity.d.ts.map +1 -0
  267. package/dist/persistence/project.entity.js +46 -0
  268. package/dist/persistence/project.entity.js.map +1 -0
  269. package/dist/persistence/project.repository.d.ts +17 -0
  270. package/dist/persistence/project.repository.d.ts.map +1 -0
  271. package/dist/persistence/project.repository.js +69 -0
  272. package/dist/persistence/project.repository.js.map +1 -0
  273. package/dist/persistence/provider-ingress.entity.d.ts +18 -0
  274. package/dist/persistence/provider-ingress.entity.d.ts.map +1 -0
  275. package/dist/persistence/provider-ingress.entity.js +91 -0
  276. package/dist/persistence/provider-ingress.entity.js.map +1 -0
  277. package/dist/persistence/provider-ingress.repository.d.ts +21 -0
  278. package/dist/persistence/provider-ingress.repository.d.ts.map +1 -0
  279. package/dist/persistence/provider-ingress.repository.js +76 -0
  280. package/dist/persistence/provider-ingress.repository.js.map +1 -0
  281. package/dist/studio-ui/assets/index-BGd2OhLv.js +84 -0
  282. package/dist/studio-ui/assets/index-BGd2OhLv.js.map +1 -0
  283. package/dist/studio-ui/assets/index-DnJos5x2.css +1 -0
  284. package/dist/studio-ui/index.html +13 -0
  285. package/dist/studio-ui-mount/index.d.ts +6 -0
  286. package/dist/studio-ui-mount/index.d.ts.map +1 -0
  287. package/dist/studio-ui-mount/index.js +13 -0
  288. package/dist/studio-ui-mount/index.js.map +1 -0
  289. package/dist/studio-ui-mount/resolve-studio-ui-root.d.ts +6 -0
  290. package/dist/studio-ui-mount/resolve-studio-ui-root.d.ts.map +1 -0
  291. package/dist/studio-ui-mount/resolve-studio-ui-root.js +25 -0
  292. package/dist/studio-ui-mount/resolve-studio-ui-root.js.map +1 -0
  293. package/dist/studio-ui-mount/studio-spa.controller.d.ts +18 -0
  294. package/dist/studio-ui-mount/studio-spa.controller.d.ts.map +1 -0
  295. package/dist/studio-ui-mount/studio-spa.controller.js +57 -0
  296. package/dist/studio-ui-mount/studio-spa.controller.js.map +1 -0
  297. package/dist/studio-ui-mount/studio-ui.module.d.ts +15 -0
  298. package/dist/studio-ui-mount/studio-ui.module.d.ts.map +1 -0
  299. package/dist/studio-ui-mount/studio-ui.module.js +47 -0
  300. package/dist/studio-ui-mount/studio-ui.module.js.map +1 -0
  301. package/dist/studio-ui-mount/studio-ui.tokens.d.ts +2 -0
  302. package/dist/studio-ui-mount/studio-ui.tokens.d.ts.map +1 -0
  303. package/dist/studio-ui-mount/studio-ui.tokens.js +5 -0
  304. package/dist/studio-ui-mount/studio-ui.tokens.js.map +1 -0
  305. package/dist/supervisor/supervisor-cascade.d.ts +55 -0
  306. package/dist/supervisor/supervisor-cascade.d.ts.map +1 -0
  307. package/dist/supervisor/supervisor-cascade.js +261 -0
  308. package/dist/supervisor/supervisor-cascade.js.map +1 -0
  309. package/dist/supervisor/supervisor-engine.d.ts +9 -0
  310. package/dist/supervisor/supervisor-engine.d.ts.map +1 -0
  311. package/dist/supervisor/supervisor-engine.js +64 -0
  312. package/dist/supervisor/supervisor-engine.js.map +1 -0
  313. package/dist/supervisor/supervisor-limits.d.ts +8 -0
  314. package/dist/supervisor/supervisor-limits.d.ts.map +1 -0
  315. package/dist/supervisor/supervisor-limits.js +36 -0
  316. package/dist/supervisor/supervisor-limits.js.map +1 -0
  317. package/dist/supervisor/supervisor-node-exec.d.ts +39 -0
  318. package/dist/supervisor/supervisor-node-exec.d.ts.map +1 -0
  319. package/dist/supervisor/supervisor-node-exec.js +201 -0
  320. package/dist/supervisor/supervisor-node-exec.js.map +1 -0
  321. package/dist/supervisor/supervisor-orchestration.d.ts +24 -0
  322. package/dist/supervisor/supervisor-orchestration.d.ts.map +1 -0
  323. package/dist/supervisor/supervisor-orchestration.js +395 -0
  324. package/dist/supervisor/supervisor-orchestration.js.map +1 -0
  325. package/dist/supervisor/supervisor-portal.d.ts +75 -0
  326. package/dist/supervisor/supervisor-portal.d.ts.map +1 -0
  327. package/dist/supervisor/supervisor-portal.js +320 -0
  328. package/dist/supervisor/supervisor-portal.js.map +1 -0
  329. package/dist/supervisor/supervisor-route.d.ts +53 -0
  330. package/dist/supervisor/supervisor-route.d.ts.map +1 -0
  331. package/dist/supervisor/supervisor-route.js +308 -0
  332. package/dist/supervisor/supervisor-route.js.map +1 -0
  333. package/dist/supervisor/supervisor-special-turns.d.ts +34 -0
  334. package/dist/supervisor/supervisor-special-turns.d.ts.map +1 -0
  335. package/dist/supervisor/supervisor-special-turns.js +308 -0
  336. package/dist/supervisor/supervisor-special-turns.js.map +1 -0
  337. package/dist/supervisor/supervisor.d.ts +44 -0
  338. package/dist/supervisor/supervisor.d.ts.map +1 -0
  339. package/dist/supervisor/supervisor.js +79 -0
  340. package/dist/supervisor/supervisor.js.map +1 -0
  341. package/dist/supervisor/supervisor.types.d.ts +71 -0
  342. package/dist/supervisor/supervisor.types.d.ts.map +1 -0
  343. package/dist/supervisor/supervisor.types.js +8 -0
  344. package/dist/supervisor/supervisor.types.js.map +1 -0
  345. package/dist/tasks/studio-task-queue.d.ts +93 -0
  346. package/dist/tasks/studio-task-queue.d.ts.map +1 -0
  347. package/dist/tasks/studio-task-queue.js +226 -0
  348. package/dist/tasks/studio-task-queue.js.map +1 -0
  349. package/dist/util/studio-env.d.ts +7 -0
  350. package/dist/util/studio-env.d.ts.map +1 -0
  351. package/dist/util/studio-env.js +32 -0
  352. package/dist/util/studio-env.js.map +1 -0
  353. package/dist/vapi-studio.module.d.ts +55 -0
  354. package/dist/vapi-studio.module.d.ts.map +1 -0
  355. package/dist/vapi-studio.module.js +166 -0
  356. package/dist/vapi-studio.module.js.map +1 -0
  357. package/dist/workflow/workflow-handoff.service.d.ts +29 -0
  358. package/dist/workflow/workflow-handoff.service.d.ts.map +1 -0
  359. package/dist/workflow/workflow-handoff.service.js +165 -0
  360. package/dist/workflow/workflow-handoff.service.js.map +1 -0
  361. package/dist/workflow/workflow-loader.d.ts +48 -0
  362. package/dist/workflow/workflow-loader.d.ts.map +1 -0
  363. package/dist/workflow/workflow-loader.js +87 -0
  364. package/dist/workflow/workflow-loader.js.map +1 -0
  365. package/docs/README.md +69 -0
  366. package/docs/assets/deterministic-assistant-flow.svg +128 -0
  367. package/docs/assets/vapi-studio-stack.svg +26 -0
  368. package/docs/best-practices/README.md +37 -0
  369. package/docs/best-practices/brain-and-prompt-injection.md +70 -0
  370. package/docs/best-practices/conversation-design.md +152 -0
  371. package/docs/best-practices/debugging-and-observability.md +49 -0
  372. package/docs/best-practices/documentation-layers.md +31 -0
  373. package/docs/best-practices/identity-and-pii.md +66 -0
  374. package/docs/best-practices/nodes-and-listens.md +116 -0
  375. package/docs/best-practices/ui-and-api-identity.md +51 -0
  376. package/docs/building-apps/creating-an-app.md +59 -0
  377. package/docs/building-apps/example-apps.md +23 -0
  378. package/docs/building-apps/overview.md +27 -0
  379. package/docs/getting-started/installation.md +52 -0
  380. package/docs/getting-started/introduction.md +23 -0
  381. package/docs/getting-started/quick-start.md +23 -0
  382. package/docs/guide/concepts.md +103 -0
  383. package/docs/guide/forms.md +102 -0
  384. package/docs/guide/handbook.md +21 -0
  385. package/docs/guide/introduction.md +56 -0
  386. package/docs/guide/module-setup.md +68 -0
  387. package/docs/guide/vapi-adapter.md +70 -0
  388. package/docs/guide/workflow-squad.md +59 -0
  389. package/docs/guides/agents.md +85 -0
  390. package/docs/guides/docker-compose.events.stub.yaml +27 -0
  391. package/docs/guides/documentation.md +13 -0
  392. package/docs/guides/extending-events.md +155 -0
  393. package/docs/guides/node-conventions.md +59 -0
  394. package/docs/guides/speckit.md +56 -0
  395. package/docs/reference/data-model.md +79 -0
  396. package/docs/reference/environment-variables.md +60 -0
  397. package/docs/reference/events-and-logging.md +137 -0
  398. package/docs/reference/flow-schema.md +79 -0
  399. package/docs/reference/runtime-api.md +708 -0
  400. package/docs/reference/security.md +41 -0
  401. package/docs/reference/standard-intentions.md +49 -0
  402. package/docs/reference/testing.md +15 -0
  403. package/docs/samples/events/nest-listener.example.ts +17 -0
  404. package/docs/samples/events/redis-bridge.example.ts +44 -0
  405. package/package.json +81 -0
  406. package/scripts/fix-access-modifiers.mjs +85 -0
  407. package/scripts/install-agent-refs.cjs +196 -0
@@ -0,0 +1,84 @@
1
+ var iS=Object.defineProperty;var rS=(n,l,r)=>l in n?iS(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var it=(n,l,r)=>rS(n,typeof l!="symbol"?l+"":l,r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))u(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&u(c)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function u(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();function Pd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xf={exports:{}},dr={};/**
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 f0;function uS(){if(f0)return dr;f0=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(u,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:n,type:u,key:c,ref:o!==void 0?o:null,props:s}}return dr.Fragment=l,dr.jsx=r,dr.jsxs=r,dr}var d0;function oS(){return d0||(d0=1,xf.exports=uS()),xf.exports}var A=oS(),Ef={exports:{}},_e={};/**
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 h0;function sS(){if(h0)return _e;h0=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(z){return z===null||typeof z!="object"?null:(z=v&&z[v]||z["@@iterator"],typeof z=="function"?z:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,w={};function S(z,V,q){this.props=z,this.context=V,this.refs=w,this.updater=q||E}S.prototype.isReactComponent={},S.prototype.setState=function(z,V){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,V,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=S.prototype;function _(z,V,q){this.props=z,this.context=V,this.refs=w,this.updater=q||E}var M=_.prototype=new C;M.constructor=_,N(M,S.prototype),M.isPureReactComponent=!0;var B=Array.isArray;function L(){}var U={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function H(z,V,q){var G=q.ref;return{$$typeof:n,type:z,key:V,ref:G!==void 0?G:null,props:q}}function $(z,V){return H(z.type,V,z.props)}function k(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function Q(z){var V={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(q){return V[q]})}var P=/\/+/g;function R(z,V){return typeof z=="object"&&z!==null&&z.key!=null?Q(""+z.key):V.toString(36)}function Z(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(L,L):(z.status="pending",z.then(function(V){z.status==="pending"&&(z.status="fulfilled",z.value=V)},function(V){z.status==="pending"&&(z.status="rejected",z.reason=V)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function D(z,V,q,G,J){var re=typeof z;(re==="undefined"||re==="boolean")&&(z=null);var se=!1;if(z===null)se=!0;else switch(re){case"bigint":case"string":case"number":se=!0;break;case"object":switch(z.$$typeof){case n:case l:se=!0;break;case p:return se=z._init,D(se(z._payload),V,q,G,J)}}if(se)return J=J(z),se=G===""?"."+R(z,0):G,B(J)?(q="",se!=null&&(q=se.replace(P,"$&/")+"/"),D(J,V,q,"",function(ge){return ge})):J!=null&&(k(J)&&(J=$(J,q+(J.key==null||z&&z.key===J.key?"":(""+J.key).replace(P,"$&/")+"/")+se)),V.push(J)),1;se=0;var ee=G===""?".":G+":";if(B(z))for(var fe=0;fe<z.length;fe++)G=z[fe],re=ee+R(G,fe),se+=D(G,V,q,re,J);else if(fe=b(z),typeof fe=="function")for(z=fe.call(z),fe=0;!(G=z.next()).done;)G=G.value,re=ee+R(G,fe++),se+=D(G,V,q,re,J);else if(re==="object"){if(typeof z.then=="function")return D(Z(z),V,q,G,J);throw V=String(z),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return se}function Y(z,V,q){if(z==null)return z;var G=[],J=0;return D(z,G,"","",function(re){return V.call(q,re,J++)}),G}function F(z){if(z._status===-1){var V=z._result;V=V(),V.then(function(q){(z._status===0||z._status===-1)&&(z._status=1,z._result=q)},function(q){(z._status===0||z._status===-1)&&(z._status=2,z._result=q)}),z._status===-1&&(z._status=0,z._result=V)}if(z._status===1)return z._result.default;throw z._result}var I=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},le={map:Y,forEach:function(z,V,q){Y(z,function(){V.apply(this,arguments)},q)},count:function(z){var V=0;return Y(z,function(){V++}),V},toArray:function(z){return Y(z,function(V){return V})||[]},only:function(z){if(!k(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return _e.Activity=y,_e.Children=le,_e.Component=S,_e.Fragment=r,_e.Profiler=o,_e.PureComponent=_,_e.StrictMode=u,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,_e.__COMPILER_RUNTIME={__proto__:null,c:function(z){return U.H.useMemoCache(z)}},_e.cache=function(z){return function(){return z.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(z,V,q){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var G=N({},z.props),J=z.key;if(V!=null)for(re in V.key!==void 0&&(J=""+V.key),V)!O.call(V,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&V.ref===void 0||(G[re]=V[re]);var re=arguments.length-2;if(re===1)G.children=q;else if(1<re){for(var se=Array(re),ee=0;ee<re;ee++)se[ee]=arguments[ee+2];G.children=se}return H(z.type,J,G)},_e.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},_e.createElement=function(z,V,q){var G,J={},re=null;if(V!=null)for(G in V.key!==void 0&&(re=""+V.key),V)O.call(V,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=V[G]);var se=arguments.length-2;if(se===1)J.children=q;else if(1<se){for(var ee=Array(se),fe=0;fe<se;fe++)ee[fe]=arguments[fe+2];J.children=ee}if(z&&z.defaultProps)for(G in se=z.defaultProps,se)J[G]===void 0&&(J[G]=se[G]);return H(z,re,J)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(z){return{$$typeof:d,render:z}},_e.isValidElement=k,_e.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:F}},_e.memo=function(z,V){return{$$typeof:g,type:z,compare:V===void 0?null:V}},_e.startTransition=function(z){var V=U.T,q={};U.T=q;try{var G=z(),J=U.S;J!==null&&J(q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(L,I)}catch(re){I(re)}finally{V!==null&&q.types!==null&&(V.types=q.types),U.T=V}},_e.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},_e.use=function(z){return U.H.use(z)},_e.useActionState=function(z,V,q){return U.H.useActionState(z,V,q)},_e.useCallback=function(z,V){return U.H.useCallback(z,V)},_e.useContext=function(z){return U.H.useContext(z)},_e.useDebugValue=function(){},_e.useDeferredValue=function(z,V){return U.H.useDeferredValue(z,V)},_e.useEffect=function(z,V){return U.H.useEffect(z,V)},_e.useEffectEvent=function(z){return U.H.useEffectEvent(z)},_e.useId=function(){return U.H.useId()},_e.useImperativeHandle=function(z,V,q){return U.H.useImperativeHandle(z,V,q)},_e.useInsertionEffect=function(z,V){return U.H.useInsertionEffect(z,V)},_e.useLayoutEffect=function(z,V){return U.H.useLayoutEffect(z,V)},_e.useMemo=function(z,V){return U.H.useMemo(z,V)},_e.useOptimistic=function(z,V){return U.H.useOptimistic(z,V)},_e.useReducer=function(z,V,q){return U.H.useReducer(z,V,q)},_e.useRef=function(z){return U.H.useRef(z)},_e.useState=function(z){return U.H.useState(z)},_e.useSyncExternalStore=function(z,V,q){return U.H.useSyncExternalStore(z,V,q)},_e.useTransition=function(){return U.H.useTransition()},_e.version="19.2.8",_e}var m0;function Or(){return m0||(m0=1,Ef.exports=sS()),Ef.exports}var j=Or();const cS=Pd(j);var Sf={exports:{}},hr={},wf={exports:{}},_f={};/**
18
+ * @license React
19
+ * scheduler.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 g0;function fS(){return g0||(g0=1,(function(n){function l(D,Y){var F=D.length;D.push(Y);e:for(;0<F;){var I=F-1>>>1,le=D[I];if(0<o(le,Y))D[I]=Y,D[F]=le,F=I;else break e}}function r(D){return D.length===0?null:D[0]}function u(D){if(D.length===0)return null;var Y=D[0],F=D.pop();if(F!==Y){D[0]=F;e:for(var I=0,le=D.length,z=le>>>1;I<z;){var V=2*(I+1)-1,q=D[V],G=V+1,J=D[G];if(0>o(q,F))G<le&&0>o(J,q)?(D[I]=J,D[G]=F,I=G):(D[I]=q,D[V]=F,I=V);else if(G<le&&0>o(J,F))D[I]=J,D[G]=F,I=G;else break e}}return Y}function o(D,Y){var F=D.sortIndex-Y.sortIndex;return F!==0?F:D.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();n.unstable_now=function(){return c.now()-d}}var h=[],g=[],p=1,y=null,v=3,b=!1,E=!1,N=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function M(D){for(var Y=r(g);Y!==null;){if(Y.callback===null)u(g);else if(Y.startTime<=D)u(g),Y.sortIndex=Y.expirationTime,l(h,Y);else break;Y=r(g)}}function B(D){if(N=!1,M(D),!E)if(r(h)!==null)E=!0,L||(L=!0,Q());else{var Y=r(g);Y!==null&&Z(B,Y.startTime-D)}}var L=!1,U=-1,O=5,H=-1;function $(){return w?!0:!(n.unstable_now()-H<O)}function k(){if(w=!1,L){var D=n.unstable_now();H=D;var Y=!0;try{e:{E=!1,N&&(N=!1,C(U),U=-1),b=!0;var F=v;try{t:{for(M(D),y=r(h);y!==null&&!(y.expirationTime>D&&$());){var I=y.callback;if(typeof I=="function"){y.callback=null,v=y.priorityLevel;var le=I(y.expirationTime<=D);if(D=n.unstable_now(),typeof le=="function"){y.callback=le,M(D),Y=!0;break t}y===r(h)&&u(h),M(D)}else u(h);y=r(h)}if(y!==null)Y=!0;else{var z=r(g);z!==null&&Z(B,z.startTime-D),Y=!1}}break e}finally{y=null,v=F,b=!1}Y=void 0}}finally{Y?Q():L=!1}}}var Q;if(typeof _=="function")Q=function(){_(k)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,R=P.port2;P.port1.onmessage=k,Q=function(){R.postMessage(null)}}else Q=function(){S(k,0)};function Z(D,Y){U=S(function(){D(n.unstable_now())},Y)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(D){D.callback=null},n.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<D?Math.floor(1e3/D):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(D){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var F=v;v=Y;try{return D()}finally{v=F}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(D,Y){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var F=v;v=D;try{return Y()}finally{v=F}},n.unstable_scheduleCallback=function(D,Y,F){var I=n.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?I+F:I):F=I,D){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=F+le,D={id:p++,callback:Y,priorityLevel:D,startTime:F,expirationTime:le,sortIndex:-1},F>I?(D.sortIndex=F,l(g,D),r(h)===null&&D===r(g)&&(N?(C(U),U=-1):N=!0,Z(B,F-I))):(D.sortIndex=le,l(h,D),E||b||(E=!0,L||(L=!0,Q()))),D},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(D){var Y=v;return function(){var F=v;v=Y;try{return D.apply(this,arguments)}finally{v=F}}}})(_f)),_f}var p0;function dS(){return p0||(p0=1,wf.exports=fS()),wf.exports}var Nf={exports:{}},pt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var y0;function hS(){if(y0)return pt;y0=1;var n=Or();function l(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)g+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(h,g,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:h,containerInfo:g,implementation:p}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,pt.createPortal=function(h,g){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return s(h,g,null,p)},pt.flushSync=function(h){var g=c.T,p=u.p;try{if(c.T=null,u.p=2,h)return h()}finally{c.T=g,u.p=p,u.d.f()}},pt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(h,g))},pt.prefetchDNS=function(h){typeof h=="string"&&u.d.D(h)},pt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var p=g.as,y=d(p,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,b=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;p==="style"?u.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):p==="script"&&u.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},pt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var p=d(g.as,g.crossOrigin);u.d.M(h,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(h)},pt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var p=g.as,y=d(p,g.crossOrigin);u.d.L(h,p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},pt.preloadModule=function(h,g){if(typeof h=="string")if(g){var p=d(g.as,g.crossOrigin);u.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(h)},pt.requestFormReset=function(h){u.d.r(h)},pt.unstable_batchedUpdates=function(h,g){return h(g)},pt.useFormState=function(h,g,p){return c.H.useFormState(h,g,p)},pt.useFormStatus=function(){return c.H.useHostTransitionStatus()},pt.version="19.2.8",pt}var v0;function Lv(){if(v0)return Nf.exports;v0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Nf.exports=hS(),Nf.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var b0;function mS(){if(b0)return hr;b0=1;var n=dS(),l=Or(),r=Lv();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(s(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,i=t;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(i=f.return,i!==null){a=i;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return h(f),e;if(m===i)return h(f),t;m=m.sibling}throw Error(u(188))}if(a.return!==i.return)a=f,i=m;else{for(var x=!1,T=f.child;T;){if(T===a){x=!0,a=f,i=m;break}if(T===i){x=!0,i=f,a=m;break}T=T.sibling}if(!x){for(T=m.child;T;){if(T===a){x=!0,a=m,i=f;break}if(T===i){x=!0,i=m,a=f;break}T=T.sibling}if(!x)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),_=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=k&&e[k]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function R(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case L:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case _:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:R(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return R(e(t))}catch{}}return null}var Z=Array.isArray,D=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],le=-1;function z(e){return{current:e}}function V(e){0>le||(e.current=I[le],I[le]=null,le--)}function q(e,t){le++,I[le]=e.current,e.current=t}var G=z(null),J=z(null),re=z(null),se=z(null);function ee(e,t){switch(q(re,t),q(J,e),q(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jp(t),e=Lp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(G),q(G,e)}function fe(){V(G),V(J),V(re)}function ge(e){e.memoizedState!==null&&q(se,e);var t=G.current,a=Lp(t,e.type);t!==a&&(q(J,e),q(G,a))}function be(e){J.current===e&&(V(G),V(J)),se.current===e&&(V(se),or._currentValue=F)}var me,ne;function he(e){if(me===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||"",ne=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+me+e+ne}var pe=!1;function we(e,t){if(!e||pe)return"";pe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ue){var ie=ue}Reflect.construct(e,[],de)}else{try{de.call()}catch(ue){ie=ue}e.call(de.prototype)}}else{try{throw Error()}catch(ue){ie=ue}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ue){if(ue&&ie&&typeof ue.stack=="string")return[ue.stack,ie.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),x=m[0],T=m[1];if(x&&T){var X=x.split(`
44
+ `),ae=T.split(`
45
+ `);for(f=i=0;i<X.length&&!X[i].includes("DetermineComponentFrameRoot");)i++;for(;f<ae.length&&!ae[f].includes("DetermineComponentFrameRoot");)f++;if(i===X.length||f===ae.length)for(i=X.length-1,f=ae.length-1;1<=i&&0<=f&&X[i]!==ae[f];)f--;for(;1<=i&&0<=f;i--,f--)if(X[i]!==ae[f]){if(i!==1||f!==1)do if(i--,f--,0>f||X[i]!==ae[f]){var oe=`
46
+ `+X[i].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=i&&0<=f);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?he(a):""}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he("Lazy");case 13:return e.child!==t&&t!==null?he("Suspense Fallback"):he("Suspense");case 19:return he("SuspenseList");case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return he("Activity");default:return""}}function yt(e){try{var t="",a=null;do t+=ze(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var Et=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Ot=n.unstable_cancelCallback,Da=n.unstable_shouldYield,Tn=n.unstable_requestPaint,Fe=n.unstable_now,Dt=n.unstable_getCurrentPriorityLevel,$t=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,Zt=n.unstable_NormalPriority,gi=n.unstable_LowPriority,dl=n.unstable_IdlePriority,ls=n.log,is=n.unstable_setDisableYieldValue,ja=null,vt=null;function vn(e){if(typeof ls=="function"&&is(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(ja,e)}catch{}}var bt=Math.clz32?Math.clz32:os,rs=Math.log,us=Math.LN2;function os(e){return e>>>=0,e===0?32:31-(rs(e)/us|0)|0}var hl=256,ml=262144,gl=4194304;function An(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pl(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var f=0,m=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?f=An(i):(x&=T,x!==0?f=An(x):a||(a=T&~e,a!==0&&(f=An(a))))):(T=i&~m,T!==0?f=An(T):x!==0?f=An(x):a||(a=i&~e,a!==0&&(f=An(a)))),f===0?0:t!==0&&t!==f&&(t&m)===0&&(m=f&-f,a=t&-t,m>=a||m===32&&(a&4194048)!==0)?t:f}function La(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ss(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yr(){var e=gl;return gl<<=1,(gl&62914560)===0&&(gl=4194304),e}function pi(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cs(e,t,a,i,f,m){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var T=e.entanglements,X=e.expirationTimes,ae=e.hiddenUpdates;for(a=x&~a;0<a;){var oe=31-bt(a),de=1<<oe;T[oe]=0,X[oe]=-1;var ie=ae[oe];if(ie!==null)for(ae[oe]=null,oe=0;oe<ie.length;oe++){var ue=ie[oe];ue!==null&&(ue.lane&=-536870913)}a&=~de}i!==0&&Vr(e,i,0),m!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=m&~(x&~t))}function Vr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-bt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function Gr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-bt(a),f=1<<i;f&t|e[i]&t&&(e[i]|=t),a&=~f}}function Xr(e,t){var a=t&-t;return a=(a&42)!==0?1:yi(a),(a&(e.suspendedLanes|t))!==0?0:a}function yi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $r(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:l0(e.type))}function Qr(e,t){var a=Y.p;try{return Y.p=e,t()}finally{Y.p=a}}var bn=Math.random().toString(36).slice(2),ot="__reactFiber$"+bn,gt="__reactProps$"+bn,Rn="__reactContainer$"+bn,yl="__reactEvents$"+bn,Zr="__reactListeners$"+bn,fs="__reactHandles$"+bn,Kr="__reactResources$"+bn,Ba="__reactMarker$"+bn;function bi(e){delete e[ot],delete e[gt],delete e[yl],delete e[Zr],delete e[fs]}function Pn(e){var t=e[ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Rn]||a[ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Vp(e);e!==null;){if(a=e[ot])return a;e=Vp(e)}return t}e=a,a=e.parentNode}return null}function ea(e){if(e=e[ot]||e[Rn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ta(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function na(e){var t=e[Kr];return t||(t=e[Kr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Ba]=!0}var Ir=new Set,Jr={};function zn(e,t){aa(e,t),aa(e+"Capture",t)}function aa(e,t){for(Jr[e]=t,e=0;e<t.length;e++)Ir.add(t[e])}var ds=RegExp("^[: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][: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]*$"),Fr={},xi={};function hs(e){return Et.call(xi,e)?!0:Et.call(Fr,e)?!1:ds.test(e)?xi[e]=!0:(Fr[e]=!0,!1)}function vl(e,t,a){if(hs(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function bl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function an(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ms(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(x){a=""+x,m.call(this,x)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ei(e){if(!e._valueTracker){var t=Wr(e)?"checked":"value";e._valueTracker=ms(e,t,""+e[t])}}function Ua(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Wr(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function xl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Pr=/[\n"\\]/g;function _t(e){return e.replace(Pr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Si(e,t,a,i,f,m,x,T){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wt(t)):e.value!==""+wt(t)&&(e.value=""+wt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?wi(e,x,wt(t)):a!=null?wi(e,x,wt(a)):i!=null&&e.removeAttribute("value"),f==null&&m!=null&&(e.defaultChecked=!!m),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+wt(T):e.removeAttribute("name")}function El(e,t,a,i,f,m,x,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){Ei(e);return}a=a!=null?""+wt(a):"",t=t!=null?""+wt(t):a,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??f,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Ei(e)}function wi(e,t,a){t==="number"&&xl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function la(e,t,a,i){if(e=e.options,t){t={};for(var f=0;f<a.length;f++)t["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=t.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&i&&(e[a].defaultSelected=!0)}else{for(a=""+wt(a),t=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,i&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function _i(e,t,a){if(t!=null&&(t=""+wt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+wt(a):""}function Rh(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(u(92));if(Z(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=wt(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),Ei(e)}function Sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ex=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zh(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||ex.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Oh(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var f in t)i=t[f],t.hasOwnProperty(f)&&a[f]!==i&&zh(e,f,i)}else for(var m in t)t.hasOwnProperty(m)&&zh(e,m,t[m])}function gs(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function eu(e){return nx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function On(){}var ps=null;function ys(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wl=null,_l=null;function Dh(e){var t=ea(e);if(t&&(e=t.stateNode)){var a=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Si(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+_t(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var f=i[gt]||null;if(!f)throw Error(u(90));Si(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&Ua(i)}break e;case"textarea":_i(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&la(e,!!a.multiple,t,!1)}}}var vs=!1;function jh(e,t,a){if(vs)return e(t,a);vs=!0;try{var i=e(t);return i}finally{if(vs=!1,(wl!==null||_l!==null)&&(Yu(),wl&&(t=wl,e=_l,_l=wl=null,Dh(t),e)))for(t=0;t<e.length;t++)Dh(e[t])}}function Ni(e,t){var a=e.stateNode;if(a===null)return null;var i=a[gt]||null;if(i===null)return null;a=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bs=!1;if(Dn)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){bs=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{bs=!1}var ia=null,xs=null,tu=null;function Lh(){if(tu)return tu;var e,t=xs,a=t.length,i,f="value"in ia?ia.value:ia.textContent,m=f.length;for(e=0;e<a&&t[e]===f[e];e++);var x=a-e;for(i=1;i<=x&&t[a-i]===f[m-i];i++);return tu=f.slice(e,1<i?1-i:void 0)}function nu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function au(){return!0}function Hh(){return!1}function Nt(e){function t(a,i,f,m,x){this._reactName=a,this._targetInst=f,this.type=i,this.nativeEvent=m,this.target=x,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(a=e[T],this[T]=a?a(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?au:Hh,this.isPropagationStopped=Hh,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=au)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=au)},persist:function(){},isPersistent:au}),t}var qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lu=Nt(qa),Mi=y({},qa,{view:0,detail:0}),ax=Nt(Mi),Es,Ss,Ti,iu=y({},Mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_s,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ti&&(Ti&&e.type==="mousemove"?(Es=e.screenX-Ti.screenX,Ss=e.screenY-Ti.screenY):Ss=Es=0,Ti=e),Es)},movementY:function(e){return"movementY"in e?e.movementY:Ss}}),Bh=Nt(iu),lx=y({},iu,{dataTransfer:0}),ix=Nt(lx),rx=y({},Mi,{relatedTarget:0}),ws=Nt(rx),ux=y({},qa,{animationName:0,elapsedTime:0,pseudoElement:0}),ox=Nt(ux),sx=y({},qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cx=Nt(sx),fx=y({},qa,{data:0}),Uh=Nt(fx),dx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mx[e])?!!t[e]:!1}function _s(){return gx}var px=y({},Mi,{key:function(e){if(e.key){var t=dx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_s,charCode:function(e){return e.type==="keypress"?nu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),yx=Nt(px),vx=y({},iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qh=Nt(vx),bx=y({},Mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_s}),xx=Nt(bx),Ex=y({},qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sx=Nt(Ex),wx=y({},iu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_x=Nt(wx),Nx=y({},qa,{newState:0,oldState:0}),Cx=Nt(Nx),Mx=[9,13,27,32],Ns=Dn&&"CompositionEvent"in window,Ai=null;Dn&&"documentMode"in document&&(Ai=document.documentMode);var Tx=Dn&&"TextEvent"in window&&!Ai,kh=Dn&&(!Ns||Ai&&8<Ai&&11>=Ai),Yh=" ",Vh=!1;function Gh(e,t){switch(e){case"keyup":return Mx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nl=!1;function Ax(e,t){switch(e){case"compositionend":return Xh(t);case"keypress":return t.which!==32?null:(Vh=!0,Yh);case"textInput":return e=t.data,e===Yh&&Vh?null:e;default:return null}}function Rx(e,t){if(Nl)return e==="compositionend"||!Ns&&Gh(e,t)?(e=Lh(),tu=xs=ia=null,Nl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return kh&&t.locale!=="ko"?null:t.data;default:return null}}var zx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zx[e.type]:t==="textarea"}function Qh(e,t,a,i){wl?_l?_l.push(i):_l=[i]:wl=i,t=Ku(t,"onChange"),0<t.length&&(a=new lu("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var Ri=null,zi=null;function Ox(e){Tp(e,0)}function ru(e){var t=ta(e);if(Ua(t))return e}function Zh(e,t){if(e==="change")return t}var Kh=!1;if(Dn){var Cs;if(Dn){var Ms="oninput"in document;if(!Ms){var Ih=document.createElement("div");Ih.setAttribute("oninput","return;"),Ms=typeof Ih.oninput=="function"}Cs=Ms}else Cs=!1;Kh=Cs&&(!document.documentMode||9<document.documentMode)}function Jh(){Ri&&(Ri.detachEvent("onpropertychange",Fh),zi=Ri=null)}function Fh(e){if(e.propertyName==="value"&&ru(zi)){var t=[];Qh(t,zi,e,ys(e)),jh(Ox,t)}}function Dx(e,t,a){e==="focusin"?(Jh(),Ri=t,zi=a,Ri.attachEvent("onpropertychange",Fh)):e==="focusout"&&Jh()}function jx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ru(zi)}function Lx(e,t){if(e==="click")return ru(t)}function Hx(e,t){if(e==="input"||e==="change")return ru(t)}function Bx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jt=typeof Object.is=="function"?Object.is:Bx;function Oi(e,t){if(jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var f=a[i];if(!Et.call(t,f)||!jt(e[f],t[f]))return!1}return!0}function Wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ph(e,t){var a=Wh(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wh(a)}}function em(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?em(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xl(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=xl(e.document)}return t}function Ts(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ux=Dn&&"documentMode"in document&&11>=document.documentMode,Cl=null,As=null,Di=null,Rs=!1;function nm(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Rs||Cl==null||Cl!==xl(i)||(i=Cl,"selectionStart"in i&&Ts(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Di&&Oi(Di,i)||(Di=i,i=Ku(As,"onSelect"),0<i.length&&(t=new lu("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=Cl)))}function ka(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ml={animationend:ka("Animation","AnimationEnd"),animationiteration:ka("Animation","AnimationIteration"),animationstart:ka("Animation","AnimationStart"),transitionrun:ka("Transition","TransitionRun"),transitionstart:ka("Transition","TransitionStart"),transitioncancel:ka("Transition","TransitionCancel"),transitionend:ka("Transition","TransitionEnd")},zs={},am={};Dn&&(am=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Ya(e){if(zs[e])return zs[e];if(!Ml[e])return e;var t=Ml[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in am)return zs[e]=t[a];return e}var lm=Ya("animationend"),im=Ya("animationiteration"),rm=Ya("animationstart"),qx=Ya("transitionrun"),kx=Ya("transitionstart"),Yx=Ya("transitioncancel"),um=Ya("transitionend"),om=new Map,Os="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Os.push("scrollEnd");function ln(e,t){om.set(e,t),zn(t,[e])}var uu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Kt=[],Tl=0,Ds=0;function ou(){for(var e=Tl,t=Ds=Tl=0;t<e;){var a=Kt[t];Kt[t++]=null;var i=Kt[t];Kt[t++]=null;var f=Kt[t];Kt[t++]=null;var m=Kt[t];if(Kt[t++]=null,i!==null&&f!==null){var x=i.pending;x===null?f.next=f:(f.next=x.next,x.next=f),i.pending=f}m!==0&&sm(a,f,m)}}function su(e,t,a,i){Kt[Tl++]=e,Kt[Tl++]=t,Kt[Tl++]=a,Kt[Tl++]=i,Ds|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function js(e,t,a,i){return su(e,t,a,i),cu(e)}function Va(e,t){return su(e,null,null,t),cu(e)}function sm(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var f=!1,m=e.return;m!==null;)m.childLanes|=a,i=m.alternate,i!==null&&(i.childLanes|=a),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(f=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,f&&t!==null&&(f=31-bt(a),e=m.hiddenUpdates,i=e[f],i===null?e[f]=[t]:i.push(t),t.lane=a|536870912),m):null}function cu(e){if(50<tr)throw tr=0,Gc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Al={};function Vx(e,t,a,i){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,a,i){return new Vx(e,t,a,i)}function Ls(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jn(e,t){var a=e.alternate;return a===null?(a=Lt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function cm(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fu(e,t,a,i,f,m){var x=0;if(i=e,typeof e=="function")Ls(e)&&(x=1);else if(typeof e=="string")x=ZE(e,a,G.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=Lt(31,a,t,f),e.elementType=H,e.lanes=m,e;case N:return Ga(a.children,f,m,t);case w:x=8,f|=24;break;case S:return e=Lt(12,a,t,f|2),e.elementType=S,e.lanes=m,e;case B:return e=Lt(13,a,t,f),e.elementType=B,e.lanes=m,e;case L:return e=Lt(19,a,t,f),e.elementType=L,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:x=10;break e;case C:x=9;break e;case M:x=11;break e;case U:x=14;break e;case O:x=16,i=null;break e}x=29,a=Error(u(130,e===null?"null":typeof e,"")),i=null}return t=Lt(x,a,t,f),t.elementType=e,t.type=i,t.lanes=m,t}function Ga(e,t,a,i){return e=Lt(7,e,i,t),e.lanes=a,e}function Hs(e,t,a){return e=Lt(6,e,null,t),e.lanes=a,e}function fm(e){var t=Lt(18,null,null,0);return t.stateNode=e,t}function Bs(e,t,a){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var dm=new WeakMap;function It(e,t){if(typeof e=="object"&&e!==null){var a=dm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:yt(t)},dm.set(e,t),t)}return{value:e,source:t,stack:yt(t)}}var Rl=[],zl=0,du=null,ji=0,Jt=[],Ft=0,ra=null,xn=1,En="";function Ln(e,t){Rl[zl++]=ji,Rl[zl++]=du,du=e,ji=t}function hm(e,t,a){Jt[Ft++]=xn,Jt[Ft++]=En,Jt[Ft++]=ra,ra=e;var i=xn;e=En;var f=32-bt(i)-1;i&=~(1<<f),a+=1;var m=32-bt(t)+f;if(30<m){var x=f-f%5;m=(i&(1<<x)-1).toString(32),i>>=x,f-=x,xn=1<<32-bt(t)+f|a<<f|i,En=m+e}else xn=1<<m|a<<f|i,En=e}function Us(e){e.return!==null&&(Ln(e,1),hm(e,1,0))}function qs(e){for(;e===du;)du=Rl[--zl],Rl[zl]=null,ji=Rl[--zl],Rl[zl]=null;for(;e===ra;)ra=Jt[--Ft],Jt[Ft]=null,En=Jt[--Ft],Jt[Ft]=null,xn=Jt[--Ft],Jt[Ft]=null}function mm(e,t){Jt[Ft++]=xn,Jt[Ft++]=En,Jt[Ft++]=ra,xn=t.id,En=t.overflow,ra=e}var ft=null,Ge=null,Oe=!1,ua=null,Wt=!1,ks=Error(u(519));function oa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Li(It(t,e)),ks}function gm(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[ot]=e,t[gt]=i,a){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(a=0;a<ar.length;a++)Te(ar[a],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),El(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),Rh(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||Op(t.textContent,a)?(i.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),i.onScroll!=null&&Te("scroll",t),i.onScrollEnd!=null&&Te("scrollend",t),i.onClick!=null&&(t.onclick=On),t=!0):t=!1,t||oa(e,!0)}function pm(e){for(ft=e.return;ft;)switch(ft.tag){case 5:case 31:case 13:Wt=!1;return;case 27:case 3:Wt=!0;return;default:ft=ft.return}}function Ol(e){if(e!==ft)return!1;if(!Oe)return pm(e),Oe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||lf(e.type,e.memoizedProps)),a=!a),a&&Ge&&oa(e),pm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ge=Yp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ge=Yp(e)}else t===27?(t=Ge,Sa(e.type)?(e=cf,cf=null,Ge=e):Ge=t):Ge=ft?en(e.stateNode.nextSibling):null;return!0}function Xa(){Ge=ft=null,Oe=!1}function Ys(){var e=ua;return e!==null&&(At===null?At=e:At.push.apply(At,e),ua=null),e}function Li(e){ua===null?ua=[e]:ua.push(e)}var Vs=z(null),$a=null,Hn=null;function sa(e,t,a){q(Vs,t._currentValue),t._currentValue=a}function Bn(e){e._currentValue=Vs.current,V(Vs)}function Gs(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function Xs(e,t,a,i){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var m=f.dependencies;if(m!==null){var x=f.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=f;for(var X=0;X<t.length;X++)if(T.context===t[X]){m.lanes|=a,T=m.alternate,T!==null&&(T.lanes|=a),Gs(m.return,a,e),i||(x=null);break e}m=T.next}}else if(f.tag===18){if(x=f.return,x===null)throw Error(u(341));x.lanes|=a,m=x.alternate,m!==null&&(m.lanes|=a),Gs(x,a,e),x=null}else x=f.child;if(x!==null)x.return=f;else for(x=f;x!==null;){if(x===e){x=null;break}if(f=x.sibling,f!==null){f.return=x.return,x=f;break}x=x.return}f=x}}function Dl(e,t,a,i){e=null;for(var f=t,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var x=f.alternate;if(x===null)throw Error(u(387));if(x=x.memoizedProps,x!==null){var T=f.type;jt(f.pendingProps.value,x.value)||(e!==null?e.push(T):e=[T])}}else if(f===se.current){if(x=f.alternate,x===null)throw Error(u(387));x.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(or):e=[or])}f=f.return}e!==null&&Xs(t,e,a,i),t.flags|=262144}function hu(e){for(e=e.firstContext;e!==null;){if(!jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qa(e){$a=e,Hn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return ym($a,e)}function mu(e,t){return $a===null&&Qa(e),ym(e,t)}function ym(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Hn===null){if(e===null)throw Error(u(308));Hn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hn=Hn.next=t;return a}var Gx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Xx=n.unstable_scheduleCallback,$x=n.unstable_NormalPriority,tt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $s(){return{controller:new Gx,data:new Map,refCount:0}}function Hi(e){e.refCount--,e.refCount===0&&Xx($x,function(){e.controller.abort()})}var Bi=null,Qs=0,jl=0,Ll=null;function Qx(e,t){if(Bi===null){var a=Bi=[];Qs=0,jl=Ic(),Ll={status:"pending",value:void 0,then:function(i){a.push(i)}}}return Qs++,t.then(vm,vm),t}function vm(){if(--Qs===0&&Bi!==null){Ll!==null&&(Ll.status="fulfilled");var e=Bi;Bi=null,jl=0,Ll=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Zx(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var f=0;f<a.length;f++)(0,a[f])(t)},function(f){for(i.status="rejected",i.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),i}var bm=D.S;D.S=function(e,t){np=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qx(e,t),bm!==null&&bm(e,t)};var Za=z(null);function Zs(){var e=Za.current;return e!==null?e:Ve.pooledCache}function gu(e,t){t===null?q(Za,Za.current):q(Za,t.pool)}function xm(){var e=Zs();return e===null?null:{parent:tt._currentValue,pool:e}}var Hl=Error(u(460)),Ks=Error(u(474)),pu=Error(u(542)),yu={then:function(){}};function Em(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sm(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(On,On),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_m(e),e;default:if(typeof t.status=="string")t.then(On,On);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=i}},function(i){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_m(e),e}throw Ia=t,Hl}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ia=a,Hl):a}}var Ia=null;function wm(){if(Ia===null)throw Error(u(459));var e=Ia;return Ia=null,e}function _m(e){if(e===Hl||e===pu)throw Error(u(483))}var Bl=null,Ui=0;function vu(e){var t=Ui;return Ui+=1,Bl===null&&(Bl=[]),Sm(Bl,e,t)}function qi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function bu(e,t){throw t.$$typeof===v?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Nm(e){function t(W,K){if(e){var te=W.deletions;te===null?(W.deletions=[K],W.flags|=16):te.push(K)}}function a(W,K){if(!e)return null;for(;K!==null;)t(W,K),K=K.sibling;return null}function i(W){for(var K=new Map;W!==null;)W.key!==null?K.set(W.key,W):K.set(W.index,W),W=W.sibling;return K}function f(W,K){return W=jn(W,K),W.index=0,W.sibling=null,W}function m(W,K,te){return W.index=te,e?(te=W.alternate,te!==null?(te=te.index,te<K?(W.flags|=67108866,K):te):(W.flags|=67108866,K)):(W.flags|=1048576,K)}function x(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function T(W,K,te,ce){return K===null||K.tag!==6?(K=Hs(te,W.mode,ce),K.return=W,K):(K=f(K,te),K.return=W,K)}function X(W,K,te,ce){var Ee=te.type;return Ee===N?oe(W,K,te.props.children,ce,te.key):K!==null&&(K.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Ka(Ee)===K.type)?(K=f(K,te.props),qi(K,te),K.return=W,K):(K=fu(te.type,te.key,te.props,null,W.mode,ce),qi(K,te),K.return=W,K)}function ae(W,K,te,ce){return K===null||K.tag!==4||K.stateNode.containerInfo!==te.containerInfo||K.stateNode.implementation!==te.implementation?(K=Bs(te,W.mode,ce),K.return=W,K):(K=f(K,te.children||[]),K.return=W,K)}function oe(W,K,te,ce,Ee){return K===null||K.tag!==7?(K=Ga(te,W.mode,ce,Ee),K.return=W,K):(K=f(K,te),K.return=W,K)}function de(W,K,te){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Hs(""+K,W.mode,te),K.return=W,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return te=fu(K.type,K.key,K.props,null,W.mode,te),qi(te,K),te.return=W,te;case E:return K=Bs(K,W.mode,te),K.return=W,K;case O:return K=Ka(K),de(W,K,te)}if(Z(K)||Q(K))return K=Ga(K,W.mode,te,null),K.return=W,K;if(typeof K.then=="function")return de(W,vu(K),te);if(K.$$typeof===_)return de(W,mu(W,K),te);bu(W,K)}return null}function ie(W,K,te,ce){var Ee=K!==null?K.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ee!==null?null:T(W,K,""+te,ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return te.key===Ee?X(W,K,te,ce):null;case E:return te.key===Ee?ae(W,K,te,ce):null;case O:return te=Ka(te),ie(W,K,te,ce)}if(Z(te)||Q(te))return Ee!==null?null:oe(W,K,te,ce,null);if(typeof te.then=="function")return ie(W,K,vu(te),ce);if(te.$$typeof===_)return ie(W,K,mu(W,te),ce);bu(W,te)}return null}function ue(W,K,te,ce,Ee){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return W=W.get(te)||null,T(K,W,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return W=W.get(ce.key===null?te:ce.key)||null,X(K,W,ce,Ee);case E:return W=W.get(ce.key===null?te:ce.key)||null,ae(K,W,ce,Ee);case O:return ce=Ka(ce),ue(W,K,te,ce,Ee)}if(Z(ce)||Q(ce))return W=W.get(te)||null,oe(K,W,ce,Ee,null);if(typeof ce.then=="function")return ue(W,K,te,vu(ce),Ee);if(ce.$$typeof===_)return ue(W,K,te,mu(K,ce),Ee);bu(K,ce)}return null}function ye(W,K,te,ce){for(var Ee=null,je=null,ve=K,Ce=K=0,Re=null;ve!==null&&Ce<te.length;Ce++){ve.index>Ce?(Re=ve,ve=null):Re=ve.sibling;var Le=ie(W,ve,te[Ce],ce);if(Le===null){ve===null&&(ve=Re);break}e&&ve&&Le.alternate===null&&t(W,ve),K=m(Le,K,Ce),je===null?Ee=Le:je.sibling=Le,je=Le,ve=Re}if(Ce===te.length)return a(W,ve),Oe&&Ln(W,Ce),Ee;if(ve===null){for(;Ce<te.length;Ce++)ve=de(W,te[Ce],ce),ve!==null&&(K=m(ve,K,Ce),je===null?Ee=ve:je.sibling=ve,je=ve);return Oe&&Ln(W,Ce),Ee}for(ve=i(ve);Ce<te.length;Ce++)Re=ue(ve,W,Ce,te[Ce],ce),Re!==null&&(e&&Re.alternate!==null&&ve.delete(Re.key===null?Ce:Re.key),K=m(Re,K,Ce),je===null?Ee=Re:je.sibling=Re,je=Re);return e&&ve.forEach(function(Ma){return t(W,Ma)}),Oe&&Ln(W,Ce),Ee}function Se(W,K,te,ce){if(te==null)throw Error(u(151));for(var Ee=null,je=null,ve=K,Ce=K=0,Re=null,Le=te.next();ve!==null&&!Le.done;Ce++,Le=te.next()){ve.index>Ce?(Re=ve,ve=null):Re=ve.sibling;var Ma=ie(W,ve,Le.value,ce);if(Ma===null){ve===null&&(ve=Re);break}e&&ve&&Ma.alternate===null&&t(W,ve),K=m(Ma,K,Ce),je===null?Ee=Ma:je.sibling=Ma,je=Ma,ve=Re}if(Le.done)return a(W,ve),Oe&&Ln(W,Ce),Ee;if(ve===null){for(;!Le.done;Ce++,Le=te.next())Le=de(W,Le.value,ce),Le!==null&&(K=m(Le,K,Ce),je===null?Ee=Le:je.sibling=Le,je=Le);return Oe&&Ln(W,Ce),Ee}for(ve=i(ve);!Le.done;Ce++,Le=te.next())Le=ue(ve,W,Ce,Le.value,ce),Le!==null&&(e&&Le.alternate!==null&&ve.delete(Le.key===null?Ce:Le.key),K=m(Le,K,Ce),je===null?Ee=Le:je.sibling=Le,je=Le);return e&&ve.forEach(function(lS){return t(W,lS)}),Oe&&Ln(W,Ce),Ee}function Ye(W,K,te,ce){if(typeof te=="object"&&te!==null&&te.type===N&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case b:e:{for(var Ee=te.key;K!==null;){if(K.key===Ee){if(Ee=te.type,Ee===N){if(K.tag===7){a(W,K.sibling),ce=f(K,te.props.children),ce.return=W,W=ce;break e}}else if(K.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Ka(Ee)===K.type){a(W,K.sibling),ce=f(K,te.props),qi(ce,te),ce.return=W,W=ce;break e}a(W,K);break}else t(W,K);K=K.sibling}te.type===N?(ce=Ga(te.props.children,W.mode,ce,te.key),ce.return=W,W=ce):(ce=fu(te.type,te.key,te.props,null,W.mode,ce),qi(ce,te),ce.return=W,W=ce)}return x(W);case E:e:{for(Ee=te.key;K!==null;){if(K.key===Ee)if(K.tag===4&&K.stateNode.containerInfo===te.containerInfo&&K.stateNode.implementation===te.implementation){a(W,K.sibling),ce=f(K,te.children||[]),ce.return=W,W=ce;break e}else{a(W,K);break}else t(W,K);K=K.sibling}ce=Bs(te,W.mode,ce),ce.return=W,W=ce}return x(W);case O:return te=Ka(te),Ye(W,K,te,ce)}if(Z(te))return ye(W,K,te,ce);if(Q(te)){if(Ee=Q(te),typeof Ee!="function")throw Error(u(150));return te=Ee.call(te),Se(W,K,te,ce)}if(typeof te.then=="function")return Ye(W,K,vu(te),ce);if(te.$$typeof===_)return Ye(W,K,mu(W,te),ce);bu(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,K!==null&&K.tag===6?(a(W,K.sibling),ce=f(K,te),ce.return=W,W=ce):(a(W,K),ce=Hs(te,W.mode,ce),ce.return=W,W=ce),x(W)):a(W,K)}return function(W,K,te,ce){try{Ui=0;var Ee=Ye(W,K,te,ce);return Bl=null,Ee}catch(ve){if(ve===Hl||ve===pu)throw ve;var je=Lt(29,ve,null,W.mode);return je.lanes=ce,je.return=W,je}finally{}}}var Ja=Nm(!0),Cm=Nm(!1),ca=!1;function Is(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Js(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function da(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(He&2)!==0){var f=i.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),i.pending=t,t=cu(e),sm(e,null,a),t}return su(e,i,t,a),cu(e)}function ki(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Gr(e,a)}}function Fs(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?f=m=t:m=m.next=t}else f=m=t;a={baseState:i.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ws=!1;function Yi(){if(Ws){var e=Ll;if(e!==null)throw e}}function Vi(e,t,a,i){Ws=!1;var f=e.updateQueue;ca=!1;var m=f.firstBaseUpdate,x=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var X=T,ae=X.next;X.next=null,x===null?m=ae:x.next=ae,x=X;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,T=oe.lastBaseUpdate,T!==x&&(T===null?oe.firstBaseUpdate=ae:T.next=ae,oe.lastBaseUpdate=X))}if(m!==null){var de=f.baseState;x=0,oe=ae=X=null,T=m;do{var ie=T.lane&-536870913,ue=ie!==T.lane;if(ue?(Ae&ie)===ie:(i&ie)===ie){ie!==0&&ie===jl&&(Ws=!0),oe!==null&&(oe=oe.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=e,Se=T;ie=t;var Ye=a;switch(Se.tag){case 1:if(ye=Se.payload,typeof ye=="function"){de=ye.call(Ye,de,ie);break e}de=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Se.payload,ie=typeof ye=="function"?ye.call(Ye,de,ie):ye,ie==null)break e;de=y({},de,ie);break e;case 2:ca=!0}}ie=T.callback,ie!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=f.callbacks,ue===null?f.callbacks=[ie]:ue.push(ie))}else ue={lane:ie,tag:T.tag,payload:T.payload,callback:T.callback,next:null},oe===null?(ae=oe=ue,X=de):oe=oe.next=ue,x|=ie;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;ue=T,T=ue.next,ue.next=null,f.lastBaseUpdate=ue,f.shared.pending=null}}while(!0);oe===null&&(X=de),f.baseState=X,f.firstBaseUpdate=ae,f.lastBaseUpdate=oe,m===null&&(f.shared.lanes=0),ya|=x,e.lanes=x,e.memoizedState=de}}function Mm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Tm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Mm(a[e],t)}var Ul=z(null),xu=z(0);function Am(e,t){e=Qn,q(xu,e),q(Ul,t),Qn=e|t.baseLanes}function Ps(){q(xu,Qn),q(Ul,Ul.current)}function ec(){Qn=xu.current,V(Ul),V(xu)}var Ht=z(null),Pt=null;function ha(e){var t=e.alternate;q(We,We.current&1),q(Ht,e),Pt===null&&(t===null||Ul.current!==null||t.memoizedState!==null)&&(Pt=e)}function tc(e){q(We,We.current),q(Ht,e),Pt===null&&(Pt=e)}function Rm(e){e.tag===22?(q(We,We.current),q(Ht,e),Pt===null&&(Pt=e)):ma()}function ma(){q(We,We.current),q(Ht,Ht.current)}function Bt(e){V(Ht),Pt===e&&(Pt=null),V(We)}var We=z(0);function Eu(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||of(a)||sf(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Un=0,Ne=null,qe=null,nt=null,Su=!1,ql=!1,Fa=!1,wu=0,Gi=0,kl=null,Kx=0;function Ie(){throw Error(u(321))}function nc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!jt(e[a],t[a]))return!1;return!0}function ac(e,t,a,i,f,m){return Un=m,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?hg:vc,Fa=!1,m=a(i,f),Fa=!1,ql&&(m=Om(t,a,i,f)),zm(e),m}function zm(e){D.H=Qi;var t=qe!==null&&qe.next!==null;if(Un=0,nt=qe=Ne=null,Su=!1,Gi=0,kl=null,t)throw Error(u(300));e===null||at||(e=e.dependencies,e!==null&&hu(e)&&(at=!0))}function Om(e,t,a,i){Ne=e;var f=0;do{if(ql&&(kl=null),Gi=0,ql=!1,25<=f)throw Error(u(301));if(f+=1,nt=qe=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}D.H=mg,m=t(a,i)}while(ql);return m}function Ix(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?Xi(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(Ne.flags|=1024),t}function lc(){var e=wu!==0;return wu=0,e}function ic(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function rc(e){if(Su){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Su=!1}Un=0,nt=qe=Ne=null,ql=!1,Gi=wu=0,kl=null}function xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ne.memoizedState=nt=e:nt=nt.next=e,nt}function Pe(){if(qe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=nt===null?Ne.memoizedState:nt.next;if(t!==null)nt=t,qe=e;else{if(e===null)throw Ne.alternate===null?Error(u(467)):Error(u(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},nt===null?Ne.memoizedState=nt=e:nt=nt.next=e}return nt}function _u(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xi(e){var t=Gi;return Gi+=1,kl===null&&(kl=[]),e=Sm(kl,e,t),t=Ne,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?hg:vc),e}function Nu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xi(e);if(e.$$typeof===_)return dt(e)}throw Error(u(438,String(e)))}function uc(e){var t=null,a=Ne.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=Ne.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=_u(),Ne.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=$;return t.index++,a}function qn(e,t){return typeof t=="function"?t(e):t}function Cu(e){var t=Pe();return oc(t,qe,e)}function oc(e,t,a){var i=e.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var f=e.baseQueue,m=i.pending;if(m!==null){if(f!==null){var x=f.next;f.next=m.next,m.next=x}t.baseQueue=f=m,i.pending=null}if(m=e.baseState,f===null)e.memoizedState=m;else{t=f.next;var T=x=null,X=null,ae=t,oe=!1;do{var de=ae.lane&-536870913;if(de!==ae.lane?(Ae&de)===de:(Un&de)===de){var ie=ae.revertLane;if(ie===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),de===jl&&(oe=!0);else if((Un&ie)===ie){ae=ae.next,ie===jl&&(oe=!0);continue}else de={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(T=X=de,x=m):X=X.next=de,Ne.lanes|=ie,ya|=ie;de=ae.action,Fa&&a(m,de),m=ae.hasEagerState?ae.eagerState:a(m,de)}else ie={lane:de,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(T=X=ie,x=m):X=X.next=ie,Ne.lanes|=de,ya|=de;ae=ae.next}while(ae!==null&&ae!==t);if(X===null?x=m:X.next=T,!jt(m,e.memoizedState)&&(at=!0,oe&&(a=Ll,a!==null)))throw a;e.memoizedState=m,e.baseState=x,e.baseQueue=X,i.lastRenderedState=m}return f===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function sc(e){var t=Pe(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var i=a.dispatch,f=a.pending,m=t.memoizedState;if(f!==null){a.pending=null;var x=f=f.next;do m=e(m,x.action),x=x.next;while(x!==f);jt(m,t.memoizedState)||(at=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),a.lastRenderedState=m}return[m,i]}function Dm(e,t,a){var i=Ne,f=Pe(),m=Oe;if(m){if(a===void 0)throw Error(u(407));a=a()}else a=t();var x=!jt((qe||f).memoizedState,a);if(x&&(f.memoizedState=a,at=!0),f=f.queue,dc(Hm.bind(null,i,f,e),[e]),f.getSnapshot!==t||x||nt!==null&&nt.memoizedState.tag&1){if(i.flags|=2048,Yl(9,{destroy:void 0},Lm.bind(null,i,f,a,t),null),Ve===null)throw Error(u(349));m||(Un&127)!==0||jm(i,t,a)}return a}function jm(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ne.updateQueue,t===null?(t=_u(),Ne.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Lm(e,t,a,i){t.value=a,t.getSnapshot=i,Bm(t)&&Um(e)}function Hm(e,t,a){return a(function(){Bm(t)&&Um(e)})}function Bm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!jt(e,a)}catch{return!0}}function Um(e){var t=Va(e,2);t!==null&&Rt(t,e,2)}function cc(e){var t=xt();if(typeof e=="function"){var a=e;if(e=a(),Fa){vn(!0);try{a()}finally{vn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:e},t}function qm(e,t,a,i){return e.baseState=a,oc(e,qe,typeof i=="function"?i:qn)}function Jx(e,t,a,i,f){if(Au(e))throw Error(u(485));if(e=t.action,e!==null){var m={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){m.listeners.push(x)}};D.T!==null?a(!0):m.isTransition=!1,i(m),a=t.pending,a===null?(m.next=t.pending=m,km(t,m)):(m.next=a.next,t.pending=a.next=m)}}function km(e,t){var a=t.action,i=t.payload,f=e.state;if(t.isTransition){var m=D.T,x={};D.T=x;try{var T=a(f,i),X=D.S;X!==null&&X(x,T),Ym(e,t,T)}catch(ae){fc(e,t,ae)}finally{m!==null&&x.types!==null&&(m.types=x.types),D.T=m}}else try{m=a(f,i),Ym(e,t,m)}catch(ae){fc(e,t,ae)}}function Ym(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){Vm(e,t,i)},function(i){return fc(e,t,i)}):Vm(e,t,a)}function Vm(e,t,a){t.status="fulfilled",t.value=a,Gm(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,km(e,a)))}function fc(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,Gm(t),t=t.next;while(t!==i)}e.action=null}function Gm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xm(e,t){return t}function $m(e,t){if(Oe){var a=Ve.formState;if(a!==null){e:{var i=Ne;if(Oe){if(Ge){t:{for(var f=Ge,m=Wt;f.nodeType!==8;){if(!m){f=null;break t}if(f=en(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Ge=en(f.nextSibling),i=f.data==="F!";break e}}oa(i)}i=!1}i&&(t=a[0])}}return a=xt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xm,lastRenderedState:t},a.queue=i,a=cg.bind(null,Ne,i),i.dispatch=a,i=cc(!1),m=yc.bind(null,Ne,!1,i.queue),i=xt(),f={state:t,dispatch:null,action:e,pending:null},i.queue=f,a=Jx.bind(null,Ne,f,m,a),f.dispatch=a,i.memoizedState=e,[t,a,!1]}function Qm(e){var t=Pe();return Zm(t,qe,e)}function Zm(e,t,a){if(t=oc(e,t,Xm)[0],e=Cu(qn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Xi(t)}catch(x){throw x===Hl?pu:x}else i=t;t=Pe();var f=t.queue,m=f.dispatch;return a!==t.memoizedState&&(Ne.flags|=2048,Yl(9,{destroy:void 0},Fx.bind(null,f,a),null)),[i,m,e]}function Fx(e,t){e.action=t}function Km(e){var t=Pe(),a=qe;if(a!==null)return Zm(t,a,e);Pe(),t=t.memoizedState,a=Pe();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function Yl(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=_u(),Ne.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function Im(){return Pe().memoizedState}function Mu(e,t,a,i){var f=xt();Ne.flags|=e,f.memoizedState=Yl(1|t,{destroy:void 0},a,i===void 0?null:i)}function Tu(e,t,a,i){var f=Pe();i=i===void 0?null:i;var m=f.memoizedState.inst;qe!==null&&i!==null&&nc(i,qe.memoizedState.deps)?f.memoizedState=Yl(t,m,a,i):(Ne.flags|=e,f.memoizedState=Yl(1|t,m,a,i))}function Jm(e,t){Mu(8390656,8,e,t)}function dc(e,t){Tu(2048,8,e,t)}function Wx(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=_u(),Ne.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Fm(e){var t=Pe().memoizedState;return Wx({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Wm(e,t){return Tu(4,2,e,t)}function Pm(e,t){return Tu(4,4,e,t)}function eg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tg(e,t,a){a=a!=null?a.concat([e]):null,Tu(4,4,eg.bind(null,t,e),a)}function hc(){}function ng(e,t){var a=Pe();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&nc(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function ag(e,t){var a=Pe();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&nc(t,i[1]))return i[0];if(i=e(),Fa){vn(!0);try{e()}finally{vn(!1)}}return a.memoizedState=[i,t],i}function mc(e,t,a){return a===void 0||(Un&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=lp(),Ne.lanes|=e,ya|=e,a)}function lg(e,t,a,i){return jt(a,t)?a:Ul.current!==null?(e=mc(e,a,i),jt(e,t)||(at=!0),e):(Un&42)===0||(Un&1073741824)!==0&&(Ae&261930)===0?(at=!0,e.memoizedState=a):(e=lp(),Ne.lanes|=e,ya|=e,t)}function ig(e,t,a,i,f){var m=Y.p;Y.p=m!==0&&8>m?m:8;var x=D.T,T={};D.T=T,yc(e,!1,t,a);try{var X=f(),ae=D.S;if(ae!==null&&ae(T,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var oe=Zx(X,i);$i(e,t,oe,kt(e))}else $i(e,t,i,kt(e))}catch(de){$i(e,t,{then:function(){},status:"rejected",reason:de},kt())}finally{Y.p=m,x!==null&&T.types!==null&&(x.types=T.types),D.T=x}}function Px(){}function gc(e,t,a,i){if(e.tag!==5)throw Error(u(476));var f=rg(e).queue;ig(e,f,t,F,a===null?Px:function(){return ug(e),a(i)})}function rg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:F},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ug(e){var t=rg(e);t.next===null&&(t=e.alternate.memoizedState),$i(e,t.next.queue,{},kt())}function pc(){return dt(or)}function og(){return Pe().memoizedState}function sg(){return Pe().memoizedState}function eE(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=kt();e=fa(a);var i=da(t,e,a);i!==null&&(Rt(i,t,a),ki(i,t,a)),t={cache:$s()},e.payload=t;return}t=t.return}}function tE(e,t,a){var i=kt();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Au(e)?fg(t,a):(a=js(e,t,a,i),a!==null&&(Rt(a,e,i),dg(a,t,i)))}function cg(e,t,a){var i=kt();$i(e,t,a,i)}function $i(e,t,a,i){var f={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Au(e))fg(t,f);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var x=t.lastRenderedState,T=m(x,a);if(f.hasEagerState=!0,f.eagerState=T,jt(T,x))return su(e,t,f,0),Ve===null&&ou(),!1}catch{}finally{}if(a=js(e,t,f,i),a!==null)return Rt(a,e,i),dg(a,t,i),!0}return!1}function yc(e,t,a,i){if(i={lane:2,revertLane:Ic(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Au(e)){if(t)throw Error(u(479))}else t=js(e,a,i,2),t!==null&&Rt(t,e,2)}function Au(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function fg(e,t){ql=Su=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function dg(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Gr(e,a)}}var Qi={readContext:dt,use:Nu,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Qi.useEffectEvent=Ie;var hg={readContext:dt,use:Nu,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Jm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Mu(4194308,4,eg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Mu(4194308,4,e,t)},useInsertionEffect:function(e,t){Mu(4,2,e,t)},useMemo:function(e,t){var a=xt();t=t===void 0?null:t;var i=e();if(Fa){vn(!0);try{e()}finally{vn(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=xt();if(a!==void 0){var f=a(t);if(Fa){vn(!0);try{a(t)}finally{vn(!1)}}}else f=t;return i.memoizedState=i.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},i.queue=e,e=e.dispatch=tE.bind(null,Ne,e),[i.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:function(e){e=cc(e);var t=e.queue,a=cg.bind(null,Ne,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:hc,useDeferredValue:function(e,t){var a=xt();return mc(a,e,t)},useTransition:function(){var e=cc(!1);return e=ig.bind(null,Ne,e.queue,!0,!1),xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=Ne,f=xt();if(Oe){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Ve===null)throw Error(u(349));(Ae&127)!==0||jm(i,t,a)}f.memoizedState=a;var m={value:a,getSnapshot:t};return f.queue=m,Jm(Hm.bind(null,i,m,e),[e]),i.flags|=2048,Yl(9,{destroy:void 0},Lm.bind(null,i,m,a,t),null),a},useId:function(){var e=xt(),t=Ve.identifierPrefix;if(Oe){var a=En,i=xn;a=(i&~(1<<32-bt(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=wu++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Kx++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:pc,useFormState:$m,useActionState:$m,useOptimistic:function(e){var t=xt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=yc.bind(null,Ne,!0,a),a.dispatch=t,[e,t]},useMemoCache:uc,useCacheRefresh:function(){return xt().memoizedState=eE.bind(null,Ne)},useEffectEvent:function(e){var t=xt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},vc={readContext:dt,use:Nu,useCallback:ng,useContext:dt,useEffect:dc,useImperativeHandle:tg,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:ag,useReducer:Cu,useRef:Im,useState:function(){return Cu(qn)},useDebugValue:hc,useDeferredValue:function(e,t){var a=Pe();return lg(a,qe.memoizedState,e,t)},useTransition:function(){var e=Cu(qn)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Xi(e),t]},useSyncExternalStore:Dm,useId:og,useHostTransitionStatus:pc,useFormState:Qm,useActionState:Qm,useOptimistic:function(e,t){var a=Pe();return qm(a,qe,e,t)},useMemoCache:uc,useCacheRefresh:sg};vc.useEffectEvent=Fm;var mg={readContext:dt,use:Nu,useCallback:ng,useContext:dt,useEffect:dc,useImperativeHandle:tg,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:ag,useReducer:sc,useRef:Im,useState:function(){return sc(qn)},useDebugValue:hc,useDeferredValue:function(e,t){var a=Pe();return qe===null?mc(a,e,t):lg(a,qe.memoizedState,e,t)},useTransition:function(){var e=sc(qn)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Xi(e),t]},useSyncExternalStore:Dm,useId:og,useHostTransitionStatus:pc,useFormState:Km,useActionState:Km,useOptimistic:function(e,t){var a=Pe();return qe!==null?qm(a,qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:uc,useCacheRefresh:sg};mg.useEffectEvent=Fm;function bc(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var xc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=kt(),f=fa(i);f.payload=t,a!=null&&(f.callback=a),t=da(e,f,i),t!==null&&(Rt(t,e,i),ki(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=kt(),f=fa(i);f.tag=1,f.payload=t,a!=null&&(f.callback=a),t=da(e,f,i),t!==null&&(Rt(t,e,i),ki(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=kt(),i=fa(a);i.tag=2,t!=null&&(i.callback=t),t=da(e,i,a),t!==null&&(Rt(t,e,a),ki(t,e,a))}};function gg(e,t,a,i,f,m,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,x):t.prototype&&t.prototype.isPureReactComponent?!Oi(a,i)||!Oi(f,m):!0}function pg(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function Wa(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function yg(e){uu(e)}function vg(e){console.error(e)}function bg(e){uu(e)}function Ru(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function xg(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ec(e,t,a){return a=fa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ru(e,t)},a}function Eg(e){return e=fa(e),e.tag=3,e}function Sg(e,t,a,i){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=i.value;e.payload=function(){return f(m)},e.callback=function(){xg(t,a,i)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){xg(t,a,i),typeof f!="function"&&(va===null?va=new Set([this]):va.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function nE(e,t,a,i,f){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&Dl(t,a,f,!0),a=Ht.current,a!==null){switch(a.tag){case 31:case 13:return Pt===null?Vu():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=f,i===yu?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),Qc(e,i,f)),!1;case 22:return a.flags|=65536,i===yu?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),Qc(e,i,f)),!1}throw Error(u(435,a.tag))}return Qc(e,i,f),Vu(),!1}if(Oe)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,i!==ks&&(e=Error(u(422),{cause:i}),Li(It(e,a)))):(i!==ks&&(t=Error(u(423),{cause:i}),Li(It(t,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,i=It(i,a),f=Ec(e.stateNode,i,f),Fs(e,f),Je!==4&&(Je=2)),!1;var m=Error(u(520),{cause:i});if(m=It(m,a),er===null?er=[m]:er.push(m),Je!==4&&(Je=2),t===null)return!0;i=It(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=Ec(a.stateNode,i,e),Fs(a,e),!1;case 1:if(t=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(va===null||!va.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Eg(f),Sg(f,e,a,i),Fs(a,f),!1}a=a.return}while(a!==null);return!1}var Sc=Error(u(461)),at=!1;function ht(e,t,a,i){t.child=e===null?Cm(t,null,a,i):Ja(t,e.child,a,i)}function wg(e,t,a,i,f){a=a.render;var m=t.ref;if("ref"in i){var x={};for(var T in i)T!=="ref"&&(x[T]=i[T])}else x=i;return Qa(t),i=ac(e,t,a,x,m,f),T=lc(),e!==null&&!at?(ic(e,t,f),kn(e,t,f)):(Oe&&T&&Us(t),t.flags|=1,ht(e,t,i,f),t.child)}function _g(e,t,a,i,f){if(e===null){var m=a.type;return typeof m=="function"&&!Ls(m)&&m.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=m,Ng(e,t,m,i,f)):(e=fu(a.type,null,i,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Rc(e,f)){var x=m.memoizedProps;if(a=a.compare,a=a!==null?a:Oi,a(x,i)&&e.ref===t.ref)return kn(e,t,f)}return t.flags|=1,e=jn(m,i),e.ref=t.ref,e.return=t,t.child=e}function Ng(e,t,a,i,f){if(e!==null){var m=e.memoizedProps;if(Oi(m,i)&&e.ref===t.ref)if(at=!1,t.pendingProps=i=m,Rc(e,f))(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,kn(e,t,f)}return wc(e,t,a,i,f)}function Cg(e,t,a,i){var f=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|a:a,e!==null){for(i=t.child=e.child,f=0;i!==null;)f=f|i.lanes|i.childLanes,i=i.sibling;i=f&~m}else i=0,t.child=null;return Mg(e,t,m,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gu(t,m!==null?m.cachePool:null),m!==null?Am(t,m):Ps(),Rm(t);else return i=t.lanes=536870912,Mg(e,t,m!==null?m.baseLanes|a:a,a,i)}else m!==null?(gu(t,m.cachePool),Am(t,m),ma(),t.memoizedState=null):(e!==null&&gu(t,null),Ps(),ma());return ht(e,t,f,a),t.child}function Zi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mg(e,t,a,i,f){var m=Zs();return m=m===null?null:{parent:tt._currentValue,pool:m},t.memoizedState={baseLanes:a,cachePool:m},e!==null&&gu(t,null),Ps(),Rm(t),e!==null&&Dl(e,t,i,!0),t.childLanes=f,null}function zu(e,t){return t=Du({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tg(e,t,a){return Ja(t,e.child,null,a),e=zu(t,t.pendingProps),e.flags|=2,Bt(t),t.memoizedState=null,e}function aE(e,t,a){var i=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(i.mode==="hidden")return e=zu(t,i),t.lanes=536870912,Zi(null,e);if(tc(t),(e=Ge)?(e=kp(e,Wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:xn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=fm(e),a.return=t,t.child=a,ft=t,Ge=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return zu(t,i)}var m=e.memoizedState;if(m!==null){var x=m.dehydrated;if(tc(t),f)if(t.flags&256)t.flags&=-257,t=Tg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(at||Dl(e,t,a,!1),f=(a&e.childLanes)!==0,at||f){if(i=Ve,i!==null&&(x=Xr(i,a),x!==0&&x!==m.retryLane))throw m.retryLane=x,Va(e,x),Rt(i,e,x),Sc;Vu(),t=Tg(e,t,a)}else e=m.treeContext,Ge=en(x.nextSibling),ft=t,Oe=!0,ua=null,Wt=!1,e!==null&&mm(t,e),t=zu(t,i),t.flags|=4096;return t}return e=jn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ou(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function wc(e,t,a,i,f){return Qa(t),a=ac(e,t,a,i,void 0,f),i=lc(),e!==null&&!at?(ic(e,t,f),kn(e,t,f)):(Oe&&i&&Us(t),t.flags|=1,ht(e,t,a,f),t.child)}function Ag(e,t,a,i,f,m){return Qa(t),t.updateQueue=null,a=Om(t,i,a,f),zm(e),i=lc(),e!==null&&!at?(ic(e,t,m),kn(e,t,m)):(Oe&&i&&Us(t),t.flags|=1,ht(e,t,a,m),t.child)}function Rg(e,t,a,i,f){if(Qa(t),t.stateNode===null){var m=Al,x=a.contextType;typeof x=="object"&&x!==null&&(m=dt(x)),m=new a(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=xc,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},Is(t),x=a.contextType,m.context=typeof x=="object"&&x!==null?dt(x):Al,m.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(bc(t,a,x,i),m.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(x=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),x!==m.state&&xc.enqueueReplaceState(m,m.state,null),Vi(t,i,m,f),Yi(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,X=Wa(a,T);m.props=X;var ae=m.context,oe=a.contextType;x=Al,typeof oe=="object"&&oe!==null&&(x=dt(oe));var de=a.getDerivedStateFromProps;oe=typeof de=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||ae!==x)&&pg(t,m,i,x),ca=!1;var ie=t.memoizedState;m.state=ie,Vi(t,i,m,f),Yi(),ae=t.memoizedState,T||ie!==ae||ca?(typeof de=="function"&&(bc(t,a,de,i),ae=t.memoizedState),(X=ca||gg(t,a,X,i,ie,ae,x))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=ae),m.props=i,m.state=ae,m.context=x,i=X):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,Js(e,t),x=t.memoizedProps,oe=Wa(a,x),m.props=oe,de=t.pendingProps,ie=m.context,ae=a.contextType,X=Al,typeof ae=="object"&&ae!==null&&(X=dt(ae)),T=a.getDerivedStateFromProps,(ae=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(x!==de||ie!==X)&&pg(t,m,i,X),ca=!1,ie=t.memoizedState,m.state=ie,Vi(t,i,m,f),Yi();var ue=t.memoizedState;x!==de||ie!==ue||ca||e!==null&&e.dependencies!==null&&hu(e.dependencies)?(typeof T=="function"&&(bc(t,a,T,i),ue=t.memoizedState),(oe=ca||gg(t,a,oe,i,ie,ue,X)||e!==null&&e.dependencies!==null&&hu(e.dependencies))?(ae||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,ue,X),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,ue,X)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||x===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ue),m.props=i,m.state=ue,m.context=X,i=oe):(typeof m.componentDidUpdate!="function"||x===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,Ou(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Ja(t,e.child,null,f),t.child=Ja(t,null,a,f)):ht(e,t,a,f),t.memoizedState=m.state,e=t.child):e=kn(e,t,f),e}function zg(e,t,a,i){return Xa(),t.flags|=256,ht(e,t,a,i),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:xm()}}function Cc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=qt),e}function Og(e,t,a){var i=t.pendingProps,f=!1,m=(t.flags&128)!==0,x;if((x=m)||(x=e!==null&&e.memoizedState===null?!1:(We.current&2)!==0),x&&(f=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(f?ha(t):ma(),(e=Ge)?(e=kp(e,Wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:xn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=fm(e),a.return=t,t.child=a,ft=t,Ge=null)):e=null,e===null)throw oa(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,f?(ma(),f=t.mode,T=Du({mode:"hidden",children:T},f),i=Ga(i,f,a,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=Nc(a),i.childLanes=Cc(e,x,a),t.memoizedState=_c,Zi(null,i)):(ha(t),Mc(t,T))}var X=e.memoizedState;if(X!==null&&(T=X.dehydrated,T!==null)){if(m)t.flags&256?(ha(t),t.flags&=-257,t=Tc(e,t,a)):t.memoizedState!==null?(ma(),t.child=e.child,t.flags|=128,t=null):(ma(),T=i.fallback,f=t.mode,i=Du({mode:"visible",children:i.children},f),T=Ga(T,f,a,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,Ja(t,e.child,null,a),i=t.child,i.memoizedState=Nc(a),i.childLanes=Cc(e,x,a),t.memoizedState=_c,t=Zi(null,i));else if(ha(t),sf(T)){if(x=T.nextSibling&&T.nextSibling.dataset,x)var ae=x.dgst;x=ae,i=Error(u(419)),i.stack="",i.digest=x,Li({value:i,source:null,stack:null}),t=Tc(e,t,a)}else if(at||Dl(e,t,a,!1),x=(a&e.childLanes)!==0,at||x){if(x=Ve,x!==null&&(i=Xr(x,a),i!==0&&i!==X.retryLane))throw X.retryLane=i,Va(e,i),Rt(x,e,i),Sc;of(T)||Vu(),t=Tc(e,t,a)}else of(T)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,Ge=en(T.nextSibling),ft=t,Oe=!0,ua=null,Wt=!1,e!==null&&mm(t,e),t=Mc(t,i.children),t.flags|=4096);return t}return f?(ma(),T=i.fallback,f=t.mode,X=e.child,ae=X.sibling,i=jn(X,{mode:"hidden",children:i.children}),i.subtreeFlags=X.subtreeFlags&65011712,ae!==null?T=jn(ae,T):(T=Ga(T,f,a,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Zi(null,i),i=t.child,T=e.child.memoizedState,T===null?T=Nc(a):(f=T.cachePool,f!==null?(X=tt._currentValue,f=f.parent!==X?{parent:X,pool:X}:f):f=xm(),T={baseLanes:T.baseLanes|a,cachePool:f}),i.memoizedState=T,i.childLanes=Cc(e,x,a),t.memoizedState=_c,Zi(e.child,i)):(ha(t),a=e.child,e=a.sibling,a=jn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Mc(e,t){return t=Du({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Du(e,t){return e=Lt(22,e,null,t),e.lanes=0,e}function Tc(e,t,a){return Ja(t,e.child,null,a),e=Mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dg(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Gs(e.return,t,a)}function Ac(e,t,a,i,f,m){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:f,treeForkCount:m}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=a,x.tailMode=f,x.treeForkCount=m)}function jg(e,t,a){var i=t.pendingProps,f=i.revealOrder,m=i.tail;i=i.children;var x=We.current,T=(x&2)!==0;if(T?(x=x&1|2,t.flags|=128):x&=1,q(We,x),ht(e,t,i,a),i=Oe?ji:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dg(e,a,t);else if(e.tag===19)Dg(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(a=t.child,f=null;a!==null;)e=a.alternate,e!==null&&Eu(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=t.child,t.child=null):(f=a.sibling,a.sibling=null),Ac(t,!1,f,a,m,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&Eu(e)===null){t.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}Ac(t,!0,a,null,m,i);break;case"together":Ac(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function kn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ya|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Dl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=jn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=jn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Rc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&hu(e)))}function lE(e,t,a){switch(t.tag){case 3:ee(t,t.stateNode.containerInfo),sa(t,tt,e.memoizedState.cache),Xa();break;case 27:case 5:ge(t);break;case 4:ee(t,t.stateNode.containerInfo);break;case 10:sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ha(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Og(e,t,a):(ha(t),e=kn(e,t,a),e!==null?e.sibling:null);ha(t);break;case 19:var f=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(Dl(e,t,a,!1),i=(a&t.childLanes)!==0),f){if(i)return jg(e,t,a);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),q(We,We.current),i)break;return null;case 22:return t.lanes=0,Cg(e,t,a,t.pendingProps);case 24:sa(t,tt,e.memoizedState.cache)}return kn(e,t,a)}function Lg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)at=!0;else{if(!Rc(e,a)&&(t.flags&128)===0)return at=!1,lE(e,t,a);at=(e.flags&131072)!==0}else at=!1,Oe&&(t.flags&1048576)!==0&&hm(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e=="function")Ls(e)?(i=Wa(e,i),t.tag=1,t=Rg(null,t,e,i,a)):(t.tag=0,t=wc(null,t,e,i,a));else{if(e!=null){var f=e.$$typeof;if(f===M){t.tag=11,t=wg(null,t,e,i,a);break e}else if(f===U){t.tag=14,t=_g(null,t,e,i,a);break e}}throw t=R(e)||e,Error(u(306,t,""))}}return t;case 0:return wc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,f=Wa(i,t.pendingProps),Rg(e,t,i,f,a);case 3:e:{if(ee(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var m=t.memoizedState;f=m.element,Js(e,t),Vi(t,i,null,a);var x=t.memoizedState;if(i=x.cache,sa(t,tt,i),i!==m.cache&&Xs(t,[tt],a,!0),Yi(),i=x.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=zg(e,t,i,a);break e}else if(i!==f){f=It(Error(u(424)),t),Li(f),t=zg(e,t,i,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ge=en(e.firstChild),ft=t,Oe=!0,ua=null,Wt=!0,a=Cm(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Xa(),i===f){t=kn(e,t,a);break e}ht(e,t,i,a)}t=t.child}return t;case 26:return Ou(e,t),e===null?(a=Qp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Oe||(a=t.type,e=t.pendingProps,i=Iu(re.current).createElement(a),i[ot]=t,i[gt]=e,mt(i,a,e),et(i),t.stateNode=i):t.memoizedState=Qp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&Oe&&(i=t.stateNode=Gp(t.type,t.pendingProps,re.current),ft=t,Wt=!0,f=Ge,Sa(t.type)?(cf=f,Ge=en(i.firstChild)):Ge=f),ht(e,t,t.pendingProps.children,a),Ou(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((f=i=Ge)&&(i=jE(i,t.type,t.pendingProps,Wt),i!==null?(t.stateNode=i,ft=t,Ge=en(i.firstChild),Wt=!1,f=!0):f=!1),f||oa(t)),ge(t),f=t.type,m=t.pendingProps,x=e!==null?e.memoizedProps:null,i=m.children,lf(f,m)?i=null:x!==null&&lf(f,x)&&(t.flags|=32),t.memoizedState!==null&&(f=ac(e,t,Ix,null,null,a),or._currentValue=f),Ou(e,t),ht(e,t,i,a),t.child;case 6:return e===null&&Oe&&((e=a=Ge)&&(a=LE(a,t.pendingProps,Wt),a!==null?(t.stateNode=a,ft=t,Ge=null,e=!0):e=!1),e||oa(t)),null;case 13:return Og(e,t,a);case 4:return ee(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ja(t,null,i,a):ht(e,t,i,a),t.child;case 11:return wg(e,t,t.type,t.pendingProps,a);case 7:return ht(e,t,t.pendingProps,a),t.child;case 8:return ht(e,t,t.pendingProps.children,a),t.child;case 12:return ht(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,sa(t,t.type,i.value),ht(e,t,i.children,a),t.child;case 9:return f=t.type._context,i=t.pendingProps.children,Qa(t),f=dt(f),i=i(f),t.flags|=1,ht(e,t,i,a),t.child;case 14:return _g(e,t,t.type,t.pendingProps,a);case 15:return Ng(e,t,t.type,t.pendingProps,a);case 19:return jg(e,t,a);case 31:return aE(e,t,a);case 22:return Cg(e,t,a,t.pendingProps);case 24:return Qa(t),i=dt(tt),e===null?(f=Zs(),f===null&&(f=Ve,m=$s(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),t.memoizedState={parent:i,cache:f},Is(t),sa(t,tt,f)):((e.lanes&a)!==0&&(Js(e,t),Vi(t,null,null,a),Yi()),f=e.memoizedState,m=t.memoizedState,f.parent!==i?(f={parent:i,cache:i},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),sa(t,tt,i)):(i=m.cache,sa(t,tt,i),i!==f.cache&&Xs(t,[tt],a,!0))),ht(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Yn(e){e.flags|=4}function zc(e,t,a,i,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(op())e.flags|=8192;else throw Ia=yu,Ks}else e.flags&=-16777217}function Hg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fp(t))if(op())e.flags|=8192;else throw Ia=yu,Ks}function ju(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yr():536870912,e.lanes|=t,$l|=t)}function Ki(e,t){if(!Oe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,i|=f.subtreeFlags&65011712,i|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,i|=f.subtreeFlags,i|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function iE(e,t,a){var i=t.pendingProps;switch(qs(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Bn(tt),fe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?Yn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ys())),Xe(t),null;case 26:var f=t.type,m=t.memoizedState;return e===null?(Yn(t),m!==null?(Xe(t),Hg(t,m)):(Xe(t),zc(t,f,null,i,a))):m?m!==e.memoizedState?(Yn(t),Xe(t),Hg(t,m)):(Xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Yn(t),Xe(t),zc(t,f,e,i,a)),null;case 27:if(be(t),a=re.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}e=G.current,Ol(t)?gm(t):(e=Gp(f,i,a),t.stateNode=e,Yn(t))}return Xe(t),null;case 5:if(be(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}if(m=G.current,Ol(t))gm(t);else{var x=Iu(re.current);switch(m){case 1:m=x.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=x.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=x.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?x.createElement("select",{is:i.is}):x.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?x.createElement(f,{is:i.is}):x.createElement(f)}}m[ot]=t,m[gt]=i;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)m.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=m;e:switch(mt(m,f,i),f){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Yn(t)}}return Xe(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Yn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=re.current,Ol(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,f=ft,f!==null)switch(f.tag){case 27:case 5:i=f.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||Op(e.nodeValue,a)),e||oa(t,!0)}else e=Iu(e).createTextNode(i),e[ot]=t,t.stateNode=e}return Xe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ol(t),a!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ot]=t}else Xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),e=!1}else a=Ys(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Bt(t),t):(Bt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Xe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Ol(t),i!==null&&i.dehydrated!==null){if(e===null){if(!f)throw Error(u(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(u(317));f[ot]=t}else Xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),f=!1}else f=Ys(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(Bt(t),t):(Bt(t),null)}return Bt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,f=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(f=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==f&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),ju(t,t.updateQueue),Xe(t),null);case 4:return fe(),e===null&&Pc(t.stateNode.containerInfo),Xe(t),null;case 10:return Bn(t.type),Xe(t),null;case 19:if(V(We),i=t.memoizedState,i===null)return Xe(t),null;if(f=(t.flags&128)!==0,m=i.rendering,m===null)if(f)Ki(i,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Eu(e),m!==null){for(t.flags|=128,Ki(i,!1),e=m.updateQueue,t.updateQueue=e,ju(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cm(a,e),a=a.sibling;return q(We,We.current&1|2),Oe&&Ln(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Fe()>qu&&(t.flags|=128,f=!0,Ki(i,!1),t.lanes=4194304)}else{if(!f)if(e=Eu(m),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,ju(t,e),Ki(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Oe)return Xe(t),null}else 2*Fe()-i.renderingStartTime>qu&&a!==536870912&&(t.flags|=128,f=!0,Ki(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Fe(),e.sibling=null,a=We.current,q(We,f?a&1|2:a&1),Oe&&Ln(t,i.treeForkCount),e):(Xe(t),null);case 22:case 23:return Bt(t),ec(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),a=t.updateQueue,a!==null&&ju(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&V(Za),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Bn(tt),Xe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function rE(e,t){switch(qs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bn(tt),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(Bt(t),t.alternate===null)throw Error(u(340));Xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(We),null;case 4:return fe(),null;case 10:return Bn(t.type),null;case 22:case 23:return Bt(t),ec(),e!==null&&V(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Bn(tt),null;case 25:return null;default:return null}}function Bg(e,t){switch(qs(t),t.tag){case 3:Bn(tt),fe();break;case 26:case 27:case 5:be(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Bt(t);break;case 13:Bt(t);break;case 19:V(We);break;case 10:Bn(t.type);break;case 22:case 23:Bt(t),ec(),e!==null&&V(Za);break;case 24:Bn(tt)}}function Ii(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var f=i.next;a=f;do{if((a.tag&e)===e){i=void 0;var m=a.create,x=a.inst;i=m(),x.destroy=i}a=a.next}while(a!==f)}}catch(T){Ue(t,t.return,T)}}function ga(e,t,a){try{var i=t.updateQueue,f=i!==null?i.lastEffect:null;if(f!==null){var m=f.next;i=m;do{if((i.tag&e)===e){var x=i.inst,T=x.destroy;if(T!==void 0){x.destroy=void 0,f=t;var X=a,ae=T;try{ae()}catch(oe){Ue(f,X,oe)}}}i=i.next}while(i!==m)}}catch(oe){Ue(t,t.return,oe)}}function Ug(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Tm(t,a)}catch(i){Ue(e,e.return,i)}}}function qg(e,t,a){a.props=Wa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Ue(e,t,i)}}function Ji(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(f){Ue(e,t,f)}}function Sn(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(f){Ue(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Ue(e,t,f)}else a.current=null}function kg(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(f){Ue(e,e.return,f)}}function Oc(e,t,a){try{var i=e.stateNode;TE(i,e.type,a,t),i[gt]=t}catch(f){Ue(e,e.return,f)}}function Yg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sa(e.type)||e.tag===4}function Dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=On));else if(i!==4&&(i===27&&Sa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(jc(e,t,a),e=e.sibling;e!==null;)jc(e,t,a),e=e.sibling}function Lu(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&Sa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lu(e,t,a),e=e.sibling;e!==null;)Lu(e,t,a),e=e.sibling}function Vg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);mt(t,i,a),t[ot]=e,t[gt]=a}catch(m){Ue(e,e.return,m)}}var Vn=!1,lt=!1,Lc=!1,Gg=typeof WeakSet=="function"?WeakSet:Set,ct=null;function uE(e,t){if(e=e.containerInfo,nf=no,e=tm(e),Ts(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var f=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,T=-1,X=-1,ae=0,oe=0,de=e,ie=null;t:for(;;){for(var ue;de!==a||f!==0&&de.nodeType!==3||(T=x+f),de!==m||i!==0&&de.nodeType!==3||(X=x+i),de.nodeType===3&&(x+=de.nodeValue.length),(ue=de.firstChild)!==null;)ie=de,de=ue;for(;;){if(de===e)break t;if(ie===a&&++ae===f&&(T=x),ie===m&&++oe===i&&(X=x),(ue=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=ue}a=T===-1||X===-1?null:{start:T,end:X}}else a=null}a=a||{start:0,end:0}}else a=null;for(af={focusedElem:e,selectionRange:a},no=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){switch(t=ct,m=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,a=t,f=m.memoizedProps,m=m.memoizedState,i=a.stateNode;try{var ye=Wa(a.type,f);e=i.getSnapshotBeforeUpdate(ye,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ue(a,a.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)uf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":uf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}}function Xg(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Xn(e,a),i&4&&Ii(5,a);break;case 1:if(Xn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){Ue(a,a.return,x)}else{var f=Wa(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Ue(a,a.return,x)}}i&64&&Ug(a),i&512&&Ji(a,a.return);break;case 3:if(Xn(e,a),i&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Tm(e,t)}catch(x){Ue(a,a.return,x)}}break;case 27:t===null&&i&4&&Vg(a);case 26:case 5:Xn(e,a),t===null&&i&4&&kg(a),i&512&&Ji(a,a.return);break;case 12:Xn(e,a);break;case 31:Xn(e,a),i&4&&Zg(e,a);break;case 13:Xn(e,a),i&4&&Kg(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=pE.bind(null,a),HE(e,a))));break;case 22:if(i=a.memoizedState!==null||Vn,!i){t=t!==null&&t.memoizedState!==null||lt,f=Vn;var m=lt;Vn=i,(lt=t)&&!m?$n(e,a,(a.subtreeFlags&8772)!==0):Xn(e,a),Vn=f,lt=m}break;case 30:break;default:Xn(e,a)}}function $g(e){var t=e.alternate;t!==null&&(e.alternate=null,$g(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Ct=!1;function Gn(e,t,a){for(a=a.child;a!==null;)Qg(e,t,a),a=a.sibling}function Qg(e,t,a){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(ja,a)}catch{}switch(a.tag){case 26:lt||Sn(a,t),Gn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:lt||Sn(a,t);var i=Qe,f=Ct;Sa(a.type)&&(Qe=a.stateNode,Ct=!1),Gn(e,t,a),ir(a.stateNode),Qe=i,Ct=f;break;case 5:lt||Sn(a,t);case 6:if(i=Qe,f=Ct,Qe=null,Gn(e,t,a),Qe=i,Ct=f,Qe!==null)if(Ct)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(m){Ue(a,t,m)}else try{Qe.removeChild(a.stateNode)}catch(m){Ue(a,t,m)}break;case 18:Qe!==null&&(Ct?(e=Qe,Up(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Pl(e)):Up(Qe,a.stateNode));break;case 4:i=Qe,f=Ct,Qe=a.stateNode.containerInfo,Ct=!0,Gn(e,t,a),Qe=i,Ct=f;break;case 0:case 11:case 14:case 15:ga(2,a,t),lt||ga(4,a,t),Gn(e,t,a);break;case 1:lt||(Sn(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&qg(a,t,i)),Gn(e,t,a);break;case 21:Gn(e,t,a);break;case 22:lt=(i=lt)||a.memoizedState!==null,Gn(e,t,a),lt=i;break;default:Gn(e,t,a)}}function Zg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pl(e)}catch(a){Ue(t,t.return,a)}}}function Kg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pl(e)}catch(a){Ue(t,t.return,a)}}function oE(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gg),t;default:throw Error(u(435,e.tag))}}function Hu(e,t){var a=oE(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var f=yE.bind(null,e,i);i.then(f,f)}})}function Mt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var f=a[i],m=e,x=t,T=x;e:for(;T!==null;){switch(T.tag){case 27:if(Sa(T.type)){Qe=T.stateNode,Ct=!1;break e}break;case 5:Qe=T.stateNode,Ct=!1;break e;case 3:case 4:Qe=T.stateNode.containerInfo,Ct=!0;break e}T=T.return}if(Qe===null)throw Error(u(160));Qg(m,x,f),Qe=null,Ct=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ig(t,e),t=t.sibling}var rn=null;function Ig(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Mt(t,e),Tt(e),i&4&&(ga(3,e,e.return),Ii(3,e),ga(5,e,e.return));break;case 1:Mt(t,e),Tt(e),i&512&&(lt||a===null||Sn(a,a.return)),i&64&&Vn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var f=rn;if(Mt(t,e),Tt(e),i&512&&(lt||a===null||Sn(a,a.return)),i&4){var m=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,f=f.ownerDocument||f;t:switch(i){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Ba]||m[ot]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(i),f.head.insertBefore(m,f.querySelector("head > title"))),mt(m,i,a),m[ot]=e,et(m),i=m;break e;case"link":var x=Ip("link","href",f).get(i+(a.href||""));if(x){for(var T=0;T<x.length;T++)if(m=x[T],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(T,1);break t}}m=f.createElement(i),mt(m,i,a),f.head.appendChild(m);break;case"meta":if(x=Ip("meta","content",f).get(i+(a.content||""))){for(T=0;T<x.length;T++)if(m=x[T],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(T,1);break t}}m=f.createElement(i),mt(m,i,a),f.head.appendChild(m);break;default:throw Error(u(468,i))}m[ot]=e,et(m),i=m}e.stateNode=i}else Jp(f,e.type,e.stateNode);else e.stateNode=Kp(f,i,e.memoizedProps);else m!==i?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,i===null?Jp(f,e.type,e.stateNode):Kp(f,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Oc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Mt(t,e),Tt(e),i&512&&(lt||a===null||Sn(a,a.return)),a!==null&&i&4&&Oc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Mt(t,e),Tt(e),i&512&&(lt||a===null||Sn(a,a.return)),e.flags&32){f=e.stateNode;try{Sl(f,"")}catch(ye){Ue(e,e.return,ye)}}i&4&&e.stateNode!=null&&(f=e.memoizedProps,Oc(e,f,a!==null?a.memoizedProps:f)),i&1024&&(Lc=!0);break;case 6:if(Mt(t,e),Tt(e),i&4){if(e.stateNode===null)throw Error(u(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(ye){Ue(e,e.return,ye)}}break;case 3:if(Wu=null,f=rn,rn=Ju(t.containerInfo),Mt(t,e),rn=f,Tt(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Pl(t.containerInfo)}catch(ye){Ue(e,e.return,ye)}Lc&&(Lc=!1,Jg(e));break;case 4:i=rn,rn=Ju(e.stateNode.containerInfo),Mt(t,e),Tt(e),rn=i;break;case 12:Mt(t,e),Tt(e);break;case 31:Mt(t,e),Tt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Hu(e,i)));break;case 13:Mt(t,e),Tt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Uu=Fe()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Hu(e,i)));break;case 22:f=e.memoizedState!==null;var X=a!==null&&a.memoizedState!==null,ae=Vn,oe=lt;if(Vn=ae||f,lt=oe||X,Mt(t,e),lt=oe,Vn=ae,Tt(e),i&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(a===null||X||Vn||lt||Pa(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){X=a=t;try{if(m=X.stateNode,f)x=m.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{T=X.stateNode;var de=X.memoizedProps.style,ie=de!=null&&de.hasOwnProperty("display")?de.display:null;T.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ye){Ue(X,X.return,ye)}}}else if(t.tag===6){if(a===null){X=t;try{X.stateNode.nodeValue=f?"":X.memoizedProps}catch(ye){Ue(X,X.return,ye)}}}else if(t.tag===18){if(a===null){X=t;try{var ue=X.stateNode;f?qp(ue,!0):qp(X.stateNode,!1)}catch(ye){Ue(X,X.return,ye)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Hu(e,a))));break;case 19:Mt(t,e),Tt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Hu(e,i)));break;case 30:break;case 21:break;default:Mt(t,e),Tt(e)}}function Tt(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(Yg(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var f=a.stateNode,m=Dc(e);Lu(e,m,f);break;case 5:var x=a.stateNode;a.flags&32&&(Sl(x,""),a.flags&=-33);var T=Dc(e);Lu(e,T,x);break;case 3:case 4:var X=a.stateNode.containerInfo,ae=Dc(e);jc(e,ae,X);break;default:throw Error(u(161))}}catch(oe){Ue(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xg(e,t.alternate,t),t=t.sibling}function Pa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ga(4,t,t.return),Pa(t);break;case 1:Sn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&qg(t,t.return,a),Pa(t);break;case 27:ir(t.stateNode);case 26:case 5:Sn(t,t.return),Pa(t);break;case 22:t.memoizedState===null&&Pa(t);break;case 30:Pa(t);break;default:Pa(t)}e=e.sibling}}function $n(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,f=e,m=t,x=m.flags;switch(m.tag){case 0:case 11:case 15:$n(f,m,a),Ii(4,m);break;case 1:if($n(f,m,a),i=m,f=i.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ae){Ue(i,i.return,ae)}if(i=m,f=i.updateQueue,f!==null){var T=i.stateNode;try{var X=f.shared.hiddenCallbacks;if(X!==null)for(f.shared.hiddenCallbacks=null,f=0;f<X.length;f++)Mm(X[f],T)}catch(ae){Ue(i,i.return,ae)}}a&&x&64&&Ug(m),Ji(m,m.return);break;case 27:Vg(m);case 26:case 5:$n(f,m,a),a&&i===null&&x&4&&kg(m),Ji(m,m.return);break;case 12:$n(f,m,a);break;case 31:$n(f,m,a),a&&x&4&&Zg(f,m);break;case 13:$n(f,m,a),a&&x&4&&Kg(f,m);break;case 22:m.memoizedState===null&&$n(f,m,a),Ji(m,m.return);break;case 30:break;default:$n(f,m,a)}t=t.sibling}}function Hc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Hi(a))}function Bc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hi(e))}function un(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fg(e,t,a,i),t=t.sibling}function Fg(e,t,a,i){var f=t.flags;switch(t.tag){case 0:case 11:case 15:un(e,t,a,i),f&2048&&Ii(9,t);break;case 1:un(e,t,a,i);break;case 3:un(e,t,a,i),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hi(e)));break;case 12:if(f&2048){un(e,t,a,i),e=t.stateNode;try{var m=t.memoizedProps,x=m.id,T=m.onPostCommit;typeof T=="function"&&T(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){Ue(t,t.return,X)}}else un(e,t,a,i);break;case 31:un(e,t,a,i);break;case 13:un(e,t,a,i);break;case 23:break;case 22:m=t.stateNode,x=t.alternate,t.memoizedState!==null?m._visibility&2?un(e,t,a,i):Fi(e,t):m._visibility&2?un(e,t,a,i):(m._visibility|=2,Vl(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),f&2048&&Hc(x,t);break;case 24:un(e,t,a,i),f&2048&&Bc(t.alternate,t);break;default:un(e,t,a,i)}}function Vl(e,t,a,i,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,x=t,T=a,X=i,ae=x.flags;switch(x.tag){case 0:case 11:case 15:Vl(m,x,T,X,f),Ii(8,x);break;case 23:break;case 22:var oe=x.stateNode;x.memoizedState!==null?oe._visibility&2?Vl(m,x,T,X,f):Fi(m,x):(oe._visibility|=2,Vl(m,x,T,X,f)),f&&ae&2048&&Hc(x.alternate,x);break;case 24:Vl(m,x,T,X,f),f&&ae&2048&&Bc(x.alternate,x);break;default:Vl(m,x,T,X,f)}t=t.sibling}}function Fi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,f=i.flags;switch(i.tag){case 22:Fi(a,i),f&2048&&Hc(i.alternate,i);break;case 24:Fi(a,i),f&2048&&Bc(i.alternate,i);break;default:Fi(a,i)}t=t.sibling}}var Wi=8192;function Gl(e,t,a){if(e.subtreeFlags&Wi)for(e=e.child;e!==null;)Wg(e,t,a),e=e.sibling}function Wg(e,t,a){switch(e.tag){case 26:Gl(e,t,a),e.flags&Wi&&e.memoizedState!==null&&KE(a,rn,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,a);break;case 3:case 4:var i=rn;rn=Ju(e.stateNode.containerInfo),Gl(e,t,a),rn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Wi,Wi=16777216,Gl(e,t,a),Wi=i):Gl(e,t,a));break;default:Gl(e,t,a)}}function Pg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ct=i,tp(i,e)}Pg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ep(e),e=e.sibling}function ep(e){switch(e.tag){case 0:case 11:case 15:Pi(e),e.flags&2048&&ga(9,e,e.return);break;case 3:Pi(e);break;case 12:Pi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bu(e)):Pi(e);break;default:Pi(e)}}function Bu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ct=i,tp(i,e)}Pg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ga(8,t,t.return),Bu(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Bu(t));break;default:Bu(t)}e=e.sibling}}function tp(e,t){for(;ct!==null;){var a=ct;switch(a.tag){case 0:case 11:case 15:ga(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Hi(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ct=i;else e:for(a=e;ct!==null;){i=ct;var f=i.sibling,m=i.return;if($g(i),i===a){ct=null;break e}if(f!==null){f.return=m,ct=f;break e}ct=m}}}var sE={getCacheForType:function(e){var t=dt(tt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return dt(tt).controller.signal}},cE=typeof WeakMap=="function"?WeakMap:Map,He=0,Ve=null,Me=null,Ae=0,Be=0,Ut=null,pa=!1,Xl=!1,Uc=!1,Qn=0,Je=0,ya=0,el=0,qc=0,qt=0,$l=0,er=null,At=null,kc=!1,Uu=0,np=0,qu=1/0,ku=null,va=null,st=0,ba=null,Ql=null,Zn=0,Yc=0,Vc=null,ap=null,tr=0,Gc=null;function kt(){return(He&2)!==0&&Ae!==0?Ae&-Ae:D.T!==null?Ic():$r()}function lp(){if(qt===0)if((Ae&536870912)===0||Oe){var e=ml;ml<<=1,(ml&3932160)===0&&(ml=262144),qt=e}else qt=536870912;return e=Ht.current,e!==null&&(e.flags|=32),qt}function Rt(e,t,a){(e===Ve&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(Zl(e,0),xa(e,Ae,qt,!1)),Ha(e,a),((He&2)===0||e!==Ve)&&(e===Ve&&((He&2)===0&&(el|=a),Je===4&&xa(e,Ae,qt,!1)),wn(e))}function ip(e,t,a){if((He&6)!==0)throw Error(u(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||La(e,t),f=i?hE(e,t):$c(e,t,!0),m=i;do{if(f===0){Xl&&!i&&xa(e,t,0,!1);break}else{if(a=e.current.alternate,m&&!fE(a)){f=$c(e,t,!1),m=!1;continue}if(f===2){if(m=t,e.errorRecoveryDisabledLanes&m)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var T=e;f=er;var X=T.current.memoizedState.isDehydrated;if(X&&(Zl(T,x).flags|=256),x=$c(T,x,!1),x!==2){if(Uc&&!X){T.errorRecoveryDisabledLanes|=m,el|=m,f=4;break e}m=At,At=f,m!==null&&(At===null?At=m:At.push.apply(At,m))}f=x}if(m=!1,f!==2)continue}}if(f===1){Zl(e,0),xa(e,t,0,!0);break}e:{switch(i=e,m=f,m){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:xa(i,t,qt,!pa);break e;case 2:At=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(f=Uu+300-Fe(),10<f)){if(xa(i,t,qt,!pa),pl(i,0,!0)!==0)break e;Zn=t,i.timeoutHandle=Hp(rp.bind(null,i,a,At,ku,kc,t,qt,el,$l,pa,m,"Throttled",-0,0),f);break e}rp(i,a,At,ku,kc,t,qt,el,$l,pa,m,null,-0,0)}}break}while(!0);wn(e)}function rp(e,t,a,i,f,m,x,T,X,ae,oe,de,ie,ue){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:On},Wg(t,m,de);var ye=(m&62914560)===m?Uu-Fe():(m&4194048)===m?np-Fe():0;if(ye=IE(de,ye),ye!==null){Zn=m,e.cancelPendingCommit=ye(mp.bind(null,e,t,m,a,i,f,x,T,X,oe,de,null,ie,ue)),xa(e,m,x,!ae);return}}mp(e,t,m,a,i,f,x,T,X)}function fE(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var f=a[i],m=f.getSnapshot;f=f.value;try{if(!jt(m(),f))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xa(e,t,a,i){t&=~qc,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var f=t;0<f;){var m=31-bt(f),x=1<<m;i[m]=-1,f&=~x}a!==0&&Vr(e,a,t)}function Yu(){return(He&6)===0?(nr(0),!1):!0}function Xc(){if(Me!==null){if(Be===0)var e=Me.return;else e=Me,Hn=$a=null,rc(e),Bl=null,Ui=0,e=Me;for(;e!==null;)Bg(e.alternate,e),e=e.return;Me=null}}function Zl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,zE(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Zn=0,Xc(),Ve=e,Me=a=jn(e.current,null),Ae=t,Be=0,Ut=null,pa=!1,Xl=La(e,t),Uc=!1,$l=qt=qc=el=ya=Je=0,At=er=null,kc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var f=31-bt(i),m=1<<f;t|=e[f],i&=~m}return Qn=t,ou(),a}function up(e,t){Ne=null,D.H=Qi,t===Hl||t===pu?(t=wm(),Be=3):t===Ks?(t=wm(),Be=4):Be=t===Sc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,Me===null&&(Je=1,Ru(e,It(t,e.current)))}function op(){var e=Ht.current;return e===null?!0:(Ae&4194048)===Ae?Pt===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===Pt:!1}function sp(){var e=D.H;return D.H=Qi,e===null?Qi:e}function cp(){var e=D.A;return D.A=sE,e}function Vu(){Je=4,pa||(Ae&4194048)!==Ae&&Ht.current!==null||(Xl=!0),(ya&134217727)===0&&(el&134217727)===0||Ve===null||xa(Ve,Ae,qt,!1)}function $c(e,t,a){var i=He;He|=2;var f=sp(),m=cp();(Ve!==e||Ae!==t)&&(ku=null,Zl(e,t)),t=!1;var x=Je;e:do try{if(Be!==0&&Me!==null){var T=Me,X=Ut;switch(Be){case 8:Xc(),x=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var ae=Be;if(Be=0,Ut=null,Kl(e,T,X,ae),a&&Xl){x=0;break e}break;default:ae=Be,Be=0,Ut=null,Kl(e,T,X,ae)}}dE(),x=Je;break}catch(oe){up(e,oe)}while(!0);return t&&e.shellSuspendCounter++,Hn=$a=null,He=i,D.H=f,D.A=m,Me===null&&(Ve=null,Ae=0,ou()),x}function dE(){for(;Me!==null;)fp(Me)}function hE(e,t){var a=He;He|=2;var i=sp(),f=cp();Ve!==e||Ae!==t?(ku=null,qu=Fe()+500,Zl(e,t)):Xl=La(e,t);e:do try{if(Be!==0&&Me!==null){t=Me;var m=Ut;t:switch(Be){case 1:Be=0,Ut=null,Kl(e,t,m,1);break;case 2:case 9:if(Em(m)){Be=0,Ut=null,dp(t);break}t=function(){Be!==2&&Be!==9||Ve!==e||(Be=7),wn(e)},m.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Em(m)?(Be=0,Ut=null,dp(t)):(Be=0,Ut=null,Kl(e,t,m,7));break;case 5:var x=null;switch(Me.tag){case 26:x=Me.memoizedState;case 5:case 27:var T=Me;if(x?Fp(x):T.stateNode.complete){Be=0,Ut=null;var X=T.sibling;if(X!==null)Me=X;else{var ae=T.return;ae!==null?(Me=ae,Gu(ae)):Me=null}break t}}Be=0,Ut=null,Kl(e,t,m,5);break;case 6:Be=0,Ut=null,Kl(e,t,m,6);break;case 8:Xc(),Je=6;break e;default:throw Error(u(462))}}mE();break}catch(oe){up(e,oe)}while(!0);return Hn=$a=null,D.H=i,D.A=f,He=a,Me!==null?0:(Ve=null,Ae=0,ou(),Je)}function mE(){for(;Me!==null&&!Da();)fp(Me)}function fp(e){var t=Lg(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,t===null?Gu(e):Me=t}function dp(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ag(a,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=Ag(a,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:rc(t);default:Bg(a,t),t=Me=cm(t,Qn),t=Lg(a,t,Qn)}e.memoizedProps=e.pendingProps,t===null?Gu(e):Me=t}function Kl(e,t,a,i){Hn=$a=null,rc(t),Bl=null,Ui=0;var f=t.return;try{if(nE(e,f,t,a,Ae)){Je=1,Ru(e,It(a,e.current)),Me=null;return}}catch(m){if(f!==null)throw Me=f,m;Je=1,Ru(e,It(a,e.current)),Me=null;return}t.flags&32768?(Oe||i===1?e=!0:Xl||(Ae&536870912)!==0?e=!1:(pa=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ht.current,i!==null&&i.tag===13&&(i.flags|=16384))),hp(t,e)):Gu(t)}function Gu(e){var t=e;do{if((t.flags&32768)!==0){hp(t,pa);return}e=t.return;var a=iE(t.alternate,t,Qn);if(a!==null){Me=a;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Je===0&&(Je=5)}function hp(e,t){do{var a=rE(e.alternate,e);if(a!==null){a.flags&=32767,Me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Me=e;return}Me=e=a}while(e!==null);Je=6,Me=null}function mp(e,t,a,i,f,m,x,T,X){e.cancelPendingCommit=null;do Xu();while(st!==0);if((He&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(m=t.lanes|t.childLanes,m|=Ds,cs(e,a,m,x,T,X),e===Ve&&(Me=Ve=null,Ae=0),Ql=t,ba=e,Zn=a,Yc=m,Vc=f,ap=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,vE(Zt,function(){return bp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=D.T,D.T=null,f=Y.p,Y.p=2,x=He,He|=4;try{uE(e,t,a)}finally{He=x,Y.p=f,D.T=i}}st=1,gp(),pp(),yp()}}function gp(){if(st===1){st=0;var e=ba,t=Ql,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var i=Y.p;Y.p=2;var f=He;He|=4;try{Ig(t,e);var m=af,x=tm(e.containerInfo),T=m.focusedElem,X=m.selectionRange;if(x!==T&&T&&T.ownerDocument&&em(T.ownerDocument.documentElement,T)){if(X!==null&&Ts(T)){var ae=X.start,oe=X.end;if(oe===void 0&&(oe=ae),"selectionStart"in T)T.selectionStart=ae,T.selectionEnd=Math.min(oe,T.value.length);else{var de=T.ownerDocument||document,ie=de&&de.defaultView||window;if(ie.getSelection){var ue=ie.getSelection(),ye=T.textContent.length,Se=Math.min(X.start,ye),Ye=X.end===void 0?Se:Math.min(X.end,ye);!ue.extend&&Se>Ye&&(x=Ye,Ye=Se,Se=x);var W=Ph(T,Se),K=Ph(T,Ye);if(W&&K&&(ue.rangeCount!==1||ue.anchorNode!==W.node||ue.anchorOffset!==W.offset||ue.focusNode!==K.node||ue.focusOffset!==K.offset)){var te=de.createRange();te.setStart(W.node,W.offset),ue.removeAllRanges(),Se>Ye?(ue.addRange(te),ue.extend(K.node,K.offset)):(te.setEnd(K.node,K.offset),ue.addRange(te))}}}}for(de=[],ue=T;ue=ue.parentNode;)ue.nodeType===1&&de.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<de.length;T++){var ce=de[T];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}no=!!nf,af=nf=null}finally{He=f,Y.p=i,D.T=a}}e.current=t,st=2}}function pp(){if(st===2){st=0;var e=ba,t=Ql,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var i=Y.p;Y.p=2;var f=He;He|=4;try{Xg(e,t.alternate,t)}finally{He=f,Y.p=i,D.T=a}}st=3}}function yp(){if(st===4||st===3){st=0,Tn();var e=ba,t=Ql,a=Zn,i=ap;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?st=5:(st=0,Ql=ba=null,vp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(va=null),vi(a),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(ja,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=D.T,f=Y.p,Y.p=2,D.T=null;try{for(var m=e.onRecoverableError,x=0;x<i.length;x++){var T=i[x];m(T.value,{componentStack:T.stack})}}finally{D.T=t,Y.p=f}}(Zn&3)!==0&&Xu(),wn(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===Gc?tr++:(tr=0,Gc=e):tr=0,nr(0)}}function vp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hi(t)))}function Xu(){return gp(),pp(),yp(),bp()}function bp(){if(st!==5)return!1;var e=ba,t=Yc;Yc=0;var a=vi(Zn),i=D.T,f=Y.p;try{Y.p=32>a?32:a,D.T=null,a=Vc,Vc=null;var m=ba,x=Zn;if(st=0,Ql=ba=null,Zn=0,(He&6)!==0)throw Error(u(331));var T=He;if(He|=4,ep(m.current),Fg(m,m.current,x,a),He=T,nr(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(ja,m)}catch{}return!0}finally{Y.p=f,D.T=i,vp(e,t)}}function xp(e,t,a){t=It(a,t),t=Ec(e.stateNode,t,2),e=da(e,t,2),e!==null&&(Ha(e,2),wn(e))}function Ue(e,t,a){if(e.tag===3)xp(e,e,a);else for(;t!==null;){if(t.tag===3){xp(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(va===null||!va.has(i))){e=It(a,e),a=Eg(2),i=da(t,a,2),i!==null&&(Sg(a,i,t,e),Ha(i,2),wn(i));break}}t=t.return}}function Qc(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new cE;var f=new Set;i.set(t,f)}else f=i.get(t),f===void 0&&(f=new Set,i.set(t,f));f.has(a)||(Uc=!0,f.add(a),e=gE.bind(null,e,t,a),t.then(e,e))}function gE(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ve===e&&(Ae&a)===a&&(Je===4||Je===3&&(Ae&62914560)===Ae&&300>Fe()-Uu?(He&2)===0&&Zl(e,0):qc|=a,$l===Ae&&($l=0)),wn(e)}function Ep(e,t){t===0&&(t=Yr()),e=Va(e,t),e!==null&&(Ha(e,t),wn(e))}function pE(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ep(e,a)}function yE(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),Ep(e,a)}function vE(e,t){return St(e,t)}var $u=null,Il=null,Zc=!1,Qu=!1,Kc=!1,Ea=0;function wn(e){e!==Il&&e.next===null&&(Il===null?$u=Il=e:Il=Il.next=e),Qu=!0,Zc||(Zc=!0,xE())}function nr(e,t){if(!Kc&&Qu){Kc=!0;do for(var a=!1,i=$u;i!==null;){if(e!==0){var f=i.pendingLanes;if(f===0)var m=0;else{var x=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-bt(42|e)+1)-1,m&=f&~(x&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,Np(i,m))}else m=Ae,m=pl(i,i===Ve?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||La(i,m)||(a=!0,Np(i,m));i=i.next}while(a);Kc=!1}}function bE(){Sp()}function Sp(){Qu=Zc=!1;var e=0;Ea!==0&&RE()&&(e=Ea);for(var t=Fe(),a=null,i=$u;i!==null;){var f=i.next,m=wp(i,t);m===0?(i.next=null,a===null?$u=f:a.next=f,f===null&&(Il=a)):(a=i,(e!==0||(m&3)!==0)&&(Qu=!0)),i=f}st!==0&&st!==5||nr(e),Ea!==0&&(Ea=0)}function wp(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,f=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var x=31-bt(m),T=1<<x,X=f[x];X===-1?((T&a)===0||(T&i)!==0)&&(f[x]=ss(T,t)):X<=t&&(e.expiredLanes|=T),m&=~T}if(t=Ve,a=Ae,a=pl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ot(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||La(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&Ot(i),vi(a)){case 2:case 8:a=Qt;break;case 32:a=Zt;break;case 268435456:a=dl;break;default:a=Zt}return i=_p.bind(null,e),a=St(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&Ot(i),e.callbackPriority=2,e.callbackNode=null,2}function _p(e,t){if(st!==0&&st!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xu()&&e.callbackNode!==a)return null;var i=Ae;return i=pl(e,e===Ve?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(ip(e,i,t),wp(e,Fe()),e.callbackNode!=null&&e.callbackNode===a?_p.bind(null,e):null)}function Np(e,t){if(Xu())return null;ip(e,t,!0)}function xE(){OE(function(){(He&6)!==0?St($t,bE):Sp()})}function Ic(){if(Ea===0){var e=jl;e===0&&(e=hl,hl<<=1,(hl&261888)===0&&(hl=256)),Ea=e}return Ea}function Cp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:eu(""+e)}function Mp(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function EE(e,t,a,i,f){if(t==="submit"&&a&&a.stateNode===f){var m=Cp((f[gt]||null).action),x=i.submitter;x&&(t=(t=x[gt]||null)?Cp(t.formAction):x.getAttribute("formAction"),t!==null&&(m=t,x=null));var T=new lu("action","action",null,i,f);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ea!==0){var X=x?Mp(f,x):new FormData(f);gc(a,{pending:!0,data:X,method:f.method,action:m},null,X)}}else typeof m=="function"&&(T.preventDefault(),X=x?Mp(f,x):new FormData(f),gc(a,{pending:!0,data:X,method:f.method,action:m},m,X))},currentTarget:f}]})}}for(var Jc=0;Jc<Os.length;Jc++){var Fc=Os[Jc],SE=Fc.toLowerCase(),wE=Fc[0].toUpperCase()+Fc.slice(1);ln(SE,"on"+wE)}ln(lm,"onAnimationEnd"),ln(im,"onAnimationIteration"),ln(rm,"onAnimationStart"),ln("dblclick","onDoubleClick"),ln("focusin","onFocus"),ln("focusout","onBlur"),ln(qx,"onTransitionRun"),ln(kx,"onTransitionStart"),ln(Yx,"onTransitionCancel"),ln(um,"onTransitionEnd"),aa("onMouseEnter",["mouseout","mouseover"]),aa("onMouseLeave",["mouseout","mouseover"]),aa("onPointerEnter",["pointerout","pointerover"]),aa("onPointerLeave",["pointerout","pointerover"]),zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ar="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_E=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ar));function Tp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],f=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var x=i.length-1;0<=x;x--){var T=i[x],X=T.instance,ae=T.currentTarget;if(T=T.listener,X!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=ae;try{m(f)}catch(oe){uu(oe)}f.currentTarget=null,m=X}else for(x=0;x<i.length;x++){if(T=i[x],X=T.instance,ae=T.currentTarget,T=T.listener,X!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=ae;try{m(f)}catch(oe){uu(oe)}f.currentTarget=null,m=X}}}}function Te(e,t){var a=t[yl];a===void 0&&(a=t[yl]=new Set);var i=e+"__bubble";a.has(i)||(Ap(t,e,2,!1),a.add(i))}function Wc(e,t,a){var i=0;t&&(i|=4),Ap(a,e,i,t)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function Pc(e){if(!e[Zu]){e[Zu]=!0,Ir.forEach(function(a){a!=="selectionchange"&&(_E.has(a)||Wc(a,!1,e),Wc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zu]||(t[Zu]=!0,Wc("selectionchange",!1,t))}}function Ap(e,t,a,i){switch(l0(t)){case 2:var f=WE;break;case 8:f=PE;break;default:f=gf}a=f.bind(null,t,a,e),f=void 0,!bs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),i?f!==void 0?e.addEventListener(t,a,{capture:!0,passive:f}):e.addEventListener(t,a,!0):f!==void 0?e.addEventListener(t,a,{passive:f}):e.addEventListener(t,a,!1)}function ef(e,t,a,i,f){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var x=i.tag;if(x===3||x===4){var T=i.stateNode.containerInfo;if(T===f)break;if(x===4)for(x=i.return;x!==null;){var X=x.tag;if((X===3||X===4)&&x.stateNode.containerInfo===f)return;x=x.return}for(;T!==null;){if(x=Pn(T),x===null)return;if(X=x.tag,X===5||X===6||X===26||X===27){i=m=x;continue e}T=T.parentNode}}i=i.return}jh(function(){var ae=m,oe=ys(a),de=[];e:{var ie=om.get(e);if(ie!==void 0){var ue=lu,ye=e;switch(e){case"keypress":if(nu(a)===0)break e;case"keydown":case"keyup":ue=yx;break;case"focusin":ye="focus",ue=ws;break;case"focusout":ye="blur",ue=ws;break;case"beforeblur":case"afterblur":ue=ws;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Bh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=ix;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=xx;break;case lm:case im:case rm:ue=ox;break;case um:ue=Sx;break;case"scroll":case"scrollend":ue=ax;break;case"wheel":ue=_x;break;case"copy":case"cut":case"paste":ue=cx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=qh;break;case"toggle":case"beforetoggle":ue=Cx}var Se=(t&4)!==0,Ye=!Se&&(e==="scroll"||e==="scrollend"),W=Se?ie!==null?ie+"Capture":null:ie;Se=[];for(var K=ae,te;K!==null;){var ce=K;if(te=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||te===null||W===null||(ce=Ni(K,W),ce!=null&&Se.push(lr(K,ce,te))),Ye)break;K=K.return}0<Se.length&&(ie=new ue(ie,ye,null,a,oe),de.push({event:ie,listeners:Se}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",ie&&a!==ps&&(ye=a.relatedTarget||a.fromElement)&&(Pn(ye)||ye[Rn]))break e;if((ue||ie)&&(ie=oe.window===oe?oe:(ie=oe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ue?(ye=a.relatedTarget||a.toElement,ue=ae,ye=ye?Pn(ye):null,ye!==null&&(Ye=s(ye),Se=ye.tag,ye!==Ye||Se!==5&&Se!==27&&Se!==6)&&(ye=null)):(ue=null,ye=ae),ue!==ye)){if(Se=Bh,ce="onMouseLeave",W="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(Se=qh,ce="onPointerLeave",W="onPointerEnter",K="pointer"),Ye=ue==null?ie:ta(ue),te=ye==null?ie:ta(ye),ie=new Se(ce,K+"leave",ue,a,oe),ie.target=Ye,ie.relatedTarget=te,ce=null,Pn(oe)===ae&&(Se=new Se(W,K+"enter",ye,a,oe),Se.target=te,Se.relatedTarget=Ye,ce=Se),Ye=ce,ue&&ye)t:{for(Se=NE,W=ue,K=ye,te=0,ce=W;ce;ce=Se(ce))te++;ce=0;for(var Ee=K;Ee;Ee=Se(Ee))ce++;for(;0<te-ce;)W=Se(W),te--;for(;0<ce-te;)K=Se(K),ce--;for(;te--;){if(W===K||K!==null&&W===K.alternate){Se=W;break t}W=Se(W),K=Se(K)}Se=null}else Se=null;ue!==null&&Rp(de,ie,ue,Se,!1),ye!==null&&Ye!==null&&Rp(de,Ye,ye,Se,!0)}}e:{if(ie=ae?ta(ae):window,ue=ie.nodeName&&ie.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ie.type==="file")var je=Zh;else if($h(ie))if(Kh)je=Hx;else{je=jx;var ve=Dx}else ue=ie.nodeName,!ue||ue.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ae&&gs(ae.elementType)&&(je=Zh):je=Lx;if(je&&(je=je(e,ae))){Qh(de,je,a,oe);break e}ve&&ve(e,ie,ae),e==="focusout"&&ae&&ie.type==="number"&&ae.memoizedProps.value!=null&&wi(ie,"number",ie.value)}switch(ve=ae?ta(ae):window,e){case"focusin":($h(ve)||ve.contentEditable==="true")&&(Cl=ve,As=ae,Di=null);break;case"focusout":Di=As=Cl=null;break;case"mousedown":Rs=!0;break;case"contextmenu":case"mouseup":case"dragend":Rs=!1,nm(de,a,oe);break;case"selectionchange":if(Ux)break;case"keydown":case"keyup":nm(de,a,oe)}var Ce;if(Ns)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Nl?Gh(e,a)&&(Re="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Re="onCompositionStart");Re&&(kh&&a.locale!=="ko"&&(Nl||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Nl&&(Ce=Lh()):(ia=oe,xs="value"in ia?ia.value:ia.textContent,Nl=!0)),ve=Ku(ae,Re),0<ve.length&&(Re=new Uh(Re,e,null,a,oe),de.push({event:Re,listeners:ve}),Ce?Re.data=Ce:(Ce=Xh(a),Ce!==null&&(Re.data=Ce)))),(Ce=Tx?Ax(e,a):Rx(e,a))&&(Re=Ku(ae,"onBeforeInput"),0<Re.length&&(ve=new Uh("onBeforeInput","beforeinput",null,a,oe),de.push({event:ve,listeners:Re}),ve.data=Ce)),EE(de,e,ae,a,oe)}Tp(de,t)})}function lr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ku(e,t){for(var a=t+"Capture",i=[];e!==null;){var f=e,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Ni(e,a),f!=null&&i.unshift(lr(e,f,m)),f=Ni(e,t),f!=null&&i.push(lr(e,f,m))),e.tag===3)return i;e=e.return}return[]}function NE(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rp(e,t,a,i,f){for(var m=t._reactName,x=[];a!==null&&a!==i;){var T=a,X=T.alternate,ae=T.stateNode;if(T=T.tag,X!==null&&X===i)break;T!==5&&T!==26&&T!==27||ae===null||(X=ae,f?(ae=Ni(a,m),ae!=null&&x.unshift(lr(a,ae,X))):f||(ae=Ni(a,m),ae!=null&&x.push(lr(a,ae,X)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var CE=/\r\n?/g,ME=/\u0000|\uFFFD/g;function zp(e){return(typeof e=="string"?e:""+e).replace(CE,`
49
+ `).replace(ME,"")}function Op(e,t){return t=zp(t),zp(e)===t}function ke(e,t,a,i,f,m){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Sl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Sl(e,""+i);break;case"className":bl(e,"class",i);break;case"tabIndex":bl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":bl(e,a,i);break;case"style":Oh(e,i,m);break;case"data":if(t!=="object"){bl(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=eu(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(a==="formAction"?(t!=="input"&&ke(e,t,"name",f.name,f,null),ke(e,t,"formEncType",f.formEncType,f,null),ke(e,t,"formMethod",f.formMethod,f,null),ke(e,t,"formTarget",f.formTarget,f,null)):(ke(e,t,"encType",f.encType,f,null),ke(e,t,"method",f.method,f,null),ke(e,t,"target",f.target,f,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=eu(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=On);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(f.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}a=eu(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""+i):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Te("beforetoggle",e),Te("toggle",e),vl(e,"popover",i);break;case"xlinkActuate":an(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":an(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":an(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":an(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":an(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":an(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":an(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":an(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":an(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":vl(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=tx.get(a)||a,vl(e,a,i))}}function tf(e,t,a,i,f,m){switch(a){case"style":Oh(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(f.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof i=="string"?Sl(e,i):(typeof i=="number"||typeof i=="bigint")&&Sl(e,""+i);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"onClick":i!=null&&(e.onclick=On);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),t=a.slice(2,f?a.length-7:void 0),m=e[gt]||null,m=m!=null?m[a]:null,typeof m=="function"&&e.removeEventListener(t,m,f),typeof i=="function")){typeof m!="function"&&m!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,f);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):vl(e,a,i)}}}function mt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var i=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var x=a[m];if(x!=null)switch(m){case"src":i=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ke(e,t,m,x,a,null)}}f&&ke(e,t,"srcSet",a.srcSet,a,null),i&&ke(e,t,"src",a.src,a,null);return;case"input":Te("invalid",e);var T=m=x=f=null,X=null,ae=null;for(i in a)if(a.hasOwnProperty(i)){var oe=a[i];if(oe!=null)switch(i){case"name":f=oe;break;case"type":x=oe;break;case"checked":X=oe;break;case"defaultChecked":ae=oe;break;case"value":m=oe;break;case"defaultValue":T=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(u(137,t));break;default:ke(e,t,i,oe,a,null)}}El(e,m,T,X,ae,x,f,!1);return;case"select":Te("invalid",e),i=x=m=null;for(f in a)if(a.hasOwnProperty(f)&&(T=a[f],T!=null))switch(f){case"value":m=T;break;case"defaultValue":x=T;break;case"multiple":i=T;default:ke(e,t,f,T,a,null)}t=m,a=x,e.multiple=!!i,t!=null?la(e,!!i,t,!1):a!=null&&la(e,!!i,a,!0);return;case"textarea":Te("invalid",e),m=f=i=null;for(x in a)if(a.hasOwnProperty(x)&&(T=a[x],T!=null))switch(x){case"value":i=T;break;case"defaultValue":f=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(u(91));break;default:ke(e,t,x,T,a,null)}Rh(e,i,f,m);return;case"option":for(X in a)if(a.hasOwnProperty(X)&&(i=a[X],i!=null))switch(X){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ke(e,t,X,i,a,null)}return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(i=0;i<ar.length;i++)Te(ar[i],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in a)if(a.hasOwnProperty(ae)&&(i=a[ae],i!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ke(e,t,ae,i,a,null)}return;default:if(gs(t)){for(oe in a)a.hasOwnProperty(oe)&&(i=a[oe],i!==void 0&&tf(e,t,oe,i,a,void 0));return}}for(T in a)a.hasOwnProperty(T)&&(i=a[T],i!=null&&ke(e,t,T,i,a,null))}function TE(e,t,a,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,x=null,T=null,X=null,ae=null,oe=null;for(ue in a){var de=a[ue];if(a.hasOwnProperty(ue)&&de!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":X=de;default:i.hasOwnProperty(ue)||ke(e,t,ue,null,i,de)}}for(var ie in i){var ue=i[ie];if(de=a[ie],i.hasOwnProperty(ie)&&(ue!=null||de!=null))switch(ie){case"type":m=ue;break;case"name":f=ue;break;case"checked":ae=ue;break;case"defaultChecked":oe=ue;break;case"value":x=ue;break;case"defaultValue":T=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(u(137,t));break;default:ue!==de&&ke(e,t,ie,ue,i,de)}}Si(e,x,T,X,ae,oe,m,f);return;case"select":ue=x=T=ie=null;for(m in a)if(X=a[m],a.hasOwnProperty(m)&&X!=null)switch(m){case"value":break;case"multiple":ue=X;default:i.hasOwnProperty(m)||ke(e,t,m,null,i,X)}for(f in i)if(m=i[f],X=a[f],i.hasOwnProperty(f)&&(m!=null||X!=null))switch(f){case"value":ie=m;break;case"defaultValue":T=m;break;case"multiple":x=m;default:m!==X&&ke(e,t,f,m,i,X)}t=T,a=x,i=ue,ie!=null?la(e,!!a,ie,!1):!!i!=!!a&&(t!=null?la(e,!!a,t,!0):la(e,!!a,a?[]:"",!1));return;case"textarea":ue=ie=null;for(T in a)if(f=a[T],a.hasOwnProperty(T)&&f!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ke(e,t,T,null,i,f)}for(x in i)if(f=i[x],m=a[x],i.hasOwnProperty(x)&&(f!=null||m!=null))switch(x){case"value":ie=f;break;case"defaultValue":ue=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(u(91));break;default:f!==m&&ke(e,t,x,f,i,m)}_i(e,ie,ue);return;case"option":for(var ye in a)if(ie=a[ye],a.hasOwnProperty(ye)&&ie!=null&&!i.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:ke(e,t,ye,null,i,ie)}for(X in i)if(ie=i[X],ue=a[X],i.hasOwnProperty(X)&&ie!==ue&&(ie!=null||ue!=null))switch(X){case"selected":e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:ke(e,t,X,ie,i,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in a)ie=a[Se],a.hasOwnProperty(Se)&&ie!=null&&!i.hasOwnProperty(Se)&&ke(e,t,Se,null,i,ie);for(ae in i)if(ie=i[ae],ue=a[ae],i.hasOwnProperty(ae)&&ie!==ue&&(ie!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(u(137,t));break;default:ke(e,t,ae,ie,i,ue)}return;default:if(gs(t)){for(var Ye in a)ie=a[Ye],a.hasOwnProperty(Ye)&&ie!==void 0&&!i.hasOwnProperty(Ye)&&tf(e,t,Ye,void 0,i,ie);for(oe in i)ie=i[oe],ue=a[oe],!i.hasOwnProperty(oe)||ie===ue||ie===void 0&&ue===void 0||tf(e,t,oe,ie,i,ue);return}}for(var W in a)ie=a[W],a.hasOwnProperty(W)&&ie!=null&&!i.hasOwnProperty(W)&&ke(e,t,W,null,i,ie);for(de in i)ie=i[de],ue=a[de],!i.hasOwnProperty(de)||ie===ue||ie==null&&ue==null||ke(e,t,de,ie,i,ue)}function Dp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AE(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var f=a[i],m=f.transferSize,x=f.initiatorType,T=f.duration;if(m&&T&&Dp(x)){for(x=0,T=f.responseEnd,i+=1;i<a.length;i++){var X=a[i],ae=X.startTime;if(ae>T)break;var oe=X.transferSize,de=X.initiatorType;oe&&Dp(de)&&(X=X.responseEnd,x+=oe*(X<T?1:(T-ae)/(X-ae)))}if(--i,t+=8*(m+x)/(f.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nf=null,af=null;function Iu(e){return e.nodeType===9?e:e.ownerDocument}function jp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function lf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rf=null;function RE(){var e=window.event;return e&&e.type==="popstate"?e===rf?!1:(rf=e,!0):(rf=null,!1)}var Hp=typeof setTimeout=="function"?setTimeout:void 0,zE=typeof clearTimeout=="function"?clearTimeout:void 0,Bp=typeof Promise=="function"?Promise:void 0,OE=typeof queueMicrotask=="function"?queueMicrotask:typeof Bp<"u"?function(e){return Bp.resolve(null).then(e).catch(DE)}:Hp;function DE(e){setTimeout(function(){throw e})}function Sa(e){return e==="head"}function Up(e,t){var a=t,i=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(f),Pl(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")ir(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ir(a);for(var m=a.firstChild;m;){var x=m.nextSibling,T=m.nodeName;m[Ba]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=x}}else a==="body"&&ir(e.ownerDocument.body);a=f}while(a);Pl(t)}function qp(e,t){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function uf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":uf(a),bi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function jE(e,t,a,i){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ba])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=en(e.nextSibling),e===null)break}return null}function LE(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=en(e.nextSibling),e===null))return null;return e}function kp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=en(e.nextSibling),e===null))return null;return e}function of(e){return e.data==="$?"||e.data==="$~"}function sf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function HE(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function en(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var cf=null;function Yp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return en(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Vp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Gp(e,t,a){switch(t=Iu(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function ir(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bi(e)}var tn=new Map,Xp=new Set;function Ju(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Kn=Y.d;Y.d={f:BE,r:UE,D:qE,C:kE,L:YE,m:VE,X:XE,S:GE,M:$E};function BE(){var e=Kn.f(),t=Yu();return e||t}function UE(e){var t=ea(e);t!==null&&t.tag===5&&t.type==="form"?ug(t):Kn.r(e)}var Jl=typeof document>"u"?null:document;function $p(e,t,a){var i=Jl;if(i&&typeof t=="string"&&t){var f=_t(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Xp.has(f)||(Xp.add(f),e={rel:e,crossOrigin:a,href:t},i.querySelector(f)===null&&(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function qE(e){Kn.D(e),$p("dns-prefetch",e,null)}function kE(e,t){Kn.C(e,t),$p("preconnect",e,t)}function YE(e,t,a){Kn.L(e,t,a);var i=Jl;if(i&&e&&t){var f='link[rel="preload"][as="'+_t(t)+'"]';t==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+_t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+_t(a.imageSizes)+'"]')):f+='[href="'+_t(e)+'"]';var m=f;switch(t){case"style":m=Fl(e);break;case"script":m=Wl(e)}tn.has(m)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),tn.set(m,e),i.querySelector(f)!==null||t==="style"&&i.querySelector(rr(m))||t==="script"&&i.querySelector(ur(m))||(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function VE(e,t){Kn.m(e,t);var a=Jl;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+_t(i)+'"][href="'+_t(e)+'"]',m=f;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Wl(e)}if(!tn.has(m)&&(e=y({rel:"modulepreload",href:e},t),tn.set(m,e),a.querySelector(f)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ur(m)))return}i=a.createElement("link"),mt(i,"link",e),et(i),a.head.appendChild(i)}}}function GE(e,t,a){Kn.S(e,t,a);var i=Jl;if(i&&e){var f=na(i).hoistableStyles,m=Fl(e);t=t||"default";var x=f.get(m);if(!x){var T={loading:0,preload:null};if(x=i.querySelector(rr(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=tn.get(m))&&ff(e,a);var X=x=i.createElement("link");et(X),mt(X,"link",e),X._p=new Promise(function(ae,oe){X.onload=ae,X.onerror=oe}),X.addEventListener("load",function(){T.loading|=1}),X.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Fu(x,t,i)}x={type:"stylesheet",instance:x,count:1,state:T},f.set(m,x)}}}function XE(e,t){Kn.X(e,t);var a=Jl;if(a&&e){var i=na(a).hoistableScripts,f=Wl(e),m=i.get(f);m||(m=a.querySelector(ur(f)),m||(e=y({src:e,async:!0},t),(t=tn.get(f))&&df(e,t),m=a.createElement("script"),et(m),mt(m,"link",e),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(f,m))}}function $E(e,t){Kn.M(e,t);var a=Jl;if(a&&e){var i=na(a).hoistableScripts,f=Wl(e),m=i.get(f);m||(m=a.querySelector(ur(f)),m||(e=y({src:e,async:!0,type:"module"},t),(t=tn.get(f))&&df(e,t),m=a.createElement("script"),et(m),mt(m,"link",e),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(f,m))}}function Qp(e,t,a,i){var f=(f=re.current)?Ju(f):null;if(!f)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Fl(a.href),a=na(f).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Fl(a.href);var m=na(f).hoistableStyles,x=m.get(e);if(x||(f=f.ownerDocument||f,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,x),(m=f.querySelector(rr(e)))&&!m._p&&(x.instance=m,x.state.loading=5),tn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},tn.set(e,a),m||QE(f,e,a,x.state))),t&&i===null)throw Error(u(528,""));return x}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wl(a),a=na(f).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Fl(e){return'href="'+_t(e)+'"'}function rr(e){return'link[rel="stylesheet"]['+e+"]"}function Zp(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function QE(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),mt(t,"link",a),et(t),e.head.appendChild(t))}function Wl(e){return'[src="'+_t(e)+'"]'}function ur(e){return"script[async]"+e}function Kp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+_t(a.href)+'"]');if(i)return t.instance=i,et(i),i;var f=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),et(i),mt(i,"style",f),Fu(i,a.precedence,e),t.instance=i;case"stylesheet":f=Fl(a.href);var m=e.querySelector(rr(f));if(m)return t.state.loading|=4,t.instance=m,et(m),m;i=Zp(a),(f=tn.get(f))&&ff(i,f),m=(e.ownerDocument||e).createElement("link"),et(m);var x=m;return x._p=new Promise(function(T,X){x.onload=T,x.onerror=X}),mt(m,"link",i),t.state.loading|=4,Fu(m,a.precedence,e),t.instance=m;case"script":return m=Wl(a.src),(f=e.querySelector(ur(m)))?(t.instance=f,et(f),f):(i=a,(f=tn.get(m))&&(i=y({},a),df(i,f)),e=e.ownerDocument||e,f=e.createElement("script"),et(f),mt(f,"link",i),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Fu(i,a.precedence,e));return t.instance}function Fu(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=i.length?i[i.length-1]:null,m=f,x=0;x<i.length;x++){var T=i[x];if(T.dataset.precedence===t)m=T;else if(m!==f)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function df(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wu=null;function Ip(e,t,a){if(Wu===null){var i=new Map,f=Wu=new Map;f.set(a,i)}else f=Wu,i=f.get(a),i||(i=new Map,f.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var m=a[f];if(!(m[Ba]||m[ot]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var x=m.getAttribute(t)||"";x=e+x;var T=i.get(x);T?T.push(m):i.set(x,[m])}}return i}function Jp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ZE(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Fp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function KE(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Fl(i.href),m=t.querySelector(rr(f));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pu.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=m,et(m);return}m=t.ownerDocument||t,i=Zp(i),(f=tn.get(f))&&ff(i,f),m=m.createElement("link"),et(m);var x=m;x._p=new Promise(function(T,X){x.onload=T,x.onerror=X}),mt(m,"link",i),a.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Pu.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var hf=0;function IE(e,t){return e.stylesheets&&e.count===0&&to(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&to(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&hf===0&&(hf=62500*AE());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&to(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>hf?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(f)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)to(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var eo=null;function to(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,eo=new Map,t.forEach(JE,e),eo=null,Pu.call(e))}function JE(e,t){if(!(t.state.loading&4)){var a=eo.get(e);if(a)var i=a.get(null);else{a=new Map,eo.set(e,a);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var x=f[m];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),i=x)}i&&a.set(null,i)}f=t.instance,x=f.getAttribute("data-precedence"),m=a.get(x)||i,m===i&&a.set(null,f),a.set(x,f),this.count++,i=Pu.bind(this),f.addEventListener("load",i),f.addEventListener("error",i),m?m.parentNode.insertBefore(f,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var or={$$typeof:_,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function FE(e,t,a,i,f,m,x,T,X){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.hiddenUpdates=pi(null),this.identifierPrefix=i,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function Wp(e,t,a,i,f,m,x,T,X,ae,oe,de){return e=new FE(e,t,a,x,X,ae,oe,de,T),t=1,m===!0&&(t|=24),m=Lt(3,null,null,t),e.current=m,m.stateNode=e,t=$s(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:a,cache:t},Is(m),e}function Pp(e){return e?(e=Al,e):Al}function e0(e,t,a,i,f,m){f=Pp(f),i.context===null?i.context=f:i.pendingContext=f,i=fa(t),i.payload={element:a},m=m===void 0?null:m,m!==null&&(i.callback=m),a=da(e,i,t),a!==null&&(Rt(a,e,t),ki(a,e,t))}function t0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function mf(e,t){t0(e,t),(e=e.alternate)&&t0(e,t)}function n0(e){if(e.tag===13||e.tag===31){var t=Va(e,67108864);t!==null&&Rt(t,e,67108864),mf(e,67108864)}}function a0(e){if(e.tag===13||e.tag===31){var t=kt();t=yi(t);var a=Va(e,t);a!==null&&Rt(a,e,t),mf(e,t)}}var no=!0;function WE(e,t,a,i){var f=D.T;D.T=null;var m=Y.p;try{Y.p=2,gf(e,t,a,i)}finally{Y.p=m,D.T=f}}function PE(e,t,a,i){var f=D.T;D.T=null;var m=Y.p;try{Y.p=8,gf(e,t,a,i)}finally{Y.p=m,D.T=f}}function gf(e,t,a,i){if(no){var f=pf(i);if(f===null)ef(e,t,i,ao,a),i0(e,i);else if(tS(f,e,t,a,i))i.stopPropagation();else if(i0(e,i),t&4&&-1<eS.indexOf(e)){for(;f!==null;){var m=ea(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var x=An(m.pendingLanes);if(x!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;x;){var X=1<<31-bt(x);T.entanglements[1]|=X,x&=~X}wn(m),(He&6)===0&&(qu=Fe()+500,nr(0))}}break;case 31:case 13:T=Va(m,2),T!==null&&Rt(T,m,2),Yu(),mf(m,2)}if(m=pf(i),m===null&&ef(e,t,i,ao,a),m===f)break;f=m}f!==null&&i.stopPropagation()}else ef(e,t,i,null,a)}}function pf(e){return e=ys(e),yf(e)}var ao=null;function yf(e){if(ao=null,e=Pn(e),e!==null){var t=s(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=c(t),e!==null)return e;e=null}else if(a===31){if(e=d(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ao=e,null}function l0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Dt()){case $t:return 2;case Qt:return 8;case Zt:case gi:return 32;case dl:return 268435456;default:return 32}default:return 32}}var vf=!1,wa=null,_a=null,Na=null,sr=new Map,cr=new Map,Ca=[],eS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function i0(e,t){switch(e){case"focusin":case"focusout":wa=null;break;case"dragenter":case"dragleave":_a=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":sr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cr.delete(t.pointerId)}}function fr(e,t,a,i,f,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:m,targetContainers:[f]},t!==null&&(t=ea(t),t!==null&&n0(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function tS(e,t,a,i,f){switch(t){case"focusin":return wa=fr(wa,e,t,a,i,f),!0;case"dragenter":return _a=fr(_a,e,t,a,i,f),!0;case"mouseover":return Na=fr(Na,e,t,a,i,f),!0;case"pointerover":var m=f.pointerId;return sr.set(m,fr(sr.get(m)||null,e,t,a,i,f)),!0;case"gotpointercapture":return m=f.pointerId,cr.set(m,fr(cr.get(m)||null,e,t,a,i,f)),!0}return!1}function r0(e){var t=Pn(e.target);if(t!==null){var a=s(t);if(a!==null){if(t=a.tag,t===13){if(t=c(a),t!==null){e.blockedOn=t,Qr(e.priority,function(){a0(a)});return}}else if(t===31){if(t=d(a),t!==null){e.blockedOn=t,Qr(e.priority,function(){a0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function lo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=pf(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);ps=i,a.target.dispatchEvent(i),ps=null}else return t=ea(a),t!==null&&n0(t),e.blockedOn=a,!1;t.shift()}return!0}function u0(e,t,a){lo(e)&&a.delete(t)}function nS(){vf=!1,wa!==null&&lo(wa)&&(wa=null),_a!==null&&lo(_a)&&(_a=null),Na!==null&&lo(Na)&&(Na=null),sr.forEach(u0),cr.forEach(u0)}function io(e,t){e.blockedOn===t&&(e.blockedOn=null,vf||(vf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,nS)))}var ro=null;function o0(e){ro!==e&&(ro=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ro===e&&(ro=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],f=e[t+2];if(typeof i!="function"){if(yf(i||a)===null)continue;break}var m=ea(a);m!==null&&(e.splice(t,3),t-=3,gc(m,{pending:!0,data:f,method:a.method,action:i},i,f))}}))}function Pl(e){function t(X){return io(X,e)}wa!==null&&io(wa,e),_a!==null&&io(_a,e),Na!==null&&io(Na,e),sr.forEach(t),cr.forEach(t);for(var a=0;a<Ca.length;a++){var i=Ca[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)r0(a),a.blockedOn===null&&Ca.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var f=a[i],m=a[i+1],x=f[gt]||null;if(typeof m=="function")x||o0(a);else if(x){var T=null;if(m&&m.hasAttribute("formAction")){if(f=m,x=m[gt]||null)T=x.formAction;else if(yf(f)!==null)continue}else T=x.action;typeof T=="function"?a[i+1]=T:(a.splice(i,3),i-=3),o0(a)}}}function s0(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(x){return f=x})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function bf(e){this._internalRoot=e}uo.prototype.render=bf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,i=kt();e0(a,i,e,t,null,null)},uo.prototype.unmount=bf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e0(e.current,2,null,e,null,null),Yu(),t[Rn]=null}};function uo(e){this._internalRoot=e}uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=$r();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ca.length&&t!==0&&t<Ca[a].priority;a++);Ca.splice(a,0,e),a===0&&r0(e)}};var c0=l.version;if(c0!=="19.2.8")throw Error(u(527,c0,"19.2.8"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var aS={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oo.isDisabled&&oo.supportsFiber)try{ja=oo.inject(aS),vt=oo}catch{}}return hr.createRoot=function(e,t){if(!o(e))throw Error(u(299));var a=!1,i="",f=yg,m=vg,x=bg;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=Wp(e,1,!1,null,null,a,i,null,f,m,x,s0),e[Rn]=t.current,Pc(e),new bf(t)},hr.hydrateRoot=function(e,t,a){if(!o(e))throw Error(u(299));var i=!1,f="",m=yg,x=vg,T=bg,X=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError),a.formState!==void 0&&(X=a.formState)),t=Wp(e,1,!0,t,a??null,i,f,X,m,x,T,s0),t.context=Pp(null),a=t.current,i=kt(),i=yi(i),f=fa(i),f.callback=null,da(a,f,i),a=i,t.current.lanes=a,Ha(t,a),wn(t),e[Rn]=t.current,Pc(e),new uo(t)},hr.version="19.2.8",hr}var x0;function gS(){if(x0)return Sf.exports;x0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Sf.exports=mS(),Sf.exports}var pS=gS();/**
50
+ * react-router v7.18.3
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var eh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Hv=/^[\\/]{2}/;function yS(n,l){return l+n.replace(/\\/g,"/")}var E0="popstate";function S0(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function vS(n={}){function l(u,o){var g;let s=(g=o.state)==null?void 0:g.masked,{pathname:c,search:d,hash:h}=s||u.location;return Bd("",{pathname:c,search:d,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function r(u,o){return typeof o=="string"?o:rl(o)}return xS(l,r,null,n)}function Ze(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function hn(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function bS(){return Math.random().toString(36).substring(2,10)}function w0(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Bd(n,l,r=null,u,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?di(l):l,state:r,key:l&&l.key||u||bS(),mask:o}}function rl({pathname:n="/",search:l="",hash:r=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),r&&r!=="#"&&(n+=r.charAt(0)==="#"?r:"#"+r),n}function di(n){let l={};if(n){let r=n.indexOf("#");r>=0&&(l.hash=n.substring(r),n=n.substring(0,r));let u=n.indexOf("?");u>=0&&(l.search=n.substring(u),n=n.substring(0,u)),n&&(l.pathname=n)}return l}function xS(n,l,r,u={}){let{window:o=document.defaultView,v5Compat:s=!1}=u,c=o.history,d="POP",h=null,g=p();g==null&&(g=0,c.replaceState({...c.state,idx:g},""));function p(){return(c.state||{idx:null}).idx}function y(){d="POP";let w=p(),S=w==null?null:w-g;g=w,h&&h({action:d,location:N.location,delta:S})}function v(w,S){d="PUSH";let C=S0(w)?w:Bd(N.location,w,S);g=p()+1;let _=w0(C,g),M=N.createHref(C.mask||C);try{c.pushState(_,"",M)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;o.location.assign(M)}s&&h&&h({action:d,location:N.location,delta:1})}function b(w,S){d="REPLACE";let C=S0(w)?w:Bd(N.location,w,S);g=p();let _=w0(C,g),M=N.createHref(C.mask||C);c.replaceState(_,"",M),s&&h&&h({action:d,location:N.location,delta:0})}function E(w){return ES(o,w)}let N={get action(){return d},get location(){return n(o,c)},listen(w){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(E0,y),h=w,()=>{o.removeEventListener(E0,y),h=null}},createHref(w){return l(o,w)},createURL:E,encodeLocation(w){let S=E(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:b,go(w){return c.go(w)}};return N}function ES(n,l,r=!1){let u="http://localhost";n&&(u=n.location.origin!=="null"?n.location.origin:n.location.href),Ze(u,"No window.location.(origin|href) available to create URL");let o=typeof l=="string"?l:rl(l);return o=o.replace(/ $/,"%20"),!r&&Hv.test(o)&&(o=u+o),new URL(o,u)}function Bv(n,l,r="/"){return SS(n,l,r,!1)}function SS(n,l,r,u,o){let s=typeof l=="string"?di(l):l,c=Fn(s.pathname||"/",r);if(c==null)return null;let d=wS(n),h=null,g=jS(c);for(let p=0;h==null&&p<d.length;++p)h=DS(d[p],g,u);return h}function wS(n){let l=Uv(n);return _S(l),l}function Uv(n,l=[],r=[],u="",o=!1){let s=(c,d,h=o,g)=>{let p={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(u)&&h)return;Ze(p.relativePath.startsWith(u),`Absolute route path "${p.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(u.length)}let y=dn([u,p.relativePath]),v=r.concat(p);c.children&&c.children.length>0&&(Ze(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Uv(c.children,l,v,y,h)),!(c.path==null&&!c.index)&&l.push({path:y,score:zS(y,c.index),routesMeta:v.map((b,E)=>{let[N,w]=Yv(b.relativePath,b.caseSensitive,E===v.length-1);return{...b,matcher:N,compiledParams:w}})})};return n.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))s(c,d);else for(let g of qv(c.path))s(c,d,!0,g)}),l}function qv(n){let l=n.split("/");if(l.length===0)return[];let[r,...u]=l,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(u.length===0)return o?[s,""]:[s];let c=qv(u.join("/")),d=[];return d.push(...c.map(h=>h===""?s:[s,h].join("/"))),o&&d.push(...c),d.map(h=>n.startsWith("/")&&h===""?"/":h)}function _S(n){n.sort((l,r)=>l.score!==r.score?r.score-l.score:OS(l.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var NS=/^:[\w-]+$/,CS=3,MS=2,TS=1,AS=10,RS=-2,_0=n=>n==="*";function zS(n,l){let r=n.split("/"),u=r.length;return r.some(_0)&&(u+=RS),l&&(u+=MS),r.filter(o=>!_0(o)).reduce((o,s)=>o+(NS.test(s)?CS:s===""?TS:AS),u)}function OS(n,l){return n.length===l.length&&n.slice(0,-1).every((u,o)=>u===l[o])?n[n.length-1]-l[l.length-1]:0}function DS(n,l,r=!1){let{routesMeta:u}=n,o={},s="/",c=[];for(let d=0;d<u.length;++d){let h=u[d],g=d===u.length-1,p=s==="/"?l:l.slice(s.length)||"/",y={path:h.relativePath,caseSensitive:h.caseSensitive,end:g},v=h.matcher&&h.compiledParams?kv(y,p,h.matcher,h.compiledParams):Ao(y,p),b=h.route;if(!v&&g&&r&&!u[u.length-1].route.index&&(v=Ao({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},p)),!v)return null;Object.assign(o,v.params),c.push({params:o,pathname:dn([s,v.pathname]),pathnameBase:BS(dn([s,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(s=dn([s,v.pathnameBase]))}return c}function Ao(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[r,u]=Yv(n.path,n.caseSensitive,n.end);return kv(n,l,r,u)}function kv(n,l,r,u){let o=l.match(r);if(!o)return null;let s=o[0],c=li(s,1),d=o.slice(1);return{params:u.reduce((g,{paramName:p,isOptional:y},v)=>{if(p==="*"){let E=d[v]||"";c=li(s.slice(0,s.length-E.length),1)}const b=d[v];return y&&!b?g[p]=void 0:g[p]=(b||"").replace(/%2F/g,"/"),g},{}),pathname:s,pathnameBase:c,pattern:n}}function Yv(n,l=!1,r=!0){hn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let u=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h,g,p)=>{if(u.push({paramName:d,isOptional:h!=null}),h){let y=p.charAt(g+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(u.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),u]}function jS(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return hn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Fn(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let r=l.endsWith("/")?l.length-1:l.length,u=n.charAt(r);return u&&u!=="/"?null:n.slice(r)||"/"}function LS(n,l="/"){let{pathname:r,search:u="",hash:o=""}=typeof n=="string"?di(n):n,s;return r?(r=Vv(r),r.startsWith("/")||r.startsWith("\\")?s=N0(r.substring(1),"/"):s=N0(r,l)):s=l,{pathname:s,search:US(u),hash:qS(o)}}function N0(n,l){let r=li(l).split("/");return n.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Cf(n,l,r,u){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function HS(n){return n.filter((l,r)=>r===0||l.route.path&&l.route.path.length>0)}function th(n){let l=HS(n);return l.map((r,u)=>u===l.length-1?r.pathname:r.pathnameBase)}function Yo(n,l,r,u=!1){let o;typeof n=="string"?o=di(n):(o={...n},Ze(!o.pathname||!o.pathname.includes("?"),Cf("?","pathname","search",o)),Ze(!o.pathname||!o.pathname.includes("#"),Cf("#","pathname","hash",o)),Ze(!o.search||!o.search.includes("#"),Cf("#","search","hash",o)));let s=n===""||o.pathname==="",c=s?"/":o.pathname,d;if(c==null)d=r;else{let y=l.length-1;if(!u&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),y-=1;o.pathname=v.join("/")}d=y>=0?l[y]:"/"}let h=LS(o,d),g=c&&c!=="/"&&c.endsWith("/"),p=(s||c===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(g||p)&&(h.pathname+="/"),h}var Vv=n=>n.replace(/[\\/]{2,}/g,"/"),dn=n=>Vv(n.join("/"));function li(n,l=0){let r=n.length;for(;r>l&&n.charCodeAt(r-1)===47;)r--;return r===n.length?n:n.slice(0,r)}var BS=n=>li(n).replace(/^\/*/,"/"),US=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,qS=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,kS=class{constructor(n,l,r,u=!1){this.status=n,this.statusText=l||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function YS(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function VS(n){let l=n.map(r=>r.route.path).filter(Boolean);return dn(l)||"/"}var Gv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xv(n,l){let r=n;if(typeof r!="string"||!eh.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,o=!1;if(Gv)try{let s=new URL(window.location.href),c=Hv.test(r)?new URL(yS(r,s.protocol)):new URL(r),d=Fn(c.pathname,l);c.origin===s.origin&&d!=null?r=d+c.search+c.hash:o=!0}catch{hn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var C0=new URL("http://localhost");function nh(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),C0)}catch{return C0}}function Mf(n,l){return n.origin===l.origin&&(n.origin!=="null"||n.protocol===l.protocol&&n.host===l.host)}function GS(n,l){if(n.startsWith("//"))return!0;let r=l.protocol.toLowerCase();return n.toLowerCase().startsWith(r)?l.host===""||n.slice(r.length).startsWith("//"):!1}function ah(n,l,r,u){let o=null;try{o=n==null?null:new URL(n,r)}catch{}let s=new URL(l,r),c=o!=null&&!Mf(o,r),d=!Mf(s,r);if(u==="reject"){if(c||d)throw new Error("External navigation is not allowed")}else if(d&&(o==null||!GS(n,o)||!Mf(o,s)))throw new Error("External navigation is not allowed")}var $v=["POST","PUT","PATCH","DELETE"];new Set($v);var XS=["GET",...$v];new Set(XS);var $S=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function QS(n){try{return $S.includes(new URL(n).protocol)}catch{return!1}}var hi=j.createContext(null);hi.displayName="DataRouter";var Vo=j.createContext(null);Vo.displayName="DataRouterState";var Qv=j.createContext(!1);function ZS(){return j.useContext(Qv)}var Zv=j.createContext({isTransitioning:!1});Zv.displayName="ViewTransition";var KS=j.createContext(new Map);KS.displayName="Fetchers";var IS=j.createContext(null);IS.displayName="Await";var Gt=j.createContext(null);Gt.displayName="Navigation";var Dr=j.createContext(null);Dr.displayName="Location";var nn=j.createContext({outlet:null,matches:[],isDataRoute:!1});nn.displayName="Route";var lh=j.createContext(null);lh.displayName="RouteError";var Kv="REACT_ROUTER_ERROR",JS="REDIRECT",FS="ROUTE_ERROR_RESPONSE";function WS(n){if(n.startsWith(`${Kv}:${JS}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function PS(n){if(n.startsWith(`${Kv}:${FS}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new kS(l.status,l.statusText,l.data)}catch{}}function ew(n,{relative:l}={}){Ze(mi(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=j.useContext(Gt),{hash:o,pathname:s,search:c}=jr(n,{relative:l}),d=s;return r!=="/"&&(d=s==="/"?r:dn([r,s])),u.createHref({pathname:d,search:c,hash:o})}function mi(){return j.useContext(Dr)!=null}function Cn(){return Ze(mi(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Dr).location}var Iv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jv(n){j.useContext(Gt).static||j.useLayoutEffect(n)}function Fv(){let{isDataRoute:n}=j.useContext(nn);return n?pw():tw()}function tw(){Ze(mi(),"useNavigate() may be used only in the context of a <Router> component.");let n=j.useContext(hi),{basename:l,navigator:r}=j.useContext(Gt),{matches:u}=j.useContext(nn),{pathname:o}=Cn(),s=JSON.stringify(th(u)),c=j.useRef(!1);return Jv(()=>{c.current=!0}),j.useCallback((h,g={})=>{if(hn(c.current,Iv),!c.current)return;if(typeof h=="number"){r.go(h);return}let p=Yo(h,JSON.parse(s),o,g.relative==="path");n==null&&l!=="/"&&(p.pathname=p.pathname==="/"?l:dn([l,p.pathname])),ah(typeof h=="string"?h:rl(h),r.createHref(p),nh(r),"reject"),(g.replace?r.replace:r.push)(p,g.state,g)},[l,r,s,o,n])}var nw=j.createContext(null);function aw(n){let l=j.useContext(nn).outlet;return j.useMemo(()=>l&&j.createElement(nw.Provider,{value:n},l),[l,n])}function lw(){let{matches:n}=j.useContext(nn),l=n[n.length-1];return(l==null?void 0:l.params)??{}}function jr(n,{relative:l}={}){let{matches:r}=j.useContext(nn),{pathname:u}=Cn(),o=JSON.stringify(th(r));return j.useMemo(()=>Yo(n,JSON.parse(o),u,l==="path"),[n,o,u,l])}function iw(n,l){return Wv(n,l)}function Wv(n,l,r){var w;Ze(mi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(Gt),{matches:o}=j.useContext(nn),s=o[o.length-1],c=s?s.params:{},d=s?s.pathname:"/",h=s?s.pathnameBase:"/",g=s&&s.route;{let S=g&&g.path||"";e1(d,!g||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=Cn(),y;if(l){let S=typeof l=="string"?di(l):l;Ze(h==="/"||((w=S.pathname)==null?void 0:w.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${S.pathname}" was given in the \`location\` prop.`),y=S}else y=p;let v=y.pathname||"/",b=v;if(h!=="/"){let S=h.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=r&&r.state.matches.length?r.state.matches.map(S=>Object.assign(S,{route:r.manifest[S.route.id]||S.route})):Bv(n,{pathname:b});hn(g||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),hn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=cw(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:dn([h,u.encodeLocation?u.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:dn([h,u.encodeLocation?u.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,r);return l&&N?j.createElement(Dr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},N):N}function rw(){let n=gw(),l=YS(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),r=n instanceof Error?n.stack:null,u="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:u},s={padding:"2px 4px",backgroundColor:u},c=null;return console.error("Error handled by React Router default ErrorBoundary:",n),c=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:s},"ErrorBoundary")," or"," ",j.createElement("code",{style:s},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},l),r?j.createElement("pre",{style:o},r):null,c)}var uw=j.createElement(rw,null),Pv=class extends j.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const r=PS(n.digest);r&&(n=r)}let l=n!==void 0?j.createElement(nn.Provider,{value:this.props.routeContext},j.createElement(lh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?j.createElement(ow,{error:n},l):l}};Pv.contextType=Qv;var Tf=new WeakMap;function ow({children:n,error:l}){let{basename:r,navigator:u}=j.useContext(Gt);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let o=WS(l.digest);if(o){let s=Tf.get(l);if(s)throw s;let c=Xv(o.location,r),d=c.absoluteURL||c.to;if(ah(o.location,d,nh(u),"allow-explicit"),QS(d))throw new Error("Invalid redirect location");if(Gv&&!Tf.get(l))if(c.isExternal||o.reloadDocument)window.location.href=d;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw Tf.set(l,h),h}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return n}function sw({routeContext:n,match:l,children:r}){let u=j.useContext(hi);return u&&u.static&&u.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=l.route.id),j.createElement(nn.Provider,{value:n},r)}function cw(n,l=[],r){let u=r==null?void 0:r.state;if(n==null){if(!u)return null;if(u.errors)n=u.matches;else if(l.length===0&&!u.initialized&&u.matches.length>0)n=u.matches;else return null}let o=n,s=u==null?void 0:u.errors;if(s!=null){let p=o.findIndex(y=>y.route.id&&(s==null?void 0:s[y.route.id])!==void 0);Ze(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let c=!1,d=-1;if(r&&u){c=u.renderFallback;for(let p=0;p<o.length;p++){let y=o[p];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(d=p),y.route.id){let{loaderData:v,errors:b}=u,E=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||E){r.isStatic&&(c=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let h=r==null?void 0:r.onError,g=u&&h?(p,y)=>{var v,b;h(p,{location:u.location,params:((b=(v=u.matches)==null?void 0:v[0])==null?void 0:b.params)??{},pattern:VS(u.matches),errorInfo:y})}:void 0;return o.reduceRight((p,y,v)=>{let b,E=!1,N=null,w=null;u&&(b=s&&y.route.id?s[y.route.id]:void 0,N=y.route.errorElement||uw,c&&(d<0&&v===0?(e1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,w=null):d===v&&(E=!0,w=y.route.hydrateFallbackElement||null)));let S=l.concat(o.slice(0,v+1)),C=()=>{let _;return b?_=N:E?_=w:y.route.Component?_=j.createElement(y.route.Component,null):y.route.element?_=y.route.element:_=p,j.createElement(sw,{match:y,routeContext:{outlet:p,matches:S,isDataRoute:u!=null},children:_})};return u&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?j.createElement(Pv,{location:u.location,revalidation:u.revalidation,component:N,error:b,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:g}):C()},null)}function ih(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fw(n){let l=j.useContext(hi);return Ze(l,ih(n)),l}function dw(n){let l=j.useContext(Vo);return Ze(l,ih(n)),l}function hw(n){let l=j.useContext(nn);return Ze(l,ih(n)),l}function rh(n){let l=hw(n),r=l.matches[l.matches.length-1];return Ze(r.route.id,`${n} can only be used on routes that contain a unique "id"`),r.route.id}function mw(){return rh("useRouteId")}function gw(){var u;let n=j.useContext(lh),l=dw("useRouteError"),r=rh("useRouteError");return n!==void 0?n:(u=l.errors)==null?void 0:u[r]}function pw(){let{router:n}=fw("useNavigate"),l=rh("useNavigate"),r=j.useRef(!1);return Jv(()=>{r.current=!0}),j.useCallback(async(o,s={})=>{hn(r.current,Iv),r.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...s}))},[n,l])}var M0={};function e1(n,l,r){!l&&!M0[n]&&(M0[n]=!0,hn(!1,r))}j.memo(yw);function yw({routes:n,manifest:l,future:r,state:u,isStatic:o,onError:s}){return Wv(n,void 0,{manifest:l,state:u,isStatic:o,onError:s})}function T0({to:n,replace:l,state:r,relative:u}){Ze(mi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=j.useContext(Gt);hn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=j.useContext(nn),{pathname:d}=Cn(),h=Fv(),g=Yo(n,th(c),d,u==="path");ah(typeof n=="string"?n:rl(n),s.createHref(g),nh(s),"reject");let p=JSON.stringify(g);return j.useEffect(()=>{h(JSON.parse(p),{replace:l,state:r,relative:u})},[h,p,u,l,r]),null}function vw(n){return aw(n.context)}function tl(n){Ze(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function bw({basename:n="/",children:l=null,location:r,navigationType:u="POP",navigator:o,static:s=!1,useTransitions:c}){Ze(!mi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=n.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:d,navigator:o,static:s,useTransitions:c,future:{}}),[d,o,s,c]);typeof r=="string"&&(r=di(r));let{pathname:g="/",search:p="",hash:y="",state:v=null,key:b="default",mask:E}=r,N=j.useMemo(()=>{let w=Fn(g,d);return w==null?null:{location:{pathname:w,search:p,hash:y,state:v,key:b,mask:E},navigationType:u}},[d,g,p,y,v,b,u,E]);return hn(N!=null,`<Router basename="${d}"> is not able to match the URL "${g}${p}${y}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:j.createElement(Gt.Provider,{value:h},j.createElement(Dr.Provider,{children:l,value:N}))}function xw({children:n,location:l}){return iw(Ud(n),l)}function Ud(n,l=[]){let r=[];return j.Children.forEach(n,(u,o)=>{if(!j.isValidElement(u))return;let s=[...l,o];if(u.type===j.Fragment){r.push.apply(r,Ud(u.props.children,s));return}Ze(u.type===tl,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ze(!u.props.index||!u.props.children,"An index route cannot have child routes.");let c={id:u.props.id||s.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(c.children=Ud(u.props.children,s)),r.push(c)}),r}var Eo="get",So="application/x-www-form-urlencoded";function Go(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function Ew(n){return Go(n)&&n.tagName.toLowerCase()==="button"}function Sw(n){return Go(n)&&n.tagName.toLowerCase()==="form"}function ww(n){return Go(n)&&n.tagName.toLowerCase()==="input"}function _w(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Nw(n,l){return n.button===0&&(!l||l==="_self")&&!_w(n)}var so=null;function Cw(){if(so===null)try{new FormData(document.createElement("form"),0),so=!1}catch{so=!0}return so}var Mw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Af(n){return n!=null&&!Mw.has(n)?(hn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${So}"`),null):n}function Tw(n,l){let r,u,o,s,c;if(Sw(n)){let d=n.getAttribute("action");u=d?Fn(d,l):null,r=n.getAttribute("method")||Eo,o=Af(n.getAttribute("enctype"))||So,s=new FormData(n)}else if(Ew(n)||ww(n)&&(n.type==="submit"||n.type==="image")){let d=n.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=n.getAttribute("formaction")||d.getAttribute("action");if(u=h?Fn(h,l):null,r=n.getAttribute("formmethod")||d.getAttribute("method")||Eo,o=Af(n.getAttribute("formenctype"))||Af(d.getAttribute("enctype"))||So,s=new FormData(d,n),!Cw()){let{name:g,type:p,value:y}=n;if(p==="image"){let v=g?`${g}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else g&&s.append(g,y)}}else{if(Go(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Eo,u=null,o=So,c=n}return s&&o==="text/plain"&&(c=s,s=void 0),{action:u,method:r.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uh(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function t1(n,l,r,u){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${u}`:o.pathname=`${o.pathname}.${u}`:o.pathname==="/"?o.pathname=`_root.${u}`:l&&Fn(o.pathname,l)==="/"?o.pathname=`${li(l)}/_root.${u}`:o.pathname=`${li(o.pathname)}.${u}`,o}async function Aw(n,l){if(n.id in l)return l[n.id];try{let r=await import(n.module);return l[n.id]=r,r}catch(r){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function zw(n,l,r){let u=await Promise.all(n.map(async o=>{let s=l.routes[o.route.id];if(s){let c=await Aw(s,r);return c.links?c.links():[]}return[]}));return Lw(u.flat(1).filter(Rw).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function A0(n,l,r,u,o,s){let c=(h,g)=>r[g]?h.route.id!==r[g].route.id:!0,d=(h,g)=>{var p;return r[g].pathname!==h.pathname||((p=r[g].route.path)==null?void 0:p.endsWith("*"))&&r[g].params["*"]!==h.params["*"]};return s==="assets"?l.filter((h,g)=>c(h,g)||d(h,g)):s==="data"?l.filter((h,g)=>{var y;let p=u.routes[h.route.id];if(!p||!p.hasLoader)return!1;if(c(h,g)||d(h,g))return!0;if(h.route.shouldRevalidate){let v=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=r[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function Ow(n,l,{includeHydrateFallback:r}={}){return Dw(n.map(u=>{let o=l.routes[u.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function Dw(n){return[...new Set(n)]}function jw(n){let l={},r=Object.keys(n).sort();for(let u of r)l[u]=n[u];return l}function Lw(n,l){let r=new Set;return new Set(l),n.reduce((u,o)=>{let s=JSON.stringify(jw(o));return r.has(s)||(r.add(s),u.push({key:s,link:o})),u},[])}function oh(){let n=j.useContext(hi);return uh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Hw(){let n=j.useContext(Vo);return uh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var sh=j.createContext(void 0);sh.displayName="FrameworkContext";function Xo(){let n=j.useContext(sh);return uh(n,"You must render this element inside a <HydratedRouter> element"),n}function Bw(n,l){let r=j.useContext(sh),[u,o]=j.useState(!1),[s,c]=j.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:g,onMouseLeave:p,onTouchStart:y}=l,v=j.useRef(null);j.useEffect(()=>{if(n==="render"&&c(!0),n==="viewport"){let N=S=>{S.forEach(C=>{c(C.isIntersecting)})},w=new IntersectionObserver(N,{threshold:.5});return v.current&&w.observe(v.current),()=>{w.disconnect()}}},[n]),j.useEffect(()=>{if(u){let N=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(N)}}},[u]);let b=()=>{o(!0)},E=()=>{o(!1),c(!1)};return r?n!=="intent"?[s,v,{}]:[s,v,{onFocus:mr(d,b),onBlur:mr(h,E),onMouseEnter:mr(g,b),onMouseLeave:mr(p,E),onTouchStart:mr(y,b)}]:[!1,v,{}]}function mr(n,l){return r=>{n&&n(r),r.defaultPrevented||l(r)}}function Uw({page:n,...l}){let r=ZS(),{nonce:u}=Xo(),{router:o}=oh(),s=j.useMemo(()=>Bv(o.routes,n,o.basename),[o.routes,n,o.basename]);return s?(l.nonce==null&&u&&(l={...l,nonce:u}),r?j.createElement(kw,{page:n,matches:s,...l}):j.createElement(Yw,{page:n,matches:s,...l})):null}function qw(n){let{manifest:l,routeModules:r}=Xo(),[u,o]=j.useState([]);return j.useEffect(()=>{let s=!1;return zw(n,l,r).then(c=>{s||o(c)}),()=>{s=!0}},[n,l,r]),u}function kw({page:n,matches:l,...r}){let u=Cn(),{future:o}=Xo(),{basename:s}=oh(),c=j.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let d=t1(n,s,o.v8_trailingSlashAwareDataRequests,"rsc"),h=!1,g=[];for(let p of l)typeof p.route.shouldRevalidate=="function"?h=!0:g.push(p.route.id);return h&&g.length>0&&d.searchParams.set("_routes",g.join(",")),[d.pathname+d.search]},[s,o.v8_trailingSlashAwareDataRequests,n,u,l]);return j.createElement(j.Fragment,null,c.map(d=>j.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...r})))}function Yw({page:n,matches:l,...r}){let u=Cn(),{future:o,manifest:s,routeModules:c}=Xo(),{basename:d}=oh(),{loaderData:h,matches:g}=Hw(),p=j.useMemo(()=>A0(n,l,g,s,u,"data"),[n,l,g,s,u]),y=j.useMemo(()=>A0(n,l,g,s,u,"assets"),[n,l,g,s,u]),v=j.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let N=new Set,w=!1;if(l.forEach(C=>{var M;let _=s.routes[C.route.id];!_||!_.hasLoader||(!p.some(B=>B.route.id===C.route.id)&&C.route.id in h&&((M=c[C.route.id])!=null&&M.shouldRevalidate)||_.hasClientLoader?w=!0:N.add(C.route.id))}),N.size===0)return[];let S=t1(n,d,o.v8_trailingSlashAwareDataRequests,"data");return w&&N.size>0&&S.searchParams.set("_routes",l.filter(C=>N.has(C.route.id)).map(C=>C.route.id).join(",")),[S.pathname+S.search]},[d,o.v8_trailingSlashAwareDataRequests,h,u,s,p,l,n,c]),b=j.useMemo(()=>Ow(y,s),[y,s]),E=qw(y);return j.createElement(j.Fragment,null,v.map(N=>j.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...r})),b.map(N=>j.createElement("link",{key:N,rel:"modulepreload",href:N,...r})),E.map(({key:N,link:w})=>j.createElement("link",{key:N,nonce:r.nonce,...w,crossOrigin:w.crossOrigin??r.crossOrigin})))}function Vw(...n){return l=>{n.forEach(r=>{typeof r=="function"?r(l):r!=null&&(r.current=l)})}}var Gw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Gw&&(window.__reactRouterVersion="7.18.3")}catch{}function Xw({basename:n,children:l,useTransitions:r,window:u}){let o=j.useRef();o.current==null&&(o.current=vS({window:u,v5Compat:!0}));let s=o.current,[c,d]=j.useState({action:s.action,location:s.location}),h=j.useCallback(g=>{r===!1?d(g):j.startTransition(()=>d(g))},[r]);return j.useLayoutEffect(()=>s.listen(h),[s,h]),j.createElement(bw,{basename:n,children:l,location:c.location,navigationType:c.action,navigator:s,useTransitions:r})}var $o=j.forwardRef(function({onClick:l,discover:r="render",prefetch:u="none",relative:o,reloadDocument:s,replace:c,mask:d,state:h,target:g,to:p,preventScrollReset:y,viewTransition:v,defaultShouldRevalidate:b,...E},N){let{basename:w,navigator:S,useTransitions:C}=j.useContext(Gt),_=typeof p=="string"&&eh.test(p),M=Xv(p,w);p=M.to;let B=ew(p,{relative:o}),L=Cn(),U=null;if(d){let Z=Yo(d,[],L.mask?L.mask.pathname:"/",!0);w!=="/"&&(Z.pathname=Z.pathname==="/"?w:dn([w,Z.pathname])),U=S.createHref(Z)}let[O,H,$]=Bw(u,E),k=Zw(p,{replace:c,mask:d,state:h,target:g,preventScrollReset:y,relative:o,viewTransition:v,defaultShouldRevalidate:b,useTransitions:C});function Q(Z){l&&l(Z),Z.defaultPrevented||k(Z)}let P=!(M.isExternal||s),R=j.createElement("a",{...E,...$,href:(P?U:void 0)||M.absoluteURL||B,onClick:P?Q:l,ref:Vw(N,H),target:g,"data-discover":!_&&r==="render"?"true":void 0});return O&&!_?j.createElement(j.Fragment,null,R,j.createElement(Uw,{page:B})):R});$o.displayName="Link";var n1=j.forwardRef(function({"aria-current":l="page",caseSensitive:r=!1,className:u="",end:o=!1,style:s,to:c,viewTransition:d,children:h,...g},p){let y=jr(c,{relative:g.relative}),v=Cn(),b=j.useContext(Vo),{navigator:E,basename:N}=j.useContext(Gt),w=b!=null&&Ww(y)&&d===!0,S=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,C=v.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(C=C.toLowerCase(),_=_?_.toLowerCase():null,S=S.toLowerCase()),_&&N&&(_=Fn(_,N)||_);const M=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let B=C===S||!o&&C.startsWith(S)&&C.charAt(M)==="/",L=_!=null&&(_===S||!o&&_.startsWith(S)&&_.charAt(S.length)==="/"),U={isActive:B,isPending:L,isTransitioning:w},O=B?l:void 0,H;typeof u=="function"?H=u(U):H=[u,B?"active":null,L?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let $=typeof s=="function"?s(U):s;return j.createElement($o,{...g,"aria-current":O,className:H,ref:p,style:$,to:c,viewTransition:d},typeof h=="function"?h(U):h)});n1.displayName="NavLink";var $w=j.forwardRef(({discover:n="render",fetcherKey:l,navigate:r,reloadDocument:u,replace:o,state:s,method:c=Eo,action:d,onSubmit:h,relative:g,preventScrollReset:p,viewTransition:y,defaultShouldRevalidate:v,...b},E)=>{let{useTransitions:N}=j.useContext(Gt),w=Jw(),S=Fw(d,{relative:g}),C=c.toLowerCase()==="get"?"get":"post",_=typeof d=="string"&&eh.test(d),M=B=>{if(h&&h(B),B.defaultPrevented)return;B.preventDefault();let L=B.nativeEvent.submitter,U=(L==null?void 0:L.getAttribute("formmethod"))||c,O=()=>w(L||B.currentTarget,{fetcherKey:l,method:U,navigate:r,replace:o,state:s,relative:g,preventScrollReset:p,viewTransition:y,defaultShouldRevalidate:v});N&&r!==!1?j.startTransition(()=>O()):O()};return j.createElement("form",{ref:E,method:C,action:S,onSubmit:u?h:M,...b,"data-discover":!_&&n==="render"?"true":void 0})});$w.displayName="Form";function Qw(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a1(n){let l=j.useContext(hi);return Ze(l,Qw(n)),l}function Zw(n,{target:l,replace:r,mask:u,state:o,preventScrollReset:s,relative:c,viewTransition:d,defaultShouldRevalidate:h,useTransitions:g}={}){let p=Fv(),y=Cn(),v=jr(n,{relative:c});return j.useCallback(b=>{if(Nw(b,l)){b.preventDefault();let E=r!==void 0?r:rl(y)===rl(v),N=()=>p(n,{replace:E,mask:u,state:o,preventScrollReset:s,relative:c,viewTransition:d,defaultShouldRevalidate:h});g?j.startTransition(()=>N()):N()}},[y,p,v,r,u,o,l,n,s,c,d,h,g])}var Kw=0,Iw=()=>`__${String(++Kw)}__`;function Jw(){let{router:n}=a1("useSubmit"),{basename:l}=j.useContext(Gt),r=mw(),u=n.fetch,o=n.navigate;return j.useCallback(async(s,c={})=>{let{action:d,method:h,encType:g,formData:p,body:y}=Tw(s,l);if(c.navigate===!1){let v=c.fetcherKey||Iw();await u(v,r,c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,body:y,formMethod:c.method||h,formEncType:c.encType||g,flushSync:c.flushSync})}else await o(c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,body:y,formMethod:c.method||h,formEncType:c.encType||g,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[u,o,l,r])}function Fw(n,{relative:l}={}){let{basename:r}=j.useContext(Gt),u=j.useContext(nn);Ze(u,"useFormAction must be used inside a RouteContext");let[o]=u.matches.slice(-1),s={...jr(n||".",{relative:l})},c=Cn();if(n==null){s.search=c.search;let d=new URLSearchParams(s.search),h=d.getAll("index");if(h.some(p=>p==="")){d.delete("index"),h.filter(y=>y).forEach(y=>d.append("index",y));let p=d.toString();s.search=p?`?${p}`:""}}return(!n||n===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:dn([r,s.pathname])),rl(s)}function Ww(n,{relative:l}={}){let r=j.useContext(Zv);Ze(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=a1("useViewTransitionState"),o=jr(n,{relative:l});if(!r.isTransitioning)return!1;let s=Fn(r.currentLocation.pathname,u)||r.currentLocation.pathname,c=Fn(r.nextLocation.pathname,u)||r.nextLocation.pathname;return Ao(o.pathname,c)!=null||Ao(o.pathname,s)!=null}Lv();const Pw=[{to:"/flow",label:"Flow"},{to:"/conversations",label:"Conversations"}];function e_(){return A.jsxs("div",{className:"studio-shell",children:[A.jsxs("header",{className:"studio-topbar",children:[A.jsxs("div",{className:"studio-brand",children:[A.jsx("strong",{children:"Vapi Studio"}),A.jsx("span",{className:"studio-brand-meta",children:"operator"})]}),A.jsx("nav",{className:"studio-nav","aria-label":"Studio",children:Pw.map(n=>A.jsx(n1,{to:n.to,className:({isActive:l})=>l?"studio-nav-link is-active":"studio-nav-link",end:n.to==="/flow",children:n.label},n.to))})]}),A.jsx("div",{className:"studio-outlet",children:A.jsx(vw,{})})]})}function ut(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let r=0,u;r<n.length;r++)(u=ut(n[r]))!==""&&(l+=(l&&" ")+u);else for(let r in n)n[r]&&(l+=(l&&" ")+r);return l}var t_={value:()=>{}};function Qo(){for(var n=0,l=arguments.length,r={},u;n<l;++n){if(!(u=arguments[n]+"")||u in r||/[\s.]/.test(u))throw new Error("illegal type: "+u);r[u]=[]}return new wo(r)}function wo(n){this._=n}function n_(n,l){return n.trim().split(/^|\s+/).map(function(r){var u="",o=r.indexOf(".");if(o>=0&&(u=r.slice(o+1),r=r.slice(0,o)),r&&!l.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:u}})}wo.prototype=Qo.prototype={constructor:wo,on:function(n,l){var r=this._,u=n_(n+"",r),o,s=-1,c=u.length;if(arguments.length<2){for(;++s<c;)if((o=(n=u[s]).type)&&(o=a_(r[o],n.name)))return o;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++s<c;)if(o=(n=u[s]).type)r[o]=R0(r[o],n.name,l);else if(l==null)for(o in r)r[o]=R0(r[o],n.name,null);return this},copy:function(){var n={},l=this._;for(var r in l)n[r]=l[r].slice();return new wo(n)},call:function(n,l){if((o=arguments.length-2)>0)for(var r=new Array(o),u=0,o,s;u<o;++u)r[u]=arguments[u+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(s=this._[n],u=0,o=s.length;u<o;++u)s[u].value.apply(l,r)},apply:function(n,l,r){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var u=this._[n],o=0,s=u.length;o<s;++o)u[o].value.apply(l,r)}};function a_(n,l){for(var r=0,u=n.length,o;r<u;++r)if((o=n[r]).name===l)return o.value}function R0(n,l,r){for(var u=0,o=n.length;u<o;++u)if(n[u].name===l){n[u]=t_,n=n.slice(0,u).concat(n.slice(u+1));break}return r!=null&&n.push({name:l,value:r}),n}var qd="http://www.w3.org/1999/xhtml";const z0={svg:"http://www.w3.org/2000/svg",xhtml:qd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zo(n){var l=n+="",r=l.indexOf(":");return r>=0&&(l=n.slice(0,r))!=="xmlns"&&(n=n.slice(r+1)),z0.hasOwnProperty(l)?{space:z0[l],local:n}:n}function l_(n){return function(){var l=this.ownerDocument,r=this.namespaceURI;return r===qd&&l.documentElement.namespaceURI===qd?l.createElement(n):l.createElementNS(r,n)}}function i_(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function l1(n){var l=Zo(n);return(l.local?i_:l_)(l)}function r_(){}function ch(n){return n==null?r_:function(){return this.querySelector(n)}}function u_(n){typeof n!="function"&&(n=ch(n));for(var l=this._groups,r=l.length,u=new Array(r),o=0;o<r;++o)for(var s=l[o],c=s.length,d=u[o]=new Array(c),h,g,p=0;p<c;++p)(h=s[p])&&(g=n.call(h,h.__data__,p,s))&&("__data__"in h&&(g.__data__=h.__data__),d[p]=g);return new Vt(u,this._parents)}function o_(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function s_(){return[]}function i1(n){return n==null?s_:function(){return this.querySelectorAll(n)}}function c_(n){return function(){return o_(n.apply(this,arguments))}}function f_(n){typeof n=="function"?n=c_(n):n=i1(n);for(var l=this._groups,r=l.length,u=[],o=[],s=0;s<r;++s)for(var c=l[s],d=c.length,h,g=0;g<d;++g)(h=c[g])&&(u.push(n.call(h,h.__data__,g,c)),o.push(h));return new Vt(u,o)}function r1(n){return function(){return this.matches(n)}}function u1(n){return function(l){return l.matches(n)}}var d_=Array.prototype.find;function h_(n){return function(){return d_.call(this.children,n)}}function m_(){return this.firstElementChild}function g_(n){return this.select(n==null?m_:h_(typeof n=="function"?n:u1(n)))}var p_=Array.prototype.filter;function y_(){return Array.from(this.children)}function v_(n){return function(){return p_.call(this.children,n)}}function b_(n){return this.selectAll(n==null?y_:v_(typeof n=="function"?n:u1(n)))}function x_(n){typeof n!="function"&&(n=r1(n));for(var l=this._groups,r=l.length,u=new Array(r),o=0;o<r;++o)for(var s=l[o],c=s.length,d=u[o]=[],h,g=0;g<c;++g)(h=s[g])&&n.call(h,h.__data__,g,s)&&d.push(h);return new Vt(u,this._parents)}function o1(n){return new Array(n.length)}function E_(){return new Vt(this._enter||this._groups.map(o1),this._parents)}function Ro(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}Ro.prototype={constructor:Ro,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,l){return this._parent.insertBefore(n,l)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function S_(n){return function(){return n}}function w_(n,l,r,u,o,s){for(var c=0,d,h=l.length,g=s.length;c<g;++c)(d=l[c])?(d.__data__=s[c],u[c]=d):r[c]=new Ro(n,s[c]);for(;c<h;++c)(d=l[c])&&(o[c]=d)}function __(n,l,r,u,o,s,c){var d,h,g=new Map,p=l.length,y=s.length,v=new Array(p),b;for(d=0;d<p;++d)(h=l[d])&&(v[d]=b=c.call(h,h.__data__,d,l)+"",g.has(b)?o[d]=h:g.set(b,h));for(d=0;d<y;++d)b=c.call(n,s[d],d,s)+"",(h=g.get(b))?(u[d]=h,h.__data__=s[d],g.delete(b)):r[d]=new Ro(n,s[d]);for(d=0;d<p;++d)(h=l[d])&&g.get(v[d])===h&&(o[d]=h)}function N_(n){return n.__data__}function C_(n,l){if(!arguments.length)return Array.from(this,N_);var r=l?__:w_,u=this._parents,o=this._groups;typeof n!="function"&&(n=S_(n));for(var s=o.length,c=new Array(s),d=new Array(s),h=new Array(s),g=0;g<s;++g){var p=u[g],y=o[g],v=y.length,b=M_(n.call(p,p&&p.__data__,g,u)),E=b.length,N=d[g]=new Array(E),w=c[g]=new Array(E),S=h[g]=new Array(v);r(p,y,N,w,S,b,l);for(var C=0,_=0,M,B;C<E;++C)if(M=N[C]){for(C>=_&&(_=C+1);!(B=w[_])&&++_<E;);M._next=B||null}}return c=new Vt(c,u),c._enter=d,c._exit=h,c}function M_(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function T_(){return new Vt(this._exit||this._groups.map(o1),this._parents)}function A_(n,l,r){var u=this.enter(),o=this,s=this.exit();return typeof n=="function"?(u=n(u),u&&(u=u.selection())):u=u.append(n+""),l!=null&&(o=l(o),o&&(o=o.selection())),r==null?s.remove():r(s),u&&o?u.merge(o).order():o}function R_(n){for(var l=n.selection?n.selection():n,r=this._groups,u=l._groups,o=r.length,s=u.length,c=Math.min(o,s),d=new Array(o),h=0;h<c;++h)for(var g=r[h],p=u[h],y=g.length,v=d[h]=new Array(y),b,E=0;E<y;++E)(b=g[E]||p[E])&&(v[E]=b);for(;h<o;++h)d[h]=r[h];return new Vt(d,this._parents)}function z_(){for(var n=this._groups,l=-1,r=n.length;++l<r;)for(var u=n[l],o=u.length-1,s=u[o],c;--o>=0;)(c=u[o])&&(s&&c.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(c,s),s=c);return this}function O_(n){n||(n=D_);function l(y,v){return y&&v?n(y.__data__,v.__data__):!y-!v}for(var r=this._groups,u=r.length,o=new Array(u),s=0;s<u;++s){for(var c=r[s],d=c.length,h=o[s]=new Array(d),g,p=0;p<d;++p)(g=c[p])&&(h[p]=g);h.sort(l)}return new Vt(o,this._parents).order()}function D_(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function j_(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function L_(){return Array.from(this)}function H_(){for(var n=this._groups,l=0,r=n.length;l<r;++l)for(var u=n[l],o=0,s=u.length;o<s;++o){var c=u[o];if(c)return c}return null}function B_(){let n=0;for(const l of this)++n;return n}function U_(){return!this.node()}function q_(n){for(var l=this._groups,r=0,u=l.length;r<u;++r)for(var o=l[r],s=0,c=o.length,d;s<c;++s)(d=o[s])&&n.call(d,d.__data__,s,o);return this}function k_(n){return function(){this.removeAttribute(n)}}function Y_(n){return function(){this.removeAttributeNS(n.space,n.local)}}function V_(n,l){return function(){this.setAttribute(n,l)}}function G_(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function X_(n,l){return function(){var r=l.apply(this,arguments);r==null?this.removeAttribute(n):this.setAttribute(n,r)}}function $_(n,l){return function(){var r=l.apply(this,arguments);r==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}}function Q_(n,l){var r=Zo(n);if(arguments.length<2){var u=this.node();return r.local?u.getAttributeNS(r.space,r.local):u.getAttribute(r)}return this.each((l==null?r.local?Y_:k_:typeof l=="function"?r.local?$_:X_:r.local?G_:V_)(r,l))}function s1(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Z_(n){return function(){this.style.removeProperty(n)}}function K_(n,l,r){return function(){this.style.setProperty(n,l,r)}}function I_(n,l,r){return function(){var u=l.apply(this,arguments);u==null?this.style.removeProperty(n):this.style.setProperty(n,u,r)}}function J_(n,l,r){return arguments.length>1?this.each((l==null?Z_:typeof l=="function"?I_:K_)(n,l,r??"")):ii(this.node(),n)}function ii(n,l){return n.style.getPropertyValue(l)||s1(n).getComputedStyle(n,null).getPropertyValue(l)}function F_(n){return function(){delete this[n]}}function W_(n,l){return function(){this[n]=l}}function P_(n,l){return function(){var r=l.apply(this,arguments);r==null?delete this[n]:this[n]=r}}function e2(n,l){return arguments.length>1?this.each((l==null?F_:typeof l=="function"?P_:W_)(n,l)):this.node()[n]}function c1(n){return n.trim().split(/^|\s+/)}function fh(n){return n.classList||new f1(n)}function f1(n){this._node=n,this._names=c1(n.getAttribute("class")||"")}f1.prototype={add:function(n){var l=this._names.indexOf(n);l<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var l=this._names.indexOf(n);l>=0&&(this._names.splice(l,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function d1(n,l){for(var r=fh(n),u=-1,o=l.length;++u<o;)r.add(l[u])}function h1(n,l){for(var r=fh(n),u=-1,o=l.length;++u<o;)r.remove(l[u])}function t2(n){return function(){d1(this,n)}}function n2(n){return function(){h1(this,n)}}function a2(n,l){return function(){(l.apply(this,arguments)?d1:h1)(this,n)}}function l2(n,l){var r=c1(n+"");if(arguments.length<2){for(var u=fh(this.node()),o=-1,s=r.length;++o<s;)if(!u.contains(r[o]))return!1;return!0}return this.each((typeof l=="function"?a2:l?t2:n2)(r,l))}function i2(){this.textContent=""}function r2(n){return function(){this.textContent=n}}function u2(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function o2(n){return arguments.length?this.each(n==null?i2:(typeof n=="function"?u2:r2)(n)):this.node().textContent}function s2(){this.innerHTML=""}function c2(n){return function(){this.innerHTML=n}}function f2(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function d2(n){return arguments.length?this.each(n==null?s2:(typeof n=="function"?f2:c2)(n)):this.node().innerHTML}function h2(){this.nextSibling&&this.parentNode.appendChild(this)}function m2(){return this.each(h2)}function g2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function p2(){return this.each(g2)}function y2(n){var l=typeof n=="function"?n:l1(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function v2(){return null}function b2(n,l){var r=typeof n=="function"?n:l1(n),u=l==null?v2:typeof l=="function"?l:ch(l);return this.select(function(){return this.insertBefore(r.apply(this,arguments),u.apply(this,arguments)||null)})}function x2(){var n=this.parentNode;n&&n.removeChild(this)}function E2(){return this.each(x2)}function S2(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function w2(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function _2(n){return this.select(n?w2:S2)}function N2(n){return arguments.length?this.property("__data__",n):this.node().__data__}function C2(n){return function(l){n.call(this,l,this.__data__)}}function M2(n){return n.trim().split(/^|\s+/).map(function(l){var r="",u=l.indexOf(".");return u>=0&&(r=l.slice(u+1),l=l.slice(0,u)),{type:l,name:r}})}function T2(n){return function(){var l=this.__on;if(l){for(var r=0,u=-1,o=l.length,s;r<o;++r)s=l[r],(!n.type||s.type===n.type)&&s.name===n.name?this.removeEventListener(s.type,s.listener,s.options):l[++u]=s;++u?l.length=u:delete this.__on}}}function A2(n,l,r){return function(){var u=this.__on,o,s=C2(l);if(u){for(var c=0,d=u.length;c<d;++c)if((o=u[c]).type===n.type&&o.name===n.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=l;return}}this.addEventListener(n.type,s,r),o={type:n.type,name:n.name,value:l,listener:s,options:r},u?u.push(o):this.__on=[o]}}function R2(n,l,r){var u=M2(n+""),o,s=u.length,c;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,g=d.length,p;h<g;++h)for(o=0,p=d[h];o<s;++o)if((c=u[o]).type===p.type&&c.name===p.name)return p.value}return}for(d=l?A2:T2,o=0;o<s;++o)this.each(d(u[o],l,r));return this}function m1(n,l,r){var u=s1(n),o=u.CustomEvent;typeof o=="function"?o=new o(l,r):(o=u.document.createEvent("Event"),r?(o.initEvent(l,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(l,!1,!1)),n.dispatchEvent(o)}function z2(n,l){return function(){return m1(this,n,l)}}function O2(n,l){return function(){return m1(this,n,l.apply(this,arguments))}}function D2(n,l){return this.each((typeof l=="function"?O2:z2)(n,l))}function*j2(){for(var n=this._groups,l=0,r=n.length;l<r;++l)for(var u=n[l],o=0,s=u.length,c;o<s;++o)(c=u[o])&&(yield c)}var g1=[null];function Vt(n,l){this._groups=n,this._parents=l}function Lr(){return new Vt([[document.documentElement]],g1)}function L2(){return this}Vt.prototype=Lr.prototype={constructor:Vt,select:u_,selectAll:f_,selectChild:g_,selectChildren:b_,filter:x_,data:C_,enter:E_,exit:T_,join:A_,merge:R_,selection:L2,order:z_,sort:O_,call:j_,nodes:L_,node:H_,size:B_,empty:U_,each:q_,attr:Q_,style:J_,property:e2,classed:l2,text:o2,html:d2,raise:m2,lower:p2,append:y2,insert:b2,remove:E2,clone:_2,datum:N2,on:R2,dispatch:D2,[Symbol.iterator]:j2};function Yt(n){return typeof n=="string"?new Vt([[document.querySelector(n)]],[document.documentElement]):new Vt([[n]],g1)}function H2(n){let l;for(;l=n.sourceEvent;)n=l;return n}function on(n,l){if(n=H2(n),l===void 0&&(l=n.currentTarget),l){var r=l.ownerSVGElement||l;if(r.createSVGPoint){var u=r.createSVGPoint();return u.x=n.clientX,u.y=n.clientY,u=u.matrixTransform(l.getScreenCTM().inverse()),[u.x,u.y]}if(l.getBoundingClientRect){var o=l.getBoundingClientRect();return[n.clientX-o.left-l.clientLeft,n.clientY-o.top-l.clientTop]}}return[n.pageX,n.pageY]}const B2={passive:!1},Sr={capture:!0,passive:!1};function Rf(n){n.stopImmediatePropagation()}function ni(n){n.preventDefault(),n.stopImmediatePropagation()}function p1(n){var l=n.document.documentElement,r=Yt(n).on("dragstart.drag",ni,Sr);"onselectstart"in l?r.on("selectstart.drag",ni,Sr):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function y1(n,l){var r=n.document.documentElement,u=Yt(n).on("dragstart.drag",null);l&&(u.on("click.drag",ni,Sr),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in r?u.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const co=n=>()=>n;function kd(n,{sourceEvent:l,subject:r,target:u,identifier:o,active:s,x:c,y:d,dx:h,dy:g,dispatch:p}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:p}})}kd.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function U2(n){return!n.ctrlKey&&!n.button}function q2(){return this.parentNode}function k2(n,l){return l??{x:n.x,y:n.y}}function Y2(){return navigator.maxTouchPoints||"ontouchstart"in this}function v1(){var n=U2,l=q2,r=k2,u=Y2,o={},s=Qo("start","drag","end"),c=0,d,h,g,p,y=0;function v(M){M.on("mousedown.drag",b).filter(u).on("touchstart.drag",w).on("touchmove.drag",S,B2).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(M,B){if(!(p||!n.call(this,M,B))){var L=_(this,l.call(this,M,B),M,B,"mouse");L&&(Yt(M.view).on("mousemove.drag",E,Sr).on("mouseup.drag",N,Sr),p1(M.view),Rf(M),g=!1,d=M.clientX,h=M.clientY,L("start",M))}}function E(M){if(ni(M),!g){var B=M.clientX-d,L=M.clientY-h;g=B*B+L*L>y}o.mouse("drag",M)}function N(M){Yt(M.view).on("mousemove.drag mouseup.drag",null),y1(M.view,g),ni(M),o.mouse("end",M)}function w(M,B){if(n.call(this,M,B)){var L=M.changedTouches,U=l.call(this,M,B),O=L.length,H,$;for(H=0;H<O;++H)($=_(this,U,M,B,L[H].identifier,L[H]))&&(Rf(M),$("start",M,L[H]))}}function S(M){var B=M.changedTouches,L=B.length,U,O;for(U=0;U<L;++U)(O=o[B[U].identifier])&&(ni(M),O("drag",M,B[U]))}function C(M){var B=M.changedTouches,L=B.length,U,O;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),U=0;U<L;++U)(O=o[B[U].identifier])&&(Rf(M),O("end",M,B[U]))}function _(M,B,L,U,O,H){var $=s.copy(),k=on(H||L,B),Q,P,R;if((R=r.call(M,new kd("beforestart",{sourceEvent:L,target:v,identifier:O,active:c,x:k[0],y:k[1],dx:0,dy:0,dispatch:$}),U))!=null)return Q=R.x-k[0]||0,P=R.y-k[1]||0,function Z(D,Y,F){var I=k,le;switch(D){case"start":o[O]=Z,le=c++;break;case"end":delete o[O],--c;case"drag":k=on(F||Y,B),le=c;break}$.call(D,M,new kd(D,{sourceEvent:Y,subject:R,target:v,identifier:O,active:le,x:k[0]+Q,y:k[1]+P,dx:k[0]-I[0],dy:k[1]-I[1],dispatch:$}),U)}}return v.filter=function(M){return arguments.length?(n=typeof M=="function"?M:co(!!M),v):n},v.container=function(M){return arguments.length?(l=typeof M=="function"?M:co(M),v):l},v.subject=function(M){return arguments.length?(r=typeof M=="function"?M:co(M),v):r},v.touchable=function(M){return arguments.length?(u=typeof M=="function"?M:co(!!M),v):u},v.on=function(){var M=s.on.apply(s,arguments);return M===s?v:M},v.clickDistance=function(M){return arguments.length?(y=(M=+M)*M,v):Math.sqrt(y)},v}function dh(n,l,r){n.prototype=l.prototype=r,r.constructor=n}function b1(n,l){var r=Object.create(n.prototype);for(var u in l)r[u]=l[u];return r}function Hr(){}var wr=.7,zo=1/wr,ai="\\s*([+-]?\\d+)\\s*",_r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Nn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V2=/^#([0-9a-f]{3,8})$/,G2=new RegExp(`^rgb\\(${ai},${ai},${ai}\\)$`),X2=new RegExp(`^rgb\\(${Nn},${Nn},${Nn}\\)$`),$2=new RegExp(`^rgba\\(${ai},${ai},${ai},${_r}\\)$`),Q2=new RegExp(`^rgba\\(${Nn},${Nn},${Nn},${_r}\\)$`),Z2=new RegExp(`^hsl\\(${_r},${Nn},${Nn}\\)$`),K2=new RegExp(`^hsla\\(${_r},${Nn},${Nn},${_r}\\)$`),O0={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};dh(Hr,ul,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:D0,formatHex:D0,formatHex8:I2,formatHsl:J2,formatRgb:j0,toString:j0});function D0(){return this.rgb().formatHex()}function I2(){return this.rgb().formatHex8()}function J2(){return x1(this).formatHsl()}function j0(){return this.rgb().formatRgb()}function ul(n){var l,r;return n=(n+"").trim().toLowerCase(),(l=V2.exec(n))?(r=l[1].length,l=parseInt(l[1],16),r===6?L0(l):r===3?new zt(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):r===8?fo(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):r===4?fo(l>>12&15|l>>8&240,l>>8&15|l>>4&240,l>>4&15|l&240,((l&15)<<4|l&15)/255):null):(l=G2.exec(n))?new zt(l[1],l[2],l[3],1):(l=X2.exec(n))?new zt(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=$2.exec(n))?fo(l[1],l[2],l[3],l[4]):(l=Q2.exec(n))?fo(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=Z2.exec(n))?U0(l[1],l[2]/100,l[3]/100,1):(l=K2.exec(n))?U0(l[1],l[2]/100,l[3]/100,l[4]):O0.hasOwnProperty(n)?L0(O0[n]):n==="transparent"?new zt(NaN,NaN,NaN,0):null}function L0(n){return new zt(n>>16&255,n>>8&255,n&255,1)}function fo(n,l,r,u){return u<=0&&(n=l=r=NaN),new zt(n,l,r,u)}function F2(n){return n instanceof Hr||(n=ul(n)),n?(n=n.rgb(),new zt(n.r,n.g,n.b,n.opacity)):new zt}function Yd(n,l,r,u){return arguments.length===1?F2(n):new zt(n,l,r,u??1)}function zt(n,l,r,u){this.r=+n,this.g=+l,this.b=+r,this.opacity=+u}dh(zt,Yd,b1(Hr,{brighter(n){return n=n==null?zo:Math.pow(zo,n),new zt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?wr:Math.pow(wr,n),new zt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new zt(ll(this.r),ll(this.g),ll(this.b),Oo(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:H0,formatHex:H0,formatHex8:W2,formatRgb:B0,toString:B0}));function H0(){return`#${al(this.r)}${al(this.g)}${al(this.b)}`}function W2(){return`#${al(this.r)}${al(this.g)}${al(this.b)}${al((isNaN(this.opacity)?1:this.opacity)*255)}`}function B0(){const n=Oo(this.opacity);return`${n===1?"rgb(":"rgba("}${ll(this.r)}, ${ll(this.g)}, ${ll(this.b)}${n===1?")":`, ${n})`}`}function Oo(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function ll(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function al(n){return n=ll(n),(n<16?"0":"")+n.toString(16)}function U0(n,l,r,u){return u<=0?n=l=r=NaN:r<=0||r>=1?n=l=NaN:l<=0&&(n=NaN),new sn(n,l,r,u)}function x1(n){if(n instanceof sn)return new sn(n.h,n.s,n.l,n.opacity);if(n instanceof Hr||(n=ul(n)),!n)return new sn;if(n instanceof sn)return n;n=n.rgb();var l=n.r/255,r=n.g/255,u=n.b/255,o=Math.min(l,r,u),s=Math.max(l,r,u),c=NaN,d=s-o,h=(s+o)/2;return d?(l===s?c=(r-u)/d+(r<u)*6:r===s?c=(u-l)/d+2:c=(l-r)/d+4,d/=h<.5?s+o:2-s-o,c*=60):d=h>0&&h<1?0:c,new sn(c,d,h,n.opacity)}function P2(n,l,r,u){return arguments.length===1?x1(n):new sn(n,l,r,u??1)}function sn(n,l,r,u){this.h=+n,this.s=+l,this.l=+r,this.opacity=+u}dh(sn,P2,b1(Hr,{brighter(n){return n=n==null?zo:Math.pow(zo,n),new sn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?wr:Math.pow(wr,n),new sn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,l=isNaN(n)||isNaN(this.s)?0:this.s,r=this.l,u=r+(r<.5?r:1-r)*l,o=2*r-u;return new zt(zf(n>=240?n-240:n+120,o,u),zf(n,o,u),zf(n<120?n+240:n-120,o,u),this.opacity)},clamp(){return new sn(q0(this.h),ho(this.s),ho(this.l),Oo(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 n=Oo(this.opacity);return`${n===1?"hsl(":"hsla("}${q0(this.h)}, ${ho(this.s)*100}%, ${ho(this.l)*100}%${n===1?")":`, ${n})`}`}}));function q0(n){return n=(n||0)%360,n<0?n+360:n}function ho(n){return Math.max(0,Math.min(1,n||0))}function zf(n,l,r){return(n<60?l+(r-l)*n/60:n<180?r:n<240?l+(r-l)*(240-n)/60:l)*255}const hh=n=>()=>n;function eN(n,l){return function(r){return n+r*l}}function tN(n,l,r){return n=Math.pow(n,r),l=Math.pow(l,r)-n,r=1/r,function(u){return Math.pow(n+u*l,r)}}function nN(n){return(n=+n)==1?E1:function(l,r){return r-l?tN(l,r,n):hh(isNaN(l)?r:l)}}function E1(n,l){var r=l-n;return r?eN(n,r):hh(isNaN(n)?l:n)}const Do=(function n(l){var r=nN(l);function u(o,s){var c=r((o=Yd(o)).r,(s=Yd(s)).r),d=r(o.g,s.g),h=r(o.b,s.b),g=E1(o.opacity,s.opacity);return function(p){return o.r=c(p),o.g=d(p),o.b=h(p),o.opacity=g(p),o+""}}return u.gamma=n,u})(1);function aN(n,l){l||(l=[]);var r=n?Math.min(l.length,n.length):0,u=l.slice(),o;return function(s){for(o=0;o<r;++o)u[o]=n[o]*(1-s)+l[o]*s;return u}}function lN(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function iN(n,l){var r=l?l.length:0,u=n?Math.min(r,n.length):0,o=new Array(u),s=new Array(r),c;for(c=0;c<u;++c)o[c]=xr(n[c],l[c]);for(;c<r;++c)s[c]=l[c];return function(d){for(c=0;c<u;++c)s[c]=o[c](d);return s}}function rN(n,l){var r=new Date;return n=+n,l=+l,function(u){return r.setTime(n*(1-u)+l*u),r}}function _n(n,l){return n=+n,l=+l,function(r){return n*(1-r)+l*r}}function uN(n,l){var r={},u={},o;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(o in l)o in n?r[o]=xr(n[o],l[o]):u[o]=l[o];return function(s){for(o in r)u[o]=r[o](s);return u}}var Vd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Of=new RegExp(Vd.source,"g");function oN(n){return function(){return n}}function sN(n){return function(l){return n(l)+""}}function S1(n,l){var r=Vd.lastIndex=Of.lastIndex=0,u,o,s,c=-1,d=[],h=[];for(n=n+"",l=l+"";(u=Vd.exec(n))&&(o=Of.exec(l));)(s=o.index)>r&&(s=l.slice(r,s),d[c]?d[c]+=s:d[++c]=s),(u=u[0])===(o=o[0])?d[c]?d[c]+=o:d[++c]=o:(d[++c]=null,h.push({i:c,x:_n(u,o)})),r=Of.lastIndex;return r<l.length&&(s=l.slice(r),d[c]?d[c]+=s:d[++c]=s),d.length<2?h[0]?sN(h[0].x):oN(l):(l=h.length,function(g){for(var p=0,y;p<l;++p)d[(y=h[p]).i]=y.x(g);return d.join("")})}function xr(n,l){var r=typeof l,u;return l==null||r==="boolean"?hh(l):(r==="number"?_n:r==="string"?(u=ul(l))?(l=u,Do):S1:l instanceof ul?Do:l instanceof Date?rN:lN(l)?aN:Array.isArray(l)?iN:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?uN:_n)(n,l)}var k0=180/Math.PI,Gd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function w1(n,l,r,u,o,s){var c,d,h;return(c=Math.sqrt(n*n+l*l))&&(n/=c,l/=c),(h=n*r+l*u)&&(r-=n*h,u-=l*h),(d=Math.sqrt(r*r+u*u))&&(r/=d,u/=d,h/=d),n*u<l*r&&(n=-n,l=-l,h=-h,c=-c),{translateX:o,translateY:s,rotate:Math.atan2(l,n)*k0,skewX:Math.atan(h)*k0,scaleX:c,scaleY:d}}var mo;function cN(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Gd:w1(l.a,l.b,l.c,l.d,l.e,l.f)}function fN(n){return n==null||(mo||(mo=document.createElementNS("http://www.w3.org/2000/svg","g")),mo.setAttribute("transform",n),!(n=mo.transform.baseVal.consolidate()))?Gd:(n=n.matrix,w1(n.a,n.b,n.c,n.d,n.e,n.f))}function _1(n,l,r,u){function o(g){return g.length?g.pop()+" ":""}function s(g,p,y,v,b,E){if(g!==y||p!==v){var N=b.push("translate(",null,l,null,r);E.push({i:N-4,x:_n(g,y)},{i:N-2,x:_n(p,v)})}else(y||v)&&b.push("translate("+y+l+v+r)}function c(g,p,y,v){g!==p?(g-p>180?p+=360:p-g>180&&(g+=360),v.push({i:y.push(o(y)+"rotate(",null,u)-2,x:_n(g,p)})):p&&y.push(o(y)+"rotate("+p+u)}function d(g,p,y,v){g!==p?v.push({i:y.push(o(y)+"skewX(",null,u)-2,x:_n(g,p)}):p&&y.push(o(y)+"skewX("+p+u)}function h(g,p,y,v,b,E){if(g!==y||p!==v){var N=b.push(o(b)+"scale(",null,",",null,")");E.push({i:N-4,x:_n(g,y)},{i:N-2,x:_n(p,v)})}else(y!==1||v!==1)&&b.push(o(b)+"scale("+y+","+v+")")}return function(g,p){var y=[],v=[];return g=n(g),p=n(p),s(g.translateX,g.translateY,p.translateX,p.translateY,y,v),c(g.rotate,p.rotate,y,v),d(g.skewX,p.skewX,y,v),h(g.scaleX,g.scaleY,p.scaleX,p.scaleY,y,v),g=p=null,function(b){for(var E=-1,N=v.length,w;++E<N;)y[(w=v[E]).i]=w.x(b);return y.join("")}}}var dN=_1(cN,"px, ","px)","deg)"),hN=_1(fN,", ",")",")"),mN=1e-12;function Y0(n){return((n=Math.exp(n))+1/n)/2}function gN(n){return((n=Math.exp(n))-1/n)/2}function pN(n){return((n=Math.exp(2*n))-1)/(n+1)}const _o=(function n(l,r,u){function o(s,c){var d=s[0],h=s[1],g=s[2],p=c[0],y=c[1],v=c[2],b=p-d,E=y-h,N=b*b+E*E,w,S;if(N<mN)S=Math.log(v/g)/l,w=function(U){return[d+U*b,h+U*E,g*Math.exp(l*U*S)]};else{var C=Math.sqrt(N),_=(v*v-g*g+u*N)/(2*g*r*C),M=(v*v-g*g-u*N)/(2*v*r*C),B=Math.log(Math.sqrt(_*_+1)-_),L=Math.log(Math.sqrt(M*M+1)-M);S=(L-B)/l,w=function(U){var O=U*S,H=Y0(B),$=g/(r*C)*(H*pN(l*O+B)-gN(B));return[d+$*b,h+$*E,g*H/Y0(l*O+B)]}}return w.duration=S*1e3*l/Math.SQRT2,w}return o.rho=function(s){var c=Math.max(.001,+s),d=c*c,h=d*d;return n(c,d,h)},o})(Math.SQRT2,2,4);var ri=0,vr=0,gr=0,N1=1e3,jo,br,Lo=0,ol=0,Ko=0,Nr=typeof performance=="object"&&performance.now?performance:Date,C1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function mh(){return ol||(C1(yN),ol=Nr.now()+Ko)}function yN(){ol=0}function Ho(){this._call=this._time=this._next=null}Ho.prototype=M1.prototype={constructor:Ho,restart:function(n,l,r){if(typeof n!="function")throw new TypeError("callback is not a function");r=(r==null?mh():+r)+(l==null?0:+l),!this._next&&br!==this&&(br?br._next=this:jo=this,br=this),this._call=n,this._time=r,Xd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xd())}};function M1(n,l,r){var u=new Ho;return u.restart(n,l,r),u}function vN(){mh(),++ri;for(var n=jo,l;n;)(l=ol-n._time)>=0&&n._call.call(void 0,l),n=n._next;--ri}function V0(){ol=(Lo=Nr.now())+Ko,ri=vr=0;try{vN()}finally{ri=0,xN(),ol=0}}function bN(){var n=Nr.now(),l=n-Lo;l>N1&&(Ko-=l,Lo=n)}function xN(){for(var n,l=jo,r,u=1/0;l;)l._call?(u>l._time&&(u=l._time),n=l,l=l._next):(r=l._next,l._next=null,l=n?n._next=r:jo=r);br=n,Xd(u)}function Xd(n){if(!ri){vr&&(vr=clearTimeout(vr));var l=n-ol;l>24?(n<1/0&&(vr=setTimeout(V0,n-Nr.now()-Ko)),gr&&(gr=clearInterval(gr))):(gr||(Lo=Nr.now(),gr=setInterval(bN,N1)),ri=1,C1(V0))}}function G0(n,l,r){var u=new Ho;return l=l==null?0:+l,u.restart(o=>{u.stop(),n(o+l)},l,r),u}var EN=Qo("start","end","cancel","interrupt"),SN=[],T1=0,X0=1,$d=2,No=3,$0=4,Qd=5,Co=6;function Io(n,l,r,u,o,s){var c=n.__transition;if(!c)n.__transition={};else if(r in c)return;wN(n,r,{name:l,index:u,group:o,on:EN,tween:SN,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:T1})}function gh(n,l){var r=pn(n,l);if(r.state>T1)throw new Error("too late; already scheduled");return r}function Mn(n,l){var r=pn(n,l);if(r.state>No)throw new Error("too late; already running");return r}function pn(n,l){var r=n.__transition;if(!r||!(r=r[l]))throw new Error("transition not found");return r}function wN(n,l,r){var u=n.__transition,o;u[l]=r,r.timer=M1(s,0,r.time);function s(g){r.state=X0,r.timer.restart(c,r.delay,r.time),r.delay<=g&&c(g-r.delay)}function c(g){var p,y,v,b;if(r.state!==X0)return h();for(p in u)if(b=u[p],b.name===r.name){if(b.state===No)return G0(c);b.state===$0?(b.state=Co,b.timer.stop(),b.on.call("interrupt",n,n.__data__,b.index,b.group),delete u[p]):+p<l&&(b.state=Co,b.timer.stop(),b.on.call("cancel",n,n.__data__,b.index,b.group),delete u[p])}if(G0(function(){r.state===No&&(r.state=$0,r.timer.restart(d,r.delay,r.time),d(g))}),r.state=$d,r.on.call("start",n,n.__data__,r.index,r.group),r.state===$d){for(r.state=No,o=new Array(v=r.tween.length),p=0,y=-1;p<v;++p)(b=r.tween[p].value.call(n,n.__data__,r.index,r.group))&&(o[++y]=b);o.length=y+1}}function d(g){for(var p=g<r.duration?r.ease.call(null,g/r.duration):(r.timer.restart(h),r.state=Qd,1),y=-1,v=o.length;++y<v;)o[y].call(n,p);r.state===Qd&&(r.on.call("end",n,n.__data__,r.index,r.group),h())}function h(){r.state=Co,r.timer.stop(),delete u[l];for(var g in u)return;delete n.__transition}}function Mo(n,l){var r=n.__transition,u,o,s=!0,c;if(r){l=l==null?null:l+"";for(c in r){if((u=r[c]).name!==l){s=!1;continue}o=u.state>$d&&u.state<Qd,u.state=Co,u.timer.stop(),u.on.call(o?"interrupt":"cancel",n,n.__data__,u.index,u.group),delete r[c]}s&&delete n.__transition}}function _N(n){return this.each(function(){Mo(this,n)})}function NN(n,l){var r,u;return function(){var o=Mn(this,n),s=o.tween;if(s!==r){u=r=s;for(var c=0,d=u.length;c<d;++c)if(u[c].name===l){u=u.slice(),u.splice(c,1);break}}o.tween=u}}function CN(n,l,r){var u,o;if(typeof r!="function")throw new Error;return function(){var s=Mn(this,n),c=s.tween;if(c!==u){o=(u=c).slice();for(var d={name:l,value:r},h=0,g=o.length;h<g;++h)if(o[h].name===l){o[h]=d;break}h===g&&o.push(d)}s.tween=o}}function MN(n,l){var r=this._id;if(n+="",arguments.length<2){for(var u=pn(this.node(),r).tween,o=0,s=u.length,c;o<s;++o)if((c=u[o]).name===n)return c.value;return null}return this.each((l==null?NN:CN)(r,n,l))}function ph(n,l,r){var u=n._id;return n.each(function(){var o=Mn(this,u);(o.value||(o.value={}))[l]=r.apply(this,arguments)}),function(o){return pn(o,u).value[l]}}function A1(n,l){var r;return(typeof l=="number"?_n:l instanceof ul?Do:(r=ul(l))?(l=r,Do):S1)(n,l)}function TN(n){return function(){this.removeAttribute(n)}}function AN(n){return function(){this.removeAttributeNS(n.space,n.local)}}function RN(n,l,r){var u,o=r+"",s;return function(){var c=this.getAttribute(n);return c===o?null:c===u?s:s=l(u=c,r)}}function zN(n,l,r){var u,o=r+"",s;return function(){var c=this.getAttributeNS(n.space,n.local);return c===o?null:c===u?s:s=l(u=c,r)}}function ON(n,l,r){var u,o,s;return function(){var c,d=r(this),h;return d==null?void this.removeAttribute(n):(c=this.getAttribute(n),h=d+"",c===h?null:c===u&&h===o?s:(o=h,s=l(u=c,d)))}}function DN(n,l,r){var u,o,s;return function(){var c,d=r(this),h;return d==null?void this.removeAttributeNS(n.space,n.local):(c=this.getAttributeNS(n.space,n.local),h=d+"",c===h?null:c===u&&h===o?s:(o=h,s=l(u=c,d)))}}function jN(n,l){var r=Zo(n),u=r==="transform"?hN:A1;return this.attrTween(n,typeof l=="function"?(r.local?DN:ON)(r,u,ph(this,"attr."+n,l)):l==null?(r.local?AN:TN)(r):(r.local?zN:RN)(r,u,l))}function LN(n,l){return function(r){this.setAttribute(n,l.call(this,r))}}function HN(n,l){return function(r){this.setAttributeNS(n.space,n.local,l.call(this,r))}}function BN(n,l){var r,u;function o(){var s=l.apply(this,arguments);return s!==u&&(r=(u=s)&&HN(n,s)),r}return o._value=l,o}function UN(n,l){var r,u;function o(){var s=l.apply(this,arguments);return s!==u&&(r=(u=s)&&LN(n,s)),r}return o._value=l,o}function qN(n,l){var r="attr."+n;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(l==null)return this.tween(r,null);if(typeof l!="function")throw new Error;var u=Zo(n);return this.tween(r,(u.local?BN:UN)(u,l))}function kN(n,l){return function(){gh(this,n).delay=+l.apply(this,arguments)}}function YN(n,l){return l=+l,function(){gh(this,n).delay=l}}function VN(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?kN:YN)(l,n)):pn(this.node(),l).delay}function GN(n,l){return function(){Mn(this,n).duration=+l.apply(this,arguments)}}function XN(n,l){return l=+l,function(){Mn(this,n).duration=l}}function $N(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?GN:XN)(l,n)):pn(this.node(),l).duration}function QN(n,l){if(typeof l!="function")throw new Error;return function(){Mn(this,n).ease=l}}function ZN(n){var l=this._id;return arguments.length?this.each(QN(l,n)):pn(this.node(),l).ease}function KN(n,l){return function(){var r=l.apply(this,arguments);if(typeof r!="function")throw new Error;Mn(this,n).ease=r}}function IN(n){if(typeof n!="function")throw new Error;return this.each(KN(this._id,n))}function JN(n){typeof n!="function"&&(n=r1(n));for(var l=this._groups,r=l.length,u=new Array(r),o=0;o<r;++o)for(var s=l[o],c=s.length,d=u[o]=[],h,g=0;g<c;++g)(h=s[g])&&n.call(h,h.__data__,g,s)&&d.push(h);return new Wn(u,this._parents,this._name,this._id)}function FN(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,r=n._groups,u=l.length,o=r.length,s=Math.min(u,o),c=new Array(u),d=0;d<s;++d)for(var h=l[d],g=r[d],p=h.length,y=c[d]=new Array(p),v,b=0;b<p;++b)(v=h[b]||g[b])&&(y[b]=v);for(;d<u;++d)c[d]=l[d];return new Wn(c,this._parents,this._name,this._id)}function WN(n){return(n+"").trim().split(/^|\s+/).every(function(l){var r=l.indexOf(".");return r>=0&&(l=l.slice(0,r)),!l||l==="start"})}function PN(n,l,r){var u,o,s=WN(l)?gh:Mn;return function(){var c=s(this,n),d=c.on;d!==u&&(o=(u=d).copy()).on(l,r),c.on=o}}function eC(n,l){var r=this._id;return arguments.length<2?pn(this.node(),r).on.on(n):this.each(PN(r,n,l))}function tC(n){return function(){var l=this.parentNode;for(var r in this.__transition)if(+r!==n)return;l&&l.removeChild(this)}}function nC(){return this.on("end.remove",tC(this._id))}function aC(n){var l=this._name,r=this._id;typeof n!="function"&&(n=ch(n));for(var u=this._groups,o=u.length,s=new Array(o),c=0;c<o;++c)for(var d=u[c],h=d.length,g=s[c]=new Array(h),p,y,v=0;v<h;++v)(p=d[v])&&(y=n.call(p,p.__data__,v,d))&&("__data__"in p&&(y.__data__=p.__data__),g[v]=y,Io(g[v],l,r,v,g,pn(p,r)));return new Wn(s,this._parents,l,r)}function lC(n){var l=this._name,r=this._id;typeof n!="function"&&(n=i1(n));for(var u=this._groups,o=u.length,s=[],c=[],d=0;d<o;++d)for(var h=u[d],g=h.length,p,y=0;y<g;++y)if(p=h[y]){for(var v=n.call(p,p.__data__,y,h),b,E=pn(p,r),N=0,w=v.length;N<w;++N)(b=v[N])&&Io(b,l,r,N,v,E);s.push(v),c.push(p)}return new Wn(s,c,l,r)}var iC=Lr.prototype.constructor;function rC(){return new iC(this._groups,this._parents)}function uC(n,l){var r,u,o;return function(){var s=ii(this,n),c=(this.style.removeProperty(n),ii(this,n));return s===c?null:s===r&&c===u?o:o=l(r=s,u=c)}}function R1(n){return function(){this.style.removeProperty(n)}}function oC(n,l,r){var u,o=r+"",s;return function(){var c=ii(this,n);return c===o?null:c===u?s:s=l(u=c,r)}}function sC(n,l,r){var u,o,s;return function(){var c=ii(this,n),d=r(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(n),ii(this,n))),c===h?null:c===u&&h===o?s:(o=h,s=l(u=c,d))}}function cC(n,l){var r,u,o,s="style."+l,c="end."+s,d;return function(){var h=Mn(this,n),g=h.on,p=h.value[s]==null?d||(d=R1(l)):void 0;(g!==r||o!==p)&&(u=(r=g).copy()).on(c,o=p),h.on=u}}function fC(n,l,r){var u=(n+="")=="transform"?dN:A1;return l==null?this.styleTween(n,uC(n,u)).on("end.style."+n,R1(n)):typeof l=="function"?this.styleTween(n,sC(n,u,ph(this,"style."+n,l))).each(cC(this._id,n)):this.styleTween(n,oC(n,u,l),r).on("end.style."+n,null)}function dC(n,l,r){return function(u){this.style.setProperty(n,l.call(this,u),r)}}function hC(n,l,r){var u,o;function s(){var c=l.apply(this,arguments);return c!==o&&(u=(o=c)&&dC(n,c,r)),u}return s._value=l,s}function mC(n,l,r){var u="style."+(n+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(l==null)return this.tween(u,null);if(typeof l!="function")throw new Error;return this.tween(u,hC(n,l,r??""))}function gC(n){return function(){this.textContent=n}}function pC(n){return function(){var l=n(this);this.textContent=l??""}}function yC(n){return this.tween("text",typeof n=="function"?pC(ph(this,"text",n)):gC(n==null?"":n+""))}function vC(n){return function(l){this.textContent=n.call(this,l)}}function bC(n){var l,r;function u(){var o=n.apply(this,arguments);return o!==r&&(l=(r=o)&&vC(o)),l}return u._value=n,u}function xC(n){var l="text";if(arguments.length<1)return(l=this.tween(l))&&l._value;if(n==null)return this.tween(l,null);if(typeof n!="function")throw new Error;return this.tween(l,bC(n))}function EC(){for(var n=this._name,l=this._id,r=z1(),u=this._groups,o=u.length,s=0;s<o;++s)for(var c=u[s],d=c.length,h,g=0;g<d;++g)if(h=c[g]){var p=pn(h,l);Io(h,n,r,g,c,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Wn(u,this._parents,n,r)}function SC(){var n,l,r=this,u=r._id,o=r.size();return new Promise(function(s,c){var d={value:c},h={value:function(){--o===0&&s()}};r.each(function(){var g=Mn(this,u),p=g.on;p!==n&&(l=(n=p).copy(),l._.cancel.push(d),l._.interrupt.push(d),l._.end.push(h)),g.on=l}),o===0&&s()})}var wC=0;function Wn(n,l,r,u){this._groups=n,this._parents=l,this._name=r,this._id=u}function z1(){return++wC}var In=Lr.prototype;Wn.prototype={constructor:Wn,select:aC,selectAll:lC,selectChild:In.selectChild,selectChildren:In.selectChildren,filter:JN,merge:FN,selection:rC,transition:EC,call:In.call,nodes:In.nodes,node:In.node,size:In.size,empty:In.empty,each:In.each,on:eC,attr:jN,attrTween:qN,style:fC,styleTween:mC,text:yC,textTween:xC,remove:nC,tween:MN,delay:VN,duration:$N,ease:ZN,easeVarying:IN,end:SC,[Symbol.iterator]:In[Symbol.iterator]};function _C(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var NC={time:null,delay:0,duration:250,ease:_C};function CC(n,l){for(var r;!(r=n.__transition)||!(r=r[l]);)if(!(n=n.parentNode))throw new Error(`transition ${l} not found`);return r}function MC(n){var l,r;n instanceof Wn?(l=n._id,n=n._name):(l=z1(),(r=NC).time=mh(),n=n==null?null:n+"");for(var u=this._groups,o=u.length,s=0;s<o;++s)for(var c=u[s],d=c.length,h,g=0;g<d;++g)(h=c[g])&&Io(h,n,l,g,c,r||CC(h,l));return new Wn(u,this._parents,n,l)}Lr.prototype.interrupt=_N;Lr.prototype.transition=MC;const go=n=>()=>n;function TC(n,{sourceEvent:l,target:r,transform:u,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:o}})}function Jn(n,l,r){this.k=n,this.x=l,this.y=r}Jn.prototype={constructor:Jn,scale:function(n){return n===1?this:new Jn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new Jn(this.k,this.x+this.k*n,this.y+this.k*l)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jo=new Jn(1,0,0);O1.prototype=Jn.prototype;function O1(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Jo;return n.__zoom}function Df(n){n.stopImmediatePropagation()}function pr(n){n.preventDefault(),n.stopImmediatePropagation()}function AC(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function RC(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Q0(){return this.__zoom||Jo}function zC(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function OC(){return navigator.maxTouchPoints||"ontouchstart"in this}function DC(n,l,r){var u=n.invertX(l[0][0])-r[0][0],o=n.invertX(l[1][0])-r[1][0],s=n.invertY(l[0][1])-r[0][1],c=n.invertY(l[1][1])-r[1][1];return n.translate(o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o),c>s?(s+c)/2:Math.min(0,s)||Math.max(0,c))}function D1(){var n=AC,l=RC,r=DC,u=zC,o=OC,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],d=250,h=_o,g=Qo("start","zoom","end"),p,y,v,b=500,E=150,N=0,w=10;function S(R){R.property("__zoom",Q0).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",$).filter(o).on("touchstart.zoom",k).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(R,Z,D,Y){var F=R.selection?R.selection():R;F.property("__zoom",Q0),R!==F?B(R,Z,D,Y):F.interrupt().each(function(){L(this,arguments).event(Y).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},S.scaleBy=function(R,Z,D,Y){S.scaleTo(R,function(){var F=this.__zoom.k,I=typeof Z=="function"?Z.apply(this,arguments):Z;return F*I},D,Y)},S.scaleTo=function(R,Z,D,Y){S.transform(R,function(){var F=l.apply(this,arguments),I=this.__zoom,le=D==null?M(F):typeof D=="function"?D.apply(this,arguments):D,z=I.invert(le),V=typeof Z=="function"?Z.apply(this,arguments):Z;return r(_(C(I,V),le,z),F,c)},D,Y)},S.translateBy=function(R,Z,D,Y){S.transform(R,function(){return r(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof D=="function"?D.apply(this,arguments):D),l.apply(this,arguments),c)},null,Y)},S.translateTo=function(R,Z,D,Y,F){S.transform(R,function(){var I=l.apply(this,arguments),le=this.__zoom,z=Y==null?M(I):typeof Y=="function"?Y.apply(this,arguments):Y;return r(Jo.translate(z[0],z[1]).scale(le.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof D=="function"?-D.apply(this,arguments):-D),I,c)},Y,F)};function C(R,Z){return Z=Math.max(s[0],Math.min(s[1],Z)),Z===R.k?R:new Jn(Z,R.x,R.y)}function _(R,Z,D){var Y=Z[0]-D[0]*R.k,F=Z[1]-D[1]*R.k;return Y===R.x&&F===R.y?R:new Jn(R.k,Y,F)}function M(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function B(R,Z,D,Y){R.on("start.zoom",function(){L(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(Y).end()}).tween("zoom",function(){var F=this,I=arguments,le=L(F,I).event(Y),z=l.apply(F,I),V=D==null?M(z):typeof D=="function"?D.apply(F,I):D,q=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),G=F.__zoom,J=typeof Z=="function"?Z.apply(F,I):Z,re=h(G.invert(V).concat(q/G.k),J.invert(V).concat(q/J.k));return function(se){if(se===1)se=J;else{var ee=re(se),fe=q/ee[2];se=new Jn(fe,V[0]-ee[0]*fe,V[1]-ee[1]*fe)}le.zoom(null,se)}})}function L(R,Z,D){return!D&&R.__zooming||new U(R,Z)}function U(R,Z){this.that=R,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=l.apply(R,Z),this.taps=0}U.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,Z){return this.mouse&&R!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var Z=Yt(this.that).datum();g.call(R,this.that,new TC(R,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:g}),Z)}};function O(R,...Z){if(!n.apply(this,arguments))return;var D=L(this,Z).event(R),Y=this.__zoom,F=Math.max(s[0],Math.min(s[1],Y.k*Math.pow(2,u.apply(this,arguments)))),I=on(R);if(D.wheel)(D.mouse[0][0]!==I[0]||D.mouse[0][1]!==I[1])&&(D.mouse[1]=Y.invert(D.mouse[0]=I)),clearTimeout(D.wheel);else{if(Y.k===F)return;D.mouse=[I,Y.invert(I)],Mo(this),D.start()}pr(R),D.wheel=setTimeout(le,E),D.zoom("mouse",r(_(C(Y,F),D.mouse[0],D.mouse[1]),D.extent,c));function le(){D.wheel=null,D.end()}}function H(R,...Z){if(v||!n.apply(this,arguments))return;var D=R.currentTarget,Y=L(this,Z,!0).event(R),F=Yt(R.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",q,!0),I=on(R,D),le=R.clientX,z=R.clientY;p1(R.view),Df(R),Y.mouse=[I,this.__zoom.invert(I)],Mo(this),Y.start();function V(G){if(pr(G),!Y.moved){var J=G.clientX-le,re=G.clientY-z;Y.moved=J*J+re*re>N}Y.event(G).zoom("mouse",r(_(Y.that.__zoom,Y.mouse[0]=on(G,D),Y.mouse[1]),Y.extent,c))}function q(G){F.on("mousemove.zoom mouseup.zoom",null),y1(G.view,Y.moved),pr(G),Y.event(G).end()}}function $(R,...Z){if(n.apply(this,arguments)){var D=this.__zoom,Y=on(R.changedTouches?R.changedTouches[0]:R,this),F=D.invert(Y),I=D.k*(R.shiftKey?.5:2),le=r(_(C(D,I),Y,F),l.apply(this,Z),c);pr(R),d>0?Yt(this).transition().duration(d).call(B,le,Y,R):Yt(this).call(S.transform,le,Y,R)}}function k(R,...Z){if(n.apply(this,arguments)){var D=R.touches,Y=D.length,F=L(this,Z,R.changedTouches.length===Y).event(R),I,le,z,V;for(Df(R),le=0;le<Y;++le)z=D[le],V=on(z,this),V=[V,this.__zoom.invert(V),z.identifier],F.touch0?!F.touch1&&F.touch0[2]!==V[2]&&(F.touch1=V,F.taps=0):(F.touch0=V,I=!0,F.taps=1+!!p);p&&(p=clearTimeout(p)),I&&(F.taps<2&&(y=V[0],p=setTimeout(function(){p=null},b)),Mo(this),F.start())}}function Q(R,...Z){if(this.__zooming){var D=L(this,Z).event(R),Y=R.changedTouches,F=Y.length,I,le,z,V;for(pr(R),I=0;I<F;++I)le=Y[I],z=on(le,this),D.touch0&&D.touch0[2]===le.identifier?D.touch0[0]=z:D.touch1&&D.touch1[2]===le.identifier&&(D.touch1[0]=z);if(le=D.that.__zoom,D.touch1){var q=D.touch0[0],G=D.touch0[1],J=D.touch1[0],re=D.touch1[1],se=(se=J[0]-q[0])*se+(se=J[1]-q[1])*se,ee=(ee=re[0]-G[0])*ee+(ee=re[1]-G[1])*ee;le=C(le,Math.sqrt(se/ee)),z=[(q[0]+J[0])/2,(q[1]+J[1])/2],V=[(G[0]+re[0])/2,(G[1]+re[1])/2]}else if(D.touch0)z=D.touch0[0],V=D.touch0[1];else return;D.zoom("touch",r(_(le,z,V),D.extent,c))}}function P(R,...Z){if(this.__zooming){var D=L(this,Z).event(R),Y=R.changedTouches,F=Y.length,I,le;for(Df(R),v&&clearTimeout(v),v=setTimeout(function(){v=null},b),I=0;I<F;++I)le=Y[I],D.touch0&&D.touch0[2]===le.identifier?delete D.touch0:D.touch1&&D.touch1[2]===le.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(le=on(le,this),Math.hypot(y[0]-le[0],y[1]-le[1])<w)){var z=Yt(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return S.wheelDelta=function(R){return arguments.length?(u=typeof R=="function"?R:go(+R),S):u},S.filter=function(R){return arguments.length?(n=typeof R=="function"?R:go(!!R),S):n},S.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:go(!!R),S):o},S.extent=function(R){return arguments.length?(l=typeof R=="function"?R:go([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),S):l},S.scaleExtent=function(R){return arguments.length?(s[0]=+R[0],s[1]=+R[1],S):[s[0],s[1]]},S.translateExtent=function(R){return arguments.length?(c[0][0]=+R[0][0],c[1][0]=+R[1][0],c[0][1]=+R[0][1],c[1][1]=+R[1][1],S):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},S.constrain=function(R){return arguments.length?(r=R,S):r},S.duration=function(R){return arguments.length?(d=+R,S):d},S.interpolate=function(R){return arguments.length?(h=R,S):h},S.on=function(){var R=g.on.apply(g,arguments);return R===g?S:R},S.clickDistance=function(R){return arguments.length?(N=(R=+R)*R,S):Math.sqrt(N)},S.tapDistance=function(R){return arguments.length?(w=+R,S):w},S}const mn={error001:(n="react")=>`Seems like you have not used ${n==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${n}flow.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:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:l,sourceHandle:r,targetHandle:u})=>`Couldn't create edge for ${n} handle id: "${n==="source"?r:u}", edge id: ${l}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/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.",error016:n=>`Edge with id "${n}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Cr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],j1=["Enter"," ","Escape"],L1={"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:n,x:l,y:r})=>`Moved selected node ${n}. New position, x: ${l}, y: ${r}`,"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 ui;(function(n){n.Strict="strict",n.Loose="loose"})(ui||(ui={}));var il;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(il||(il={}));var Mr;(function(n){n.Partial="partial",n.Full="full"})(Mr||(Mr={}));const H1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var za;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(za||(za={}));var Tr;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Tr||(Tr={}));var xe;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(xe||(xe={}));const Z0={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top},B1=n=>!!n&&typeof n=="object"&&"id"in n&&"source"in n&&"target"in n,jC=n=>!!n&&typeof n=="object"&&"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),yh=n=>!!n&&typeof n=="object"&&"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),Br=(n,l=[0,0])=>{const{width:r,height:u}=yn(n),o=n.origin??l,s=r*o[0],c=u*o[1];return{x:n.position.x-s,y:n.position.y-c}},LC=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};let r=!1;const u=n.reduce((o,s)=>{const c=typeof s=="string";let d=!l.nodeLookup&&!c?s:void 0;return l.nodeLookup&&(d=c?l.nodeLookup.get(s):yh(s)?s:l.nodeLookup.get(s.id)),d?(r=!0,Fo(o,Bo(d,l.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return r?Wo(u):{x:0,y:0,width:0,height:0}},Ur=(n,l={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},u=!1;return n.forEach(o=>{(l.filter===void 0||l.filter(o))&&(r=Fo(r,Bo(o)),u=!0)}),u?Wo(r):{x:0,y:0,width:0,height:0}},vh=(n,l,[r,u,o]=[0,0,1],s=!1,c=!1)=>{const d=(l.x-r)/o,h=(l.y-u)/o,g=l.width/o,p=l.height/o,y=[];for(const v of n.values()){const{measured:b,selectable:E=!0,hidden:N=!1}=v;if(c&&!E||N)continue;const w=b.width??v.width??v.initialWidth??0,S=b.height??v.height??v.initialHeight??0,{x:C,y:_}=v.internals.positionAbsolute,M=Y1(d,h,g,p,C,_,w,S),B=w*S,L=s&&M>0;(!v.internals.handleBounds||L||M>=B||v.dragging)&&y.push(v)}return y},HC=(n,l)=>{const r=new Set;return n.forEach(u=>{r.add(u.id)}),l.filter(u=>r.has(u.source)||r.has(u.target))};function BC(n,l){const r=new Map,u=l!=null&&l.nodes?new Set(l.nodes.map(o=>o.id)):null;return n.forEach(o=>{let s;if(l!=null&&l.includeHiddenNodes){const{width:c,height:d}=yn(o);s=c>0&&d>0}else s=!!(o.measured.width&&o.measured.height&&!o.hidden);s&&(!u||u.has(o.id))&&r.set(o.id,o)}),r}async function UC({nodes:n,width:l,height:r,panZoom:u,minZoom:o,maxZoom:s},c){if(n.size===0)return!0;const d=BC(n,c),h=Ur(d),g=xh(h,l,r,(c==null?void 0:c.minZoom)??o,(c==null?void 0:c.maxZoom)??s,(c==null?void 0:c.padding)??.1);return await u.setViewport(g,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),!0}function U1({nodeId:n,nextPosition:l,nodeLookup:r,nodeOrigin:u=[0,0],nodeExtent:o,onError:s}){const c=r.get(n),d=c.parentId?r.get(c.parentId):void 0,{x:h,y:g}=d?d.internals.positionAbsolute:{x:0,y:0},p=c.origin??u;let y=c.extent||o;if(c.extent==="parent"&&!c.expandParent)if(!d)s==null||s("005",mn.error005());else{const{width:b,height:E}=yn(d);b&&E&&(y=[[h,g],[h+b,g+E]])}else d&&cl(c.extent)&&(y=[[c.extent[0][0]+h,c.extent[0][1]+g],[c.extent[1][0]+h,c.extent[1][1]+g]]);const v=cl(y)?sl(l,y,c.measured):l;return(c.measured.width===void 0||c.measured.height===void 0)&&(s==null||s("015",mn.error015())),{position:{x:v.x-h+(c.measured.width??0)*p[0],y:v.y-g+(c.measured.height??0)*p[1]},positionAbsolute:v}}async function qC({nodesToRemove:n=[],edgesToRemove:l=[],nodes:r,edges:u,onBeforeDelete:o}){const s=new Set(n.map(v=>v.id)),c=[];for(const v of r){if(v.deletable===!1)continue;const b=s.has(v.id),E=!b&&v.parentId&&c.find(N=>N.id===v.parentId);(b||E)&&c.push(v)}const d=new Set(l.map(v=>v.id)),h=u.filter(v=>v.deletable!==!1),p=HC(c,h);for(const v of h)d.has(v.id)&&!p.find(E=>E.id===v.id)&&p.push(v);if(!o)return{edges:p,nodes:c};const y=await o({nodes:c,edges:p});return typeof y=="boolean"?y?{edges:p,nodes:c}:{edges:[],nodes:[]}:y}const oi=(n,l=0,r=1)=>Math.min(Math.max(n,l),r),sl=(n={x:0,y:0},l,r)=>({x:oi(n.x,l[0][0],l[1][0]-((r==null?void 0:r.width)??0)),y:oi(n.y,l[0][1],l[1][1]-((r==null?void 0:r.height)??0))});function q1(n,l,r){const{width:u,height:o}=yn(r),{x:s,y:c}=r.internals.positionAbsolute;return sl(n,[[s,c],[s+u,c+o]],l)}const K0=(n,l,r)=>n<l?oi(Math.abs(n-l),1,l)/l:n>r?-oi(Math.abs(n-r),1,l)/l:0,bh=(n,l,r=15,u=40)=>{const o=K0(n.x,u,l.width-u)*r,s=K0(n.y,u,l.height-u)*r;return[o,s]},Fo=(n,l)=>({x:Math.min(n.x,l.x),y:Math.min(n.y,l.y),x2:Math.max(n.x2,l.x2),y2:Math.max(n.y2,l.y2)}),Zd=({x:n,y:l,width:r,height:u})=>({x:n,y:l,x2:n+r,y2:l+u}),Wo=({x:n,y:l,x2:r,y2:u})=>({x:n,y:l,width:r-n,height:u-l}),Ar=(n,l=[0,0])=>{var o,s;const{x:r,y:u}=yh(n)?n.internals.positionAbsolute:Br(n,l);return{x:r,y:u,width:((o=n.measured)==null?void 0:o.width)??n.width??n.initialWidth??0,height:((s=n.measured)==null?void 0:s.height)??n.height??n.initialHeight??0}},Bo=(n,l=[0,0])=>{var o,s;const{x:r,y:u}=yh(n)?n.internals.positionAbsolute:Br(n,l);return{x:r,y:u,x2:r+(((o=n.measured)==null?void 0:o.width)??n.width??n.initialWidth??0),y2:u+(((s=n.measured)==null?void 0:s.height)??n.height??n.initialHeight??0)}},k1=(n,l)=>Wo(Fo(Zd(n),Zd(l))),Y1=(n,l,r,u,o,s,c,d)=>{const h=Math.max(0,Math.min(n+r,o+c)-Math.max(n,o)),g=Math.max(0,Math.min(l+u,s+d)-Math.max(l,s));return Math.ceil(h*g)},Uo=(n,l)=>Y1(n.x,n.y,n.width,n.height,l.x,l.y,l.width,l.height),I0=n=>cn(n.width)&&cn(n.height)&&cn(n.x)&&cn(n.y),cn=n=>!isNaN(n)&&isFinite(n),V1=(n,l)=>(r,u)=>{},qr=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),kr=({x:n,y:l},[r,u,o],s=!1,c=[1,1])=>{const d={x:(n-r)/o,y:(l-u)/o};return s?qr(d,c):d},si=({x:n,y:l},[r,u,o])=>({x:n*o+r,y:l*o+u});function ei(n,l){if(typeof n=="number")return Math.floor((l-l/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const r=parseFloat(n);if(!Number.isNaN(r))return Math.floor(r)}if(typeof n=="string"&&n.endsWith("%")){const r=parseFloat(n);if(!Number.isNaN(r))return Math.floor(l*r*.01)}return console.error(`The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function kC(n,l,r){if(typeof n=="string"||typeof n=="number"){const u=ei(n,r),o=ei(n,l);return{top:u,right:o,bottom:u,left:o,x:o*2,y:u*2}}if(typeof n=="object"){const u=ei(n.top??n.y??0,r),o=ei(n.bottom??n.y??0,r),s=ei(n.left??n.x??0,l),c=ei(n.right??n.x??0,l);return{top:u,right:c,bottom:o,left:s,x:s+c,y:u+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function YC(n,l,r,u,o,s){const{x:c,y:d}=si(n,[l,r,u]),{x:h,y:g}=si({x:n.x+n.width,y:n.y+n.height},[l,r,u]),p=o-h,y=s-g;return{left:Math.floor(c),top:Math.floor(d),right:Math.floor(p),bottom:Math.floor(y)}}const xh=(n,l,r,u,o,s)=>{const c=kC(s,l,r),d=(l-c.x)/n.width,h=(r-c.y)/n.height,g=Math.min(d,h),p=oi(g,u,o),y=n.x+n.width/2,v=n.y+n.height/2,b=l/2-y*p,E=r/2-v*p,N=YC(n,b,E,p,l,r),w={left:Math.min(N.left-c.left,0),top:Math.min(N.top-c.top,0),right:Math.min(N.right-c.right,0),bottom:Math.min(N.bottom-c.bottom,0)};return{x:b-w.left+w.right,y:E-w.top+w.bottom,zoom:p}},Rr=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function cl(n){return n!=null&&n!=="parent"}function yn(n){var l,r;return{width:((l=n.measured)==null?void 0:l.width)??n.width??n.initialWidth??0,height:((r=n.measured)==null?void 0:r.height)??n.height??n.initialHeight??0}}function G1(n){var l,r;return(((l=n.measured)==null?void 0:l.width)??n.width??n.initialWidth)!==void 0&&(((r=n.measured)==null?void 0:r.height)??n.height??n.initialHeight)!==void 0}function X1(n,l={width:0,height:0},r,u,o){const s={...n},c=u.get(r);if(c){const d=c.origin||o;s.x+=c.internals.positionAbsolute.x-(l.width??0)*d[0],s.y+=c.internals.positionAbsolute.y-(l.height??0)*d[1]}return s}function J0(n,l){if(n.size!==l.size)return!1;for(const r of n)if(!l.has(r))return!1;return!0}function VC(){let n,l;return{promise:new Promise((u,o)=>{n=u,l=o}),resolve:n,reject:l}}function GC(n){return{...L1,...n||{}}}function $1(n){return n===null?null:n?"valid":"invalid"}function Er(n,{snapGrid:l=[0,0],snapToGrid:r=!1,transform:u,containerBounds:o}){const{x:s,y:c}=fn(n),d=kr({x:s-((o==null?void 0:o.left)??0),y:c-((o==null?void 0:o.top)??0)},u),{x:h,y:g}=r?qr(d,l):d;return{xSnapped:h,ySnapped:g,...d}}const Eh=n=>({width:n.offsetWidth,height:n.offsetHeight}),Q1=n=>{var l;return((l=n==null?void 0:n.getRootNode)==null?void 0:l.call(n))||(window==null?void 0:window.document)},XC=["INPUT","SELECT","TEXTAREA"];function Z1(n){var u,o;const l=((o=(u=n.composedPath)==null?void 0:u.call(n))==null?void 0:o[0])||n.target;return(l==null?void 0:l.nodeType)!==1?!1:XC.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const K1=n=>"clientX"in n,fn=(n,l)=>{var s,c;const r=K1(n),u=r?n.clientX:(s=n.touches)==null?void 0:s[0].clientX,o=r?n.clientY:(c=n.touches)==null?void 0:c[0].clientY;return{x:u-((l==null?void 0:l.left)??0),y:o-((l==null?void 0:l.top)??0)}},F0=(n,l,r,u,o)=>{const s=l.querySelectorAll(`.${n}`);return!s||!s.length?null:Array.from(s).map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:n,nodeId:o,position:c.getAttribute("data-handlepos"),x:(d.left-r.left)/u,y:(d.top-r.top)/u,...Eh(c)}})};function I1({sourceX:n,sourceY:l,targetX:r,targetY:u,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:d}){const h=n*.125+o*.375+c*.375+r*.125,g=l*.125+s*.375+d*.375+u*.125,p=Math.abs(h-n),y=Math.abs(g-l);return[h,g,p,y]}function po(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function W0({pos:n,x1:l,y1:r,x2:u,y2:o,c:s}){switch(n){case xe.Left:return[l-po(l-u,s),r];case xe.Right:return[l+po(u-l,s),r];case xe.Top:return[l,r-po(r-o,s)];case xe.Bottom:return[l,r+po(o-r,s)]}}function J1({sourceX:n,sourceY:l,sourcePosition:r=xe.Bottom,targetX:u,targetY:o,targetPosition:s=xe.Top,curvature:c=.25}){const[d,h]=W0({pos:r,x1:n,y1:l,x2:u,y2:o,c}),[g,p]=W0({pos:s,x1:u,y1:o,x2:n,y2:l,c}),[y,v,b,E]=I1({sourceX:n,sourceY:l,targetX:u,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:g,targetControlY:p});return[`M${n},${l} C${d},${h} ${g},${p} ${u},${o}`,y,v,b,E]}function F1({sourceX:n,sourceY:l,targetX:r,targetY:u}){const o=Math.abs(r-n)/2,s=r<n?r+o:r-o,c=Math.abs(u-l)/2,d=u<l?u+c:u-c;return[s,d,o,c]}function $C({sourceNode:n,targetNode:l,selected:r=!1,zIndex:u=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return u;const c=o&&r?u+1e3:u,d=Math.max(n.parentId||o&&n.selected?n.internals.z:0,l.parentId||o&&l.selected?l.internals.z:0);return c+d}function QC({sourceNode:n,targetNode:l,width:r,height:u,transform:o}){const s=Fo(Bo(n),Bo(l));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:u/o[2]};return Uo(c,Wo(s))>0}const ZC=({source:n,sourceHandle:l,target:r,targetHandle:u})=>`xy-edge__${n}${l||""}-${r}${u||""}`,KC=(n,l)=>l.some(r=>r.source===n.source&&r.target===n.target&&(r.sourceHandle===n.sourceHandle||!r.sourceHandle&&!n.sourceHandle)&&(r.targetHandle===n.targetHandle||!r.targetHandle&&!n.targetHandle)),IC=(n,l,r={})=>{var s;if(!n.source||!n.target)return(s=r.onError)==null||s.call(r,"006",mn.error006()),l;const u=r.getEdgeId||ZC;let o;return B1(n)?o={...n}:o={...n,id:u(n)},KC(o,l)?l:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,l.concat(o))};function W1({sourceX:n,sourceY:l,targetX:r,targetY:u}){const[o,s,c,d]=F1({sourceX:n,sourceY:l,targetX:r,targetY:u});return[`M ${n},${l}L ${r},${u}`,o,s,c,d]}const P0={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},JC=({source:n,sourcePosition:l=xe.Bottom,target:r})=>l===xe.Left||l===xe.Right?n.x<r.x?{x:1,y:0}:{x:-1,y:0}:n.y<r.y?{x:0,y:1}:{x:0,y:-1},ey=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function FC({source:n,sourcePosition:l=xe.Bottom,target:r,targetPosition:u=xe.Top,center:o,offset:s,stepPosition:c}){const d=P0[l],h=P0[u],g={x:n.x+d.x*s,y:n.y+d.y*s},p={x:r.x+h.x*s,y:r.y+h.y*s},y=JC({source:g,sourcePosition:l,target:p}),v=y.x!==0?"x":"y",b=y[v];let E=[],N,w;const S={x:0,y:0},C={x:0,y:0},[,,_,M]=F1({sourceX:n.x,sourceY:n.y,targetX:r.x,targetY:r.y});if(d[v]*h[v]===-1){v==="x"?(N=o.x??g.x+(p.x-g.x)*c,w=o.y??(g.y+p.y)/2):(N=o.x??(g.x+p.x)/2,w=o.y??g.y+(p.y-g.y)*c);const O=[{x:N,y:g.y},{x:N,y:p.y}],H=[{x:g.x,y:w},{x:p.x,y:w}];d[v]===b?E=v==="x"?O:H:E=v==="x"?H:O}else{const O=[{x:g.x,y:p.y}],H=[{x:p.x,y:g.y}];if(v==="x"?E=d.x===b?H:O:E=d.y===b?O:H,l===u){const R=Math.abs(n[v]-r[v]);if(R<=s){const Z=Math.min(s-1,s-R);d[v]===b?S[v]=(g[v]>n[v]?-1:1)*Z:C[v]=(p[v]>r[v]?-1:1)*Z}}if(l!==u){const R=v==="x"?"y":"x",Z=d[v]===h[R],D=g[R]>p[R],Y=g[R]<p[R];(d[v]===1&&(!Z&&D||Z&&Y)||d[v]!==1&&(!Z&&Y||Z&&D))&&(E=v==="x"?O:H)}const $={x:g.x+S.x,y:g.y+S.y},k={x:p.x+C.x,y:p.y+C.y},Q=Math.max(Math.abs($.x-E[0].x),Math.abs(k.x-E[0].x)),P=Math.max(Math.abs($.y-E[0].y),Math.abs(k.y-E[0].y));Q>=P?(N=($.x+k.x)/2,w=E[0].y):(N=E[0].x,w=($.y+k.y)/2)}const B={x:g.x+S.x,y:g.y+S.y},L={x:p.x+C.x,y:p.y+C.y};return[[n,...B.x!==E[0].x||B.y!==E[0].y?[B]:[],...E,...L.x!==E[E.length-1].x||L.y!==E[E.length-1].y?[L]:[],r],N,w,_,M]}function WC(n,l,r,u){const o=Math.min(ey(n,l)/2,ey(l,r)/2,u),{x:s,y:c}=l;if(n.x===s&&s===r.x||n.y===c&&c===r.y)return`L${s} ${c}`;if(n.y===c){const g=n.x<r.x?-1:1,p=n.y<r.y?1:-1;return`L ${s+o*g},${c}Q ${s},${c} ${s},${c+o*p}`}const d=n.x<r.x?1:-1,h=n.y<r.y?-1:1;return`L ${s},${c+o*h}Q ${s},${c} ${s+o*d},${c}`}function Kd({sourceX:n,sourceY:l,sourcePosition:r=xe.Bottom,targetX:u,targetY:o,targetPosition:s=xe.Top,borderRadius:c=5,centerX:d,centerY:h,offset:g=20,stepPosition:p=.5}){const[y,v,b,E,N]=FC({source:{x:n,y:l},sourcePosition:r,target:{x:u,y:o},targetPosition:s,center:{x:d,y:h},offset:g,stepPosition:p});let w=`M${y[0].x} ${y[0].y}`;for(let S=1;S<y.length-1;S++)w+=WC(y[S-1],y[S],y[S+1],c);return w+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[w,v,b,E,N]}function ty(n){var l;return n&&!!(n.internals.handleBounds||(l=n.handles)!=null&&l.length)&&!!(n.measured.width||n.width||n.initialWidth)}function PC(n){var y;const{sourceNode:l,targetNode:r}=n;if(!ty(l)||!ty(r))return null;const u=l.internals.handleBounds||ny(l.handles),o=r.internals.handleBounds||ny(r.handles),s=ay((u==null?void 0:u.source)??[],n.sourceHandle),c=ay(n.connectionMode===ui.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),n.targetHandle);if(!s||!c)return(y=n.onError)==null||y.call(n,"008",mn.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const d=(s==null?void 0:s.position)||xe.Bottom,h=(c==null?void 0:c.position)||xe.Top,g=fl(l,s,d),p=fl(r,c,h);return{sourceX:g.x,sourceY:g.y,targetX:p.x,targetY:p.y,sourcePosition:d,targetPosition:h}}function ny(n){if(!n)return null;const l=[],r=[];for(const u of n)u.width=u.width??1,u.height=u.height??1,u.type==="source"?l.push(u):u.type==="target"&&r.push(u);return{source:l,target:r}}function fl(n,l,r=xe.Left,u=!1){const o=((l==null?void 0:l.x)??0)+n.internals.positionAbsolute.x,s=((l==null?void 0:l.y)??0)+n.internals.positionAbsolute.y,{width:c,height:d}=l??yn(n);if(u)return{x:o+c/2,y:s+d/2};switch((l==null?void 0:l.position)??r){case xe.Top:return{x:o+c/2,y:s};case xe.Right:return{x:o+c,y:s+d/2};case xe.Bottom:return{x:o+c/2,y:s+d};case xe.Left:return{x:o,y:s+d/2}}}function ay(n,l){return n&&(l?n.find(r=>r.id===l):n[0])||null}function Id(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(u=>`${u}=${n[u]}`).join("&")}`:""}function eM(n,{id:l,defaultColor:r,defaultMarkerStart:u,defaultMarkerEnd:o}){const s=new Set;return n.reduce((c,d)=>([d.markerStart||u,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const g=Id(h,l);s.has(g)||(c.push({id:g,color:h.color||r,...h}),s.add(g))}}),c),[]).sort((c,d)=>c.id.localeCompare(d.id))}const P1=1e3,tM=10,Sh={nodeOrigin:[0,0],nodeExtent:Cr,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nM={...Sh,checkEquality:!0};function wh(n,l){const r={...n};for(const u in l)l[u]!==void 0&&(r[u]=l[u]);return r}function aM(n,l,r){const u=wh(Sh,r);for(const o of n.values())if(o.parentId)Nh(o,n,l,u);else{const s=Br(o,u.nodeOrigin),c=cl(o.extent)?o.extent:u.nodeExtent,d=sl(s,c,yn(o));o.internals.positionAbsolute=d}}function lM(n,l){if(!n.handles)return n.measured?l==null?void 0:l.internals.handleBounds:void 0;const r=[],u=[];for(const o of n.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:n.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?r.push(s):o.type==="target"&&u.push(s)}return{source:r,target:u}}function _h(n){return n==="manual"}function Jd(n,l,r,u={}){var p,y;const o=wh(nM,u),s={i:0},c=new Map(l),d=o!=null&&o.elevateNodesOnSelect&&!_h(o.zIndexMode)?P1:0;let h=n.length>0,g=!1;l.clear(),r.clear();for(const v of n){let b=c.get(v.id);if(o.checkEquality&&v===(b==null?void 0:b.internals.userNode))l.set(v.id,b);else{const E=Br(v,o.nodeOrigin),N=cl(v.extent)?v.extent:o.nodeExtent,w=sl(E,N,yn(v));b={...o.defaults,...v,measured:{width:(p=v.measured)==null?void 0:p.width,height:(y=v.measured)==null?void 0:y.height},internals:{positionAbsolute:w,handleBounds:lM(v,b),z:eb(v,d,o.zIndexMode),userNode:v}},l.set(v.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(h=!1),v.parentId&&Nh(b,l,r,u,s),g||(g=v.selected??!1)}return{nodesInitialized:h,hasSelectedNodes:g}}function iM(n,l){if(!n.parentId)return;const r=l.get(n.parentId);r?r.set(n.id,n):l.set(n.parentId,new Map([[n.id,n]]))}function Nh(n,l,r,u,o){const{elevateNodesOnSelect:s,nodeOrigin:c,nodeExtent:d,zIndexMode:h}=wh(Sh,u),g=n.parentId,p=l.get(g);if(!p){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}iM(n,r),o&&!p.parentId&&p.internals.rootParentIndex===void 0&&h==="auto"&&(p.internals.rootParentIndex=++o.i,p.internals.z=p.internals.z+o.i*tM),o&&p.internals.rootParentIndex!==void 0&&(o.i=p.internals.rootParentIndex);const y=s&&!_h(h)?P1:0,{x:v,y:b,z:E}=rM(n,p,c,d,y,h),{positionAbsolute:N}=n.internals,w=v!==N.x||b!==N.y;(w||E!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:w?{x:v,y:b}:N,z:E}})}function eb(n,l,r){const u=cn(n.zIndex)?n.zIndex:0;return _h(r)?u:u+(n.selected?l:0)}function rM(n,l,r,u,o,s){const{x:c,y:d}=l.internals.positionAbsolute,h=yn(n),g=Br(n,r),p=cl(n.extent)?sl(g,n.extent,h):g;let y=sl({x:c+p.x,y:d+p.y},u,h);n.extent==="parent"&&(y=q1(y,h,l));const v=eb(n,o,s),b=l.internals.z??0;return{x:y.x,y:y.y,z:b>=v?b+1:v}}function Ch(n,l,r,u=[0,0]){var c;const o=[],s=new Map;for(const d of n){const h=l.get(d.parentId);if(!h)continue;const g=((c=s.get(d.parentId))==null?void 0:c.expandedRect)??Ar(h),p=k1(g,d.rect);s.set(d.parentId,{expandedRect:p,parent:h})}return s.size>0&&s.forEach(({expandedRect:d,parent:h},g)=>{var _;const p=h.internals.positionAbsolute,y=yn(h),v=h.origin??u,b=d.x<p.x?Math.round(Math.abs(p.x-d.x)):0,E=d.y<p.y?Math.round(Math.abs(p.y-d.y)):0,N=Math.max(y.width,Math.round(d.width)),w=Math.max(y.height,Math.round(d.height)),S=(N-y.width)*v[0],C=(w-y.height)*v[1];(b>0||E>0||S||C)&&(o.push({id:g,type:"position",position:{x:h.position.x-b+S,y:h.position.y-E+C}}),(_=r.get(g))==null||_.forEach(M=>{n.some(B=>B.id===M.id)||o.push({id:M.id,type:"position",position:{x:M.position.x+b,y:M.position.y+E}})})),(y.width<d.width||y.height<d.height||b||E)&&o.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:N+(b?v[0]*b-S:0),height:w+(E?v[1]*E-C:0)}})}),o}function uM(n,l,r,u,o,s,c){const d=u==null?void 0:u.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const g=[],p=window.getComputedStyle(d),{m22:y}=new window.DOMMatrixReadOnly(p.transform),v=[];for(const b of n.values()){const E=l.get(b.id);if(!E)continue;if(E.hidden){l.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const N=Eh(b.nodeElement),w=E.measured.width!==N.width||E.measured.height!==N.height;if(!!(N.width&&N.height&&(w||!E.internals.handleBounds||b.force))){const C=b.nodeElement.getBoundingClientRect(),_=cl(E.extent)?E.extent:s;let{positionAbsolute:M}=E.internals;if(E.parentId&&E.extent==="parent"){const L=l.get(E.parentId);L&&(M=q1(M,N,L))}else _&&(M=sl(M,_,N));const B={...E,measured:N,internals:{...E.internals,positionAbsolute:M,handleBounds:{source:F0("source",b.nodeElement,C,y,E.id),target:F0("target",b.nodeElement,C,y,E.id)}}};l.set(E.id,B),E.parentId&&Nh(B,l,r,{nodeOrigin:o,zIndexMode:c}),h=!0,w&&(g.push({id:E.id,type:"dimensions",dimensions:N}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:Ar(B,o)}))}}if(v.length>0){const b=Ch(v,l,r,o);g.push(...b)}return{changes:g,updatedInternals:h}}async function oM({delta:n,panZoom:l,transform:r,translateExtent:u,width:o,height:s}){if(!l||!n.x&&!n.y)return!1;const c=await l.setViewportConstrained({x:r[0]+n.x,y:r[1]+n.y,zoom:r[2]},[[0,0],[o,s]],u);return!!c&&(c.x!==r[0]||c.y!==r[1]||c.k!==r[2])}function ly(n,l,r,u,o,s){let c=o;const d=u.get(c)||new Map;u.set(c,d.set(r,l)),c=`${o}-${n}`;const h=u.get(c)||new Map;if(u.set(c,h.set(r,l)),s){c=`${o}-${n}-${s}`;const g=u.get(c)||new Map;u.set(c,g.set(r,l))}}function tb(n,l,r){n.clear(),l.clear();for(const u of r){const{source:o,target:s,sourceHandle:c=null,targetHandle:d=null}=u,h={edgeId:u.id,source:o,target:s,sourceHandle:c,targetHandle:d},g=`${o}-${c}--${s}-${d}`,p=`${s}-${d}--${o}-${c}`;ly("source",h,p,n,o,c),ly("target",h,g,n,s,d),l.set(u.id,u)}}function nb(n,l){if(!n.parentId)return!1;const r=l.get(n.parentId);return r?r.selected?!0:nb(r,l):!1}function iy(n,l,r){var o;let u=n;do{if((o=u==null?void 0:u.matches)!=null&&o.call(u,l))return!0;if(u===r)return!1;u=u==null?void 0:u.parentElement}while(u);return!1}function sM(n,l,r,u){const o=new Map;for(const[s,c]of n)if((c.selected||c.id===u)&&(!c.parentId||!nb(c,n))&&(c.draggable||l&&typeof c.draggable>"u")){const d=n.get(s);d&&o.set(s,{id:s,position:d.position||{x:0,y:0},distance:{x:r.x-d.internals.positionAbsolute.x,y:r.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function jf({nodeId:n,dragItems:l,nodeLookup:r,dragging:u=!0}){var c,d,h;const o=[];for(const[g,p]of l){const y=(c=r.get(g))==null?void 0:c.internals.userNode;y&&o.push({...y,position:p.position,dragging:u})}if(!n)return[o[0],o];const s=(d=r.get(n))==null?void 0:d.internals.userNode;return[s?{...s,position:((h=l.get(n))==null?void 0:h.position)||s.position,dragging:u}:o[0],o]}function cM({dragItems:n,snapGrid:l,x:r,y:u}){const o=n.values().next().value;if(!o)return null;const s={x:r-o.distance.x,y:u-o.distance.y},c=qr(s,l);return{x:c.x-s.x,y:c.y-s.y}}function fM({onNodeMouseDown:n,getStoreItems:l,onDragStart:r,onDrag:u,onDragStop:o}){let s={x:null,y:null},c=0,d=new Map,h=!1,g={x:0,y:0},p=null,y=!1,v=null,b=!1,E=!1,N=null;function w({noDragClassName:C,handleSelector:_,domNode:M,isSelectable:B,nodeId:L,nodeClickDistance:U=0}){v=Yt(M);function O({x:Q,y:P}){const{nodeLookup:R,nodeExtent:Z,snapGrid:D,snapToGrid:Y,nodeOrigin:F,onNodeDrag:I,onSelectionDrag:le,onError:z,updateNodePositions:V}=l();s={x:Q,y:P};let q=!1;const G=d.size>1,J=G&&Z?Zd(Ur(d)):null,re=G&&Y?cM({dragItems:d,snapGrid:D,x:Q,y:P}):null;for(const[se,ee]of d){if(!R.has(se))continue;let fe={x:Q-ee.distance.x,y:P-ee.distance.y};Y&&(fe=re?{x:Math.round(fe.x+re.x),y:Math.round(fe.y+re.y)}:qr(fe,D));let ge=null;if(G&&Z&&!ee.extent&&J){const{positionAbsolute:ne}=ee.internals,he=ne.x-J.x+Z[0][0],pe=ne.x+ee.measured.width-J.x2+Z[1][0],we=ne.y-J.y+Z[0][1],ze=ne.y+ee.measured.height-J.y2+Z[1][1];ge=[[he,we],[pe,ze]]}const{position:be,positionAbsolute:me}=U1({nodeId:se,nextPosition:fe,nodeLookup:R,nodeExtent:ge||Z,nodeOrigin:F,onError:z});q=q||ee.position.x!==be.x||ee.position.y!==be.y,ee.position=be,ee.internals.positionAbsolute=me}if(E=E||q,!!q&&(V(d,!0),N&&(u||I||!L&&le))){const[se,ee]=jf({nodeId:L,dragItems:d,nodeLookup:R});u==null||u(N,d,se,ee),I==null||I(N,se,ee),L||le==null||le(N,ee)}}async function H(){if(!p)return;const{transform:Q,panBy:P,autoPanSpeed:R,autoPanOnNodeDrag:Z}=l();if(!Z){h=!1,cancelAnimationFrame(c);return}const[D,Y]=bh(g,p,R);(D!==0||Y!==0)&&(s.x=(s.x??0)-D/Q[2],s.y=(s.y??0)-Y/Q[2],await P({x:D,y:Y})&&O(s)),c=requestAnimationFrame(H)}function $(Q){var G;const{nodeLookup:P,multiSelectionActive:R,nodesDraggable:Z,transform:D,snapGrid:Y,snapToGrid:F,selectNodesOnDrag:I,onNodeDragStart:le,onSelectionDragStart:z,unselectNodesAndEdges:V}=l();y=!0,(!I||!B)&&!R&&L&&((G=P.get(L))!=null&&G.selected||V()),B&&I&&L&&(n==null||n(L));const q=Er(Q.sourceEvent,{transform:D,snapGrid:Y,snapToGrid:F,containerBounds:p});if(s=q,d=sM(P,Z,q,L),d.size>0&&(r||le||!L&&z)){const[J,re]=jf({nodeId:L,dragItems:d,nodeLookup:P});r==null||r(Q.sourceEvent,d,J,re),le==null||le(Q.sourceEvent,J,re),L||z==null||z(Q.sourceEvent,re)}}const k=v1().clickDistance(U).on("start",Q=>{const{domNode:P,nodeDragThreshold:R,transform:Z,snapGrid:D,snapToGrid:Y}=l();p=(P==null?void 0:P.getBoundingClientRect())||null,b=!1,E=!1,N=Q.sourceEvent,R===0&&$(Q),s=Er(Q.sourceEvent,{transform:Z,snapGrid:D,snapToGrid:Y,containerBounds:p}),g=fn(Q.sourceEvent,p)}).on("drag",Q=>{const{autoPanOnNodeDrag:P,transform:R,snapGrid:Z,snapToGrid:D,nodeDragThreshold:Y,nodeLookup:F}=l(),I=Er(Q.sourceEvent,{transform:R,snapGrid:Z,snapToGrid:D,containerBounds:p});if(N=Q.sourceEvent,(Q.sourceEvent.type==="touchmove"&&Q.sourceEvent.touches.length>1||L&&!F.has(L))&&(b=!0),!b){if(!h&&P&&y&&(h=!0,H()),!y){const le=fn(Q.sourceEvent,p),z=le.x-g.x,V=le.y-g.y;Math.sqrt(z*z+V*V)>Y&&$(Q)}(s.x!==I.xSnapped||s.y!==I.ySnapped)&&d&&y&&(g=fn(Q.sourceEvent,p),O(I))}}).on("end",Q=>{if(!y||b){b&&d.size>0&&l().updateNodePositions(d,!1);return}if(h=!1,y=!1,cancelAnimationFrame(c),d.size>0){const{nodeLookup:P,updateNodePositions:R,onNodeDragStop:Z,onSelectionDragStop:D}=l();if(E&&(R(d,!1),E=!1),o||Z||!L&&D){const[Y,F]=jf({nodeId:L,dragItems:d,nodeLookup:P,dragging:!1});o==null||o(Q.sourceEvent,d,Y,F),Z==null||Z(Q.sourceEvent,Y,F),L||D==null||D(Q.sourceEvent,F)}}}).filter(Q=>{const P=Q.target;return!Q.button&&(!C||!iy(P,`.${C}`,M))&&(!_||iy(P,_,M))});v.call(k)}function S(){v==null||v.on(".drag",null)}return{update:w,destroy:S}}function dM(n,l,r){const u=[],o={x:n.x-r,y:n.y-r,width:r*2,height:r*2};for(const s of l.values())Uo(o,Ar(s))>0&&u.push(s);return u}const hM=250;function mM(n,l,r,u){var d,h;let o=[],s=1/0;const c=dM(n,r,l+hM);for(const g of c){const p=[...((d=g.internals.handleBounds)==null?void 0:d.source)??[],...((h=g.internals.handleBounds)==null?void 0:h.target)??[]];for(const y of p){if(u.nodeId===y.nodeId&&u.type===y.type&&u.id===y.id)continue;const{x:v,y:b}=fl(g,y,y.position,!0),E=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(b-n.y,2));E>l||(E<s?(o=[{...y,x:v,y:b}],s=E):E===s&&o.push({...y,x:v,y:b}))}}if(!o.length)return null;if(o.length>1){const g=u.type==="source"?"target":"source";return o.find(p=>p.type===g)??o[0]}return o[0]}function ab(n,l,r,u,o,s=!1){var g,p,y;const c=u.get(n);if(!c)return null;const d=o==="strict"?(g=c.internals.handleBounds)==null?void 0:g[l]:[...((p=c.internals.handleBounds)==null?void 0:p.source)??[],...((y=c.internals.handleBounds)==null?void 0:y.target)??[]],h=(r?d==null?void 0:d.find(v=>v.id===r):d==null?void 0:d[0])??null;return h&&s?{...h,...fl(c,h,h.position,!0)}:h}function lb(n,l){return n||(l!=null&&l.classList.contains("target")?"target":l!=null&&l.classList.contains("source")?"source":null)}function gM(n,l){let r=null;return l?r=!0:n&&!l&&(r=!1),r}const ib=()=>!0;function pM(n,{connectionMode:l,connectionRadius:r,handleId:u,nodeId:o,edgeUpdaterType:s,isTarget:c,domNode:d,nodeLookup:h,lib:g,autoPanOnConnect:p,flowId:y,panBy:v,cancelConnection:b,onConnectStart:E,onConnect:N,onConnectEnd:w,isValidConnection:S=ib,onReconnectEnd:C,updateConnection:_,getTransform:M,getFromHandle:B,autoPanSpeed:L,dragThreshold:U=1,handleDomNode:O}){const H=Q1(n.target);let $=0,k;const{x:Q,y:P}=fn(n),R=lb(s,O),Z=d==null?void 0:d.getBoundingClientRect();let D=!1;if(!Z||!R)return;const Y=ab(o,R,u,h,l);if(!Y)return;let F=fn(n,Z),I=!1,le=null,z=!1,V=null;function q(){if(!p||!Z)return;const[be,me]=bh(F,Z,L);v({x:be,y:me}),$=requestAnimationFrame(q)}const G={...Y,nodeId:o,type:R,position:Y.position},J=h.get(o);let se={inProgress:!0,isValid:null,from:fl(J,G,xe.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:J,to:F,toHandle:null,toPosition:Z0[G.position],toNode:null,pointer:F};function ee(){D=!0,_(se),E==null||E(n,{nodeId:o,handleId:u,handleType:R})}U===0&&ee();function fe(be){if(!D){const{x:ze,y:yt}=fn(be),Et=ze-Q,St=yt-P;if(!(Et*Et+St*St>U*U))return;ee()}if(!B()||!G){ge(be);return}const me=M();F=fn(be,Z),k=mM(kr(F,me,!1,[1,1]),r,h,G),I||(q(),I=!0);const ne=rb(be,{handle:k,connectionMode:l,fromNodeId:o,fromHandleId:u,fromType:c?"target":"source",isValidConnection:S,doc:H,lib:g,flowId:y,nodeLookup:h});V=ne.handleDomNode,le=ne.connection,z=gM(!!k,ne.isValid);const he=h.get(o),pe=he?fl(he,G,xe.Left,!0):se.from,we={...se,from:pe,isValid:z,to:ne.toHandle&&z?si({x:ne.toHandle.x,y:ne.toHandle.y},me):F,toHandle:ne.toHandle,toPosition:z&&ne.toHandle?ne.toHandle.position:Z0[G.position],toNode:ne.toHandle?h.get(ne.toHandle.nodeId):null,pointer:F};_(we),se=we}function ge(be){if(!("touches"in be&&be.touches.length>0)){if(D){(k||V)&&le&&z&&(N==null||N(le));const{inProgress:me,...ne}=se,he={...ne,toPosition:se.toHandle?se.toPosition:null};w==null||w(be,he),s&&(C==null||C(be,he))}b(),cancelAnimationFrame($),I=!1,z=!1,le=null,V=null,H.removeEventListener("mousemove",fe),H.removeEventListener("mouseup",ge),H.removeEventListener("touchmove",fe),H.removeEventListener("touchend",ge)}}H.addEventListener("mousemove",fe),H.addEventListener("mouseup",ge),H.addEventListener("touchmove",fe),H.addEventListener("touchend",ge)}function rb(n,{handle:l,connectionMode:r,fromNodeId:u,fromHandleId:o,fromType:s,doc:c,lib:d,flowId:h,isValidConnection:g=ib,nodeLookup:p}){const y=s==="target",v=l?c.querySelector(`.${d}-flow__handle[data-id="${h}-${l==null?void 0:l.nodeId}-${l==null?void 0:l.id}-${l==null?void 0:l.type}"]`):null,{x:b,y:E}=fn(n),N=c.elementFromPoint(b,E),w=N!=null&&N.classList.contains(`${d}-flow__handle`)?N:v,S={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const C=lb(void 0,w),_=w.getAttribute("data-nodeid"),M=w.getAttribute("data-handleid"),B=w.classList.contains("connectable"),L=w.classList.contains("connectableend");if(!_||!C)return S;const U={source:y?_:u,sourceHandle:y?M:o,target:y?u:_,targetHandle:y?o:M};S.connection=U;const H=B&&L&&(r===ui.Strict?y&&C==="source"||!y&&C==="target":_!==u||M!==o);S.isValid=H&&g(U),S.toHandle=ab(_,C,M,p,r,!0)}return S}const Fd={onPointerDown:pM,isValid:rb};function yM({domNode:n,panZoom:l,getTransform:r,getViewScale:u}){const o=Yt(n);function s({translateExtent:d,width:h,height:g,zoomStep:p=1,pannable:y=!0,zoomable:v=!0,inversePan:b=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!l)return;const M=r(),B=_.sourceEvent.ctrlKey&&Rr()?10:1,L=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*p,U=M[2]*Math.pow(2,L*B);l.scaleTo(U)};let N=[0,0];const w=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(N=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},S=_=>{const M=r();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!l)return;const B=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],L=[B[0]-N[0],B[1]-N[1]];N=B;const U=u()*Math.max(M[2],Math.log(M[2]))*(b?-1:1),O={x:M[0]-L[0]*U,y:M[1]-L[1]*U},H=[[0,0],[h,g]];l.setViewportConstrained({x:O.x,y:O.y,zoom:M[2]},H,d)},C=D1().on("start",w).on("zoom",y?S:null).on("zoom.wheel",v?E:null);o.call(C,{})}function c(){o.on("zoom",null)}return{update:s,destroy:c,pointer:on}}const Po=n=>({x:n.x,y:n.y,zoom:n.k}),Lf=({x:n,y:l,zoom:r})=>Jo.translate(n,l).scale(r),Ra=(n,l)=>n.target.closest(`.${l}`),ub=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),vM=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,Hf=(n,l=0,r=vM,u=()=>{})=>{const o=typeof l=="number"&&l>0;return o||u(),o?n.transition().duration(l).ease(r).on("end",u):n},ob=n=>{const l=n.ctrlKey&&Rr()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function bM({zoomPanValues:n,noWheelClassName:l,d3Selection:r,d3Zoom:u,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:c,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:g}){return p=>{if(Ra(p,l))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const y=r.property("__zoom").k||1;if(p.ctrlKey&&c){const w=on(p),S=ob(p),C=y*Math.pow(2,S);u.scaleTo(r,C,w,p);return}const v=p.deltaMode===1?20:1;let b=o===il.Vertical?0:p.deltaX*v,E=o===il.Horizontal?0:p.deltaY*v;!Rr()&&p.shiftKey&&o!==il.Vertical&&(b=p.deltaY*v,E=0),u.translateBy(r,-(b/y)*s,-(E/y)*s,{internal:!0});const N=Po(r.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?h==null||h(p,N):(n.isPanScrolling=!0,d==null||d(p,N)),n.panScrollTimeout=setTimeout(()=>{g==null||g(p,N),n.isPanScrolling=!1},150)}}function xM({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:r}){return function(u,o){const s=u.type==="wheel",c=!l&&s&&!u.ctrlKey,d=Ra(u,n);if(u.ctrlKey&&s&&d&&u.preventDefault(),c||d)return null;u.preventDefault(),r.call(this,u,o)}}function EM({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:r}){return u=>{var s,c,d;if((s=u.sourceEvent)!=null&&s.internal)return;const o=Po(u.transform);n.mouseButton=((c=u.sourceEvent)==null?void 0:c.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=o,((d=u.sourceEvent)==null?void 0:d.type)==="mousedown"&&l(!0),r&&(r==null||r(u.sourceEvent,o))}}function SM({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:r,onTransformChange:u,onPanZoom:o}){return s=>{var c,d;n.usedRightMouseButton=!!(r&&ub(l,n.mouseButton??0)),(c=s.sourceEvent)!=null&&c.sync||u([s.transform.x,s.transform.y,s.transform.k]),o&&!((d=s.sourceEvent)!=null&&d.internal)&&(o==null||o(s.sourceEvent,Po(s.transform)))}}function wM({zoomPanValues:n,panOnDrag:l,panOnScroll:r,onDraggingChange:u,onPanZoomEnd:o,onPaneContextMenu:s}){return c=>{var d;if(!((d=c.sourceEvent)!=null&&d.internal)&&(n.isZoomingOrPanning=!1,s&&ub(l,n.mouseButton??0)&&!n.usedRightMouseButton&&c.sourceEvent&&s(c.sourceEvent),n.usedRightMouseButton=!1,u(!1),o)){const h=Po(c.transform);n.prevViewport=h,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{o==null||o(c.sourceEvent,h)},r?150:0)}}}function _M({panActivationKeyPressed:n,zoomActivationKeyPressed:l,zoomOnScroll:r,zoomOnPinch:u,panOnDrag:o,panOnScroll:s,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:g,lib:p,connectionInProgress:y}){return v=>{var S;const b=l||r,E=u&&v.ctrlKey,N=v.type==="wheel";if(v.button===1&&v.type==="mousedown"&&(Ra(v,`${p}-flow__node`)||Ra(v,`${p}-flow__edge`)||Ra(v,`${p}-flow__selection`)||Ra(v,`${p}-flow__nodesselection`)))return!0;if(!o&&!b&&!s&&!c&&!u||d||y&&!N||Ra(v,h)&&N||Ra(v,g)&&(!N||s&&N&&!l)||!u&&v.ctrlKey&&N)return!1;if(!u&&v.type==="touchstart"&&((S=v.touches)==null?void 0:S.length)>1)return v.preventDefault(),!1;if(!b&&!s&&!E&&N||!o&&(v.type==="mousedown"||v.type==="touchstart")||Array.isArray(o)&&!o.includes(v.button)&&v.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(v.button)||!v.button||v.button<=1;return(!v.ctrlKey||N||n)&&w}}function NM({domNode:n,minZoom:l,maxZoom:r,translateExtent:u,viewport:o,onPanZoom:s,onPanZoomStart:c,onPanZoomEnd:d,onDraggingChange:h}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=n.getBoundingClientRect();let y=[[0,0],[p.width,p.height]];const v=typeof ResizeObserver<"u"?new ResizeObserver(P=>{const R=P[0];R&&(y=[[0,0],[R.contentRect.width,R.contentRect.height]])}):null;v==null||v.observe(n);const b=D1().extent(()=>y).scaleExtent([l,r]).translateExtent(u),E=Yt(n).call(b);M({x:o.x,y:o.y,zoom:oi(o.zoom,l,r)},[[0,0],[p.width,p.height]],u);const N=E.on("wheel.zoom"),w=E.on("dblclick.zoom");b.wheelDelta(ob);async function S(P,R){return E?new Promise(Z=>{b==null||b.interpolate((R==null?void 0:R.interpolate)==="linear"?xr:_o).transform(Hf(E,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Z(!0)),P)}):!1}function C({noWheelClassName:P,noPanClassName:R,onPaneContextMenu:Z,userSelectionActive:D,panOnScroll:Y,panOnDrag:F,panOnScrollMode:I,panOnScrollSpeed:le,preventScrolling:z,zoomOnPinch:V,zoomOnScroll:q,zoomOnDoubleClick:G,panActivationKeyPressed:J=!1,zoomActivationKeyPressed:re,lib:se,onTransformChange:ee,connectionInProgress:fe,paneClickDistance:ge,selectionOnDrag:be}){D&&!g.isZoomingOrPanning&&_();const me=Y&&!re&&!D;b.clickDistance(be?1/0:!cn(ge)||ge<0?0:ge);const ne=me?bM({zoomPanValues:g,noWheelClassName:P,d3Selection:E,d3Zoom:b,panOnScrollMode:I,panOnScrollSpeed:le,zoomOnPinch:V,onPanZoomStart:c,onPanZoom:s,onPanZoomEnd:d}):xM({noWheelClassName:P,preventScrolling:z,d3ZoomHandler:N});E.on("wheel.zoom",ne,{passive:!1});const he=EM({zoomPanValues:g,onDraggingChange:h,onPanZoomStart:c});b.on("start",he);const pe=SM({zoomPanValues:g,panOnDrag:F,onPaneContextMenu:!!Z,onPanZoom:s,onTransformChange:ee});b.on("zoom",pe);const we=wM({zoomPanValues:g,panOnDrag:F,panOnScroll:Y,onPaneContextMenu:Z,onPanZoomEnd:d,onDraggingChange:h});b.on("end",we);const ze=_M({panActivationKeyPressed:J,zoomActivationKeyPressed:re,panOnDrag:F,zoomOnScroll:q,panOnScroll:Y,zoomOnDoubleClick:G,zoomOnPinch:V,userSelectionActive:D,noPanClassName:R,noWheelClassName:P,lib:se,connectionInProgress:fe});b.filter(ze),G?E.on("dblclick.zoom",w):E.on("dblclick.zoom",null)}function _(){b.on("zoom",null)}async function M(P,R,Z){const D=Lf(P),Y=b==null?void 0:b.constrain()(D,R,Z);return Y&&await S(Y),Y}async function B(P,R){const Z=Lf(P);return await S(Z,R),Z}function L(P){if(E){const R=Lf(P),Z=E.property("__zoom");(Z.k!==P.zoom||Z.x!==P.x||Z.y!==P.y)&&(b==null||b.transform(E,R,null,{sync:!0}))}}function U(){const P=E?O1(E.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}async function O(P,R){return E?new Promise(Z=>{b==null||b.interpolate((R==null?void 0:R.interpolate)==="linear"?xr:_o).scaleTo(Hf(E,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Z(!0)),P)}):!1}async function H(P,R){return E?new Promise(Z=>{b==null||b.interpolate((R==null?void 0:R.interpolate)==="linear"?xr:_o).scaleBy(Hf(E,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Z(!0)),P)}):!1}function $(P){b==null||b.scaleExtent(P)}function k(P){b==null||b.translateExtent(P)}function Q(P){const R=!cn(P)||P<0?0:P;b==null||b.clickDistance(R)}return{update:C,destroy:_,setViewport:B,setViewportConstrained:M,getViewport:U,scaleTo:O,scaleBy:H,setScaleExtent:$,setTranslateExtent:k,syncViewport:L,setClickDistance:Q}}var ci;(function(n){n.Line="line",n.Handle="handle"})(ci||(ci={}));function CM({width:n,prevWidth:l,height:r,prevHeight:u,affectsX:o,affectsY:s}){const c=n-l,d=r-u,h=[c>0?1:c<0?-1:0,d>0?1:d<0?-1:0];return c&&o&&(h[0]=h[0]*-1),d&&s&&(h[1]=h[1]*-1),h}function ry(n){const l=n.includes("right")||n.includes("left"),r=n.includes("bottom")||n.includes("top"),u=n.includes("left"),o=n.includes("top");return{isHorizontal:l,isVertical:r,affectsX:u,affectsY:o}}function Ta(n,l){return Math.max(0,l-n)}function Aa(n,l){return Math.max(0,n-l)}function yo(n,l,r){return Math.max(0,l-n,n-r)}function uy(n,l){return n?!l:l}function MM(n,l,r,u,o,s,c,d){let{affectsX:h,affectsY:g}=l;const{isHorizontal:p,isVertical:y}=l,v=p&&y,{xSnapped:b,ySnapped:E}=r,{minWidth:N,maxWidth:w,minHeight:S,maxHeight:C}=u,{x:_,y:M,width:B,height:L,aspectRatio:U}=n;let O=Math.floor(p?b-n.pointerX:0),H=Math.floor(y?E-n.pointerY:0);const $=B+(h?-O:O),k=L+(g?-H:H),Q=-s[0]*B,P=-s[1]*L;let R=yo($,N,w),Z=yo(k,S,C);if(c){let F=0,I=0;h&&O<0?F=Ta(_+O+Q,c[0][0]):!h&&O>0&&(F=Aa(_+$+Q,c[1][0])),g&&H<0?I=Ta(M+H+P,c[0][1]):!g&&H>0&&(I=Aa(M+k+P,c[1][1])),R=Math.max(R,F),Z=Math.max(Z,I)}if(d){let F=0,I=0;h&&O>0?F=Aa(_+O,d[0][0]):!h&&O<0&&(F=Ta(_+$,d[1][0])),g&&H>0?I=Aa(M+H,d[0][1]):!g&&H<0&&(I=Ta(M+k,d[1][1])),R=Math.max(R,F),Z=Math.max(Z,I)}if(o){if(p){const F=yo($/U,S,C)*U;if(R=Math.max(R,F),c){let I=0;!h&&!g||h&&!g&&v?I=Aa(M+P+$/U,c[1][1])*U:I=Ta(M+P+(h?O:-O)/U,c[0][1])*U,R=Math.max(R,I)}if(d){let I=0;!h&&!g||h&&!g&&v?I=Ta(M+$/U,d[1][1])*U:I=Aa(M+(h?O:-O)/U,d[0][1])*U,R=Math.max(R,I)}}if(y){const F=yo(k*U,N,w)/U;if(Z=Math.max(Z,F),c){let I=0;!h&&!g||g&&!h&&v?I=Aa(_+k*U+Q,c[1][0])/U:I=Ta(_+(g?H:-H)*U+Q,c[0][0])/U,Z=Math.max(Z,I)}if(d){let I=0;!h&&!g||g&&!h&&v?I=Ta(_+k*U,d[1][0])/U:I=Aa(_+(g?H:-H)*U,d[0][0])/U,Z=Math.max(Z,I)}}}H=H+(H<0?Z:-Z),O=O+(O<0?R:-R),o&&(v?$>k*U?H=(uy(h,g)?-O:O)/U:O=(uy(h,g)?-H:H)*U:p?(H=O/U,g=h):(O=H*U,h=g));const D=h?_+O:_,Y=g?M+H:M;return{width:B+(h?-O:O),height:L+(g?-H:H),x:s[0]*O*(h?-1:1)+D,y:s[1]*H*(g?-1:1)+Y}}const sb={width:0,height:0,x:0,y:0},TM={...sb,pointerX:0,pointerY:0,aspectRatio:1};function AM(n,l,r){const u=l.position.x+n.position.x,o=l.position.y+n.position.y,s=n.measured.width??0,c=n.measured.height??0,d=r[0]*s,h=r[1]*c;return[[u-d,o-h],[u+s-d,o+c-h]]}function RM({domNode:n,nodeId:l,getStoreItems:r,onChange:u,onEnd:o}){const s=Yt(n);let c={controlDirection:ry("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:g,boundaries:p,keepAspectRatio:y,resizeDirection:v,onResizeStart:b,onResize:E,onResizeEnd:N,shouldResize:w}){let S={...sb},C={...TM};c={boundaries:p,resizeDirection:v,keepAspectRatio:y,controlDirection:ry(g)};let _,M=null,B=[],L,U,O,H=!1;const $=v1().on("start",k=>{const{nodeLookup:Q,transform:P,snapGrid:R,snapToGrid:Z,nodeOrigin:D,paneDomNode:Y}=r();if(_=Q.get(l),!_)return;M=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:I}=Er(k.sourceEvent,{transform:P,snapGrid:R,snapToGrid:Z,containerBounds:M});S={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...S,pointerX:F,pointerY:I,aspectRatio:S.width/S.height},L=void 0,U=cl(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(L=Q.get(_.parentId)),L&&_.extent==="parent"&&(U=[[0,0],[L.measured.width,L.measured.height]]),B=[],O=void 0;for(const[le,z]of Q)if(z.parentId===l&&(B.push({id:le,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=AM(z,_,z.origin??D);O?O=[[Math.min(V[0][0],O[0][0]),Math.min(V[0][1],O[0][1])],[Math.max(V[1][0],O[1][0]),Math.max(V[1][1],O[1][1])]]:O=V}b==null||b(k,{...S})}).on("drag",k=>{const{transform:Q,snapGrid:P,snapToGrid:R,nodeOrigin:Z}=r(),D=Er(k.sourceEvent,{transform:Q,snapGrid:P,snapToGrid:R,containerBounds:M}),Y=[];if(!_)return;const{x:F,y:I,width:le,height:z}=S,V={},q=_.origin??Z,{width:G,height:J,x:re,y:se}=MM(C,c.controlDirection,D,c.boundaries,c.keepAspectRatio,q,U,O),ee=G!==le,fe=J!==z,ge=re!==F&&ee,be=se!==I&&fe;if(!ge&&!be&&!ee&&!fe)return;if((ge||be||q[0]===1||q[1]===1)&&(V.x=ge?re:S.x,V.y=be?se:S.y,S.x=V.x,S.y=V.y,B.length>0)){const pe=re-F,we=se-I;for(const ze of B)ze.position={x:ze.position.x-pe+q[0]*(G-le),y:ze.position.y-we+q[1]*(J-z)},Y.push(ze)}if((ee||fe)&&(V.width=ee&&(!c.resizeDirection||c.resizeDirection==="horizontal")?G:S.width,V.height=fe&&(!c.resizeDirection||c.resizeDirection==="vertical")?J:S.height,S.width=V.width,S.height=V.height),L&&_.expandParent){const pe=q[0]*(V.width??0);V.x&&V.x<pe&&(S.x=pe,C.x=C.x-(V.x-pe));const we=q[1]*(V.height??0);V.y&&V.y<we&&(S.y=we,C.y=C.y-(V.y-we))}const me=CM({width:S.width,prevWidth:le,height:S.height,prevHeight:z,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ne={...S,direction:me};(w==null?void 0:w(k,ne))!==!1&&(H=!0,E==null||E(k,ne),u(V,Y))}).on("end",k=>{H&&(N==null||N(k,{...S}),o==null||o({...S}),H=!1)});s.call($)}function h(){s.on(".drag",null)}return{update:d,destroy:h}}var Bf={exports:{}},Uf={},qf={exports:{}},kf={};/**
61
+ * @license React
62
+ * use-sync-external-store-shim.production.js
63
+ *
64
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ */var oy;function zM(){if(oy)return kf;oy=1;var n=Or();function l(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var r=typeof Object.is=="function"?Object.is:l,u=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function d(y,v){var b=v(),E=u({inst:{value:b,getSnapshot:v}}),N=E[0].inst,w=E[1];return s(function(){N.value=b,N.getSnapshot=v,h(N)&&w({inst:N})},[y,b,v]),o(function(){return h(N)&&w({inst:N}),y(function(){h(N)&&w({inst:N})})},[y]),c(b),b}function h(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!r(y,b)}catch{return!0}}function g(y,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return kf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,kf}var sy;function OM(){return sy||(sy=1,qf.exports=zM()),qf.exports}/**
69
+ * @license React
70
+ * use-sync-external-store-shim/with-selector.production.js
71
+ *
72
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
73
+ *
74
+ * This source code is licensed under the MIT license found in the
75
+ * LICENSE file in the root directory of this source tree.
76
+ */var cy;function DM(){if(cy)return Uf;cy=1;var n=Or(),l=OM();function r(g,p){return g===p&&(g!==0||1/g===1/p)||g!==g&&p!==p}var u=typeof Object.is=="function"?Object.is:r,o=l.useSyncExternalStore,s=n.useRef,c=n.useEffect,d=n.useMemo,h=n.useDebugValue;return Uf.useSyncExternalStoreWithSelector=function(g,p,y,v,b){var E=s(null);if(E.current===null){var N={hasValue:!1,value:null};E.current=N}else N=E.current;E=d(function(){function S(L){if(!C){if(C=!0,_=L,L=v(L),b!==void 0&&N.hasValue){var U=N.value;if(b(U,L))return M=U}return M=L}if(U=M,u(_,L))return U;var O=v(L);return b!==void 0&&b(U,O)?(_=L,U):(_=L,M=O)}var C=!1,_,M,B=y===void 0?null:y;return[function(){return S(p())},B===null?void 0:function(){return S(B())}]},[p,y,v,b]);var w=o(g,E[0],E[1]);return c(function(){N.hasValue=!0,N.value=w},[w]),h(w),w},Uf}var fy;function jM(){return fy||(fy=1,Bf.exports=DM()),Bf.exports}var LM=jM();const HM=Pd(LM),BM={},dy=n=>{let l;const r=new Set,u=(p,y)=>{const v=typeof p=="function"?p(l):p;if(!Object.is(v,l)){const b=l;l=y??(typeof v!="object"||v===null)?v:Object.assign({},l,v),r.forEach(E=>E(l,b))}},o=()=>l,h={setState:u,getState:o,getInitialState:()=>g,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(BM?"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."),r.clear()}},g=l=n(u,o,h);return h},UM=n=>n?dy(n):dy,{useDebugValue:qM}=cS,{useSyncExternalStoreWithSelector:kM}=HM,YM=n=>n;function cb(n,l=YM,r){const u=kM(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,r);return qM(u),u}const hy=(n,l)=>{const r=UM(n),u=(o,s=l)=>cb(r,o,s);return Object.assign(u,r),u},VM=(n,l)=>n?hy(n,l):hy;function Ke(n,l){if(Object.is(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;if(n instanceof Map&&l instanceof Map){if(n.size!==l.size)return!1;for(const[u,o]of n)if(!Object.is(o,l.get(u)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const u of n)if(!l.has(u))return!1;return!0}const r=Object.keys(n);if(r.length!==Object.keys(l).length)return!1;for(const u of r)if(!Object.prototype.hasOwnProperty.call(l,u)||!Object.is(n[u],l[u]))return!1;return!0}const es=j.createContext(null),GM=es.Provider,fb=mn.error001("react");function De(n,l){const r=j.useContext(es);if(r===null)throw new Error(fb);return cb(r,n,l)}function $e(){const n=j.useContext(es);if(n===null)throw new Error(fb);return j.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const my={display:"none"},XM={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},db="react-flow__node-desc",hb="react-flow__edge-desc",$M="react-flow__aria-live",QM=n=>n.ariaLiveMessage,ZM=n=>n.ariaLabelConfig;function KM({rfId:n}){const l=De(QM);return A.jsx("div",{id:`${$M}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:XM,children:l})}function IM({rfId:n,disableKeyboardA11y:l}){const r=De(ZM);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${db}-${n}`,style:my,children:l?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${hb}-${n}`,style:my,children:r["edge.a11yDescription.default"]}),!l&&A.jsx(KM,{rfId:n})]})}const ts=j.forwardRef(({position:n="top-left",children:l,className:r,style:u,...o},s)=>{const c=`${n}`.split("-");return A.jsx("div",{className:ut(["react-flow__panel",r,...c]),style:u,ref:s,...o,children:l})});ts.displayName="Panel";const gy="https://reactflow.dev?utm_source=attribution";function JM({proOptions:n,position:l="bottom-right"}){return j.useEffect(()=>{},[]),n!=null&&n.hideAttribution?null:A.jsx(ts,{position:l,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${gy}`,children:A.jsx("a",{href:gy,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const FM=n=>{const l=[],r=[];for(const[,u]of n.nodeLookup)u.selected&&l.push(u.internals.userNode);for(const[,u]of n.edgeLookup)u.selected&&r.push(u);return{selectedNodes:l,selectedEdges:r}},vo=n=>n.id;function WM(n,l){return Ke(n.selectedNodes.map(vo),l.selectedNodes.map(vo))&&Ke(n.selectedEdges.map(vo),l.selectedEdges.map(vo))}function PM({onSelectionChange:n}){const l=$e(),{selectedNodes:r,selectedEdges:u}=De(FM,WM);return j.useEffect(()=>{const o={nodes:r,edges:u};n==null||n(o),l.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[r,u,n]),null}const eT=n=>!!n.onSelectionChangeHandlers;function tT({onSelectionChange:n}){const l=De(eT);return n||l?A.jsx(PM,{onSelectionChange:n}):null}const mb=[0,0],nT={x:0,y:0,zoom:1},aT=["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","ariaLabelConfig","zIndexMode"],py=[...aT,"rfId"],lT=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),yy={translateExtent:Cr,nodeOrigin:mb,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iT(n){const{setNodes:l,setEdges:r,setMinZoom:u,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:c,reset:d,setDefaultNodesAndEdges:h}=De(lT,Ke),g=$e();j.useEffect(()=>(h(n.defaultNodes,n.defaultEdges),()=>{p.current=yy,d()}),[]);const p=j.useRef(yy);return j.useEffect(()=>{for(const y of py){const v=n[y],b=p.current[y];v!==b&&(typeof n[y]>"u"||(y==="nodes"?l(v):y==="edges"?r(v):y==="minZoom"?u(v):y==="maxZoom"?o(v):y==="translateExtent"?s(v):y==="nodeExtent"?c(v):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:GC(v)}):y==="fitView"?g.setState({fitViewQueued:v}):y==="fitViewOptions"?g.setState({fitViewOptions:v}):g.setState({[y]:v})))}p.current=n},py.map(y=>n[y])),null}function vy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rT(n){var u;const[l,r]=j.useState(n==="system"?null:n);return j.useEffect(()=>{if(n!=="system"){r(n);return}const o=vy(),s=()=>r(o!=null&&o.matches?"dark":"light");return s(),o==null||o.addEventListener("change",s),()=>{o==null||o.removeEventListener("change",s)}},[n]),l!==null?l:(u=vy())!=null&&u.matches?"dark":"light"}const by=typeof document<"u"?document:null;function zr(n=null,l={target:by,actInsideInputWithModifier:!0}){const[r,u]=j.useState(!1),o=j.useRef(!1),s=j.useRef(new Set([])),[c,d]=j.useMemo(()=>{if(n!==null){const g=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.replace(/\+/g,`
77
+ `).replace(`
78
+
79
+ `,`
80
+ +`).split(`
81
+ `)),p=g.reduce((y,v)=>y.concat(...v),[]);return[g,p]}return[[],[]]},[n]);return j.useEffect(()=>{const h=(l==null?void 0:l.target)??by,g=(l==null?void 0:l.actInsideInputWithModifier)??!0;if(n!==null){const p=b=>{var w,S;if(o.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!o.current||o.current&&!g)&&Z1(b))return!1;const N=Ey(b.code,d);if(s.current.add(b[N]),xy(c,s.current,!1)){const C=((S=(w=b.composedPath)==null?void 0:w.call(b))==null?void 0:S[0])||b.target,_=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";l.preventDefault!==!1&&(o.current||!_)&&b.preventDefault(),u(!0)}},y=b=>{const E=Ey(b.code,d);xy(c,s.current,!0)?(u(!1),s.current.clear()):s.current.delete(b[E]),b.key==="Meta"&&s.current.clear(),o.current=!1},v=()=>{s.current.clear(),u(!1)};return h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",y),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",y),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[n,u]),r}function xy(n,l,r){return n.filter(u=>r||u.length===l.size).some(u=>u.every(o=>l.has(o)))}function Ey(n,l){return l.includes(n)?"code":"key"}const uT=()=>{const n=$e();return j.useMemo(()=>({zoomIn:async l=>{const{panZoom:r}=n.getState();return r?r.scaleBy(1.2,l):!1},zoomOut:async l=>{const{panZoom:r}=n.getState();return r?r.scaleBy(1/1.2,l):!1},zoomTo:async(l,r)=>{const{panZoom:u}=n.getState();return u?u.scaleTo(l,r):!1},getZoom:()=>n.getState().transform[2],setViewport:async(l,r)=>{const{transform:[u,o,s],panZoom:c}=n.getState();return c?(await c.setViewport({x:l.x??u,y:l.y??o,zoom:l.zoom??s},r),!0):!1},getViewport:()=>{const[l,r,u]=n.getState().transform;return{x:l,y:r,zoom:u}},setCenter:async(l,r,u)=>n.getState().setCenter(l,r,u),fitBounds:async(l,r)=>{const{width:u,height:o,minZoom:s,maxZoom:c,panZoom:d}=n.getState(),h=xh(l,u,o,s,c,(r==null?void 0:r.padding)??.1);return d?(await d.setViewport(h,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),!0):!1},screenToFlowPosition:(l,r={})=>{const{transform:u,snapGrid:o,snapToGrid:s,domNode:c}=n.getState();if(!c)return l;const{x:d,y:h}=c.getBoundingClientRect(),g={x:l.x-d,y:l.y-h},p=r.snapGrid??o,y=r.snapToGrid??s;return kr(g,u,y,p)},flowToScreenPosition:l=>{const{transform:r,domNode:u}=n.getState();if(!u)return l;const{x:o,y:s}=u.getBoundingClientRect(),c=si(l,r);return{x:c.x+o,y:c.y+s}}}),[])};function gb(n,l){const r=[],u=new Map,o=[];for(const s of n)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")u.set(s.id,[s]);else{const c=u.get(s.id);c?c.push(s):u.set(s.id,[s])}for(const s of l){const c=u.get(s.id);if(!c){r.push(s);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){r.push({...c[0].item});continue}const d={...s};for(const h of c)oT(h,d);r.push(d)}return o.length&&o.forEach(s=>{s.index!==void 0?r.splice(s.index,0,{...s.item}):r.push({...s.item})}),r}function oT(n,l){switch(n.type){case"select":{l.selected=n.selected;break}case"position":{typeof n.position<"u"&&(l.position=n.position),typeof n.dragging<"u"&&(l.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(l.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(l.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(l.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(l.resizing=n.resizing);break}}}function pb(n,l){return gb(n,l)}function yb(n,l){return gb(n,l)}function nl(n,l){return{id:n,type:"select",selected:l}}function ti(n,l=new Set,r=!1){const u=[];for(const[o,s]of n){const c=l.has(o);!(s.selected===void 0&&!c)&&s.selected!==c&&(r&&(s.selected=c),u.push(nl(s.id,c)))}return u}function Sy({items:n=[],lookup:l}){var o;const r=[],u=new Map(n.map(s=>[s.id,s]));for(const[s,c]of n.entries()){const d=l.get(c.id),h=((o=d==null?void 0:d.internals)==null?void 0:o.userNode)??d;h!==void 0&&h!==c&&r.push({id:c.id,item:c,type:"replace"}),h===void 0&&r.push({item:c,type:"add",index:s})}for(const[s]of l)u.get(s)===void 0&&r.push({id:s,type:"remove"});return r}function wy(n){return{id:n.id,type:"remove"}}const sT=V1();function vb(n,l,r={}){return IC(n,l,{...r,onError:r.onError??sT})}const _y=n=>jC(n),cT=n=>B1(n);function bb(n){return j.forwardRef(n)}const xb=typeof window<"u"?j.useLayoutEffect:j.useEffect;function Ny(n){const[l,r]=j.useState(BigInt(0)),[u]=j.useState(()=>fT(()=>r(o=>o+BigInt(1))));return xb(()=>{const o=u.get();o.length&&(n(o),u.reset())},[l]),u}function fT(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:r=>{l.push(r),n()}}}const Eb=j.createContext(null);function dT({children:n}){const l=$e(),r=j.useCallback(d=>{const{nodes:h=[],setNodes:g,hasDefaultNodes:p,onNodesChange:y,nodeLookup:v,fitViewQueued:b,onNodesChangeMiddlewareMap:E}=l.getState();let N=h;for(const S of d)N=typeof S=="function"?S(N):S;let w=Sy({items:N,lookup:v});for(const S of E.values())w=S(w);p&&g(N),w.length>0?y==null||y(w):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:C,setNodes:_}=l.getState();S&&_(C)})},[]),u=Ny(r),o=j.useCallback(d=>{const{edges:h=[],setEdges:g,hasDefaultEdges:p,onEdgesChange:y,edgeLookup:v}=l.getState();let b=h;for(const E of d)b=typeof E=="function"?E(b):E;p?g(b):y&&y(Sy({items:b,lookup:v}))},[]),s=Ny(o),c=j.useMemo(()=>({nodeQueue:u,edgeQueue:s}),[]);return A.jsx(Eb.Provider,{value:c,children:n})}function hT(){const n=j.useContext(Eb);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const mT=n=>!!n.panZoom;function Mh(){const n=uT(),l=$e(),r=hT(),u=De(mT),o=j.useMemo(()=>{const s=y=>l.getState().nodeLookup.get(y),c=y=>{r.nodeQueue.push(y)},d=y=>{r.edgeQueue.push(y)},h=y=>{var S,C;const{nodeLookup:v,nodeOrigin:b}=l.getState(),E=_y(y)?y:v.get(y.id),N=E.parentId?X1(E.position,E.measured,E.parentId,v,b):E.position,w={...E,position:N,width:((S=E.measured)==null?void 0:S.width)??E.width,height:((C=E.measured)==null?void 0:C.height)??E.height};return Ar(w)},g=(y,v,b={replace:!1})=>{c(E=>E.map(N=>{if(N.id===y){const w=typeof v=="function"?v(N):v;return b.replace&&_y(w)?w:{...N,...w}}return N}))},p=(y,v,b={replace:!1})=>{d(E=>E.map(N=>{if(N.id===y){const w=typeof v=="function"?v(N):v;return b.replace&&cT(w)?w:{...N,...w}}return N}))};return{getNodes:()=>l.getState().nodes.map(y=>({...y})),getNode:y=>{var v;return(v=s(y))==null?void 0:v.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:y=[]}=l.getState();return y.map(v=>({...v}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:c,setEdges:d,addNodes:y=>{const v=Array.isArray(y)?y:[y];r.nodeQueue.push(b=>[...b,...v])},addEdges:y=>{const v=Array.isArray(y)?y:[y];r.edgeQueue.push(b=>[...b,...v])},toObject:()=>{const{nodes:y=[],edges:v=[],transform:b}=l.getState(),[E,N,w]=b;return{nodes:y.map(S=>({...S})),edges:v.map(S=>({...S})),viewport:{x:E,y:N,zoom:w}}},deleteElements:async({nodes:y=[],edges:v=[]})=>{const{nodes:b,edges:E,onNodesDelete:N,onEdgesDelete:w,triggerNodeChanges:S,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:M}=l.getState(),{nodes:B,edges:L}=await qC({nodesToRemove:y,edgesToRemove:v,nodes:b,edges:E,onBeforeDelete:M}),U=L.length>0,O=B.length>0;if(U){const H=L.map(wy);w==null||w(L),C(H)}if(O){const H=B.map(wy);N==null||N(B),S(H)}return(O||U)&&(_==null||_({nodes:B,edges:L})),{deletedNodes:B,deletedEdges:L}},getIntersectingNodes:(y,v=!0,b)=>{const E=I0(y),N=E?y:h(y),w=b!==void 0;return N?(b||l.getState().nodes).filter(S=>{const C=l.getState().nodeLookup.get(S.id);if(C&&!E&&(S.id===y.id||!C.internals.positionAbsolute))return!1;const _=Ar(w?S:C),M=Uo(_,N);return v&&M>0||M>=_.width*_.height||M>=N.width*N.height}):[]},isNodeIntersecting:(y,v,b=!0)=>{const N=I0(y)?y:h(y);if(!N)return!1;const w=Uo(N,v);return b&&w>0||w>=v.width*v.height||w>=N.width*N.height},updateNode:g,updateNodeData:(y,v,b={replace:!1})=>{g(y,E=>{const N=typeof v=="function"?v(E):v;return b.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},b)},updateEdge:p,updateEdgeData:(y,v,b={replace:!1})=>{p(y,E=>{const N=typeof v=="function"?v(E):v;return b.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},b)},getNodesBounds:y=>{const{nodeLookup:v,nodeOrigin:b}=l.getState();return LC(y,{nodeLookup:v,nodeOrigin:b})},getHandleConnections:({type:y,id:v,nodeId:b})=>{var E;return Array.from(((E=l.getState().connectionLookup.get(`${b}-${y}${v?`-${v}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:y,handleId:v,nodeId:b})=>{var E;return Array.from(((E=l.getState().connectionLookup.get(`${b}${y?v?`-${y}-${v}`:`-${y}`:""}`))==null?void 0:E.values())??[])},fitView:async y=>{const v=l.getState().fitViewResolver??VC();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:v}),r.nodeQueue.push(b=>[...b]),v.promise}}},[]);return j.useMemo(()=>({...o,...n,viewportInitialized:u}),[u])}const Cy=n=>n.selected,gT=typeof window<"u"?window:void 0;function pT({deleteKeyCode:n,multiSelectionKeyCode:l}){const r=$e(),{deleteElements:u}=Mh(),o=zr(n,{actInsideInputWithModifier:!1}),s=zr(l,{target:gT});j.useEffect(()=>{if(o){const{edges:c,nodes:d}=r.getState();u({nodes:d.filter(Cy),edges:c.filter(Cy)}),r.setState({nodesSelectionActive:!1})}},[o]),j.useEffect(()=>{r.setState({multiSelectionActive:s})},[s])}function yT(n){const l=$e();j.useEffect(()=>{const r=()=>{var o,s,c,d;if(!n.current||!(((s=(o=n.current).checkVisibility)==null?void 0:s.call(o))??!0))return!1;const u=Eh(n.current);(u.height===0||u.width===0)&&((d=(c=l.getState()).onError)==null||d.call(c,"004",mn.error004())),l.setState({width:u.width||500,height:u.height||500})};if(n.current){r(),window.addEventListener("resize",r);const u=new ResizeObserver(()=>r());return u.observe(n.current),()=>{window.removeEventListener("resize",r),u&&n.current&&u.unobserve(n.current)}}},[])}const ns={position:"absolute",width:"100%",height:"100%",top:0,left:0},vT=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function bT({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:r=!0,panOnScroll:u=!1,panActivationKeyPressed:o,panOnScrollSpeed:s=.5,panOnScrollMode:c=il.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:g,translateExtent:p,minZoom:y,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:E=!0,children:N,noWheelClassName:w,noPanClassName:S,onViewportChange:C,isControlledViewport:_,paneClickDistance:M,selectionOnDrag:B}){const L=$e(),U=j.useRef(null),{userSelectionActive:O,lib:H,connectionInProgress:$}=De(vT,Ke),k=zr(b),Q=j.useRef();yT(U);const P=j.useCallback(R=>{C==null||C({x:R[0],y:R[1],zoom:R[2]}),_||L.setState({transform:R})},[C,_]);return j.useEffect(()=>{if(U.current){Q.current=NM({domNode:U.current,minZoom:y,maxZoom:v,translateExtent:p,viewport:g,onDraggingChange:Y=>L.setState(F=>F.paneDragging===Y?F:{paneDragging:Y}),onPanZoomStart:(Y,F)=>{const{onViewportChangeStart:I,onMoveStart:le}=L.getState();le==null||le(Y,F),I==null||I(F)},onPanZoom:(Y,F)=>{const{onViewportChange:I,onMove:le}=L.getState();le==null||le(Y,F),I==null||I(F)},onPanZoomEnd:(Y,F)=>{const{onViewportChangeEnd:I,onMoveEnd:le}=L.getState();le==null||le(Y,F),I==null||I(F)}});const{x:R,y:Z,zoom:D}=Q.current.getViewport();return L.setState({panZoom:Q.current,transform:[R,Z,D],domNode:U.current.closest(".react-flow")}),()=>{var Y;(Y=Q.current)==null||Y.destroy()}}},[]),j.useEffect(()=>{var R;(R=Q.current)==null||R.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:r,panOnScroll:u,panActivationKeyPressed:o,panOnScrollSpeed:s,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:k,preventScrolling:E,noPanClassName:S,userSelectionActive:O,noWheelClassName:w,lib:H,onTransformChange:P,connectionInProgress:$,selectionOnDrag:B,paneClickDistance:M})},[n,l,r,u,o,s,c,d,h,k,E,S,O,w,H,P,$,B,M]),A.jsx("div",{className:"react-flow__renderer",ref:U,style:ns,children:N})}const xT=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function ET(){const{userSelectionActive:n,userSelectionRect:l}=De(xT,Ke);return n&&l?A.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:l.width,height:l.height,transform:`translate(${l.x}px, ${l.y}px)`}}):null}const Yf=(n,l)=>r=>{r.target===l.current&&(n==null||n(r))},ST=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging,panBy:n.panBy,autoPanSpeed:n.autoPanSpeed});function wT({isSelecting:n,selectionKeyPressed:l,selectionMode:r=Mr.Full,panOnDrag:u,autoPanOnSelection:o,paneClickDistance:s,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:h,onPaneClick:g,onPaneContextMenu:p,onPaneScroll:y,onPaneMouseEnter:v,onPaneMouseMove:b,onPaneMouseLeave:E,children:N}){const w=j.useRef(0),S=$e(),{userSelectionActive:C,elementsSelectable:_,dragging:M,panBy:B,autoPanSpeed:L}=De(ST,Ke),U=_&&(n||C),O=j.useRef(null),H=j.useRef(),$=j.useRef(new Set),k=j.useRef(new Set),Q=j.useRef(!1),P=j.useRef(!1),R=j.useRef({x:0,y:0}),Z=j.useRef(!1),D=ee=>{if(P.current||Q.current||S.getState().connection.inProgress){P.current=!1,Q.current=!1;return}g==null||g(ee),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},Y=ee=>{if(Array.isArray(u)&&(u!=null&&u.includes(2))){ee.preventDefault();return}p==null||p(ee)},F=y?ee=>y(ee):void 0,I=ee=>{P.current&&(ee.stopPropagation(),P.current=!1)},le=ee=>{var ze,yt;if(ee.pointerType==="touch"&&u!==!1&&!l)return;const{domNode:fe,transform:ge}=S.getState();if(H.current=fe==null?void 0:fe.getBoundingClientRect(),!H.current)return;const be=ee.target===O.current;if(!be&&!!ee.target.closest(".nokey")||!n||!(c&&be||l)||ee.button!==0||!ee.isPrimary)return;(yt=(ze=ee.target)==null?void 0:ze.setPointerCapture)==null||yt.call(ze,ee.pointerId),P.current=!1;const{x:he,y:pe}=fn(ee.nativeEvent,H.current),we=kr({x:he,y:pe},ge);S.setState({userSelectionRect:{width:0,height:0,startX:we.x,startY:we.y,x:he,y:pe}}),be||(ee.stopPropagation(),ee.preventDefault())};function z(ee,fe){const{userSelectionRect:ge}=S.getState();if(!ge)return;const{transform:be,nodeLookup:me,edgeLookup:ne,connectionLookup:he,triggerNodeChanges:pe,triggerEdgeChanges:we,defaultEdgeOptions:ze}=S.getState(),yt={x:ge.startX,y:ge.startY},{x:Et,y:St}=si(yt,be),Ot={startX:yt.x,startY:yt.y,x:ee<Et?ee:Et,y:fe<St?fe:St,width:Math.abs(ee-Et),height:Math.abs(fe-St)},Da=$.current,Tn=k.current;$.current=new Set(vh(me,Ot,be,r===Mr.Partial,!0).map(Dt=>Dt.id)),k.current=new Set;const Fe=(ze==null?void 0:ze.selectable)??!0;for(const Dt of $.current){const $t=he.get(Dt);if($t)for(const{edgeId:Qt}of $t.values()){const Zt=ne.get(Qt);Zt&&(Zt.selectable??Fe)&&k.current.add(Qt)}}if(!J0(Da,$.current)){const Dt=ti(me,$.current,!0);pe(Dt)}if(!J0(Tn,k.current)){const Dt=ti(ne,k.current);we(Dt)}S.setState({userSelectionRect:Ot,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!o||!H.current)return;const[ee,fe]=bh(R.current,H.current,L);B({x:ee,y:fe}).then(ge=>{if(!P.current||!ge){w.current=requestAnimationFrame(V);return}const{x:be,y:me}=R.current;z(be,me),w.current=requestAnimationFrame(V)})}const q=()=>{cancelAnimationFrame(w.current),w.current=0,Z.current=!1};j.useEffect(()=>()=>q(),[]);const G=ee=>{const{userSelectionRect:fe,transform:ge,resetSelectedElements:be}=S.getState();if(!H.current||!fe)return;const{x:me,y:ne}=fn(ee.nativeEvent,H.current);R.current={x:me,y:ne};const he=si({x:fe.startX,y:fe.startY},ge);if(!P.current){const pe=l?0:s;if(Math.hypot(me-he.x,ne-he.y)<=pe)return;be(),d==null||d(ee)}P.current=!0,Z.current||(V(),Z.current=!0),z(me,ne)},J=ee=>{var fe,ge;if(!U){ee.target===O.current&&S.getState().connection.inProgress&&(Q.current=!0);return}ee.button===0&&((ge=(fe=ee.target)==null?void 0:fe.releasePointerCapture)==null||ge.call(fe,ee.pointerId),!C&&ee.target===O.current&&S.getState().userSelectionRect&&(D==null||D(ee)),S.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(h==null||h(ee),S.setState({nodesSelectionActive:$.current.size>0})),q())},re=ee=>{var fe,ge;(ge=(fe=ee.target)==null?void 0:fe.releasePointerCapture)==null||ge.call(fe,ee.pointerId),q()},se=u===!0||Array.isArray(u)&&u.includes(0);return A.jsxs("div",{className:ut(["react-flow__pane",{draggable:se,dragging:M,selection:n}]),onClick:U?void 0:Yf(D,O),onContextMenu:Yf(Y,O),onWheel:Yf(F,O),onPointerEnter:U?void 0:v,onPointerMove:U?G:b,onPointerUp:J,onPointerCancel:U?re:void 0,onPointerDownCapture:U?le:void 0,onClickCapture:U?I:void 0,onPointerLeave:E,ref:O,style:ns,children:[N,A.jsx(ET,{})]})}function Wd({id:n,store:l,unselect:r=!1,nodeRef:u}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:c,nodeLookup:d,onError:h}=l.getState(),g=d.get(n);if(!g){h==null||h("012",mn.error012(n));return}l.setState({nodesSelectionActive:!1}),g.selected?(r||g.selected&&c)&&(s({nodes:[g],edges:[]}),requestAnimationFrame(()=>{var p;return(p=u==null?void 0:u.current)==null?void 0:p.blur()})):o([n])}function Sb({nodeRef:n,disabled:l=!1,noDragClassName:r,handleSelector:u,nodeId:o,isSelectable:s,nodeClickDistance:c}){const d=$e(),[h,g]=j.useState(!1),p=j.useRef();return j.useEffect(()=>{if(!l)return p.current=fM({getStoreItems:()=>d.getState(),onNodeMouseDown:y=>{Wd({id:y,store:d,nodeRef:n})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}}),()=>{var y;(y=p.current)==null||y.destroy(),p.current=void 0}},[l,d,n]),j.useEffect(()=>{l||!n.current||!p.current||p.current.update({noDragClassName:r,handleSelector:u,domNode:n.current,isSelectable:s,nodeId:o,nodeClickDistance:c})},[r,u,l,s,n,o,c]),h}const _T=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function wb(){const n=$e();return j.useCallback(r=>{const{nodeExtent:u,snapToGrid:o,snapGrid:s,nodesDraggable:c,onError:d,updateNodePositions:h,nodeLookup:g,nodeOrigin:p}=n.getState(),y=new Map,v=_T(c),b=o?s[0]:5,E=o?s[1]:5,N=r.direction.x*b*r.factor,w=r.direction.y*E*r.factor;for(const[,S]of g){if(!v(S))continue;let C={x:S.internals.positionAbsolute.x+N,y:S.internals.positionAbsolute.y+w};o&&(C=qr(C,s));const{position:_,positionAbsolute:M}=U1({nodeId:S.id,nextPosition:C,nodeLookup:g,nodeExtent:u,nodeOrigin:p,onError:d});S.position=_,S.internals.positionAbsolute=M,y.set(S.id,S)}h(y)},[])}const Th=j.createContext(null),NT=Th.Provider;Th.Consumer;const _b=()=>j.useContext(Th),CT=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),Nb=j.createContext(null);function MT({children:n}){const l=De(CT,Ke);return A.jsx(Nb.Provider,{value:l,children:n})}function TT(){const n=j.useContext(Nb);if(!n)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return n}const AT={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},RT=(n,l,r)=>u=>{const{connectionClickStartHandle:o,connectionMode:s,connection:c}=u,{fromHandle:d,toHandle:h,isValid:g}=c;if(!d&&!o)return AT;const p=(h==null?void 0:h.nodeId)===n&&(h==null?void 0:h.id)===l&&(h==null?void 0:h.type)===r;return{connectingFrom:(d==null?void 0:d.nodeId)===n&&(d==null?void 0:d.id)===l&&(d==null?void 0:d.type)===r,connectingTo:p,clickConnecting:(o==null?void 0:o.nodeId)===n&&(o==null?void 0:o.id)===l&&(o==null?void 0:o.type)===r,isPossibleEndHandle:s===ui.Strict?(d==null?void 0:d.type)!==r:n!==(d==null?void 0:d.nodeId)||l!==(d==null?void 0:d.id),connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:p&&g}};function zT({type:n="source",position:l=xe.Top,isValidConnection:r,isConnectable:u=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:c,onConnect:d,children:h,className:g,onMouseDown:p,onTouchStart:y,...v},b){var Z,D;const E=c||null,N=n==="target",w=$e(),S=_b(),{connectOnClick:C,noPanClassName:_,rfId:M}=TT(),{connectingFrom:B,connectingTo:L,clickConnecting:U,isPossibleEndHandle:O,connectionInProcess:H,clickConnectionInProcess:$,valid:k}=De(RT(S,E,n),Ke);S||(D=(Z=w.getState()).onError)==null||D.call(Z,"010",mn.error010());const Q=Y=>{const{defaultEdgeOptions:F,onConnect:I,hasDefaultEdges:le}=w.getState(),z={...F,...Y};if(le){const{edges:V,setEdges:q,onError:G}=w.getState();q(vb(z,V,{onError:G}))}I==null||I(z),d==null||d(z)},P=Y=>{if(!S)return;const F=K1(Y.nativeEvent);if(o&&(F&&Y.button===0||!F)){const I=w.getState();Fd.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:N,handleId:E,nodeId:S,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...le)=>{var z,V;return(V=(z=w.getState()).onConnectEnd)==null?void 0:V.call(z,...le)},updateConnection:I.updateConnection,onConnect:Q,isValidConnection:r||((...le)=>{var z,V;return((V=(z=w.getState()).isValidConnection)==null?void 0:V.call(z,...le))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}F?p==null||p(Y):y==null||y(Y)},R=Y=>{const{onClickConnectStart:F,onClickConnectEnd:I,connectionClickStartHandle:le,connectionMode:z,isValidConnection:V,lib:q,rfId:G,nodeLookup:J,connection:re}=w.getState();if(!S||!le&&!o)return;if(!le){F==null||F(Y.nativeEvent,{nodeId:S,handleId:E,handleType:n}),w.setState({connectionClickStartHandle:{nodeId:S,type:n,id:E}});return}const se=Q1(Y.target),ee=r||V,{connection:fe,isValid:ge}=Fd.isValid(Y.nativeEvent,{handle:{nodeId:S,id:E,type:n},connectionMode:z,fromNodeId:le.nodeId,fromHandleId:le.id||null,fromType:le.type,isValidConnection:ee,flowId:G,doc:se,lib:q,nodeLookup:J});ge&&fe&&Q(fe);const be=structuredClone(re);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,I==null||I(Y,be),w.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":E,"data-nodeid":S,"data-handlepos":l,"data-id":`${M}-${S}-${E}-${n}`,className:ut(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",_,g,{source:!N,target:N,connectable:u,connectablestart:o,connectableend:s,clickconnecting:U,connectingfrom:B,connectingto:L,valid:k,connectionindicator:u&&(!H||O)&&(H||$?s:o)}]),onMouseDown:P,onTouchStart:P,onClick:C?R:void 0,ref:b,...v,children:h})}const fi=j.memo(bb(zT));function OT({data:n,isConnectable:l,sourcePosition:r=xe.Bottom}){return A.jsxs(A.Fragment,{children:[n==null?void 0:n.label,A.jsx(fi,{type:"source",position:r,isConnectable:l})]})}function DT({data:n,isConnectable:l,targetPosition:r=xe.Top,sourcePosition:u=xe.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(fi,{type:"target",position:r,isConnectable:l}),n==null?void 0:n.label,A.jsx(fi,{type:"source",position:u,isConnectable:l})]})}function jT(){return null}function LT({data:n,isConnectable:l,targetPosition:r=xe.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(fi,{type:"target",position:r,isConnectable:l}),n==null?void 0:n.label]})}const qo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},My={input:OT,default:DT,output:LT,group:jT};function HT(n){var l,r,u,o;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((l=n.style)==null?void 0:l.width),height:n.height??n.initialHeight??((r=n.style)==null?void 0:r.height)}:{width:n.width??((u=n.style)==null?void 0:u.width),height:n.height??((o=n.style)==null?void 0:o.height)}}const BT=n=>{const{width:l,height:r,x:u,y:o}=Ur(n.nodeLookup,{filter:s=>!!s.selected});return{width:cn(l)?l:null,height:cn(r)?r:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${u}px,${o}px)`}};function UT({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:r}){const u=$e(),{width:o,height:s,transformString:c,userSelectionActive:d}=De(BT,Ke),h=wb(),g=j.useRef(null);j.useEffect(()=>{var b;r||(b=g.current)==null||b.focus({preventScroll:!0})},[r]);const p=!d&&o!==null&&s!==null;if(Sb({nodeRef:g,disabled:!p}),!p)return null;const y=n?b=>{const E=u.getState().nodes.filter(N=>N.selected);n(b,E)}:void 0,v=b=>{Object.prototype.hasOwnProperty.call(qo,b.key)&&(b.preventDefault(),h({direction:qo[b.key],factor:b.shiftKey?4:1}))};return A.jsx("div",{className:ut(["react-flow__nodesselection","react-flow__container",l]),style:{transform:c},children:A.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:r?void 0:-1,onKeyDown:r?void 0:v,style:{width:o,height:s}})})}const Ty=typeof window<"u"?window:void 0,qT=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function Cb({children:n,onPaneClick:l,onPaneMouseEnter:r,onPaneMouseMove:u,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:g,selectionOnDrag:p,selectionMode:y,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:w,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:M,panOnScrollSpeed:B,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:O,autoPanOnSelection:H,defaultViewport:$,translateExtent:k,minZoom:Q,maxZoom:P,preventScrolling:R,onSelectionContextMenu:Z,noWheelClassName:D,noPanClassName:Y,disableKeyboardA11y:F,onViewportChange:I,isControlledViewport:le}){const{nodesSelectionActive:z,userSelectionActive:V}=De(qT,Ke),q=zr(g,{target:Ty}),G=zr(N,{target:Ty}),J=G||O,re=G||M,se=p&&J!==!0,ee=q||V||se;return pT({deleteKeyCode:h,multiSelectionKeyCode:E}),A.jsx(bT,{onPaneContextMenu:s,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:re,panActivationKeyPressed:G,panOnScrollSpeed:B,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:!q&&J,defaultViewport:$,translateExtent:k,minZoom:Q,maxZoom:P,zoomActivationKeyCode:w,preventScrolling:R,noWheelClassName:D,noPanClassName:Y,onViewportChange:I,isControlledViewport:le,paneClickDistance:d,selectionOnDrag:se,children:A.jsxs(wT,{onSelectionStart:v,onSelectionEnd:b,onPaneClick:l,onPaneMouseEnter:r,onPaneMouseMove:u,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:J,autoPanOnSelection:H,isSelecting:!!ee,selectionMode:y,selectionKeyPressed:q,paneClickDistance:d,selectionOnDrag:se,children:[n,z&&A.jsx(UT,{onSelectionContextMenu:Z,noPanClassName:Y,disableKeyboardA11y:F})]})})}Cb.displayName="FlowRenderer";const kT=j.memo(Cb),YT=n=>l=>n?vh(l.nodeLookup,{x:0,y:0,width:l.width,height:l.height},l.transform,!0).map(r=>r.id):Array.from(l.nodeLookup.keys());function VT(n){return De(j.useCallback(YT(n),[n]),Ke)}const GT=n=>n.updateNodeInternals;function XT(){const n=De(GT),[l]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const u=new Map;r.forEach(o=>{const s=o.target.getAttribute("data-id");u.set(s,{id:s,nodeElement:o.target,force:!0})}),n(u)}));return j.useEffect(()=>()=>{l==null||l.disconnect()},[l]),l}function $T({node:n,nodeType:l,hasDimensions:r,resizeObserver:u}){const o=$e(),s=j.useRef(null),c=j.useRef(null),d=j.useRef(n.sourcePosition),h=j.useRef(n.targetPosition),g=j.useRef(l),p=r&&!!n.internals.handleBounds;return j.useEffect(()=>{s.current&&!n.hidden&&(!p||c.current!==s.current)&&(c.current&&(u==null||u.unobserve(c.current)),u==null||u.observe(s.current),c.current=s.current)},[p,n.hidden]),j.useEffect(()=>()=>{c.current&&(u==null||u.unobserve(c.current),c.current=null)},[]),j.useEffect(()=>{if(s.current){const y=g.current!==l,v=d.current!==n.sourcePosition,b=h.current!==n.targetPosition;(y||v||b)&&(g.current=l,d.current=n.sourcePosition,h.current=n.targetPosition,o.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:s.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),s}function QT({id:n,onClick:l,onMouseEnter:r,onMouseMove:u,onMouseLeave:o,onContextMenu:s,onDoubleClick:c,nodesDraggable:d,elementsSelectable:h,nodesConnectable:g,nodesFocusable:p,resizeObserver:y,noDragClassName:v,noPanClassName:b,disableKeyboardA11y:E,rfId:N,nodeTypes:w,nodeClickDistance:S,onError:C}){const{node:_,internals:M,isParent:B}=De(ee=>{const fe=ee.nodeLookup.get(n),ge=ee.parentLookup.has(n);return{node:fe,internals:fe.internals,isParent:ge}},Ke);let L=_.type||"default",U=(w==null?void 0:w[L])||My[L];U===void 0&&(C==null||C("003",mn.error003(L)),L="default",U=(w==null?void 0:w.default)||My.default);const O=!!(_.draggable||d&&typeof _.draggable>"u"),H=!!(_.selectable||h&&typeof _.selectable>"u"),$=!!(_.connectable||g&&typeof _.connectable>"u"),k=!!(_.focusable||p&&typeof _.focusable>"u"),Q=$e(),P=G1(_),R=$T({node:_,nodeType:L,hasDimensions:P,resizeObserver:y}),Z=Sb({nodeRef:R,disabled:_.hidden||!O,noDragClassName:v,handleSelector:_.dragHandle,nodeId:n,isSelectable:H,nodeClickDistance:S}),D=wb();if(_.hidden)return null;const Y=yn(_),F=HT(_),I=H||O||l||r||u||o,le=r?ee=>r(ee,{...M.userNode}):void 0,z=u?ee=>u(ee,{...M.userNode}):void 0,V=o?ee=>o(ee,{...M.userNode}):void 0,q=s?ee=>s(ee,{...M.userNode}):void 0,G=c?ee=>c(ee,{...M.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ge}=Q.getState();H&&(!fe||!O||ge>0)&&Wd({id:n,store:Q,nodeRef:R}),l&&l(ee,{...M.userNode})},re=ee=>{if(!(Z1(ee.nativeEvent)||E)){if(j1.includes(ee.key)&&H){const fe=ee.key==="Escape";Wd({id:n,store:Q,unselect:fe,nodeRef:R})}else if(O&&_.selected&&Object.prototype.hasOwnProperty.call(qo,ee.key)){ee.preventDefault();const{ariaLabelConfig:fe}=Q.getState();Q.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),D({direction:qo[ee.key],factor:ee.shiftKey?4:1})}}},se=()=>{var he;if(E||!((he=R.current)!=null&&he.matches(":focus-visible")))return;const{transform:ee,width:fe,height:ge,autoPanOnNodeFocus:be,setCenter:me}=Q.getState();if(!be)return;vh(new Map([[n,_]]),{x:0,y:0,width:fe,height:ge},ee,!0).length>0||me(_.position.x+Y.width/2,_.position.y+Y.height/2,{zoom:ee[2]})};return A.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${L}`,{[b]:O},_.className,{selected:_.selected,selectable:H,parent:B,draggable:O,dragging:Z}]),ref:R,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:P?"visible":"hidden",..._.style,...F},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:le,onMouseMove:z,onMouseLeave:V,onContextMenu:q,onClick:J,onDoubleClick:G,onKeyDown:k?re:void 0,tabIndex:k?0:void 0,onFocus:k?se:void 0,role:_.ariaRole??(k?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${db}-${N}`,"aria-label":_.ariaLabel,..._.domAttributes,children:A.jsx(NT,{value:n,children:A.jsx(U,{id:n,data:_.data,type:L,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:_.selected??!1,selectable:H,draggable:O,deletable:_.deletable??!0,isConnectable:$,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:Z,dragHandle:_.dragHandle,zIndex:M.z,parentId:_.parentId,...Y})})})}var ZT=j.memo(QT);const KT=n=>({nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function Mb(n){const{nodesConnectable:l,nodesFocusable:r,elementsSelectable:u,onError:o}=De(KT,Ke),s=VT(n.onlyRenderVisibleElements),c=XT();return A.jsx("div",{className:"react-flow__nodes",style:ns,children:s.map(d=>A.jsx(ZT,{id:d,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:c,nodesDraggable:n.nodesDraggable??!0,nodesConnectable:l,nodesFocusable:r,elementsSelectable:u,nodeClickDistance:n.nodeClickDistance,onError:o},d))})}Mb.displayName="NodeRenderer";const IT=j.memo(Mb);function JT(n){return De(j.useCallback(r=>{if(!n)return r.edges.map(o=>o.id);const u=[];if(r.width&&r.height)for(const o of r.edges){const s=r.nodeLookup.get(o.source),c=r.nodeLookup.get(o.target);s&&c&&QC({sourceNode:s,targetNode:c,width:r.width,height:r.height,transform:r.transform})&&u.push(o.id)}return u},[n]),Ke)}const FT=({color:n="none",strokeWidth:l=1})=>{const r={strokeWidth:l,...n&&{stroke:n}};return A.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},WT=({color:n="none",strokeWidth:l=1})=>{const r={strokeWidth:l,...n&&{stroke:n,fill:n}};return A.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ay={[Tr.Arrow]:FT,[Tr.ArrowClosed]:WT};function PT(n){const l=$e();return j.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(Ay,n)?Ay[n]:((s=(o=l.getState()).onError)==null||s.call(o,"009",mn.error009(n)),null)},[n])}const eA=({id:n,type:l,color:r,width:u=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:c,orient:d="auto-start-reverse"})=>{const h=PT(l);return h?A.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${u}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:d,refX:"0",refY:"0",children:A.jsx(h,{color:r,strokeWidth:c})}):null},Tb=({defaultColor:n,rfId:l})=>{const r=De(s=>s.edges),u=De(s=>s.defaultEdgeOptions),o=j.useMemo(()=>eM(r,{id:l,defaultColor:n,defaultMarkerStart:u==null?void 0:u.markerStart,defaultMarkerEnd:u==null?void 0:u.markerEnd}),[r,u,l,n]);return o.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:o.map(s=>A.jsx(eA,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};Tb.displayName="MarkerDefinitions";var tA=j.memo(Tb);function Ab({x:n,y:l,label:r,labelStyle:u,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:h,className:g,...p}){const[y,v]=j.useState({x:1,y:0,width:0,height:0}),b=ut(["react-flow__edge-textwrapper",g]),E=j.useRef(null);return j.useEffect(()=>{if(E.current){const N=E.current.getBBox();v({x:N.x,y:N.y,width:N.width,height:N.height})}},[r]),r?A.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:b,visibility:y.width?"visible":"hidden",...p,children:[o&&A.jsx("rect",{width:y.width+2*c[0],x:-c[0],y:-c[1],height:y.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:d,ry:d}),A.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:E,style:u,children:r}),h]}):null}Ab.displayName="EdgeText";const nA=j.memo(Ab);function as({path:n,labelX:l,labelY:r,label:u,labelStyle:o,labelShowBg:s,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:g=20,...p}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...p,d:n,fill:"none",className:ut(["react-flow__edge-path",p.className])}),g?A.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,u&&cn(l)&&cn(r)?A.jsx(nA,{x:l,y:r,label:u,labelStyle:o,labelShowBg:s,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Ry({pos:n,x1:l,y1:r,x2:u,y2:o}){return n===xe.Left||n===xe.Right?[.5*(l+u),r]:[l,.5*(r+o)]}function Rb({sourceX:n,sourceY:l,sourcePosition:r=xe.Bottom,targetX:u,targetY:o,targetPosition:s=xe.Top}){const[c,d]=Ry({pos:r,x1:n,y1:l,x2:u,y2:o}),[h,g]=Ry({pos:s,x1:u,y1:o,x2:n,y2:l}),[p,y,v,b]=I1({sourceX:n,sourceY:l,targetX:u,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:h,targetControlY:g});return[`M${n},${l} C${c},${d} ${h},${g} ${u},${o}`,p,y,v,b]}function zb(n){return j.memo(({id:l,sourceX:r,sourceY:u,targetX:o,targetY:s,sourcePosition:c,targetPosition:d,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:E,markerEnd:N,markerStart:w,interactionWidth:S})=>{const[C,_,M]=Rb({sourceX:r,sourceY:u,sourcePosition:c,targetX:o,targetY:s,targetPosition:d}),B=n.isInternal?void 0:l;return A.jsx(as,{id:B,path:C,labelX:_,labelY:M,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:E,markerEnd:N,markerStart:w,interactionWidth:S})})}const aA=zb({isInternal:!1}),Ob=zb({isInternal:!0});aA.displayName="SimpleBezierEdge";Ob.displayName="SimpleBezierEdgeInternal";function Db(n){return j.memo(({id:l,sourceX:r,sourceY:u,targetX:o,targetY:s,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:y,style:v,sourcePosition:b=xe.Bottom,targetPosition:E=xe.Top,markerEnd:N,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[_,M,B]=Kd({sourceX:r,sourceY:u,sourcePosition:b,targetX:o,targetY:s,targetPosition:E,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),L=n.isInternal?void 0:l;return A.jsx(as,{id:L,path:_,labelX:M,labelY:B,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:y,style:v,markerEnd:N,markerStart:w,interactionWidth:C})})}const jb=Db({isInternal:!1}),Lb=Db({isInternal:!0});jb.displayName="SmoothStepEdge";Lb.displayName="SmoothStepEdgeInternal";function Hb(n){return j.memo(({id:l,...r})=>{var o;const u=n.isInternal?void 0:l;return A.jsx(jb,{...r,id:u,pathOptions:j.useMemo(()=>{var s;return{borderRadius:0,offset:(s=r.pathOptions)==null?void 0:s.offset}},[(o=r.pathOptions)==null?void 0:o.offset])})})}const lA=Hb({isInternal:!1}),Bb=Hb({isInternal:!0});lA.displayName="StepEdge";Bb.displayName="StepEdgeInternal";function Ub(n){return j.memo(({id:l,sourceX:r,sourceY:u,targetX:o,targetY:s,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:y,style:v,markerEnd:b,markerStart:E,interactionWidth:N})=>{const[w,S,C]=W1({sourceX:r,sourceY:u,targetX:o,targetY:s}),_=n.isInternal?void 0:l;return A.jsx(as,{id:_,path:w,labelX:S,labelY:C,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:y,style:v,markerEnd:b,markerStart:E,interactionWidth:N})})}const iA=Ub({isInternal:!1}),qb=Ub({isInternal:!0});iA.displayName="StraightEdge";qb.displayName="StraightEdgeInternal";function kb(n){return j.memo(({id:l,sourceX:r,sourceY:u,targetX:o,targetY:s,sourcePosition:c=xe.Bottom,targetPosition:d=xe.Top,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:E,markerEnd:N,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[_,M,B]=J1({sourceX:r,sourceY:u,sourcePosition:c,targetX:o,targetY:s,targetPosition:d,curvature:S==null?void 0:S.curvature}),L=n.isInternal?void 0:l;return A.jsx(as,{id:L,path:_,labelX:M,labelY:B,label:h,labelStyle:g,labelShowBg:p,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:E,markerEnd:N,markerStart:w,interactionWidth:C})})}const rA=kb({isInternal:!1}),Yb=kb({isInternal:!0});rA.displayName="BezierEdge";Yb.displayName="BezierEdgeInternal";const zy={default:Yb,straight:qb,step:Bb,smoothstep:Lb,simplebezier:Ob},Oy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},uA=(n,l,r)=>r===xe.Left?n-l:r===xe.Right?n+l:n,oA=(n,l,r)=>r===xe.Top?n-l:r===xe.Bottom?n+l:n,Dy="react-flow__edgeupdater";function jy({position:n,centerX:l,centerY:r,radius:u=10,onMouseDown:o,onMouseEnter:s,onMouseOut:c,type:d}){return A.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:c,className:ut([Dy,`${Dy}-${d}`]),cx:uA(l,u,n),cy:oA(r,u,n),r:u,stroke:"transparent",fill:"transparent"})}function sA({isReconnectable:n,reconnectRadius:l,edge:r,sourceX:u,sourceY:o,targetX:s,targetY:c,sourcePosition:d,targetPosition:h,onReconnect:g,onReconnectStart:p,onReconnectEnd:y,setReconnecting:v,setUpdateHover:b}){const E=$e(),N=(M,B)=>{if(M.button!==0)return;const{autoPanOnConnect:L,domNode:U,connectionMode:O,connectionRadius:H,lib:$,onConnectStart:k,cancelConnection:Q,nodeLookup:P,rfId:R,panBy:Z,updateConnection:D}=E.getState(),Y=B.type==="target",F=(z,V)=>{v(!1),y==null||y(z,r,B.type,V)},I=z=>g==null?void 0:g(r,z),le=(z,V)=>{v(!0),p==null||p(M,r,B.type),k==null||k(z,V)};Fd.onPointerDown(M.nativeEvent,{autoPanOnConnect:L,connectionMode:O,connectionRadius:H,domNode:U,handleId:B.id,nodeId:B.nodeId,nodeLookup:P,isTarget:Y,edgeUpdaterType:B.type,lib:$,flowId:R,cancelConnection:Q,panBy:Z,isValidConnection:(...z)=>{var V,q;return((q=(V=E.getState()).isValidConnection)==null?void 0:q.call(V,...z))??!0},onConnect:I,onConnectStart:le,onConnectEnd:(...z)=>{var V,q;return(q=(V=E.getState()).onConnectEnd)==null?void 0:q.call(V,...z)},onReconnectEnd:F,updateConnection:D,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},w=M=>N(M,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),S=M=>N(M,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),C=()=>b(!0),_=()=>b(!1);return A.jsxs(A.Fragment,{children:[(n===!0||n==="source")&&A.jsx(jy,{position:d,centerX:u,centerY:o,radius:l,onMouseDown:w,onMouseEnter:C,onMouseOut:_,type:"source"}),(n===!0||n==="target")&&A.jsx(jy,{position:h,centerX:s,centerY:c,radius:l,onMouseDown:S,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function cA({id:n,edgesFocusable:l,edgesReconnectable:r,elementsSelectable:u,onClick:o,onDoubleClick:s,onContextMenu:c,onMouseEnter:d,onMouseMove:h,onMouseLeave:g,reconnectRadius:p,onReconnect:y,onReconnectStart:v,onReconnectEnd:b,rfId:E,edgeTypes:N,noPanClassName:w,onError:S,disableKeyboardA11y:C}){let _=De(me=>me.edgeLookup.get(n));const M=De(me=>me.defaultEdgeOptions);_=M?{...M,..._}:_;let B=_.type||"default",L=(N==null?void 0:N[B])||zy[B];L===void 0&&(S==null||S("011",mn.error011(B)),B="default",L=(N==null?void 0:N.default)||zy.default);const U=!!(_.focusable||l&&typeof _.focusable>"u"),O=typeof y<"u"&&(_.reconnectable||r&&typeof _.reconnectable>"u"),H=!!(_.selectable||u&&typeof _.selectable>"u"),$=j.useRef(null),[k,Q]=j.useState(!1),[P,R]=j.useState(!1),Z=$e(),{zIndex:D=_.zIndex,sourceX:Y,sourceY:F,targetX:I,targetY:le,sourcePosition:z,targetPosition:V}=De(j.useCallback(me=>{const ne=me.nodeLookup.get(_.source),he=me.nodeLookup.get(_.target);if(!ne||!he)return Oy;const pe=PC({id:n,sourceNode:ne,targetNode:he,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:me.connectionMode,onError:S}),we=$C({selected:_.selected,zIndex:_.zIndex,sourceNode:ne,targetNode:he,elevateOnSelect:me.elevateEdgesOnSelect,zIndexMode:me.zIndexMode});return{...pe||Oy,zIndex:we}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex,S]),Ke),q=j.useMemo(()=>_.markerStart?`url('#${Id(_.markerStart,E)}')`:void 0,[_.markerStart,E]),G=j.useMemo(()=>_.markerEnd?`url('#${Id(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||Y===null||F===null||I===null||le===null)return null;const J=me=>{var we;const{addSelectedEdges:ne,unselectNodesAndEdges:he,multiSelectionActive:pe}=Z.getState();H&&(Z.setState({nodesSelectionActive:!1}),_.selected&&pe?(he({nodes:[],edges:[_]}),(we=$.current)==null||we.blur()):ne([n])),o&&o(me,_)},re=s?me=>{s(me,{..._})}:void 0,se=c?me=>{c(me,{..._})}:void 0,ee=d?me=>{d(me,{..._})}:void 0,fe=h?me=>{h(me,{..._})}:void 0,ge=g?me=>{g(me,{..._})}:void 0,be=me=>{var ne;if(!C&&j1.includes(me.key)&&H){const{unselectNodesAndEdges:he,addSelectedEdges:pe}=Z.getState();me.key==="Escape"?((ne=$.current)==null||ne.blur(),he({edges:[_]})):pe([n])}};return A.jsx("svg",{style:{zIndex:D},children:A.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${B}`,_.className,w,{selected:_.selected,animated:_.animated,inactive:!H&&!o,updating:k,selectable:H}]),onClick:J,onDoubleClick:re,onContextMenu:se,onMouseEnter:ee,onMouseMove:fe,onMouseLeave:ge,onKeyDown:U?be:void 0,tabIndex:U?0:void 0,role:_.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":U?`${hb}-${E}`:void 0,ref:$,..._.domAttributes,children:[!P&&A.jsx(L,{id:n,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:H,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:Y,sourceY:F,targetX:I,targetY:le,sourcePosition:z,targetPosition:V,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:q,markerEnd:G,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),O&&A.jsx(sA,{edge:_,isReconnectable:O,reconnectRadius:p,onReconnect:y,onReconnectStart:v,onReconnectEnd:b,sourceX:Y,sourceY:F,targetX:I,targetY:le,sourcePosition:z,targetPosition:V,setUpdateHover:Q,setReconnecting:R})]})})}var fA=j.memo(cA);const dA=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Vb({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:r,edgeTypes:u,noPanClassName:o,onReconnect:s,onEdgeContextMenu:c,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:g,onEdgeClick:p,reconnectRadius:y,onEdgeDoubleClick:v,onReconnectStart:b,onReconnectEnd:E,disableKeyboardA11y:N}){const{edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,onError:_}=De(dA,Ke),M=JT(l);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(tA,{defaultColor:n,rfId:r}),M.map(B=>A.jsx(fA,{id:B,edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,noPanClassName:o,onReconnect:s,onContextMenu:c,onMouseEnter:d,onMouseMove:h,onMouseLeave:g,onClick:p,reconnectRadius:y,onDoubleClick:v,onReconnectStart:b,onReconnectEnd:E,rfId:r,onError:_,edgeTypes:u,disableKeyboardA11y:N},B))]})}Vb.displayName="EdgeRenderer";const hA=j.memo(Vb),Ly=n=>`translate(${n[0]}px,${n[1]}px) scale(${n[2]})`;function mA({children:n}){const l=$e(),r=j.useRef(null),[u]=j.useState(()=>l.getState().transform);return xb(()=>{let o=null;const s=()=>{const c=l.getState().transform;o&&c[0]===o[0]&&c[1]===o[1]&&c[2]===o[2]||(o=c,r.current&&(r.current.style.transform=Ly(c)))};return s(),l.subscribe(s)},[l]),A.jsx("div",{ref:r,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Ly(u)},children:n})}function gA(n){const l=Mh(),r=j.useRef(!1);j.useEffect(()=>{!r.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),r.current=!0)},[n,l.viewportInitialized])}const pA=n=>{var l;return(l=n.panZoom)==null?void 0:l.syncViewport};function yA(n){const l=De(pA),r=$e();return j.useEffect(()=>{n&&(l==null||l(n),r.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function vA(n){return n.connection.inProgress?{...n.connection,to:kr(n.connection.to,n.transform)}:{...n.connection}}function bA(n){return vA}function xA(n){const l=bA();return De(l,Ke)}const EA=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function SA({containerStyle:n,style:l,type:r,component:u}){const{nodesConnectable:o,width:s,height:c,isValid:d,inProgress:h}=De(EA,Ke);return!(s&&o&&h)?null:A.jsx("svg",{style:n,width:s,height:c,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:ut(["react-flow__connection",$1(d)]),children:A.jsx(Gb,{style:l,type:r,CustomComponent:u,isValid:d})})})}const Gb=({style:n,type:l=za.Bezier,CustomComponent:r,isValid:u})=>{const{inProgress:o,from:s,fromNode:c,fromHandle:d,fromPosition:h,to:g,toNode:p,toHandle:y,toPosition:v,pointer:b}=xA();if(!o)return;if(r)return A.jsx(r,{connectionLineType:l,connectionLineStyle:n,fromNode:c,fromHandle:d,fromX:s.x,fromY:s.y,toX:g.x,toY:g.y,fromPosition:h,toPosition:v,connectionStatus:$1(u),toNode:p,toHandle:y,pointer:b});let E="";const N={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:g.x,targetY:g.y,targetPosition:v};switch(l){case za.Bezier:[E]=J1(N);break;case za.SimpleBezier:[E]=Rb(N);break;case za.Step:[E]=Kd({...N,borderRadius:0});break;case za.SmoothStep:[E]=Kd(N);break;default:[E]=W1(N)}return A.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:n})};Gb.displayName="ConnectionLine";const wA={};function Hy(n=wA){j.useRef(n),$e(),j.useEffect(()=>{},[n])}function _A(){$e(),j.useRef(!1),j.useEffect(()=>{},[])}function Xb({nodeTypes:n,edgeTypes:l,onInit:r,onNodeClick:u,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:p,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:E,connectionLineStyle:N,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:C,selectionOnDrag:_,selectionMode:M,multiSelectionKeyCode:B,panActivationKeyCode:L,zoomActivationKeyCode:U,deleteKeyCode:O,onlyRenderVisibleElements:H,elementsSelectable:$,defaultViewport:k,translateExtent:Q,minZoom:P,maxZoom:R,preventScrolling:Z,defaultMarkerColor:D,zoomOnScroll:Y,zoomOnPinch:F,panOnScroll:I,panOnScrollSpeed:le,panOnScrollMode:z,zoomOnDoubleClick:V,panOnDrag:q,autoPanOnSelection:G,onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneScroll:fe,onPaneContextMenu:ge,paneClickDistance:be,nodeClickDistance:me,onEdgeContextMenu:ne,onEdgeMouseEnter:he,onEdgeMouseMove:pe,onEdgeMouseLeave:we,reconnectRadius:ze,onReconnect:yt,onReconnectStart:Et,onReconnectEnd:St,noDragClassName:Ot,noWheelClassName:Da,noPanClassName:Tn,disableKeyboardA11y:Fe,nodeExtent:Dt,rfId:$t,viewport:Qt,onViewportChange:Zt,nodesDraggable:gi}){return Hy(n),Hy(l),_A(),gA(r),yA(Qt),A.jsx(kT,{onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneContextMenu:ge,onPaneScroll:fe,paneClickDistance:be,deleteKeyCode:O,selectionKeyCode:C,selectionOnDrag:_,selectionMode:M,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:B,panActivationKeyCode:L,zoomActivationKeyCode:U,elementsSelectable:$,zoomOnScroll:Y,zoomOnPinch:F,zoomOnDoubleClick:V,panOnScroll:I,panOnScrollSpeed:le,panOnScrollMode:z,panOnDrag:q,autoPanOnSelection:G,defaultViewport:k,translateExtent:Q,minZoom:P,maxZoom:R,onSelectionContextMenu:y,preventScrolling:Z,noDragClassName:Ot,noWheelClassName:Da,noPanClassName:Tn,disableKeyboardA11y:Fe,onViewportChange:Zt,isControlledViewport:!!Qt,children:A.jsxs(mA,{children:[A.jsx(hA,{edgeTypes:l,onEdgeClick:o,onEdgeDoubleClick:c,onReconnect:yt,onReconnectStart:Et,onReconnectEnd:St,onlyRenderVisibleElements:H,onEdgeContextMenu:ne,onEdgeMouseEnter:he,onEdgeMouseMove:pe,onEdgeMouseLeave:we,reconnectRadius:ze,defaultMarkerColor:D,noPanClassName:Tn,disableKeyboardA11y:Fe,rfId:$t}),A.jsx(SA,{style:N,type:E,component:w,containerStyle:S}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(IT,{nodeTypes:n,onNodeClick:u,onNodeDoubleClick:s,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:p,nodeClickDistance:me,onlyRenderVisibleElements:H,noPanClassName:Tn,noDragClassName:Ot,disableKeyboardA11y:Fe,nodeExtent:Dt,rfId:$t,nodesDraggable:gi}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xb.displayName="GraphView";const NA=j.memo(Xb),CA=V1(),By=({nodes:n,edges:l,defaultNodes:r,defaultEdges:u,width:o,height:s,fitView:c,fitViewOptions:d,minZoom:h=.5,maxZoom:g=2,nodeOrigin:p,nodeExtent:y,zIndexMode:v="basic"}={})=>{const b=new Map,E=new Map,N=new Map,w=new Map,S=u??l??[],C=r??n??[],_=p??[0,0],M=y??Cr;tb(N,w,S);const{nodesInitialized:B}=Jd(C,b,E,{nodeOrigin:_,nodeExtent:M,zIndexMode:v});let L=[0,0,1];if(c&&o&&s){const U=Ur(b,{filter:k=>!!((k.width||k.initialWidth)&&(k.height||k.initialHeight))}),{x:O,y:H,zoom:$}=xh(U,o,s,h,g,(d==null?void 0:d.padding)??.1);L=[O,H,$]}return{rfId:"1",width:o??0,height:s??0,transform:L,nodes:C,nodesInitialized:B,nodeLookup:b,parentLookup:E,edges:S,edgeLookup:w,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:u!==void 0,panZoom:null,minZoom:h,maxZoom:g,translateExtent:Cr,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ui.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:d,fitViewResolver:null,connection:{...H1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:CA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:L1,zIndexMode:v,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},MA=({nodes:n,edges:l,defaultNodes:r,defaultEdges:u,width:o,height:s,fitView:c,fitViewOptions:d,minZoom:h,maxZoom:g,nodeOrigin:p,nodeExtent:y,zIndexMode:v})=>VM((b,E)=>{async function N(){const{nodeLookup:w,panZoom:S,fitViewOptions:C,fitViewResolver:_,width:M,height:B,minZoom:L,maxZoom:U}=E();S&&(await UC({nodes:w,width:M,height:B,panZoom:S,minZoom:L,maxZoom:U},C),_==null||_.resolve(!0),b({fitViewResolver:null}))}return{...By({nodes:n,edges:l,width:o,height:s,fitView:c,fitViewOptions:d,minZoom:h,maxZoom:g,nodeOrigin:p,nodeExtent:y,defaultNodes:r,defaultEdges:u,zIndexMode:v}),setNodes:w=>{const{nodeLookup:S,parentLookup:C,nodeOrigin:_,nodeExtent:M,elevateNodesOnSelect:B,fitViewQueued:L,zIndexMode:U,nodesSelectionActive:O}=E(),{nodesInitialized:H,hasSelectedNodes:$}=Jd(w,S,C,{nodeOrigin:_,nodeExtent:M,elevateNodesOnSelect:B,checkEquality:!0,zIndexMode:U}),k=O&&$;L&&H?(N(),b({nodes:w,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:k})):b({nodes:w,nodesInitialized:H,nodesSelectionActive:k})},setEdges:w=>{const{connectionLookup:S,edgeLookup:C}=E();tb(S,C,w),b({edges:w})},setDefaultNodesAndEdges:(w,S)=>{if(w){const{setNodes:C}=E();C(w),b({hasDefaultNodes:!0})}if(S){const{setEdges:C}=E();C(S),b({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:S,nodeLookup:C,parentLookup:_,domNode:M,nodeOrigin:B,nodeExtent:L,debug:U,fitViewQueued:O,zIndexMode:H}=E(),{changes:$,updatedInternals:k}=uM(w,C,_,M,B,L,H);k&&(aM(C,_,{nodeOrigin:B,nodeExtent:L,zIndexMode:H}),O?(N(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),($==null?void 0:$.length)>0&&(U&&console.log("React Flow: trigger node changes",$),S==null||S($)))},updateNodePositions:(w,S=!1)=>{const C=[];let _=[];const{nodeLookup:M,triggerNodeChanges:B,connection:L,updateConnection:U,onNodesChangeMiddlewareMap:O}=E();for(const[H,$]of w){const k=M.get(H),Q=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&($!=null&&$.position)),P={id:H,type:"position",position:Q?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:S};if(k&&L.inProgress&&L.fromNode.id===k.id){const R=fl(k,L.fromHandle,xe.Left,!0);U({...L,from:R})}Q&&k.parentId&&C.push({id:H,parentId:k.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),_.push(P)}if(C.length>0){const{parentLookup:H,nodeOrigin:$}=E(),k=Ch(C,M,H,$);_.push(...k)}for(const H of O.values())_=H(_);B(_)},triggerNodeChanges:w=>{const{onNodesChange:S,setNodes:C,nodes:_,hasDefaultNodes:M,debug:B}=E();if(w!=null&&w.length){if(M){const L=pb(w,_);C(L)}B&&console.log("React Flow: trigger node changes",w),S==null||S(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:S,setEdges:C,edges:_,hasDefaultEdges:M,debug:B}=E();if(w!=null&&w.length){if(M){const L=yb(w,_);C(L)}B&&console.log("React Flow: trigger edge changes",w),S==null||S(w)}},addSelectedNodes:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:B}=E();if(S){const L=w.map(U=>nl(U,!0));M(L);return}M(ti(_,new Set([...w]),!0)),B(ti(C))},addSelectedEdges:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:B}=E();if(S){const L=w.map(U=>nl(U,!0));B(L);return}B(ti(C,new Set([...w]))),M(ti(_,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:S}={})=>{const{edges:C,nodes:_,nodeLookup:M,triggerNodeChanges:B,triggerEdgeChanges:L}=E(),U=w||_,O=S||C,H=[];for(const k of U){if(!k.selected)continue;const Q=M.get(k.id);Q&&(Q.selected=!1),H.push(nl(k.id,!1))}const $=[];for(const k of O)k.selected&&$.push(nl(k.id,!1));B(H),L($)},setMinZoom:w=>{const{panZoom:S,maxZoom:C}=E();S==null||S.setScaleExtent([w,C]),b({minZoom:w})},setMaxZoom:w=>{const{panZoom:S,minZoom:C}=E();S==null||S.setScaleExtent([C,w]),b({maxZoom:w})},setTranslateExtent:w=>{var S;(S=E().panZoom)==null||S.setTranslateExtent(w),b({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:S,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:M}=E();if(!M)return;const B=S.reduce((U,O)=>O.selected?[...U,nl(O.id,!1)]:U,[]),L=w.reduce((U,O)=>O.selected?[...U,nl(O.id,!1)]:U,[]);C(B),_(L)},setNodeExtent:w=>{const{nodes:S,nodeLookup:C,parentLookup:_,nodeOrigin:M,elevateNodesOnSelect:B,nodeExtent:L,zIndexMode:U}=E();w[0][0]===L[0][0]&&w[0][1]===L[0][1]&&w[1][0]===L[1][0]&&w[1][1]===L[1][1]||(Jd(S,C,_,{nodeOrigin:M,nodeExtent:w,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:U}),b({nodeExtent:w}))},panBy:w=>{const{transform:S,width:C,height:_,panZoom:M,translateExtent:B}=E();return oM({delta:w,panZoom:M,transform:S,translateExtent:B,width:C,height:_})},setCenter:async(w,S,C)=>{const{width:_,height:M,maxZoom:B,panZoom:L}=E();if(!L)return!1;const U=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:B;return await L.setViewport({x:_/2-w*U,y:M/2-S*U,zoom:U},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),!0},cancelConnection:()=>{b({connection:{...H1}})},updateConnection:w=>{b({connection:w})},reset:()=>b({...By()})}},Object.is);function TA({initialNodes:n,initialEdges:l,defaultNodes:r,defaultEdges:u,initialWidth:o,initialHeight:s,initialMinZoom:c,initialMaxZoom:d,initialFitViewOptions:h,fitView:g,nodeOrigin:p,nodeExtent:y,zIndexMode:v,children:b}){const[E]=j.useState(()=>MA({nodes:n,edges:l,defaultNodes:r,defaultEdges:u,width:o,height:s,fitView:g,minZoom:c,maxZoom:d,fitViewOptions:h,nodeOrigin:p,nodeExtent:y,zIndexMode:v}));return A.jsx(GM,{value:E,children:A.jsx(dT,{children:A.jsx(MT,{children:b})})})}function AA({children:n,nodes:l,edges:r,defaultNodes:u,defaultEdges:o,width:s,height:c,fitView:d,fitViewOptions:h,minZoom:g,maxZoom:p,nodeOrigin:y,nodeExtent:v,zIndexMode:b}){return j.useContext(es)?A.jsx(A.Fragment,{children:n}):A.jsx(TA,{initialNodes:l,initialEdges:r,defaultNodes:u,defaultEdges:o,initialWidth:s,initialHeight:c,fitView:d,initialFitViewOptions:h,initialMinZoom:g,initialMaxZoom:p,nodeOrigin:y,nodeExtent:v,zIndexMode:b,children:n})}const RA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function zA({nodes:n,edges:l,defaultNodes:r,defaultEdges:u,className:o,nodeTypes:s,edgeTypes:c,onNodeClick:d,onEdgeClick:h,onInit:g,onMove:p,onMoveStart:y,onMoveEnd:v,onConnect:b,onConnectStart:E,onConnectEnd:N,onClickConnectStart:w,onClickConnectEnd:S,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:M,onNodeContextMenu:B,onNodeDoubleClick:L,onNodeDragStart:U,onNodeDrag:O,onNodeDragStop:H,onNodesDelete:$,onEdgesDelete:k,onDelete:Q,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:Z,onSelectionDragStop:D,onSelectionContextMenu:Y,onSelectionStart:F,onSelectionEnd:I,onBeforeDelete:le,connectionMode:z,connectionLineType:V=za.Bezier,connectionLineStyle:q,connectionLineComponent:G,connectionLineContainerStyle:J,deleteKeyCode:re="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:ee=!1,selectionMode:fe=Mr.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:be=Rr()?"Meta":"Control",zoomActivationKeyCode:me=Rr()?"Meta":"Control",snapToGrid:ne,snapGrid:he,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:we,nodesDraggable:ze,autoPanOnNodeFocus:yt,nodesConnectable:Et,nodesFocusable:St,nodeOrigin:Ot=mb,edgesFocusable:Da,edgesReconnectable:Tn,elementsSelectable:Fe=!0,defaultViewport:Dt=nT,minZoom:$t=.5,maxZoom:Qt=2,translateExtent:Zt=Cr,preventScrolling:gi=!0,nodeExtent:dl,defaultMarkerColor:ls="#b1b1b7",zoomOnScroll:is=!0,zoomOnPinch:ja=!0,panOnScroll:vt=!1,panOnScrollSpeed:vn=.5,panOnScrollMode:bt=il.Free,zoomOnDoubleClick:rs=!0,panOnDrag:us=!0,onPaneClick:os,onPaneMouseEnter:hl,onPaneMouseMove:ml,onPaneMouseLeave:gl,onPaneScroll:An,onPaneContextMenu:pl,paneClickDistance:La=1,nodeClickDistance:ss=0,children:Yr,onReconnect:pi,onReconnectStart:Ha,onReconnectEnd:cs,onEdgeContextMenu:Vr,onEdgeDoubleClick:Gr,onEdgeMouseEnter:Xr,onEdgeMouseMove:yi,onEdgeMouseLeave:vi,reconnectRadius:$r=10,onNodesChange:Qr,onEdgesChange:bn,noDragClassName:ot="nodrag",noWheelClassName:gt="nowheel",noPanClassName:Rn="nopan",fitView:yl,fitViewOptions:Zr,connectOnClick:fs,attributionPosition:Kr,proOptions:Ba,defaultEdgeOptions:bi,elevateNodesOnSelect:Pn=!0,elevateEdgesOnSelect:ea=!1,disableKeyboardA11y:ta=!1,autoPanOnConnect:na,autoPanOnNodeDrag:et,autoPanOnSelection:Ir=!0,autoPanSpeed:Jr,connectionRadius:zn,isValidConnection:aa,onError:ds,style:Fr,id:xi,nodeDragThreshold:hs,connectionDragThreshold:vl,viewport:bl,onViewportChange:an,width:wt,height:Wr,colorMode:ms="light",debug:Ei,onScroll:Ua,ariaLabelConfig:xl,zIndexMode:Pr="basic",..._t},Si){const El=xi||"1",wi=rT(ms),la=j.useCallback(_i=>{_i.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ua==null||Ua(_i)},[Ua]);return A.jsx("div",{"data-testid":"rf__wrapper",..._t,onScroll:la,style:{...Fr,...RA},ref:Si,className:ut(["react-flow",o,wi]),id:xi,role:"application",children:A.jsxs(AA,{nodes:n,edges:l,width:wt,height:Wr,fitView:yl,fitViewOptions:Zr,minZoom:$t,maxZoom:Qt,nodeOrigin:Ot,nodeExtent:dl,zIndexMode:Pr,children:[A.jsx(iT,{nodes:n,edges:l,defaultNodes:r,defaultEdges:u,onConnect:b,onConnectStart:E,onConnectEnd:N,onClickConnectStart:w,onClickConnectEnd:S,nodesDraggable:ze,autoPanOnNodeFocus:yt,nodesConnectable:Et,nodesFocusable:St,edgesFocusable:Da,edgesReconnectable:Tn,elementsSelectable:Fe,elevateNodesOnSelect:Pn,elevateEdgesOnSelect:ea,minZoom:$t,maxZoom:Qt,nodeExtent:dl,onNodesChange:Qr,onEdgesChange:bn,snapToGrid:ne,snapGrid:he,connectionMode:z,translateExtent:Zt,connectOnClick:fs,defaultEdgeOptions:bi,fitView:yl,fitViewOptions:Zr,onNodesDelete:$,onEdgesDelete:k,onDelete:Q,onNodeDragStart:U,onNodeDrag:O,onNodeDragStop:H,onSelectionDrag:Z,onSelectionDragStart:R,onSelectionDragStop:D,onMove:p,onMoveStart:y,onMoveEnd:v,noPanClassName:Rn,nodeOrigin:Ot,rfId:El,autoPanOnConnect:na,autoPanOnNodeDrag:et,autoPanSpeed:Jr,onError:ds,connectionRadius:zn,isValidConnection:aa,selectNodesOnDrag:we,nodeDragThreshold:hs,connectionDragThreshold:vl,onBeforeDelete:le,debug:Ei,ariaLabelConfig:xl,zIndexMode:Pr}),A.jsx(NA,{onInit:g,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:M,onNodeContextMenu:B,onNodeDoubleClick:L,nodeTypes:s,edgeTypes:c,connectionLineType:V,connectionLineStyle:q,connectionLineComponent:G,connectionLineContainerStyle:J,selectionKeyCode:se,selectionOnDrag:ee,selectionMode:fe,deleteKeyCode:re,multiSelectionKeyCode:be,panActivationKeyCode:ge,zoomActivationKeyCode:me,onlyRenderVisibleElements:pe,defaultViewport:Dt,translateExtent:Zt,minZoom:$t,maxZoom:Qt,preventScrolling:gi,zoomOnScroll:is,zoomOnPinch:ja,zoomOnDoubleClick:rs,panOnScroll:vt,panOnScrollSpeed:vn,panOnScrollMode:bt,panOnDrag:us,autoPanOnSelection:Ir,onPaneClick:os,onPaneMouseEnter:hl,onPaneMouseMove:ml,onPaneMouseLeave:gl,onPaneScroll:An,onPaneContextMenu:pl,paneClickDistance:La,nodeClickDistance:ss,onSelectionContextMenu:Y,onSelectionStart:F,onSelectionEnd:I,onReconnect:pi,onReconnectStart:Ha,onReconnectEnd:cs,onEdgeContextMenu:Vr,onEdgeDoubleClick:Gr,onEdgeMouseEnter:Xr,onEdgeMouseMove:yi,onEdgeMouseLeave:vi,reconnectRadius:$r,defaultMarkerColor:ls,noDragClassName:ot,noWheelClassName:gt,noPanClassName:Rn,rfId:El,disableKeyboardA11y:ta,nodeExtent:dl,viewport:bl,onViewportChange:an,nodesDraggable:ze}),A.jsx(tT,{onSelectionChange:P}),Yr,A.jsx(JM,{proOptions:Ba,position:Kr}),A.jsx(IM,{rfId:El,disableKeyboardA11y:ta})]})})}var OA=bb(zA);function DA(n){const[l,r]=j.useState(n),u=j.useCallback(o=>r(s=>pb(o,s)),[]);return[l,r,u]}function jA(n){const[l,r]=j.useState(n),u=j.useCallback(o=>r(s=>yb(o,s)),[]);return[l,r,u]}function LA({dimensions:n,lineWidth:l,variant:r,className:u}){return A.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:ut(["react-flow__background-pattern",r,u])})}function HA({radius:n,className:l}){return A.jsx("circle",{cx:n,cy:n,r:n,className:ut(["react-flow__background-pattern","dots",l])})}var Oa;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(Oa||(Oa={}));const BA={[Oa.Dots]:1,[Oa.Lines]:1,[Oa.Cross]:6},UA=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function $b({id:n,variant:l=Oa.Dots,gap:r=20,size:u,lineWidth:o=1,offset:s=0,color:c,bgColor:d,style:h,className:g,patternClassName:p}){const y=j.useRef(null),{transform:v,patternId:b}=De(UA,Ke),E=u||BA[l],N=l===Oa.Dots,w=l===Oa.Cross,S=Array.isArray(r)?r:[r,r],C=[S[0]*v[2]||1,S[1]*v[2]||1],_=E*v[2],M=Array.isArray(s)?s:[s,s],B=w?[_,_]:C,L=[M[0]*v[2]+B[0]/2,M[1]*v[2]+B[1]/2],U=`${b}${n||""}`;return A.jsxs("svg",{className:ut(["react-flow__background",g]),style:{...h,...ns,"--xy-background-color-props":d,"--xy-background-pattern-color-props":c},ref:y,"data-testid":"rf__background",children:[A.jsx("pattern",{id:U,x:v[0]%C[0],y:v[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:N?A.jsx(HA,{radius:_/2,className:p}):A.jsx(LA,{dimensions:B,lineWidth:o,variant:l,className:p})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}$b.displayName="Background";const qA=j.memo($b);function kA(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YA(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function VA(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.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 GA(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.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 XA(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.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 bo({children:n,className:l,...r}){return A.jsx("button",{type:"button",className:ut(["react-flow__controls-button",l]),...r,children:n})}const $A=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Qb({style:n,showZoom:l=!0,showFitView:r=!0,showInteractive:u=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:c,onFitView:d,onInteractiveChange:h,className:g,children:p,position:y="bottom-left",orientation:v="vertical","aria-label":b}){const E=$e(),{isInteractive:N,minZoomReached:w,maxZoomReached:S,ariaLabelConfig:C}=De($A,Ke),{zoomIn:_,zoomOut:M,fitView:B}=Mh(),L=()=>{_(),s==null||s()},U=()=>{M(),c==null||c()},O=()=>{B(o),d==null||d()},H=()=>{E.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),h==null||h(!N)},$=v==="horizontal"?"horizontal":"vertical";return A.jsxs(ts,{className:ut(["react-flow__controls",$,g]),position:y,style:n,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[l&&A.jsxs(A.Fragment,{children:[A.jsx(bo,{onClick:L,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:S,children:A.jsx(kA,{})}),A.jsx(bo,{onClick:U,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:w,children:A.jsx(YA,{})})]}),r&&A.jsx(bo,{className:"react-flow__controls-fitview",onClick:O,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:A.jsx(VA,{})}),u&&A.jsx(bo,{className:"react-flow__controls-interactive",onClick:H,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:N?A.jsx(XA,{}):A.jsx(GA,{})}),p]})}Qb.displayName="Controls";const QA=j.memo(Qb);function ZA({id:n,x:l,y:r,width:u,height:o,style:s,color:c,strokeColor:d,strokeWidth:h,className:g,borderRadius:p,shapeRendering:y,selected:v,onClick:b}){const{background:E,backgroundColor:N}=s||{},w=c||E||N;return A.jsx("rect",{className:ut(["react-flow__minimap-node",{selected:v},g]),x:l,y:r,rx:p,ry:p,width:u,height:o,style:{fill:w,stroke:d,strokeWidth:h},shapeRendering:y,onClick:b?S=>b(S,n):void 0})}const KA=j.memo(ZA),IA=n=>n.nodes.map(l=>l.id),Vf=n=>n instanceof Function?n:()=>n;function JA({nodeStrokeColor:n,nodeColor:l,nodeClassName:r="",nodeBorderRadius:u=5,nodeStrokeWidth:o,nodeComponent:s=KA,onClick:c}){const d=De(IA,Ke),h=Vf(l),g=Vf(n),p=Vf(r),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:d.map(v=>A.jsx(WA,{id:v,nodeColorFunc:h,nodeStrokeColorFunc:g,nodeClassNameFunc:p,nodeBorderRadius:u,nodeStrokeWidth:o,NodeComponent:s,onClick:c,shapeRendering:y},v))})}function FA({id:n,nodeColorFunc:l,nodeStrokeColorFunc:r,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:d,onClick:h}){const{node:g,x:p,y,width:v,height:b}=De(E=>{const N=E.nodeLookup.get(n);if(!N)return{node:void 0,x:0,y:0,width:0,height:0};const w=N.internals.userNode,{x:S,y:C}=N.internals.positionAbsolute,{width:_,height:M}=yn(w);return{node:w,x:S,y:C,width:_,height:M}},Ke);return!g||g.hidden||!G1(g)?null:A.jsx(d,{x:p,y,width:v,height:b,style:g.style,selected:!!g.selected,className:u(g),color:l(g),borderRadius:o,strokeColor:r(g),strokeWidth:s,shapeRendering:c,onClick:h,id:g.id})}const WA=j.memo(FA);var PA=j.memo(JA);const e3=200,t3=150,n3=n=>!n.hidden,a3=n=>{const l={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};let r=!1;for(const u of n.nodeLookup.values())if(!u.hidden){r=!0;break}return{viewBB:l,boundingRect:r?k1(Ur(n.nodeLookup,{filter:n3}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},Uy=(n,l)=>n.x===l.x&&n.y===l.y&&n.width===l.width&&n.height===l.height,l3=(n,l)=>Uy(n.viewBB,l.viewBB)&&Uy(n.boundingRect,l.boundingRect)&&n.rfId===l.rfId&&n.panZoom===l.panZoom&&n.translateExtent===l.translateExtent&&n.flowWidth===l.flowWidth&&n.flowHeight===l.flowHeight&&n.ariaLabelConfig===l.ariaLabelConfig,i3="react-flow__minimap-desc";function Zb({style:n,className:l,nodeStrokeColor:r,nodeColor:u,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:c,nodeComponent:d,bgColor:h,maskColor:g,maskStrokeColor:p,maskStrokeWidth:y,position:v="bottom-right",onClick:b,onNodeClick:E,pannable:N=!1,zoomable:w=!1,ariaLabel:S,inversePan:C,zoomStep:_=1,offsetScale:M=5}){const B=$e(),L=j.useRef(null),{boundingRect:U,panZoom:O,viewBB:H,rfId:$,translateExtent:k,flowWidth:Q,flowHeight:P,ariaLabelConfig:R}=De(a3,l3),Z=(n==null?void 0:n.width)??e3,D=(n==null?void 0:n.height)??t3,Y=U.width/Z,F=U.height/D,I=Math.max(Y,F),le=I*Z,z=I*D,V=M*I,q=U.x-(le-U.width)/2-V,G=U.y-(z-U.height)/2-V,J=le+V*2,re=z+V*2,se=`${i3}-${$}`,ee=j.useRef(0),fe=j.useRef();ee.current=I,j.useEffect(()=>{const he=B.getState().panZoom;if(L.current&&he)return fe.current=yM({domNode:L.current,panZoom:he,getTransform:()=>B.getState().transform,getViewScale:()=>ee.current}),()=>{var pe;(pe=fe.current)==null||pe.destroy()}},[O]),j.useEffect(()=>{var he;(he=fe.current)==null||he.update({translateExtent:k,width:Q,height:P,inversePan:C,pannable:N,zoomStep:_,zoomable:w})},[N,w,C,_,k,Q,P]);const ge=b?he=>{var ze;const[pe,we]=((ze=fe.current)==null?void 0:ze.pointer(he))||[0,0];b(he,{x:pe,y:we})}:void 0,be=j.useCallback((he,pe)=>{const we=B.getState().nodeLookup.get(pe).internals.userNode;E==null||E(he,we)},[E]),me=E?be:void 0,ne=S??R["minimap.ariaLabel"];return A.jsx(ts,{position:v,style:{...n,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*I:void 0,"--xy-minimap-node-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:ut(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:Z,height:D,viewBox:`${q} ${G} ${J} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:L,onClick:ge,children:[ne&&A.jsx("title",{id:se,children:ne}),A.jsx(PA,{onClick:me,nodeColor:u,nodeStrokeColor:r,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:c,nodeComponent:d}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-V},${G-V}h${J+V*2}v${re+V*2}h${-J-V*2}z
82
+ M${H.x},${H.y}h${H.width}v${H.height}h${-H.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Zb.displayName="MiniMap";const r3=j.memo(Zb),u3=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,o3={[ci.Line]:"right",[ci.Handle]:"bottom-right"};function s3({nodeId:n,position:l,variant:r=ci.Handle,className:u,style:o=void 0,children:s,color:c,minWidth:d=10,minHeight:h=10,maxWidth:g=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:v,autoScale:b=!0,shouldResize:E,onResizeStart:N,onResize:w,onResizeEnd:S}){const C=_b(),_=typeof n=="string"?n:C,M=$e(),B=j.useRef(null),L=r===ci.Handle,U=De(j.useCallback(u3(L&&b),[L,b]),Ke),O=j.useRef(null),H=l??o3[r];j.useEffect(()=>{if(!(!B.current||!_))return O.current||(O.current=RM({domNode:B.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:k,transform:Q,snapGrid:P,snapToGrid:R,nodeOrigin:Z,domNode:D}=M.getState();return{nodeLookup:k,transform:Q,snapGrid:P,snapToGrid:R,nodeOrigin:Z,paneDomNode:D}},onChange:(k,Q)=>{const{triggerNodeChanges:P,nodeLookup:R,parentLookup:Z,nodeOrigin:D}=M.getState(),Y=[],F={x:k.x,y:k.y},I=R.get(_);if(I&&I.expandParent&&I.parentId){const le=I.origin??D,z=k.width??I.measured.width??0,V=k.height??I.measured.height??0,q={id:I.id,parentId:I.parentId,rect:{width:z,height:V,...X1({x:k.x??I.position.x,y:k.y??I.position.y},{width:z,height:V},I.parentId,R,le)}},G=Ch([q],R,Z,D);Y.push(...G),F.x=k.x?Math.max(le[0]*z,k.x):void 0,F.y=k.y?Math.max(le[1]*V,k.y):void 0}if(F.x!==void 0&&F.y!==void 0){const le={id:_,type:"position",position:{...F}};Y.push(le)}if(k.width!==void 0&&k.height!==void 0){const z={id:_,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:k.width,height:k.height}};Y.push(z)}for(const le of Q){const z={...le,type:"position"};Y.push(z)}P(Y)},onEnd:({width:k,height:Q})=>{const P={id:_,type:"dimensions",resizing:!1,dimensions:{width:k,height:Q}};M.getState().triggerNodeChanges([P])}})),O.current.update({controlPosition:H,boundaries:{minWidth:d,minHeight:h,maxWidth:g,maxHeight:p},keepAspectRatio:y,resizeDirection:v,onResizeStart:N,onResize:w,onResizeEnd:S,shouldResize:E}),()=>{var k;(k=O.current)==null||k.destroy()}},[H,d,h,g,p,y,N,w,S,E]);const $=H.split("-");return A.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...$,r,u]),ref:B,style:{...o,scale:U,...c&&{[L?"backgroundColor":"borderColor"]:c}},children:s})}j.memo(s3);async function Xt(n,l={}){const r=await fetch(n,{...l,headers:{"content-type":"application/json",...l.headers||{}},credentials:"include"});if(!r.ok){const o=await r.text().catch(()=>"");throw new Error(o||`HTTP ${r.status}`)}return r.status===204?void 0:(r.headers.get("content-type")||"").includes("application/json")?await r.json():await r.text()}function To(n){return n?new Date(n).toLocaleString():"—"}function c3(){return Xt("/flow/graph")}function f3(n){return Xt("/flow/edges",{method:"PUT",body:JSON.stringify({edges:n})})}function d3(){return Xt("/studio/presets")}function h3(n){return Xt("/studio/conversations/call",{method:"POST",body:JSON.stringify(n)})}function m3(n,l){return Xt(`/studio/conversations/${encodeURIComponent(n)}/turns`,{method:"POST",body:JSON.stringify({text:l})})}function g3(n){return Xt(`/studio/conversations/${encodeURIComponent(n)}/idle`,{method:"POST",body:"{}"})}function p3(n,l="customer_ended"){return Xt(`/studio/conversations/${encodeURIComponent(n)}/end`,{method:"POST",body:JSON.stringify({reason:l})})}function y3(n){return Xt(`/studio/conversations/${encodeURIComponent(n)}`)}function v3(n){return Xt(`/studio/conversations/${encodeURIComponent(n)}/forms/pending`)}function b3(n,l){return Xt(`/studio/conversations/${encodeURIComponent(n)}/forms/${encodeURIComponent(l)}/ack`,{method:"POST",body:"{}"})}function x3(n,l,r){return Xt(`/studio/conversations/${encodeURIComponent(n)}/forms/${encodeURIComponent(l)}/submit`,{method:"POST",body:JSON.stringify({values:r})})}const qy="studio_caller_id";function ky(){const n=document.cookie.match(new RegExp(`(?:^|; )${qy}=([^;]*)`));if(n!=null&&n[1])return decodeURIComponent(n[1]);const l=crypto.randomUUID();return document.cookie=`${qy}=${encodeURIComponent(l)}; path=/; max-age=31536000; SameSite=Lax`,l}var Gf,Yy;function Ah(){if(Yy)return Gf;Yy=1;var n="\0",l="\0",r="";class u{constructor(p){it(this,"_isDirected",!0);it(this,"_isMultigraph",!1);it(this,"_isCompound",!1);it(this,"_label");it(this,"_defaultNodeLabelFn",()=>{});it(this,"_defaultEdgeLabelFn",()=>{});it(this,"_nodes",{});it(this,"_in",{});it(this,"_preds",{});it(this,"_out",{});it(this,"_sucs",{});it(this,"_edgeObjs",{});it(this,"_edgeLabels",{});it(this,"_nodeCount",0);it(this,"_edgeCount",0);it(this,"_parent");it(this,"_children");p&&(this._isDirected=Object.hasOwn(p,"directed")?p.directed:!0,this._isMultigraph=Object.hasOwn(p,"multigraph")?p.multigraph:!1,this._isCompound=Object.hasOwn(p,"compound")?p.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[l]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(p){return this._label=p,this}graph(){return this._label}setDefaultNodeLabel(p){return this._defaultNodeLabelFn=p,typeof p!="function"&&(this._defaultNodeLabelFn=()=>p),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var p=this;return this.nodes().filter(y=>Object.keys(p._in[y]).length===0)}sinks(){var p=this;return this.nodes().filter(y=>Object.keys(p._out[y]).length===0)}setNodes(p,y){var v=arguments,b=this;return p.forEach(function(E){v.length>1?b.setNode(E,y):b.setNode(E)}),this}setNode(p,y){return Object.hasOwn(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=y),this):(this._nodes[p]=arguments.length>1?y:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=l,this._children[p]={},this._children[l][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)}node(p){return this._nodes[p]}hasNode(p){return Object.hasOwn(this._nodes,p)}removeNode(p){var y=this;if(Object.hasOwn(this._nodes,p)){var v=b=>y.removeEdge(y._edgeObjs[b]);delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],this.children(p).forEach(function(b){y.setParent(b)}),delete this._children[p]),Object.keys(this._in[p]).forEach(v),delete this._in[p],delete this._preds[p],Object.keys(this._out[p]).forEach(v),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this}setParent(p,y){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(y===void 0)y=l;else{y+="";for(var v=y;v!==void 0;v=this.parent(v))if(v===p)throw new Error("Setting "+y+" as parent of "+p+" would create a cycle");this.setNode(y)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=y,this._children[y][p]=!0,this}_removeFromParentsChildList(p){delete this._children[this._parent[p]][p]}parent(p){if(this._isCompound){var y=this._parent[p];if(y!==l)return y}}children(p=l){if(this._isCompound){var y=this._children[p];if(y)return Object.keys(y)}else{if(p===l)return this.nodes();if(this.hasNode(p))return[]}}predecessors(p){var y=this._preds[p];if(y)return Object.keys(y)}successors(p){var y=this._sucs[p];if(y)return Object.keys(y)}neighbors(p){var y=this.predecessors(p);if(y){const b=new Set(y);for(var v of this.successors(p))b.add(v);return Array.from(b.values())}}isLeaf(p){var y;return this.isDirected()?y=this.successors(p):y=this.neighbors(p),y.length===0}filterNodes(p){var y=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});y.setGraph(this.graph());var v=this;Object.entries(this._nodes).forEach(function([N,w]){p(N)&&y.setNode(N,w)}),Object.values(this._edgeObjs).forEach(function(N){y.hasNode(N.v)&&y.hasNode(N.w)&&y.setEdge(N,v.edge(N))});var b={};function E(N){var w=v.parent(N);return w===void 0||y.hasNode(w)?(b[N]=w,w):w in b?b[w]:E(w)}return this._isCompound&&y.nodes().forEach(N=>y.setParent(N,E(N))),y}setDefaultEdgeLabel(p){return this._defaultEdgeLabelFn=p,typeof p!="function"&&(this._defaultEdgeLabelFn=()=>p),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(p,y){var v=this,b=arguments;return p.reduce(function(E,N){return b.length>1?v.setEdge(E,N,y):v.setEdge(E,N),N}),this}setEdge(){var p,y,v,b,E=!1,N=arguments[0];typeof N=="object"&&N!==null&&"v"in N?(p=N.v,y=N.w,v=N.name,arguments.length===2&&(b=arguments[1],E=!0)):(p=N,y=arguments[1],v=arguments[3],arguments.length>2&&(b=arguments[2],E=!0)),p=""+p,y=""+y,v!==void 0&&(v=""+v);var w=c(this._isDirected,p,y,v);if(Object.hasOwn(this._edgeLabels,w))return E&&(this._edgeLabels[w]=b),this;if(v!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(y),this._edgeLabels[w]=E?b:this._defaultEdgeLabelFn(p,y,v);var S=d(this._isDirected,p,y,v);return p=S.v,y=S.w,Object.freeze(S),this._edgeObjs[w]=S,o(this._preds[y],p),o(this._sucs[p],y),this._in[y][w]=S,this._out[p][w]=S,this._edgeCount++,this}edge(p,y,v){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,y,v);return this._edgeLabels[b]}edgeAsObj(){const p=this.edge(...arguments);return typeof p!="object"?{label:p}:p}hasEdge(p,y,v){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,y,v);return Object.hasOwn(this._edgeLabels,b)}removeEdge(p,y,v){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,y,v),E=this._edgeObjs[b];return E&&(p=E.v,y=E.w,delete this._edgeLabels[b],delete this._edgeObjs[b],s(this._preds[y],p),s(this._sucs[p],y),delete this._in[y][b],delete this._out[p][b],this._edgeCount--),this}inEdges(p,y){var v=this._in[p];if(v){var b=Object.values(v);return y?b.filter(E=>E.v===y):b}}outEdges(p,y){var v=this._out[p];if(v){var b=Object.values(v);return y?b.filter(E=>E.w===y):b}}nodeEdges(p,y){var v=this.inEdges(p,y);if(v)return v.concat(this.outEdges(p,y))}}function o(g,p){g[p]?g[p]++:g[p]=1}function s(g,p){--g[p]||delete g[p]}function c(g,p,y,v){var b=""+p,E=""+y;if(!g&&b>E){var N=b;b=E,E=N}return b+r+E+r+(v===void 0?n:v)}function d(g,p,y,v){var b=""+p,E=""+y;if(!g&&b>E){var N=b;b=E,E=N}var w={v:b,w:E};return v&&(w.name=v),w}function h(g,p){return c(g,p.v,p.w,p.name)}return Gf=u,Gf}var Xf,Vy;function E3(){return Vy||(Vy=1,Xf="2.2.4"),Xf}var $f,Gy;function S3(){return Gy||(Gy=1,$f={Graph:Ah(),version:E3()}),$f}var Qf,Xy;function w3(){if(Xy)return Qf;Xy=1;var n=Ah();Qf={write:l,read:o};function l(s){var c={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:r(s),edges:u(s)};return s.graph()!==void 0&&(c.value=structuredClone(s.graph())),c}function r(s){return s.nodes().map(function(c){var d=s.node(c),h=s.parent(c),g={v:c};return d!==void 0&&(g.value=d),h!==void 0&&(g.parent=h),g})}function u(s){return s.edges().map(function(c){var d=s.edge(c),h={v:c.v,w:c.w};return c.name!==void 0&&(h.name=c.name),d!==void 0&&(h.value=d),h})}function o(s){var c=new n(s.options).setGraph(s.value);return s.nodes.forEach(function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),s.edges.forEach(function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return Qf}var Zf,$y;function _3(){if($y)return Zf;$y=1,Zf=n;function n(l){var r={},u=[],o;function s(c){Object.hasOwn(r,c)||(r[c]=!0,o.push(c),l.successors(c).forEach(s),l.predecessors(c).forEach(s))}return l.nodes().forEach(function(c){o=[],s(c),o.length&&u.push(o)}),u}return Zf}var Kf,Qy;function Kb(){if(Qy)return Kf;Qy=1;class n{constructor(){it(this,"_arr",[]);it(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(r){return r.key})}has(r){return Object.hasOwn(this._keyIndices,r)}priority(r){var u=this._keyIndices[r];if(u!==void 0)return this._arr[u].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(r,u){var o=this._keyIndices;if(r=String(r),!Object.hasOwn(o,r)){var s=this._arr,c=s.length;return o[r]=c,s.push({key:r,priority:u}),this._decrease(c),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key}decrease(r,u){var o=this._keyIndices[r];if(u>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[o].priority+" New: "+u);this._arr[o].priority=u,this._decrease(o)}_heapify(r){var u=this._arr,o=2*r,s=o+1,c=r;o<u.length&&(c=u[o].priority<u[c].priority?o:c,s<u.length&&(c=u[s].priority<u[c].priority?s:c),c!==r&&(this._swap(r,c),this._heapify(c)))}_decrease(r){for(var u=this._arr,o=u[r].priority,s;r!==0&&(s=r>>1,!(u[s].priority<o));)this._swap(r,s),r=s}_swap(r,u){var o=this._arr,s=this._keyIndices,c=o[r],d=o[u];o[r]=d,o[u]=c,s[d.key]=r,s[c.key]=u}}return Kf=n,Kf}var If,Zy;function Ib(){if(Zy)return If;Zy=1;var n=Kb();If=r;var l=()=>1;function r(o,s,c,d){return u(o,String(s),c||l,d||function(h){return o.outEdges(h)})}function u(o,s,c,d){var h={},g=new n,p,y,v=function(b){var E=b.v!==p?b.v:b.w,N=h[E],w=c(b),S=y.distance+w;if(w<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+w);S<N.distance&&(N.distance=S,N.predecessor=p,g.decrease(E,S))};for(o.nodes().forEach(function(b){var E=b===s?0:Number.POSITIVE_INFINITY;h[b]={distance:E},g.add(b,E)});g.size()>0&&(p=g.removeMin(),y=h[p],y.distance!==Number.POSITIVE_INFINITY);)d(p).forEach(v);return h}return If}var Jf,Ky;function N3(){if(Ky)return Jf;Ky=1;var n=Ib();Jf=l;function l(r,u,o){return r.nodes().reduce(function(s,c){return s[c]=n(r,c,u,o),s},{})}return Jf}var Ff,Iy;function Jb(){if(Iy)return Ff;Iy=1,Ff=n;function n(l){var r=0,u=[],o={},s=[];function c(d){var h=o[d]={onStack:!0,lowlink:r,index:r++};if(u.push(d),l.successors(d).forEach(function(y){Object.hasOwn(o,y)?o[y].onStack&&(h.lowlink=Math.min(h.lowlink,o[y].index)):(c(y),h.lowlink=Math.min(h.lowlink,o[y].lowlink))}),h.lowlink===h.index){var g=[],p;do p=u.pop(),o[p].onStack=!1,g.push(p);while(d!==p);s.push(g)}}return l.nodes().forEach(function(d){Object.hasOwn(o,d)||c(d)}),s}return Ff}var Wf,Jy;function C3(){if(Jy)return Wf;Jy=1;var n=Jb();Wf=l;function l(r){return n(r).filter(function(u){return u.length>1||u.length===1&&r.hasEdge(u[0],u[0])})}return Wf}var Pf,Fy;function M3(){if(Fy)return Pf;Fy=1,Pf=l;var n=()=>1;function l(u,o,s){return r(u,o||n,s||function(c){return u.outEdges(c)})}function r(u,o,s){var c={},d=u.nodes();return d.forEach(function(h){c[h]={},c[h][h]={distance:0},d.forEach(function(g){h!==g&&(c[h][g]={distance:Number.POSITIVE_INFINITY})}),s(h).forEach(function(g){var p=g.v===h?g.w:g.v,y=o(g);c[h][p]={distance:y,predecessor:h}})}),d.forEach(function(h){var g=c[h];d.forEach(function(p){var y=c[p];d.forEach(function(v){var b=y[h],E=g[v],N=y[v],w=b.distance+E.distance;w<N.distance&&(N.distance=w,N.predecessor=E.predecessor)})})}),c}return Pf}var ed,Wy;function Fb(){if(Wy)return ed;Wy=1;function n(r){var u={},o={},s=[];function c(d){if(Object.hasOwn(o,d))throw new l;Object.hasOwn(u,d)||(o[d]=!0,u[d]=!0,r.predecessors(d).forEach(c),delete o[d],s.push(d))}if(r.sinks().forEach(c),Object.keys(u).length!==r.nodeCount())throw new l;return s}class l extends Error{constructor(){super(...arguments)}}return ed=n,n.CycleException=l,ed}var td,Py;function T3(){if(Py)return td;Py=1;var n=Fb();td=l;function l(r){try{n(r)}catch(u){if(u instanceof n.CycleException)return!1;throw u}return!0}return td}var nd,ev;function Wb(){if(ev)return nd;ev=1,nd=n;function n(o,s,c){Array.isArray(s)||(s=[s]);var d=o.isDirected()?y=>o.successors(y):y=>o.neighbors(y),h=c==="post"?l:r,g=[],p={};return s.forEach(y=>{if(!o.hasNode(y))throw new Error("Graph does not have node: "+y);h(y,d,p,g)}),g}function l(o,s,c,d){for(var h=[[o,!1]];h.length>0;){var g=h.pop();g[1]?d.push(g[0]):Object.hasOwn(c,g[0])||(c[g[0]]=!0,h.push([g[0],!0]),u(s(g[0]),p=>h.push([p,!1])))}}function r(o,s,c,d){for(var h=[o];h.length>0;){var g=h.pop();Object.hasOwn(c,g)||(c[g]=!0,d.push(g),u(s(g),p=>h.push(p)))}}function u(o,s){for(var c=o.length;c--;)s(o[c],c,o);return o}return nd}var ad,tv;function A3(){if(tv)return ad;tv=1;var n=Wb();ad=l;function l(r,u){return n(r,u,"post")}return ad}var ld,nv;function R3(){if(nv)return ld;nv=1;var n=Wb();ld=l;function l(r,u){return n(r,u,"pre")}return ld}var id,av;function z3(){if(av)return id;av=1;var n=Ah(),l=Kb();id=r;function r(u,o){var s=new n,c={},d=new l,h;function g(y){var v=y.v===h?y.w:y.v,b=d.priority(v);if(b!==void 0){var E=o(y);E<b&&(c[v]=h,d.decrease(v,E))}}if(u.nodeCount()===0)return s;u.nodes().forEach(function(y){d.add(y,Number.POSITIVE_INFINITY),s.setNode(y)}),d.decrease(u.nodes()[0],0);for(var p=!1;d.size()>0;){if(h=d.removeMin(),Object.hasOwn(c,h))s.setEdge(h,c[h]);else{if(p)throw new Error("Input graph is not connected: "+u);p=!0}u.nodeEdges(h).forEach(g)}return s}return id}var rd,lv;function O3(){return lv||(lv=1,rd={components:_3(),dijkstra:Ib(),dijkstraAll:N3(),findCycles:C3(),floydWarshall:M3(),isAcyclic:T3(),postorder:A3(),preorder:R3(),prim:z3(),tarjan:Jb(),topsort:Fb()}),rd}var ud,iv;function gn(){if(iv)return ud;iv=1;var n=S3();return ud={Graph:n.Graph,json:w3(),alg:O3(),version:n.version},ud}var od,rv;function D3(){if(rv)return od;rv=1;class n{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,s=o._prev;if(s!==o)return l(s),s}enqueue(o){let s=this._sentinel;o._prev&&o._next&&l(o),o._next=s._next,s._next._prev=o,s._next=o,o._prev=s}toString(){let o=[],s=this._sentinel,c=s._prev;for(;c!==s;)o.push(JSON.stringify(c,r)),c=c._prev;return"["+o.join(", ")+"]"}}function l(u){u._prev._next=u._next,u._next._prev=u._prev,delete u._next,delete u._prev}function r(u,o){if(u!=="_next"&&u!=="_prev")return o}return od=n,od}var sd,uv;function j3(){if(uv)return sd;uv=1;let n=gn().Graph,l=D3();sd=u;let r=()=>1;function u(g,p){if(g.nodeCount()<=1)return[];let y=c(g,p||r);return o(y.graph,y.buckets,y.zeroIdx).flatMap(b=>g.outEdges(b.v,b.w))}function o(g,p,y){let v=[],b=p[p.length-1],E=p[0],N;for(;g.nodeCount();){for(;N=E.dequeue();)s(g,p,y,N);for(;N=b.dequeue();)s(g,p,y,N);if(g.nodeCount()){for(let w=p.length-2;w>0;--w)if(N=p[w].dequeue(),N){v=v.concat(s(g,p,y,N,!0));break}}}return v}function s(g,p,y,v,b){let E=b?[]:void 0;return g.inEdges(v.v).forEach(N=>{let w=g.edge(N),S=g.node(N.v);b&&E.push({v:N.v,w:N.w}),S.out-=w,d(p,y,S)}),g.outEdges(v.v).forEach(N=>{let w=g.edge(N),S=N.w,C=g.node(S);C.in-=w,d(p,y,C)}),g.removeNode(v.v),E}function c(g,p){let y=new n,v=0,b=0;g.nodes().forEach(w=>{y.setNode(w,{v:w,in:0,out:0})}),g.edges().forEach(w=>{let S=y.edge(w.v,w.w)||0,C=p(w),_=S+C;y.setEdge(w.v,w.w,_),b=Math.max(b,y.node(w.v).out+=C),v=Math.max(v,y.node(w.w).in+=C)});let E=h(b+v+3).map(()=>new l),N=v+1;return y.nodes().forEach(w=>{d(E,N,y.node(w))}),{graph:y,buckets:E,zeroIdx:N}}function d(g,p,y){y.out?y.in?g[y.out-y.in+p].enqueue(y):g[g.length-1].enqueue(y):g[0].enqueue(y)}function h(g){const p=[];for(let y=0;y<g;y++)p.push(y);return p}return sd}var cd,ov;function rt(){if(ov)return cd;ov=1;let n=gn().Graph;cd={addBorderNode:p,addDummyNode:l,applyWithChunking:b,asNonCompoundGraph:u,buildLayerMatrix:d,intersectRect:c,mapValues:L,maxRank:E,normalizeRanks:h,notime:S,partition:N,pick:B,predecessorWeights:s,range:M,removeEmptyRanks:g,simplify:r,successorWeights:o,time:w,uniqueId:_,zipObject:U};function l(O,H,$,k){for(var Q=k;O.hasNode(Q);)Q=_(k);return $.dummy=H,O.setNode(Q,$),Q}function r(O){let H=new n().setGraph(O.graph());return O.nodes().forEach($=>H.setNode($,O.node($))),O.edges().forEach($=>{let k=H.edge($.v,$.w)||{weight:0,minlen:1},Q=O.edge($);H.setEdge($.v,$.w,{weight:k.weight+Q.weight,minlen:Math.max(k.minlen,Q.minlen)})}),H}function u(O){let H=new n({multigraph:O.isMultigraph()}).setGraph(O.graph());return O.nodes().forEach($=>{O.children($).length||H.setNode($,O.node($))}),O.edges().forEach($=>{H.setEdge($,O.edge($))}),H}function o(O){let H=O.nodes().map($=>{let k={};return O.outEdges($).forEach(Q=>{k[Q.w]=(k[Q.w]||0)+O.edge(Q).weight}),k});return U(O.nodes(),H)}function s(O){let H=O.nodes().map($=>{let k={};return O.inEdges($).forEach(Q=>{k[Q.v]=(k[Q.v]||0)+O.edge(Q).weight}),k});return U(O.nodes(),H)}function c(O,H){let $=O.x,k=O.y,Q=H.x-$,P=H.y-k,R=O.width/2,Z=O.height/2;if(!Q&&!P)throw new Error("Not possible to find intersection inside of the rectangle");let D,Y;return Math.abs(P)*R>Math.abs(Q)*Z?(P<0&&(Z=-Z),D=Z*Q/P,Y=Z):(Q<0&&(R=-R),D=R,Y=R*P/Q),{x:$+D,y:k+Y}}function d(O){let H=M(E(O)+1).map(()=>[]);return O.nodes().forEach($=>{let k=O.node($),Q=k.rank;Q!==void 0&&(H[Q][k.order]=$)}),H}function h(O){let H=O.nodes().map(k=>{let Q=O.node(k).rank;return Q===void 0?Number.MAX_VALUE:Q}),$=b(Math.min,H);O.nodes().forEach(k=>{let Q=O.node(k);Object.hasOwn(Q,"rank")&&(Q.rank-=$)})}function g(O){let H=O.nodes().map(R=>O.node(R).rank),$=b(Math.min,H),k=[];O.nodes().forEach(R=>{let Z=O.node(R).rank-$;k[Z]||(k[Z]=[]),k[Z].push(R)});let Q=0,P=O.graph().nodeRankFactor;Array.from(k).forEach((R,Z)=>{R===void 0&&Z%P!==0?--Q:R!==void 0&&Q&&R.forEach(D=>O.node(D).rank+=Q)})}function p(O,H,$,k){let Q={width:0,height:0};return arguments.length>=4&&(Q.rank=$,Q.order=k),l(O,"border",Q,H)}function y(O,H=v){const $=[];for(let k=0;k<O.length;k+=H){const Q=O.slice(k,k+H);$.push(Q)}return $}const v=65535;function b(O,H){if(H.length>v){const $=y(H);return O.apply(null,$.map(k=>O.apply(null,k)))}else return O.apply(null,H)}function E(O){const $=O.nodes().map(k=>{let Q=O.node(k).rank;return Q===void 0?Number.MIN_VALUE:Q});return b(Math.max,$)}function N(O,H){let $={lhs:[],rhs:[]};return O.forEach(k=>{H(k)?$.lhs.push(k):$.rhs.push(k)}),$}function w(O,H){let $=Date.now();try{return H()}finally{console.log(O+" time: "+(Date.now()-$)+"ms")}}function S(O,H){return H()}let C=0;function _(O){var H=++C;return O+(""+H)}function M(O,H,$=1){H==null&&(H=O,O=0);let k=P=>P<H;$<0&&(k=P=>H<P);const Q=[];for(let P=O;k(P);P+=$)Q.push(P);return Q}function B(O,H){const $={};for(const k of H)O[k]!==void 0&&($[k]=O[k]);return $}function L(O,H){let $=H;return typeof H=="string"&&($=k=>k[H]),Object.entries(O).reduce((k,[Q,P])=>(k[Q]=$(P,Q),k),{})}function U(O,H){return O.reduce(($,k,Q)=>($[k]=H[Q],$),{})}return cd}var fd,sv;function L3(){if(sv)return fd;sv=1;let n=j3(),l=rt().uniqueId;fd={run:r,undo:o};function r(s){(s.graph().acyclicer==="greedy"?n(s,d(s)):u(s)).forEach(h=>{let g=s.edge(h);s.removeEdge(h),g.forwardName=h.name,g.reversed=!0,s.setEdge(h.w,h.v,g,l("rev"))});function d(h){return g=>h.edge(g).weight}}function u(s){let c=[],d={},h={};function g(p){Object.hasOwn(h,p)||(h[p]=!0,d[p]=!0,s.outEdges(p).forEach(y=>{Object.hasOwn(d,y.w)?c.push(y):g(y.w)}),delete d[p])}return s.nodes().forEach(g),c}function o(s){s.edges().forEach(c=>{let d=s.edge(c);if(d.reversed){s.removeEdge(c);let h=d.forwardName;delete d.reversed,delete d.forwardName,s.setEdge(c.w,c.v,d,h)}})}return fd}var dd,cv;function H3(){if(cv)return dd;cv=1;let n=rt();dd={run:l,undo:u};function l(o){o.graph().dummyChains=[],o.edges().forEach(s=>r(o,s))}function r(o,s){let c=s.v,d=o.node(c).rank,h=s.w,g=o.node(h).rank,p=s.name,y=o.edge(s),v=y.labelRank;if(g===d+1)return;o.removeEdge(s);let b,E,N;for(N=0,++d;d<g;++N,++d)y.points=[],E={width:0,height:0,edgeLabel:y,edgeObj:s,rank:d},b=n.addDummyNode(o,"edge",E,"_d"),d===v&&(E.width=y.width,E.height=y.height,E.dummy="edge-label",E.labelpos=y.labelpos),o.setEdge(c,b,{weight:y.weight},p),N===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,h,{weight:y.weight},p)}function u(o){o.graph().dummyChains.forEach(s=>{let c=o.node(s),d=c.edgeLabel,h;for(o.setEdge(c.edgeObj,d);c.dummy;)h=o.successors(s)[0],o.removeNode(s),d.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height),s=h,c=o.node(s)})}return dd}var hd,fv;function ko(){if(fv)return hd;fv=1;const{applyWithChunking:n}=rt();hd={longestPath:l,slack:r};function l(u){var o={};function s(c){var d=u.node(c);if(Object.hasOwn(o,c))return d.rank;o[c]=!0;let h=u.outEdges(c).map(p=>p==null?Number.POSITIVE_INFINITY:s(p.w)-u.edge(p).minlen);var g=n(Math.min,h);return g===Number.POSITIVE_INFINITY&&(g=0),d.rank=g}u.sources().forEach(s)}function r(u,o){return u.node(o.w).rank-u.node(o.v).rank-u.edge(o).minlen}return hd}var md,dv;function Pb(){if(dv)return md;dv=1;var n=gn().Graph,l=ko().slack;md=r;function r(c){var d=new n({directed:!1}),h=c.nodes()[0],g=c.nodeCount();d.setNode(h,{});for(var p,y;u(d,c)<g;)p=o(d,c),y=d.hasNode(p.v)?l(c,p):-l(c,p),s(d,c,y);return d}function u(c,d){function h(g){d.nodeEdges(g).forEach(p=>{var y=p.v,v=g===y?p.w:y;!c.hasNode(v)&&!l(d,p)&&(c.setNode(v,{}),c.setEdge(g,v,{}),h(v))})}return c.nodes().forEach(h),c.nodeCount()}function o(c,d){return d.edges().reduce((g,p)=>{let y=Number.POSITIVE_INFINITY;return c.hasNode(p.v)!==c.hasNode(p.w)&&(y=l(d,p)),y<g[0]?[y,p]:g},[Number.POSITIVE_INFINITY,null])[1]}function s(c,d,h){c.nodes().forEach(g=>d.node(g).rank+=h)}return md}var gd,hv;function B3(){if(hv)return gd;hv=1;var n=Pb(),l=ko().slack,r=ko().longestPath,u=gn().alg.preorder,o=gn().alg.postorder,s=rt().simplify;gd=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=g,c.leaveEdge=v,c.enterEdge=b,c.exchangeEdges=E;function c(C){C=s(C),r(C);var _=n(C);p(_),d(_,C);for(var M,B;M=v(_);)B=b(_,C,M),E(_,C,M,B)}function d(C,_){var M=o(C,C.nodes());M=M.slice(0,M.length-1),M.forEach(B=>h(C,_,B))}function h(C,_,M){var B=C.node(M),L=B.parent;C.edge(M,L).cutvalue=g(C,_,M)}function g(C,_,M){var B=C.node(M),L=B.parent,U=!0,O=_.edge(M,L),H=0;return O||(U=!1,O=_.edge(L,M)),H=O.weight,_.nodeEdges(M).forEach($=>{var k=$.v===M,Q=k?$.w:$.v;if(Q!==L){var P=k===U,R=_.edge($).weight;if(H+=P?R:-R,w(C,M,Q)){var Z=C.edge(M,Q).cutvalue;H+=P?-Z:Z}}}),H}function p(C,_){arguments.length<2&&(_=C.nodes()[0]),y(C,{},1,_)}function y(C,_,M,B,L){var U=M,O=C.node(B);return _[B]=!0,C.neighbors(B).forEach(H=>{Object.hasOwn(_,H)||(M=y(C,_,M,H,B))}),O.low=U,O.lim=M++,L?O.parent=L:delete O.parent,M}function v(C){return C.edges().find(_=>C.edge(_).cutvalue<0)}function b(C,_,M){var B=M.v,L=M.w;_.hasEdge(B,L)||(B=M.w,L=M.v);var U=C.node(B),O=C.node(L),H=U,$=!1;U.lim>O.lim&&(H=O,$=!0);var k=_.edges().filter(Q=>$===S(C,C.node(Q.v),H)&&$!==S(C,C.node(Q.w),H));return k.reduce((Q,P)=>l(_,P)<l(_,Q)?P:Q)}function E(C,_,M,B){var L=M.v,U=M.w;C.removeEdge(L,U),C.setEdge(B.v,B.w,{}),p(C),d(C,_),N(C,_)}function N(C,_){var M=C.nodes().find(L=>!_.node(L).parent),B=u(C,M);B=B.slice(1),B.forEach(L=>{var U=C.node(L).parent,O=_.edge(L,U),H=!1;O||(O=_.edge(U,L),H=!0),_.node(L).rank=_.node(U).rank+(H?O.minlen:-O.minlen)})}function w(C,_,M){return C.hasEdge(_,M)}function S(C,_,M){return M.low<=_.lim&&_.lim<=M.lim}return gd}var pd,mv;function U3(){if(mv)return pd;mv=1;var n=ko(),l=n.longestPath,r=Pb(),u=B3();pd=o;function o(h){var g=h.graph().ranker;if(g instanceof Function)return g(h);switch(h.graph().ranker){case"network-simplex":d(h);break;case"tight-tree":c(h);break;case"longest-path":s(h);break;case"none":break;default:d(h)}}var s=l;function c(h){l(h),r(h)}function d(h){u(h)}return pd}var yd,gv;function q3(){if(gv)return yd;gv=1,yd=n;function n(u){let o=r(u);u.graph().dummyChains.forEach(s=>{let c=u.node(s),d=c.edgeObj,h=l(u,o,d.v,d.w),g=h.path,p=h.lca,y=0,v=g[y],b=!0;for(;s!==d.w;){if(c=u.node(s),b){for(;(v=g[y])!==p&&u.node(v).maxRank<c.rank;)y++;v===p&&(b=!1)}if(!b){for(;y<g.length-1&&u.node(v=g[y+1]).minRank<=c.rank;)y++;v=g[y]}u.setParent(s,v),s=u.successors(s)[0]}})}function l(u,o,s,c){let d=[],h=[],g=Math.min(o[s].low,o[c].low),p=Math.max(o[s].lim,o[c].lim),y,v;y=s;do y=u.parent(y),d.push(y);while(y&&(o[y].low>g||p>o[y].lim));for(v=y,y=c;(y=u.parent(y))!==v;)h.push(y);return{path:d.concat(h.reverse()),lca:v}}function r(u){let o={},s=0;function c(d){let h=s;u.children(d).forEach(c),o[d]={low:h,lim:s++}}return u.children().forEach(c),o}return yd}var vd,pv;function k3(){if(pv)return vd;pv=1;let n=rt();vd={run:l,cleanup:s};function l(c){let d=n.addDummyNode(c,"root",{},"_root"),h=u(c),g=Object.values(h),p=n.applyWithChunking(Math.max,g)-1,y=2*p+1;c.graph().nestingRoot=d,c.edges().forEach(b=>c.edge(b).minlen*=y);let v=o(c)+1;c.children().forEach(b=>r(c,d,y,v,p,h,b)),c.graph().nodeRankFactor=y}function r(c,d,h,g,p,y,v){let b=c.children(v);if(!b.length){v!==d&&c.setEdge(d,v,{weight:0,minlen:h});return}let E=n.addBorderNode(c,"_bt"),N=n.addBorderNode(c,"_bb"),w=c.node(v);c.setParent(E,v),w.borderTop=E,c.setParent(N,v),w.borderBottom=N,b.forEach(S=>{r(c,d,h,g,p,y,S);let C=c.node(S),_=C.borderTop?C.borderTop:S,M=C.borderBottom?C.borderBottom:S,B=C.borderTop?g:2*g,L=_!==M?1:p-y[v]+1;c.setEdge(E,_,{weight:B,minlen:L,nestingEdge:!0}),c.setEdge(M,N,{weight:B,minlen:L,nestingEdge:!0})}),c.parent(v)||c.setEdge(d,E,{weight:0,minlen:p+y[v]})}function u(c){var d={};function h(g,p){var y=c.children(g);y&&y.length&&y.forEach(v=>h(v,p+1)),d[g]=p}return c.children().forEach(g=>h(g,1)),d}function o(c){return c.edges().reduce((d,h)=>d+c.edge(h).weight,0)}function s(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,c.edges().forEach(h=>{var g=c.edge(h);g.nestingEdge&&c.removeEdge(h)})}return vd}var bd,yv;function Y3(){if(yv)return bd;yv=1;let n=rt();bd=l;function l(u){function o(s){let c=u.children(s),d=u.node(s);if(c.length&&c.forEach(o),Object.hasOwn(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(let h=d.minRank,g=d.maxRank+1;h<g;++h)r(u,"borderLeft","_bl",s,d,h),r(u,"borderRight","_br",s,d,h)}}u.children().forEach(o)}function r(u,o,s,c,d,h){let g={width:0,height:0,rank:h,borderType:o},p=d[o][h-1],y=n.addDummyNode(u,"border",g,s);d[o][h]=y,u.setParent(y,c),p&&u.setEdge(p,y,{weight:1})}return bd}var xd,vv;function V3(){if(vv)return xd;vv=1,xd={adjust:n,undo:l};function n(h){let g=h.graph().rankdir.toLowerCase();(g==="lr"||g==="rl")&&r(h)}function l(h){let g=h.graph().rankdir.toLowerCase();(g==="bt"||g==="rl")&&o(h),(g==="lr"||g==="rl")&&(c(h),r(h))}function r(h){h.nodes().forEach(g=>u(h.node(g))),h.edges().forEach(g=>u(h.edge(g)))}function u(h){let g=h.width;h.width=h.height,h.height=g}function o(h){h.nodes().forEach(g=>s(h.node(g))),h.edges().forEach(g=>{let p=h.edge(g);p.points.forEach(s),Object.hasOwn(p,"y")&&s(p)})}function s(h){h.y=-h.y}function c(h){h.nodes().forEach(g=>d(h.node(g))),h.edges().forEach(g=>{let p=h.edge(g);p.points.forEach(d),Object.hasOwn(p,"x")&&d(p)})}function d(h){let g=h.x;h.x=h.y,h.y=g}return xd}var Ed,bv;function G3(){if(bv)return Ed;bv=1;let n=rt();Ed=l;function l(r){let u={},o=r.nodes().filter(p=>!r.children(p).length),s=o.map(p=>r.node(p).rank),c=n.applyWithChunking(Math.max,s),d=n.range(c+1).map(()=>[]);function h(p){if(u[p])return;u[p]=!0;let y=r.node(p);d[y.rank].push(p),r.successors(p).forEach(h)}return o.sort((p,y)=>r.node(p).rank-r.node(y).rank).forEach(h),d}return Ed}var Sd,xv;function X3(){if(xv)return Sd;xv=1;let n=rt().zipObject;Sd=l;function l(u,o){let s=0;for(let c=1;c<o.length;++c)s+=r(u,o[c-1],o[c]);return s}function r(u,o,s){let c=n(s,s.map((v,b)=>b)),d=o.flatMap(v=>u.outEdges(v).map(b=>({pos:c[b.w],weight:u.edge(b).weight})).sort((b,E)=>b.pos-E.pos)),h=1;for(;h<s.length;)h<<=1;let g=2*h-1;h-=1;let p=new Array(g).fill(0),y=0;return d.forEach(v=>{let b=v.pos+h;p[b]+=v.weight;let E=0;for(;b>0;)b%2&&(E+=p[b+1]),b=b-1>>1,p[b]+=v.weight;y+=v.weight*E}),y}return Sd}var wd,Ev;function $3(){if(Ev)return wd;Ev=1,wd=n;function n(l,r=[]){return r.map(u=>{let o=l.inEdges(u);if(o.length){let s=o.reduce((c,d)=>{let h=l.edge(d),g=l.node(d.v);return{sum:c.sum+h.weight*g.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:u,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:u}})}return wd}var _d,Sv;function Q3(){if(Sv)return _d;Sv=1;let n=rt();_d=l;function l(o,s){let c={};o.forEach((h,g)=>{let p=c[h.v]={indegree:0,in:[],out:[],vs:[h.v],i:g};h.barycenter!==void 0&&(p.barycenter=h.barycenter,p.weight=h.weight)}),s.edges().forEach(h=>{let g=c[h.v],p=c[h.w];g!==void 0&&p!==void 0&&(p.indegree++,g.out.push(c[h.w]))});let d=Object.values(c).filter(h=>!h.indegree);return r(d)}function r(o){let s=[];function c(h){return g=>{g.merged||(g.barycenter===void 0||h.barycenter===void 0||g.barycenter>=h.barycenter)&&u(h,g)}}function d(h){return g=>{g.in.push(h),--g.indegree===0&&o.push(g)}}for(;o.length;){let h=o.pop();s.push(h),h.in.reverse().forEach(c(h)),h.out.forEach(d(h))}return s.filter(h=>!h.merged).map(h=>n.pick(h,["vs","i","barycenter","weight"]))}function u(o,s){let c=0,d=0;o.weight&&(c+=o.barycenter*o.weight,d+=o.weight),s.weight&&(c+=s.barycenter*s.weight,d+=s.weight),o.vs=s.vs.concat(o.vs),o.barycenter=c/d,o.weight=d,o.i=Math.min(s.i,o.i),s.merged=!0}return _d}var Nd,wv;function Z3(){if(wv)return Nd;wv=1;let n=rt();Nd=l;function l(o,s){let c=n.partition(o,E=>Object.hasOwn(E,"barycenter")),d=c.lhs,h=c.rhs.sort((E,N)=>N.i-E.i),g=[],p=0,y=0,v=0;d.sort(u(!!s)),v=r(g,h,v),d.forEach(E=>{v+=E.vs.length,g.push(E.vs),p+=E.barycenter*E.weight,y+=E.weight,v=r(g,h,v)});let b={vs:g.flat(!0)};return y&&(b.barycenter=p/y,b.weight=y),b}function r(o,s,c){let d;for(;s.length&&(d=s[s.length-1]).i<=c;)s.pop(),o.push(d.vs),c++;return c}function u(o){return(s,c)=>s.barycenter<c.barycenter?-1:s.barycenter>c.barycenter?1:o?c.i-s.i:s.i-c.i}return Nd}var Cd,_v;function K3(){if(_v)return Cd;_v=1;let n=$3(),l=Q3(),r=Z3();Cd=u;function u(c,d,h,g){let p=c.children(d),y=c.node(d),v=y?y.borderLeft:void 0,b=y?y.borderRight:void 0,E={};v&&(p=p.filter(C=>C!==v&&C!==b));let N=n(c,p);N.forEach(C=>{if(c.children(C.v).length){let _=u(c,C.v,h,g);E[C.v]=_,Object.hasOwn(_,"barycenter")&&s(C,_)}});let w=l(N,h);o(w,E);let S=r(w,g);if(v&&(S.vs=[v,S.vs,b].flat(!0),c.predecessors(v).length)){let C=c.node(c.predecessors(v)[0]),_=c.node(c.predecessors(b)[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+C.order+_.order)/(S.weight+2),S.weight+=2}return S}function o(c,d){c.forEach(h=>{h.vs=h.vs.flatMap(g=>d[g]?d[g].vs:g)})}function s(c,d){c.barycenter!==void 0?(c.barycenter=(c.barycenter*c.weight+d.barycenter*d.weight)/(c.weight+d.weight),c.weight+=d.weight):(c.barycenter=d.barycenter,c.weight=d.weight)}return Cd}var Md,Nv;function I3(){if(Nv)return Md;Nv=1;let n=gn().Graph,l=rt();Md=r;function r(o,s,c,d){d||(d=o.nodes());let h=u(o),g=new n({compound:!0}).setGraph({root:h}).setDefaultNodeLabel(p=>o.node(p));return d.forEach(p=>{let y=o.node(p),v=o.parent(p);(y.rank===s||y.minRank<=s&&s<=y.maxRank)&&(g.setNode(p),g.setParent(p,v||h),o[c](p).forEach(b=>{let E=b.v===p?b.w:b.v,N=g.edge(E,p),w=N!==void 0?N.weight:0;g.setEdge(E,p,{weight:o.edge(b).weight+w})}),Object.hasOwn(y,"minRank")&&g.setNode(p,{borderLeft:y.borderLeft[s],borderRight:y.borderRight[s]}))}),g}function u(o){for(var s;o.hasNode(s=l.uniqueId("_root")););return s}return Md}var Td,Cv;function J3(){if(Cv)return Td;Cv=1,Td=n;function n(l,r,u){let o={},s;u.forEach(c=>{let d=l.parent(c),h,g;for(;d;){if(h=l.parent(d),h?(g=o[h],o[h]=d):(g=s,s=d),g&&g!==d){r.setEdge(g,d);return}d=h}})}return Td}var Ad,Mv;function F3(){if(Mv)return Ad;Mv=1;let n=G3(),l=X3(),r=K3(),u=I3(),o=J3(),s=gn().Graph,c=rt();Ad=d;function d(y,v){if(v&&typeof v.customOrder=="function"){v.customOrder(y,d);return}let b=c.maxRank(y),E=h(y,c.range(1,b+1),"inEdges"),N=h(y,c.range(b-1,-1,-1),"outEdges"),w=n(y);if(p(y,w),v&&v.disableOptimalOrderHeuristic)return;let S=Number.POSITIVE_INFINITY,C;for(let _=0,M=0;M<4;++_,++M){g(_%2?E:N,_%4>=2),w=c.buildLayerMatrix(y);let B=l(y,w);B<S&&(M=0,C=Object.assign({},w),S=B)}p(y,C)}function h(y,v,b){const E=new Map,N=(w,S)=>{E.has(w)||E.set(w,[]),E.get(w).push(S)};for(const w of y.nodes()){const S=y.node(w);if(typeof S.rank=="number"&&N(S.rank,w),typeof S.minRank=="number"&&typeof S.maxRank=="number")for(let C=S.minRank;C<=S.maxRank;C++)C!==S.rank&&N(C,w)}return v.map(function(w){return u(y,w,b,E.get(w)||[])})}function g(y,v){let b=new s;y.forEach(function(E){let N=E.graph().root,w=r(E,N,b,v);w.vs.forEach((S,C)=>E.node(S).order=C),o(E,b,w.vs)})}function p(y,v){Object.values(v).forEach(b=>b.forEach((E,N)=>y.node(E).order=N))}return Ad}var Rd,Tv;function W3(){if(Tv)return Rd;Tv=1;let n=gn().Graph,l=rt();Rd={positionX:b,findType1Conflicts:r,findType2Conflicts:u,addConflict:s,hasConflict:c,verticalAlignment:d,horizontalCompaction:h,alignCoordinates:y,findSmallestWidthAlignment:p,balance:v};function r(w,S){let C={};function _(M,B){let L=0,U=0,O=M.length,H=B[B.length-1];return B.forEach(($,k)=>{let Q=o(w,$),P=Q?w.node(Q).order:O;(Q||$===H)&&(B.slice(U,k+1).forEach(R=>{w.predecessors(R).forEach(Z=>{let D=w.node(Z),Y=D.order;(Y<L||P<Y)&&!(D.dummy&&w.node(R).dummy)&&s(C,Z,R)})}),U=k+1,L=P)}),B}return S.length&&S.reduce(_),C}function u(w,S){let C={};function _(B,L,U,O,H){let $;l.range(L,U).forEach(k=>{$=B[k],w.node($).dummy&&w.predecessors($).forEach(Q=>{let P=w.node(Q);P.dummy&&(P.order<O||P.order>H)&&s(C,Q,$)})})}function M(B,L){let U=-1,O,H=0;return L.forEach(($,k)=>{if(w.node($).dummy==="border"){let Q=w.predecessors($);Q.length&&(O=w.node(Q[0]).order,_(L,H,k,U,O),H=k,U=O)}_(L,H,L.length,O,B.length)}),L}return S.length&&S.reduce(M),C}function o(w,S){if(w.node(S).dummy)return w.predecessors(S).find(C=>w.node(C).dummy)}function s(w,S,C){if(S>C){let M=S;S=C,C=M}let _=w[S];_||(w[S]=_={}),_[C]=!0}function c(w,S,C){if(S>C){let _=S;S=C,C=_}return!!w[S]&&Object.hasOwn(w[S],C)}function d(w,S,C,_){let M={},B={},L={};return S.forEach(U=>{U.forEach((O,H)=>{M[O]=O,B[O]=O,L[O]=H})}),S.forEach(U=>{let O=-1;U.forEach(H=>{let $=_(H);if($.length){$=$.sort((Q,P)=>L[Q]-L[P]);let k=($.length-1)/2;for(let Q=Math.floor(k),P=Math.ceil(k);Q<=P;++Q){let R=$[Q];B[H]===H&&O<L[R]&&!c(C,H,R)&&(B[R]=H,B[H]=M[H]=M[R],O=L[R])}}})}),{root:M,align:B}}function h(w,S,C,_,M){let B={},L=g(w,S,C,M),U=M?"borderLeft":"borderRight";function O(k,Q){let P=L.nodes(),R=P.pop(),Z={};for(;R;)Z[R]?k(R):(Z[R]=!0,P.push(R),P=P.concat(Q(R))),R=P.pop()}function H(k){B[k]=L.inEdges(k).reduce((Q,P)=>Math.max(Q,B[P.v]+L.edge(P)),0)}function $(k){let Q=L.outEdges(k).reduce((R,Z)=>Math.min(R,B[Z.w]-L.edge(Z)),Number.POSITIVE_INFINITY),P=w.node(k);Q!==Number.POSITIVE_INFINITY&&P.borderType!==U&&(B[k]=Math.max(B[k],Q))}return O(H,L.predecessors.bind(L)),O($,L.successors.bind(L)),Object.keys(_).forEach(k=>B[k]=B[C[k]]),B}function g(w,S,C,_){let M=new n,B=w.graph(),L=E(B.nodesep,B.edgesep,_);return S.forEach(U=>{let O;U.forEach(H=>{let $=C[H];if(M.setNode($),O){var k=C[O],Q=M.edge(k,$);M.setEdge(k,$,Math.max(L(w,H,O),Q||0))}O=H})}),M}function p(w,S){return Object.values(S).reduce((C,_)=>{let M=Number.NEGATIVE_INFINITY,B=Number.POSITIVE_INFINITY;Object.entries(_).forEach(([U,O])=>{let H=N(w,U)/2;M=Math.max(O+H,M),B=Math.min(O-H,B)});const L=M-B;return L<C[0]&&(C=[L,_]),C},[Number.POSITIVE_INFINITY,null])[1]}function y(w,S){let C=Object.values(S),_=l.applyWithChunking(Math.min,C),M=l.applyWithChunking(Math.max,C);["u","d"].forEach(B=>{["l","r"].forEach(L=>{let U=B+L,O=w[U];if(O===S)return;let H=Object.values(O),$=_-l.applyWithChunking(Math.min,H);L!=="l"&&($=M-l.applyWithChunking(Math.max,H)),$&&(w[U]=l.mapValues(O,k=>k+$))})})}function v(w,S){return l.mapValues(w.ul,(C,_)=>{if(S)return w[S.toLowerCase()][_];{let M=Object.values(w).map(B=>B[_]).sort((B,L)=>B-L);return(M[1]+M[2])/2}})}function b(w){let S=l.buildLayerMatrix(w),C=Object.assign(r(w,S),u(w,S)),_={},M;["u","d"].forEach(L=>{M=L==="u"?S:Object.values(S).reverse(),["l","r"].forEach(U=>{U==="r"&&(M=M.map(k=>Object.values(k).reverse()));let O=(L==="u"?w.predecessors:w.successors).bind(w),H=d(w,M,C,O),$=h(w,M,H.root,H.align,U==="r");U==="r"&&($=l.mapValues($,k=>-k)),_[L+U]=$})});let B=p(w,_);return y(_,B),v(_,w.graph().align)}function E(w,S,C){return(_,M,B)=>{let L=_.node(M),U=_.node(B),O=0,H;if(O+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":H=-L.width/2;break;case"r":H=L.width/2;break}if(H&&(O+=C?H:-H),H=0,O+=(L.dummy?S:w)/2,O+=(U.dummy?S:w)/2,O+=U.width/2,Object.hasOwn(U,"labelpos"))switch(U.labelpos.toLowerCase()){case"l":H=U.width/2;break;case"r":H=-U.width/2;break}return H&&(O+=C?H:-H),H=0,O}}function N(w,S){return w.node(S).width}return Rd}var zd,Av;function P3(){if(Av)return zd;Av=1;let n=rt(),l=W3().positionX;zd=r;function r(o){o=n.asNonCompoundGraph(o),u(o),Object.entries(l(o)).forEach(([s,c])=>o.node(s).x=c)}function u(o){let s=n.buildLayerMatrix(o),c=o.graph().ranksep,d=0;s.forEach(h=>{const g=h.reduce((p,y)=>{const v=o.node(y).height;return p>v?p:v},0);h.forEach(p=>o.node(p).y=d+g/2),d+=g+c})}return zd}var Od,Rv;function eR(){if(Rv)return Od;Rv=1;let n=L3(),l=H3(),r=U3(),u=rt().normalizeRanks,o=q3(),s=rt().removeEmptyRanks,c=k3(),d=Y3(),h=V3(),g=F3(),p=P3(),y=rt(),v=gn().Graph;Od=b;function b(q,G){let J=G&&G.debugTiming?y.time:y.notime;J("layout",()=>{let re=J(" buildLayoutGraph",()=>O(q));J(" runLayout",()=>E(re,J,G)),J(" updateInputGraph",()=>N(q,re))})}function E(q,G,J){G(" makeSpaceForEdgeLabels",()=>H(q)),G(" removeSelfEdges",()=>F(q)),G(" acyclic",()=>n.run(q)),G(" nestingGraph.run",()=>c.run(q)),G(" rank",()=>r(y.asNonCompoundGraph(q))),G(" injectEdgeLabelProxies",()=>$(q)),G(" removeEmptyRanks",()=>s(q)),G(" nestingGraph.cleanup",()=>c.cleanup(q)),G(" normalizeRanks",()=>u(q)),G(" assignRankMinMax",()=>k(q)),G(" removeEdgeLabelProxies",()=>Q(q)),G(" normalize.run",()=>l.run(q)),G(" parentDummyChains",()=>o(q)),G(" addBorderSegments",()=>d(q)),G(" order",()=>g(q,J)),G(" insertSelfEdges",()=>I(q)),G(" adjustCoordinateSystem",()=>h.adjust(q)),G(" position",()=>p(q)),G(" positionSelfEdges",()=>le(q)),G(" removeBorderNodes",()=>Y(q)),G(" normalize.undo",()=>l.undo(q)),G(" fixupEdgeLabelCoords",()=>Z(q)),G(" undoCoordinateSystem",()=>h.undo(q)),G(" translateGraph",()=>P(q)),G(" assignNodeIntersects",()=>R(q)),G(" reversePoints",()=>D(q)),G(" acyclic.undo",()=>n.undo(q))}function N(q,G){q.nodes().forEach(J=>{let re=q.node(J),se=G.node(J);re&&(re.x=se.x,re.y=se.y,re.rank=se.rank,G.children(J).length&&(re.width=se.width,re.height=se.height))}),q.edges().forEach(J=>{let re=q.edge(J),se=G.edge(J);re.points=se.points,Object.hasOwn(se,"x")&&(re.x=se.x,re.y=se.y)}),q.graph().width=G.graph().width,q.graph().height=G.graph().height}let w=["nodesep","edgesep","ranksep","marginx","marginy"],S={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],_=["width","height","rank"],M={width:0,height:0},B=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"];function O(q){let G=new v({multigraph:!0,compound:!0}),J=V(q.graph());return G.setGraph(Object.assign({},S,z(J,w),y.pick(J,C))),q.nodes().forEach(re=>{let se=V(q.node(re));const ee=z(se,_);Object.keys(M).forEach(fe=>{ee[fe]===void 0&&(ee[fe]=M[fe])}),G.setNode(re,ee),G.setParent(re,q.parent(re))}),q.edges().forEach(re=>{let se=V(q.edge(re));G.setEdge(re,Object.assign({},L,z(se,B),y.pick(se,U)))}),G}function H(q){let G=q.graph();G.ranksep/=2,q.edges().forEach(J=>{let re=q.edge(J);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function $(q){q.edges().forEach(G=>{let J=q.edge(G);if(J.width&&J.height){let re=q.node(G.v),ee={rank:(q.node(G.w).rank-re.rank)/2+re.rank,e:G};y.addDummyNode(q,"edge-proxy",ee,"_ep")}})}function k(q){let G=0;q.nodes().forEach(J=>{let re=q.node(J);re.borderTop&&(re.minRank=q.node(re.borderTop).rank,re.maxRank=q.node(re.borderBottom).rank,G=Math.max(G,re.maxRank))}),q.graph().maxRank=G}function Q(q){q.nodes().forEach(G=>{let J=q.node(G);J.dummy==="edge-proxy"&&(q.edge(J.e).labelRank=J.rank,q.removeNode(G))})}function P(q){let G=Number.POSITIVE_INFINITY,J=0,re=Number.POSITIVE_INFINITY,se=0,ee=q.graph(),fe=ee.marginx||0,ge=ee.marginy||0;function be(me){let ne=me.x,he=me.y,pe=me.width,we=me.height;G=Math.min(G,ne-pe/2),J=Math.max(J,ne+pe/2),re=Math.min(re,he-we/2),se=Math.max(se,he+we/2)}q.nodes().forEach(me=>be(q.node(me))),q.edges().forEach(me=>{let ne=q.edge(me);Object.hasOwn(ne,"x")&&be(ne)}),G-=fe,re-=ge,q.nodes().forEach(me=>{let ne=q.node(me);ne.x-=G,ne.y-=re}),q.edges().forEach(me=>{let ne=q.edge(me);ne.points.forEach(he=>{he.x-=G,he.y-=re}),Object.hasOwn(ne,"x")&&(ne.x-=G),Object.hasOwn(ne,"y")&&(ne.y-=re)}),ee.width=J-G+fe,ee.height=se-re+ge}function R(q){q.edges().forEach(G=>{let J=q.edge(G),re=q.node(G.v),se=q.node(G.w),ee,fe;J.points?(ee=J.points[0],fe=J.points[J.points.length-1]):(J.points=[],ee=se,fe=re),J.points.unshift(y.intersectRect(re,ee)),J.points.push(y.intersectRect(se,fe))})}function Z(q){q.edges().forEach(G=>{let J=q.edge(G);if(Object.hasOwn(J,"x"))switch((J.labelpos==="l"||J.labelpos==="r")&&(J.width-=J.labeloffset),J.labelpos){case"l":J.x-=J.width/2+J.labeloffset;break;case"r":J.x+=J.width/2+J.labeloffset;break}})}function D(q){q.edges().forEach(G=>{let J=q.edge(G);J.reversed&&J.points.reverse()})}function Y(q){q.nodes().forEach(G=>{if(q.children(G).length){let J=q.node(G),re=q.node(J.borderTop),se=q.node(J.borderBottom),ee=q.node(J.borderLeft[J.borderLeft.length-1]),fe=q.node(J.borderRight[J.borderRight.length-1]);J.width=Math.abs(fe.x-ee.x),J.height=Math.abs(se.y-re.y),J.x=ee.x+J.width/2,J.y=re.y+J.height/2}}),q.nodes().forEach(G=>{q.node(G).dummy==="border"&&q.removeNode(G)})}function F(q){q.edges().forEach(G=>{if(G.v===G.w){var J=q.node(G.v);J.selfEdges||(J.selfEdges=[]),J.selfEdges.push({e:G,label:q.edge(G)}),q.removeEdge(G)}})}function I(q){var G=y.buildLayerMatrix(q);G.forEach(J=>{var re=0;J.forEach((se,ee)=>{var fe=q.node(se);fe.order=ee+re,(fe.selfEdges||[]).forEach(ge=>{y.addDummyNode(q,"selfedge",{width:ge.label.width,height:ge.label.height,rank:fe.rank,order:ee+ ++re,e:ge.e,label:ge.label},"_se")}),delete fe.selfEdges})})}function le(q){q.nodes().forEach(G=>{var J=q.node(G);if(J.dummy==="selfedge"){var re=q.node(J.e.v),se=re.x+re.width/2,ee=re.y,fe=J.x-se,ge=re.height/2;q.setEdge(J.e,J.label),q.removeNode(G),J.label.points=[{x:se+2*fe/3,y:ee-ge},{x:se+5*fe/6,y:ee-ge},{x:se+fe,y:ee},{x:se+5*fe/6,y:ee+ge},{x:se+2*fe/3,y:ee+ge}],J.label.x=J.x,J.label.y=J.y}})}function z(q,G){return y.mapValues(y.pick(q,G),Number)}function V(q){var G={};return q&&Object.entries(q).forEach(([J,re])=>{typeof J=="string"&&(J=J.toLowerCase()),G[J]=re}),G}return Od}var Dd,zv;function tR(){if(zv)return Dd;zv=1;let n=rt(),l=gn().Graph;Dd={debugOrdering:r};function r(u){let o=n.buildLayerMatrix(u),s=new l({compound:!0,multigraph:!0}).setGraph({});return u.nodes().forEach(c=>{s.setNode(c,{label:c}),s.setParent(c,"layer"+u.node(c).rank)}),u.edges().forEach(c=>s.setEdge(c.v,c.w,{},c.name)),o.forEach((c,d)=>{let h="layer"+d;s.setNode(h,{rank:"same"}),c.reduce((g,p)=>(s.setEdge(g,p,{style:"invis"}),p))}),s}return Dd}var jd,Ov;function nR(){return Ov||(Ov=1,jd="1.1.8"),jd}var Ld,Dv;function aR(){return Dv||(Dv=1,Ld={graphlib:gn(),layout:eR(),debug:tR(),util:{time:rt().time,notime:rt().notime},version:nR()}),Ld}var lR=aR();const jv=Pd(lR),Hd=240,xo=76;function iR(n){return n.map(l=>{const r=l.style&&typeof l.style.stroke=="string"&&l.style.stroke||"#5c6b7a";return{id:l.id,source:l.source,target:l.target,label:l.label,type:l.type||"smoothstep",animated:l.animated,reconnectable:!0,markerEnd:{type:Tr.ArrowClosed,width:16,height:16,color:r},style:{stroke:"#5c6b7a",strokeWidth:1.5,...l.style||{}},labelStyle:{fill:"#8b9aab",fontSize:12},labelBgStyle:{fill:"#0f1419",fillOpacity:.85},labelBgPadding:[5,3]}})}function rR(n,l,r){var c;const u=(c=n.lanes)!=null&&c.length?n.lanes.map(d=>d.id):[...new Set(n.nodes.map(d=>d.data.lane||"main"))],o=[];let s=0;for(const d of u){const h=n.nodes.filter(y=>(y.data.lane||"main")===d);if(!h.length)continue;const g=new jv.graphlib.Graph;g.setDefaultEdgeLabel(()=>({})),g.setGraph({rankdir:"LR",nodesep:xo*1.5,ranksep:Hd*.85});for(const y of h)g.setNode(y.id,{width:Hd,height:xo});for(const y of n.edges)h.some(v=>v.id===y.source)&&h.some(v=>v.id===y.target)&&g.setEdge(y.source,y.target);jv.layout(g);let p=0;for(const y of h){const v=g.node(y.id),b=((v==null?void 0:v.x)??0)-Hd/2,E=((v==null?void 0:v.y)??0)-xo/2+s;p=Math.max(p,E+xo);const N=!!(l&&(y.id===l||y.data.realNodeId===l)),w=!!(r&&y.data.moduleId&&y.data.moduleId!==r&&y.data.lane!=="portals"&&y.data.lane!=="conversation");o.push({id:y.id,type:"studio",position:{x:b,y:E},data:{...y.data,isCurrent:N,isDim:w}})}s=p+80}return{nodes:o,edges:iR(n.edges)}}function uR(n){switch(n){case"conversation-start":case"start-prep":return"#14b8a6";case"assistant-start":case"greeting":case"start":return"#2d6a4f";case"assistant-end":case"portal-exit":return"#78716c";case"handoff-exit":return"#e9c46a";case"portal":return"#7b2d3b";case"portal-start":return"#9a3412";case"terminal":return"#4a3f6b";case"normal":default:return"#1d3557"}}function oR({data:n}){const l=["rf-node",n.kind||"normal",n.isCurrent?"current":"",n.isDim?"assistant-dim":""].filter(Boolean).join(" ");return A.jsxs("div",{className:l,children:[A.jsx(fi,{type:"target",position:xe.Left}),n.assistantName?A.jsx("div",{className:"rf-node-asst",children:n.assistantName}):null,A.jsx("div",{className:"rf-node-title",children:n.label}),A.jsx("div",{className:"rf-node-sub",children:n.className}),A.jsx(fi,{type:"source",position:xe.Right})]})}const sR=j.memo(oR),cR={studio:sR};function fR(n){var l,r;return(l=n.data)!=null&&l.isCurrent?"#f4a261":uR((r=n.data)==null?void 0:r.kind)}function dR(){var me;const[n,l]=j.useState(null),[r,u]=j.useState(!1),[o,s]=j.useState({}),[c,d,h]=DA([]),[g,p,y]=jA([]),[v,b]=j.useState(!1),[E,N]=j.useState(""),[w,S]=j.useState(""),[C,_]=j.useState(null),[M,B]=j.useState(null),[L,U]=j.useState([]),[O,H]=j.useState(""),[$,k]=j.useState(!1),[Q,P]=j.useState(null),[R,Z]=j.useState({}),D=j.useRef(null),Y=j.useRef(0),F=j.useRef(new Set),I=!!(C&&M&&!M.ended),le=j.useCallback(async(ne,he)=>{const pe=await c3(),we=rR(pe,ne,he);return d(we.nodes),p(we.edges),b(!1),pe},[p,d]);j.useEffect(()=>{(async()=>{try{const[ne]=await Promise.all([d3(),le(null,null)]);l(ne);const he={};for(const pe of ne.featureFlags||[])he[pe.id]=pe.defaultEnabled;s(he)}catch(ne){S(ne instanceof Error?ne.message:String(ne))}})()},[le]);const z=j.useCallback((ne,he="assistant")=>{const pe=Date.now();he==="assistant"&&pe-Y.current<250,Y.current=pe,U(we=>[...we,...ne.filter(Boolean).map(ze=>({role:he,text:ze}))])},[]),V=j.useCallback(async ne=>{var pe,we;B(ne),_(ne.conversationId),(pe=ne.say)!=null&&pe.length&&z(ne.say,"assistant");for(const ze of ne.actions||[])ze.kind==="toolCall"&&((we=ze.toolCall)!=null&&we.name)&&z([`tool: ${ze.toolCall.name}`],"system");const he=ne.diagramHighlightNodeId||ne.currentNodeId||ne.selectedNodeId||null;await le(he,ne.activeModuleId||null),ne.formExpose&&P(ne.formExpose),ne.ended&&(k(!1),z(["Call ended."],"system"))},[z,le]),q=()=>{D.current&&(window.clearTimeout(D.current),D.current=null)},G=j.useCallback(ne=>{q(),D.current=window.setTimeout(()=>{(async()=>{try{const he=await g3(ne);await V(he),he.ended||G(ne)}catch{}})()},3e4)},[V]);j.useEffect(()=>{if(!I||!C)return;const ne=window.setInterval(()=>{(async()=>{var he;try{const pe=await v3(C);(he=pe.liveSays)!=null&&he.length&&z(pe.liveSays,"assistant"),pe.formExpose&&(P(pe.formExpose),F.current.has(pe.formExpose.exposeId)||(F.current.add(pe.formExpose.exposeId),await b3(C,pe.formExpose.exposeId)))}catch{}})()},400);return()=>window.clearInterval(ne)},[z,C,I]);const J=j.useCallback(ne=>{p(he=>vb({...ne,type:"smoothstep"},he)),b(!0)},[p]),re=async()=>{S(""),k(!0),U([]),F.current.clear();try{const ne=await h3({callerId:ky(),afterHours:r,featureFlagOverrides:o});await V(ne),ne.ended||G(ne.conversationId),N("Live")}catch(ne){S(ne instanceof Error?ne.message:String(ne))}finally{k(!1)}},se=async()=>{if(!C||!O.trim()||$)return;const ne=O.trim();H(""),z([ne],"user"),k(!0),q();try{const he=await m3(C,ne);await V(he),he.ended||G(C)}catch(he){S(he instanceof Error?he.message:String(he))}finally{k(!1)}},ee=async()=>{if(C){q(),k(!0);try{const ne=await p3(C);await V(ne),N("Ended")}catch(ne){S(ne instanceof Error?ne.message:String(ne))}finally{k(!1)}}},fe=async()=>{try{await f3(g.map(ne=>({source:ne.source,target:ne.target,label:typeof ne.label=="string"?ne.label:void 0}))),b(!1),N("Edges saved")}catch(ne){S(ne instanceof Error?ne.message:String(ne))}},ge=async()=>{var ne;if(!(!C||!Q)){k(!0);try{const he=await x3(C,Q.exposeId,R);(ne=he.say)!=null&&ne.length&&z(he.say,"assistant"),P(he.formExpose);const pe=await y3(C);await V(pe),Z({})}catch(he){S(he instanceof Error?he.message:String(he))}finally{k(!1)}}},be=j.useMemo(()=>(M==null?void 0:M.diagramHighlightNodeId)||(M==null?void 0:M.currentNodeId)||(M==null?void 0:M.selectedNodeId)||null,[M]);return A.jsxs("div",{className:"page-wide flow-page",children:[A.jsxs("div",{className:"flow-toolbar",children:[A.jsxs("div",{children:[A.jsx("strong",{children:"Flow Studio"}),A.jsxs("span",{className:"meta",style:{marginLeft:10},children:[M?`${M.workflowId||"flow"} · ${be||"—"}`:"Idle — start a call to drive the graph",v?" · unsaved edges":""]})]}),A.jsxs("div",{className:"toolbar",children:[A.jsx("button",{type:"button",onClick:()=>void fe(),disabled:!v,children:"Save edges"}),A.jsx("button",{type:"button",onClick:()=>void le(be,(M==null?void 0:M.activeModuleId)||null),children:"Reload"}),I?A.jsx("button",{type:"button",disabled:$,onClick:()=>void ee(),children:"Customer hung up"}):A.jsx("button",{type:"button",className:"btn primary",disabled:$,onClick:()=>void re(),children:"Place call"})]})]}),A.jsxs("div",{className:"flow-legend","aria-label":"Node kinds",children:[A.jsxs("span",{children:[A.jsx("i",{className:"swatch start-prep"}),"start"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch start"}),"greeting"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch normal"}),"node"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch terminal"}),"terminal"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch portal"}),"portal"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch portal-start"}),"portal enter"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch portal-exit"}),"portal exit"]}),A.jsxs("span",{children:[A.jsx("i",{className:"swatch current"}),"current"]})]}),(w||E)&&A.jsx("div",{className:w?"error":"meta",style:{padding:"6px 14px"},children:w||E}),A.jsxs("div",{className:`flow-body ${I?"":"is-idle"}`,children:[A.jsxs("aside",{className:"flow-side",children:[A.jsx("h3",{children:"Presets"}),A.jsxs("div",{className:"flow-side-body",children:[n?A.jsxs(A.Fragment,{children:[A.jsx("label",{className:"field",children:A.jsxs("span",{children:[A.jsx("input",{type:"checkbox",checked:r,onChange:ne=>u(ne.target.checked),disabled:I})," ",((me=n.afterHours)==null?void 0:me.label)||"After hours"]})}),(n.featureFlags||[]).map(ne=>A.jsxs("label",{className:"field",children:[A.jsxs("span",{children:[A.jsx("input",{type:"checkbox",checked:!!o[ne.id],disabled:I,onChange:he=>s(pe=>({...pe,[ne.id]:he.target.checked}))})," ",ne.label]}),A.jsx("span",{className:"meta",children:ne.description})]},ne.id))]}):A.jsx("p",{className:"meta",children:"Loading presets…"}),M?A.jsxs(A.Fragment,{children:[A.jsx("h3",{style:{marginTop:16},children:"Session"}),A.jsxs("dl",{className:"summary",children:[A.jsx("dt",{children:"Caller"}),A.jsxs("dd",{className:"mono",children:[ky().slice(0,8),"…"]}),A.jsx("dt",{children:"Node"}),A.jsx("dd",{className:"mono",children:M.currentNodeId||"—"}),A.jsx("dt",{children:"Status"}),A.jsx("dd",{children:M.status})]}),A.jsx("pre",{className:"json",style:{maxHeight:160},children:JSON.stringify(M.memory||{},null,2)})]}):null]})]}),A.jsx("div",{className:"flow-canvas-wrap",children:A.jsxs(OA,{nodes:c,edges:g,onNodesChange:h,onEdgesChange:ne=>{y(ne),b(!0)},onConnect:J,nodeTypes:cR,fitView:!0,proOptions:{hideAttribution:!0},children:[A.jsx(qA,{gap:18,color:"#243040"}),A.jsx(QA,{}),A.jsx(r3,{pannable:!0,zoomable:!0,nodeColor:fR,maskColor:"rgba(15,20,25,0.72)",bgColor:"#121820",style:{width:120,height:80}})]})}),I?A.jsxs("aside",{className:"flow-chat",children:[A.jsx("h3",{children:"Chat"}),A.jsx("div",{className:"chat-log",style:{flex:1,maxHeight:"none"},children:L.map((ne,he)=>A.jsx("div",{className:`chat-row ${ne.role}`,children:A.jsxs("div",{children:[A.jsx("div",{className:"role",children:ne.role}),A.jsx("div",{className:"bubble",children:ne.text})]})},he))}),A.jsxs("div",{className:"composer",children:[A.jsx("textarea",{rows:2,value:O,disabled:$||!!Q,placeholder:"Caller reply…",onChange:ne=>H(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),se())}}),A.jsx("div",{className:"composer-actions",children:A.jsx("button",{type:"button",className:"btn primary",disabled:$||!O.trim()||!!Q,onClick:()=>void se(),children:"Send"})})]})]}):null]}),Q?A.jsx("div",{className:"modal-backdrop",children:A.jsxs("div",{className:"modal",children:[A.jsx("h2",{children:"Form"}),Q.fields.map(ne=>A.jsxs("label",{className:"field",children:[ne.label,ne.type==="textarea"?A.jsx("textarea",{rows:3,value:R[ne.name]||"",onChange:he=>Z(pe=>({...pe,[ne.name]:he.target.value}))}):A.jsx("input",{type:ne.type==="email"?"email":ne.type==="tel"?"tel":"text",value:R[ne.name]||"",placeholder:ne.placeholder,required:ne.required,onChange:he=>Z(pe=>({...pe,[ne.name]:he.target.value}))})]},ne.name)),A.jsx("div",{className:"toolbar",children:A.jsx("button",{type:"button",className:"btn primary",disabled:$,onClick:()=>void ge(),children:"Submit"})})]})}):null]})}const yr=50;function hR(){const[n,l]=j.useState(0),[r,u]=j.useState(0),[o,s]=j.useState([]),[c,d]=j.useState("Loading…"),[h,g]=j.useState(""),p=j.useCallback(async()=>{d("Loading…"),g("");try{const b=await Xt(`/conversations/api?limit=${yr}&offset=${n}`);u(b.total||0),s(b.items||[]),d("")}catch(b){g(b instanceof Error?b.message:String(b)),d("")}},[n]);j.useEffect(()=>{p()},[p]);const y=r?n+1:0,v=Math.min(n+yr,r);return A.jsxs("div",{className:"page",children:[A.jsxs("div",{className:"page-head",children:[A.jsxs("div",{children:[A.jsx("h1",{children:"Conversations"}),A.jsx("div",{className:"meta",children:"Durable Postgres history"})]}),A.jsx("div",{className:"toolbar",children:A.jsx("button",{type:"button",onClick:()=>void p(),children:"Refresh"})})]}),A.jsx("div",{className:h?"error":"meta",style:{marginBottom:12,minHeight:"1.2em"},children:h||c}),A.jsxs("table",{className:"data",children:[A.jsx("thead",{children:A.jsxs("tr",{children:[A.jsx("th",{children:"When"}),A.jsx("th",{children:"Status"}),A.jsx("th",{children:"Channel"}),A.jsx("th",{children:"Caller"}),A.jsx("th",{children:"Node"}),A.jsx("th",{children:"Last user"}),A.jsx("th",{children:"Actions"})]})}),A.jsx("tbody",{children:o.length?o.map(b=>A.jsxs("tr",{children:[A.jsx("td",{className:"mono",children:To(b.createdAt)}),A.jsx("td",{children:A.jsx("span",{className:`badge ${b.status==="ACTIVE"?"active":"ended"}`,children:b.status})}),A.jsx("td",{children:A.jsx("span",{className:`badge ${b.channel}`,children:b.channel})}),A.jsx("td",{className:"mono",children:b.callerId||"—"}),A.jsx("td",{className:"mono",children:b.currentNodeId||"—"}),A.jsx("td",{className:"preview",title:b.chatPreview||void 0,children:b.chatPreview||"—"}),A.jsxs("td",{className:"toolbar",children:[A.jsx($o,{to:`/conversations/${b.conversationId}`,children:"Open"}),b.vapiCallUrl?A.jsx("a",{href:b.vapiCallUrl,target:"_blank",rel:"noopener noreferrer",children:"Vapi ↗"}):null]})]},b.conversationId)):A.jsx("tr",{children:A.jsx("td",{colSpan:7,className:"meta",children:c?"Loading…":"No conversations yet."})})})]}),A.jsxs("div",{className:"toolbar",style:{marginTop:16},children:[A.jsx("button",{type:"button",disabled:n<=0,onClick:()=>l(b=>Math.max(0,b-yr)),children:"Newer"}),A.jsx("span",{className:"meta",children:r?`${y}–${v} of ${r}`:"0 conversations"}),A.jsx("button",{type:"button",disabled:n+yr>=r,onClick:()=>l(b=>b+yr),children:"Older"})]})]})}function mR(){var h,g;const{id:n}=lw(),[l,r]=j.useState(null),[u,o]=j.useState(""),s=j.useCallback(async()=>{if(!n){o("Missing conversation id in URL.");return}o("");try{const p=await Xt(`/conversations/api/${encodeURIComponent(n)}`);r(p)}catch(p){r(null),o(p instanceof Error?p.message:String(p))}},[n]);j.useEffect(()=>{s()},[s]);const c=((h=l==null?void 0:l.history)==null?void 0:h.chat)||[],d=((g=l==null?void 0:l.history)==null?void 0:g.nodes)||[];return A.jsxs("div",{className:"page",children:[A.jsxs("div",{className:"page-head",children:[A.jsxs("div",{children:[A.jsx("h1",{children:l?`Conversation ${l.conversationId.slice(0,8)}…`:"Conversation"}),A.jsx("div",{className:"meta",children:l?`${l.liveInMemory?"LIVE in memory · ":""}${l.status} · ${l.channel}${l.currentNodeId?` · node ${l.currentNodeId}`:""}`:"Loading…"})]}),A.jsxs("div",{className:"toolbar",children:[A.jsx($o,{to:"/conversations",children:"← All conversations"}),l!=null&&l.vapiCallUrl?A.jsx("a",{className:"btn",href:l.vapiCallUrl,target:"_blank",rel:"noopener noreferrer",children:"Open in Vapi ↗"}):null,A.jsx("button",{type:"button",onClick:()=>void s(),children:"Refresh"})]})]}),u?A.jsx("div",{className:"error",children:u}):null,l?A.jsxs("div",{className:"detail-grid",children:[A.jsxs("section",{className:"panel",children:[A.jsx("h2",{children:"Chat history"}),A.jsx("div",{className:"chat-log",children:c.length?c.filter(p=>p.role==="user"||p.role==="assistant").map((p,y)=>A.jsx("div",{className:`chat-row ${p.role}`,children:A.jsxs("div",{children:[A.jsx("div",{className:"role",children:p.role}),A.jsx("div",{className:"bubble",children:p.text||""})]})},y)):A.jsx("p",{className:"meta",children:"No chat messages in snapshot."})})]}),A.jsxs("aside",{className:"side",children:[A.jsxs("section",{className:"panel",children:[A.jsx("h2",{children:"Summary"}),A.jsxs("dl",{className:"summary",children:[A.jsx("dt",{children:"ID"}),A.jsx("dd",{className:"mono",children:l.conversationId}),A.jsx("dt",{children:"Provider call"}),A.jsx("dd",{className:"mono",children:l.providerCallId}),A.jsx("dt",{children:"Caller"}),A.jsx("dd",{className:"mono",children:l.callerId||"—"}),A.jsx("dt",{children:"Created"}),A.jsx("dd",{className:"mono",children:To(l.createdAt)}),A.jsx("dt",{children:"Ended"}),A.jsx("dd",{className:"mono",children:To(l.endedAt)}),A.jsx("dt",{children:"Last activity"}),A.jsx("dd",{className:"mono",children:To(l.lastActivityAt)}),A.jsx("dt",{children:"Current node"}),A.jsx("dd",{className:"mono",children:l.currentNodeId||"—"}),A.jsx("dt",{children:"Module"}),A.jsx("dd",{className:"mono",children:l.activeModuleId||"—"}),A.jsx("dt",{children:"Brain"}),A.jsx("dd",{className:"mono",children:l.brainProfileId||"—"})]})]}),A.jsxs("section",{className:"panel",children:[A.jsx("h2",{children:"Node path"}),A.jsx("pre",{className:"json",children:d.length?d.map(p=>`${p.turnNumber} ${p.nodeId} ← ${p.intention||"?"} @ ${p.at}`).join(`
83
+ `):"(empty)"})]}),A.jsxs("section",{className:"panel",children:[A.jsx("h2",{children:"Memory"}),A.jsx("pre",{className:"json",children:JSON.stringify(l.memory||{},null,2)})]})]})]}):null]})}function gR(){return A.jsx(xw,{children:A.jsxs(tl,{element:A.jsx(e_,{}),children:[A.jsx(tl,{index:!0,element:A.jsx(T0,{to:"/flow",replace:!0})}),A.jsx(tl,{path:"flow",element:A.jsx(dR,{})}),A.jsx(tl,{path:"conversations",element:A.jsx(hR,{})}),A.jsx(tl,{path:"conversations/:id",element:A.jsx(mR,{})}),A.jsx(tl,{path:"*",element:A.jsx(T0,{to:"/flow",replace:!0})})]})})}pS.createRoot(document.getElementById("root")).render(A.jsx(j.StrictMode,{children:A.jsx(Xw,{children:A.jsx(gR,{})})}));
84
+ //# sourceMappingURL=index-BGd2OhLv.js.map