@jinn-network/client 0.1.8 → 0.1.9-canary.144d87d2

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 (397) hide show
  1. package/README.md +6 -0
  2. package/dist/adapters/mech/adapter.d.ts +21 -1
  3. package/dist/adapters/mech/adapter.js +77 -10
  4. package/dist/adapters/mech/adapter.js.map +1 -1
  5. package/dist/adapters/mech/contracts.js +62 -28
  6. package/dist/adapters/mech/contracts.js.map +1 -1
  7. package/dist/adapters/mech/safe-revert.d.ts +4 -0
  8. package/dist/adapters/mech/safe-revert.js +5 -1
  9. package/dist/adapters/mech/safe-revert.js.map +1 -1
  10. package/dist/adapters/mech/safe.js +5 -1
  11. package/dist/adapters/mech/safe.js.map +1 -1
  12. package/dist/adapters/mech/verdict-code.js +1 -1
  13. package/dist/adapters/mech/verdict-code.js.map +1 -1
  14. package/dist/api/bootstrap-endpoint.d.ts +1 -0
  15. package/dist/api/bootstrap-endpoint.js +1 -0
  16. package/dist/api/bootstrap-endpoint.js.map +1 -1
  17. package/dist/api/discovery-endpoint.d.ts +1 -0
  18. package/dist/api/discovery-endpoint.js +24 -0
  19. package/dist/api/discovery-endpoint.js.map +1 -1
  20. package/dist/api/fleet-build.d.ts +1 -7
  21. package/dist/api/fleet-build.js +0 -7
  22. package/dist/api/fleet-build.js.map +1 -1
  23. package/dist/api/gather-status.d.ts +8 -2
  24. package/dist/api/gather-status.js +29 -117
  25. package/dist/api/gather-status.js.map +1 -1
  26. package/dist/api/loop-completion-build.d.ts +79 -0
  27. package/dist/api/loop-completion-build.js +155 -0
  28. package/dist/api/loop-completion-build.js.map +1 -0
  29. package/dist/api/operator-artifacts-endpoint.js +1 -1
  30. package/dist/api/operator-artifacts-endpoint.js.map +1 -1
  31. package/dist/api/peers.js +2 -0
  32. package/dist/api/peers.js.map +1 -1
  33. package/dist/api/setup-endpoints.d.ts +32 -0
  34. package/dist/api/setup-endpoints.js +94 -24
  35. package/dist/api/setup-endpoints.js.map +1 -1
  36. package/dist/api/solvernets-endpoints.js +4 -1
  37. package/dist/api/solvernets-endpoints.js.map +1 -1
  38. package/dist/api/status-build.d.ts +43 -33
  39. package/dist/api/status-build.js +3 -26
  40. package/dist/api/status-build.js.map +1 -1
  41. package/dist/api/status-rollup-build.d.ts +0 -4
  42. package/dist/api/status-rollup-build.js +0 -4
  43. package/dist/api/status-rollup-build.js.map +1 -1
  44. package/dist/api/stop-hook.d.ts +1 -1
  45. package/dist/api/stop-hook.js +1 -1
  46. package/dist/api/stop-hook.js.map +1 -1
  47. package/dist/build-info.json +4 -4
  48. package/dist/build-meta.json +1 -1
  49. package/dist/cli/commands/codedigest-revert-check.js +6 -2
  50. package/dist/cli/commands/codedigest-revert-check.js.map +1 -1
  51. package/dist/cli/commands/doctor.d.ts +3 -0
  52. package/dist/cli/commands/doctor.js +37 -2
  53. package/dist/cli/commands/doctor.js.map +1 -1
  54. package/dist/cli/commands/eval.d.ts +87 -0
  55. package/dist/cli/commands/eval.js +481 -0
  56. package/dist/cli/commands/eval.js.map +1 -0
  57. package/dist/cli/commands/rewards.d.ts +2 -0
  58. package/dist/cli/commands/rewards.js +30 -3
  59. package/dist/cli/commands/rewards.js.map +1 -1
  60. package/dist/cli/commands/solver-nets.js +68 -0
  61. package/dist/cli/commands/solver-nets.js.map +1 -1
  62. package/dist/cli/commands/status.js +0 -1
  63. package/dist/cli/commands/status.js.map +1 -1
  64. package/dist/cli/index.js +2 -0
  65. package/dist/cli/index.js.map +1 -1
  66. package/dist/config.d.ts +102 -15
  67. package/dist/config.js +166 -19
  68. package/dist/config.js.map +1 -1
  69. package/dist/daemon/ai-units-gate.d.ts +6 -6
  70. package/dist/daemon/ai-units-gate.js +11 -10
  71. package/dist/daemon/ai-units-gate.js.map +1 -1
  72. package/dist/daemon/balance-topup-loop.js +3 -0
  73. package/dist/daemon/balance-topup-loop.js.map +1 -1
  74. package/dist/daemon/checkpoint-loop.js +2 -2
  75. package/dist/daemon/creator.d.ts +1 -0
  76. package/dist/daemon/creator.js +26 -14
  77. package/dist/daemon/creator.js.map +1 -1
  78. package/dist/daemon/daemon.d.ts +15 -0
  79. package/dist/daemon/daemon.js +78 -22
  80. package/dist/daemon/daemon.js.map +1 -1
  81. package/dist/daemon/eviction-loop.d.ts +7 -0
  82. package/dist/daemon/eviction-loop.js +19 -3
  83. package/dist/daemon/eviction-loop.js.map +1 -1
  84. package/dist/daemon/jinn-claim-loop.js +3 -0
  85. package/dist/daemon/jinn-claim-loop.js.map +1 -1
  86. package/dist/daemon/join-applier.d.ts +35 -0
  87. package/dist/daemon/join-applier.js +49 -0
  88. package/dist/daemon/join-applier.js.map +1 -0
  89. package/dist/daemon/loop-heartbeat.d.ts +34 -0
  90. package/dist/daemon/loop-heartbeat.js +39 -0
  91. package/dist/daemon/loop-heartbeat.js.map +1 -0
  92. package/dist/daemon/reward-claim-loop.js +4 -1
  93. package/dist/daemon/reward-claim-loop.js.map +1 -1
  94. package/dist/daemon/watchdog-loop.d.ts +84 -0
  95. package/dist/daemon/watchdog-loop.js +91 -0
  96. package/dist/daemon/watchdog-loop.js.map +1 -0
  97. package/dist/dashboard/assets/index-8tAiMbUV.css +1 -0
  98. package/dist/dashboard/assets/index-D6a-DfaM.js +171 -0
  99. package/dist/dashboard/index.html +2 -2
  100. package/dist/discovery/http.d.ts +17 -0
  101. package/dist/discovery/http.js +295 -25
  102. package/dist/discovery/http.js.map +1 -1
  103. package/dist/discovery/onchain.js +155 -1
  104. package/dist/discovery/onchain.js.map +1 -1
  105. package/dist/discovery/types.d.ts +106 -0
  106. package/dist/discovery/types.js +40 -0
  107. package/dist/discovery/types.js.map +1 -1
  108. package/dist/discovery/with-fallback.js +14 -0
  109. package/dist/discovery/with-fallback.js.map +1 -1
  110. package/dist/earning/bootstrap.d.ts +25 -0
  111. package/dist/earning/bootstrap.js +79 -28
  112. package/dist/earning/bootstrap.js.map +1 -1
  113. package/dist/earning/faucet.d.ts +1 -1
  114. package/dist/earning/faucet.js +2 -2
  115. package/dist/earning/faucet.js.map +1 -1
  116. package/dist/earning/safe-adapter.js +11 -0
  117. package/dist/earning/safe-adapter.js.map +1 -1
  118. package/dist/earning/stolas-claim.js +5 -5
  119. package/dist/earning/types.d.ts +1 -1
  120. package/dist/earning/types.js +1 -1
  121. package/dist/earning/types.js.map +1 -1
  122. package/dist/eval/eval-harness-run.d.ts +63 -0
  123. package/dist/eval/eval-harness-run.js +123 -0
  124. package/dist/eval/eval-harness-run.js.map +1 -0
  125. package/dist/eval/orchestrator.d.ts +224 -0
  126. package/dist/eval/orchestrator.js +250 -0
  127. package/dist/eval/orchestrator.js.map +1 -0
  128. package/dist/eval/paired.d.ts +68 -0
  129. package/dist/eval/paired.js +93 -0
  130. package/dist/eval/paired.js.map +1 -0
  131. package/dist/eval/resolve-slate-tasks.d.ts +35 -0
  132. package/dist/eval/resolve-slate-tasks.js +56 -0
  133. package/dist/eval/resolve-slate-tasks.js.map +1 -0
  134. package/dist/eval/screen-discovery.d.ts +22 -0
  135. package/dist/eval/screen-discovery.js +71 -0
  136. package/dist/eval/screen-discovery.js.map +1 -0
  137. package/dist/eval/screen-progress.d.ts +41 -0
  138. package/dist/eval/screen-progress.js +60 -0
  139. package/dist/eval/screen-progress.js.map +1 -0
  140. package/dist/eval/screen-runner.d.ts +30 -0
  141. package/dist/eval/screen-runner.js +289 -0
  142. package/dist/eval/screen-runner.js.map +1 -0
  143. package/dist/eval/screen.d.ts +107 -0
  144. package/dist/eval/screen.js +159 -0
  145. package/dist/eval/screen.js.map +1 -0
  146. package/dist/eval/slope.d.ts +29 -0
  147. package/dist/eval/slope.js +46 -0
  148. package/dist/eval/slope.js.map +1 -0
  149. package/dist/eval/train-sequence.d.ts +35 -0
  150. package/dist/eval/train-sequence.js +59 -0
  151. package/dist/eval/train-sequence.js.map +1 -0
  152. package/dist/eval/wilson.d.ts +45 -0
  153. package/dist/eval/wilson.js +48 -0
  154. package/dist/eval/wilson.js.map +1 -0
  155. package/dist/events/types.d.ts +1 -1
  156. package/dist/events/types.js +1 -1
  157. package/dist/events/types.js.map +1 -1
  158. package/dist/harnesses/engine/canonical-json.js +5 -3
  159. package/dist/harnesses/engine/canonical-json.js.map +1 -1
  160. package/dist/harnesses/engine/engine.d.ts +24 -0
  161. package/dist/harnesses/engine/engine.js +72 -9
  162. package/dist/harnesses/engine/engine.js.map +1 -1
  163. package/dist/harnesses/engine/packaging.js +1 -1
  164. package/dist/harnesses/engine/packaging.js.map +1 -1
  165. package/dist/harnesses/engine/persistence.d.ts +17 -0
  166. package/dist/harnesses/engine/persistence.js +28 -0
  167. package/dist/harnesses/engine/persistence.js.map +1 -1
  168. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
  169. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
  170. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
  171. package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
  172. package/dist/harnesses/impls/hermes-agent/adapter.js +8 -5
  173. package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
  174. package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +1 -0
  175. package/dist/harnesses/impls/hermes-agent/bootstrap.js +6 -1
  176. package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
  177. package/dist/harnesses/impls/hermes-agent/harness.d.ts +17 -3
  178. package/dist/harnesses/impls/hermes-agent/harness.js +68 -5
  179. package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
  180. package/dist/harnesses/impls/index.d.ts +2 -0
  181. package/dist/harnesses/impls/index.js +9 -0
  182. package/dist/harnesses/impls/index.js.map +1 -1
  183. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
  184. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
  185. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
  186. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
  187. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
  188. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
  189. package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +64 -0
  190. package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +125 -0
  191. package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
  192. package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
  193. package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
  194. package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
  195. package/dist/harnesses/impls/learner/adapters/claude-code.js +5 -0
  196. package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
  197. package/dist/harnesses/impls/learner/harness.d.ts +17 -1
  198. package/dist/harnesses/impls/learner/harness.js +51 -1
  199. package/dist/harnesses/impls/learner/harness.js.map +1 -1
  200. package/dist/harnesses/impls/learner/harvest.d.ts +2 -0
  201. package/dist/harnesses/impls/learner/harvest.js +51 -1
  202. package/dist/harnesses/impls/learner/harvest.js.map +1 -1
  203. package/dist/harnesses/impls/learner/plugin-path.js +1 -0
  204. package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
  205. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +3 -1
  206. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
  207. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +2 -2
  208. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +3 -1
  209. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
  210. package/dist/harnesses/readiness-registry.d.ts +10 -0
  211. package/dist/harnesses/readiness-registry.js +13 -0
  212. package/dist/harnesses/readiness-registry.js.map +1 -1
  213. package/dist/harnesses/types.d.ts +14 -0
  214. package/dist/learner/revert-decision.d.ts +16 -1
  215. package/dist/learner/revert-decision.js +38 -18
  216. package/dist/learner/revert-decision.js.map +1 -1
  217. package/dist/learner/revert-stats.d.ts +14 -0
  218. package/dist/learner/revert-stats.js +42 -0
  219. package/dist/learner/revert-stats.js.map +1 -1
  220. package/dist/local-provider-url.d.ts +3 -0
  221. package/dist/local-provider-url.js +28 -0
  222. package/dist/local-provider-url.js.map +1 -0
  223. package/dist/main.js +94 -25
  224. package/dist/main.js.map +1 -1
  225. package/dist/mcp/operator-server.js +1 -1
  226. package/dist/mcp/operator-server.js.map +1 -1
  227. package/dist/mcp/server.js +1 -1
  228. package/dist/mcp/server.js.map +1 -1
  229. package/dist/plugins/learner/.claude-plugin/plugin.json +1 -1
  230. package/dist/plugins/learner/.codex-plugin/plugin.json +1 -1
  231. package/dist/plugins/learner/hooks/session-start +30 -1
  232. package/dist/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
  233. package/dist/preflight/deployment-readiness.d.ts +147 -0
  234. package/dist/preflight/deployment-readiness.js +366 -0
  235. package/dist/preflight/deployment-readiness.js.map +1 -0
  236. package/dist/preflight/pidfile-liveness.d.ts +7 -1
  237. package/dist/preflight/pidfile-liveness.js +14 -0
  238. package/dist/preflight/pidfile-liveness.js.map +1 -1
  239. package/dist/rpc/transport.d.ts +43 -5
  240. package/dist/rpc/transport.js +131 -30
  241. package/dist/rpc/transport.js.map +1 -1
  242. package/dist/scripts/swe-rebench-v2-seed-pool.json +2 -1
  243. package/dist/solver-nets/registry.d.ts +19 -0
  244. package/dist/solver-nets/registry.js +95 -66
  245. package/dist/solver-nets/registry.js.map +1 -1
  246. package/dist/solver-types/_jinn-repo-pool.d.ts +27 -0
  247. package/dist/solver-types/_jinn-repo-pool.js +27 -0
  248. package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
  249. package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +76 -0
  250. package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +156 -0
  251. package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
  252. package/dist/solver-types/_swe-rebench-v2-pool-recovery.d.ts +81 -0
  253. package/dist/solver-types/_swe-rebench-v2-pool-recovery.js +116 -0
  254. package/dist/solver-types/_swe-rebench-v2-pool-recovery.js.map +1 -0
  255. package/dist/solver-types/_swe-rebench-v2-state.d.ts +9 -0
  256. package/dist/solver-types/_swe-rebench-v2-state.js +14 -0
  257. package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
  258. package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +30 -0
  259. package/dist/solver-types/_swe-rebench-v2-validated-pool.js +40 -0
  260. package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
  261. package/dist/solver-types/index.js +2 -0
  262. package/dist/solver-types/index.js.map +1 -1
  263. package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
  264. package/dist/solver-types/jinn-repo-admit.js +16 -0
  265. package/dist/solver-types/jinn-repo-admit.js.map +1 -0
  266. package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
  267. package/dist/solver-types/jinn-repo-auto.js +163 -0
  268. package/dist/solver-types/jinn-repo-auto.js.map +1 -0
  269. package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
  270. package/dist/solver-types/jinn-repo-definition.js +34 -0
  271. package/dist/solver-types/jinn-repo-definition.js.map +1 -0
  272. package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
  273. package/dist/solver-types/jinn-repo-extract.js +32 -0
  274. package/dist/solver-types/jinn-repo-extract.js.map +1 -0
  275. package/dist/solver-types/jinn-repo.d.ts +21 -0
  276. package/dist/solver-types/jinn-repo.js +23 -0
  277. package/dist/solver-types/jinn-repo.js.map +1 -0
  278. package/dist/solver-types/learner-loop-test.js +1 -1
  279. package/dist/solver-types/learner-loop-test.js.map +1 -1
  280. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
  281. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.json +19 -0
  282. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.screening-report.json +628 -0
  283. package/dist/solver-types/solver-type.d.ts +8 -0
  284. package/dist/solver-types/swe-rebench-v2.d.ts +2 -0
  285. package/dist/solver-types/swe-rebench-v2.js +115 -10
  286. package/dist/solver-types/swe-rebench-v2.js.map +1 -1
  287. package/dist/solvernets/launched-record-dispatcher.d.ts +5 -0
  288. package/dist/solvernets/launched-record-dispatcher.js +8 -1
  289. package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
  290. package/dist/solvernets/registry-client-erc8004.js +29 -37
  291. package/dist/solvernets/registry-client-erc8004.js.map +1 -1
  292. package/dist/solvernets/registry-client.d.ts +6 -0
  293. package/dist/solvernets/store.d.ts +1 -1
  294. package/dist/solvernets/store.js +8 -3
  295. package/dist/solvernets/store.js.map +1 -1
  296. package/dist/spend/ai-units-config.d.ts +10 -0
  297. package/dist/spend/ai-units-config.js +7 -1
  298. package/dist/spend/ai-units-config.js.map +1 -1
  299. package/dist/spend/ai-units.d.ts +51 -0
  300. package/dist/spend/ai-units.js +73 -0
  301. package/dist/spend/ai-units.js.map +1 -1
  302. package/dist/spend/record.js +12 -5
  303. package/dist/spend/record.js.map +1 -1
  304. package/dist/store/store.d.ts +91 -5
  305. package/dist/store/store.js +170 -7
  306. package/dist/store/store.js.map +1 -1
  307. package/dist/trajectory/harness-bundle-schema.d.ts +1 -1
  308. package/dist/trajectory/harness-bundle-schema.js +1 -1
  309. package/dist/trajectory/harness-bundle-schema.js.map +1 -1
  310. package/dist/trajectory/schema.d.ts +1 -1
  311. package/dist/trajectory/schema.js +1 -1
  312. package/dist/trajectory/schema.js.map +1 -1
  313. package/dist/trajectory/transcript-parsers/types.d.ts +1 -1
  314. package/dist/trajectory/transcript-parsers/types.js +1 -1
  315. package/dist/trajectory/transcript-parsers/types.js.map +1 -1
  316. package/dist/types/envelope.d.ts +1 -1
  317. package/dist/types/envelope.js +1 -1
  318. package/dist/types/envelope.js.map +1 -1
  319. package/dist/types/payloads/index.d.ts +1 -1
  320. package/dist/types/payloads/index.js +7 -1
  321. package/dist/types/payloads/index.js.map +1 -1
  322. package/dist/types/payloads/portfolio-v0.d.ts +1 -1
  323. package/dist/types/payloads/portfolio-v0.js +1 -1
  324. package/dist/types/payloads/portfolio-v0.js.map +1 -1
  325. package/dist/types/payloads/prediction-apy-v0.d.ts +1 -1
  326. package/dist/types/payloads/prediction-apy-v0.js +1 -1
  327. package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
  328. package/dist/types/payloads/prediction-v0.d.ts +1 -1
  329. package/dist/types/payloads/prediction-v0.js +1 -1
  330. package/dist/types/payloads/prediction-v0.js.map +1 -1
  331. package/dist/types/portfolio.d.ts +1 -1
  332. package/dist/types/portfolio.js +1 -1
  333. package/dist/types/portfolio.js.map +1 -1
  334. package/dist/types/prediction-apy.d.ts +1 -1
  335. package/dist/types/prediction-apy.js +1 -1
  336. package/dist/types/prediction-apy.js.map +1 -1
  337. package/dist/types/prediction.d.ts +1 -1
  338. package/dist/types/prediction.js +1 -1
  339. package/dist/types/prediction.js.map +1 -1
  340. package/dist/types/session-provenance.d.ts +1 -1
  341. package/dist/types/session-provenance.js +1 -1
  342. package/dist/types/session-provenance.js.map +1 -1
  343. package/dist/types/task-document.d.ts +1 -1
  344. package/dist/types/task-document.js +1 -1
  345. package/dist/types/task-document.js.map +1 -1
  346. package/dist/types/task.d.ts +1 -1
  347. package/dist/types/task.js +1 -1
  348. package/dist/types/task.js.map +1 -1
  349. package/dist/types/window.d.ts +1 -1
  350. package/dist/types/window.js +1 -1
  351. package/dist/types/window.js.map +1 -1
  352. package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
  353. package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
  354. package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
  355. package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
  356. package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +44 -0
  357. package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +25 -0
  358. package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
  359. package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
  360. package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +38 -0
  361. package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +22 -0
  362. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
  363. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
  364. package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
  365. package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
  366. package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +109 -2
  367. package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +26 -2
  368. package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
  369. package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
  370. package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
  371. package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
  372. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
  373. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -1
  374. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
  375. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
  376. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +2 -2
  377. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +1 -1
  378. package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +1 -1
  379. package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +1 -1
  380. package/dist/vendor/@jinn-network/sdk/package.json +9 -1
  381. package/docker-compose.yml +3 -2
  382. package/package.json +23 -20
  383. package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
  384. package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
  385. package/plugins/jinn-repo-runtime/README.md +27 -0
  386. package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
  387. package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
  388. package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
  389. package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
  390. package/plugins/learner/.claude-plugin/plugin.json +1 -1
  391. package/plugins/learner/.codex-plugin/plugin.json +1 -1
  392. package/plugins/learner/hooks/session-start +30 -1
  393. package/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
  394. package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
  395. package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
  396. package/dist/dashboard/assets/index-CzKxvMcU.css +0 -32
  397. package/dist/dashboard/assets/index-yVemxHot.js +0 -351
@@ -0,0 +1,171 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=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&&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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?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 h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function F(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function se(e,t){ae++,ie[ae]=e.current,e.current=t}var ce=oe(null),le=oe(null),ue=oe(null),de=oe(null);function fe(e,t){switch(se(ue,t),se(le,e),se(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(ce),se(ce,e)}function pe(){F(ce),F(le),F(ue)}function me(e){e.memoizedState!==null&&se(de,e);var t=ce.current,n=Jd(t,e.type);t!==n&&(se(le,e),se(ce,n))}function he(e){le.current===e&&(F(ce),F(le)),de.current===e&&(F(de),ip._currentValue=re)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(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 Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function I(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function L(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 Ye(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=P.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function at(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[st])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return Ce.call(Dt,e)?!0:Ce.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function R(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var z=!1;function on(e,t,n){if(z)return e(t,n);z=!0;try{return e(t)}finally{if(z=!1,(rn!==null||an!==null)&&(Cu(),rn&&(t=rn,e=an,an=rn=null,R(t),e)))for(t=0;t<e.length;t++)R(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function hn(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 gn(){return!0}function _n(){return!1}function vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?gn:_n,this.isPropagationStopped=_n,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),t}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bn=vn(yn),xn=h({},yn,{view:0,detail:0}),Sn=vn(xn),Cn,wn,Tn,En=h({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,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!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=vn(En),On=vn(h({},En,{dataTransfer:0})),kn=vn(h({},xn,{relatedTarget:0})),An=vn(h({},yn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=vn(h({},yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=vn(h({},yn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={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`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=vn(h({},xn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=vn(h({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=vn(h({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=vn(h({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=vn(h({},En,{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})),Un=vn(h({},yn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=cn&&`CompositionEvent`in window,Kn=null;cn&&`documentMode`in document&&(Kn=document.documentMode);var qn=cn&&`TextEvent`in window&&!Kn,Jn=cn&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!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 Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=jd(t,`onChange`),0<t.length&&(n=new bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){Cd(e,0)}function cr(e){if(It(vt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(cn){var dr;if(cn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,nn(e)),on(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ce.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Dr(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 Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Lt(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=jd(Ar,`onSelect`),0<r.length&&(t=new bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};cn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),Ct(t,[e])}var Yr=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&&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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function B(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=si(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return di(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function di(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function fi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function pi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function mi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hi=new WeakMap;function gi(e,t){if(typeof e==`object`&&e){var n=hi.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},hi.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var _i=[],V=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){_i[V++]=yi,_i[V++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Be(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=_i[--V],_i[V]=null,yi=_i[--V],_i[V]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function H(e){throw zi(gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||H(e,!0)}function U(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function W(e){if(e!==Ai)return!1;if(!Mi)return U(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&ji&&H(e),U(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=gf(e)}else t===27?(t=ji,rf(e.type)?(e=hf,hf=null,ji=e):ji=t):ji=Ai?mf(e.stateNode.nextSibling):null;return!0}function Li(){ji=Ai=null,Mi=!1}function Ri(){var e=Ni;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Ni=null),e}function zi(e){Ni===null?Ni=[e]:Ni.push(e)}var Bi=oe(null),Vi=null,Hi=null;function Ui(e,t,n){se(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,F(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=hd(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(G,G),t}function G(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=N.S;N.S=function(e,t){ru=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),da!==null&&da(e,t)};var fa=oe(null);function pa(){var e=fa.current;return e===null?Rl.pooledCache:e}function ma(e,t){t===null?se(fa,fa.current):se(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:na._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=fi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=B(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=mi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=di(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=B(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=mi(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(ne(t)||A(t))return t=di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(ne(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(ne(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Mi&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Mi&&Ti(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Mi&&Ti(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=B(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=mi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=ca;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Bl&f)===f:(r&f)===f){f!==0&&f===sa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=oe(null),qa=oe(0);function Ja(e,t){e=Kl,se(qa,e),se(Ka,t),Kl=e|t.baseLanes}function Ya(){se(qa,Kl),se(Ka,Ka.current)}function Xa(){Kl=qa.current,F(Ka),F(qa)}var Za=oe(null),Qa=null;function $a(e){var t=e.alternate;se(K,K.current&1),se(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){se(K,K.current),se(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(se(K,K.current),se(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){se(K,K.current),se(Za,Za.current)}function ro(e){F(Za),Qa===e&&(Qa=null),F(K)}var K=oe(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))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)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 ao=0,oo=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return ao=a,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){N.H=Ps;var t=so!==null&&so.next!==null;if(ao=0,co=so=oo=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Ji(e)&&($s=!0))}function xo(e,t,n,r){oo=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ls,o=t(n,r)}while(uo);return o}function So(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(oo.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}ao=0,co=so=oo=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?oo.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=oo.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?oo.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw oo.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?oo.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=oo,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fs:Is),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=oo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=oo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),oo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((ao&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,oo.lanes|=p,Jl|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,oo.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&($s=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=oo,a=Do(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||ao&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=oo.updateQueue,t===null?(t=Oo(),oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Vo(e){var t=ni(e,2);t!==null&&vu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Mi){var n=Rl.formState;if(n!==null){a:{var r=oo;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=mf(i.nextSibling),r=i.data===`F!`;break a}}H(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=Os.bind(null,oo,r),r.dispatch=n,r=Ho(!1),a=As.bind(null,oo,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,oo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return q(Do(),so,e)}function q(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(oo.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Do(),n=so;if(n!==null)return q(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=oo.updateQueue,t===null&&(t=Oo(),oo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Do().memoizedState}function rs(e,t,n,r){var i=Eo();oo.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(oo.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){oo.flags|=4;var t=oo.updateQueue;if(t===null)t=Oo(),oo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Do().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||ao&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),oo.lanes|=e,Jl|=e,n)}function _s(e,t,n,r){return xr(n,t)?n:Ka.current===null?!(ao&42)||ao&1073741824&&!(Bl&261930)?($s=!0,e.memoizedState=n):(e=_u(),oo.lanes|=e,Jl|=e,t):(e=gs(e,n,r),xr(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,As(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ua(c,r),gu(e)):ks(e,t,r,gu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,re,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},gu())}function Cs(){return Xi(ip)}function ws(){return Do().memoizedState}function Ts(){return Do().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=La(n);var r=Ra(t,e,n);r!==null&&(vu(r,t,n),za(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=ti(e,t,n,r),n!==null&&(vu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,gu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Rl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return vu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&vu(t,e,2)}function js(e){var t=e.alternate;return e===oo||t!==null&&t===oo}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Ps={readContext:Xi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Ps.useEffectEvent=_o;var Fs={readContext:Xi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=Os.bind(null,oo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=vs.bind(null,oo,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oo,a=Eo();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(zo.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Rl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,oo,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Es.bind(null,oo)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:No,useRef:ns,useState:function(){return No(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Fo,useRef:ns,useState:function(){return Fo(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Do();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(vu(t,e,n),za(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Yr(e)}function Ws(e){console.error(e)}function Gs(e){Yr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Mi)return t=Za.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),zi(gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=gi(r,n),a=Js(e.stateNode,r,a),Ba(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),zi(gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=gi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=B(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=ji)?(e=uf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw H(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if($s||qi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),vu(r,e,s),Qs;Au(),t=cc(e,t,n)}else e=o.treeContext,ji=mf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=sc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Yi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!$s?(wo(e,t,a),Tc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Li(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(K.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Mi){if(a?$a(t):no(t),(e=ji)?(e=uf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw H(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=di(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=di(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||qi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),vu(s,e,r),Qs;df(c)||Au(),t=xc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=mf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=di(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ha():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=K.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,se(K,o),ec(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:me(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),se(K,K.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ha(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}else if(r!==a){a=gi(Error(i(424)),t),zi(a),t=mc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=mf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Kd(ue.current).createElement(n),r[st]=t,r[ct]=e,Bd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Mi&&(r=t.stateNode=vf(t.type,t.pendingProps,ue.current),Ai=t,Pi=!0,a=ji,rf(t.type)?(hf=a,ji=mf(r.firstChild)):ji=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=cf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=mf(r.firstChild),Pi=!1,a=!0)),a||H(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ip._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=lf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||H(t)),null;case 13:return vc(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=pa(),a===null&&(a=Rl,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Ui(t,na,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(Du())e.flags|=8192;else throw Ca=ya,_a}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!Mi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(W(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(he(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ce.current,W(t)?Ii(t,e):(e=vf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ce.current,W(t))Ii(t,o);else{var s=Kd(ue.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,W(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||H(t,!0)}else e=Kd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=W(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=W(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return pe(),e===null&&Dd(t.stateNode.containerInfo),Pc(t),null;case 10:return Wi(t.type),Pc(t),null;case 19:if(F(K),r=t.memoizedState,r===null)return Pc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return se(K,K.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}else{if(!a)if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return Pc(t),null}else 2*Oe()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=K.current,se(K,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(K),null;case 4:return pe(),null;case 10:return Wi(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&F(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Lc(e,t){switch(Oi(t),t.tag){case 3:Wi(na),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:F(K);break;case 10:Wi(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&F(fa);break;case 24:Wi(na)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[ct]=t}catch(t){Ju(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[st]=e,t[ct]=n}catch(t){Ju(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Wd=pp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},pp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;rf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),yf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:al!==null&&(ol?(e=al,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):af(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Ju(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Ju(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Kf=null,a=ml,ml=Sf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Ju(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=Sf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:yf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Zf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=Sf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:N.T===null?it():hd()}function _u(){if(Zl===0)if(!(Bl&536870912)||Mi){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),Zl=e}else Zl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Ze(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||I(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-Oe(),10<a)){if(Su(r,t,Zl,!Ul),Je(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Qd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},kl(t,a,d);var m=(a&62914560)===a?nu-Oe():(a&4194048)===a?ru-Oe():0;if(m=$f(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function Cu(){return Ll&6?!0:(cd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Hi=Vi=null,To(e),Ea=null,Da=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=li(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=I(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,$r(),n}function Eu(e,t){oo=null,N.H=Ps,t===ga||t===va?(t=wa(),Vl=3):t===_a?(t=wa(),Vl=4):Vl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,Ks(e,gi(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=N.H;return N.H=Ps,e===null?Ps:e}function ku(){var e=N.A;return N.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,Ll=r,N.H=i,N.A=a,zl===null&&(Rl=null,Bl=0,$r()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=Oe()+500,Tu(e,t)):Wl=I(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(ba(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:ba(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Xf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Hi=Vi=null,N.H=r,N.A=a,Ll=n,zl===null?(Rl=null,Bl=0,$r(),ql):0}function Pu(){for(;zl!==null&&!Ee();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:To(t);default:Lc(n,t),t=zl=ui(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Hi=Vi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,Bl)){ql=1,Ks(e,gi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,Ks(e,gi(n,e.current)),zl=null;return}t.flags&32768?(Mi||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,Qe(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Me,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,P.p=a,N.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Gd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!Wd,Gd=Wd=null}finally{Ll=i,P.p=r,N.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,P.p=r,N.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,De();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),rt(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=rt(uu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,cd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{P.p=a,N.T=r,Wu(e,t)}}function qu(e,t,n){t=gi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ze(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=gi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Ze(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>Oe()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Ye()),e=ni(e,t),e!==null&&(Ze(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return we(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Je(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||I(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=Oe(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=L(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||I(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),rt(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=fd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Je(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){tf(function(){Ll&6?we(Ae,ld):ud()})}function hd(){if(od===0){var e=sa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<qr.length;yd++){var bd=qr[yd];Jr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,xt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=gt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}on(function(){var r=a,i=nn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=bn,u=e;switch(e){case`keypress`:if(hn(n)===0)break a;case`keydown`:case`keyup`:l=Rn;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Bn;break;case zr:case Br:case Vr:l=An;break;case Gr:l=Vn;break;case`scroll`:case`scrollend`:l=Sn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=zn;break;case`toggle`:case`beforetoggle`:l=Un}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=yr;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,$n=!0)),y=jd(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=sn(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
9
+ `).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Gt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(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 Jd(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 Yd(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 Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);zp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(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 hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=P.d;P.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=Cu();return e||t}function Tf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=yt(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);bt(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=yt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=h({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),bt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=yt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),bt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=ue.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+zt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),bt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+zt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Bd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,bt(a),a):(r=n,(a=bf.get(o))&&(r=h({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[st]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===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 Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function sp(e){return e?(e=ai,e):ai}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(vu(n,e,t),za(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&vu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=gu();t=nt(t);var n=ni(e,t);n!==null&&vu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,gp(e,t,n,r)}finally{P.p=a,N.T=i}}function hp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,gp(e,t,n,r)}finally{P.p=a,N.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)kd(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Ll&6)&&(iu=Oe()+500,cd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&vu(s,a,2),Cu(),up(a,2)}if(a=_p(r),a===null&&kd(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function _p(e){return e=nn(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(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(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`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 kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=_t(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,at(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ct]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,gu(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Cu(),t[lt]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.7`)throw Error(i(527,Up,`19.2.7`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Wp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{Le=Gp.inject(Wp),Re=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[lt]=t.current,Dd(e),new Vp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},v=new class extends _{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b=new class{#e=y;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function x(e){setTimeout(e,0)}var S=typeof window>`u`||`Deno`in globalThis;function C(){}function w(e,t){return typeof e==`function`?e(t):e}function T(e){return typeof e==`number`&&e>=0&&e!==1/0}function E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function ee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==k(o,t.options))return!1}else if(!j(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function te(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!j(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function k(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function j(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>j(e[n],t[n])):!1}var M=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=P(e)&&P(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:M.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function N(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function P(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{b.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function F(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t){return typeof e==`function`?e(...t):!!e}function de(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fe=(()=>{let e=()=>S;return{isServer(){return e()},setIsServer(t){e=t}}})();function pe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var me=x;function he(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=me,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ge=he(),_e=new class extends _{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)===`online`?_e.isOnline():!0}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=pe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new be(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>v.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),u=()=>ye(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(fe.isServer()?0:3),o=e.retryDelay??ve,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{de(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?se:F;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ee(e,t){return t?we(e,t)!=null:!1}function De(e,t){return!t||!e.getPreviousPageParam?!1:Te(e,t)!=null}var Oe=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=je(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=je(this.options);e.data!==void 0&&(this.setState(Ae(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(C).catch(C):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>D(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!E(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ke(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ge.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function je(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Me=class extends _{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=pe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof O(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!N(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ie(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Re(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(C)),t}#g(){this.#b();let e=D(this.options.staleTime,this.#t);if(fe.isServer()||this.#r.isStale||!T(e))return;let t=E(this.#r.dataUpdatedAt,e)+1;this.#d=b.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(fe.isServer()||O(this.options.enabled,this.#t)===!1||!T(this.#p)||this.#p===0)&&(this.#f=b.setInterval(()=>{(this.options.refetchIntervalInBackground||v.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(b.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(b.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Pe(e,t),o=i&&Ie(e,n,t,r);(a||o)&&(l={...l,...ke(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Le(e,t),refetch:this.refetch,promise:this.#o,isEnabled:O(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=pe())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!N(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ge.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ne(e,t){return O(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&O(t.retryOnMount,e)===!1)}function Pe(e,t){return Ne(e,t)||e.state.data!==void 0&&Fe(e,t,t.refetchOnMount)}function Fe(e,t,n){if(O(t.enabled,e)!==!1&&D(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Le(e,t)}return!1}function Ie(e,t,n,r){return(e!==t||O(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Le(e,n)}function Le(e,t){return O(t.enabled,e)!==!1&&e.isStaleByTime(D(t.staleTime,e))}function Re(e,t){return!N(e.getCurrentResult(),t)}var ze=class extends Me{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ee(t,n.data),hasPreviousPage:De(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Be=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ve(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ge.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ve(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var He=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Be({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ue(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ue(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ue(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ue(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ge.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>te(t,e))}findAll(e={}){return this.getAll().filter(t=>te(e,t))}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ge.batch(()=>Promise.all(e.map(e=>e.continue().catch(C))))}};function Ue(e){return e.options.scope?.id}var We=class extends _{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),N(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ve();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ge.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ge=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??k(r,t),a=this.get(i);return a||(a=new Oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ge.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ee(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ee(e,t)):t}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ge.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ge.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ke=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ge,this.#t=e.mutationCache||new He,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=_e.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(D(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ge.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ge.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ge.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ge.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(C).catch(C)}invalidateQueries(e,t={}){return ge.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ge.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(C)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(C)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(D(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(C).catch(C)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(C).catch(C)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return _e.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{j(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{j(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=k(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ce&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Je=o(((e,t)=>{t.exports=qe()})),I=c(u(),1),L=Je(),Ye=I.createContext(void 0),Xe=e=>{let t=I.useContext(Ye);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ze=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Ye.Provider,{value:e,children:t})),Qe=I.createContext(!1),$e=()=>I.useContext(Qe);Qe.Provider;function et(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tt=I.createContext(et()),nt=()=>I.useContext(tt),rt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ue(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},it=e=>{I.useEffect(()=>{e.clearReset()},[e])},at=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ue(n,[e.error,r])),ot=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},st=(e,t)=>e.isLoading&&e.isFetching&&!t,ct=(e,t)=>e?.suspense&&t.isPending,lt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ut(e,t,n){let r=$e(),i=nt(),a=Xe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ot(o),rt(o,i,s),it(i);let l=!a.getQueryCache().get(o.queryHash),[u]=I.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(I.useSyncExternalStore(I.useCallback(e=>{let t=f?u.subscribe(ge.batchCalls(e)):C;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),I.useEffect(()=>{u.setOptions(o)},[o,u]),ct(o,d))throw lt(o,u,i);if(at({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!fe.isServer()&&st(d,r)&&(l?lt(o,u,i):s?.promise)?.catch(C).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function dt(e,t){return ut(e,Me,t)}function ft(e,t){let n=Xe(t),[r]=I.useState(()=>new We(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);let i=I.useSyncExternalStore(I.useCallback(e=>r.subscribe(ge.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=I.useCallback((e,t)=>{r.mutate(e,t).catch(C)},[r]);if(i.error&&ue(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function pt(e,t){return ut(e,ze,t)}var mt=c(g(),1);function ht(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var gt=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),_t=o(((e,t)=>{t.exports=gt()}))(),vt=I.useInsertionEffect,yt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect,bt=vt||yt,xt=e=>{let t=I.useRef([e,(...e)=>t[0](...e)]).current;return bt(()=>{t[0]=e}),t[1]},St=`popstate`,Ct=`pushState`,wt=`replaceState`,Tt=[St,Ct,wt,`hashchange`],Et=e=>{for(let t of Tt)addEventListener(t,e);return()=>{for(let t of Tt)removeEventListener(t,e)}},Dt=(e,t)=>(0,_t.useSyncExternalStore)(Et,e,t),Ot=()=>location.search,kt=({ssrSearch:e}={})=>Dt(Ot,e==null?Ot:()=>e),At=()=>location.pathname,jt=({ssrPath:e}={})=>Dt(At,e==null?At:()=>e),Mt=(e,{replace:t=!1,state:n=null}={})=>history[t?wt:Ct](n,``,e),Nt=(e={})=>[jt(e),Mt],Pt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Pt]===void 0){for(let e of[Ct,wt]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Pt,{value:!0})}var Ft=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,It=(e=``)=>e===`/`?``:e,Lt=(e,t)=>e[0]===`~`?e.slice(1):It(t)+e,Rt=(e=``,t)=>Ft(zt(It(e)),zt(t)),zt=e=>{try{return decodeURI(e)}catch{return e}},Bt={hook:Nt,searchHook:kt,parser:ht,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Vt=(0,I.createContext)(Bt),Ht=()=>(0,I.useContext)(Vt),Ut={},Wt=(0,I.createContext)(Ut),Gt=()=>(0,I.useContext)(Wt),Kt=e=>{let[t,n]=e.hook(e);return[Rt(e.base,t),xt((t,r)=>e.aroundNav(n,Lt(t,e.base),r))]},qt=()=>Kt(Ht()),Jt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Yt=e=>Jt(Ht().parser,e,qt()[0]),Xt=({children:e,...t})=>{let n=Ht(),r=t.hook?Bt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,I.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,I.createElement)(Vt.Provider,{value:i,children:e})},Zt=({children:e,component:t},n)=>t?(0,I.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Qt=e=>{let t=(0,I.useRef)(Ut),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},$t=({path:e,nest:t,match:n,...r})=>{let i=Ht(),[a]=Kt(i),[o,s,c]=n??Jt(i.parser,e,a,t),l=Qt({...Gt(),...s});if(!o)return null;let u=c?(0,I.createElement)(Xt,{base:c},Zt(r,l)):Zt(r,l);return(0,I.createElement)(Wt.Provider,{value:l,children:u})},en=(0,I.forwardRef)((e,t)=>{let n=Ht(),[r,i]=Kt(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=xt(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,I.isValidElement)(l)?(0,I.cloneElement)(l,{onClick:h,href:g}):(0,I.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})}),tn=e=>Array.isArray(e)?e.flatMap(e=>tn(e&&e.type===I.Fragment?e.props.children:e)):[e],nn=({children:e,location:t})=>{let n=Ht(),[r]=Kt(n);for(let i of tn(e)){let e=0;if((0,I.isValidElement)(i)&&(e=Jt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,I.cloneElement)(i,{match:e})}return null},rn=e=>{let{to:t,href:n=t}=e,r=Ht(),[,i]=Kt(r),a=xt(()=>i(t||n,e)),{ssrContext:o}=r;return yt(()=>{a()},[]),o&&(o.redirectTo=t),null};async function an(e){if(!(e.headers.get(`content-type`)??``).includes(`application/json`))return null;try{let t=await e.json();if(typeof t!=`object`||!t)return null;let n=t;return{error:typeof n.error==`string`?n.error:void 0,message:typeof n.message==`string`?n.message:void 0}}catch{return null}}async function R(e,t){let n=await fetch(e,{credentials:`same-origin`,headers:{Accept:`application/json`,...t?.headers??{}},...t});if(!n.ok){let t=await an(n),r=t?.message??t?.error,i=Error(r?`${n.status} ${n.statusText}: ${r} on ${e}`:`${n.status} ${n.statusText} on ${e}`);throw i.status=n.status,i.code=t?.error,i}return n.json()}var z={getStatus:()=>R(`/v1/status`),getBootstrap:()=>R(`/v1/bootstrap`),getRecentEvents:(e,t=100)=>{let n=new URLSearchParams;return e&&e.length>0&&n.set(`kinds`,e.join(`,`)),n.set(`limit`,String(t)),R(`/v1/events/recent?${n.toString()}`)},getActivityEvents:e=>{let t=new URLSearchParams;e?.kinds&&e.kinds.length>0&&t.set(`kinds`,e.kinds.join(`,`)),e?.outcome&&t.set(`outcome`,e.outcome),e?.requestId&&t.set(`requestId`,e.requestId),e?.beforeId!==void 0&&t.set(`beforeId`,String(e.beforeId)),e?.limit!==void 0&&t.set(`limit`,String(e.limit));let n=t.toString();return R(`/v1/activity-events${n?`?${n}`:``}`)},getActivityEvent:e=>R(`/v1/activity-events/${encodeURIComponent(String(e))}`),getClaudeAuth:()=>R(`/v1/auth/claude`),installClaudeCode:()=>R(`/v1/setup/claude/install`,{method:`POST`}),signInClaude:()=>R(`/v1/auth/claude/spawn`,{method:`POST`}),triggerDrip:e=>R(e?.singleDrip?`/v1/setup/drip?singleDrip=true`:`/v1/setup/drip`,{method:`POST`}),changeKeystorePassword:(e,t)=>R(`/v1/setup/change-password`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({current:e,next:t})}),restartDaemon:e=>R(`/api/admin/restart`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e??{})}),stopDaemon:()=>R(`/api/admin/stop`,{method:`POST`}),getSolverNets:()=>R(`/v1/solvernets`),updateSolverNet:(e,t)=>R(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),updateNetwork:e=>R(`/v1/setup/network`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),retryAgentBinding:e=>R(`/v1/setup/agent-binding/retry`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e??{})}),retryBootstrap:()=>R(`/v1/setup/bootstrap/retry`,{method:`POST`}),updateHarnessMode:e=>R(`/v1/setup/harness`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:e})}),hermesDoctor:()=>R(`/api/hermes/doctor`),codexDoctor:()=>R(`/api/codex/doctor`),harnessReadiness:e=>R(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>R(`/v1/launcher/status`),fetchLauncherTasks:(e={})=>{let t=new URLSearchParams;e.cursor&&t.set(`cursor`,e.cursor),e.limit!==void 0&&t.set(`limit`,String(e.limit));let n=t.toString();return R(`/v1/launcher/tasks${n?`?${n}`:``}`)},patchLauncherSolverNet:(e,t)=>R(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>R(`/v1/solvernets/drafts`),getDraft:e=>R(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>R(`/v1/solvernets/drafts`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>R(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),deleteDraft:e=>R(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:`DELETE`}),launch:e=>R(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:`POST`}),transitionLifecycle:(e,t)=>R(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>R(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),get:e=>R(`/v1/solvernets/launched/${encodeURIComponent(e)}`),listLaunched:e=>{let t=new URLSearchParams;e?.status&&t.set(`status`,e.status);let n=t.toString();return R(`/v1/solvernets/launched${n?`?${n}`:``}`)},listRegistry:e=>{let t=new URLSearchParams;e?.status&&t.set(`status`,e.status),e?.refresh&&t.set(`refresh`,`1`);let n=t.toString();return R(`/v1/solvernets/registry${n?`?${n}`:``}`)},getManifest:e=>R(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{let t=new URLSearchParams;e.source&&t.set(`source`,e.source),e.artifactType&&t.set(`artifactType`,e.artifactType),e.limit!==void 0&&t.set(`limit`,String(e.limit));let n=t.toString();return R(`/v1/operator/execution-data${n?`?${n}`:``}`)},updatePricing:e=>R(`/v1/operator/pricing`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),join:(e,t)=>R(`/v1/operator/join/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),leave:e=>R(`/v1/operator/join/${encodeURIComponent(e)}`,{method:`DELETE`}),listJoined:()=>R(`/v1/operator/joined`),completeOnboarding:()=>R(`/v1/operator/onboarding-complete`,{method:`POST`})},captures:{listPending:()=>R(`/api/captures/pending`),get:e=>R(`/api/captures/${encodeURIComponent(e)}`),approve:e=>R(`/api/captures/${encodeURIComponent(e)}/approve`,{method:`POST`}),skip:e=>R(`/api/captures/${encodeURIComponent(e)}/skip`,{method:`POST`}),trustRepo:(e,t)=>R(`/api/captures/trust-repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},debugReport:{manifest:()=>R(`/v1/debug-report/manifest`),download:async e=>{let t=await fetch(`/v1/debug-report`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify(e?{screenshotPngBase64:e}:{})});if(!t.ok)throw Error(`debug report failed: ${t.status} ${t.statusText}`);return t.blob()}},discovery:{listPluginPublications:e=>{let t=new URLSearchParams;e?.solverType&&t.set(`solverType`,e.solverType),e?.builderAgentId&&t.set(`builderAgentId`,e.builderAgentId),e?.includeRevoked!==void 0&&t.set(`includeRevoked`,String(e.includeRevoked));let n=t.toString();return R(`/v1/discovery/plugin-publications${n?`?${n}`:``}`)},listBuilderArtifacts:(e,t)=>{let n=new URLSearchParams({builderAgentId:e});return t!==void 0&&n.set(`limit`,String(t)),R(`/v1/discovery/builder-artifacts?${n.toString()}`)},getPluginScores:(e,t)=>{let n=new URLSearchParams({cid:e});return t!==void 0&&n.set(`limit`,String(t)),R(`/v1/discovery/plugin-scores?${n.toString()}`)},getSolverNetOperatorCount:e=>R(`/v1/discovery/solvernet-operator-count?${new URLSearchParams({cid:e}).toString()}`),getTaskPostCounts:e=>{let t=new URLSearchParams;(e??[]).forEach(e=>t.append(`cid`,e));let n=t.toString();return R(`/v1/discovery/task-post-counts${n?`?${n}`:``}`)}}};async function on(){let e=new URL(window.location.href),t=e.searchParams.get(`k`);if(t){try{await fetch(`/auth/handshake?k=${encodeURIComponent(t)}`,{credentials:`same-origin`})}catch{}e.searchParams.delete(`k`),window.history.replaceState({},``,e.toString())}}async function sn(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=await fetch(e,{credentials:`same-origin`,headers:{Accept:`application/json`},cache:`no-store`,signal:n.signal});return t.status===502||t.status===503||t.status===504?{ok:!1,error:`daemon unavailable (HTTP ${t.status})`}:{ok:!0,error:null}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}finally{clearTimeout(r)}}function cn(e={}){let{pollIntervalMs:t=2e3,failureThreshold:n=2,maxBackoffMs:r=3e4,probeTimeoutMs:i=3500,probeUrl:a=`/v1/status`}=e,[o,s]=(0,I.useState)({status:`connected`,lastConnectedAt:Date.now()}),c=(0,I.useRef)(0),l=(0,I.useRef)(t),u=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{u.current=!1;let e=null,o=t=>{u.current||(e=setTimeout(d,t))},d=async()=>{let e=await sn(a,i);if(!u.current){if(e.ok){c.current=0,l.current=t,s(e=>e.status===`connected`?e:{status:`connected`,lastConnectedAt:Date.now()}),o(t);return}c.current+=1,c.current>=n?(s(t=>t.status===`disconnected`?{...t,attempts:t.attempts+1,lastError:e.error}:{status:`disconnected`,since:Date.now(),lastError:e.error,attempts:1}),l.current=Math.min(Math.max(l.current*2,t*2),r),o(l.current)):o(t)}};return d(),()=>{u.current=!0,e!==null&&clearTimeout(e)}},[t,n,r,i,a]),o}var ln=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),un=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),dn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),fn=e=>{let t=dn(e);return t.charAt(0).toUpperCase()+t.slice(1)},pn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},mn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},hn=(0,I.createContext)({}),gn=()=>(0,I.useContext)(hn),_n=(0,I.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=gn()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,I.createElement)(`svg`,{ref:c,...pn,width:t??l??pn.width,height:t??l??pn.height,stroke:e??f,strokeWidth:m,className:ln(`lucide`,p,i),...!a&&!mn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),vn=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(_n,{ref:i,iconNode:t,className:ln(`lucide-${un(fn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=fn(e),n},yn=vn(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),bn=vn(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),xn=vn(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Sn=vn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Cn=vn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),wn=vn(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Tn=vn(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),En=vn(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Dn=vn(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),On=vn(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),kn=vn(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),An=vn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),jn=vn(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Mn=vn(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Nn=vn(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Pn=vn(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Fn=vn(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),In=vn(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ln=vn(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Rn=vn(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),zn=vn(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Bn=vn(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Vn=vn(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Hn=vn(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Un=vn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Wn(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{let t=e&&e.length>0?`?kinds=${e.join(`,`)}`:``,r=new EventSource(`/v1/events${t}`,{withCredentials:!0});return r.onopen=()=>i(!0),r.onerror=()=>i(!1),r.onmessage=e=>{try{let t=JSON.parse(e.data);n(e=>[...e.slice(-499),t])}catch{}},()=>{r.close()}},[e?.join(`,`)]),{events:t,connected:r}}function Gn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Kn(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Gn(e[t],null)}}}}function qn(...e){return I.useCallback(Kn(...e),e)}var Jn=Symbol.for(`react.lazy`),Yn=I.use;function Xn(e){return typeof e==`object`&&!!e&&`then`in e}function Zn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Jn&&`_payload`in e&&Xn(e._payload)}function Qn(e){let t=er(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e;Zn(r)&&typeof Yn==`function`&&(r=Yn(r._payload));let a=I.Children.toArray(r),o=a.find(nr);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var $n=Qn(`Slot`);function er(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(Zn(n)&&typeof Yn==`function`&&(n=Yn(n._payload)),I.isValidElement(n)){let e=ir(n),i=rr(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tr=Symbol(`radix.slottable`);function nr(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===tr}function rr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ir(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ar(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ar(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function or(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ar(e))&&(r&&(r+=` `),r+=t);return r}var sr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,cr=or,lr=(e,t)=>n=>{if(t?.variants==null)return cr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=sr(t)||sr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return cr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ur=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},dr=(e,t)=>({classGroupId:e,validator:t}),fr=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),pr=`-`,mr=[],hr=`arbitrary..`,gr=e=>{let t=yr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return vr(e);let n=e.split(pr);return _r(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ur(i,t):t:i||mr}return n[e]||mr}}},_r=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=_r(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(pr):e.slice(t).join(pr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},vr=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?hr+r:void 0})(),yr=e=>{let{theme:t,classGroups:n}=e;return br(n,t)},br=(e,t)=>{let n=fr();for(let r in e){let i=e[r];xr(i,n,r,t)}return n},xr=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Sr(i,t,n,r)}},Sr=(e,t,n,r)=>{if(typeof e==`string`){Cr(e,t,n);return}if(typeof e==`function`){wr(e,t,n,r);return}Tr(e,t,n,r)},Cr=(e,t,n)=>{let r=e===``?t:Er(t,e);r.classGroupId=n},wr=(e,t,n,r)=>{if(Dr(e)){xr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(dr(n,e))},Tr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];xr(o,Er(t,a),n,r)}},Er=(e,t)=>{let n=e,r=t.split(pr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=fr(),n.nextPart.set(t,i)),n=i}return n},Dr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Or=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},kr=`!`,Ar=`:`,jr=[],Mr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Nr=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ar){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(kr)?(c=s.slice(0,-1),l=!0):s.startsWith(kr)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Mr(t,l,c,u)};if(t){let e=t+Ar,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Mr(jr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Pr=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Fr=e=>({cache:Or(e.cacheSize),parseClassName:Nr(e),sortModifiers:Pr(e),postfixLookupClassGroupIds:Ir(e),...gr(e)}),Ir=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Lr=/\s+/,Rr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Lr),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+kr:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},zr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Br(n))&&(i&&(i+=` `),i+=r);return i},Br=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Br(e[r]))&&(n&&(n+=` `),n+=t);return n},Vr=(e,...t)=>{let n,r,i,a,o=o=>(n=Fr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Rr(e,n);return i(e,a),a};return a=o,(...e)=>a(zr(...e))},Hr=[],Ur=e=>{let t=t=>t[e]||Hr;return t.isThemeGetter=!0,t},Wr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Kr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qr=e=>Kr.test(e),$r=e=>!!e&&!Number.isNaN(Number(e)),ei=e=>!!e&&Number.isInteger(Number(e)),ti=e=>e.endsWith(`%`)&&$r(e.slice(0,-1)),ni=e=>qr.test(e),ri=()=>!0,ii=e=>Jr.test(e)&&!Yr.test(e),ai=()=>!1,oi=e=>Xr.test(e),si=e=>Zr.test(e),ci=e=>!B(e)&&!V(e),li=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ui=e=>Ti(e,ki,ai),B=e=>Wr.test(e),di=e=>Ti(e,Ai,ii),fi=e=>Ti(e,ji,$r),pi=e=>Ti(e,Ni,ri),mi=e=>Ti(e,Mi,ai),hi=e=>Ti(e,Di,ai),gi=e=>Ti(e,Oi,si),_i=e=>Ti(e,Pi,oi),V=e=>Gr.test(e),vi=e=>Ei(e,Ai),yi=e=>Ei(e,Mi),bi=e=>Ei(e,Di),xi=e=>Ei(e,ki),Si=e=>Ei(e,Oi),Ci=e=>Ei(e,Pi,!0),wi=e=>Ei(e,Ni,!0),Ti=(e,t,n)=>{let r=Wr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ei=(e,t,n=!1)=>{let r=Gr.exec(e);return r?r[1]?t(r[1]):n:!1},Di=e=>e===`position`||e===`percentage`,Oi=e=>e===`image`||e===`url`,ki=e=>e===`length`||e===`size`||e===`bg-size`,Ai=e=>e===`length`,ji=e=>e===`number`,Mi=e=>e===`family-name`,Ni=e=>e===`number`||e===`weight`,Pi=e=>e===`shadow`,Fi=Vr(()=>{let e=Ur(`color`),t=Ur(`font`),n=Ur(`text`),r=Ur(`font-weight`),i=Ur(`tracking`),a=Ur(`leading`),o=Ur(`breakpoint`),s=Ur(`container`),c=Ur(`spacing`),l=Ur(`radius`),u=Ur(`shadow`),d=Ur(`inset-shadow`),f=Ur(`text-shadow`),p=Ur(`drop-shadow`),m=Ur(`blur`),h=Ur(`perspective`),g=Ur(`aspect`),_=Ur(`ease`),v=Ur(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[Qr,`full`,`auto`,...w()],E=()=>[ei,`none`,`subgrid`,V,B],D=()=>[`auto`,{span:[`full`,ei,V,B]},ei,V,B],O=()=>[ei,`auto`,V,B],ee=()=>[`auto`,`min`,`max`,`fr`,V,B],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[Qr,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[Qr,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[Qr,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,V,B],P=()=>[...b(),bi,hi,{position:[V,B]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,xi,ui,{size:[V,B]}],ae=()=>[ti,vi,di],oe=()=>[``,`none`,`full`,l,V,B],F=()=>[``,$r,vi,di],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[$r,ti,bi,hi],ue=()=>[``,`none`,m,V,B],de=()=>[`none`,$r,V,B],fe=()=>[`none`,$r,V,B],pe=()=>[$r,V,B],me=()=>[Qr,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ni],breakpoint:[ni],color:[ri],container:[ni],"drop-shadow":[ni],ease:[`in`,`out`,`in-out`],font:[ci],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ni],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ni],shadow:[ni],spacing:[`px`,$r],text:[ni],"text-shadow":[ni],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Qr,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[li],columns:[{columns:[$r,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ei,`auto`,V,B]}],basis:[{basis:[Qr,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[$r,Qr,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,$r,V,B]}],shrink:[{shrink:[``,$r,V,B]}],order:[{order:[ei,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,vi,di]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,wi,pi]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ti,B]}],"font-family":[{font:[yi,mi,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[$r,`none`,V,fi]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[$r,`from-font`,`auto`,V,di]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[$r,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ei,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ei,V,B],radial:[``,V,B],conic:[ei,V,B]},Si,gi]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[$r,V,B]}],"outline-w":[{outline:[``,$r,vi,di]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Ci,_i]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ci,_i]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[$r,di]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Ci,_i]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[$r,V,B]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[$r]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[$r]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:ue()}],brightness:[{brightness:[$r,V,B]}],contrast:[{contrast:[$r,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ci,_i]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,$r,V,B]}],"hue-rotate":[{"hue-rotate":[$r,V,B]}],invert:[{invert:[``,$r,V,B]}],saturate:[{saturate:[$r,V,B]}],sepia:[{sepia:[``,$r,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[$r,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[$r,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,$r,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$r,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,$r,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[$r,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[$r,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,$r,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[$r,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[$r,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[ei,V,B]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[$r,vi,di,fi]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return Fi(or(e))}var Ii=lr(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-mono text-[11px] uppercase tracking-[0.14em] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-[var(--accent-sky)] text-[var(--bg-sunken)] hover:bg-[var(--accent-sky-hover)]`,destructive:`border border-[var(--break-red)] bg-transparent text-[var(--break-red)] hover:bg-[var(--severity-blocking-bg)]`,outline:`border border-[var(--accent-sky)] bg-transparent text-[var(--accent-sky)] hover:bg-[var(--bg-sunken)]`,secondary:`border border-[var(--border)] bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]`,ghost:`bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]`,link:`bg-transparent normal-case tracking-normal text-[var(--accent-sky)] hover:text-[var(--accent-sky-hover)] underline-offset-4 hover:underline`},size:{default:`h-8 px-3 py-1.5`,sm:`h-7 px-2.5 text-[10px]`,lg:`h-10 px-4 text-xs`,icon:`h-8 w-8`}},defaultVariants:{variant:`default`,size:`default`}}),U=I.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,L.jsx)(r?$n:`button`,{className:H(Ii({variant:t,size:n,className:e})),ref:a,...i}));U.displayName=`Button`;var W=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`rounded-lg border border-border bg-card text-card-foreground`,e),...t}));W.displayName=`Card`;var Li=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`flex flex-col gap-1.5 p-6 pb-3`,e),...t}));Li.displayName=`CardHeader`;var Ri=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`h3`,{ref:n,className:H(`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,e),...t}));Ri.displayName=`CardTitle`;var zi=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`p`,{ref:n,className:H(`font-mono text-[12px] text-[var(--fg-muted)]`,e),...t}));zi.displayName=`CardDescription`;var Bi=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`px-6 pb-6`,e),...t}));Bi.displayName=`CardContent`;var Vi=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`flex items-center px-6 pb-6 pt-0`,e),...t}));Vi.displayName=`CardFooter`;var Hi=c(m(),1);function Ui(e){let t=Wi(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(Ki);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Wi(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=Ji(n),i=qi(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gi=Symbol(`radix.slottable`);function Ki(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Gi}function qi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ji(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yi=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ui(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xi(e,t){e&&Hi.flushSync(()=>e.dispatchEvent(t))}var Zi=globalThis?.document?I.useLayoutEffect:()=>{};function Qi(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var $i=e=>{let{present:t,children:n}=e,r=ea(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=qn(r.ref,na(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};$i.displayName=`Presence`;function ea(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=Qi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=ta(r.current);a.current=o===`mounted`?e:`none`},[o]),Zi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ta(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Zi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ta(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=ta(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function ta(e){return e?.animationName||`none`}function na(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ra(e,t){let n=I.createContext(t),r=e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=I.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function ia(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,aa(i,...t)]}function aa(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function oa(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...e)=>t.current?.(...e),[])}var sa=I.createContext(void 0);function ca(e){let t=I.useContext(sa);return e||t||`ltr`}function la(e,[t,n]){return Math.min(n,Math.max(t,e))}typeof window<`u`&&window.document&&window.document.createElement;function G(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ua(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var da=`ScrollArea`,[fa,pa]=ia(da),[ma,ha]=fa(da),ga=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,b]=I.useState(0),[x,S]=I.useState(!1),[C,w]=I.useState(!1),T=qn(t,e=>c(e)),E=ca(i);return(0,L.jsx)(ma,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,L.jsx)(Yi.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});ga.displayName=da;var _a=`ScrollAreaViewport`,va=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=ha(_a,n),s=qn(t,I.useRef(null),o.onViewportChange);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,L.jsx)(Yi.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,L.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});va.displayName=_a;var ya=`ScrollAreaScrollbar`,ba=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ha(ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,L.jsx)(xa,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,L.jsx)(Sa,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,L.jsx)(Ca,{...r,ref:t,forceMount:n}):i.type===`always`?(0,L.jsx)(wa,{...r,ref:t}):null});ba.displayName=ya;var xa=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ha(ya,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,L.jsx)($i,{present:n||a,children:(0,L.jsx)(Ca,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Sa=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ha(ya,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Wa(()=>c(`SCROLL_END`),100),[s,c]=ua(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,L.jsx)($i,{present:n||s!==`hidden`,children:(0,L.jsx)(wa,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:G(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:G(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),Ca=I.forwardRef((e,t)=>{let n=ha(ya,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=Wa(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Ga(n.viewport,c),Ga(n.content,c),(0,L.jsx)($i,{present:r||a,children:(0,L.jsx)(wa,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),wa=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=ha(ya,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=La(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return za(e,o.current,s,t)}return n===`horizontal`?(0,L.jsx)(Ta,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Ba(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,L.jsx)(Ea,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Ba(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Ta=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=ha(ya,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=qn(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(ka,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Ra(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Ha(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ia(o.paddingLeft),paddingEnd:Ia(o.paddingRight)}})}})}),Ea=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=ha(ya,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=qn(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(ka,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Ra(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Ha(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ia(o.paddingTop),paddingEnd:Ia(o.paddingBottom)}})}})}),[Da,Oa]=fa(ya),ka=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=ha(ya,n),[m,h]=I.useState(null),g=qn(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=oa(u),S=oa(c),C=Wa(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(S,[r,S]),Ga(m,C),Ga(p.content,C),(0,L.jsx)(Da,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:oa(a),onThumbPointerUp:oa(o),onThumbPositionChange:S,onThumbPointerDown:oa(s),children:(0,L.jsx)(Yi.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:G(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:G(e.onPointerMove,w),onPointerUp:G(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),Aa=`ScrollAreaThumb`,ja=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Oa(Aa,e.__scopeScrollArea);return(0,L.jsx)($i,{present:n||i.hasThumb,children:(0,L.jsx)(Ma,{ref:t,...r})})}),Ma=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=ha(Aa,n),o=Oa(Aa,n),{onThumbPositionChange:s}=o,c=qn(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=Wa(()=>{l.current&&=(l.current(),void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Ua(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,L.jsx)(Yi.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:G(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:G(e.onPointerUp,o.onThumbPointerUp)})});ja.displayName=Aa;var Na=`ScrollAreaCorner`,Pa=I.forwardRef((e,t)=>{let n=ha(Na,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,L.jsx)(Fa,{...e,ref:t}):null});Pa.displayName=Na;var Fa=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=ha(Na,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Ga(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Ga(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,L.jsx)(Yi.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function Ia(e){return e?parseInt(e,10):0}function La(e,t){let n=e/t;return isNaN(n)?0:n}function Ra(e){let t=La(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function za(e,t,n,r=`ltr`){let i=Ra(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Va([c,l],d)(e)}function Ba(e,t,n=`ltr`){let r=Ra(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=la(e,n===`ltr`?[0,o]:[o*-1,0]);return Va([0,o],[0,s])(c)}function Va(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ha(e,t){return e>0&&e<t}var Ua=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Wa(e,t){let n=oa(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ga(e,t){let n=oa(t);Zi(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Ka=ga,qa=va,Ja=Pa,Ya=I.forwardRef(({className:e,children:t,...n},r)=>(0,L.jsxs)(Ka,{ref:r,className:H(`relative overflow-hidden`,e),...n,children:[(0,L.jsx)(qa,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,L.jsx)(Xa,{}),(0,L.jsx)(Ja,{})]}));Ya.displayName=Ka.displayName;var Xa=I.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,L.jsx)(ba,{ref:r,orientation:t,className:H(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2 border-l border-l-transparent p-px`,t===`horizontal`&&`h-2 flex-col border-t border-t-transparent p-px`,e),...n,children:(0,L.jsx)(ja,{className:`relative flex-1 rounded-full bg-[var(--border-strong)]`})}));Xa.displayName=ba.displayName;var Za=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]`,Qa=`font-serif font-normal leading-[1.05] text-foreground text-[64px]`;function $a({headline:e}){let[t,n]=(0,I.useState)(!1),{events:r}=Wn(),i=r.length>0?r[r.length-1]:null;return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground`,children:(0,L.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-6`,children:[(0,L.jsx)(`span`,{className:Za,children:`Jinn · starting up`}),(0,L.jsxs)(`h1`,{className:Qa,children:[e,`.`]}),(0,L.jsx)(`p`,{className:`min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]`,children:i?eo(i):`The daemon is booting. This usually takes a second.`}),(0,L.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`self-start text-[var(--fg-dim)] hover:text-foreground`,onClick:()=>n(e=>!e),"aria-expanded":t,children:[t?(0,L.jsx)(wn,{}):(0,L.jsx)(Sn,{}),t?`Hide details`:`Show details`]}),t&&(0,L.jsx)(W,{className:`bg-[var(--bg-elevated)]`,children:(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsx)(Ya,{className:`h-64`,children:(0,L.jsxs)(`div`,{className:`px-3 py-2 font-mono text-xs`,children:[r.length===0&&(0,L.jsx)(`div`,{className:`text-[var(--fg-dim)]`,children:`no events yet`}),r.slice().reverse().map(e=>(0,L.jsxs)(`div`,{className:`grid grid-cols-[68px_84px_1fr] gap-3 py-0.5`,children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:e.ts.slice(11,19)}),(0,L.jsx)(`span`,{className:H(e.kind===`error`?`text-[var(--break-red)]`:e.kind===`system`?`text-[var(--accent-sky)]`:`text-[var(--fg-dim)]`),children:e.kind}),(0,L.jsx)(`span`,{className:`text-foreground`,children:e.message})]},e.id))]})})})})]})})}function eo(e){return e.kind===`error`?`Error: ${e.message}`:e.message}var to=lr(`relative w-full border-l-2 px-4 py-2 font-mono text-[12px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3 [&>svg+div]:translate-y-[-3px]`,{variants:{variant:{default:`border-[var(--severity-info-fg)] bg-transparent text-foreground`,info:`border-[var(--severity-info-fg)] bg-transparent text-foreground`,warning:`border-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)] text-foreground`,blocking:`border-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)] text-foreground`,success:`border-[var(--vow-green)] bg-transparent text-foreground`}},defaultVariants:{variant:`default`}}),no=I.forwardRef(({className:e,variant:t,...n},r)=>(0,L.jsx)(`div`,{ref:r,role:`alert`,className:H(to({variant:t}),e),...n}));no.displayName=`Alert`;var ro=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`h5`,{ref:n,className:H(`mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]`,e),...t}));ro.displayName=`AlertTitle`;var K=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`text-[12px] [&_p]:leading-relaxed`,e),...t}));K.displayName=`AlertDescription`;function io(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,ao(i,...t)]}function ao(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function oo(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function so(...e){return t=>{let n=!1,r=e.map(e=>{let r=oo(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():oo(e[t],null)}}}}function co(...e){return I.useCallback(so(...e),e)}function lo(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];_o(r)&&typeof xo==`function`&&(r=xo(r._payload)),I.Children.forEach(r,e=>{if(ho(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;_o(n)&&typeof xo==`function`&&(n=xo(n._payload)),a=fo(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?mo(a):void 0,l=co(n,c);if(!a){if(r||r===0)throw Error(o?bo(e):yo(e));return r}let u=po(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var uo=Symbol.for(`radix.slottable`),fo=(e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null};function po(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function mo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ho(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===uo}var go=Symbol.for(`react.lazy`);function _o(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===go&&`_payload`in e&&vo(e._payload)}function vo(e){return typeof e==`object`&&!!e&&`then`in e}var yo=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,bo=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xo=I.use,So=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=lo(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Co=`Progress`,wo=100,[To,Eo]=io(Co),[Do,Oo]=To(Co),ko=I.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Mo,...o}=e;(i||i===0)&&!Fo(i)&&console.error(Lo(`${i}`,`Progress`));let s=Fo(i)?i:wo;r!==null&&!Io(r,s)&&console.error(Ro(`${r}`,`Progress`));let c=Io(r,s)?r:null,l=Po(c)?a(c,s):void 0;return(0,L.jsx)(Do,{scope:n,value:c,max:s,children:(0,L.jsx)(So.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Po(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":No(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});ko.displayName=Co;var Ao=`ProgressIndicator`,jo=I.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=Oo(Ao,n);return(0,L.jsx)(So.div,{"data-state":No(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});jo.displayName=Ao;function Mo(e,t){return`${Math.round(e/t*100)}%`}function No(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Po(e){return typeof e==`number`}function Fo(e){return Po(e)&&!isNaN(e)&&e>0}function Io(e,t){return Po(e)&&!isNaN(e)&&e<=t&&e>=0}function Lo(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${wo}\`.`}function Ro(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
10
+ - a positive number
11
+ - less than the value passed to \`max\` (or ${wo} if no \`max\` prop is set)
12
+ - \`null\` or \`undefined\` if the progress is indeterminate.
13
+
14
+ Defaulting to \`null\`.`}var zo=ko,Bo=jo,Vo=I.forwardRef(({className:e,value:t,...n},r)=>(0,L.jsx)(zo,{ref:r,className:H(`relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]`,e),...n,children:(0,L.jsx)(Bo,{className:`h-full w-full flex-1 bg-[var(--accent-sky)] transition-all`,style:{transform:`translateX(-${100-(t??0)}%)`}})}));Vo.displayName=zo.displayName;var Ho={base:`Base`,"base-sepolia":`Base Sepolia`},Uo=`font-mono text-[11px] font-medium uppercase tracking-[0.14em]`;function Wo({address:e,minimumWei:t,chainExplorerBase:n,chain:r,onSharedDefaultRpc:i=!1}){let[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(0),d=(0,I.useRef)(!1),[f,p]=(0,I.useState)({state:`idle`});(0,I.useEffect)(()=>{if(s===null)return;u(Math.max(0,Math.floor((Date.now()-s)/1e3)));let e=window.setInterval(()=>{u(Math.max(0,Math.floor((Date.now()-s)/1e3)))},1e3);return()=>window.clearInterval(e)},[s]);let m=async()=>{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)},h=async()=>{d.current=!0,c(Date.now()),u(0),p({state:`requesting`});try{let e=await z.triggerDrip();c(null),e.ok?p({state:`sent`,txHash:e.txHash??e.txHashes?.at(-1),txHashes:e.txHashes,attempts:e.attempts,balanceWei:e.balanceWei,targetWei:e.targetWei}):e.rateLimited||e.reason&&/rate|claimed|429/i.test(e.reason)?p({state:`rate_limited`,reason:e.reason??`faucet rate-limited`}):p({state:`failed`,reason:e.reason??`faucet funding failed`})}catch(e){c(null),p({state:`failed`,reason:e instanceof Error?e.message:`drip failed`})}},g=(0,I.useRef)(t);(0,I.useEffect)(()=>{g.current!==t&&(g.current=t,p({state:`idle`}),d.current&&h())},[t]);let _=e=>{if(!e)return`unknown`;try{let t=Number(BigInt(e))/0xde0b6b3a7640000;return`${t.toFixed(t<.001?4:3)} ETH`}catch{return`${e} wei`}},v=_(t),y=(0,I.useMemo)(()=>f.state===`requesting`?Math.min(92,Math.max(8,Math.round(l/60*92))):0,[f.state,l]),b=f.state===`sent`?f.txHashes?.length??f.attempts??+!!f.txHash:0,x=f.state===`sent`&&f.balanceWei!==void 0&&f.targetWei!==void 0&&(()=>{try{return BigInt(f.balanceWei)>=BigInt(f.targetWei)}catch{return!1}})(),S=f.state===`sent`&&!x;return(0,L.jsxs)(no,{variant:`warning`,className:`flex flex-col gap-4 border-l-2 px-6 py-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,L.jsx)(ro,{className:H(Uo,`text-[var(--accent-gold)]`),children:`Action needed · fund the master EOA`}),(0,L.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--fg-dim)]`,children:`auto-detected on chain`})]}),(0,L.jsxs)(K,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`break-all font-mono text-xs text-foreground`,children:e}),(0,L.jsxs)(`span`,{className:`font-mono text-xs text-[var(--fg-muted)]`,children:[`send at least `,v,` on `,Ho[r??``]??`this chain`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(U,{type:`button`,onClick:h,disabled:f.state===`requesting`||x,className:`bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]`,children:f.state===`requesting`?`Funding...`:x?`Faucet funded`:S?`Fund more`:`Fund from faucet`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,onClick:m,children:a?`Copied`:`Copy address`}),(0,L.jsx)(U,{asChild:!0,variant:`ghost`,children:(0,L.jsxs)(`a`,{href:`${n}/address/${e}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,L.jsx)(An,{}),`View on explorer`]})})]}),f.state===`sent`&&(0,L.jsxs)(`p`,{className:H(`font-mono text-[11px]`,x?`text-[var(--vow-green)]`:`text-[var(--accent-gold)]`),children:[x?`Faucet funding complete`:`Faucet funding partial`,b>0?` (${b} drip${b===1?``:`s`})`:``,`.`,f.balanceWei&&f.targetWei?` Balance ${_(f.balanceWei)} / target ${_(f.targetWei)}.`:``,S?` Click "Fund more" to top up.`:``,f.txHash&&(0,L.jsxs)(L.Fragment,{children:[` `,(0,L.jsx)(`a`,{href:`${n}/tx/${f.txHash}`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--accent-sky)] hover:underline`,children:`view latest tx`})]})]}),f.state===`requesting`&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(Vo,{value:y,className:`h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]`}),(0,L.jsxs)(`p`,{className:`font-mono text-[11px] text-[var(--fg-muted)]`,children:[`Requesting faucet drips for `,Go(e),`. Elapsed `,l,`s; this can take about a minute on a fresh wallet.`]})]}),f.state===`rate_limited`&&(0,L.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--wane)]`,children:`Faucet rate-limited. Send manually or wait before trying again.`}),f.state===`failed`&&(0,L.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--break-red)]`,children:f.reason}),i&&(0,L.jsx)(`p`,{"data-testid":`onboarding-shared-rpc-nudge`,className:`font-mono text-[11px] text-[var(--fg-dim)]`,children:`Using a shared trial RPC — add your own key in the Network section for reliable operation.`})]})}var Go=e=>`${e.slice(0,6)}…${e.slice(-4)}`,Ko=o(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(self,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(6114),s=n(9924),c=n(844),l=n(5596),u=n(4725),d=n(3656),f=t.AccessibilityManager=class extends c.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=document.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=document.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new s.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
15
+ `)))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,d.addDisposableDomListener)(window,`resize`,(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,c.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
16
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)),o.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0,o.isMac&&this._liveRegion.remove()}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.translateBufferLineToString(n.ydisp+i,!0),t=(n.ydisp+i+1).toString(),a=this._rowElements[i];a&&(e.length===0?a.innerText=`\xA0`:a.textContent=e,a.setAttribute(`aria-posinset`,t),a.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=document.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=f=r([i(1,u.IRenderService)],f)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},6465:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=t.Linkifier2=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{let t=this._linkProviders.indexOf(e);t!==-1&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,n){this._element=e,this._mouseService=t,this._renderService=n,this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,r;this._activeProviderReplies&&t||((n=this._activeProviderReplies)==null||n.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,a]of this._linkProviders.entries())t?(r=this._activeProviderReplies)!=null&&r.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):a.provideLinks(e.y,(t=>{var r;if(this._isMouseOut)return;let a=t?.map((e=>({link:e})));(r=this._activeProviderReplies)==null||r.set(n,a),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>(this._currentLink?.state)?.decorations.pointerCursor,set:e=>{var t,n;(t=this._currentLink)!=null&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&((n=this._element)==null||n.classList.toggle(`xterm-cursor-pointer`,e)))}},underline:{get:()=>(this._currentLink?.state)?.decorations.underline,set:t=>{var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink?.state)?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier2=l=r([i(0,c.IBufferService)],l)},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>(i?.hover)?.call(i,e,t,a),leave:(e,t)=>(i?.leave)?.call(i,e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._parentWindow.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;let r=n(844);class i extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,r.toDisposable)((()=>{this.clearListener()})))}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=i},3236:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(6465),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),T=n(6114),E=n(8437),D=n(2584),O=n(7399),ee=n(5941),te=n(9074),k=n(2585),A=n(5435),j=n(4567),M=typeof window<`u`?window.document:null;class ne extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(a.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(te.DecorationService),this._instantiationService.setService(k.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{var e;this._customKeyEventHandler=void 0,(e=this.element?.parentNode)==null||e.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${n};${(0,ee.toRgbString)(r)}${D.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.rgba.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.rgba.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(j.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[I`),this.updateCursorStyle(e),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),T.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this._document=e.ownerDocument,this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=M.createDocumentFragment();this._viewportElement=M.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._helperContainer=M.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=M.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),T.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,this._document.defaultView??window),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=M.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(j.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=(t.addEventListener(`mouseup`,a.mouseup),a.mouseup):(this._document.removeEventListener(`mouseup`,r.mouseup),t.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){var r;n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):(r=this.viewport)==null||r.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,O.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==D.C0.ETX&&n.key!==D.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var n,r;(n=this._charSizeService)==null||n.measure(),(r=this.viewport)==null||r.syncScrollArea(!0)}clear(){var e;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(E.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(e=this.viewport)==null||e.reset(),this.refresh(0,this.rows-1)}}reset(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;let n=this._customKeyEventHandler;this._setup(),super.reset(),(e=this._selectionService)==null||e.reset(),this._decorationService.reset(),(t=this.viewport)==null||t.reset(),this._customKeyEventHandler=n,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(D.C0.ESC+`[I`):this.coreService.triggerDataEvent(D.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case A.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t};${e}t`);break;case A.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=ne},9924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(3656),o=n(4725),s=n(844),c=n(2585),l=t.BufferDecorationRenderer=class extends s.Disposable{constructor(e,t,n,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=n,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,a.addDisposableDomListener)(window,`resize`,(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,s.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=document.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=l=r([i(1,c.IBufferService),i(2,c.IDecorationService),i(3,o.IRenderService)],l)},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(3656),s=n(4725),c=n(844),l=n(2585),u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},p=t.OverviewRulerRenderer=class extends c.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,s){var l;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowseService=s,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),(l=this._viewportElement.parentElement)==null||l.insertBefore(this._canvas,this._viewportElement);let u=this._canvas.getContext(`2d`);if(!u)throw Error(`Ctx cannot be null`);this._ctx=u,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,c.toDisposable)((()=>{var e;(e=this._canvas)==null||e.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,`resize`,(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=d.left,f.right=d.left+d.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowseService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);u.left=t,u.center=t,u.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(f[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-u[e.position||`full`]/2),d[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=p=r([i(2,l.IBufferService),i(3,l.IDecorationService),i(4,s.IRenderService),i(5,l.IOptionsService),i(6,s.ICoreBrowserService)],p)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1,c=n.buffer.lines.get(i+s*a);c!=null&&c.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(4725),u=n(8055),d=n(8460),f=n(844),p=n(2585),m=`xterm-dom-renderer-owner-`,h=`xterm-rows`,g=`xterm-fg-`,_=`xterm-bg-`,v=`xterm-focus`,y=`xterm-selection`,b=1,x=t.DomRenderer=class extends f.Disposable{constructor(e,t,n,r,i,s,l,u,p,g){super(),this._element=e,this._screenElement=t,this._viewportElement=n,this._linkifier2=r,this._charSizeService=s,this._optionsService=l,this._bufferService=u,this._coreBrowserService=p,this._themeService=g,this._terminalClass=b++,this._rowElements=[],this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=document.createElement(`div`),this._rowContainer.classList.add(h),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement(`div`),this._selectionContainer.classList.add(y),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=i.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${h} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${h} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${h} .xterm-dim { color: ${u.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,t+=`@keyframes blink_box_shadow_`+this._terminalClass+` { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes blink_block_`+this._terminalClass+` { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${y} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${y} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${y} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${g}${n} { color: ${r.css}; }${this._terminalSelector} .${g}${n}.xterm-dim { color: ${u.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${_}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(e.background).css}; }${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;let r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,a=Math.max(r,0),o=Math.min(i,this._bufferService.rows-1);if(a>=this._bufferService.rows||o<0)return;let s=document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=document.createElement(`div`);return i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=t*this.dimensions.css.cell.width+`px`,i.style.width=this.dimensions.css.cell.width*(n-t)+`px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=x=r([i(4,p.IInstantiationService),i(5,l.ICharSizeService),i(6,p.IOptionsService),i(7,p.IBufferService),i(8,l.ICoreBrowserService),i(9,l.IThemeService)],x)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,T=0,E=0,D=!1,O=0,ee=!1,te=0,k=[],A=m!==-1&&g!==-1;for(let j=0;j<x;j++){e.loadCell(j,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let M=!1,ne=j,N=this._workCell;if(v.length>0&&j===v[0][0]){M=!0;let t=v.shift();N=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),ne=t[1]-1,x=N.getWidth()}let P=this._isCellInSelection(j,t),re=n&&j===s,ie=A&&j>=m&&j<=g,ae=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,(e=>{ae=!0}));let oe=N.getChars()||o.WHITESPACE_CELL_CHAR;if(oe===` `&&(N.isUnderline()||N.isOverline())&&(oe=`\xA0`),te=x*u-f.get(oe,N.isBold(),N.isItalic()),b){if(S&&(P&&ee||!P&&!ee&&N.bg===w)&&(P&&ee&&y.selectionForeground||N.fg===T)&&N.extended.ext===E&&ie===D&&te===O&&!re&&!M&&!ae){C+=oe,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=N.bg,T=N.fg,E=N.extended.ext,D=ie,O=te,ee=P,M&&s>=j&&s<=ne&&(s=j),!this._coreService.isCursorHidden&&re){if(k.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&k.push(`xterm-cursor-blink`),k.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:k.push(`xterm-cursor-outline`);break;case`block`:k.push(`xterm-cursor-block`);break;case`bar`:k.push(`xterm-cursor-bar`);break;case`underline`:k.push(`xterm-cursor-underline`)}}if(N.isBold()&&k.push(`xterm-bold`),N.isItalic()&&k.push(`xterm-italic`),N.isDim()&&k.push(`xterm-dim`),C=N.isInvisible()?o.WHITESPACE_CELL_CHAR:N.getChars()||o.WHITESPACE_CELL_CHAR,N.isUnderline()&&(k.push(`xterm-underline-${N.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!N.isUnderlineColorDefault()))if(N.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(N.getUnderlineColor()).join(`,`)})`;else{let e=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}N.isOverline()&&(k.push(`xterm-overline`),C===` `&&(C=`\xA0`)),N.isStrikethrough()&&k.push(`xterm-strikethrough`),ie&&(b.style.textDecoration=`underline`);let F=N.getFgColor(),se=N.getFgColorMode(),ce=N.getBgColor(),le=N.getBgColorMode(),ue=!!N.isInverse();if(ue){let e=F;F=ce,ce=e;let t=se;se=le,le=t}let de,fe,pe,me=!1;switch(this._decorationService.forEachDecorationAtCell(j,t,void 0,(e=>{e.options.layer!==`top`&&me||(e.backgroundColorRGB&&(le=50331648,ce=e.backgroundColorRGB.rgba>>8&16777215,de=e.backgroundColorRGB),e.foregroundColorRGB&&(se=50331648,F=e.foregroundColorRGB.rgba>>8&16777215,fe=e.foregroundColorRGB),me=e.options.layer===`top`)})),!me&&P&&(de=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ce=de.rgba>>8&16777215,le=50331648,me=!0,y.selectionForeground&&(se=50331648,F=y.selectionForeground.rgba>>8&16777215,fe=y.selectionForeground)),me&&k.push(`xterm-decoration-top`),le){case 16777216:case 33554432:pe=y.ansi[ce],k.push(`xterm-bg-${ce}`);break;case 50331648:pe=l.rgba.toColor(ce>>16,ce>>8&255,255&ce),this._addStyle(b,`background-color:#${h((ce>>>0).toString(16),`0`,6)}`);break;default:ue?(pe=y.foreground,k.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):pe=y.background}switch(de||N.isDim()&&(de=l.color.multiplyOpacity(pe,.5)),se){case 16777216:case 33554432:N.isBold()&&F<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(F+=8),this._applyMinimumContrast(b,pe,y.ansi[F],N,de,void 0)||k.push(`xterm-fg-${F}`);break;case 50331648:let e=l.rgba.toColor(F>>16&255,F>>8&255,255&F);this._applyMinimumContrast(b,pe,e,N,de,fe)||this._addStyle(b,`color:#${h(F.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,pe,y.foreground,N,de,void 0)||ue&&k.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}k.length&&=(b.className=k.join(` `),0),re||M||ae?b.textContent=C:S++,te!==this.defaultSpacing&&(b.style.letterSpacing=`${te}px`),_.push(b),j=ne}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.style.position=`absolute`,this._container.style.top=`-50000px`,this._container.style.width=`50000px`,this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let t=e.createElement(`span`),n=e.createElement(`span`);n.style.fontWeight=`bold`;let r=e.createElement(`span`);r.style.fontStyle=`italic`;let i=e.createElement(`span`);i.style.fontWeight=`bold`,i.style.fontStyle=`italic`,this._measureElements=[t,n,r,i],this._container.appendChild(t),this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),e.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256)return this._flat[r]===-9999?this._flat[r]=this._measure(e,0):this._flat[r];let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new l(e,t,this._optionsService),this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l{constructor(e,t,n){this._document=e,this._parentElement=t,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;let e={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return e.width!==0&&e.height!==0&&(this._result.width=e.width/32,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;let a=n(3656),o=n(6193),s=n(5596),c=n(4725),l=n(8460),u=n(844),d=n(7226),f=n(2585),p=t.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,c,f,p){if(super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new d.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new l.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new l.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new l.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new l.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(f.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new s.ScreenDprMonitor(f.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(c.onResize((()=>this._fullRefresh()))),this.register(c.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`],(()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(c.buffer.y,c.buffer.y,!0)))),this.register((0,a.addDisposableDomListener)(f.window,`resize`,(()=>this.handleDevicePixelRatioChange()))),this.register(p.onChangeColors((()=>this._fullRefresh()))),`IntersectionObserver`in f.window){let e=new f.window.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});e.observe(t),this.register({dispose:()=>e.disconnect()})}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};t.RenderService=p=r([i(2,f.IOptionsService),i(3,c.ICharSizeService),i(4,f.IDecorationService),i(5,f.IBufferService),i(6,c.ICoreBrowserService),i(7,c.IThemeService)],p)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
17
+ `:`
18
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh())),d.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(n&&r&&t)&&this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!n||!r)&&this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return!!r&&(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(e.button!==2||!this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);n?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols)}};t.SelectionService=g=r([i(3,m.IBufferService),i(4,m.ICoreService),i(5,c.IMouseService),i(6,m.IOptionsService),i(7,c.IRenderService),i(8,c.ICoreBrowserService)],g)},4725:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;let r=n(8343);t.ICharSizeService=(0,r.createDecorator)(`CharSizeService`),t.ICoreBrowserService=(0,r.createDecorator)(`CoreBrowserService`),t.IMouseService=(0,r.createDecorator)(`MouseService`),t.IRenderService=(0,r.createDecorator)(`RenderService`),t.ISelectionService=(0,r.createDecorator)(`SelectionService`),t.ICharacterJoinerService=(0,r.createDecorator)(`CharacterJoinerService`),t.IThemeService=(0,r.createDecorator)(`ThemeService`)},6731:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;let a=n(7239),o=n(8055),s=n(8460),c=n(844),l=n(2585),u=o.css.toColor(`#ffffff`),d=o.css.toColor(`#000000`),f=o.css.toColor(`#ffffff`),p=o.css.toColor(`#000000`),m={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let e=[o.css.toColor(`#2e3436`),o.css.toColor(`#cc0000`),o.css.toColor(`#4e9a06`),o.css.toColor(`#c4a000`),o.css.toColor(`#3465a4`),o.css.toColor(`#75507b`),o.css.toColor(`#06989a`),o.css.toColor(`#d3d7cf`),o.css.toColor(`#555753`),o.css.toColor(`#ef2929`),o.css.toColor(`#8ae234`),o.css.toColor(`#fce94f`),o.css.toColor(`#729fcf`),o.css.toColor(`#ad7fa8`),o.css.toColor(`#34e2e2`),o.css.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:o.channels.toCss(r,i,a),rgba:o.channels.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+10*t;e.push({css:o.channels.toCss(n,n,n),rgba:o.channels.toRgba(n,n,n)})}return e})());let h=t.ThemeService=class extends c.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new s.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:o.color.blend(d,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:o.color.blend(d,m),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange(`theme`,(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){let n=this._colors;if(n.foreground=g(e.foreground,u),n.background=g(e.background,d),n.cursor=g(e.cursor,f),n.cursorAccent=g(e.cursorAccent,p),n.selectionBackgroundTransparent=g(e.selectionBackground,m),n.selectionBackgroundOpaque=o.color.blend(n.background,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundOpaque=o.color.blend(n.background,n.selectionInactiveBackgroundTransparent),n.selectionForeground=e.selectionForeground?g(e.selectionForeground,o.NULL_COLOR):void 0,n.selectionForeground===o.NULL_COLOR&&(n.selectionForeground=void 0),o.color.isOpaque(n.selectionBackgroundTransparent)&&(n.selectionBackgroundTransparent=o.color.opacity(n.selectionBackgroundTransparent,.3)),o.color.isOpaque(n.selectionInactiveBackgroundTransparent)&&(n.selectionInactiveBackgroundTransparent=o.color.opacity(n.selectionInactiveBackgroundTransparent,.3)),n.ansi=t.DEFAULT_ANSI_COLORS.slice(),n.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),n.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),n.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),n.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),n.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),n.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),n.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),n.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),n.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),n.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),n.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),n.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),n.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),n.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),n.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),n.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){let r=Math.min(n.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)n.ansi[i+16]=g(e.extendedAnsi[i],t.DEFAULT_ANSI_COLORS[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e!==void 0)switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e]}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function g(e,t){if(e!==void 0)try{return o.css.toColor(e)}catch{}return t}t.ThemeService=h=r([i(0,l.IOptionsService)],h)},6349:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new r.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new r.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new r.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}t.CircularList=a},1439:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,n=5){if(typeof t!=`object`)return t;let r=Array.isArray(t)?[]:{};for(let i in t)r[i]=n<=1?t[i]:t[i]&&e(t[i],n-1);return r}},8055:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let r=n(6114),i=0,a=0,o=0,s=0;var c,l,u,d,f;function p(e){let t=e.toString(16);return t.length<2?`0`+t:t}function m(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${p(e)}${p(t)}${p(n)}`:`#${p(e)}${p(t)}${p(n)}${p(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}}(c||(t.channels=c={})),function(e){function t(e,t){return s=Math.round(255*t),[i,a,o]=f.toChannels(e.rgba),{css:c.toCss(i,a,o,s),rgba:c.toRgba(i,a,o,s)}}e.blend=function(e,t){if(s=(255&t.rgba)/255,s===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return i=u+Math.round((n-u)*s),a=d+Math.round((r-d)*s),o=f+Math.round((l-f)*s),{css:c.toCss(i,a,o),rgba:c.toRgba(i,a,o)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=f.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return f.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[i,a,o]=f.toChannels(t),{css:c.toCss(i,a,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return s=255&e.rgba,t(e,s*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(l||(t.color=l={})),function(e){let t,n;if(!r.isNode){let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return i=parseInt(e.slice(1,2).repeat(2),16),a=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),f.toColor(i,a,o);case 5:return i=parseInt(e.slice(1,2).repeat(2),16),a=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),s=parseInt(e.slice(4,5).repeat(2),16),f.toColor(i,a,o,s);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return i=parseInt(r[1]),a=parseInt(r[2]),o=parseInt(r[3]),s=Math.round(255*(r[5]===void 0?1:parseFloat(r[5]))),f.toColor(i,a,o,s);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[i,a,o,s]=t.getImageData(0,0,1,1).data,s!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:c.toRgba(i,a,o,s),css:e}}}(u||(t.css=u={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(d||(t.rgb=d={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function n(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.ensureContrastRatio=function(e,r,i){let a=d.relativeLuminance(e>>8),o=d.relativeLuminance(r>>8);if(m(a,o)<i){if(o<a){let o=t(e,r,i),s=m(a,d.relativeLuminance(o>>8));if(s<i){let t=n(e,r,i);return s>m(a,d.relativeLuminance(t>>8))?o:t}return o}let s=n(e,r,i),c=m(a,d.relativeLuminance(s>>8));if(c<i){let n=t(e,r,i);return c>m(a,d.relativeLuminance(n>>8))?s:n}return s}},e.reduceLuminance=t,e.increaseLuminance=n,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,n,r){return{css:c.toCss(e,t,n,r),rgba:c.toRgba(e,t,n,r)}}}(f||(t.rgba=f={})),t.toPaddedHex=p,t.contrastRatio=m},8969:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;let r=n(844),i=n(2585),a=n(4348),o=n(7866),s=n(744),c=n(7302),l=n(6975),u=n(8460),d=n(1753),f=n(1480),p=n(7994),m=n(9282),h=n(5435),g=n(5981),_=n(2660),v=!1;class y extends r.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this.register(new r.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new c.OptionsService(e)),this._instantiationService.setService(i.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(s.BufferService)),this._instantiationService.setService(i.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(i.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(i.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(i.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(i.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(i.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(_.OscLinkService),this._instantiationService.setService(i.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new h.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new g.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=i.LogLevelEnum.WARN&&!v&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),v=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,s.MINIMUM_COLS),t=Math.max(t,s.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,n){this._bufferService.scrollLines(e,t,n)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,r.toDisposable)((()=>{for(let t of e)t.dispose()}))}}}t.CoreTerminal=y},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))}},5435:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let a=n(2584),o=n(7116),s=n(2015),c=n(844),l=n(482),u=n(8437),d=n(8460),f=n(643),p=n(511),m=n(3734),h=n(2585),g=n(6242),_=n(6351),v=n(5941),y={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function x(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var S;(function(e){e[e.GET_WIN_SIZE_PIXELS=0]=`GET_WIN_SIZE_PIXELS`,e[e.GET_CELL_SIZE_PIXELS=1]=`GET_CELL_SIZE_PIXELS`})(S||(t.WindowsOptionsReportType=S={}));let C=0;class w extends c.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,n,r,i,c,f,m,h=new s.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=m,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new T(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})})),this._parser.setOscHandlerFallback(((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})})),this._parser.setDcsHandlerFallback(((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})})),this._parser.setPrintHandler(((e,t,n)=>this.print(e,t,n))),this._parser.registerCsiHandler({final:`@`},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:` `,final:`@`},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:`A`},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:` `,final:`A`},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:`B`},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:`C`},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:`D`},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:`E`},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:`F`},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:`G`},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:`H`},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:`I`},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:`J`},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`J`},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:`K`},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`K`},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:`L`},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:`M`},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:`P`},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:`S`},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:`T`},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:`X`},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:`Z`},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:`a`},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:`b`},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:`c`},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:`>`,final:`c`},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:`d`},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:`e`},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:`f`},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:`g`},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:`h`},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`h`},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:`l`},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`l`},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:`m`},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:`n`},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:`?`,final:`n`},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:` `,final:`q`},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:`r`},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:`s`},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:`t`},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:`u`},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new g.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new g.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new g.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new g.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new g.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new g.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new g.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new g.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new g.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new g.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:`7`},(()=>this.saveCursor())),this._parser.registerEscHandler({final:`8`},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:`D`},(()=>this.index())),this._parser.registerEscHandler({final:`E`},(()=>this.nextLine())),this._parser.registerEscHandler({final:`H`},(()=>this.tabSet())),this._parser.registerEscHandler({final:`M`},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:`=`},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:`>`},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:`c`},(()=>this.fullReset())),this._parser.registerEscHandler({final:`n`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`o`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`|`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`}`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`~`},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:`%`,final:`@`},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:`%`,final:`G`},(()=>this.selectDefaultCharset()));for(let e in o.CHARSETS)this._parser.registerEscHandler({intermediates:`(`,final:e},(()=>this.selectCharset(`(`+e))),this._parser.registerEscHandler({intermediates:`)`,final:e},(()=>this.selectCharset(`)`+e))),this._parser.registerEscHandler({intermediates:`*`,final:e},(()=>this.selectCharset(`*`+e))),this._parser.registerEscHandler({intermediates:`+`,final:e},(()=>this.selectCharset(`+`+e))),this._parser.registerEscHandler({intermediates:`-`,final:e},(()=>this.selectCharset(`-`+e))),this._parser.registerEscHandler({intermediates:`.`,final:e},(()=>this.selectCharset(`.`+e))),this._parser.registerEscHandler({intermediates:`/`,final:e},(()=>this.selectCharset(`/`+e)));this._parser.registerEscHandler({intermediates:`#`,final:`8`},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error(`Parsing error: `,e),e))),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new _.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=h.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t(`#SLOW_TIMEOUT`)),5e3)))]).catch((e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than 5000 ms`)}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>b&&(a=this._parseStack.position+b)}if(this._logService.logLevel<=h.LogLevelEnum.DEBUG&&this._logService.debug(`parsing data`+(typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join(``)}"`),typeof e==`string`?e.split(``).map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<b&&(this._parseBuffer=new Uint32Array(Math.min(e.length,b))),o||this._dirtyRowTracker.clearRange(),e.length>b)for(let t=a;t<e.length;t+=b){let a=t+b<e.length?t+b:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}this._activeBuffer.x===r&&this._activeBuffer.y===i||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodePoint(this._activeBuffer.x-1,0,1,d.fg,d.bg,d.extended);for(let m=t;m<n;++m){if(r=e[m],i=this._unicodeService.wcwidth(r),r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}if(o&&this._onA11yChar.fire((0,l.stringFromCodePoint)(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),i||!this._activeBuffer.x){if(this._activeBuffer.x+i-1>=s){if(c){for(;this._activeBuffer.x<s;)p.setCellFromCodePoint(this._activeBuffer.x++,0,1,d.fg,d.bg,d.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=s-1,i===2)continue}if(u&&(p.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(d),d),p.getWidth(s-1)===2&&p.setCellFromCodePoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),p.setCellFromCodePoint(this._activeBuffer.x++,r,i,d.fg,d.bg,d.extended),i>0)for(;--i;)p.setCellFromCodePoint(this._activeBuffer.x++,0,0,d.fg,d.bg,d.extended)}else p.getWidth(this._activeBuffer.x-1)?p.addCodepointToCell(this._activeBuffer.x-1,r):p.addCodepointToCell(this._activeBuffer.x-2,r)}n-t>0&&(p.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<s&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodePoint(this._activeBuffer.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final!==`t`||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!x(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),t!==2&&t!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){let n;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(!this._parser.precedingCodepoint)return!0;let t=e.params[0]||1,n=new Uint32Array(t);for(let e=0;e<t;++e)n[e]=this._parser.precedingCodepoint;return this.print(n,0,n.length),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(a.C0.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:i}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=e=>e?1:2,p=e.params[0];return m=p,h=t?p===2?4:p===4?f(o.modes.insertMode):p===12?3:p===20?f(d.convertEol):0:p===1?f(n.applicationCursorKeys):p===3?d.windowOptions.setWinLines?c===80?2:+(c===132):0:p===6?f(n.origin):p===7?f(n.wraparound):p===8?3:p===9?f(r===`X10`):p===12?f(d.cursorBlink):p===25?f(!o.isCursorHidden):p===45?f(n.reverseWraparound):p===66?f(n.applicationKeypad):p===67?4:p===1e3?f(r===`VT200`):p===1002?f(r===`DRAG`):p===1003?f(r===`ANY`):p===1004?f(n.sendFocus):p===1005?4:p===1006?f(i===`SGR`):p===1015?4:p===1016?f(i===`SGR_PIXELS`):p===1048?1:p===47||p===1047||p===1049?f(l===u):p===2004?f(n.bracketedPasteMode):0,o.triggerDataEvent(`${a.C0.ESC}[${t?``:`?`}${m};${h}$y`),!0;var m,h}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=m.AttributeData.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|255&n),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=u.DEFAULT_ATTR_DATA.fg,e.bg=u.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777224|n-90):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777224|n-100):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):n===49?(r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle=`block`;break;case 3:case 4:this._optionsService.options.cursorStyle=`underline`;break;case 5:case 6:this._optionsService.options.cursorStyle=`bar`}let n=t%2==1;return this._optionsService.options.cursorBlink=n,!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!x(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(S.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(S.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t!==0&&t!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t!==0&&t!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t!==0&&t!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t!==0&&t!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(E(n))if(r===`?`)t.push({type:0,index:n});else{let e=(0,v.parseColor)(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.split(`;`);return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex((e=>e.startsWith(`id=`)));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=(0,v.parseColor)(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);E(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(y[e[0]],o.CHARSETS[e[1]]||o.DEFAULT_CHARSET),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new p.CellData;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${e}${a.C0.ESC}\\`),!0))(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-+!!r.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=w;let T=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(C=e,e=t,t=C),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function E(e){return 0<=e&&e<256}T=r([i(0,h.IBufferService)],T)},844:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof navigator>`u`;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let n=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){this._array.length===0?this._array.push(e):(n=this._search(this._getKey(e)),this._array.splice(n,0,e))}delete(e){if(this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(n=this._search(t),n===-1)||this._getKey(this._array[n])!==t)return!1;do if(this._array[n]===e)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===t);return!1}*getKeyIterator(e){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===e)}forEachByKey(e,t){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do t(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===e)}values(){return[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else{if(!(i<e)){for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}t=r+1}}return t}}},7226:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(6114);class i{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},9282:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=n(643);t.updateWindowsModeWrappedState=function(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},9092:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;let r=n(6349),i=n(7226),a=n(3734),o=n(8437),s=n(4634),c=n(511),l=n(643),u=n(4863),d=n(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,l.WHITESPACE_CELL_CHAR,l.WHITESPACE_CELL_WIDTH,l.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new i.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let n=e+this._optionsService.rawOptions.scrollback;return n>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:n}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=o.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=(0,s.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(n.length>0){let r=(0,s.reflowLargerCreateNewLayout)(this.lines,n);(0,s.reflowLargerApplyNewLayout)(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(o.DEFAULT_ATTR_DATA),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new o.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=[],i=0;for(let a=this.lines.length-1;a>=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let l=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),l.unshift(c);let u=this.ybase+this.y;if(u>=a&&u<a+l.length)continue;let d=l[l.length-1].getTrimmedLength(),f=(0,s.reflowSmallerGetNewLineLengths)(l,this._cols,e),p=f.length-l.length,m;m=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);let h=[];for(let e=0;e<p;e++){let e=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);h.push(e)}h.length>0&&(r.push({start:a+l.length+i,newLines:h}),i+=h.length),l.push(...h);let g=f.length-1,_=f[g];_===0&&(g--,_=f[g]);let v=l.length-p-1,y=d;for(;v>=0;){let e=Math.min(y,_);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[v],y-e,_-e,e,!0),_-=e,_===0&&(g--,_=f[g]),y-=e,y===0){v--;let e=Math.max(v,0);y=(0,s.getWrappedLineTrimmedLength)(l,e,this._cols)}}for(let t=0;t<l.length;t++)f[t]<e&&l[t].setCell(f[t],n);let b=p-m;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+i)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(r.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,a=n-1,o=0,s=r[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+i);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+i-1);l>=0;l--)if(s&&s.start>a+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:a+1,amount:s.newLines.length}),c+=s.newLines.length,s=r[++o]}else this.lines.set(l,t[a--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+i-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new u.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let r=n(3734),i=n(511),a=n(643),o=n(482);t.DEFAULT_ATTR_DATA=Object.freeze(new r.AttributeData);let s=0;class c{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let r=t||i.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[3*e+0],n=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:n?(0,o.stringFromCodePoint)(n):``,t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],t[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):``}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return s=3*e,t.content=this._data[s+0],t.fg=this._data[s+1],t.bg=this._data[s+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,n,r,i,a){268435456&i&&(this._extendedAttrs[e]=a),this._data[3*e+0]=t|n<<22,this._data[3*e+1]=r,this._data[3*e+2]=i}addCodepointToCell(e,t){let n=this._data[3*e+0];2097152&n?this._combined[e]+=(0,o.stringFromCodePoint)(t):(2097151&n?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&n)+(0,o.stringFromCodePoint)(t),n&=-2097152,n|=2097152):n=t|1<<22,this._data[3*e+0]=n)}insertCells(e,t,n,a){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs),t<this.length-e){let r=new i.CellData;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs)}deleteCells(e,t,n,a){if(e%=this.length,t<this.length-e){let r=new i.CellData;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs)}replaceCells(e,t,n,i,a=!1){if(a)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodePoint(t,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let n=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let e=new c(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let t in this._combined)e._combined[t]=this._combined[t];for(let t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e=!1,t=0,n=this.length){e&&(n=Math.min(n,this.getTrimmedLength()));let r=``;for(;t<n;){let e=this._data[3*t+0],n=2097151&e;r+=2097152&e?this._combined[t]:n?(0,o.stringFromCodePoint)(n):a.WHITESPACE_CELL_CHAR,t+=e>>22||1}return r}}t.BufferLine=c},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function n(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(i>=s&&i<c){s+=u.length-1;continue}let d=0,f=n(u,d,t),p=1,m=0;for(;p<u.length;){let e=n(u,p,t),i=e-m,o=r-f,s=Math.min(i,o);u[d].copyCellsFrom(u[p],m,f,s,!1),f+=s,f===r&&(d++,f=0),m+=s,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(r-1)===2&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,a))}u[d].replaceCells(f,r,a);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}},t.reflowLargerApplyNewLayout=function(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){let i=[],a=e.map(((r,i)=>n(e,i,t))).reduce(((e,t)=>e+t)),o=0,s=0,c=0;for(;c<a;){if(a-c<r){i.push(a-c);break}o+=r;let l=n(e,s,t);o>l&&(o-=l,s++);let u=e[s].getWidth(o-1)===2;u&&o--;let d=u?r-1:r;i.push(d),c+=d}return i},t.getWrappedLineTrimmedLength=n},5295:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;let r=n(8460),i=n(844),a=n(9092);class o extends i.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=n(482),i=n(643),a=n(3734);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;let r=n(8460),i=n(844);class a{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new r.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,i.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=a,a._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},t.CHARSETS.A={"#":`£`},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},t.CHARSETS.C=t.CHARSETS[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},t.CHARSETS.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},t.CHARSETS.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},t.CHARSETS.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},t.CHARSETS.E=t.CHARSETS[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},t.CHARSETS.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},t.CHARSETS.H=t.CHARSETS[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`}},2584:(e,t)=>{var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
19
+ `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``}(n||(t.C0=n={})),function(e){e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`}(r||(t.C1=r={})),function(e){e.ST=`${n.ESC}\\`}(i||(t.C1_ESCAPED=i={}))},7399:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;let r=n(2584),i={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};t.evaluateKeyboardEvent=function(e,t,n,a){let o={type:0,cancel:!1,key:void 0},s=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`:e.key===`UIKeyInputRightArrow`?o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`);break;case 8:if(e.altKey){o.key=r.C0.ESC+r.C0.DEL;break}o.key=r.C0.DEL;break;case 9:if(e.shiftKey){o.key=r.C0.ESC+`[Z`;break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`D`,o.key===r.C0.ESC+`[1;3D`&&(o.key=r.C0.ESC+(n?`b`:`[1;5D`))):o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`;break;case 39:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`C`,o.key===r.C0.ESC+`[1;3C`&&(o.key=r.C0.ESC+(n?`f`:`[1;5C`))):o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`;break;case 38:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`A`,n||o.key!==r.C0.ESC+`[1;3A`||(o.key=r.C0.ESC+`[1;5A`)):o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`;break;case 40:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`B`,n||o.key!==r.C0.ESC+`[1;3B`||(o.key=r.C0.ESC+`[1;5B`)):o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`;break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+`[2~`);break;case 46:o.key=s?r.C0.ESC+`[3;`+(s+1)+`~`:r.C0.ESC+`[3~`;break;case 36:o.key=s?r.C0.ESC+`[1;`+(s+1)+`H`:t?r.C0.ESC+`OH`:r.C0.ESC+`[H`;break;case 35:o.key=s?r.C0.ESC+`[1;`+(s+1)+`F`:t?r.C0.ESC+`OF`:r.C0.ESC+`[F`;break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=r.C0.ESC+`[5;`+(s+1)+`~`:o.key=r.C0.ESC+`[5~`;break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=r.C0.ESC+`[6;`+(s+1)+`~`:o.key=r.C0.ESC+`[6~`;break;case 112:o.key=s?r.C0.ESC+`[1;`+(s+1)+`P`:r.C0.ESC+`OP`;break;case 113:o.key=s?r.C0.ESC+`[1;`+(s+1)+`Q`:r.C0.ESC+`OQ`;break;case 114:o.key=s?r.C0.ESC+`[1;`+(s+1)+`R`:r.C0.ESC+`OR`;break;case 115:o.key=s?r.C0.ESC+`[1;`+(s+1)+`S`:r.C0.ESC+`OS`;break;case 116:o.key=s?r.C0.ESC+`[15;`+(s+1)+`~`:r.C0.ESC+`[15~`;break;case 117:o.key=s?r.C0.ESC+`[17;`+(s+1)+`~`:r.C0.ESC+`[17~`;break;case 118:o.key=s?r.C0.ESC+`[18;`+(s+1)+`~`:r.C0.ESC+`[18~`;break;case 119:o.key=s?r.C0.ESC+`[19;`+(s+1)+`~`:r.C0.ESC+`[19~`;break;case 120:o.key=s?r.C0.ESC+`[20;`+(s+1)+`~`:r.C0.ESC+`[20~`;break;case 121:o.key=s?r.C0.ESC+`[21;`+(s+1)+`~`:r.C0.ESC+`[21~`;break;case 122:o.key=s?r.C0.ESC+`[23;`+(s+1)+`~`:r.C0.ESC+`[23~`;break;case 123:o.key=s?r.C0.ESC+`[24;`+(s+1)+`~`:r.C0.ESC+`[24~`;break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!a||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(o.key=r.C0.US),e.key===`@`&&(o.key=r.C0.NUL)):e.keyCode===65&&(o.type=1);else{let t=i[e.keyCode]?.[+!!e.shiftKey];if(t)o.key=r.C0.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),o.key=r.C0.ESC+n}else if(e.keyCode===32)o.key=r.C0.ESC+(e.ctrlKey?r.C0.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=r.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=r.C0.DEL:e.keyCode===219?o.key=r.C0.ESC:e.keyCode===220?o.key=r.C0.FS:e.keyCode===221&&(o.key=r.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},225:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;let n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],i;t.UnicodeV6=class{constructor(){if(this.version=`6`,!i){i=new Uint8Array(65536),i.fill(1),i[0]=0,i.fill(0,1,32),i.fill(0,127,160),i.fill(2,4352,4448),i[9001]=2,i[9002]=2,i.fill(2,11904,42192),i[12351]=1,i.fill(2,44032,55204),i.fill(2,63744,64256),i.fill(2,65040,65050),i.fill(2,65072,65136),i.fill(2,65280,65377),i.fill(2,65504,65511);for(let e=0;e<n.length;++e)i.fill(0,n[e][0],n[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?i[e]:function(e,t){let n,r=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else{if(!(e<t[n][0]))return!0;i=n-1}return!1}(e,r)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let n;for(this._isSyncWriting=!0;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e=>Date.now()-n>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-n>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=a},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,r=/^[\da-f]+$/;function i(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=n.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),r.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}},t.toRgbString=function(e,t=16){let[n,r,a]=e;return`rgb:${i(n,t)}/${i(r,t)}/${i(a,t)}`}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;let r=n(482),i=n(8742),a=n(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,`HOOK`,t)}put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._ident,`PUT`,(0,r.utf32ToString)(e,t,n))}unhook(e,t=!0){if(this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].unhook(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,`UNHOOK`,e);this._active=o,this._ident=0}};let s=new i.Params;s.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data=``,this._params=s,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():s,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=s,this._data=``,this._hitLimit=!1,e)));return this._params=s,this._data=``,this._hitLimit=!1,t}}},2015:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=n(844),i=n(8742),a=n(6242),o=n(6351);class s{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}}t.TransitionTable=s,t.VT500_TRANSITION_TABLE=function(){let e=new s(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();class c extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new i.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,r.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},(()=>!0))}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r,i=0,a=0,o=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](this._params),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 4:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],r=this._dcsParser.unhook(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],r=this._oscParser.end(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let n=o;n<t;++n){switch(i=e[n],a=this._transitions.table[this.currentState<<8|(i<160?i:160)],a>>4){case 2:for(let r=n+1;;++r){if(r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|i],s=o?o.length-1:-1;for(;s>=0&&(r=o[s](this._params),!0!==r);s--)if(r instanceof Promise)return this._preserveStack(3,o,s,a,n),r;s<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingCodepoint=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++n<t&&(i=e[n])>47&&i<60);n--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let c=this._escHandlers[this._collect<<8|i],l=c?c.length-1:-1;for(;l>=0&&(r=c[l](),!0!==r);l--)if(r instanceof Promise)return this._preserveStack(4,c,l,a,n),r;l<0&&this._escHandlerFb(this._collect<<8|i),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let r=n+1;;++r)if(r>=t||(i=e[r])===24||i===26||i===27||i>127&&i<160){this._dcsParser.put(e,n,r),n=r-1;break}break;case 14:if(r=this._dcsParser.unhook(i!==24&&i!==26),r)return this._preserveStack(6,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let r=n+1;;r++)if(r>=t||(i=e[r])<32||i>127&&i<160){this._oscParser.put(e,n,r),n=r-1;break}break;case 6:if(r=this._oscParser.end(i!==24&&i!==26),r)return this._preserveStack(5,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&a}}}t.EscapeSequenceParser=c},6242:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;let r=n(5770),i=n(482),a=[];t.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,`START`)}_put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,`PUT`,(0,i.utf32ToString)(e,t,n))}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].end(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._id,`END`,e);this._active=a,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data=``,this._hitLimit=!1,e)));return this._data=``,this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;let n=2147483647;class r{static fromArray(e){let t=new r;if(!e.length)return t;for(let n=+!!Array.isArray(e[0]);n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let e=0;e<r.length;++e)t.addSubParam(r[e]);else t.addParam(r)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e=new r(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}}t.Params=r},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;let r=n(3785),i=n(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new r.BufferLineApiView(t)}getNullCell(){return new i.CellData}}},3785:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;let r=n(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}}},8285:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;let r=n(8771),i=n(8460),a=n(844);class o extends a.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new i.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new r.BufferApiView(this._core.buffers.normal,`normal`),this._alternate=new r.BufferApiView(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,n)=>t(e,n.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let a=n(8460),o=n(844),s=n(5295),c=n(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let l=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new s.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t,n){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};t.BufferService=l=r([i(0,c.IOptionsService)],l)},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;let a=n(2585),o=n(8460),s=n(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),e.action===32?n|=32:e.action!==0||t||(n|=3)),n}let u=String.fromCharCode,d={DEFAULT:e=>{let t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`${u(t[0])}${u(t[1])}${u(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.x};${e.y}${t}`}},f=t.CoreMouseService=class extends s.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(c))this.addProtocol(e,c[e]);for(let e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=f=r([i(0,a.IBufferService),i(1,a.ICoreService)],f)},6975:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;let a=n(1439),o=n(8460),s=n(844),c=n(2585),l=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=t.CoreService=class extends s.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=r([i(0,c.IBufferService),i(1,c.ILogService),i(2,c.IOptionsService)],d)},9074:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;let r=n(8055),i=n(8460),a=n(844),o=n(6106),s=0,c=0;class l extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new i.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new i.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;let t=new u(e);if(t){let e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,(t=>{s=t.options.x??0,c=s+(t.options.width??1),e>=s&&e<c&&(!n||(t.options.layer??`bottom`)===n)&&r(t)}))}}t.DecorationService=l;class u extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new i.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new i.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=n(2585),i=n(8343);class a{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=a,t.InstantiationService=class{constructor(){this._services=new a,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=(0,i.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(n)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}}},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(844),o=n(2585),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},7302:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;let r=n(8460),i=n(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`courier-new, courier, monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n(6114).isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRulerWidth:0};let a=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`];class o extends i.Disposable{constructor(e){super(),this._onOptionChange=this.register(new r.EventEmitter),this.onOptionChange=this._onOptionChange.event;let n=Object.assign({},t.DEFAULT_OPTIONS);for(let t in e)if(t in n)try{let r=e[t];n[t]=this._sanitizeAndValidateOption(t,r)}catch(e){console.error(e)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(e,t){return this.onOptionChange((n=>{n===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((n=>{e.indexOf(n)!==-1&&t()}))}_setupOptions(){let e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},n=(e,n)=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);n=this._sanitizeAndValidateOption(e,n),this.rawOptions[e]!==n&&(this.rawOptions[e]=n,this._onOptionChange.fire(e))};for(let t in this.rawOptions){let r={get:e.bind(this,t),set:n.bind(this,t)};Object.defineProperty(this.options,t,r)}}_sanitizeAndValidateOption(e,n){switch(e){case`cursorStyle`:if(n||=t.DEFAULT_OPTIONS[e],!function(e){return e===`block`||e===`underline`||e===`bar`}(n))throw Error(`"${n}" is not a valid value for ${e}`);break;case`wordSeparator`:n||=t.DEFAULT_OPTIONS[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof n==`number`&&1<=n&&n<=1e3)break;n=a.includes(n)?n:t.DEFAULT_OPTIONS[e];break;case`cursorWidth`:n=Math.floor(n);case`lineHeight`:case`tabStopWidth`:if(n<1)throw Error(`${e} cannot be less than 1, value: ${n}`);break;case`minimumContrastRatio`:n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case`scrollback`:if((n=Math.min(n,4294967295))<0)throw Error(`${e} cannot be less than 0, value: ${n}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(n<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${n}`);break;case`rows`:case`cols`:if(!n&&n!==0)throw Error(`${e} must be numeric, value: ${n}`);break;case`windowsPty`:n??={}}return n}}t.OptionsService=o},2660:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;let a=n(2585),o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(r,n))),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(o,a))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every((e=>e.line!==t))){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(n,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=r([i(0,a.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(8343);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)},1480:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;let r=n(8460),i=n(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;let e=new i.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=e.length;for(let r=0;r<n;++r){let i=e.charCodeAt(r);if(55296<=i&&i<=56319){if(++r>=n)return t+this.wcwidth(i);let a=e.charCodeAt(r);56320<=a&&a<=57343?i=1024*(i-55296)+a-56320+65536:t+=this.wcwidth(a)}t+=this.wcwidth(i)}return t}}}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;let t=n(9042),i=n(3236),a=n(844),o=n(5741),s=n(8285),c=n(7975),l=n(7090),u=[`cols`,`rows`];class d extends a.Disposable{constructor(e){super(),this._core=this.register(new i.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions=Object.assign({},this._core.options);let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(u.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new c.ParserApi(this._core),this._parser}get unicode(){return this._checkProposedApi(),new l.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this.register(new s.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
20
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return t}_verifyIntegers(...e){for(let t of e)if(t===1/0||isNaN(t)||t%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(let t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw Error(`This API only accepts positive integers`)}}e.Terminal=d})(),r})()))})),qo=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.FitAddon=r():n.FitAddon=r()})(self,(()=>(()=>{var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core,t=e._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let n=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue(`height`)),a=Math.max(0,parseInt(r.getPropertyValue(`width`))),o=window.getComputedStyle(this._terminal.element),s=i-(parseInt(o.getPropertyValue(`padding-top`))+parseInt(o.getPropertyValue(`padding-bottom`))),c=a-(parseInt(o.getPropertyValue(`padding-right`))+parseInt(o.getPropertyValue(`padding-left`)))-n;return{cols:Math.max(2,Math.floor(c/t.css.cell.width)),rows:Math.max(1,Math.floor(s/t.css.cell.height))}}}})(),e})()))})),Jo=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.WebLinksAddon=r():n.WebLinksAddon=r()})(self,(()=>(()=>{var e={6:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let r=n.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e)))}};class n{static computeLink(e,t,r,i){let a=new RegExp(t.source,(t.flags||``)+`g`),[o,s]=n._getWindowedLineStrings(e-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let e=l[0];try{let t=new URL(e),n=decodeURI(t.toString());if(e!==n&&e+`/`!==n)continue}catch{continue}let[t,a]=n._mapStrIdx(r,s,0,l.index),[o,c]=n._mapStrIdx(r,t,a,e.length);if(t===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:t+1},end:{x:c,y:o+1}};u.push({range:d,text:e,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}}t.LinkComputer=n}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;let t=n(6),i=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function a(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}e.WebLinksAddon=class{constructor(e=a,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let n=this._options,r=n.urlRegex||i;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,r,this._handler,n))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}}})(),r})()))})),Yo=Ko(),Xo=qo(),Zo=Jo(),Qo=lr(`inline-flex items-center rounded-sm border px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] transition-colors`,{variants:{variant:{default:`border-transparent bg-[var(--accent-sky)] text-[var(--bg-sunken)]`,secondary:`border-transparent bg-[var(--bg-sunken)] text-[var(--fg-muted)]`,destructive:`border-[var(--severity-blocking-border)] bg-[var(--severity-blocking-bg)] text-[var(--severity-blocking-fg)]`,warning:`border-[var(--severity-warning-border)] bg-[var(--severity-warning-bg)] text-[var(--severity-warning-fg)]`,success:`border-[var(--severity-success-border)] bg-[var(--severity-success-bg)] text-[var(--severity-success-fg)]`,outline:`border-[var(--border)] bg-transparent text-[var(--fg)]`,pill:`rounded-full border-[var(--wane)] bg-transparent text-[var(--wane)] normal-case tracking-[0.12em] px-1.5`}},defaultVariants:{variant:`default`}});function q({className:e,variant:t,...n}){return(0,L.jsx)(`span`,{className:H(Qo({variant:t}),e),...n})}function $o({agentGated:e=!1}={}){let t=(0,I.useRef)(null),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null);(0,I.useEffect)(()=>{if(!t.current)return;let e=!1,n=null,i=null,o=null,c=window.location.protocol===`https:`?`wss`:`ws`,u=new WebSocket(`${c}://${window.location.host}/api/agent/ws`),d=()=>{if(i||!t.current)return i;let r=new Yo.Terminal({fontFamily:`"JetBrains Mono", ui-monospace, Menlo, monospace`,fontSize:13,lineHeight:1.3,letterSpacing:0,theme:{background:`#070d18`,foreground:`#f2f7fc`,cursor:`#dcb866`,selectionBackground:`#1f3a66`,black:`#0c1628`,red:`#a85a5a`,green:`#6a9b8f`,yellow:`#dcb866`,blue:`#7aa7dc`,magenta:`#7a6db0`,cyan:`#a8c8ea`,white:`#a4b0c2`,brightBlack:`#33394a`,brightRed:`#c87a7a`,brightGreen:`#8abbaf`,brightYellow:`#ead08e`,brightBlue:`#a8c8ea`,brightMagenta:`#9a8dd0`,brightCyan:`#cbdef3`,brightWhite:`#f2f7fc`},convertEol:!0,scrollback:5e3,allowProposedApi:!0}),a=new Xo.FitAddon;r.loadAddon(a),r.loadAddon(new Zo.WebLinksAddon),r.open(t.current);let s=()=>{if(!(e||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{a.fit()}catch{}};return n=window.requestAnimationFrame(s),o=new ResizeObserver(()=>{s()}),o.observe(t.current),r.onData(e=>{u.readyState===WebSocket.OPEN&&u.send(JSON.stringify({kind:`input`,data:e}))}),r.onResize(({cols:e,rows:t})=>{u.readyState===WebSocket.OPEN&&u.send(JSON.stringify({kind:`resize`,cols:e,rows:t}))}),i=r,r};return u.onopen=()=>{a(!0),d()},u.onclose=()=>a(!1),u.onerror=()=>a(!1),u.onmessage=e=>{try{let t=JSON.parse(e.data);t.kind===`data`&&typeof t.data==`string`?i?.write(t.data):t.kind===`meta`?(r({active:!!t.autoMode,reason:t.reason??``}),typeof t.agentReady==`boolean`&&s(t.agentReady)):t.kind===`auth_url`&&typeof t.url==`string`||(t.kind===`error`?t.recoverable&&t.remediation?l({message:t.message??`agent failed to start`,remediation:t.remediation}):i?.write(`\r\n\x1b[31m[error] ${t.message??`unknown error`}\x1b[0m\r\n`):t.kind===`exit`&&i?.write(`\r
21
+ \x1B[33m[claude session exited]\x1B[0m\r
22
+ `))}catch{}},()=>{e=!0,n!==null&&window.cancelAnimationFrame(n),u.close(),o?.disconnect(),i?.dispose()}},[]);let u=e&&!o;return(0,L.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-[var(--bg-sunken)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2`,children:[(0,L.jsx)(`span`,{className:H(`font-mono text-[11px] tracking-[0.05em]`,i?`text-[var(--vow-green)]`:`text-[var(--fg-dim)]`),children:i?`● connected`:`○ disconnected`}),n&&(0,L.jsx)(q,{variant:n.active?`warning`:`secondary`,title:n.active?`Claude Code Auto Mode is active`:n.reason,children:n.active?`Auto Mode`:`Default permissions`})]}),c&&(0,L.jsxs)(no,{variant:`blocking`,className:`m-3 flex flex-col gap-2`,children:[(0,L.jsx)(ro,{className:`text-[var(--break-red)]`,children:`Agent panel unavailable`}),(0,L.jsx)(K,{className:`font-mono text-xs text-[var(--fg-muted)]`,children:c.message}),c.remediation&&(0,L.jsxs)(`p`,{className:`font-mono text-xs text-[var(--fg-dim)]`,children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-muted)]`,children:`Fix · `}),c.remediation]})]}),(0,L.jsx)(`div`,{ref:t,className:H(`w-full flex-1 bg-[var(--bg-sunken)] p-3`,`min-h-[400px]`,u&&`invisible hidden`)}),u&&!c&&(0,L.jsx)(es,{})]})}function es(){return(0,L.jsx)(`div`,{className:`flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6`,children:(0,L.jsxs)(`div`,{className:`flex max-w-[34ch] flex-col items-center gap-4 text-center`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]`}),(0,L.jsx)(`p`,{className:`font-mono text-xs text-[var(--fg-muted)]`,children:`The agent will come online once harness setup is complete.`})]})})}var ts={pluginBuilderUi:!1,embeddedAgent:!1};function ns(){let e=typeof window>`u`?void 0:window.__JINN_FEATURES__;return!e||typeof e!=`object`?ts:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function rs({envelope:e,chainExplorerBase:t}){let n=os(e),r=ss(e.generatedAt),[i,a]=(0,I.useState)(`idle`),[o,s]=(0,I.useState)(null),c=e.details,l=(typeof c?.category==`string`?c.category:void 0)===`insufficient_funds`,u=typeof c?.address==`string`?c.address:null,d=typeof c?.requiredWei==`string`?c.requiredWei:typeof c?.needWei==`string`?c.needWei:null,f=typeof c?.haveWei==`string`?c.haveWei:null,p=(typeof c?.txHash==`string`?c.txHash:null)??n,m=(0,I.useCallback)(async()=>{a(`retrying`),s(null);try{await z.retryBootstrap(),a(`success`)}catch(e){a(`error`),s(e instanceof Error?e.message:String(e))}},[]);return(0,L.jsxs)(no,{variant:`blocking`,className:`flex flex-col gap-3 px-5 py-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,L.jsxs)(ro,{className:`text-[var(--break-red)]`,children:[`Bootstrap halted · `,e.code]}),r&&(0,L.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--fg-dim)]`,children:r})]}),(0,L.jsx)(K,{className:`break-words font-mono text-xs text-foreground`,children:e.message}),l&&u&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(is,{label:`Send ETH to`,children:u}),d&&(0,L.jsx)(is,{label:`Required`,children:as(d)}),f&&(0,L.jsx)(is,{label:`Currently have`,children:as(f)}),d&&f&&(0,L.jsx)(is,{label:`Shortfall`,children:as((BigInt(d)-BigInt(f)).toString())})]}),!l&&e.hint&&(0,L.jsxs)(`p`,{className:`font-mono text-xs text-[var(--fg-muted)]`,children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`Fix · `}),e.hint]}),p&&(0,L.jsx)(U,{asChild:!0,variant:`link`,size:`sm`,className:`self-start px-0`,children:(0,L.jsxs)(`a`,{href:`${t}/tx/${p}`,target:`_blank`,rel:`noopener noreferrer`,children:[`view failed tx`,(0,L.jsx)(An,{})]})}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-3`,children:[(0,L.jsx)(U,{variant:`destructive`,size:`sm`,type:`button`,onClick:()=>{m()},disabled:i===`retrying`,children:i===`retrying`?`Retrying…`:i===`success`?`Resuming…`:`Retry`}),i===`success`&&(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--fg-muted)]`,children:`Daemon resumed — waiting for bootstrap to complete`}),i===`error`&&o&&(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--break-red)]`,children:o})]}),i===`idle`&&(0,L.jsxs)(`p`,{className:`font-mono text-[11px] text-[var(--fg-dim)]`,children:[`Once you've addressed the cause above, click Retry or`,` `,(0,L.jsx)(`code`,{className:`text-[var(--fg-muted)]`,children:`jinn run`}),` to resume from the persisted state.`]})]})}function is({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(`span`,{className:`break-all font-mono text-[11px] text-foreground`,children:t})]})}function as(e){try{let t=BigInt(e),n=Number(t)/0xde0b6b3a7640000;return n===0?`0 ETH`:n<1e-6?`${t} wei`:`${n.toFixed(6).replace(/\.?0+$/,``)} ETH`}catch{return e}}function os(e){let t=[e.details?.txHash,e.details?.cause,e.message];for(let e of t){if(typeof e!=`string`)continue;let t=/(0x[a-fA-F0-9]{64})/.exec(e);if(t)return t[1]}return null}function ss(e){try{let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;let n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);return r<60?`${r}m ago`:`${Math.round(r/60)}h ago`}catch{return null}}function cs(e,t=globalThis?.document){let n=oa(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ls=`DismissableLayer`,us=`dismissableLayer.update`,ds=`dismissableLayer.pointerDownOutside`,fs=`dismissableLayer.focusOutside`,ps,ms=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hs=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(ms),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=qn(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=vs(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ys(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return cs(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ps=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),bs(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ps)}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),bs())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(us,e),()=>document.removeEventListener(us,e)},[]),(0,L.jsx)(Yi.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:G(e.onFocusCapture,S.onFocusCapture),onBlurCapture:G(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,x.onPointerDownCapture)})});hs.displayName=ls;var gs=`DismissableLayerBranch`,_s=I.forwardRef((e,t)=>{let n=I.useContext(ms),r=I.useRef(null),i=qn(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,L.jsx)(Yi.div,{...e,ref:i})});_s.displayName=gs;function vs(e,t=globalThis?.document){let n=oa(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){xs(ds,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ys(e,t=globalThis?.document){let n=oa(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&xs(fs,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bs(){let e=new CustomEvent(us);document.dispatchEvent(e)}function xs(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xi(i,a):i.dispatchEvent(a)}var Ss=I.useId||(()=>void 0),Cs=0;function ws(e){let[t,n]=I.useState(Ss());return Zi(()=>{e||n(e=>e??String(Cs++))},[e]),e||(t?`radix-${t}`:``)}var Ts=[`top`,`right`,`bottom`,`left`],Es=Math.min,Ds=Math.max,Os=Math.round,ks=Math.floor,As=e=>({x:e,y:e}),js={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ms(e,t,n){return Ds(e,Es(t,n))}function Ns(e,t){return typeof e==`function`?e(t):e}function Ps(e){return e.split(`-`)[0]}function Fs(e){return e.split(`-`)[1]}function Is(e){return e===`x`?`y`:`x`}function Ls(e){return e===`y`?`height`:`width`}function Rs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function zs(e){return Is(Rs(e))}function Bs(e,t,n){n===void 0&&(n=!1);let r=Fs(e),i=zs(e),a=Ls(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ys(o)),[o,Ys(o)]}function Vs(e){let t=Ys(e);return[Hs(e),t,Hs(t)]}function Hs(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Us=[`left`,`right`],Ws=[`right`,`left`],Gs=[`top`,`bottom`],Ks=[`bottom`,`top`];function qs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ws:Us:t?Us:Ws;case`left`:case`right`:return t?Gs:Ks;default:return[]}}function Js(e,t,n,r){let i=Fs(e),a=qs(Ps(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Hs)))),a}function Ys(e){let t=Ps(e);return js[t]+e.slice(t.length)}function Xs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Xs(e)}function Qs(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function $s(e,t,n){let{reference:r,floating:i}=e,a=Rs(t),o=zs(t),s=Ls(o),c=Ps(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Fs(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ec(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ns(t,e),p=Zs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Qs(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Qs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var tc=50,nc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ec},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$s(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<tc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=$s(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ns(e,t)||{};if(l==null)return{};let d=Zs(u),f={x:n,y:r},p=zs(i),m=Ls(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Es(d[_],T),D=Es(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,k=Ms(O,te,ee),A=!c.arrow&&Fs(i)!=null&&te!==k&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,j=A?te<O?te-O:te-ee:0;return{[p]:f[p]+j,data:{[p]:k,centerOffset:te-k-j,...A&&{alignmentOffset:j}},reset:A}}}),ic=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ns(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ps(r),_=Rs(o),v=Ps(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ys(o)]:Vs(o)),x=p!==`none`;!d&&x&&b.push(...Js(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Bs(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Rs(t))||T.every(e=>Rs(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Rs(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ac(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oc(e){return Ts.some(t=>e[t]>=0)}var sc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ns(e,t);switch(i){case`referenceHidden`:{let e=ac(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oc(e)}}}case`escaped`:{let e=ac(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oc(e)}}}default:return{}}}}},cc=new Set([`left`,`top`]);async function lc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ps(n),s=Fs(n),c=Rs(n)===`y`,l=cc.has(o)?-1:1,u=a&&c?-1:1,d=Ns(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var uc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await lc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},dc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ns(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Rs(Ps(i)),p=Is(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ms(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ms(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},fc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ns(e,t),u={x:n,y:r},d=Rs(i),f=Is(d),p=u[f],m=u[d],h=Ns(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=cc.has(Ps(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ns(e,t),u=await o.detectOverflow(t,l),d=Ps(i),f=Fs(i),p=Rs(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Es(h-u[g],v),x=Es(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ds(u.left,0),t=Ds(u.right,0),n=Ds(u.top,0),r=Ds(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ds(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ds(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function mc(){return typeof window<`u`}function hc(e){return vc(e)?(e.nodeName||``).toLowerCase():`#document`}function gc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _c(e){return((vc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function vc(e){return mc()?e instanceof Node||e instanceof gc(e).Node:!1}function yc(e){return mc()?e instanceof Element||e instanceof gc(e).Element:!1}function bc(e){return mc()?e instanceof HTMLElement||e instanceof gc(e).HTMLElement:!1}function xc(e){return!mc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof gc(e).ShadowRoot}function Sc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Nc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cc(e){return/^(table|td|th)$/.test(hc(e))}function wc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Tc=/transform|translate|scale|rotate|perspective|filter/,Ec=/paint|layout|strict|content/,Dc=e=>!!e&&e!==`none`,Oc;function kc(e){let t=yc(e)?Nc(e):e;return Dc(t.transform)||Dc(t.translate)||Dc(t.scale)||Dc(t.rotate)||Dc(t.perspective)||!jc()&&(Dc(t.backdropFilter)||Dc(t.filter))||Tc.test(t.willChange||``)||Ec.test(t.contain||``)}function Ac(e){let t=Fc(e);for(;bc(t)&&!Mc(t);){if(kc(t))return t;if(wc(t))return null;t=Fc(t)}return null}function jc(){return Oc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Oc}function Mc(e){return/^(html|body|#document)$/.test(hc(e))}function Nc(e){return gc(e).getComputedStyle(e)}function Pc(e){return yc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fc(e){if(hc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xc(e)&&e.host||_c(e);return xc(t)?t.host:t}function Ic(e){let t=Fc(e);return Mc(t)?e.ownerDocument?e.ownerDocument.body:e.body:bc(t)&&Sc(t)?t:Ic(t)}function Lc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ic(e),i=r===e.ownerDocument?.body,a=gc(r);if(i){let e=Rc(a);return t.concat(a,a.visualViewport||[],Sc(r)?r:[],e&&n?Lc(e):[])}else return t.concat(r,Lc(r,[],n))}function Rc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zc(e){let t=Nc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Os(n)!==a||Os(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Bc(e){return yc(e)?e:e.contextElement}function Vc(e){let t=Bc(e);if(!bc(t))return As(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zc(t),o=(a?Os(n.width):n.width)/r,s=(a?Os(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Hc=As(0);function Uc(e){let t=gc(e);return!jc()||!t.visualViewport?Hc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gc(e)?!1:t}function Gc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bc(e),o=As(1);t&&(r?yc(r)&&(o=Vc(r)):o=Vc(e));let s=Wc(a,n,r)?Uc(a):As(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=gc(a),t=r&&yc(r)?gc(r):r,n=e,i=Rc(n);for(;i&&r&&t!==n;){let e=Vc(i),t=i.getBoundingClientRect(),r=Nc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=gc(i),i=Rc(n)}}return Qs({width:u,height:d,x:c,y:l})}function Kc(e,t){let n=Pc(e).scrollLeft;return t?t.left+n:Gc(_c(e)).left+n}function qc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kc(e,n),y:n.top+t.scrollTop}}function Jc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=_c(r),s=t?wc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=As(1),u=As(0),d=bc(r);if((d||!d&&!a)&&((hc(r)!==`body`||Sc(o))&&(c=Pc(r)),d)){let e=Gc(r);l=Vc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qc(o,c):As(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Yc(e){return Array.from(e.getClientRects())}function Xc(e){let t=_c(e),n=Pc(e),r=e.ownerDocument.body,i=Ds(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ds(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Kc(e),s=-n.scrollTop;return Nc(r).direction===`rtl`&&(o+=Ds(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Zc=25;function Qc(e,t){let n=gc(e),r=_c(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=jc();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Kc(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Zc&&(a-=o)}else l<=Zc&&(a+=l);return{width:a,height:o,x:s,y:c}}function $c(e,t){let n=Gc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bc(e)?Vc(e):As(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function el(e,t,n){let r;if(t===`viewport`)r=Qc(e,n);else if(t===`document`)r=Xc(_c(e));else if(yc(t))r=$c(t,n);else{let n=Uc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qs(r)}function tl(e,t){let n=Fc(e);return n===t||!yc(n)||Mc(n)?!1:Nc(n).position===`fixed`||tl(n,t)}function nl(e,t){let n=t.get(e);if(n)return n;let r=Lc(e,[],!1).filter(e=>yc(e)&&hc(e)!==`body`),i=null,a=Nc(e).position===`fixed`,o=a?Fc(e):e;for(;yc(o)&&!Mc(o);){let t=Nc(o),n=kc(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Sc(o)&&!n&&tl(e,o))?r=r.filter(e=>e!==o):i=t,o=Fc(o)}return t.set(e,r),r}function rl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?wc(t)?[]:nl(t,this._c):[].concat(n),r],o=el(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=el(t,a[e],i);s=Ds(n.top,s),c=Es(n.right,c),l=Es(n.bottom,l),u=Ds(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function il(e){let{width:t,height:n}=zc(e);return{width:t,height:n}}function al(e,t,n){let r=bc(t),i=_c(t),a=n===`fixed`,o=Gc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=As(0);function l(){c.x=Kc(i)}if(r||!r&&!a)if((hc(t)!==`body`||Sc(i))&&(s=Pc(t)),r){let e=Gc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?qc(i,s):As(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ol(e){return Nc(e).position===`static`}function sl(e,t){if(!bc(e)||Nc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return _c(e)===n&&(n=n.ownerDocument.body),n}function cl(e,t){let n=gc(e);if(wc(e))return n;if(!bc(e)){let t=Fc(e);for(;t&&!Mc(t);){if(yc(t)&&!ol(t))return t;t=Fc(t)}return n}let r=sl(e,t);for(;r&&Cc(r)&&ol(r);)r=sl(r,t);return r&&Mc(r)&&ol(r)&&!kc(r)?n:r||Ac(e)||n}var ll=async function(e){let t=this.getOffsetParent||cl,n=this.getDimensions,r=await n(e.floating);return{reference:al(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ul(e){return Nc(e).direction===`rtl`}var dl={convertOffsetParentRelativeRectToViewportRelativeRect:Jc,getDocumentElement:_c,getClippingRect:rl,getOffsetParent:cl,getElementRects:ll,getClientRects:Yc,getDimensions:il,getScale:Vc,isElement:yc,isRTL:ul};function fl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pl(e,t){let n=null,r,i=_c(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ks(d),h=ks(i.clientWidth-(u+f)),g=ks(i.clientHeight-(d+p)),_=ks(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ds(0,Es(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!fl(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ml(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Bc(e),u=i||a?[...l?Lc(l):[],...t?Lc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?pl(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Gc(e):null;c&&g();function g(){let t=Gc(e);h&&!fl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var hl=uc,gl=dc,_l=ic,vl=pc,yl=sc,bl=rc,xl=fc,Sl=(e,t,n)=>{let r=new Map,i={platform:dl,...n},a={...i.platform,_c:r};return nc(e,t,{...i,platform:a})},Cl=typeof document<`u`?I.useLayoutEffect:function(){};function wl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!wl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Tl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function El(e,t){let n=Tl(e);return Math.round(t*n)/n}function Dl(e){let t=I.useRef(e);return Cl(()=>{t.current=e}),t}function Ol(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);wl(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=Dl(c),D=Dl(i),O=Dl(l),ee=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Sl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};te.current&&!wl(w.current,t)&&(w.current=t,Hi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Cl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=I.useRef(!1);Cl(()=>(te.current=!0,()=>{te.current=!1}),[]),Cl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let k=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=I.useMemo(()=>({reference:b,floating:x}),[b,x]),j=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=El(A.floating,u.x),r=El(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Tl(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:ee,refs:k,elements:A,floatingStyles:j}),[u,ee,k,A,j])}var kl=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:bl({element:r.current,padding:i}).fn(n):r?bl({element:r,padding:i}).fn(n):{}}}},Al=(e,t)=>{let n=hl(e);return{name:n.name,fn:n.fn,options:[e,t]}},jl=(e,t)=>{let n=gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ml=(e,t)=>({fn:xl(e).fn,options:[e,t]}),Nl=(e,t)=>{let n=_l(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pl=(e,t)=>{let n=vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fl=(e,t)=>{let n=yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Il=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ll=`Arrow`,Rl=I.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Yi.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Rl.displayName=Ll;var zl=Rl;function Bl(e){let[t,n]=I.useState(void 0);return Zi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Vl=`Popper`,[Hl,Ul]=ia(Vl),[Wl,Gl]=Hl(Vl),Kl=e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return(0,L.jsx)(Wl,{scope:t,anchor:r,onAnchorChange:i,children:n})};Kl.displayName=Vl;var ql=`PopperAnchor`,Jl=I.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Gl(ql,n),o=I.useRef(null),s=qn(t,o),c=I.useRef(null);return I.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(Yi.div,{...i,ref:s})});Jl.displayName=ql;var Yl=`PopperContent`,[Xl,Zl]=Hl(Yl),Ql=I.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Gl(Yl,n),[_,v]=I.useState(null),y=qn(t,e=>v(e)),[b,x]=I.useState(null),S=Bl(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,ee={padding:E,boundary:D.filter(nu),altBoundary:O},{refs:te,floatingStyles:k,placement:A,isPositioned:j,middlewareData:M}=Ol({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>ml(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Al({mainAxis:i+w,alignmentAxis:o}),c&&jl({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Ml():void 0,...ee}),c&&Nl({...ee}),Pl({...ee,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Il({element:b,padding:s}),ru({arrowWidth:C,arrowHeight:w}),f&&Fl({strategy:`referenceHidden`,...ee})]}),[ne,N]=iu(A),P=oa(m);Zi(()=>{j&&P?.()},[j,P]);let re=M.arrow?.x,ie=M.arrow?.y,ae=M.arrow?.centerOffset!==0,[oe,F]=I.useState();return Zi(()=>{_&&F(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...k,transform:j?k.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Xl,{scope:n,placedSide:ne,onArrowChange:x,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,L.jsx)(Yi.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:j?void 0:`none`}})})})});Ql.displayName=Yl;var $l=`PopperArrow`,eu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},tu=I.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Zl($l,n),a=eu[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(zl,{...r,ref:t,style:{...r.style,display:`block`}})})});tu.displayName=$l;function nu(e){return e!==null}var ru=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=iu(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function iu(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var au=Kl,ou=Jl,su=Ql,cu=tu,lu=`Portal`,uu=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);Zi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Hi.createPortal((0,L.jsx)(Yi.div,{...r,ref:t}),o):null});uu.displayName=lu;var du=Symbol(`radix.slottable`);function fu(e){let t=({children:e})=>(0,L.jsx)(L.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=du,t}var pu=I.useInsertionEffect||Zi;function mu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=hu({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=gu(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function hu({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return pu(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function gu(e){return typeof e==`function`}var _u=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vu=`VisuallyHidden`,yu=I.forwardRef((e,t)=>(0,L.jsx)(Yi.span,{...e,ref:t,style:{..._u,...e.style}}));yu.displayName=vu;var bu=yu,[xu,Su]=ia(`Tooltip`,[Ul]),Cu=Ul(),wu=`TooltipProvider`,Tu=700,Eu=`tooltip.open`,[Du,Ou]=xu(wu),ku=e=>{let{__scopeTooltip:t,delayDuration:n=Tu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(Du,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};ku.displayName=wu;var Au=`Tooltip`,[ju,Mu]=xu(Au),Nu=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Ou(Au,e.__scopeTooltip),l=Cu(t),[u,d]=I.useState(null),f=ws(),p=I.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=I.useRef(!1),[_,v]=mu({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Eu))):c.onClose(),a?.(e)},caller:Au}),y=I.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=I.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return I.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,L.jsx)(au,{...l,children:(0,L.jsx)(ju,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:I.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};Nu.displayName=Au;var Pu=`TooltipTrigger`,Fu=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Mu(Pu,n),a=Ou(Pu,n),o=Cu(n),s=qn(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(ou,{asChild:!0,...o,children:(0,L.jsx)(Yi.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:G(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:G(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:G(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:G(e.onBlur,i.onClose),onClick:G(e.onClick,i.onClose)})})});Fu.displayName=Pu;var Iu=`TooltipPortal`,[Lu,Ru]=xu(Iu,{forceMount:void 0}),zu=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Mu(Iu,t);return(0,L.jsx)(Lu,{scope:t,forceMount:n,children:(0,L.jsx)($i,{present:n||a.open,children:(0,L.jsx)(uu,{asChild:!0,container:i,children:r})})})};zu.displayName=Iu;var Bu=`TooltipContent`,Vu=I.forwardRef((e,t)=>{let n=Ru(Bu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Mu(Bu,e.__scopeTooltip);return(0,L.jsx)($i,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Ku,{side:i,...a,ref:t}):(0,L.jsx)(Hu,{side:i,...a,ref:t})})}),Hu=I.forwardRef((e,t)=>{let n=Mu(Bu,e.__scopeTooltip),r=Ou(Bu,e.__scopeTooltip),i=I.useRef(null),a=qn(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Xu(r,Yu(r,n.getBoundingClientRect())),a=Zu(t.getBoundingClientRect());s($u([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Qu(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Ku,{...e,ref:a})}),[Uu,Wu]=xu(Au,{isInside:!1}),Gu=fu(`TooltipContent`),Ku=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Mu(Bu,n),l=Cu(n),{onClose:u}=c;return I.useEffect(()=>(document.addEventListener(Eu,u),()=>document.removeEventListener(Eu,u)),[u]),I.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,L.jsx)(hs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,L.jsxs)(su,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(Gu,{children:r}),(0,L.jsx)(Uu,{scope:n,isInside:!0,children:(0,L.jsx)(bu,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Vu.displayName=Bu;var qu=`TooltipArrow`,Ju=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Cu(n);return Wu(qu,n).isInside?null:(0,L.jsx)(cu,{...i,...r,ref:t})});Ju.displayName=qu;function Yu(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Xu(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Zu(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Qu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $u(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ed(t)}function ed(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var td=ku,nd=Nu,rd=Fu,id=zu,ad=Vu,od=td,sd=nd,cd=rd,ld=I.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(id,{children:(0,L.jsx)(ad,{ref:r,sideOffset:t,className:H(`z-50 overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1.5 font-mono text-[11px] text-popover-foreground shadow-md`,`data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));ld.displayName=ad.displayName;function ud({chain:e}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(q,{variant:e===`base`?`secondary`:`outline`,children:`Testnet`}),(0,L.jsx)(od,{delayDuration:120,children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`span`,{children:(0,L.jsx)(q,{variant:`secondary`,className:`border-dashed border-border opacity-60`,children:`Mainnet · soon`})})}),(0,L.jsx)(ld,{children:`Mainnet support is coming. v1 supports testnet only.`})]})})]})}function dd({status:e}){return e===`done`?(0,L.jsxs)(q,{variant:`success`,className:`gap-1.5`,children:[(0,L.jsx)(Tn,{className:`h-3 w-3`}),`Done`]}):e===`error`?(0,L.jsxs)(q,{variant:`destructive`,className:`gap-1.5`,children:[(0,L.jsx)(Hn,{className:`h-3 w-3`}),`Failed`]}):e===`active`?(0,L.jsxs)(q,{variant:`warning`,className:`gap-2`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]`}),`Active`]}):(0,L.jsx)(q,{variant:`secondary`,children:`Queued`})}var fd={1:`Provisioning your wallet`,2:`Fund your wallet`,3:`Joining Jinn`,4:`Pick your first SolverNet`,5:`Set up harness + model`};function pd({phase:e,status:t,children:n}){let r=t===`active`,i=t===`error`,a=t===`done`,o=r||i,s=i?`text-[var(--break-red)]`:r?`text-[var(--accent-gold)]`:a?`text-[var(--accent-sky)]`:`text-[var(--fg-dim)]`,c=i||r?`text-foreground`:a?`text-[var(--fg-muted)]`:`text-[var(--fg-dim)]`,l=o?`font-serif text-[28px] leading-[1.2]`:`font-mono text-[14px] leading-[1.2]`;return(0,L.jsxs)(`li`,{className:`phase-row border-t border-border`,"data-status":t,"data-testid":`onboarding-phase-${e}`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4`,children:[(0,L.jsx)(`span`,{className:H(`font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200`,s),children:String(e).padStart(2,`0`)}),(0,L.jsx)(`span`,{className:H(l,c,`transition-colors duration-200`),children:fd[e]}),(0,L.jsx)(dd,{status:t})]}),o&&n&&(0,L.jsx)(`div`,{className:`jinn-anim-fade-slide ml-12 pb-5 pr-2`,children:n})]})}function md({label:e,step:t,serviceIndex:n,serviceId:r,safeAddress:i,explorer:a,contractRevertReason:o}){let s=!!o;return(0,L.jsxs)(`div`,{className:H(`flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3`,s?`border-[var(--break-red)]`:`border-border`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:H(`jinn-anim-pulse h-1.5 w-1.5 rounded-full`,s?`bg-[var(--break-red)]`:`bg-[var(--accent-sky)]`)}),(0,L.jsx)(`span`,{className:`font-mono text-sm text-foreground`,children:e}),(0,L.jsx)(`span`,{className:H(`ml-auto font-mono text-[10px]`,s?`text-[var(--break-red)]`:`text-[var(--fg-dim)]`),children:s?`binding failed · will retry`:`running · no action needed`})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-1 font-mono text-[11px] text-[var(--fg-muted)] md:grid-cols-[120px_1fr]`,children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`Current step`}),(0,L.jsx)(`span`,{children:hd(t)}),n!==void 0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`Service`}),(0,L.jsxs)(`span`,{children:[`#`,n,r===void 0?``:` · id ${r}`]})]}),i&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`Safe`}),(0,L.jsx)(`a`,{href:`${a}/address/${i}`,target:`_blank`,rel:`noopener noreferrer`,className:`break-all text-[var(--accent-sky)] hover:underline`,children:i})]}),o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`Contract revert reason`}),(0,L.jsx)(`code`,{className:`break-words text-xs text-[var(--break-red)]`,children:o})]})]})]})}function hd(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var gd=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,className:H(`animate-pulse rounded-md bg-muted`,e),...t}));gd.displayName=`Skeleton`;var _d=`swe-rebench-v2`,vd=new Set([`subsystem_not_ready`,`registry_unavailable`]);function yd(e){if(e&&typeof e==`object`&&`code`in e){let t=e.code;if(typeof t==`string`)return t}if(e instanceof Error&&e.message.includes(`subsystem_not_ready`))return`subsystem_not_ready`}function bd({onJoined:e,joinedCids:t}){let n=dt({queryKey:[`solvernets`,`registry`],queryFn:()=>z.solvernets.listRegistry(),refetchInterval:5e3,retry:!1}),r=n.data?.summaries.find(e=>e.contractId===_d&&e.status===`launched`),i=r?.manifestCid,a=i!==void 0&&t.includes(i),o=ft({mutationFn:async()=>{if(!r)throw Error(`no swe-rebench-v2 registry entry`);return z.operator.join(r.manifestCid,{name:r.name,contract:{id:r.contractId,version:r.contractVersion},roles:[`solver`]})},onSuccess:()=>{r&&e(r.manifestCid)}});if(n.isLoading)return(0,L.jsxs)(`div`,{"data-testid":`onboarding-solvernet-loading`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(gd,{className:`h-6 w-48`}),(0,L.jsx)(gd,{className:`h-24 w-full`})]});let s=n.isError?yd(n.error):void 0;return n.isError&&!vd.has(s??``)?(0,L.jsxs)(no,{variant:`blocking`,"data-testid":`onboarding-solvernet-error`,children:[(0,L.jsx)(ro,{children:`Could not load SolverNets.`}),(0,L.jsx)(K,{children:`The daemon could not read the SolverNet registry. Retry once startup finishes; check daemon logs if it keeps failing.`})]}):r?(0,L.jsxs)(W,{"data-testid":`onboarding-solvernet-card`,"data-manifest-cid":r.manifestCid,children:[(0,L.jsxs)(Li,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(Ri,{className:`font-mono text-[15px]`,children:r.name}),a?(0,L.jsx)(q,{"data-testid":`onboarding-solvernet-joined`,children:`Joined`}):(0,L.jsx)(q,{variant:`secondary`,children:`Recommended`})]}),(0,L.jsx)(zi,{children:`Pick your first SolverNet; add more later.`})]}),(0,L.jsxs)(Bi,{className:`flex items-center justify-between gap-4`,children:[(0,L.jsx)(`p`,{className:`text-sm text-[var(--fg-muted)]`,children:`Solve coding tasks; your node claims and submits solutions.`}),!a&&(0,L.jsx)(U,{"data-testid":`onboarding-solvernet-join`,onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?`Joining…`:`Join`})]})]}):(0,L.jsxs)(`div`,{"data-testid":`onboarding-solvernet-starting`,className:`flex items-center gap-3 font-mono text-[12px] text-[var(--fg-muted)]`,children:[(0,L.jsx)(gd,{className:`h-4 w-4 rounded-full`}),`Finding your first SolverNet…`]})}var xd=`claude-code`,Sd=`codex`,Cd=`hermes-agent`,wd={"claude-code-learner":xd,"codex-code-learner":Sd},Td={[xd]:`Claude Code`,[Sd]:`Codex`,[Cd]:`Hermes Agent`,"swe-rebench-v2-evaluator":`SWE-rebench v2 Evaluator`};function Ed(e){return e?wd[e]??e:``}function Dd(e){let t=Ed(e);return Td[t]??t}function Od(e,t){let n=Dd(e);return t?`${n} ${t}`:n}function kd(e,t){return Ed(e)===Ed(t)}var Ad=[{label:`Haiku`,id:`claude-haiku-4-5-20251001`},{label:`Sonnet`,id:`claude-sonnet-4-6`},{label:`Opus`,id:`claude-opus-4-7`}],jd=[{label:`GPT-5.4 Mini`,id:`gpt-5.4-mini`},{label:`GPT-5.5`,id:`gpt-5.5`},{label:`GPT-5.4`,id:`gpt-5.4`},{label:`GPT-5.3 Codex`,id:`gpt-5.3-codex`},{label:`GPT-5.3 Codex Spark`,id:`gpt-5.3-codex-spark`}],Md=[{label:`Claude Opus 4.7 (OpenRouter)`,id:`anthropic/claude-opus-4.7`},{label:`Claude Sonnet 4.6 (OpenRouter)`,id:`anthropic/claude-sonnet-4.6`},{label:`Hy3 Preview`,id:`tencent/hy3-preview`},{label:`DeepSeek V4 Pro`,id:`deepseek/deepseek-v4-pro`},{label:`DeepSeek V4 Flash`,id:`deepseek/deepseek-v4-flash`},{label:`Gemini 3.1 Flash Lite`,id:`google/gemini-3.1-flash-lite`},{label:`Kimi K2.6`,id:`moonshotai/kimi-k2.6`},{label:`Owl Alpha`,id:`openrouter/owl-alpha`},{label:`MiniMax M2.7`,id:`minimax/minimax-m2.7`}];function Nd(e){return Ed(e)===Sd}function Pd(e){return Ed(e)===Cd}function Fd(e){return Pd(e)?Md:Nd(e)?jd:Ad}function Id(e){return Fd(e)[0].id}function Ld(e,t){let n=Fd(t).find(t=>t.id===e)??null??Ad.find(t=>t.id===e)??jd.find(t=>t.id===e)??Md.find(t=>t.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function Rd(e){let t=zd(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(Vd);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function zd(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=Ud(n),i=Hd(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bd=Symbol(`radix.slottable`);function Vd(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Bd}function Hd(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ud(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Wd(e){let t=e+`CollectionProvider`,[n,r]=ia(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Rd(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:qn(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Rd(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=qn(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Gd=`rovingFocusGroup.onEntryFocus`,Kd={bubbles:!1,cancelable:!0},qd=`RovingFocusGroup`,[Jd,Yd,Xd]=Wd(qd),[Zd,Qd]=ia(qd,[Xd]),[$d,ef]=Zd(qd),tf=I.forwardRef((e,t)=>(0,L.jsx)(Jd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Jd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(nf,{...e,ref:t})})}));tf.displayName=qd;var nf=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=qn(t,f),m=ca(a),[h,g]=mu({prop:o,defaultProp:s??null,onChange:c,caller:qd}),[_,v]=I.useState(!1),y=oa(l),b=Yd(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Gd,y),()=>e.removeEventListener(Gd,y)},[y]),(0,L.jsx)($d,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(Yi.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{x.current=!0}),onFocus:G(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Gd,Kd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);lf([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:G(e.onBlur,()=>v(!1))})})}),rf=`RovingFocusGroupItem`,af=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=ws(),l=a||c,u=ef(rf,n),d=u.currentTabStopId===l,f=Yd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return I.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,L.jsx)(Jd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Yi.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=cf(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?uf(n,r+1):n.slice(r+1)}setTimeout(()=>lf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});af.displayName=rf;var of={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function sf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function cf(e,t,n){let r=sf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return of[r]}function lf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function uf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var df=tf,ff=af;function pf(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var mf=`Radio`,[hf,gf]=ia(mf),[_f,vf]=hf(mf),yf=I.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...u}=e,[d,f]=I.useState(null),p=qn(t,e=>f(e)),m=I.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,L.jsxs)(_f,{scope:n,checked:i,disabled:o,children:[(0,L.jsx)(Yi.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":wf(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:G(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,L.jsx)(Cf,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});yf.displayName=mf;var bf=`RadioIndicator`,xf=I.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=vf(bf,n);return(0,L.jsx)($i,{present:r||a.checked,children:(0,L.jsx)(Yi.span,{"data-state":wf(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});xf.displayName=bf;var Sf=`RadioBubbleInput`,Cf=I.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=I.useRef(null),s=qn(o,a),c=pf(n),l=Bl(t);return I.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,L.jsx)(Yi.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Cf.displayName=Sf;function wf(e){return e?`checked`:`unchecked`}var Tf=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Ef=`RadioGroup`,[Df,Of]=ia(Ef,[Qd,gf]),kf=Qd(),Af=gf(),[jf,Mf]=Df(Ef),Nf=I.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=kf(n),m=ca(l),[h,g]=mu({prop:a,defaultProp:i??null,onChange:d,caller:Ef});return(0,L.jsx)(jf,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,L.jsx)(df,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,L.jsx)(Yi.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});Nf.displayName=Ef;var Pf=`RadioGroupItem`,Ff=I.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Mf(Pf,n),o=a.disabled||r,s=kf(n),c=Af(n),l=I.useRef(null),u=qn(t,l),d=a.value===i.value,f=I.useRef(!1);return I.useEffect(()=>{let e=e=>{Tf.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,L.jsx)(ff,{asChild:!0,...s,focusable:!o,active:d,children:(0,L.jsx)(yf,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:G(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:G(i.onFocus,()=>{f.current&&l.current?.click()})})})});Ff.displayName=Pf;var If=`RadioGroupIndicator`,Lf=I.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,L.jsx)(xf,{...Af(n),...r,ref:t})});Lf.displayName=If;var Rf=Nf,zf=Ff,Bf=Lf,Vf=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Rf,{className:H(`grid gap-2`,e),...t,ref:n}));Vf.displayName=Rf.displayName;var Hf=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(zf,{ref:n,className:H(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,L.jsx)(Bf,{className:`flex items-center justify-center`,children:(0,L.jsx)(Dn,{className:`h-2.5 w-2.5 fill-current text-current`})})}));Hf.displayName=zf.displayName;function Uf(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Wf(...e){return t=>{let n=!1,r=e.map(e=>{let r=Uf(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Uf(e[t],null)}}}}function Gf(...e){return I.useCallback(Wf(...e),e)}function Kf(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];$f(r)&&typeof rp==`function`&&(r=rp(r._payload)),I.Children.forEach(r,e=>{if(Zf(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;$f(n)&&typeof rp==`function`&&(n=rp(n._payload)),a=Jf(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?Xf(a):void 0,l=Gf(n,c);if(!a){if(r||r===0)throw Error(o?np(e):tp(e));return r}let u=Yf(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var qf=Symbol.for(`radix.slottable`),Jf=(e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null};function Yf(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Xf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zf(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qf}var Qf=Symbol.for(`react.lazy`);function $f(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Qf&&`_payload`in e&&ep(e._payload)}function ep(e){return typeof e==`object`&&!!e&&`then`in e}var tp=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,np=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,rp=I.use,ip=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Kf(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ap=`Label`,op=I.forwardRef((e,t)=>(0,L.jsx)(ip.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));op.displayName=ap;var sp=op,cp=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(sp,{ref:n,className:H(`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)] peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t}));cp.displayName=sp.displayName;function lp({protocol:e,node:t,machine:n}){return(0,L.jsx)(`span`,{"data-testid":`tier-dots`,className:`inline-flex items-center gap-1`,"aria-hidden":!0,children:[{id:`protocol`,active:e},{id:`node`,active:t},{id:`machine`,active:n}].map(e=>(0,L.jsx)(`span`,{"data-tier":e.id,"data-active":e.active?`true`:`false`,className:H(`size-1.5 rounded-full border border-current transition-colors`,e.active?`bg-current text-[var(--accent-sky)]`:`bg-transparent text-[var(--fg-dim)]`)},e.id))})}var up=[Sd,xd,Cd],dp=new Set([`harness_not_found`,`subsystem_not_ready`]);function fp({onSelectionChange:e}){let[t,n]=(0,I.useState)(Sd),[r,i]=(0,I.useState)(Id(Sd)),a=dt({queryKey:[`onboarding-harness-readiness`,t],refetchInterval:5e3,queryFn:async()=>{try{return await z.harnessReadiness(t)}catch(e){let t=e.code;if(t&&dp.has(t))return null;throw e}}}),o=a.data,s=o?.ready===!0,c=o?.ready===!1;(0,I.useEffect)(()=>{e({harness:t,model:r,ready:s})},[t,r,s,e]);function l(e){n(e),i(Id(e))}let u=Fd(t);return(0,L.jsxs)(W,{"data-testid":`onboarding-harness-card`,children:[(0,L.jsxs)(Li,{children:[(0,L.jsx)(Ri,{className:`font-mono text-[15px]`,children:`Harness & model`}),(0,L.jsx)(`p`,{className:`text-sm text-[var(--fg-muted)]`,children:`The harness and model your node uses for its work.`})]}),(0,L.jsxs)(Bi,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(Vf,{value:t,onValueChange:l,className:`gap-2`,children:up.map(e=>{let n=e===t,r=n?s?`Ready`:c?`Setup required`:`Checking…`:`Select to check`;return(0,L.jsxs)(`label`,{htmlFor:`onboarding-harness-${e}`,className:`flex cursor-pointer items-center gap-3 rounded-[var(--radius-2)] border border-border px-3 py-2.5`,"data-testid":`onboarding-harness-row-${e}`,children:[(0,L.jsx)(Hf,{value:e,id:`onboarding-harness-${e}`}),(0,L.jsx)(`span`,{className:`flex-1 font-mono text-[13px]`,children:Dd(e)}),(0,L.jsx)(lp,{protocol:!0,node:!0,machine:n?s:!1}),(0,L.jsx)(q,{variant:r===`Ready`?`default`:`secondary`,children:r})]},e)})}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(cp,{htmlFor:`onboarding-model-select`,className:`text-[var(--fg-muted)]`,children:`Model`}),(0,L.jsx)(`select`,{id:`onboarding-model-select`,"data-testid":`onboarding-model-select`,value:r,onChange:e=>i(e.target.value),className:`rounded-[var(--radius-1)] border border-border bg-transparent px-2 py-1.5 font-mono text-[13px]`,children:u.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),c&&(0,L.jsxs)(`div`,{"data-testid":`onboarding-harness-not-ready`,className:`flex flex-col gap-2 rounded-[var(--radius-2)] border border-[var(--break-red)] px-3 py-2.5`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-[var(--break-red)]`,children:o?.reason??`This harness needs setup before your node can use it.`}),o?.nextStep?.description&&(0,L.jsx)(`span`,{className:`text-sm text-[var(--fg-muted)]`,children:o.nextStep.description}),o?.nextStep?.cli&&(0,L.jsx)(`code`,{className:`rounded-[var(--radius-1)] bg-[var(--bg-sunken)] px-2 py-1 font-mono text-[12px]`,children:o.nextStep.cli}),(0,L.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,"data-testid":`onboarding-harness-recheck`,onClick:()=>void a.refetch(),className:`self-start`,children:`Recheck`})]})]})]})}var pp=new Set([`complete`,`safe_binding_pending`]);function mp(e){return e.mode===`running`||pp.has(e.currentStep)}var hp={wallet:{phase:1,subState:null},safe_predicted:{phase:1,subState:null},awaiting_funding:{phase:2,subState:null},safe_deployed:{phase:3,subState:`Deploying`},service_created:{phase:3,subState:`Deploying`},service_activated:{phase:3,subState:`Deploying`},agents_registered:{phase:3,subState:`Deploying`},service_deployed:{phase:3,subState:`Deploying`},service_staked:{phase:3,subState:`Deploying`},staked:{phase:3,subState:`Deploying`},mech_deployed:{phase:3,subState:`Joining the network`},agent_registered:{phase:3,subState:`Joining the network`},safe_binding_pending:{phase:3,subState:`Binding identity`}};function gp(e){return hp[e]??{phase:1,subState:null}}function _p(e,t,n){return e<t?e===2&&n===!1?`active`:`done`:e===t?`active`:`queued`}var vp=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]`;function yp(){let e=Xe(),{data:t,isLoading:n}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:2e3}),[r,i]=(0,I.useState)(null),a=(0,I.useCallback)(e=>i(e),[]),o=Object.keys(t?.joinedSolverNets??{}),s=o[0],c=ft({mutationFn:async()=>{s&&r&&await z.operator.join(s,{roles:[`solver`],harness:r.harness,model:r.model}),await z.operator.completeOnboarding()},onSuccess:()=>{e.invalidateQueries({queryKey:[`bootstrap`]})}}),l=(0,I.useCallback)(()=>{e.invalidateQueries({queryKey:[`bootstrap`]})},[e]),u=o.length>0&&r?.ready===!0&&!!r?.model;if(n||!t)return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Connecting…`})});let d=t.chain===`base`?`https://basescan.org`:`https://sepolia.basescan.org`,f=t.master_address??``,{phase:p,subState:m}=gp(t.currentStep),h=mp(t)?o.length>0?5:4:p,g=t.error,_=t.services??[],v=_.find(e=>e.step===t.currentStep)??_[0],y=t.funding?.targetMet,b=ns().embeddedAgent;return(0,L.jsx)(`div`,{className:`min-h-screen w-full bg-background text-foreground`,children:(0,L.jsxs)(`div`,{className:`mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10`,children:[(0,L.jsxs)(`section`,{className:H(`col-span-12 flex flex-col gap-8`,b&&`lg:col-span-7`),children:[(0,L.jsxs)(`header`,{className:`flex items-baseline justify-between`,children:[(0,L.jsx)(`span`,{className:vp,children:`Jinn · Onboarding`}),(0,L.jsx)(ud,{chain:t.chain})]}),(0,L.jsx)(`h1`,{className:`font-serif text-[76px] leading-[1.05] text-foreground`,children:`Welcome to Jinn.`}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"data-testid":`onboarding-progress`,"aria-label":`Onboarding progress`,children:[(0,L.jsx)(Vo,{value:Math.min(100,(h-1)/4*100)}),(0,L.jsxs)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:[`Phase `,h,` of 5`]})]}),(0,L.jsx)(`ol`,{className:`flex flex-col`,children:[1,2,3,4,5].map(e=>{let n=_p(e,h,y),r=g&&e===h&&e<=3;return(0,L.jsxs)(pd,{phase:e,status:r?`error`:n,children:[r&&(0,L.jsx)(rs,{envelope:g,chainExplorerBase:d}),!r&&e===2&&n===`active`&&f&&(0,L.jsx)(Wo,{address:f,minimumWei:t.funding?.targetWei??`10000000000000000`,chainExplorerBase:d,chain:t.chain,onSharedDefaultRpc:t.rpcUrl===t.defaultRpcUrl}),!r&&e===3&&n===`active`&&(0,L.jsx)(md,{label:m??`Working`,step:t.currentStep,serviceIndex:v?.index,serviceId:v?.service_id,safeAddress:v?.safe_address,explorer:d,contractRevertReason:v?.error_revert_reason??null}),e===4&&n===`active`&&(0,L.jsx)(bd,{onJoined:l,joinedCids:o}),e===5&&n===`active`&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(fp,{onSelectionChange:a}),c.isError&&(0,L.jsxs)(no,{variant:`blocking`,"data-testid":`onboarding-enter-error`,children:[(0,L.jsx)(ro,{children:`Could not enter the dashboard.`}),(0,L.jsx)(K,{children:`Saving your harness selection or completing onboarding failed. Try again; check daemon logs if it keeps failing.`})]}),(0,L.jsx)(U,{"data-testid":`onboarding-enter-dashboard`,disabled:!u||c.isPending,onClick:()=>c.mutate(),className:`self-start`,children:c.isPending?`Starting…`:`Enter dashboard`})]})]},e)})})]}),b&&(0,L.jsxs)(`aside`,{className:`col-span-12 flex flex-col gap-3 lg:col-span-5`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Ask Claude`}),(0,L.jsx)(W,{className:`h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0`,children:(0,L.jsx)($o,{agentGated:!1})})]})]})})}var bp=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]`,xp=`font-serif font-normal leading-[1.05] text-foreground text-[64px]`;function Sp({connection:e}){let[t,n]=(0,I.useState)(!1);return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground`,"data-testid":`daemon-offline-screen`,children:(0,L.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-6`,children:[(0,L.jsx)(`span`,{className:bp,children:`Jinn · offline`}),(0,L.jsx)(`h1`,{className:xp,children:`Daemon not running.`}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`font-mono text-sm text-[var(--fg-muted)]`,children:`Open a terminal and run:`}),(0,L.jsx)(`code`,{className:`self-start rounded bg-[var(--bg-elevated)] px-2 py-1 font-mono text-sm text-foreground`,children:`jinn run`}),(0,L.jsx)(`p`,{className:`font-mono text-xs text-[var(--fg-dim)]`,children:`(or the command you originally used to start it)`})]}),(0,L.jsxs)(`p`,{className:`font-mono text-sm text-[var(--fg-muted)]`,children:[`Reconnecting…`,e.attempts>0&&(0,L.jsxs)(`span`,{className:`ml-1 text-[var(--fg-dim)]`,children:[`(attempt `,e.attempts,`)`]})]}),(0,L.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`self-start text-[var(--fg-dim)] hover:text-foreground`,onClick:()=>n(e=>!e),"aria-expanded":t,children:[t?(0,L.jsx)(wn,{}):(0,L.jsx)(Sn,{}),t?`Hide details`:`Show details`]}),t&&e.lastError&&(0,L.jsx)(W,{className:`bg-[var(--bg-elevated)]`,children:(0,L.jsx)(Bi,{className:`px-3 py-2`,children:(0,L.jsx)(`p`,{className:`font-mono text-xs text-[var(--fg-muted)]`,children:e.lastError})})})]})})}var Cp={blocking:`border-l-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)]`,warning:`border-l-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)]`,info:`border-l-[var(--severity-info-fg)]`},wp={blocking:`text-[var(--severity-blocking-fg)]`,warning:`text-[var(--severity-warning-fg)]`,info:`text-[var(--severity-info-fg)]`};function Tp({notice:e}){return(0,L.jsxs)(`li`,{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:H(`flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground`,Cp[e.severity]),children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:H(`min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]`,wp[e.severity]),children:e.severity}),(0,L.jsx)(`span`,{className:`flex-1`,children:e.message}),e.jumpTo?(0,L.jsx)(en,{href:e.jumpTo,className:`font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]`,children:`resolve →`}):null]})}function Ep({notices:e}){return e.length===0?null:(0,L.jsx)(`section`,{"aria-label":`Notifications`,role:`region`,children:(0,L.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map((e,t)=>(0,L.jsx)(Tp,{notice:e},`${e.kind}-${t}`))})})}var Dp=(0,I.createContext)({restartPending:!1,setRestartPending:()=>{}});function Op(){return(0,I.useContext)(Dp)}var kp=3,Ap=1e3*60*60*24*90;function jp(e){let t=[],n=e.status;if(e.bootstrap.mode!==`running`&&t.push({kind:`bootstrap_blocked`,severity:`blocking`,message:e.bootstrap.blockingReason??`Bootstrap incomplete`,jumpTo:`/`}),n.funds.runwayDays<kp&&t.push({kind:`funding_low`,severity:`warning`,message:`Runway is ${n.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:`/overview`}),!n.harness.ready){let e=n.harness.name===null?`A harness`:`Harness ${n.harness.name}`,r=n.harness.reason?`: ${n.harness.reason}`:``;t.push({kind:`harness_not_ready`,severity:`blocking`,message:`${e} is not ready${r}.`,jumpTo:`/operator/memberships`})}return n.rpc.reachable||t.push({kind:`rpc_unreachable`,severity:`blocking`,message:`RPC endpoint is unreachable.`,jumpTo:`/operator/network`}),Object.keys(n.joinedSolverNets).length===0&&e.bootstrap.mode===`running`&&t.push({kind:`no_solvernets_joined`,severity:`info`,message:`No SolverNets joined. Browse the registry to start earning.`,jumpTo:`/operator/registry`}),n.services.some(e=>!e.safeBound)&&t.push({kind:`safe_binding_pending`,severity:`warning`,message:`Safe wallet binding is pending.`,jumpTo:`/overview`}),n.restartPending&&t.push({kind:`restart_required`,severity:`warning`,message:`A configuration change is pending — restart to apply.`,jumpTo:`/overview`}),n.latestVersion&&n.latestVersion!==n.daemonVersion&&t.push({kind:`update_available`,severity:`info`,message:`Daemon ${n.latestVersion} available (running ${n.daemonVersion}).`}),n.passwordRotatedAt&&(e.now??Date.now())-new Date(n.passwordRotatedAt).getTime()>Ap&&t.push({kind:`password_rotation_due`,severity:`info`,message:`Keystore password is over 90 days old.`,jumpTo:`/operator/security`}),t}var Mp={blocking:0,warning:1,info:2},Np=1800*1e3,Pp=60*1e3,Fp=[`intent`];function Ip(e,t,n){let r=e??{},i=t??{},a=String(r.masterGas?.balanceWei??`0`),o=`0`,s=1/0;try{let e=BigInt(a);o=e.toString(),s=e>0n?1/0:0}catch{}let c=Array.isArray(r.fleet?.services)?r.fleet.services:[],l=i.joinedSolverNets&&typeof i.joinedSolverNets==`object`?i.joinedSolverNets:{};return{funds:{eth:o,runwayDays:s},harness:{ready:r.harness?.ready!==!1,name:typeof r.harness?.name==`string`?r.harness.name:null,reason:typeof r.harness?.reason==`string`?r.harness.reason:null},rpc:{reachable:!0},restartPending:n,daemonVersion:String(r.version??`0.0.0`),latestVersion:void 0,services:c.map(e=>({safeBound:e?.safeBoundToAgent!==!1})),joinedSolverNets:l,passwordRotatedAt:void 0}}function Lp(){let e=cn(),{restartPending:t}=Op(),n=dt({queryKey:[`status`],queryFn:()=>z.getStatus()}),r=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap()}),{events:i}=Wn(Fp),[a,o]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{let e=setInterval(()=>o(Date.now()),Pp);return()=>clearInterval(e)},[]);let s=(0,I.useMemo)(()=>{let e=a-Np,t=new Set,n=i.filter(n=>{if(n.kind!==`intent`||n.errorCode!==`claim_failed`)return!1;let r=Date.parse(n.ts);return Number.isNaN(r)||r<e||t.has(n.id)?!1:(t.add(n.id),!0)});if(n.length===0)return null;let r=n.length;return{kind:`claim_failed`,severity:`warning`,message:`${r} claim attempt${r===1?``:`s`} failed in the last 30 minutes. Check Tasks for details.`,jumpTo:`/overview`,details:{count:r,sinceMs:e}}},[i,a]);return(0,I.useMemo)(()=>{if(e.status===`disconnected`)return[{kind:`rpc_unreachable`,severity:`blocking`,message:`Daemon offline. What you see may be stale. Reconnecting automatically…`}];if(!n.data||!r.data)return[];let i=jp({bootstrap:r.data,status:Ip(n.data,r.data,t)});return(s?[...i,s]:[...i]).sort((e,t)=>Mp[e.severity]-Mp[t.severity])},[e.status,t,n.data,r.data,s])}function Rp({header:e,tabs:t,rail:n,children:r}){let i=n!=null,a=Lp(),o=a.length>0?`grid-rows-[auto_auto_auto_minmax(0,1fr)]`:`grid-rows-[auto_auto_minmax(0,1fr)]`;return(0,L.jsxs)(`div`,{className:H(`grid h-screen w-full overflow-hidden bg-background text-foreground`,i?`grid-cols-[1fr_320px]`:`grid-cols-1`,o),children:[(0,L.jsx)(`div`,{className:`col-span-full border-b border-border`,children:e}),(0,L.jsx)(`div`,{className:`col-span-full border-b border-border`,children:t}),a.length>0&&(0,L.jsx)(`div`,{className:`col-span-full border-b border-border`,children:(0,L.jsx)(Ep,{notices:a})}),(0,L.jsx)(`main`,{className:`min-h-0 overflow-y-auto`,children:r}),i&&(0,L.jsx)(`aside`,{className:`h-full min-h-0 overflow-y-auto border-l border-border`,children:n})]})}function zp(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var Bp=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Vp(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}var Hp=null;function Up(e={}){return Hp||(e.includeStyleProperties?(Hp=e.includeStyleProperties,Hp):(Hp=Vp(window.getComputedStyle(document.documentElement)),Hp))}function Wp(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function Gp(e){let t=Wp(e,`border-left-width`),n=Wp(e,`border-right-width`);return e.clientWidth+t+n}function Kp(e){let t=Wp(e,`border-top-width`),n=Wp(e,`border-bottom-width`);return e.clientHeight+t+n}function qp(e,t={}){return{width:t.width||Gp(e),height:t.height||Kp(e)}}function Jp(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var Yp=16384;function Xp(e){(e.width>Yp||e.height>Yp)&&(e.width>Yp&&e.height>Yp?e.width>e.height?(e.height*=Yp/e.width,e.width=Yp):(e.width*=Yp/e.height,e.height=Yp):e.width>Yp?(e.height*=Yp/e.width,e.width=Yp):(e.width*=Yp/e.height,e.height=Yp))}function Zp(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function Qp(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function $p(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),Qp(i)}var em=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||em(n,t)};function tm(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function nm(e,t){return Up(t).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function rm(e,t,n,r){let i=`.${e}:${t}`,a=n.cssText?tm(n):nm(n,r);return document.createTextNode(`${i}{${a}}`)}function im(e,t,n,r){let i=window.getComputedStyle(e,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=Bp();try{t.className=`${t.className} ${o}`}catch{return}let s=document.createElement(`style`);s.appendChild(rm(o,n,i,r)),t.appendChild(s)}function am(e,t,n){im(e,t,`:before`,n),im(e,t,`:after`,n)}var om=`application/font-woff`,sm=`image/jpeg`,cm={woff:om,woff2:om,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:sm,jpeg:sm,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function lm(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function um(e){return cm[lm(e).toLowerCase()]||``}function dm(e){return e.split(/,/)[1]}function fm(e){return e.search(/^(data:)/)!==-1}function pm(e,t){return`data:${t};base64,${e}`}async function mm(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var hm={};function gm(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function _m(e,t,n){let r=gm(e,t,n.includeQueryParams);if(hm[r]!=null)return hm[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=pm(await mm(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,dm(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return hm[r]=i,i}async function vm(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):Zp(t)}async function ym(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),Zp(t.toDataURL())}let n=e.poster;return Zp(await _m(n,um(n),t))}async function bm(e,t){try{if(e?.contentDocument?.body)return await Am(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function xm(e,t){return em(e,HTMLCanvasElement)?vm(e):em(e,HTMLVideoElement)?ym(e,t):em(e,HTMLIFrameElement)?bm(e,t):e.cloneNode(Cm(e))}var Sm=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`,Cm=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SVG`;async function wm(e,t,n){if(Cm(t))return t;let r=[];return r=Sm(e)&&e.assignedNodes?Vp(e.assignedNodes()):em(e,HTMLIFrameElement)&&e.contentDocument?.body?Vp(e.contentDocument.body.childNodes):Vp((e.shadowRoot??e).childNodes),r.length===0||em(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>Am(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function Tm(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Up(n).forEach(n=>{let a=i.getPropertyValue(n);n===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),em(e,HTMLIFrameElement)&&n===`display`&&a===`inline`&&(a=`block`),n===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),r.setProperty(n,a,i.getPropertyPriority(n))})}function Em(e,t){em(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),em(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function Dm(e,t){if(em(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function Om(e,t,n){return em(t,Element)&&(Tm(e,t,n),am(e,t,n),Em(e,t),Dm(e,t)),t}async function km(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await Am(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function Am(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>xm(e,t)).then(n=>wm(e,n,t)).then(n=>Om(e,n,t)).then(e=>km(e,t))}var jm=/url\((['"]?)([^'"]+?)\1\)/g,Mm=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nm=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Pm(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function Fm(e){let t=[];return e.replace(jm,(e,n,r)=>(t.push(r),e)),t.filter(e=>!fm(e))}async function Im(e,t,n,r,i){try{let a=n?zp(t,n):t,o=um(t),s;return s=i?pm(await i(a),o):await _m(a,o,r),e.replace(Pm(t),`$1${s}$3`)}catch{}return e}function Lm(e,{preferredFontFormat:t}){return t?e.replace(Nm,e=>{for(;;){let[n,,r]=Mm.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function Rm(e){return e.search(jm)!==-1}async function zm(e,t,n){if(!Rm(e))return e;let r=Lm(e,n);return Fm(r).reduce((e,r)=>e.then(e=>Im(e,r,t,n)),Promise.resolve(r))}async function Bm(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await zm(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Vm(e,t){await Bm(`background`,e,t)||await Bm(`background-image`,e,t),await Bm(`mask`,e,t)||await Bm(`-webkit-mask`,e,t)||await Bm(`mask-image`,e,t)||await Bm(`-webkit-mask-image`,e,t)}async function Hm(e,t){let n=em(e,HTMLImageElement);if(!(n&&!fm(e.src))&&!(em(e,SVGImageElement)&&!fm(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await _m(r,um(r),t);await new Promise((r,a)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...e)=>{try{r(t.onImageErrorHandler(...e))}catch(e){a(e)}}:a;let o=e;o.decode&&=r,o.loading===`lazy`&&(o.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function Um(e,t){let n=Vp(e.childNodes).map(e=>Wm(e,t));await Promise.all(n).then(()=>e)}async function Wm(e,t){em(e,Element)&&(await Vm(e,t),await Hm(e,t),await Um(e,t))}function Gm(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var Km={};async function qm(e){let t=Km[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},Km[e]=t,t)}async function Jm(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),mm(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function Ym(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function Xm(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{Vp(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=qm(o).then(e=>Jm(e,t)).then(e=>Ym(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(qm(n.href).then(e=>Jm(e,t)).then(e=>Ym(e).forEach(e=>{a.insertRule(e,a.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{Vp(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function Zm(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Rm(e.style.getPropertyValue(`src`)))}async function Qm(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return Zm(await Xm(Vp(e.ownerDocument.styleSheets),t))}function $m(e){return e.trim().replace(/["']/g,``)}function eh(e){let t=new Set;function n(e){(e.style.fontFamily||getComputedStyle(e).fontFamily).split(`,`).forEach(e=>{t.add($m(e))}),Array.from(e.children).forEach(e=>{e instanceof HTMLElement&&n(e)})}return n(e),t}async function th(e,t){let n=await Qm(e,t),r=eh(e);return(await Promise.all(n.filter(e=>r.has($m(e.style.fontFamily))).map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return zm(e.cssText,n,t)}))).join(`
23
+ `)}async function nh(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await th(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function rh(e,t={}){let{width:n,height:r}=qp(e,t),i=await Am(e,t,!0);return await nh(i,t),await Wm(i,t),Gm(i,t),await $p(i,n,r)}async function ih(e,t={}){let{width:n,height:r}=qp(e,t),i=await Zp(await rh(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||Jp(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||Xp(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function ah(e,t={}){return(await ih(e,t)).toDataURL()}async function oh(){try{return(await ah(document.body,{canvasWidth:1600,cacheBust:!0})).replace(/^data:image\/png;base64,/,``)}catch{return}}function sh(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}var ch={background:`var(--bg-raised, var(--bg))`,border:`1px solid var(--border)`,borderRadius:`10px`,padding:`20px`,maxWidth:`420px`,fontFamily:`'JetBrains Mono', monospace`,fontSize:`12px`,color:`var(--fg)`};function lh(){let[e,t]=(0,I.useState)(`idle`),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(null);async function o(){t(`loading-manifest`),a(null);try{r(await z.debugReport.manifest()),t(`reviewing`)}catch(e){a(e instanceof Error?e.message:String(e)),t(`error`)}}function s(){t(`idle`),r(null),a(null)}async function c(){t(`building`),a(null);try{let e=await oh();sh(await z.debugReport.download(e),`jinn-debug-report-${new Date().toISOString().slice(0,10)}.tar.gz`),s()}catch(e){a(e instanceof Error?e.message:String(e)),t(`error`)}}return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>void o(),disabled:e===`loading-manifest`||e===`building`,style:{background:`transparent`,border:`1px solid var(--border)`,borderRadius:`6px`,padding:`4px 10px`,fontFamily:`'JetBrains Mono', monospace`,fontSize:`11px`,letterSpacing:`0.08em`,textTransform:`uppercase`,color:`var(--fg-muted)`,cursor:e===`building`?`wait`:`pointer`},children:e===`building`?`building report…`:`debug report`}),(e===`reviewing`||e===`building`||e===`error`)&&(0,L.jsx)(`div`,{role:`dialog`,"aria-label":`Download debug report`,style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3},onClick:s,children:(0,L.jsxs)(`div`,{style:ch,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(`h2`,{style:{fontFamily:`'Instrument Serif', 'Times New Roman', serif`,fontSize:`22px`,margin:`0 0 8px`,color:`var(--fg)`},children:`Download debug report`}),(0,L.jsx)(`p`,{style:{color:`var(--fg-muted)`,margin:`0 0 14px`,lineHeight:1.5},children:`A support bundle for debugging this daemon. Secret values in the config, logs, and events are redacted — but the screenshot is not (see below). Review what it contains:`}),n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{style:{marginBottom:`12px`},children:[(0,L.jsx)(`div`,{style:{color:`var(--fg-dim)`,marginBottom:`4px`},children:`Bundle contents`}),(0,L.jsx)(`ul`,{style:{margin:0,paddingLeft:`18px`,color:`var(--fg)`},children:n.files.map(e=>(0,L.jsx)(`li`,{children:e},e))})]}),(0,L.jsxs)(`div`,{style:{marginBottom:`14px`},children:[(0,L.jsx)(`div`,{style:{color:`var(--fg-dim)`,marginBottom:`4px`},children:`Redacted`}),(0,L.jsx)(`ul`,{style:{margin:0,paddingLeft:`18px`,color:`var(--fg-muted)`},children:n.redaction.redacted.map(e=>(0,L.jsx)(`li`,{children:e},e))})]}),n.redaction.notRedacted&&n.redaction.notRedacted.length>0&&(0,L.jsxs)(`div`,{style:{marginBottom:`14px`},children:[(0,L.jsx)(`div`,{style:{color:`var(--break-red)`,marginBottom:`4px`},children:`Not redacted — review before sharing`}),(0,L.jsx)(`ul`,{style:{margin:0,paddingLeft:`18px`,color:`var(--fg-muted)`},children:n.redaction.notRedacted.map(e=>(0,L.jsx)(`li`,{children:e},e))})]})]}),i&&(0,L.jsx)(`p`,{style:{color:`var(--break-red)`,margin:`0 0 12px`},children:i}),(0,L.jsxs)(`div`,{style:{display:`flex`,gap:`10px`,justifyContent:`flex-end`},children:[(0,L.jsx)(`button`,{type:`button`,onClick:s,style:{background:`transparent`,border:`1px solid var(--border)`,borderRadius:`6px`,padding:`6px 12px`,fontFamily:`'JetBrains Mono', monospace`,fontSize:`11px`,color:`var(--fg-muted)`,cursor:`pointer`},children:`Cancel`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void c(),disabled:e===`building`,style:{background:`var(--fg)`,border:`1px solid var(--fg)`,borderRadius:`6px`,padding:`6px 12px`,fontFamily:`'JetBrains Mono', monospace`,fontSize:`11px`,color:`var(--bg)`,cursor:e===`building`?`wait`:`pointer`},children:e===`building`?`Building…`:`Download`})]})]})})]})}function uh({network:e}){return(0,L.jsxs)(`header`,{className:`flex items-center justify-between px-6 py-3.5`,children:[(0,L.jsx)(en,{href:`/overview`,className:`font-serif text-[26px] text-foreground no-underline`,children:`jinn operator`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(q,{variant:`outline`,children:e}),(0,L.jsx)(lh,{})]})]})}var dh=[{path:`/overview`,label:`Dashboard`},{path:`/events`,label:`Events`},{path:`/operator`,label:`Settings`}];function fh(){let[e]=qt(),t=e.split(/[?#]/)[0]||`/`,n=t===`/launcher`||t.startsWith(`/launcher/`),{data:r}=dt({queryKey:[`solvernets`,`launched`,`top-tabs`],queryFn:()=>z.solvernets.listLaunched(),refetchInterval:3e4,enabled:!n}),i=ns().pluginBuilderUi?[...dh,{path:`/build`,label:`Build`}]:dh;return(0,L.jsx)(`nav`,{className:`-mb-px flex px-6`,children:(n||(r?.records.length??0)>0?[...i,{path:`/launcher`,label:`Launcher`}]:i).map(e=>{let n=t===e.path||t.startsWith(`${e.path}/`);return(0,L.jsx)(en,{href:e.path,"data-active":n?`true`:`false`,className:H(`border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors`,n?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:e.label},e.path)})})}function ph({agentGated:e}){return(0,L.jsxs)(`div`,{className:`agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]`,children:`Claude`}),(0,L.jsx)($o,{agentGated:e})]})}function mh(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var hh=e=>{switch(e){case`success`:return vh;case`info`:return bh;case`warning`:return yh;case`error`:return xh;default:return null}},gh=Array(12).fill(0),_h=({visible:e,className:t})=>I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},I.createElement(`div`,{className:`sonner-spinner`},gh.map((e,t)=>I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),vh=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),yh=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),bh=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),xh=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Sh=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ch=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},wh=1,Th=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:wh++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Dh(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||wh++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Eh=(e,t)=>{let n=t?.id||wh++;return Th.addToast({title:e,...t,id:n}),n},Dh=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Oh=Object.assign(Eh,{success:Th.success,info:Th.info,warning:Th.warning,error:Th.error,custom:Th.custom,message:Th.message,promise:Th.promise,dismiss:Th.dismiss,loading:Th.loading},{getHistory:()=>Th.toasts,getToasts:()=>Th.getActiveToasts()});mh(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function kh(e){return e.label!==void 0}var Ah=3,jh=`24px`,Mh=`16px`,Nh=4e3,Ph=356,Fh=14,Ih=45,Lh=200;function Rh(...e){return e.filter(Boolean).join(` `)}function zh(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Bh=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=I.useState(null),[O,ee]=I.useState(null),[te,k]=I.useState(!1),[A,j]=I.useState(!1),[M,ne]=I.useState(!1),[N,P]=I.useState(!1),[re,ie]=I.useState(!1),[ae,oe]=I.useState(0),[F,se]=I.useState(0),ce=I.useRef(n.duration||y||Nh),le=I.useRef(null),ue=I.useRef(null),de=c===0,fe=c+1<=o,pe=n.type,me=n.dismissible!==!1,he=n.className||``,ge=n.descriptionClassName||``,_e=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=I.useMemo(()=>n.duration||y||Nh,[n.duration,y]),be=I.useRef(0),xe=I.useRef(0),Se=I.useRef(0),Ce=I.useRef(null),[we,Te]=b.split(`-`),Ee=I.useMemo(()=>s.reduce((e,t,n)=>n>=_e?e:e+t.height,0),[s,_e]),De=Ch(),Oe=n.invert||t,ke=pe===`loading`;xe.current=I.useMemo(()=>_e*x+Ee,[_e,Ee]),I.useEffect(()=>{ce.current=ye},[ye]),I.useEffect(()=>{k(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!te)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[te,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=I.useCallback(()=>{j(!0),oe(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Lh)},[n,d,a,xe]);I.useEffect(()=>{if(n.promise&&pe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;ce.current-=e}Se.current=new Date().getTime()})():ce.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},ce.current)),()=>clearTimeout(e)},[u,i,n,pe,De,Ae]),I.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return w?.loading?I.createElement(`div`,{className:Rh(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":pe===`loading`},w.loading):I.createElement(_h,{className:Rh(C?.loader,n?.classNames?.loader),visible:pe===`loading`})}let Me=n.icon||w?.[pe]||hh(pe);return I.createElement(`li`,{tabIndex:0,ref:ue,className:Rh(_,he,C?.toast,n?.classNames?.toast,C?.default,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":te,"data-promise":!!n.promise,"data-swiped":re,"data-removed":A,"data-visible":fe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":de,"data-swiping":M,"data-dismissible":me,"data-type":pe,"data-invert":Oe,"data-swipe-out":N,"data-swipe-direction":O,"data-expanded":!!(u||S&&te),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${A?ae:xe.current}px`,"--initial-height":S?`auto`:`${F}px`,...m,...n.style},onDragEnd:()=>{ne(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!me||(le.current=new Date,oe(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ne(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(N||!me)return;Ce.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Ih||a>.11){oe(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),ee(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),P(!0);return}else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ie(!1),ne(!1),D(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!me||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??zh(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ie(!0),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ue.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ve&&!n.jsx&&pe!==`loading`?I.createElement(`button`,{"aria-label":T,"data-disabled":ke,"data-close-button":!0,onClick:ke||!me?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Rh(C?.closeButton,n?.classNames?.closeButton)},w?.close??Sh):null,(pe||n.icon||n.promise)&&n.icon!==null&&(w?.[pe]!==null||n.icon)?I.createElement(`div`,{"data-icon":``,className:Rh(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:Me):null,I.createElement(`div`,{"data-content":``,className:Rh(C?.content,n?.classNames?.content)},I.createElement(`div`,{"data-title":``,className:Rh(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?I.createElement(`div`,{"data-description":``,className:Rh(v,ge,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),I.isValidElement(n.cancel)?n.cancel:n.cancel&&kh(n.cancel)?I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{kh(n.cancel)&&me&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:Rh(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,I.isValidElement(n.action)?n.action:n.action&&kh(n.action)?I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{kh(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:Rh(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Vh(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Hh(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Mh:jh;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Uh=I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ah,toastOptions:g,dir:_=Vh(),gap:v=Fh,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=I.useState([]),C=I.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=I.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=I.useState([]),[D,O]=I.useState(!1),[ee,te]=I.useState(!1),[k,A]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=I.useRef(null),M=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ne=I.useRef(null),N=I.useRef(!1),P=I.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||Th.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>Th.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Hi.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),I.useEffect(()=>{if(d!==`system`){A(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?A(`dark`):A(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{A(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{A(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{x.length<=1&&O(!1)},[x]),I.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(j.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,N.current=!1)}},[j.current]),I.createElement(`section`,{ref:t,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?I.createElement(`ol`,{key:t,dir:_===`auto`?Vh():_,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Ph}px`,"--gap":`${v}px`,...m,...Hh(l,u)},onBlur:e=>{N.current&&!e.currentTarget.contains(e.relatedTarget)&&(N.current=!1,ne.current&&=(ne.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N.current||(N.current=!0,ne.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ee||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||te(!0)},onPointerUp:()=>te(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>I.createElement(Bh,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:ee,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:P,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Wh=I.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,L.jsx)(`div`,{ref:i,role:n?`none`:`separator`,"aria-orientation":t,className:H(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));Wh.displayName=`Separator`;var Gh=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,Kh=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,qh=`font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground`,Jh=`font-mono text-[12px] font-medium text-[var(--fg-muted)]`,Yh=`font-mono text-[12px] text-[var(--fg-dim)]`;function Xh(e,t,n){switch(e){case`ready`:return{value:t,copy:null};case`error`:return{value:`unavailable`,copy:n??`Sepolia tJINN balance temporarily unavailable.`};case`pending`:return{value:`pending`,copy:`Waiting for Sepolia balance.`}}}function Zh({totalEth:e,runwayDays:t,tjinnEarned:n,tjinnEarnedLast24h:r,tjinnState:i,tjinnError:a,lastPasswordRotationAt:o,onTopUp:s,actionsDisabled:c=!1}){let[,l]=qt(),{value:u,copy:d}=Xh(i,n,a);return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{role:`region`,"aria-label":`Wallet`,"data-testid":`wallet-card`,className:`flex flex-col gap-6 p-6`,children:[(0,L.jsx)(`span`,{className:Gh,children:`Wallet`}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,"data-testid":`wallet-section-rewards`,children:[(0,L.jsx)(`span`,{className:Kh,children:`Rewards`}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,"data-testid":`tjinn-earned-24h-region`,"aria-live":`polite`,"aria-atomic":`true`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:`Testnet JINN earned last 24hrs`}),(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`text-2xl font-bold tracking-tight`,"data-testid":`tjinn-earned-24h-value`,style:i===`error`?{color:`var(--break-red)`}:void 0,children:r??(i===`error`?`unavailable`:`pending`)}),r!==null&&(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`tJINN`})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,"data-testid":`tjinn-earned-region`,"aria-live":`polite`,"aria-atomic":`true`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`tjinn-earned-state-prefix`,children:`Lifetime`}),(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`text-base font-medium`,"data-testid":`tjinn-earned-value`,style:i===`error`?{color:`var(--break-red)`}:void 0,children:u}),i===`ready`&&(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`tJINN`})]}),d&&(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`tjinn-earned-state`,children:d})]})]}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,"data-testid":`wallet-section-gas`,children:[(0,L.jsx)(`span`,{className:Kh,children:`Gas`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:qh,children:e}),(0,L.jsx)(`span`,{className:Jh,children:`ETH`}),(0,L.jsx)(`span`,{className:Yh,children:`·`}),(0,L.jsxs)(`span`,{className:Yh,children:[t,`d runway`]})]}),(0,L.jsx)(U,{variant:`outline`,size:`sm`,"aria-label":`Top up from faucet`,onClick:s,disabled:c,"data-testid":`wallet-topup`,className:`self-start`,children:`Top up from faucet (free)`})]}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,"data-testid":`wallet-section-password`,children:[(0,L.jsx)(`span`,{className:Kh,children:`Password`}),(0,L.jsxs)(`span`,{className:`font-mono text-[12px] text-[var(--fg-dim)]`,children:[`last rotated:`,` `,o?(0,L.jsx)(`time`,{dateTime:o,className:`text-[var(--fg-muted)]`,children:o}):(0,L.jsx)(`span`,{className:`text-[var(--fg-muted)]`,children:`never`})]}),(0,L.jsx)(U,{variant:`secondary`,size:`sm`,"aria-label":`Change password`,onClick:()=>l(`/operator/security`),"data-testid":`wallet-change-password`,className:`self-start`,children:`Change password`})]})]})})}var Qh=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,$h=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,eg=`font-mono text-[14px] text-foreground`,tg=`font-mono text-[14px] text-[var(--fg-muted)]`;function ng(e){return e.length<10?e:`${e.slice(0,6)}…${e.slice(-4)}`}function rg(){return(0,L.jsx)(`span`,{"data-testid":`identity-stat-empty`,className:tg,children:`—`})}async function ig(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);try{if(document.execCommand(`copy`)!==!0)throw Error(`Copy command failed`)}finally{t.remove()}}function ag({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:$h,children:e}),t]})}function og({label:e,address:t,testId:n}){return(0,L.jsx)(ag,{label:e,children:t?(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"data-testid":n,"aria-label":`Copy full ${e} address`,onClick:()=>{t&&ig(t).catch(()=>{})},className:`cursor-copy border-0 bg-transparent p-0 text-left ${eg}`,children:ng(t)})}),(0,L.jsx)(ld,{children:t})]}):(0,L.jsx)(rg,{})})}function sg({masterAddress:e,safeAddress:t,serviceId:n,agentId:r,services:i=[],bindingError:a}){let o=i.find(e=>e.agentId!==null&&!e.safeBoundToAgent),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(a??null),h=async()=>{if(o){u(!0),f(null),m(null);try{let e=(await z.retryAgentBinding({serviceIndex:o.index})).attempts[0];e?.status===`success`?(f(`success`),c(!1)):(f(`reverted`),m(e?.detail??`Bind reverted on chain.`))}catch(e){f(`reverted`),m(e instanceof Error?e.message:String(e))}finally{u(!1)}}};return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{role:`region`,"aria-label":`Identity`,"data-testid":`identity-card`,className:`flex flex-col gap-6 p-6`,children:[(0,L.jsx)(`span`,{className:Qh,children:`Identity`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-8`,children:[(0,L.jsx)(ag,{label:`Service`,children:n===null?(0,L.jsx)(rg,{}):(0,L.jsxs)(`span`,{"data-testid":`identity-service-id`,className:eg,children:[`#`,n]})}),(0,L.jsx)(ag,{label:`Agent`,children:(0,L.jsxs)(`span`,{className:`flex items-center gap-2 ${eg}`,children:[r===null?(0,L.jsx)(rg,{}):`#${r}`,o&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer rounded-full border border-[var(--wane)] bg-transparent px-1.5 py-px font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--wane)]`,children:`binding pending`}),d===`success`&&(0,L.jsx)(q,{variant:`success`,className:`rounded-full normal-case tracking-[0.12em]`,children:`bound`})]})}),(0,L.jsx)(og,{label:`Master`,address:e,testId:`identity-master-address`}),(0,L.jsx)(og,{label:`Safe`,address:t,testId:`identity-safe-address`})]}),o&&(0,L.jsxs)(no,{variant:`warning`,"data-testid":`identity-state-message-safe-not-bound`,className:`flex flex-col gap-2`,children:[(0,L.jsxs)(K,{children:[`Service #`,o.index,` Safe is not yet bound to agent #`,o.agentId,`. The bootstrap left it unbound; retry to attempt the ERC-1271 bind again.`]}),s&&p&&(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--break-red)]`,children:p}),(0,L.jsx)(U,{variant:`default`,size:`sm`,onClick:()=>{s||c(!0),h()},disabled:l,className:`self-start`,children:l?`Retrying…`:`Retry binding`})]}),r===null&&(0,L.jsx)(no,{variant:`warning`,"data-testid":`identity-state-message-agent-id-not-minted`,children:(0,L.jsx)(K,{children:`Agent ID has not yet been minted. The daemon mints it during bootstrap; if this persists, check the bootstrap logs.`})})]})})}var cg=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,lg=`flex items-center gap-2 font-mono text-[17px] font-medium text-foreground`;function ug({tone:e}){return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:H(`inline-block h-2 w-2 rounded-full`,e===`good`?`bg-[var(--vow-green)]`:e===`bad`?`bg-[var(--break-red)]`:`bg-[var(--fg-muted)]`)})}function dg({daemonStatus:e,daemonStateMessage:t,rpcStatus:n,onRestart:r}){let[,i]=qt(),[a,o]=(0,I.useState)(null),s=e===`running`,c=n===`healthy`;function l(){a||!r||(o(`restart`),Promise.resolve().then(r).catch(e=>console.error(`[node-health] restart failed:`,e)).finally(()=>o(null)))}return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{"data-testid":`node-health-card`,"aria-labelledby":`node-health-heading`,className:`flex flex-col gap-4 p-6`,children:[(0,L.jsx)(`h2`,{id:`node-health-heading`,className:H(cg,`m-0 text-[var(--fg-dim)]`),children:`Node health`}),(0,L.jsxs)(`div`,{"data-testid":`node-health-daemon-row`,"data-status":e,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`span`,{className:cg,children:`Daemon`}),(0,L.jsxs)(`span`,{className:lg,children:[(0,L.jsx)(ug,{tone:s?`good`:`bad`}),s?`Running`:`Stopped`]}),t&&(0,L.jsx)(`span`,{"data-testid":`node-health-daemon-state`,className:`font-mono text-[12px] leading-snug text-[var(--fg-muted)]`,children:t}),(0,L.jsx)(`div`,{className:`mt-2 flex gap-2`,children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`span`,{tabIndex:s?-1:0,children:(0,L.jsx)(U,{variant:`outline`,size:`sm`,disabled:!s||a!==null,"data-testid":`node-health-restart`,onClick:l,children:a===`restart`?`Restarting...`:`Restart`})})}),(0,L.jsx)(ld,{children:s?`Restart the daemon. The dashboard reconnects when it comes back.`:`Daemon is stopped — re-run jinn from your terminal to start it.`})]})})]}),(0,L.jsxs)(`div`,{"data-testid":`node-health-rpc-row`,"data-status":n,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`span`,{className:cg,children:`RPC`}),(0,L.jsxs)(`span`,{className:lg,children:[(0,L.jsx)(ug,{tone:c?`good`:`bad`}),c?`Healthy`:`Unreachable`]}),(0,L.jsx)(`div`,{className:`mt-2 flex gap-2`,children:(0,L.jsx)(U,{variant:`outline`,size:`sm`,"data-testid":`node-health-rpc-settings`,onClick:()=>i(`/operator/network`),children:`Manage RPC`})})]})]})})}var fg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,L.jsx)(`table`,{ref:n,className:H(`w-full caption-bottom font-mono text-[12px]`,e),...t})}));fg.displayName=`Table`;var pg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`thead`,{ref:n,className:H(`[&_tr]:border-b [&_tr]:border-border`,e),...t}));pg.displayName=`TableHeader`;var mg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`tbody`,{ref:n,className:H(`[&_tr:last-child]:border-0`,e),...t}));mg.displayName=`TableBody`;var hg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`tfoot`,{ref:n,className:H(`border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));hg.displayName=`TableFooter`;var gg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`tr`,{ref:n,className:H(`border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]`,e),...t}));gg.displayName=`TableRow`;var _g=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`th`,{ref:n,className:H(`h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,e),...t}));_g.displayName=`TableHead`;var vg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`td`,{ref:n,className:H(`px-2 py-2 align-middle`,e),...t}));vg.displayName=`TableCell`;var yg=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`caption`,{ref:n,className:H(`mt-4 text-[12px] text-[var(--fg-muted)]`,e),...t}));yg.displayName=`TableCaption`;var bg=new Set([`DISCOVERED`,`CLAIMED`,`WAITING`,`PRE_SNAPSHOT`,`RUNNING`,`POST_SNAPSHOT`,`PACKAGING`,`DELIVERING`]);function xg(e,t=6,n=4){return e.length<=t+n+1?e:`${e.slice(0,t)}…${e.slice(-n)}`}function Sg(e){return e===`restoration`?`solve`:e===`evaluation`?`evaluate`:`—`}function Cg(e){return e===`COMPLETE`?{label:`succeeded`,detail:`COMPLETE`,tone:`good`}:e===`FAILED`?{label:`failed`,detail:`FAILED`,tone:`bad`}:e===`RACE_LOST`?{label:`race-lost`,detail:`RACE_LOST`,tone:`neutral`}:bg.has(e)?{label:`active`,detail:e.toLowerCase().replace(/_/g,` `),tone:`active`}:{label:e.toLowerCase().replace(/_/g,` `),detail:e,tone:`neutral`}}function wg(e){return e===`bad`?`destructive`:e===`good`?`success`:e===`active`?`default`:`outline`}function Tg(e){if(!e)return`—`;let t=Math.floor((Date.now()-e)/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Eg(e){return e===`solving`||e===`solver`?`solver`:e===`evaluating`||e===`evaluator`?`evaluator`:e}var Dg=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0`;function Og({children:e,className:t}){return(0,L.jsx)(`h3`,{className:H(Dg,t),children:e})}function kg({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(Og,{children:e}),(0,L.jsx)(`div`,{className:`font-mono text-[12px] text-foreground`,children:t})]})}function Ag({joined:e,tasks:t}){let[,n]=qt(),[r,i]=(0,I.useState)(e[0]?.manifestCid??e[0]?.name??null),a=(0,I.useMemo)(()=>e.find(e=>(e.manifestCid??e.name)===r)??e[0]??null,[e,r]),o=(0,I.useMemo)(()=>a?t.filter(t=>{if(t.state===`FAILED`){if(t.runStartedAt===null)return!1;let e=(t.failureReason??``).toLowerCase();if(e.includes(`not ready`)||e.includes(`not enabled`))return!1}return e.length<=1?!0:t.solverType&&a.solverType?t.solverType===a.solverType:t.manifestCid&&a.manifestCid?t.manifestCid===a.manifestCid:!0}):[],[t,a,e.length,r]);return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{role:`region`,"aria-label":`Activity`,"data-testid":`activity-card`,children:[(0,L.jsxs)(Li,{className:`flex flex-row items-center justify-between gap-3 pb-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(yn,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(Ri,{children:`Activity`})]}),(0,L.jsxs)(U,{variant:`secondary`,size:`sm`,"data-testid":`activity-view-event-log`,onClick:()=>n(`/events`),children:[(0,L.jsx)(Nn,{className:`h-3 w-3`,"aria-hidden":`true`}),`View event log`]})]}),(0,L.jsx)(Bi,{children:(0,L.jsxs)(`div`,{className:`grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]`,children:[(0,L.jsxs)(`div`,{"data-testid":`activity-joined`,className:`flex min-w-0 flex-col gap-3`,children:[(0,L.jsx)(Og,{children:`Joined`}),e.length===0?(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] text-muted-foreground`,children:`No SolverNets joined.`}):(0,L.jsx)(Ya,{className:`max-h-[280px]`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-1 pr-2`,children:e.map(e=>{let t=e.manifestCid??e.name,n=t===(a?.manifestCid??a?.name);return(0,L.jsx)(U,{variant:`ghost`,size:`sm`,"data-testid":`activity-joined-row-${t}`,"data-state":n?`active`:void 0,"aria-current":n?`true`:void 0,onClick:()=>i(t),className:H(`h-auto w-full justify-start gap-0 rounded-sm border-l-2 px-2.5 py-1.5 font-mono text-[12px] normal-case tracking-normal`,n?`border-l-primary bg-accent text-foreground`:`border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground`),children:(0,L.jsx)(`span`,{className:`truncate`,children:e.name})},t)})})}),(0,L.jsxs)(U,{variant:`outline`,size:`sm`,"data-testid":`activity-join-more`,onClick:()=>n(`/operator/registry`),className:`self-start`,children:[(0,L.jsx)(Rn,{className:`h-3 w-3`,"aria-hidden":`true`}),`Join more SolverNets`]})]}),(0,L.jsxs)(`div`,{"data-testid":`activity-tasks`,className:`flex min-w-0 flex-col gap-3`,children:[a&&(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[20px] font-normal leading-tight text-foreground`,children:a.name}),o.length===0?(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] text-muted-foreground`,children:`No task runs recorded yet.`}):(0,L.jsx)(`div`,{"data-testid":`activity-tasks-table`,children:(0,L.jsxs)(fg,{children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{className:`hover:bg-transparent`,children:[(0,L.jsx)(_g,{children:`Run`}),(0,L.jsx)(_g,{children:`Task`}),(0,L.jsx)(_g,{children:`State`}),(0,L.jsx)(_g,{children:`Started`})]})}),(0,L.jsx)(mg,{children:o.map(e=>{let t=Cg(e.state),r=t.tone===`active`;return(0,L.jsxs)(gg,{"data-active":r?`true`:void 0,"data-testid":`activity-task-row-${e.requestId}`,className:H(`border-l-2`,r?`border-l-primary bg-primary/[0.06]`:`border-l-transparent`),children:[(0,L.jsx)(vg,{className:`text-muted-foreground`,children:Sg(e.taskRole)}),(0,L.jsx)(vg,{children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`bg-transparent p-0 font-mono text-[12px] text-[var(--accent-sky)] underline-offset-4 hover:underline`,onClick:()=>n(`/events?requestId=${encodeURIComponent(e.requestId)}`),children:xg(e.requestId)})}),(0,L.jsx)(ld,{children:e.requestId})]})}),(0,L.jsx)(vg,{children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`cursor-help bg-transparent p-0`,children:(0,L.jsx)(q,{variant:wg(t.tone),children:t.label})})}),(0,L.jsx)(ld,{children:t.detail})]})}),(0,L.jsx)(vg,{className:`text-muted-foreground`,children:Tg(e.runStartedAt??e.stateUpdatedAt)})]},e.requestId)})})]})})]}),(0,L.jsxs)(`div`,{"data-testid":`activity-settings`,className:`flex min-w-0 flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,L.jsx)(Og,{children:`Settings`}),(0,L.jsxs)(U,{variant:`link`,size:`sm`,"data-testid":`activity-settings-edit`,onClick:()=>n(`/operator/memberships`),className:`h-auto gap-1 p-0 text-[11px] uppercase tracking-[0.14em]`,children:[(0,L.jsx)(Ln,{className:`h-3 w-3`,"aria-hidden":`true`}),`Edit`]})]}),a?(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(kg,{label:`Roles`,children:a.roles.length===0?(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:a.roles.map(e=>(0,L.jsx)(q,{variant:`outline`,children:Eg(e)},e))})}),(0,L.jsx)(Wh,{}),(0,L.jsx)(kg,{label:`Harness`,children:a.harness??`—`}),(0,L.jsx)(Wh,{}),(0,L.jsx)(kg,{label:`Model`,children:(0,L.jsx)(`span`,{className:H(!a.model&&`text-muted-foreground`),children:a.model??`—`})}),(0,L.jsx)(Wh,{}),(0,L.jsx)(kg,{label:`Plugins`,children:!a.plugins||a.plugins.length===0?(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):(0,L.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:a.plugins.map(e=>(0,L.jsxs)(`li`,{"data-testid":`activity-plugin-${e.name}`,className:`flex items-center gap-2 overflow-hidden`,children:[(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground`,children:e.displayName})}),(0,L.jsx)(ld,{children:e.name})]}),e.defaultIncluded&&(0,L.jsx)(q,{variant:`secondary`,className:`shrink-0`,children:`default`})]},e.name))})})]}):(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] text-muted-foreground`,children:`No SolverNet selected.`})]})]})})]})})}function jg(e){let t=new Date(e);return`${String(t.getUTCHours()).padStart(2,`0`)}:${String(t.getUTCMinutes()).padStart(2,`0`)} UTC`}function Mg({aiUnits:e}){if(!e)return null;let t=e.credentials.filter(e=>e.paused);return t.length===0?null:(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(e=>{let t=e.unitsThisBlock>=e.capPerBlock?`block`:`week`,n=t===`block`?e.blockResetsAt:e.weekResetsAt,r=t===`block`?`6h`:`7d`;return(0,L.jsxs)(no,{variant:`warning`,"data-testid":`ai-units-pause-alert-${e.credentialId}`,children:[(0,L.jsx)(En,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,L.jsxs)(ro,{className:`font-mono text-[13px]`,children:[`Paused — `,r,` AI-unit cap reached`]}),(0,L.jsx)(K,{className:`font-mono text-[12px] text-muted-foreground`,children:(0,L.jsxs)(`span`,{children:[`Credential `,(0,L.jsx)(`span`,{className:`text-foreground`,children:e.credentialId}),` used`,` `,t===`block`?`${e.unitsThisBlock} / ${e.capPerBlock} units this block`:`${e.unitsThisWeek} / ${e.capPerWeek} units this 7-day window`,`. Claims resume at `,(0,L.jsx)(`span`,{className:`text-foreground`,children:jg(n)}),`.`]})})]},e.credentialId)})})}var Ng=[{name:`network-tools`,version:`0.1.0`,defaultIncluded:!0},{name:`claude-code-learner`,version:`0.2.0`,defaultIncluded:!0}],Pg=new Set([`swe-rebench-v2-runtime`]),Fg={"network-tools":`Network Tools`,"claude-code-learner":`Learner`,"swe-rebench-v2-runtime":`SWE-rebench v2 Runtime`,"jinn-prediction-plugin":`Prediction Runtime`},Ig=`bundled:`;function Lg(e){return Fg[e]??e}function Rg(e){return e.startsWith(Ig)?e.slice(8):e}function zg(e){let t=Ed(e)===Cd;return Ng.filter(e=>!(t&&e.name===`claude-code-learner`)).map(e=>({name:e.name,displayName:Lg(e.name),source:`bundled`,version:e.version,defaultIncluded:!0}))}function Bg({harness:e,explicit:t,disabledDefaults:n,catalogCompatible:r=[]}){let i=new Set(n.map(Rg)),a=new Set(t.map(Rg));new Map(t.map(e=>[Rg(e),e]));let o=[],s=new Set;for(let t of zg(e))s.has(t.name)||(s.add(t.name),!i.has(t.name)&&o.push(t));for(let e of r){if(s.has(e.name))continue;s.add(e.name);let t=Pg.has(e.name),n=a.has(e.name);!t&&!n||t&&i.has(e.name)||o.push({name:e.name,displayName:Lg(e.name),source:`catalog`,version:e.version,defaultIncluded:t})}for(let e of t){let t=Rg(e);s.has(t)||(s.add(t),o.push({name:t,displayName:Lg(t),source:e.startsWith(Ig)?`bundled`:`custom`,version:`configured`,defaultIncluded:!1}))}return o}function Vg(e){if(!e||!/^\d+$/.test(e))return`—`;try{let t=BigInt(e);return(Number(t)/0xde0b6b3a7640000).toFixed(4)}catch{return`—`}}function Hg(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/0xde0b6b3a7640000).toFixed(6)} ETH`}catch{return null}}function Ug(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function Wg(){let[e,t]=(0,I.useState)(null),{data:n,isError:r}=dt({queryKey:[`status`],queryFn:()=>z.getStatus(),refetchInterval:5e3}),{data:i}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:3e4}),{data:a}=dt({queryKey:[`solvernets`,`catalog`],queryFn:()=>z.getSolverNets(),refetchInterval:5*6e4}),o=(n?.fleet?.services??[]).map(e=>({index:e.index,serviceId:e.serviceId??null,safeAddress:e.safeAddress??``,agentId:e.agentId??null,safeBoundToAgent:e.safeBoundToAgent??!1})),s=o.find(e=>e.serviceId!==null)?.serviceId??null,c=n?.tJinn?.state??`pending`,l=n?.tJinn?.state===`ready`?Vg(n.tJinn.safeBalanceWei??`0`):Vg(n?.tJinn?.safeBalanceWei??void 0),u=n?.tJinn?.operatorMintedLast24hWei==null?null:Vg(n.tJinn.operatorMintedLast24hWei),d=n?.tJinn?.error??null,f=Vg(n?.masterGas?.balanceWei),p=n?.masterGas?.runwayDaysExcess??`—`,m=n?.balances?.eth,h=Vg(m?.master?.balanceWei??void 0),g=Vg(m?.agent?.balanceWei??void 0),_=Vg(m?.safe?.balanceWei??void 0),v=(0,I.useMemo)(()=>{let e=[],t=i?.joinedSolverNets;if(!t)return e;for(let[n,r]of Object.entries(t)){if(!r)continue;let t=r.contract?a?.nets.find(e=>e.contract.id===r.contract?.id&&e.contract.version===r.contract?.version):void 0,i=Bg({harness:r.harness,explicit:Array.isArray(r.plugins)?r.plugins:[],disabledDefaults:Array.isArray(r.disabledDefaultPlugins)?r.disabledDefaultPlugins:[],catalogCompatible:t?.compatiblePlugins});e.push({name:r.name??r.manifestCid??n,manifestCid:r.manifestCid??n,solverType:r.contract?`${r.contract.id}.${r.contract.version}`:void 0,roles:Array.isArray(r.roles)?r.roles:[],harness:r.harness,model:r.model,plugins:i})}return e},[i,a]),y=(0,I.useMemo)(()=>{let e=new Map,t=t=>{if(t)for(let n of t)n.requestId&&(e.has(n.requestId)||e.set(n.requestId,{requestId:n.requestId,manifestCid:n.manifestCid??null,solverType:n.solverType??null,taskRole:n.taskRole,state:n.state,implName:n.implName??null,windowStartTs:n.windowStartTs??0,runStartedAt:n.runStartedAt??null,stateUpdatedAt:n.stateUpdatedAt,deliveryTxHash:n.deliveryTxHash??null,failureReason:n.failureReason??null}))};return t(n?.taskRuns?.recentTasks),t(n?.taskRuns?.inFlight),t(n?.predictionV1?.recentTasks),Array.from(e.values()).sort((e,t)=>t.stateUpdatedAt-e.stateUpdatedAt)},[n]),b=r&&n===void 0?`stopped`:`running`,x=(e,n,r)=>{t(e),Promise.resolve().then(n).then(t=>{Oh.success(e,{description:t?.message,duration:r?.autoClearMs??5e3})}).catch(t=>{Oh.error(`${e} failed`,{description:t instanceof Error?t.message:String(t),duration:1/0})}).finally(()=>t(null))};return(0,L.jsxs)(`div`,{"data-testid":`overview-page-grid`,className:`grid items-start gap-6 p-6 [grid-template-columns:minmax(0,1fr)_minmax(0,380px)]`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,L.jsx)(Mg,{aiUnits:n?.aiUnits}),(0,L.jsx)(Ag,{joined:v,tasks:y})]}),(0,L.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(dg,{daemonStatus:b,daemonStateMessage:void 0,rpcStatus:`healthy`,onStop:async()=>{if(!(await z.stopDaemon()).ok)throw Error(`Stop request failed.`)},onRestart:async()=>{if(!(await z.restartDaemon({forceRespawn:!0})).ok)throw Error(`Restart request failed.`)}}),(0,L.jsx)(sg,{masterAddress:i?.master_address??null,agentAddress:null,safeAddress:o[0]?.safeAddress??null,serviceId:s,agentId:o[0]?.agentId??null,services:o}),(0,L.jsx)(Zh,{totalEth:f,runwayDays:p,actionsDisabled:e!==null,perRole:{master:h,agent:g,safe:_},tjinnEarned:l,tjinnEarnedLast24h:u,tjinnState:c,tjinnError:d,lastPasswordRotationAt:n?.security?.lastPasswordRotationAt??null,onTopUp:()=>x(`Top up gas`,async()=>{let e=await z.triggerDrip({singleDrip:!0});if(!e.ok)throw Error(e.reason??`Gas top-up failed.`);let t=e.txHash??e.txHashes?.at(-1);if(!t)return{message:`Gas top-up checked; the faucet sent no funds.`};let n=Hg(e.deltaWei),r=Ug(t);return{message:n?`Gas topped up: +${n} · tx ${r}`:`Gas top-up sent · tx ${r}`}},{autoClearMs:5e3})})]})]})}var Gg=[`task_posted`,`intent_registry_failed`,`request_claimed`,`delivery_submitted`,`evaluation_submitted`,`reward_claimed`,`balance_topup`,`jinn_claim_emitted`,`jinn_claim_ticket_recorded`,`jinn_claim_submitted`,`jinn_claim_canonical_skip`,`engine_transition`,`tick_error`,`race_lost`,`startup`,`shutdown`],Kg={task_posted:{label:`Task posted`,description:`A new task intent was published on-chain.`,tone:`info`},intent_registry_failed:{label:`Intent registry failed`,description:`Posting a task intent to the registry did not succeed.`,tone:`error`},request_claimed:{label:`Request claimed`,description:`The solver claimed a task request to work on.`,tone:`info`},delivery_submitted:{label:`Delivery submitted`,description:`A completed solution was delivered on-chain.`,tone:`success`},evaluation_submitted:{label:`Evaluation submitted`,description:`An evaluation verdict was submitted for a delivery.`,tone:`success`},reward_claimed:{label:`Reward claimed`,description:`Staking rewards were claimed to the operator's safe.`,tone:`reward`},balance_topup:{label:`Balance top-up`,description:`Gas balance was topped up from the faucet.`,tone:`info`},jinn_claim_emitted:{label:`Testnet JINN claim emitted`,description:`A testnet JINN (tJINN) earnings claim was emitted locally.`,tone:`info`},jinn_claim_ticket_recorded:{label:`Testnet JINN ticket recorded`,description:`A testnet JINN (tJINN) claim ticket was recorded for later submission.`,tone:`info`},jinn_claim_submitted:{label:`Testnet JINN claim submitted`,description:`A testnet JINN (tJINN) earnings claim was submitted on-chain.`,tone:`success`},jinn_claim_canonical_skip:{label:`Testnet JINN claim skipped`,description:`A testnet JINN (tJINN) claim was skipped as already canonical.`,tone:`neutral`},engine_transition:{label:`Engine transition`,description:`A task run moved to a new lifecycle state.`,tone:`info`},tick_error:{label:`Tick error`,description:`An error occurred during a daemon polling tick.`,tone:`error`},race_lost:{label:`Race lost`,description:`A claim or evaluation lost the on-chain race (task already filled or evaluation deadline passed); no action needed.`,tone:`neutral`},startup:{label:`Daemon started`,description:`The jinn daemon process started.`,tone:`neutral`},shutdown:{label:`Daemon stopped`,description:`The jinn daemon process shut down.`,tone:`neutral`}};function qg(e){let t=e.replace(/_/g,` `).trim();return t.length===0?`Event`:t.charAt(0).toUpperCase()+t.slice(1)}function Jg(e){return Kg[e]||{label:qg(e),description:`A daemon lifecycle event.`,tone:`neutral`}}function Yg(e,t){if(t===`failed`)return`destructive`;if(t===`warn`)return`warning`;let n=Jg(e).tone;return n===`error`?`destructive`:n===`warning`?`warning`:n===`success`||n===`reward`?`success`:n===`neutral`?`secondary`:`default`}var Xg=50;function Zg(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace(`T`,` `).slice(0,19)}function Qg(e,t=8,n=4){return e.length<=t+n+1?e:`${e.slice(0,t)}...${e.slice(-n)}`}function $g(e){return e.requestId??e.solverType??`-`}function e_(){let[e]=qt();return(0,I.useMemo)(()=>{let t=e.includes(`?`)?e.split(`?`)[1]:``,n=typeof window>`u`?``:window.location.search.replace(/^\?/,``);return new URLSearchParams(t||n).get(`requestId`)?.trim()||void 0},[e])}function t_({pageSize:e=Xg}={}){let t=e_(),[n,r]=(0,I.useState)([]),[i,a]=(0,I.useState)(`all`),o=pt({queryKey:[`activity-events`,n,i,t,e],queryFn:({pageParam:r})=>z.getActivityEvents({kinds:n.length>0?n:void 0,outcome:i===`all`?void 0:i,requestId:t,beforeId:typeof r==`number`?r:void 0,limit:e}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0}),s=o.data?.pages??[],c=s.flatMap(e=>e.events),l=s[0]?.counts??{};function u(e){r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}return(0,L.jsxs)(`main`,{"data-testid":`events-page`,className:`mx-auto flex w-full max-w-6xl flex-col gap-5 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[32px] font-normal leading-tight text-foreground`,children:`Events`}),(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] text-muted-foreground`,children:`Persistent lifecycle activity from this operator.`})]}),(0,L.jsx)(U,{asChild:!0,variant:`secondary`,size:`sm`,children:(0,L.jsx)(en,{href:`/overview`,"data-testid":`events-back`,children:`Overview`})})]}),t&&(0,L.jsxs)(no,{variant:`info`,"data-testid":`events-request-scope`,children:[(0,L.jsx)(ro,{children:`Request scoped`}),(0,L.jsxs)(K,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`break-all`,children:[`Showing events for `,t]}),(0,L.jsx)(U,{asChild:!0,variant:`link`,size:`sm`,className:`h-auto p-0`,children:(0,L.jsxs)(en,{href:`/events`,"data-testid":`events-clear-request`,children:[(0,L.jsx)(Un,{"aria-hidden":`true`}),`Clear`]})})]})]}),(0,L.jsxs)(W,{children:[(0,L.jsxs)(Li,{children:[(0,L.jsx)(Ri,{children:`Filters`}),(0,L.jsx)(zi,{children:`Kind and outcome filters page through the same durable log.`})]}),(0,L.jsxs)(Bi,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Kind`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Gg.map(e=>{let t=n.includes(e),r=Jg(e);return(0,L.jsxs)(U,{type:`button`,size:`sm`,variant:t?`outline`:`secondary`,"aria-pressed":t?`true`:`false`,"data-testid":`events-kind-filter-${e}`,onClick:()=>u(e),className:`normal-case tracking-normal`,children:[r.label,l[e]!==void 0&&(0,L.jsx)(q,{variant:`secondary`,children:l[e]})]},e)})})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Outcome`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`all`,`ok`,`failed`,`warn`].map(e=>(0,L.jsx)(U,{type:`button`,size:`sm`,variant:i===e?`outline`:`secondary`,"aria-pressed":i===e?`true`:`false`,"data-testid":`events-outcome-${e}`,onClick:()=>a(e),children:e},e))})]})]})]}),(0,L.jsxs)(W,{"data-testid":`events-list-section`,children:[(0,L.jsxs)(Li,{children:[(0,L.jsx)(Ri,{children:`Event Log`}),(0,L.jsxs)(zi,{children:[c.length,` loaded`]})]}),(0,L.jsxs)(Bi,{className:`flex flex-col gap-4`,children:[o.isLoading&&(0,L.jsxs)(`div`,{"data-testid":`events-loading`,className:`flex items-center gap-2 font-mono text-[12px] text-muted-foreground`,children:[(0,L.jsx)(Pn,{className:`animate-spin`,"aria-hidden":`true`}),`Loading events`]}),o.isError&&(0,L.jsxs)(no,{variant:`blocking`,"data-testid":`events-error`,children:[(0,L.jsx)(ro,{children:`Events unavailable`}),(0,L.jsxs)(K,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsx)(`span`,{children:o.error instanceof Error?o.error.message:`Failed to load events.`}),(0,L.jsx)(U,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{o.refetch()},children:`Retry`})]})]}),!o.isLoading&&!o.isError&&c.length===0&&(0,L.jsx)(`p`,{"data-testid":`events-empty`,className:`m-0 font-mono text-[12px] text-muted-foreground`,children:`No events match the current filters.`}),c.length>0&&(0,L.jsx)(`div`,{"data-testid":`events-list`,className:`overflow-x-auto`,children:(0,L.jsxs)(fg,{children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{className:`hover:bg-transparent`,children:[(0,L.jsx)(_g,{children:`Time`}),(0,L.jsx)(_g,{children:`Kind`}),(0,L.jsx)(_g,{children:`Subject`}),(0,L.jsx)(_g,{children:`Outcome`}),(0,L.jsx)(_g,{children:`Tx`}),(0,L.jsx)(_g,{className:`w-8`})]})}),(0,L.jsx)(mg,{children:c.map(e=>{let t=Jg(e.kind);return(0,L.jsxs)(gg,{"data-testid":`events-row`,children:[(0,L.jsx)(vg,{className:`whitespace-nowrap text-muted-foreground`,children:Zg(e.ts)}),(0,L.jsx)(vg,{children:(0,L.jsx)(q,{variant:Yg(e.kind,e.outcome),children:t.label})}),(0,L.jsx)(vg,{className:`max-w-[280px] font-mono text-[12px]`,children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`span`,{className:H(e.requestId&&`cursor-help`),children:e.requestId?Qg(e.requestId):$g(e)})}),e.requestId&&(0,L.jsx)(ld,{children:e.requestId})]})}),(0,L.jsx)(vg,{children:(0,L.jsx)(q,{variant:Yg(e.kind,e.outcome),children:e.outcome??`-`})}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:e.txHash?Qg(e.txHash,6,4):`-`}),(0,L.jsx)(vg,{className:`text-right`,children:(0,L.jsx)(U,{asChild:!0,variant:`ghost`,size:`icon`,"aria-label":`Inspect event ${e.id}`,children:(0,L.jsx)(en,{href:`/events/${e.id}`,"data-testid":`events-row-link`,children:(0,L.jsx)(Cn,{"aria-hidden":`true`})})})})]},e.id)})})]})}),o.hasNextPage&&(0,L.jsxs)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`events-load-more`,disabled:o.isFetchingNextPage,onClick:()=>{o.fetchNextPage()},className:`self-start`,children:[o.isFetchingNextPage&&(0,L.jsx)(Pn,{className:`animate-spin`,"aria-hidden":`true`}),o.isFetchingNextPage?`Loading`:`Load more`]})]})]})]})}function n_(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().replace(`T`,` `).slice(0,19)} UTC`}function r_(e){return e===`base`?`https://basescan.org`:`https://sepolia.basescan.org`}function i_({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid gap-1 py-2 sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-4`,children:[(0,L.jsx)(`dt`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`m-0 break-all font-mono text-[12px] text-foreground`,children:t})]})}function a_(){let e=Gt().id??``,{data:t}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap()}),{data:n,isLoading:r,isError:i,error:a,refetch:o}=dt({queryKey:[`activity-events`,`detail`,e],queryFn:()=>z.getActivityEvent(e),enabled:e.length>0}),s=n?Jg(n.kind):null,c=r_(t?.chain);return(0,L.jsxs)(`main`,{"data-testid":`event-detail`,className:`mx-auto flex w-full max-w-4xl flex-col gap-5 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[32px] font-normal leading-tight text-foreground`,children:s?s.label:`Event`}),(0,L.jsxs)(`p`,{className:`m-0 font-mono text-[12px] text-muted-foreground`,children:[`Event `,e]})]}),(0,L.jsx)(U,{asChild:!0,variant:`secondary`,size:`sm`,children:(0,L.jsxs)(en,{href:`/events`,"data-testid":`event-detail-back`,children:[(0,L.jsx)(bn,{"aria-hidden":`true`}),`Events`]})})]}),r&&(0,L.jsxs)(`div`,{"data-testid":`event-detail-loading`,className:`flex items-center gap-2 font-mono text-[12px] text-muted-foreground`,children:[(0,L.jsx)(Pn,{className:`animate-spin`,"aria-hidden":`true`}),`Loading event`]}),i&&(0,L.jsxs)(no,{variant:`blocking`,"data-testid":`event-detail-error`,children:[(0,L.jsx)(ro,{children:`Event unavailable`}),(0,L.jsxs)(K,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsx)(`span`,{children:a?.status===404?`This event could not be found.`:a instanceof Error?a.message:`Failed to load this event.`}),(0,L.jsx)(U,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{o()},children:`Retry`})]})]}),n&&s&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(W,{"data-testid":`event-detail-summary`,children:[(0,L.jsxs)(Li,{children:[(0,L.jsx)(Ri,{children:`Summary`}),(0,L.jsx)(zi,{children:s.description})]}),(0,L.jsxs)(Bi,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(q,{variant:Yg(n.kind,n.outcome),children:n.outcome??`-`}),(0,L.jsx)(q,{variant:`outline`,children:n_(n.ts)})]})]}),(0,L.jsxs)(W,{"data-testid":`event-detail-payload`,children:[(0,L.jsxs)(Li,{children:[(0,L.jsx)(Ri,{children:`Details`}),(0,L.jsx)(zi,{children:`Raw event fields from the persistent activity log.`})]}),(0,L.jsx)(Bi,{children:(0,L.jsxs)(`dl`,{className:`m-0`,children:[(0,L.jsx)(i_,{label:`Event id`,children:n.id}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Kind`,children:n.kind}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Request id`,children:n.requestId??`-`}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Service index`,children:n.serviceIndex===null?`-`:n.serviceIndex}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Solver type`,children:n.solverType??`-`}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Transaction`,children:n.txHash?(0,L.jsx)(U,{asChild:!0,variant:`link`,size:`sm`,className:`h-auto justify-start p-0 font-mono text-[12px] normal-case tracking-normal`,children:(0,L.jsxs)(`a`,{"data-testid":`event-detail-tx-link`,href:`${c}/tx/${n.txHash}`,target:`_blank`,rel:`noreferrer`,children:[n.txHash,(0,L.jsx)(An,{"aria-hidden":`true`})]})}):`-`}),(0,L.jsx)(Wh,{}),(0,L.jsx)(i_,{label:`Detail`,children:n.detail??`-`})]})})]})]})]})}function o_(e,t){let n=e??[];return n.includes(t)?n:[...n,t]}function s_(e){if(!e||!/^\d+$/.test(e))return`—`;try{let t=BigInt(e);return t===0n?`0 ETH`:t>=100000000000000n?`${c_(t,18,t>=1000000000000000000n?4:6)} ETH`:t>=1000000000n?`${c_(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return`—`}}function c_(e,t,n){let r=10n**BigInt(t),i=e/r,a=e%r;if(a===0n||n===0)return i.toString();let o=a.toString().padStart(t,`0`).slice(0,n).replace(/0+$/,``);return o?`${i}.${o}`:i.toString()}function l_(e){let t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw Error(`not a non-negative integer`);return BigInt(t)}var u_={launching:{variant:`default`,label:`Launching`},launched:{variant:`success`,label:`Launched`},paused:{variant:`pill`,label:`Paused`},retired:{variant:`outline`,label:`Retired`},failed:{variant:`destructive`,label:`Failed`}};function d_(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function f_(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace(`T`,` `).slice(0,16)+` UTC`}catch{return e}}function p_({status:e}){let t=u_[e]??u_.launching;return(0,L.jsx)(q,{variant:t.variant,className:`whitespace-nowrap`,children:t.label})}function m_({postCounts:e,loading:t,error:n}){let r;return r=n?(0,L.jsx)(`span`,{className:`text-[var(--wane)]`,children:`posts unavailable`}):t&&!e?(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`…`}):!e||e.h24===0?(0,L.jsx)(`span`,{className:`text-[var(--fg-dim)]`,children:`No recent posts`}):(0,L.jsxs)(`span`,{className:`text-[var(--fg-muted)]`,children:[e.h1,` · `,e.h6,` · `,e.h24]}),(0,L.jsxs)(`div`,{"data-testid":`launcher-owned-row-postcounts`,className:`flex flex-col items-end gap-0.5 font-mono text-[12px]`,children:[(0,L.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:`recent posts (1h · 6h · 24h)`}),r]})}function h_({label:e}){return(0,L.jsx)(q,{"data-testid":`launcher-owned-row-role`,variant:`outline`,className:`normal-case tracking-[0.12em] text-[var(--fg-muted)]`,children:e})}function g_({record:e,postCounts:t,postCountsLoading:n,postCountsError:r}){let[,i]=qt(),a=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,o=e.summary,s=o?.name??e.solverNetId,c=o===void 0?null:`${o.contractId}.${o.contractVersion}`;return(0,L.jsx)(`a`,{href:a,"data-testid":`launcher-owned-row`,"data-solvernet-id":e.solverNetId,"data-has-summary":o===void 0?`false`:`true`,onClick:e=>{e.preventDefault(),i(a)},className:`block text-inherit no-underline`,children:(0,L.jsxs)(W,{className:H(`grid grid-cols-[1fr_auto] items-center gap-4 p-4`,`transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer`),children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,L.jsx)(`div`,{"data-testid":`launcher-owned-row-primary`,className:H(`truncate text-foreground`,o===void 0?`font-mono text-[14px] font-medium`:`font-serif text-[18px] font-normal tracking-[-0.01em]`),children:s}),c!==null&&(0,L.jsx)(`div`,{"data-testid":`launcher-owned-row-contract`,className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:c}),o!==void 0&&(0,L.jsxs)(`div`,{"data-testid":`launcher-owned-row-prices`,className:`flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]`,children:[(0,L.jsxs)(`span`,{children:[`solution `,s_(o.solutionPriceWei)]}),(0,L.jsxs)(`span`,{children:[`verdict `,s_(o.verdictPriceWei)]})]}),o!==void 0&&o.openRoles.length>0&&(0,L.jsx)(`div`,{"data-testid":`launcher-owned-row-roles`,className:`flex flex-wrap gap-1.5`,children:o.openRoles.map(e=>(0,L.jsx)(h_,{label:e},e))}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]`,children:[(0,L.jsxs)(`span`,{children:[`cid `,d_(e.manifestCid)]}),(0,L.jsxs)(`span`,{children:[`launched `,f_(e.launchedAt)]})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,L.jsx)(p_,{status:e.status}),(0,L.jsx)(m_,{postCounts:t,loading:n,error:r})]})]})})}function __(){return(0,L.jsxs)(W,{"data-testid":`launcher-empty-state`,className:`flex flex-col gap-3.5 p-8`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground`,children:`No SolverNets created yet.`}),(0,L.jsx)(`p`,{className:`m-0 text-[14px] leading-relaxed text-[var(--fg-muted)]`,children:`Create a SolverNet to direct operators toward a specific kind of knowledge work.`}),(0,L.jsx)(`div`,{children:(0,L.jsx)(U,{asChild:!0,variant:`default`,size:`lg`,children:(0,L.jsx)(en,{href:`/launcher/create`,children:`Create SolverNet`})})})]})}function v_(){let{data:e,isLoading:t,isError:n,error:r,refetch:i}=dt({queryKey:[`solvernets`,`launched`,`owned`],queryFn:()=>z.solvernets.listLaunched(),refetchInterval:3e4}),a=(e?.records??[]).map(e=>e.manifestCid),o=dt({queryKey:[`discovery`,`task-post-counts`,`launcher`,a],queryFn:()=>z.discovery.getTaskPostCounts(a),enabled:a.length>0,refetchInterval:3e4}),s=o.data?.byCid;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[32px] font-normal text-foreground`,children:`Your SolverNets`}),(e?.records.length??0)>0&&(0,L.jsx)(U,{asChild:!0,variant:`default`,"data-testid":`launcher-create-cta`,children:(0,L.jsx)(en,{href:`/launcher/create`,children:`Create SolverNet`})})]}),t&&(0,L.jsx)(`p`,{"data-testid":`launcher-loading`,className:`m-0 font-mono text-[13px] text-[var(--fg-muted)]`,children:`Loading…`}),n&&(0,L.jsxs)(no,{"data-testid":`launcher-error`,variant:`blocking`,className:`flex items-center justify-between gap-4 border-l-0 border border-destructive p-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(ro,{className:`font-mono text-[13px] font-medium text-destructive`,children:`Failed to load your SolverNets.`}),(0,L.jsx)(K,{className:`text-[12px] text-[var(--fg-muted)]`,children:r instanceof Error?r.message:`Unknown error`})]}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>{i()},children:`Retry`})]}),!t&&!n&&e&&e.records.length===0&&(0,L.jsx)(__,{}),!t&&!n&&e&&e.records.length>0&&(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.records.map(e=>(0,L.jsx)(g_,{record:e,postCounts:s?.[e.manifestCid],postCountsLoading:o.isLoading,postCountsError:o.isError},e.solverNetId))})]})}var y_=I.forwardRef(({className:e,type:t,...n},r)=>(0,L.jsx)(`input`,{type:t,ref:r,className:H(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-[13px] text-foreground transition-colors`,`placeholder:text-[var(--fg-dim)]`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n}));y_.displayName=`Input`;function b_({current:e,total:t=5}){return(0,L.jsxs)(`div`,{"data-testid":`launcher-create-progress`,className:`flex items-center gap-3 font-mono text-[11px] uppercase tracking-[0.14em] text-fg-muted`,children:[(0,L.jsxs)(`span`,{"data-testid":`launcher-create-step-counter`,children:[`Step `,e,` of `,t]}),(0,L.jsx)(`div`,{className:`flex max-w-[320px] flex-1 gap-1`,children:Array.from({length:t}).map((t,n)=>{let r=n+1,i=r<=e;return(0,L.jsx)(`span`,{"data-testid":`launcher-create-progress-pip-${r}`,"data-filled":i?`true`:`false`,className:H(`h-[3px] flex-1 rounded-sm`,i?`bg-accent-sky`:`bg-border`)},r)})})]})}function x_({step:e,total:t=5,title:n,blurb:r,children:i,footer:a,error:o}){return(0,L.jsxs)(`main`,{"data-testid":`launcher-create-step-${e}`,className:`mx-auto flex max-w-[720px] flex-col gap-5 p-6`,children:[(0,L.jsx)(b_,{current:e,total:t}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground`,children:n}),r&&(0,L.jsx)(`p`,{className:`m-0 text-[14px] leading-relaxed text-fg-muted`,children:r})]}),o&&(0,L.jsx)(no,{variant:`blocking`,"data-testid":`launcher-create-error`,className:`font-mono text-[13px]`,children:(0,L.jsx)(K,{children:o})}),(0,L.jsx)(`div`,{className:`flex flex-col gap-4`,children:i}),(0,L.jsx)(Wh,{}),(0,L.jsx)(`div`,{className:`flex items-center justify-between gap-3`,children:a})]})}function S_({onBack:e,onNext:t,nextLabel:n=`Next`,nextDisabled:r=!1,busy:i=!1,right:a}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{children:e&&(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`lg`,"data-testid":`launcher-create-back`,onClick:e,disabled:i,children:`Back`})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,t&&(0,L.jsx)(U,{type:`button`,size:`lg`,"data-testid":`launcher-create-next`,onClick:t,disabled:r||i,children:n})]})]})}function C_({label:e,helperText:t,error:n,children:r,asLabel:i=!0}){let a=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(cp,{children:e}),r,n?(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-break-red`,children:n}):t&&(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-fg-dim`,children:t})]});return i?(0,L.jsx)(`label`,{className:`flex flex-col gap-1.5`,children:a}):(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:a})}var w_=`flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;function T_({draft:e,onAdvance:t,busy:n,error:r}){let[i,a]=(0,I.useState)(e.name??``),[o,s]=(0,I.useState)(e.description??``),[c,l]=(0,I.useState)(!1),u=c&&i.trim().length===0?`Name is required.`:null,d=c&&o.trim().length===0?`Description is required.`:null,f=async n=>{n?.preventDefault(),l(!0),!(i.trim().length===0||o.trim().length===0)&&await t({name:i.trim(),description:o.trim(),completedSteps:o_(e.completedSteps,`define`)})};return(0,L.jsx)(x_,{step:1,title:`Name your SolverNet`,blurb:`Pick a short, recognisable name and describe what kind of knowledge work this SolverNet directs operators toward.`,error:r,footer:(0,L.jsx)(S_,{onNext:()=>{f()},nextDisabled:i.trim().length===0||o.trim().length===0,busy:n}),children:(0,L.jsxs)(`form`,{onSubmit:e=>{f(e)},className:`flex flex-col gap-4`,children:[(0,L.jsx)(C_,{label:`Name`,error:u,helperText:`Shown in the registry catalog and the operator opt-in cards.`,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-name`,type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Polymarket forecasts`,className:H(u&&`border-break-red`),disabled:n})}),(0,L.jsx)(C_,{label:`Description`,error:d,helperText:`One or two sentences. Operators read this when deciding whether to opt in.`,children:(0,L.jsx)(`textarea`,{"data-testid":`launcher-create-description`,value:o,onChange:e=>s(e.target.value),rows:4,placeholder:`Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.`,className:H(w_,`min-h-[96px] resize-y`,d&&`border-break-red`),disabled:n})}),(0,L.jsx)(U,{type:`submit`,className:`hidden`,"aria-hidden":!0,tabIndex:-1})]})})}var E_={id:`prediction`,version:`v1`,name:`Prediction`,description:`Forecast resolved outcomes. Solvers submit a probability for a binary market; evaluators score against the on-chain resolution using Brier loss.`,schemas:{task:{name:`prediction.v1 Task`,description:`A binary Polymarket market with resolution time, condition id, and orderbook snapshot.`},solution:{name:`prediction.v1 Solution`,description:`A scalar probability in [0, 1] that the market resolves YES.`},verdict:{name:`prediction.v1 Verdict`,description:`Brier-loss score derived from the solver probability and the resolved outcome.`}},evaluationFunction:{id:`prediction.brier-loss.v1`,deterministic:!0,inputs:[`prediction.v1 Task`,`prediction.v1 Solution`,`Polymarket/UMA resolution`],output:`prediction.v1 Verdict`},aggregationFunction:{id:`prediction.trailing-mean-brier-spread.v1`,deterministic:!0,inputs:[`SCORED prediction.v1 Verdicts`],output:`trailing mean brierSpread`,windowDays:84},claimPolicyDefaults:{mode:`parallel`,maxClaims:25,maxClaimsPerOperator:1,claimLeaseTtlSeconds:1800},credentialRequirements:{creator:[{id:`polymarket.public.market-data.read`,kind:`public-api`,required:!0,description:`Read public Polymarket market metadata and orderbook snapshots for Task creation.`}],solver:[],evaluator:[{id:`polymarket.public.resolution.read`,kind:`public-api`,required:!0,description:`Read public Polymarket/UMA final market state for resolution mapping.`}]},generatorDefaults:{cadenceMs:360*60*1e3,submissionWindowMs:360*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:`10000`,minVolume24hUsd:`2500`,maxYesSpread:`0.10`,maxOrderbookAgeSeconds:60}},D_={id:`swe-rebench-v2`,version:`v1`,name:`SWE-rebench v2`,description:`Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.`,schemas:{task:{name:`swe-rebench-v2.v1 Task`,description:`A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement.`},solution:{name:`swe-rebench-v2.v1 Solution`,description:`A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload.`},verdict:{name:`swe-rebench-v2.v1 Verdict`,description:`Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata.`}},evaluationFunction:{id:`swe-rebench-v2.docker-test-suite.v1`,deterministic:!0,inputs:[`swe-rebench-v2.v1 Task`,`swe-rebench-v2.v1 Solution`,`per-instance Docker image`],output:`swe-rebench-v2.v1 Verdict`},aggregationFunction:{id:`swe-rebench-v2.multi-winrate.v1`,deterministic:!0,inputs:[`SCORED swe-rebench-v2.v1 Verdicts`],output:`mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate`,windowDays:30},claimPolicyDefaults:{mode:`parallel`,maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:3600},credentialRequirements:{creator:[{id:`huggingface.public.datasets-server.read`,kind:`public-api`,required:!0,description:`Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits.`}],solver:[],evaluator:[{id:`docker.local.run`,kind:`local-runtime`,required:!0,description:`Run per-instance Docker images that ship with the upstream eval.py harness.`},{id:`huggingface.public.datasets-server.read`,kind:`public-api`,required:!0,description:`Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS.`}]},generatorDefaults:{N_target_successes:5,posting_window_ms:1440*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:3600}},O_={"prediction.v1":E_,"swe-rebench-v2.v1":D_},k_=`font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim`;function A_({draft:e,template:t=E_,onAdvance:n,onBack:r,busy:i,error:a}){return(0,L.jsx)(x_,{step:2,title:`Review contract`,blurb:`The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.`,error:a,footer:(0,L.jsx)(S_,{onBack:r,onNext:()=>{n({templateContractId:t.id,templateContractVersion:t.version,completedSteps:o_(e.completedSteps,`reviewContract`)})},busy:i}),children:(0,L.jsx)(W,{"data-testid":`launcher-create-template`,"data-template-id":`${t.id}.${t.version}`,children:(0,L.jsxs)(Bi,{className:`flex flex-col gap-4 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:k_,children:[t.id,`.`,t.version]}),(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[24px] font-normal text-foreground`,children:t.name}),(0,L.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-fg-muted`,children:t.description})]}),(0,L.jsxs)(j_,{title:`Schemas`,children:[(0,L.jsx)(M_,{label:`Task`,value:t.schemas.task.name,hint:t.schemas.task.description}),(0,L.jsx)(M_,{label:`Solution`,value:t.schemas.solution.name,hint:t.schemas.solution.description}),(0,L.jsx)(M_,{label:`Verdict`,value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),(0,L.jsxs)(j_,{title:`Evaluation function`,children:[(0,L.jsx)(M_,{label:`Id`,value:t.evaluationFunction.id,mono:!0}),(0,L.jsx)(M_,{label:`Deterministic`,value:t.evaluationFunction.deterministic?`yes`:`no`}),(0,L.jsx)(M_,{label:`Inputs`,value:t.evaluationFunction.inputs.join(`, `)}),(0,L.jsx)(M_,{label:`Output`,value:t.evaluationFunction.output})]}),(0,L.jsxs)(j_,{title:`Aggregation function`,children:[(0,L.jsx)(M_,{label:`Id`,value:t.aggregationFunction.id,mono:!0}),(0,L.jsx)(M_,{label:`Window`,value:t.aggregationFunction.windowDays===void 0?`—`:`${t.aggregationFunction.windowDays} days`}),(0,L.jsx)(M_,{label:`Output`,value:t.aggregationFunction.output})]}),(0,L.jsxs)(j_,{title:`Claim policy defaults`,children:[(0,L.jsx)(M_,{label:`Mode`,value:t.claimPolicyDefaults.mode}),(0,L.jsx)(M_,{label:`Max claims`,value:String(t.claimPolicyDefaults.maxClaims)}),(0,L.jsx)(M_,{label:`Per operator`,value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),(0,L.jsx)(M_,{label:`Lease TTL`,value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),(0,L.jsxs)(j_,{title:`Credential requirements`,children:[(0,L.jsx)(N_,{role:`creator`,creds:t.credentialRequirements.creator}),(0,L.jsx)(N_,{role:`solver`,creds:t.credentialRequirements.solver}),(0,L.jsx)(N_,{role:`evaluator`,creds:t.credentialRequirements.evaluator})]})]})})})}function j_({title:e,children:t}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(Wh,{}),(0,L.jsx)(`h3`,{className:H(`m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted`),children:e}),(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t})]})}function M_({label:e,value:t,hint:n,mono:r}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[140px_1fr] items-baseline gap-3`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] tracking-[0.06em] text-fg-dim`,children:e}),(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:H(`text-[13px] text-foreground`,r?`font-mono`:`font-sans`),children:t}),n&&(0,L.jsx)(`span`,{className:`font-mono text-[12px] leading-relaxed text-fg-muted`,children:n})]})]})}function N_({role:e,creds:t}){return(0,L.jsxs)(`div`,{"data-testid":`launcher-create-credentials-${e}`,className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`div`,{className:`font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim`,children:e}),t.length===0?(0,L.jsx)(`div`,{className:`text-[12px] text-fg-muted`,children:`None.`}):t.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-accent-sky`,children:e.id}),(0,L.jsx)(q,{variant:`secondary`,children:e.kind}),e.required&&(0,L.jsx)(q,{variant:`warning`,children:`required`})]}),(0,L.jsx)(`div`,{className:`text-fg-muted`,children:e.description})]},e.id))]})}var P_=`flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-y`;function F_(e){let t=e.template??E_;switch(t.id){case`prediction`:return(0,L.jsx)(U_,{...e,template:t});case`swe-rebench-v2`:return(0,L.jsx)(K_,{...e,template:t});default:return(0,L.jsx)(x_,{step:3,title:`Configure generator`,blurb:`No generator form is registered for this template.`,error:e.error??null,footer:(0,L.jsx)(S_,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:(0,L.jsx)(`div`,{"data-testid":`launcher-create-generator-unsupported`})})}}var I_=6e4;function L_(e,t){return typeof e==`number`&&Number.isFinite(e)?String(e):typeof e==`string`&&e.trim().length>0?e.trim():String(t)}function R_(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).join(`, `):``}function z_(e){let t=E_.generatorDefaults;return{cadenceMs:L_(e?.cadenceMs,t.cadenceMs),windowMs:L_(e?.windowMs??e?.submissionWindowMs,t.submissionWindowMs),resolveGapMs:L_(e?.resolveGapMs,3600*1e3),maxNewRoundsPerPoll:L_(e?.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:L_(e?.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:L_(e?.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:R_(e?.allowlistConditionIds),blocklistConditionIds:R_(e?.blocklistConditionIds)}}function B_(e){let t={},n=V_(e.cadenceMs);n===null?t.cadenceMs=`Must be a positive integer (ms).`:n<I_&&(t.cadenceMs=`Cadence must be at least ${I_/1e3}s.`);let r=V_(e.windowMs);r===null&&(t.windowMs=`Must be a positive integer (ms).`);let i=V_(e.resolveGapMs);i===null&&(t.resolveGapMs=`Must be a positive integer (ms).`);let a=V_(e.maxNewRoundsPerPoll);a===null&&(t.maxNewRoundsPerPoll=`Must be a positive integer.`);let o=V_(e.maxNewRoundsPerDay);o===null&&(t.maxNewRoundsPerDay=`Must be a positive integer.`);let s=V_(e.maxOpenRounds);return s===null&&(t.maxOpenRounds=`Must be a positive integer.`),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:n,windowMs:r,resolveGapMs:i,submissionWindowMs:r,maxNewRoundsPerPoll:a,maxNewRoundsPerDay:o,maxOpenRounds:s,allowlistConditionIds:H_(e.allowlistConditionIds),blocklistConditionIds:H_(e.blocklistConditionIds)}}}function V_(e){let t=e.trim();if(t.length===0||!/^\d+$/.test(t))return null;let n=Number(t);return!Number.isFinite(n)||n<=0?null:n}function H_(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function U_({draft:e,onAdvance:t,onBack:n,busy:r,error:i}){let[a,o]=(0,I.useState)((0,I.useMemo)(()=>z_(e.generatorConfig),[e.generatorConfig])),[s,c]=(0,I.useState)(!1),l=s?B_(a):{ok:!0,errors:{}},u=s?l.errors:{},d=()=>{c(!0);let n=B_(a);!n.ok||!n.generatorConfig||t({generatorConfig:n.generatorConfig,completedSteps:o_(e.completedSteps,`configureGenerator`)})},f=(e,t)=>{o(n=>({...n,[e]:t}))};return(0,L.jsxs)(x_,{step:3,title:`Configure generator`,blurb:`The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.`,error:i,footer:(0,L.jsx)(S_,{onBack:n,onNext:d,busy:r,nextDisabled:s&&!l.ok}),children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-3.5 sm:grid-cols-2`,children:[(0,L.jsx)(C_,{label:`Cadence (ms)`,helperText:`How often the generator polls Polymarket. Minimum 60s.`,error:u.cadenceMs??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-cadenceMs`,type:`text`,inputMode:`numeric`,value:a.cadenceMs,onChange:e=>f(`cadenceMs`,e.target.value),className:H(u.cadenceMs&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Submission window (ms)`,helperText:`How long Tasks stay open for solving.`,error:u.windowMs??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-windowMs`,type:`text`,inputMode:`numeric`,value:a.windowMs,onChange:e=>f(`windowMs`,e.target.value),className:H(u.windowMs&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Resolve gap (ms)`,helperText:`Cushion between window-close and resolution.`,error:u.resolveGapMs??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-resolveGapMs`,type:`text`,inputMode:`numeric`,value:a.resolveGapMs,onChange:e=>f(`resolveGapMs`,e.target.value),className:H(u.resolveGapMs&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Max rounds / poll`,helperText:`Cap on new Tasks per generator tick.`,error:u.maxNewRoundsPerPoll??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-maxNewRoundsPerPoll`,type:`text`,inputMode:`numeric`,value:a.maxNewRoundsPerPoll,onChange:e=>f(`maxNewRoundsPerPoll`,e.target.value),className:H(u.maxNewRoundsPerPoll&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Max rounds / day`,helperText:`Daily ceiling across all polls.`,error:u.maxNewRoundsPerDay??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-maxNewRoundsPerDay`,type:`text`,inputMode:`numeric`,value:a.maxNewRoundsPerDay,onChange:e=>f(`maxNewRoundsPerDay`,e.target.value),className:H(u.maxNewRoundsPerDay&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Max open rounds`,helperText:`Concurrent open Tasks before back-off kicks in.`,error:u.maxOpenRounds??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-maxOpenRounds`,type:`text`,inputMode:`numeric`,value:a.maxOpenRounds,onChange:e=>f(`maxOpenRounds`,e.target.value),className:H(u.maxOpenRounds&&`border-break-red`),disabled:r})})]}),(0,L.jsx)(C_,{label:`Allowlist condition ids`,helperText:`Comma-separated. If non-empty, only these markets are considered.`,children:(0,L.jsx)(`textarea`,{"data-testid":`launcher-create-allowlistConditionIds`,value:a.allowlistConditionIds,onChange:e=>f(`allowlistConditionIds`,e.target.value),rows:2,placeholder:`0xabc…, 0xdef…`,className:P_,disabled:r})}),(0,L.jsx)(C_,{label:`Blocklist condition ids`,helperText:`Comma-separated. Markets here are skipped, even if they pass the eligibility filters.`,children:(0,L.jsx)(`textarea`,{"data-testid":`launcher-create-blocklistConditionIds`,value:a.blocklistConditionIds,onChange:e=>f(`blocklistConditionIds`,e.target.value),rows:2,placeholder:`0xabc…`,className:P_,disabled:r})})]})}function W_(e){let t=D_.generatorDefaults,n=typeof e?.claimPolicy==`object`&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:L_(e?.N_target_successes,t.N_target_successes),posting_window_ms:L_(e?.posting_window_ms,t.posting_window_ms),post_batch_size:L_(e?.post_batch_size,t.post_batch_size),maxClaimsPerOperator:L_(e?.maxClaimsPerOperator??n.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:L_(e?.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function G_(e){let t={},n=V_(e.N_target_successes);n===null&&(t.N_target_successes=`Must be a positive integer.`);let r=V_(e.posting_window_ms);r===null&&(t.posting_window_ms=`Must be a positive integer (ms).`);let i=V_(e.post_batch_size);i===null&&(t.post_batch_size=`Must be a positive integer.`);let a=V_(e.maxClaimsPerOperator);a===null&&(t.maxClaimsPerOperator=`Must be a positive integer.`);let o=V_(e.claimLeaseTtlSeconds);return o===null&&(t.claimLeaseTtlSeconds=`Must be a positive integer (seconds).`),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:n,posting_window_ms:r,post_batch_size:i,maxClaimsPerOperator:a,claimLeaseTtlSeconds:o}}}function K_({draft:e,onAdvance:t,onBack:n,busy:r,error:i}){let[a,o]=(0,I.useState)((0,I.useMemo)(()=>W_(e.generatorConfig),[e.generatorConfig])),[s,c]=(0,I.useState)(!1),l=s?G_(a):{ok:!0,errors:{}},u=s?l.errors:{},d=()=>{c(!0);let n=G_(a);!n.ok||!n.generatorConfig||t({generatorConfig:n.generatorConfig,completedSteps:o_(e.completedSteps,`configureGenerator`)})},f=(e,t)=>{o(n=>({...n,[e]:t}))};return(0,L.jsx)(x_,{step:3,title:`Configure generator`,blurb:`The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.`,error:i,footer:(0,L.jsx)(S_,{onBack:n,onNext:d,busy:r,nextDisabled:s&&!l.ok}),children:(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-3.5 sm:grid-cols-2`,children:[(0,L.jsx)(C_,{label:`Target successful Verdicts per instance`,helperText:`How many score=1 Verdicts saturate a SWE instance and stop further Task posting.`,error:u.N_target_successes??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-N_target_successes`,type:`text`,inputMode:`numeric`,value:a.N_target_successes,onChange:e=>f(`N_target_successes`,e.target.value),className:H(u.N_target_successes&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Posting window (ms)`,helperText:`On-chain claim-window deadline for each posting. Reposts trigger on claim-budget exhaustion observed via the indexer, not this window.`,error:u.posting_window_ms??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-posting_window_ms`,type:`text`,inputMode:`numeric`,value:a.posting_window_ms,onChange:e=>f(`posting_window_ms`,e.target.value),className:H(u.posting_window_ms&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Post batch size`,helperText:`Maximum number of SWE instances to post in one creator tick.`,error:u.post_batch_size??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-post_batch_size`,type:`text`,inputMode:`numeric`,value:a.post_batch_size,onChange:e=>f(`post_batch_size`,e.target.value),className:H(u.post_batch_size&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Max claims per operator`,helperText:`Optional cap; each posting is still limited by remaining target successes.`,error:u.maxClaimsPerOperator??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-maxClaimsPerOperator`,type:`text`,inputMode:`numeric`,value:a.maxClaimsPerOperator,onChange:e=>f(`maxClaimsPerOperator`,e.target.value),className:H(u.maxClaimsPerOperator&&`border-break-red`),disabled:r})}),(0,L.jsx)(C_,{label:`Claim lease (seconds)`,helperText:`How long a claimed SWE task slot stays leased.`,error:u.claimLeaseTtlSeconds??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-claimLeaseTtlSeconds`,type:`text`,inputMode:`numeric`,value:a.claimLeaseTtlSeconds,onChange:e=>f(`claimLeaseTtlSeconds`,e.target.value),className:H(u.claimLeaseTtlSeconds&&`border-break-red`),disabled:r})})]})})}function q_(e,t){let n={},r,i;try{r=l_(e),r===null?n.solutionPriceWei=`Required.`:r<0n&&(n.solutionPriceWei=`Must be non-negative.`)}catch{n.solutionPriceWei=`Must be a non-negative integer (wei).`,r=null}try{i=l_(t),i===null?n.verdictPriceWei=`Required.`:i<0n&&(n.verdictPriceWei=`Must be non-negative.`)}catch{n.verdictPriceWei=`Must be a non-negative integer (wei).`,i=null}return r!==null&&i!==null&&!n.solutionPriceWei&&!n.verdictPriceWei&&r===0n&&i===0n&&(n.combined=`At least one price must be positive.`),{ok:Object.keys(n).length===0,errors:n,solutionWei:r??void 0,verdictWei:i??void 0}}function J_(e,t,n,r){if(!e||!/^\d+$/.test(e)||t===void 0||n===void 0)return null;let i;try{i=BigInt(e)}catch{return null}let a=t+n*BigInt(r);return a<=0n?null:{tasks:Number(i/a),perTaskWei:a}}function Y_({draft:e,template:t=E_,onAdvance:n,onBack:r,fundingSafeAddress:i,fundingSafeBalanceWei:a,busy:o,error:s}){let[c,l]=(0,I.useState)(e.solutionPriceWei??``),[u,d]=(0,I.useState)(e.verdictPriceWei??``),[f,p]=(0,I.useState)(!1),m=(0,I.useMemo)(()=>q_(c,u),[c,u]),h=t.claimPolicyDefaults.maxClaimsPerOperator,g=(0,I.useMemo)(()=>J_(a??null,m.solutionWei,m.verdictWei,h),[a,m.solutionWei,m.verdictWei,h]),_=()=>{p(!0),m.ok&&n({solutionPriceWei:c,verdictPriceWei:u,completedSteps:o_(e.completedSteps,`configurePricing`)})},v=f?m.errors:{};return(0,L.jsxs)(x_,{step:4,title:`Configure pricing`,blurb:`Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.`,error:s,footer:(0,L.jsx)(S_,{onBack:r,onNext:_,busy:o,nextDisabled:f&&!m.ok}),children:[(0,L.jsx)(C_,{label:`Funding Safe`,helperText:`Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.`,asLabel:!1,children:(0,L.jsx)(`div`,{"data-testid":`launcher-create-fundingSafe`,className:`rounded-md border border-border bg-surface-sunken px-3 py-2.5 font-mono text-[13px] text-fg-muted break-all`,children:i??`— (master Safe will be picked at launch)`})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-3.5 sm:grid-cols-2`,children:[(0,L.jsx)(C_,{label:`Solution price (wei)`,helperText:`≈ ${s_(m.solutionWei?.toString())}`,error:v.solutionPriceWei??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-solutionPriceWei`,type:`text`,inputMode:`numeric`,value:c,onChange:e=>l(e.target.value),placeholder:`e.g. 100000000000000 (0.0001 ETH)`,className:H(v.solutionPriceWei&&`border-break-red`),disabled:o})}),(0,L.jsx)(C_,{label:`Verdict price (wei)`,helperText:`≈ ${s_(m.verdictWei?.toString())}`,error:v.verdictPriceWei??null,children:(0,L.jsx)(y_,{"data-testid":`launcher-create-verdictPriceWei`,type:`text`,inputMode:`numeric`,value:u,onChange:e=>d(e.target.value),placeholder:`e.g. 50000000000000 (0.00005 ETH)`,className:H(v.verdictPriceWei&&`border-break-red`),disabled:o})})]}),v.combined&&(0,L.jsx)(`div`,{"data-testid":`launcher-create-pricing-combined-error`,className:`font-mono text-[12px] text-break-red`,children:v.combined}),(0,L.jsx)(W,{"data-testid":`launcher-create-projection`,children:(0,L.jsxs)(Bi,{className:`flex flex-col gap-2.5 p-5`,children:[(0,L.jsx)(`h3`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted`,children:`Runway projection`}),(0,L.jsx)(Wh,{}),(0,L.jsx)(X_,{label:`Safe balance`,value:a?`${s_(a)} (${a} wei)`:`—`}),(0,L.jsx)(X_,{label:`Per-Task cost`,value:g?`${s_(g.perTaskWei.toString())} (${g.perTaskWei} wei)`:`—`,hint:`solution + verdict × maxClaimsPerOperator (${h})`}),(0,L.jsx)(X_,{label:`Projected Tasks`,value:g?`~${g.tasks.toLocaleString(`en-US`)}`:`—`,hint:`Approximate; ignores gas and any in-flight reservations.`,testId:`launcher-create-projected-tasks`})]})})]})}function X_({label:e,value:t,hint:n,testId:r}){return(0,L.jsxs)(`div`,{"data-testid":r,className:`grid grid-cols-[160px_1fr] items-baseline gap-3`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] tracking-[0.06em] text-fg-dim`,children:e}),(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[13px] text-foreground`,children:t}),n&&(0,L.jsx)(`span`,{className:`text-[12px] text-fg-muted`,children:n})]})]})}var Z_=1500,Q_=[`pinning`,`recording`,`broadcasting`,`confirming`,`spawning`],$_={pinning:`Pinning manifest`,recording:`Recording draft`,broadcasting:`Broadcasting tx`,confirming:`Confirming on-chain`,spawning:`Spawning generator`};function ev({draft:e,template:t=E_,onUpdateDraft:n,onBack:r,onLaunchFailure:i,navigateTo:a,pollIntervalMs:o=Z_}){let[,s]=qt(),c=a??s,[l,u]=(0,I.useState)((0,I.useMemo)(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:[`solver`,`evaluator`],[e.openRoles])),[d,f]=(0,I.useState)({kind:`idle`}),p=(0,I.useRef)(!1);(0,I.useEffect)(()=>()=>{p.current=!0},[]);let m=e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},h=async()=>{if(l.length!==0){f(e=>e.kind===`failed`?{kind:`idle`}:e),p.current=!1;try{await n({openRoles:l,completedSteps:o_(e.completedSteps,`configurePricing`)});let t=await z.solvernets.launch(e.draftId);if(p.current)return;let r=`pinning`;for(f({kind:`launching`,phase:r,solverNetId:t.solverNetId});;){if(p.current)return;let e;try{e=await z.solvernets.get(t.solverNetId)}catch{if(p.current)return;await dv(o);continue}if(e.launchProgress?.phase&&(r=e.launchProgress.phase),e.status===`launched`){f({kind:`launching`,phase:`spawning`,solverNetId:t.solverNetId}),c(`/launcher/launched/${encodeURIComponent(t.solverNetId)}`);return}if(e.status===`failed`){f({kind:`failed`,message:e.launchProgress?.txError?.message??`Launch failed during ${r}.`,solverNetId:t.solverNetId}),i?.();return}f({kind:`launching`,phase:r,solverNetId:t.solverNetId}),await dv(o)}}catch(e){if(p.current)return;f({kind:`failed`,message:e instanceof Error?e.message:String(e)}),i?.()}}},g=d.kind===`launching`,_=l.length===0||g;return(0,L.jsxs)(x_,{step:5,title:`Review & launch`,blurb:`One last check. The Launch button signs the manifest, pins it to IPFS, and broadcasts the registry transaction.`,footer:(0,L.jsx)(S_,{onBack:r,onNext:()=>{h()},nextLabel:g?`Launching…`:`Launch`,nextDisabled:_,busy:g,right:g&&(0,L.jsx)(tv,{current:d.kind===`launching`?d.phase:`pinning`})}),children:[(0,L.jsx)(nv,{draft:e,template:t}),(0,L.jsxs)(C_,{label:`Open roles`,helperText:`Operators can opt in to any role you open here. Most launchers want both.`,asLabel:!1,children:[(0,L.jsxs)(`div`,{"data-testid":`launcher-create-openRoles`,className:`flex flex-col gap-2.5`,children:[(0,L.jsx)(uv,{role:`solver`,checked:l.includes(`solver`),onChange:()=>m(`solver`),disabled:g}),(0,L.jsx)(uv,{role:`evaluator`,checked:l.includes(`evaluator`),onChange:()=>m(`evaluator`),disabled:g})]}),l.length===0&&(0,L.jsx)(`span`,{"data-testid":`launcher-create-openRoles-error`,className:`font-mono text-[12px] text-break-red`,children:`At least one role must be open.`})]}),d.kind===`failed`&&(0,L.jsxs)(no,{variant:`blocking`,"data-testid":`launcher-create-launch-failure`,children:[(0,L.jsx)(ro,{className:`font-mono text-[13px] font-medium text-break-red`,children:`Launch failed.`}),(0,L.jsx)(K,{className:`font-mono text-[12px] text-fg-muted`,children:d.message}),(0,L.jsxs)(`div`,{className:`mt-2.5 flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,size:`sm`,"data-testid":`launcher-create-launch-retry`,onClick:()=>{h()},children:`Retry`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-create-launch-abandon`,onClick:()=>{c(`/launcher`)},children:`Abandon`})]})]})]})}function tv({current:e}){let t=Q_.indexOf(e);return(0,L.jsxs)(`div`,{"data-testid":`launcher-create-launch-progress`,"data-phase":e,className:`flex items-center gap-1.5 font-mono text-[11px] tracking-[0.06em] text-fg-muted`,children:[(0,L.jsx)(`span`,{"data-testid":`launcher-create-launch-phase`,children:$_[e]}),(0,L.jsx)(`div`,{className:`flex gap-[3px]`,children:Q_.map((e,n)=>(0,L.jsx)(`span`,{"data-testid":`launcher-create-launch-phase-pip-${e}`,"data-active":n<=t?`true`:`false`,className:H(`h-[3px] w-2 rounded-sm`,n<=t?`bg-accent-sky`:`bg-border`)},e))})]})}function nv({draft:e,template:t}){let n=e.generatorConfig??{};return(0,L.jsx)(W,{"data-testid":`launcher-create-manifest-summary`,children:(0,L.jsxs)(Bi,{className:`flex flex-col gap-3 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim`,children:[e.templateContractId??t.id,`.`,e.templateContractVersion??t.version]}),(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[24px] font-normal text-foreground`,children:e.name??`— unnamed`}),e.description&&(0,L.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-fg-muted`,children:e.description})]}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(cv,{children:[(0,L.jsx)(lv,{label:`Solution price`,value:av(e.solutionPriceWei)}),(0,L.jsx)(lv,{label:`Verdict price`,value:av(e.verdictPriceWei)}),t.id===`prediction`?(0,L.jsx)(rv,{generator:n}):(0,L.jsx)(iv,{generator:n})]})]})})}function rv({generator:e}){let t=ov(e.cadenceMs),n=ov(e.windowMs??e.submissionWindowMs),r=ov(e.maxOpenRounds);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lv,{label:`Cadence`,value:t?`${t} ms`:`—`}),(0,L.jsx)(lv,{label:`Window`,value:n?`${n} ms`:`—`}),(0,L.jsx)(lv,{label:`Max open rounds`,value:r??`—`}),(0,L.jsx)(lv,{label:`Allowlist`,value:sv(e.allowlistConditionIds)}),(0,L.jsx)(lv,{label:`Blocklist`,value:sv(e.blocklistConditionIds)})]})}function iv({generator:e}){let t=ov(e.N_target_successes),n=ov(e.posting_window_ms),r=ov(e.post_batch_size);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lv,{label:`Target successes`,value:t??`—`}),(0,L.jsx)(lv,{label:`Posting window`,value:n?`${n} ms`:`—`}),(0,L.jsx)(lv,{label:`Batch size`,value:r??`—`})]})}function av(e){return e?`${e} wei (${s_(e)})`:`—`}function ov(e){return typeof e==`number`&&Number.isFinite(e)?String(e):typeof e==`string`&&/^\d+$/.test(e.trim())?e.trim():null}function sv(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:`none`}function cv({children:e}){return(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2`,children:e})}function lv({label:e,value:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim`,children:e}),(0,L.jsx)(`span`,{className:`font-mono text-[13px] text-foreground`,children:t})]})}function uv({role:e,checked:t,onChange:n,disabled:r}){return(0,L.jsxs)(`label`,{className:H(`flex items-center gap-2.5`,r?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,L.jsx)(`input`,{"data-testid":`launcher-create-openRoles-${e}`,type:`checkbox`,checked:t,onChange:n,disabled:r,className:`h-4 w-4 cursor-pointer accent-accent-sky`}),(0,L.jsx)(`span`,{className:`font-mono text-[13px] text-foreground`,children:e})]})}function dv(e){return new Promise(t=>setTimeout(t,e))}var fv=`jinn.launcher-create.draftId.v1`;function pv(){if(typeof window>`u`)return null;try{return window.localStorage.getItem(fv)}catch{return null}}function mv(e){if(!(typeof window>`u`))try{e===null?window.localStorage.removeItem(fv):window.localStorage.setItem(fv,e)}catch{}}function hv(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search).get(`template`);return e&&e.length>0?e:null}function gv({templateKey:e}={}){let t=e??hv()??`prediction.v1`,n=(0,I.useMemo)(()=>O_[t]??null,[t]),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(1),[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),p=(0,I.useRef)(!1),{data:m}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:3e4}),{data:h}=dt({queryKey:[`status`],queryFn:()=>z.getStatus(),refetchInterval:3e4}),g=m?.master_address??h?.master_address??null,_=h?.masterGas?.balanceWei??null;(0,I.useEffect)(()=>{if(p.current)return;p.current=!0;let e=!1;return(async()=>{let t=pv();if(t)try{let n=await z.solvernets.getDraft(t);if(e)return;i(n);return}catch{mv(null)}try{let t=await z.solvernets.createDraft();if(e)return;mv(t.draftId),i(t)}catch(t){if(e)return;o(t instanceof Error?t.message:`Failed to create draft.`)}})(),()=>{e=!0}},[]);let v=async e=>{if(r){u(!0),f(null);try{i(await z.solvernets.updateDraft(r.draftId,e)),c(e=>e<5?e+1:e)}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}},y=async e=>{if(r){u(!0),f(null);try{i(await z.solvernets.updateDraft(r.draftId,e))}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}},b=()=>{f(null),c(e=>e>1?e-1:e)},x=()=>{f(null)};if(n===null)return(0,L.jsxs)(`main`,{"data-testid":`launcher-create-unknown-template`,"data-template-key":t,className:`mx-auto flex max-w-[720px] flex-col gap-4 p-6`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[28px] font-normal text-foreground`,children:`Unknown SolverNet template`}),(0,L.jsx)(no,{variant:`blocking`,children:(0,L.jsxs)(K,{className:`font-mono text-[13px]`,children:[`No template registered for `,(0,L.jsx)(`code`,{children:t}),`. Available keys:`,` `,Object.keys(O_).map(e=>`?template=${e}`).join(`, `),`.`]})})]});if(a)return(0,L.jsxs)(`main`,{"data-testid":`launcher-create-bootstrap-error`,className:`mx-auto flex max-w-[720px] flex-col gap-4 p-6`,children:[(0,L.jsx)(`h1`,{className:`m-0 font-serif text-[28px] font-normal text-foreground`,children:`Couldn't start a new draft`}),(0,L.jsxs)(no,{variant:`blocking`,children:[(0,L.jsx)(ro,{className:`font-mono text-[12px]`,children:`Bootstrap error`}),(0,L.jsx)(K,{className:`font-mono text-[13px]`,children:a})]})]});if(!r)return(0,L.jsx)(`main`,{"data-testid":`launcher-create-loading`,className:`p-6 font-mono text-[13px] text-fg-muted`,children:`Loading draft…`});switch(s){case 1:return(0,L.jsx)(T_,{draft:r,onAdvance:v,busy:l,error:d});case 2:return(0,L.jsx)(A_,{draft:r,template:n,onAdvance:v,onBack:b,busy:l,error:d});case 3:return(0,L.jsx)(F_,{draft:r,template:n,onAdvance:v,onBack:b,busy:l,error:d});case 4:return(0,L.jsx)(Y_,{draft:r,template:n,onAdvance:v,onBack:b,fundingSafeAddress:g,fundingSafeBalanceWei:_??null,busy:l,error:d});case 5:return(0,L.jsx)(ev,{draft:r,template:n,onUpdateDraft:y,onBack:b,onLaunchFailure:x});default:return(0,L.jsx)(T_,{draft:r,onAdvance:v,busy:l,error:d})}}function _v(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:``}function vv(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:``}function yv(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace(`T`,` `).slice(0,16)+` UTC`}catch{return e}}var bv={launched:[`paused`,`retired`],paused:[`launched`,`retired`]};function xv(e,t,n){let r=10n**BigInt(t),i=e/r,a=e%r;if(a===0n||n===0)return i.toString();let o=a.toString().padStart(t,`0`).slice(0,n).replace(/0+$/,``);return o?`${i}.${o}`:i.toString()}function Sv(e){if(!e||!/^\d+$/.test(e))return`—`;try{let t=BigInt(e);return t===0n?`0 ETH`:t>=100000000000000n?`${xv(t,18,t>=1000000000000000000n?4:6)} ETH`:t>=1000000000n?`${xv(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return`—`}}var Cv=175000n*11500000n;function wv(e,t,n,r=Cv){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!n||!/^\d+$/.test(n))return null;let i;try{i=BigInt(e)}catch{return null}let a=BigInt(t)+BigInt(n)+r;if(a<=0n)return null;let o=Number(i/a);return{tasks:o,perTaskWei:a,lowRunway:o<100}}var Tv=6e4;function Ev(e){let t=e??{};return{cadenceMs:kv(t.cadenceMs),windowMs:kv(t.windowMs??t.submissionWindowMs),resolveGapMs:kv(t.resolveGapMs),maxNewRoundsPerPoll:kv(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:kv(t.maxNewRoundsPerDay),maxOpenRounds:kv(t.maxOpenRounds),allowlistConditionIds:Av(t.allowlistConditionIds),blocklistConditionIds:Av(t.blocklistConditionIds)}}function Dv(e,t){let n=e??{},r=Ov(n.claimPolicy),i=t?.contract.claimPolicyDefaults??{maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:3600};return{N_target_successes:kv(n.N_target_successes),posting_window_ms:kv(n.posting_window_ms),post_batch_size:kv(n.post_batch_size),maxClaimsPerOperator:kv(n.maxClaimsPerOperator??r.maxClaimsPerOperator??i.maxClaimsPerOperator),claimLeaseTtlSeconds:kv(n.claimLeaseTtlSeconds??r.claimLeaseTtlSeconds??i.claimLeaseTtlSeconds)}}function Ov(e){return typeof e==`object`&&e?e:{}}function kv(e){return typeof e==`number`&&Number.isFinite(e)?String(e):typeof e==`string`&&e.trim().length>0?e.trim():``}function Av(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).join(`, `):``}function jv(e){let t=e.trim();if(!t||!/^\d+$/.test(t))return null;let n=Number(t);return!Number.isFinite(n)||n<=0?null:n}function Mv(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function Nv(e,t){let n={},r={};for(let i of[`cadenceMs`,`windowMs`,`resolveGapMs`,`maxNewRoundsPerPoll`,`maxNewRoundsPerDay`,`maxOpenRounds`]){if(e[i]===t[i]||e[i].trim().length===0)continue;let a=jv(e[i]);if(a===null){n[i]=`Must be a positive integer.`;continue}if(i===`cadenceMs`&&a<Tv){n[i]=`Cadence must be at least ${Tv/1e3}s.`;continue}i===`windowMs`?r.submissionWindowMs=a:r[i]=a}for(let n of[`allowlistConditionIds`,`blocklistConditionIds`])e[n]!==t[n]&&(r[n]=Mv(e[n]));return{ok:Object.keys(n).length===0,patch:r,errors:n}}function Pv(e,t){let n={},r={};for(let i of[`N_target_successes`,`posting_window_ms`,`post_batch_size`,`maxClaimsPerOperator`,`claimLeaseTtlSeconds`]){if(e[i]===t[i]||e[i].trim().length===0)continue;let a=jv(e[i]);if(a===null){n[i]=i===`posting_window_ms`?`Must be a positive integer (ms).`:i===`claimLeaseTtlSeconds`?`Must be a positive integer (seconds).`:`Must be a positive integer.`;continue}r[i]=a}return{ok:Object.keys(n).length===0,patch:r,errors:n}}function Fv(e,t){if(t)return t.id===`swe-rebench-v2`&&t.version===`v1`;if(e.summary?.contractId===`swe-rebench-v2`&&e.summary.contractVersion===`v1`)return!0;let n=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(n,`N_target_successes`)||Object.prototype.hasOwnProperty.call(n,`N_max_postings_per_task`)||Object.prototype.hasOwnProperty.call(n,`posting_window_ms`)||Object.prototype.hasOwnProperty.call(n,`cooldown_ms`)}function Iv({record:e,manifest:t,template:n,onSave:r}){return Fv(e,n)?(0,L.jsx)(zv,{record:e,manifest:t,onSave:r}):(0,L.jsx)(Rv,{record:e,onSave:r})}function Lv({record:e,configExpanded:t,setConfigExpanded:n,children:r}){return(0,L.jsxs)(W,{"data-testid":`launcher-launched-generator-panel`,role:`region`,"aria-label":`Generator`,className:`flex flex-col gap-4 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[22px] font-normal text-foreground`,children:`Generator`}),(0,L.jsx)(Gv,{record:e})]}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-generator-toggle`,"aria-expanded":t,"aria-controls":`launcher-launched-generator-config`,onClick:()=>n(e=>!e),children:t?`Hide config`:`Edit config`})]}),(0,L.jsxs)(`dl`,{className:`m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]`,children:[(0,L.jsx)(Yv,{label:`Last poll`,value:yv(e.generatorState?.lastPollAt),testid:`launcher-launched-generator-last-poll`}),(0,L.jsx)(Yv,{label:`Generator enabled`,value:e.generatorEnabled?`yes`:`no`,testid:`launcher-launched-generator-enabled`})]}),(0,L.jsx)(Vv,{record:e}),(0,L.jsx)(Wv,{record:e}),e.generatorState?.lastError&&(0,L.jsx)(Uv,{record:e}),r]})}function Rv({record:e,onSave:t}){let n=(0,I.useMemo)(()=>Ev(e.generatorConfig),[e.generatorConfig]),[r,i]=(0,I.useState)(n),[a,o]=(0,I.useState)({kind:`idle`}),[s,c]=(0,I.useState)(!1);(0,I.useEffect)(()=>{i(t=>JSON.stringify(t)===JSON.stringify(e())?n:t);function e(){return n}},[JSON.stringify(e.generatorConfig)]);let l=(e,t)=>{i(n=>({...n,[e]:t}))},u=(0,I.useMemo)(()=>Nv(r,n),[r,n]),d=Object.keys(u.patch).length>0,f=a.kind===`saving`;return(0,L.jsx)(Lv,{record:e,configExpanded:s,setConfigExpanded:c,children:s&&(0,L.jsxs)(`div`,{id:`launcher-launched-generator-config`,"data-testid":`launcher-launched-generator-config`,className:`flex flex-col gap-3.5 pt-3.5`,children:[(0,L.jsx)(Wh,{}),(0,L.jsx)(`h3`,{className:`m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Hot-apply config`}),(0,L.jsxs)(`div`,{className:`grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]`,children:[(0,L.jsx)(qv,{label:`Cadence (ms)`,testid:`launcher-launched-generator-cadenceMs`,value:r.cadenceMs,onChange:e=>l(`cadenceMs`,e),error:u.errors.cadenceMs,disabled:f}),(0,L.jsx)(qv,{label:`Submission window (ms)`,testid:`launcher-launched-generator-windowMs`,value:r.windowMs,onChange:e=>l(`windowMs`,e),error:u.errors.windowMs,disabled:f}),(0,L.jsx)(qv,{label:`Resolve gap (ms)`,testid:`launcher-launched-generator-resolveGapMs`,value:r.resolveGapMs,onChange:e=>l(`resolveGapMs`,e),error:u.errors.resolveGapMs,disabled:f}),(0,L.jsx)(qv,{label:`Max rounds / poll`,testid:`launcher-launched-generator-maxNewRoundsPerPoll`,value:r.maxNewRoundsPerPoll,onChange:e=>l(`maxNewRoundsPerPoll`,e),error:u.errors.maxNewRoundsPerPoll,disabled:f}),(0,L.jsx)(qv,{label:`Max rounds / day`,testid:`launcher-launched-generator-maxNewRoundsPerDay`,value:r.maxNewRoundsPerDay,onChange:e=>l(`maxNewRoundsPerDay`,e),error:u.errors.maxNewRoundsPerDay,disabled:f}),(0,L.jsx)(qv,{label:`Max open rounds`,testid:`launcher-launched-generator-maxOpenRounds`,value:r.maxOpenRounds,onChange:e=>l(`maxOpenRounds`,e),error:u.errors.maxOpenRounds,disabled:f})]}),(0,L.jsx)(Jv,{label:`Allowlist condition ids`,testid:`launcher-launched-generator-allowlistConditionIds`,value:r.allowlistConditionIds,onChange:e=>l(`allowlistConditionIds`,e),disabled:f}),(0,L.jsx)(Jv,{label:`Blocklist condition ids`,testid:`launcher-launched-generator-blocklistConditionIds`,value:r.blocklistConditionIds,onChange:e=>l(`blocklistConditionIds`,e),disabled:f}),(0,L.jsx)(Bv,{dirty:d,saving:f,validationOk:u.ok,saveStatus:a,onSubmit:async()=>{if(!(!u.ok||!d||f)){o({kind:`saving`});try{await t(u.patch),o({kind:`saved`,at:new Date})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:String(e)})}}}})]})})}function zv({record:e,manifest:t,onSave:n}){let r=(0,I.useMemo)(()=>Dv(e.generatorConfig,t),[e.generatorConfig,t]),[i,a]=(0,I.useState)(r),[o,s]=(0,I.useState)({kind:`idle`}),[c,l]=(0,I.useState)(!1);(0,I.useEffect)(()=>{a(e=>JSON.stringify(e)===JSON.stringify(r)?r:e)},[JSON.stringify(e.generatorConfig)]);let u=(e,t)=>{a(n=>({...n,[e]:t}))},d=(0,I.useMemo)(()=>Pv(i,r),[i,r]),f=Object.keys(d.patch).length>0,p=o.kind===`saving`;return(0,L.jsx)(Lv,{record:e,configExpanded:c,setConfigExpanded:l,children:c&&(0,L.jsxs)(`div`,{id:`launcher-launched-generator-config`,"data-testid":`launcher-launched-generator-config`,className:`flex flex-col gap-3.5 pt-3.5`,children:[(0,L.jsx)(Wh,{}),(0,L.jsx)(`h3`,{className:`m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Hot-apply config`}),(0,L.jsxs)(`div`,{className:`grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]`,children:[(0,L.jsx)(qv,{label:`Target successful Verdicts per instance`,testid:`launcher-launched-generator-N_target_successes`,value:i.N_target_successes,onChange:e=>u(`N_target_successes`,e),error:d.errors.N_target_successes,disabled:p}),(0,L.jsx)(qv,{label:`Posting window (ms)`,testid:`launcher-launched-generator-posting_window_ms`,value:i.posting_window_ms,onChange:e=>u(`posting_window_ms`,e),error:d.errors.posting_window_ms,disabled:p}),(0,L.jsx)(qv,{label:`Post batch size`,testid:`launcher-launched-generator-post_batch_size`,value:i.post_batch_size,onChange:e=>u(`post_batch_size`,e),error:d.errors.post_batch_size,disabled:p})]}),(0,L.jsx)(`h3`,{className:`m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Claim policy`}),(0,L.jsxs)(`div`,{className:`grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]`,children:[(0,L.jsx)(qv,{label:`Max claims per operator`,testid:`launcher-launched-generator-maxClaimsPerOperator`,value:i.maxClaimsPerOperator,onChange:e=>u(`maxClaimsPerOperator`,e),error:d.errors.maxClaimsPerOperator,disabled:p}),(0,L.jsx)(qv,{label:`Claim lease (seconds)`,testid:`launcher-launched-generator-claimLeaseTtlSeconds`,value:i.claimLeaseTtlSeconds,onChange:e=>u(`claimLeaseTtlSeconds`,e),error:d.errors.claimLeaseTtlSeconds,disabled:p})]}),(0,L.jsx)(Bv,{dirty:f,saving:p,validationOk:d.ok,saveStatus:o,onSubmit:async()=>{if(!(!d.ok||!f||p)){s({kind:`saving`});try{await n(d.patch),s({kind:`saved`,at:new Date})}catch(e){s({kind:`error`,message:e instanceof Error?e.message:String(e)})}}}})]})})}function Bv({dirty:e,saving:t,validationOk:n,saveStatus:r,onSubmit:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[(0,L.jsx)(Kv,{status:r}),(0,L.jsx)(U,{type:`button`,variant:`default`,"data-testid":`launcher-launched-generator-save`,onClick:()=>{i()},disabled:!(e&&n&&!t),children:t?`Saving…`:`Save`})]})]})}function Vv({record:e}){let t=e.generatorState?.lastPollSummary;return Hv(t)?(0,L.jsxs)(`dl`,{"data-testid":`launcher-launched-generator-pool-summary`,className:`m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]`,children:[(0,L.jsx)(Yv,{label:`Pool`,value:String(t.poolSize),testid:`launcher-launched-generator-poolSize`}),(0,L.jsx)(Yv,{label:`Posted`,value:String(t.posted),testid:`launcher-launched-generator-posted`}),(0,L.jsx)(Yv,{label:`Unposted`,value:String(t.unposted),testid:`launcher-launched-generator-unposted`}),(0,L.jsx)(Yv,{label:`Live`,value:String(t.live),testid:`launcher-launched-generator-live`}),(0,L.jsx)(Yv,{label:`Repostable`,value:String(t.repostable),testid:`launcher-launched-generator-repostable`}),(0,L.jsx)(Yv,{label:`Saturated`,value:String(t.saturated),testid:`launcher-launched-generator-saturated`})]}):null}function Hv(e){if(typeof e!=`object`||!e)return!1;let t=e;return[`poolSize`,`posted`,`unposted`,`live`,`repostable`,`saturated`].every(e=>typeof t[e]==`number`)}function Uv({record:e}){return(0,L.jsxs)(`div`,{"data-testid":`launcher-launched-generator-error`,className:`flex flex-col gap-1 rounded-md border border-destructive bg-card p-3`,children:[(0,L.jsxs)(`span`,{className:`font-mono text-[12px] font-medium text-destructive`,children:[`Last error · `,yv(e.generatorState?.lastError?.at)]}),(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:e.generatorState?.lastError?.message})]})}function Wv({record:e}){let t=e.generatorState?.poolPublicationUpdatedAt;if(!t)return null;let n=e.generatorState?.poolPublicationPriorSize,r=e.generatorState?.poolPublicationCurrentSize,i=typeof n==`number`&&typeof r==`number`?`Pool grew from ${n} → ${r} scorable tasks`:`Pool re-published`;return(0,L.jsxs)(no,{"data-testid":`launcher-launched-generator-pool-republished`,variant:`default`,children:[(0,L.jsx)(ro,{children:`Vetted pool re-published`}),(0,L.jsxs)(K,{children:[i,` · `,yv(t)]})]})}function Gv({record:e}){let t=e.generatorEnabled,n=e.generatorState?.lastError?{variant:`destructive`,label:`Errored`}:t?{variant:`success`,label:`Enabled`}:{variant:`outline`,label:`Disabled`};return(0,L.jsx)(q,{"data-testid":`launcher-launched-generator-state-badge`,variant:n.variant,children:n.label})}function Kv({status:e}){return e.kind===`saving`?(0,L.jsx)(`span`,{"data-testid":`launcher-launched-generator-save-status`,className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:`Saving…`}):e.kind===`saved`?(0,L.jsxs)(`span`,{"data-testid":`launcher-launched-generator-save-status`,className:`font-mono text-[12px] text-[var(--vow-green)]`,children:[`Saved at `,e.at.toISOString().slice(11,16),` UTC`]}):e.kind===`error`?(0,L.jsxs)(`span`,{"data-testid":`launcher-launched-generator-save-status`,className:`font-mono text-[12px] text-destructive`,children:[`Save failed: `,e.message]}):(0,L.jsx)(`span`,{"data-testid":`launcher-launched-generator-save-status`,className:`font-mono text-[11px] text-[var(--fg-dim)]`,children:`Edits hot-apply without restart.`})}function qv({label:e,testid:t,value:n,onChange:r,error:i,disabled:a}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(cp,{htmlFor:t,className:`font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(y_,{id:t,"data-testid":t,type:`text`,inputMode:`numeric`,value:n,onChange:e=>r(e.target.value),disabled:a,className:H(i&&`border-destructive`)}),i&&(0,L.jsx)(`span`,{"data-testid":`${t}-error`,className:`font-mono text-[11px] text-destructive`,children:i})]})}function Jv({label:e,testid:t,value:n,onChange:r,disabled:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(cp,{htmlFor:t,className:`font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(`textarea`,{id:t,"data-testid":t,value:n,onChange:e=>r(e.target.value),disabled:i,rows:2,placeholder:`0xabc…, 0xdef…`,className:`flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground transition-colors placeholder:text-[var(--fg-dim)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`})]})}function Yv({label:e,value:t,testid:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(`dd`,{"data-testid":n,className:`m-0 font-mono text-[13px] text-foreground`,children:t})]})}function Xv(e,t){let n=I.createContext(t);n.displayName=e+`Context`;let r=e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=I.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Zv(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Qv(i,...t)]}function Qv(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function $v(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ey(...e){return t=>{let n=!1,r=e.map(e=>{let r=$v(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$v(e[t],null)}}}}function ty(...e){return I.useCallback(ey(...e),e)}typeof window<`u`&&window.document&&window.document.createElement;function ny(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var ry=globalThis?.document?I.useLayoutEffect:()=>{},iy=I.useId||(()=>void 0),ay=0;function oy(e){let[t,n]=I.useState(iy());return ry(()=>{e||n(e=>e??String(ay++))},[e]),e||(t?`radix-${t}`:``)}var sy=I.useInsertionEffect||ry;function cy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ly({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=uy(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ly({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return sy(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function uy(e){return typeof e==`function`}function dy(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];yy(r)&&typeof Cy==`function`&&(r=Cy(r._payload)),I.Children.forEach(r,e=>{if(_y(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;yy(n)&&typeof Cy==`function`&&(n=Cy(n._payload)),a=my(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?gy(a):void 0,l=ty(n,c);if(!a){if(r||r===0)throw Error(o?Sy(e):xy(e));return r}let u=hy(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var fy=Symbol.for(`radix.slottable`);function py(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=fy,t}var my=(e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null};function hy(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function gy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _y(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fy}var vy=Symbol.for(`react.lazy`);function yy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===vy&&`_payload`in e&&by(e._payload)}function by(e){return typeof e==`object`&&!!e&&`then`in e}var xy=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Sy=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cy=I.use,wy=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=dy(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ty(e,t){e&&Hi.flushSync(()=>e.dispatchEvent(t))}function Ey(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}function Dy(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}function Oy(e,t=globalThis?.document){let n=Dy(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ky=`DismissableLayer`,Ay=`dismissableLayer.update`,jy=`dismissableLayer.pointerDownOutside`,My=`dismissableLayer.focusOutside`,Ny,Py=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fy=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(Py),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=ty(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Ry(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=zy(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Oy(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ny=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),By(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Ny))}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),By())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ay,e),()=>document.removeEventListener(Ay,e)},[]),(0,L.jsx)(wy.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:ny(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ny(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ny(e.onPointerDownCapture,x.onPointerDownCapture)})});Fy.displayName=ky;var Iy=`DismissableLayerBranch`,Ly=I.forwardRef((e,t)=>{let n=I.useContext(Py),r=I.useRef(null),i=ty(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,L.jsx)(wy.div,{...e,ref:i})});Ly.displayName=Iy;function Ry(e,t=globalThis?.document){let n=Ey(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Vy(jy,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zy(e,t=globalThis?.document){let n=Ey(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&Vy(My,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function By(){let e=new CustomEvent(Ay);document.dispatchEvent(e)}function Vy(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ty(i,a):i.dispatchEvent(a)}var Hy=`focusScope.autoFocusOnMount`,Uy=`focusScope.autoFocusOnUnmount`,Wy={bubbles:!1,cancelable:!0},Gy=`FocusScope`,Ky=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=Ey(i),u=Ey(a),d=I.useRef(null),f=ty(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:$y(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||$y(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$y(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){eb.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Hy,Wy);s.addEventListener(Hy,l),s.dispatchEvent(t),t.defaultPrevented||(qy(rb(Yy(s)),{select:!0}),document.activeElement===e&&$y(s))}return()=>{s.removeEventListener(Hy,l),setTimeout(()=>{let t=new CustomEvent(Uy,Wy);s.addEventListener(Uy,u),s.dispatchEvent(t),t.defaultPrevented||$y(e??document.body,{select:!0}),s.removeEventListener(Uy,u),eb.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Jy(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$y(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$y(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(wy.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Ky.displayName=Gy;function qy(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($y(r,{select:t}),document.activeElement!==n)return}function Jy(e){let t=Yy(e);return[Xy(t,e),Xy(t.reverse(),e)]}function Yy(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xy(e,t){for(let n of e)if(!Zy(n,{upTo:t}))return n}function Zy(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Qy(e){return e instanceof HTMLInputElement&&`select`in e}function $y(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qy(e)&&t&&e.select()}}var eb=tb();function tb(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=nb(e,t),e.unshift(t)},remove(t){e=nb(e,t),e[0]?.resume()}}}function nb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rb(e){return e.filter(e=>e.tagName!==`A`)}var ib=`Portal`,ab=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);ry(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Hi.createPortal((0,L.jsx)(wy.div,{...r,ref:t}),o):null});ab.displayName=ib;function ob(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var sb=e=>{let{present:t,children:n}=e,r=cb(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=ub(r.ref,fb(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};sb.displayName=`Presence`;function cb(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=ob(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=db(r.current);a.current=o===`mounted`?e:`none`},[o]),ry(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=db(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),ry(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=db(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=db(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function lb(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ub(...e){let t=I.useRef(e);return t.current=e,I.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=lb(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():lb(n[e],null)}}},[])}function db(e){return e?.animationName||`none`}function fb(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pb=0,mb=null;function hb(){I.useEffect(()=>{mb||={start:gb(),end:gb()};let{start:e,end:t}=mb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),pb++,()=>{pb===1&&(mb?.start.remove(),mb?.end.remove(),mb=null),pb=Math.max(0,pb-1)}},[])}function gb(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var _b=function(){return _b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_b.apply(this,arguments)};function vb(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function yb(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var bb=`right-scroll-bar-position`,xb=`width-before-scroll-bar`,Sb=`with-scroll-bars-hidden`,Cb=`--removed-body-scroll-bar-size`;function wb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Tb(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Eb=typeof window<`u`?I.useLayoutEffect:I.useEffect,Db=new WeakMap;function Ob(e,t){var n=Tb(t||null,function(t){return e.forEach(function(e){return wb(e,t)})});return Eb(function(){var t=Db.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||wb(e,null)}),i.forEach(function(e){r.has(e)||wb(e,a)})}Db.set(n,e)},[e]),n}function kb(e){return e}function Ab(e,t){t===void 0&&(t=kb);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function jb(e){e===void 0&&(e={});var t=Ab(null);return t.options=_b({async:!0,ssr:!1},e),t}var Mb=function(e){var t=e.sideCar,n=vb(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,_b({},n))};Mb.isSideCarExport=!0;function Nb(e,t){return e.useMedium(t),Mb}var Pb=jb(),Fb=function(){},Ib=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:Fb,onWheelCapture:Fb,onTouchMoveCapture:Fb}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=vb(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ob([n,t]),C=_b(_b({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:Pb,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),_b(_b({},C),{ref:S})):I.createElement(v,_b({},C,{className:c,ref:S}),s))});Ib.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ib.classNames={fullWidth:xb,zeroRight:bb};var Lb,Rb=function(){if(Lb)return Lb;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function zb(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Rb();return t&&e.setAttribute(`nonce`,t),e}function Bb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Vb(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Hb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zb())&&(Bb(t,n),Vb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ub=function(){var e=Hb();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Wb=function(){var e=Ub();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Gb={left:0,top:0,right:0,gap:0},Kb=function(e){return parseInt(e||``,10)||0},qb=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Kb(n),Kb(r),Kb(i)]},Jb=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Gb;var t=qb(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Yb=Wb(),Xb=`data-scroll-locked`,Zb=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
24
+ .${Sb} {
25
+ overflow: hidden ${r};
26
+ padding-right: ${s}px ${r};
27
+ }
28
+ body[${Xb}] {
29
+ overflow: hidden ${r};
30
+ overscroll-behavior: contain;
31
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
32
+ padding-left: ${i}px;
33
+ padding-top: ${a}px;
34
+ padding-right: ${o}px;
35
+ margin-left:0;
36
+ margin-top:0;
37
+ margin-right: ${s}px ${r};
38
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
39
+ }
40
+
41
+ .${bb} {
42
+ right: ${s}px ${r};
43
+ }
44
+
45
+ .${xb} {
46
+ margin-right: ${s}px ${r};
47
+ }
48
+
49
+ .${bb} .${bb} {
50
+ right: 0 ${r};
51
+ }
52
+
53
+ .${xb} .${xb} {
54
+ margin-right: 0 ${r};
55
+ }
56
+
57
+ body[${Xb}] {
58
+ ${Cb}: ${s}px;
59
+ }
60
+ `},Qb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},$b=function(){I.useEffect(function(){return document.body.setAttribute(Xb,(Qb()+1).toString()),function(){var e=Qb()-1;e<=0?document.body.removeAttribute(Xb):document.body.setAttribute(Xb,e.toString())}},[])},ex=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;$b();var a=I.useMemo(function(){return Jb(i)},[i]);return I.createElement(Yb,{styles:Zb(a,!t,i,n?``:`!important`)})},tx=!1;if(typeof window<`u`)try{var nx=Object.defineProperty({},"passive",{get:function(){return tx=!0,!0}});window.addEventListener(`test`,nx,nx),window.removeEventListener(`test`,nx,nx)}catch{tx=!1}var rx=tx?{passive:!1}:!1,ix=function(e){return e.tagName===`TEXTAREA`},ax=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ix(e)&&n[t]===`visible`)},ox=function(e){return ax(e,`overflowY`)},sx=function(e){return ax(e,`overflowX`)},cx=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),dx(e,r)){var i=fx(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lx=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ux=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},dx=function(e,t){return e===`v`?ox(t):sx(t)},fx=function(e,t){return e===`v`?lx(t):ux(t)},px=function(e,t){return e===`h`&&t===`rtl`?-1:1},mx=function(e,t,n,r,i){var a=px(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=fx(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&dx(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},hx=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gx=function(e){return[e.deltaX,e.deltaY]},_x=function(e){return e&&`current`in e?e.current:e},vx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yx=function(e){return`
61
+ .block-interactivity-${e} {pointer-events: none;}
62
+ .allow-interactivity-${e} {pointer-events: all;}
63
+ `},bx=0,xx=[];function Sx(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(bx++)[0],a=I.useState(Wb)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=yb([e.lockRef.current],(e.shards||[]).map(_x),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=hx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=cx(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=cx(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return mx(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(!(!xx.length||xx[xx.length-1]!==a)){var r=`deltaY`in n?gx(n):hx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&vx(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(_x).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Cx(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=hx(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,gx(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,hx(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return xx.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,rx),document.addEventListener(`touchmove`,c,rx),document.addEventListener(`touchstart`,u,rx),function(){xx=xx.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,rx),document.removeEventListener(`touchmove`,c,rx),document.removeEventListener(`touchstart`,u,rx)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:yx(i)}):null,p?I.createElement(ex,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Cx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wx=Nb(Pb,Sx),Tx=I.forwardRef(function(e,t){return I.createElement(Ib,_b({},e,{ref:t,sideCar:wx}))});Tx.classNames=Ib.classNames;var Ex=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Dx=new WeakMap,Ox=new WeakMap,kx={},Ax=0,jx=function(e){return e&&(e.host||jx(e.parentNode))},Mx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=jx(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Nx=function(e,t,n,r){var i=Mx(t,Array.isArray(e)?e:[e]);kx[n]||(kx[n]=new WeakMap);var a=kx[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Dx.get(e)||0)+1,l=(a.get(e)||0)+1;Dx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ox.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ax++,function(){o.forEach(function(e){var t=Dx.get(e)-1,i=a.get(e)-1;Dx.set(e,t),a.set(e,i),t||(Ox.has(e)||e.removeAttribute(r),Ox.delete(e)),i||e.removeAttribute(n)}),Ax--,Ax||(Dx=new WeakMap,Dx=new WeakMap,Ox=new WeakMap,kx={})}},Px=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ex(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Nx(r,i,n,`aria-hidden`)):function(){return null}},Fx=`Dialog`,[Ix,Lx]=Zv(Fx),[Rx,zx]=Ix(Fx),Bx=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=I.useRef(null),c=I.useRef(null),[l,u]=cy({prop:r,defaultProp:i??!1,onChange:a,caller:Fx});return(0,L.jsx)(Rx,{scope:t,triggerRef:s,contentRef:c,contentId:oy(),titleId:oy(),descriptionId:oy(),open:l,onOpenChange:u,onOpenToggle:I.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Bx.displayName=Fx;var Vx=`DialogTrigger`,Hx=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=zx(Vx,n),a=ty(t,i.triggerRef);return(0,L.jsx)(wy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":cS(i.open),...r,ref:a,onClick:ny(e.onClick,i.onOpenToggle)})});Hx.displayName=Vx;var Ux=`DialogPortal`,[Wx,Gx]=Ix(Ux,{forceMount:void 0}),Kx=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=zx(Ux,t);return(0,L.jsx)(Wx,{scope:t,forceMount:n,children:I.Children.map(r,e=>(0,L.jsx)(sb,{present:n||a.open,children:(0,L.jsx)(ab,{asChild:!0,container:i,children:e})}))})};Kx.displayName=Ux;var qx=`DialogOverlay`,Jx=I.forwardRef((e,t)=>{let n=Gx(qx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zx(qx,e.__scopeDialog);return a.modal?(0,L.jsx)(sb,{present:r||a.open,children:(0,L.jsx)(Xx,{...i,ref:t})}):null});Jx.displayName=qx;var Yx=dy(`DialogOverlay.RemoveScroll`),Xx=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=zx(qx,n);return(0,L.jsx)(Tx,{as:Yx,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(wy.div,{"data-state":cS(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Zx=`DialogContent`,Qx=I.forwardRef((e,t)=>{let n=Gx(Zx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zx(Zx,e.__scopeDialog);return(0,L.jsx)(sb,{present:r||a.open,children:a.modal?(0,L.jsx)($x,{...i,ref:t}):(0,L.jsx)(eS,{...i,ref:t})})});Qx.displayName=Zx;var $x=I.forwardRef((e,t)=>{let n=zx(Zx,e.__scopeDialog),r=I.useRef(null),i=ty(t,n.contentRef,r);return I.useEffect(()=>{let e=r.current;if(e)return Px(e)},[]),(0,L.jsx)(tS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ny(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ny(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ny(e.onFocusOutside,e=>e.preventDefault())})}),eS=I.forwardRef((e,t)=>{let n=zx(Zx,e.__scopeDialog),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(tS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),tS=I.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=zx(Zx,n),c=I.useRef(null),l=ty(t,c);return hb(),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ky,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Fy,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":cS(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fS,{titleId:s.titleId}),(0,L.jsx)(mS,{contentRef:c,descriptionId:s.descriptionId})]})]})}),nS=`DialogTitle`,rS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=zx(nS,n);return(0,L.jsx)(wy.h2,{id:i.titleId,...r,ref:t})});rS.displayName=nS;var iS=`DialogDescription`,aS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=zx(iS,n);return(0,L.jsx)(wy.p,{id:i.descriptionId,...r,ref:t})});aS.displayName=iS;var oS=`DialogClose`,sS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=zx(oS,n);return(0,L.jsx)(wy.button,{type:`button`,...r,ref:t,onClick:ny(e.onClick,()=>i.onOpenChange(!1))})});sS.displayName=oS;function cS(e){return e?`open`:`closed`}var lS=`DialogTitleWarning`,[uS,dS]=Xv(lS,{contentName:Zx,titleName:nS,docsSlug:`dialog`}),fS=({titleId:e})=>{let t=dS(lS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
64
+
65
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
66
+
67
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return I.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pS=`DialogDescriptionWarning`,mS=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dS(pS).contentName}}.`;return I.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},hS=Bx,gS=Hx,_S=Kx,vS=Jx,yS=Qx,bS=rS,xS=aS,SS=sS,CS=`AlertDialog`,[wS,TS]=Zv(CS,[Lx]),ES=Lx(),DS=e=>{let{__scopeAlertDialog:t,...n}=e,r=ES(t);return(0,L.jsx)(hS,{...r,...n,modal:!0})};DS.displayName=CS;var OS=`AlertDialogTrigger`,kS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=ES(n);return(0,L.jsx)(gS,{...i,...r,ref:t})});kS.displayName=OS;var AS=`AlertDialogPortal`,jS=e=>{let{__scopeAlertDialog:t,...n}=e,r=ES(t);return(0,L.jsx)(_S,{...r,...n})};jS.displayName=AS;var MS=`AlertDialogOverlay`,NS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=ES(n);return(0,L.jsx)(vS,{...i,...r,ref:t})});NS.displayName=MS;var PS=`AlertDialogContent`,[FS,IS]=wS(PS),LS=py(`AlertDialogContent`),RS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=ES(n),o=I.useRef(null),s=ty(t,o),c=I.useRef(null);return(0,L.jsx)(uS,{contentName:PS,titleName:zS,docsSlug:`alert-dialog`,children:(0,L.jsx)(FS,{scope:n,cancelRef:c,children:(0,L.jsxs)(yS,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:ny(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,L.jsx)(LS,{children:r}),(0,L.jsx)(qS,{contentRef:o})]})})})});RS.displayName=PS;var zS=`AlertDialogTitle`,BS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=ES(n);return(0,L.jsx)(bS,{...i,...r,ref:t})});BS.displayName=zS;var VS=`AlertDialogDescription`,HS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=ES(n);return(0,L.jsx)(xS,{...i,...r,ref:t})});HS.displayName=VS;var US=`AlertDialogAction`,WS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=ES(n);return(0,L.jsx)(SS,{...i,...r,ref:t})});WS.displayName=US;var GS=`AlertDialogCancel`,KS=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=IS(GS,n),a=ES(n),o=ty(t,i);return(0,L.jsx)(SS,{...a,...r,ref:o})});KS.displayName=GS;var qS=({contentRef:e})=>{let t=`\`${PS}\` requires a description for the component to be accessible for screen reader users.
68
+
69
+ You can add a description to the \`${PS}\` by passing a \`${VS}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
70
+
71
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${PS}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
72
+
73
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},JS=DS,YS=jS,XS=NS,ZS=RS,QS=WS,$S=KS,eC=BS,tC=HS,nC=JS,rC=YS,iC=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(XS,{className:H(`fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));iC.displayName=XS.displayName;var aC=I.forwardRef(({className:e,...t},n)=>(0,L.jsxs)(rC,{children:[(0,L.jsx)(iC,{}),(0,L.jsx)(ZS,{ref:n,className:H(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));aC.displayName=ZS.displayName;var oC=({className:e,...t})=>(0,L.jsx)(`div`,{className:H(`flex flex-col gap-2 text-left`,e),...t});oC.displayName=`AlertDialogHeader`;var sC=({className:e,...t})=>(0,L.jsx)(`div`,{className:H(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t});sC.displayName=`AlertDialogFooter`;var cC=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(eC,{ref:n,className:H(`font-serif text-[20px] leading-tight text-foreground`,e),...t}));cC.displayName=eC.displayName;var lC=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(tC,{ref:n,className:H(`font-mono text-[12px] text-[var(--fg-muted)]`,e),...t}));lC.displayName=tC.displayName;var uC=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(QS,{ref:n,className:H(Ii(),e),...t}));uC.displayName=QS.displayName;var dC=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)($S,{ref:n,className:H(Ii({variant:`secondary`}),`mt-2 sm:mt-0`,e),...t}));dC.displayName=$S.displayName;var fC={paused:{title:`Pause SolverNet`,body:`The generator will stop posting new Tasks. Existing Tasks continue through their normal lifecycle. You can resume any time.`,confirmLabel:`Pause`},launched:{title:`Resume SolverNet`,body:`The generator will resume polling and posting new Tasks at the configured cadence.`,confirmLabel:`Resume`},retired:{title:`Retire SolverNet`,body:`Retirement is permanent. The SolverNet stops accepting new work and disappears from the operator catalog. Historical Tasks, solutions, and verdicts remain discoverable. Type the SolverNet name to confirm.`,confirmLabel:`Retire permanently`,danger:!0}};function pC({open:e,target:t,solverNetName:n,onConfirm:r,onCancel:i,pending:a=!1,errorMessage:o}){let[s,c]=(0,I.useState)(``);(0,I.useEffect)(()=>{e||c(``)},[e,t]);let l=fC[t],u=t===`retired`,d=!u||s.trim().toLowerCase()===n.trim().toLowerCase(),f=a||!d;return(0,L.jsx)(nC,{open:e,onOpenChange:e=>{!e&&!a&&i()},children:(0,L.jsxs)(aC,{"data-testid":`launcher-launched-dialog`,"data-target":t,className:H(`gap-4`,l.danger&&`border-destructive`),children:[(0,L.jsxs)(oC,{children:[(0,L.jsx)(cC,{className:H(l.danger&&`text-destructive`),children:l.title}),(0,L.jsx)(lC,{children:l.body})]}),u&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(cp,{htmlFor:`launcher-launched-dialog-typed`,className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:[`Type`,` `,(0,L.jsx)(`span`,{className:`text-foreground`,children:n}),` to confirm`]}),(0,L.jsx)(y_,{id:`launcher-launched-dialog-typed`,"data-testid":`launcher-launched-dialog-typed`,type:`text`,autoFocus:!0,value:s,onChange:e=>c(e.target.value),disabled:a,className:H(d&&`border-[var(--vow-green)]`)})]}),o&&(0,L.jsx)(`span`,{"data-testid":`launcher-launched-dialog-error`,className:`font-mono text-[12px] text-destructive`,children:o}),(0,L.jsxs)(sC,{children:[(0,L.jsx)(dC,{"data-testid":`launcher-launched-dialog-cancel`,onClick:e=>{e.preventDefault(),i()},disabled:a,children:`Cancel`}),(0,L.jsx)(uC,{"data-testid":`launcher-launched-dialog-confirm`,onClick:e=>{if(f){e.preventDefault();return}e.preventDefault(),r()},disabled:f,className:H(l.danger&&`border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]`),children:a?`${l.confirmLabel}…`:l.confirmLabel})]})]})})}function mC({record:e,manifest:t,fetchLauncherStatus:n}){let r=n??(()=>z.fetchLauncherStatus()),{data:i,isLoading:a,isError:o}=dt({queryKey:[`launcher-status`,e.solverNetId],queryFn:()=>r(),refetchInterval:3e4}),s=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=s?i?.nets.find(n=>n.solverType===s||n.name===(t?.name??e.summary?.name)):void 0,l=c?.budget.safeBalanceWei,u=c?.budget.safeAddress??e.launcherSafeAddress,d=t?.solutionPriceWei??e.summary?.solutionPriceWei,f=t?.verdictPriceWei??e.summary?.verdictPriceWei,p=wv(l,d,f);return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{"data-testid":`launcher-launched-spend-panel`,role:`region`,"aria-label":`Spend and runway`,className:`flex flex-col gap-3 p-6`,children:[(0,L.jsx)(`header`,{className:`flex items-center justify-between gap-3`,children:(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[22px] font-normal text-foreground`,children:`Spend & runway`})}),(0,L.jsxs)(`dl`,{className:`m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]`,children:[(0,L.jsx)(hC,{label:`Safe address`,value:vv(u),tooltip:u,testid:`launcher-launched-spend-safe-address`}),(0,L.jsx)(hC,{label:`Safe balance`,value:a?`—`:l?Sv(l):`unavailable`,tooltip:l?`${l} wei`:void 0,testid:`launcher-launched-spend-safe-balance`}),(0,L.jsx)(hC,{label:`Solution price`,value:d?Sv(d):`—`,tooltip:d?`${d} wei`:void 0,testid:`launcher-launched-spend-solution-price`}),(0,L.jsx)(hC,{label:`Verdict price`,value:f?Sv(f):`—`,tooltip:f?`${f} wei`:void 0,testid:`launcher-launched-spend-verdict-price`}),(0,L.jsx)(hC,{label:`Per-Task cost`,value:p?Sv(p.perTaskWei.toString()):`—`,tooltip:p?`${p.perTaskWei.toString()} wei`:void 0,testid:`launcher-launched-spend-per-task`}),(0,L.jsx)(hC,{label:`Projected runway`,value:p?`${p.tasks.toLocaleString()} Tasks at current prices`:`manifest or balance unavailable`,testid:`launcher-launched-spend-runway`})]}),o&&(0,L.jsx)(`span`,{"data-testid":`launcher-launched-spend-error`,className:`font-mono text-[12px] text-destructive`,children:`Failed to load Safe balance.`}),p?.lowRunway&&(0,L.jsxs)(`span`,{"data-testid":`launcher-launched-spend-low-runway`,className:`font-mono text-[12px] text-[var(--wane)]`,children:[`Runway low — under `,100 .toLocaleString(),` Tasks remain at current prices. Top up your wallet from the Overview faucet — the daemon forwards ETH to the Safe automatically. This panel has no local top-up action.`]}),(0,L.jsx)(`p`,{className:`m-0 font-mono text-[11px] leading-relaxed text-[var(--fg-dim)]`,children:`Runway projects how many Tasks the Safe can fund at the current manifest prices, including the expected claim-tx gas per Task.`})]})})}function hC({label:e,value:t,testid:n,tooltip:r}){let i=(0,L.jsx)(`dd`,{"data-testid":n,className:`m-0 truncate font-mono text-[13px] text-foreground`,tabIndex:r?0:void 0,children:t});return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),r?(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:i}),(0,L.jsx)(ld,{children:r})]}):i]})}var gC={paused:`Pause`,launched:`Resume`,retired:`Retire`},_C={launching:{variant:`default`,label:`Launching`},launched:{variant:`success`,label:`Launched`},paused:{variant:`pill`,label:`Paused`},retired:{variant:`outline`,label:`Retired`},failed:{variant:`destructive`,label:`Failed`}};function vC({record:e,manifest:t,operatorCount:n,onAction:r,pending:i}){let a=_C[e.status]??_C.launching,o=bv[e.status]??[],s=t?.name??e.summary?.name??e.solverNetId;return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{"data-testid":`launcher-launched-status-header`,"data-status":e.status,role:`region`,"aria-label":`SolverNet status header`,className:`flex flex-col gap-4 p-6`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsx)(`h1`,{"data-testid":`launcher-launched-name`,className:`m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground`,children:s}),(0,L.jsx)(q,{"data-testid":`launcher-launched-status-badge`,variant:a.variant,className:`whitespace-nowrap`,children:a.label})]}),t?.description&&(0,L.jsx)(`p`,{className:`m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]`,children:t.description})]}),(0,L.jsx)(bC,{allowed:o,onAction:r,pending:i??null,terminal:e.status===`retired`,launching:e.status===`launching`})]}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(`dl`,{className:`m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]`,children:[(0,L.jsx)(yC,{label:`SolverNet id`,value:e.solverNetId,testid:`launcher-launched-solvernet-id`}),(0,L.jsx)(yC,{label:`Manifest cid`,value:_v(e.manifestCid),testid:`launcher-launched-manifest-cid`,additionalTestIds:[`manifest-cid`],tooltip:e.manifestCid}),(0,L.jsx)(yC,{label:`Launcher Safe`,value:vv(e.launcherSafeAddress),testid:`launcher-launched-safe`,tooltip:e.launcherSafeAddress}),(0,L.jsx)(yC,{label:`Launcher agent`,value:e.launcherAgentId,testid:`launcher-launched-agent`}),n!==void 0&&(0,L.jsx)(yC,{label:`Operators`,value:String(n),testid:`launcher-launched-operator-count`,additionalTestIds:[`operator-count`],tooltip:`Distinct operators that have ever claimed a task on this SolverNet, including on finalized or refunded tasks`})]})]})})}function yC({label:e,value:t,testid:n,additionalTestIds:r,tooltip:i}){let a=(0,L.jsxs)(`dd`,{"data-testid":n,className:`m-0 truncate font-mono text-[13px] text-foreground`,tabIndex:i?0:void 0,children:[t,r?.map(e=>(0,L.jsx)(`span`,{"data-testid":e,className:`hidden`,"aria-hidden":`true`,children:t},e))]});return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),i?(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:a}),(0,L.jsx)(ld,{children:i})]}):a]})}function bC({allowed:e,onAction:t,pending:n,terminal:r,launching:i}){return r?(0,L.jsx)(q,{"data-testid":`launcher-launched-terminal-pill`,variant:`outline`,className:`self-start whitespace-nowrap`,children:`Retired — no further actions`}):i?(0,L.jsx)(q,{"data-testid":`launcher-launched-launching-pill`,variant:`outline`,className:`self-start whitespace-nowrap border-primary text-primary`,children:`Launching…`}):e.length===0?null:(0,L.jsx)(`div`,{"data-testid":`launcher-launched-actions`,className:`flex flex-wrap gap-2 self-start`,children:e.map(e=>{let r=gC[e],i=n===e;return(0,L.jsx)(U,{type:`button`,variant:e===`retired`?`destructive`:`default`,"data-testid":`launcher-launched-action-${e}`,onClick:()=>t(e),disabled:n!==null,className:n!==null&&!i?`opacity-60`:void 0,children:i?`${r}…`:r},e)})})}var xC=5,SC={open:{variant:`default`,label:`Open`},"claims-in-flight":{variant:`default`,label:`In flight`},"fully-claimed":{variant:`success`,label:`Claimed`},settled:{variant:`success`,label:`Settled`},failed:{variant:`destructive`,label:`Failed`}};function CC({record:e,fetchTasks:t}){let[n,r]=(0,I.useState)([void 0]),i=n[n.length-1],a=t??(e=>z.fetchLauncherTasks(e)),{data:o,isLoading:s,isError:c,error:l,refetch:u}=dt({queryKey:[`launcher-tasks`,e.solverNetId,i??null],queryFn:()=>a({cursor:i,limit:xC}),refetchInterval:15e3});return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(W,{"data-testid":`launcher-launched-tasks-panel`,role:`region`,"aria-label":`Recent posted Tasks`,className:`flex flex-col gap-3 p-6`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[22px] font-normal text-foreground`,children:`Recent posted Tasks`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-tasks-refresh`,onClick:()=>{u()},children:`Refresh`})]}),s&&(0,L.jsx)(`p`,{"data-testid":`launcher-launched-tasks-loading`,className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:`Loading…`}),c&&(0,L.jsxs)(`div`,{"data-testid":`launcher-launched-tasks-error`,className:`font-mono text-[12px] text-destructive`,children:[`Failed to load tasks: `,l instanceof Error?l.message:`unknown error`]}),!s&&!c&&o&&o.tasks.length===0&&(0,L.jsx)(TC,{}),!s&&!c&&o&&o.tasks.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{"data-testid":`launcher-launched-tasks-list`,className:`overflow-hidden rounded-md border border-border`,children:(0,L.jsxs)(fg,{className:`table-fixed`,children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{className:`bg-[var(--bg)] hover:bg-[var(--bg)]`,children:[(0,L.jsx)(_g,{className:`w-[34%]`,children:`Task`}),(0,L.jsx)(_g,{className:`w-[16%]`,children:`SolverType`}),(0,L.jsx)(_g,{className:`w-[22%]`,children:`Posted`}),(0,L.jsx)(_g,{className:`w-[14%]`,children:`State`}),(0,L.jsx)(_g,{className:`w-[14%] text-right`,children:`Claims`})]})}),(0,L.jsx)(mg,{children:o.tasks.map(e=>(0,L.jsx)(wC,{task:e},e.taskId))})]})}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-tasks-prev`,onClick:()=>{r(e=>e.length>1?e.slice(0,-1):e)},disabled:n.length<=1,children:`← Newer`}),(0,L.jsxs)(`span`,{className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:[`Page `,n.length,o.tasks.length<xC&&o.cursor===void 0?` · end`:``]}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-tasks-next`,onClick:()=>{o?.cursor?.before&&r(e=>[...e,o.cursor.before])},disabled:!o.cursor?.before,children:`Older →`})]})]})]})})}function wC({task:e}){let t=SC[e.state]??{variant:`secondary`,label:e.state},n=e.summary?.title??_v(e.taskCid),r=e.solverType??e.solverNet;return(0,L.jsxs)(gg,{"data-testid":`launcher-launched-task-row`,"data-task-id":e.taskId,children:[(0,L.jsx)(vg,{className:`font-mono text-[13px] text-foreground`,children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`span`,{className:`block truncate`,tabIndex:0,children:n})}),(0,L.jsx)(ld,{children:e.taskCid})]})}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:(0,L.jsxs)(sd,{children:[(0,L.jsx)(cd,{asChild:!0,children:(0,L.jsx)(`span`,{className:`block truncate`,tabIndex:0,children:r})}),(0,L.jsx)(ld,{children:r})]})}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:yv(e.postedAt)}),(0,L.jsx)(vg,{children:(0,L.jsx)(q,{variant:t.variant,className:`normal-case tracking-[0.1em]`,children:t.label})}),(0,L.jsxs)(vg,{className:`text-right font-mono text-[12px] text-[var(--fg-muted)]`,children:[e.claims.current,` / `,e.claims.max]})]})}function TC(){return(0,L.jsx)(`div`,{"data-testid":`launcher-launched-tasks-empty`,className:`rounded-md border border-dashed border-border p-6 text-center font-mono text-[13px] text-[var(--fg-muted)]`,children:`Tasks will appear here after the first generator poll posts a Task.`})}var EC=2500,DC=3e4,OC=`mx-auto flex max-w-[960px] flex-col gap-4 p-6`;function kC({pollIntervalMs:e=EC,navigateTo:t,solverNetId:n}={}){let r=Gt(),[,i]=qt(),a=t??i,o=Xe(),s=n??r.solverNetId,c=dt({queryKey:[`solvernets`,`launched`,s],queryFn:()=>z.solvernets.get(s),refetchInterval:e,enabled:!!s}),l=c.data?.manifestCid,u=dt({queryKey:[`solvernets`,`manifest`,l],queryFn:()=>z.solvernets.getManifest(l),enabled:!!l,staleTime:1/0}),d=dt({queryKey:[`solvernets`,`operator-count`,l],queryFn:async()=>(await z.discovery.getSolverNetOperatorCount(l)).operatorCount,enabled:!!l,refetchInterval:DC}),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(null),g=ft({mutationFn:({target:e})=>z.solvernets.transitionLifecycle(s,e),onSuccess:async e=>{await o.cancelQueries({queryKey:[`solvernets`,`launched`,s]}),o.setQueryData([`solvernets`,`launched`,s],e),p(null),h(null)},onError:e=>{h(e instanceof Error?e.message:String(e))}}),_=ft({mutationFn:e=>z.solvernets.updateGeneratorConfig(s,e),onSuccess:()=>{o.invalidateQueries({queryKey:[`solvernets`,`launched`,s]})}});if(!s)return(0,L.jsx)(`main`,{"data-testid":`launcher-launched-missing-id`,className:OC,children:(0,L.jsx)(MC,{message:`No solverNetId supplied.`,onBack:()=>a(`/launcher`)})});if(c.isLoading)return(0,L.jsx)(`main`,{"data-testid":`launcher-launched-loading`,className:OC,children:(0,L.jsx)(`p`,{className:`m-0 font-mono text-[13px] text-[var(--fg-muted)]`,children:`Loading…`})});if(c.isError||!c.data)return(0,L.jsx)(`main`,{"data-testid":`launcher-launched-error`,className:OC,children:(0,L.jsx)(MC,{message:`Failed to load SolverNet: ${c.error instanceof Error?c.error.message:`Unknown error`}`,onBack:()=>a(`/launcher`),onRetry:()=>{c.refetch()}})});let v=c.data,y=u.data?.manifest,b=jC(v,y),x=y?.name??v.summary?.name??v.solverNetId;return(0,L.jsxs)(`main`,{"data-testid":`launcher-launched`,"data-solvernet-id":s,className:OC,children:[(0,L.jsx)(vC,{record:v,manifest:y,operatorCount:d.data,onAction:e=>{h(null),p(e)},pending:g.isPending?g.variables?.target??null:null}),(0,L.jsx)(Iv,{record:v,manifest:y,template:b,onSave:async e=>{await _.mutateAsync(e)}}),(0,L.jsx)(mC,{record:v,manifest:y}),(0,L.jsx)(CC,{record:v}),u.isError&&(0,L.jsxs)(`p`,{"data-testid":`launcher-launched-manifest-error`,className:`m-0 font-mono text-[12px] text-destructive`,children:[`Failed to load manifest:`,` `,AC(u.error)]}),(0,L.jsx)(pC,{open:f!==null,target:f??`paused`,solverNetName:x,pending:g.isPending,errorMessage:m??void 0,onCancel:()=>{g.isPending||(p(null),h(null))},onConfirm:()=>{f&&g.mutate({target:f})}})]})}function AC(e){let t=e instanceof Error?e.message:String(e??`unknown error`);return/404|manifest_not_found|registry_unavailable/i.test(t)?`Manifest unavailable from local cache or registry (${t})`:t}function jC(e,t){let n=t?.contract??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(n)return O_[`${n.id}.${n.version}`]}function MC({message:e,onBack:t,onRetry:n}){return(0,L.jsxs)(no,{variant:`blocking`,className:`flex items-center justify-between gap-4 border-l-0 border border-destructive p-4`,children:[(0,L.jsx)(K,{className:`font-mono text-[13px] text-destructive`,children:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[n&&(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-error-retry`,onClick:n,children:`Retry`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`launcher-launched-error-back`,onClick:t,children:`Back to launcher`})]})]})}var NC=`curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash`,PC=`m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-[var(--bg-sunken)] p-2.5 font-mono text-[12px] text-foreground`;function FC({onSuccess:e,onCancel:t}){let[n,r]=(0,I.useState)(`checking`),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(``),c=()=>{r(`checking`),z.hermesDoctor().then(t=>{if(!t.installed){r(`not-installed`);return}if(t.exitCode!==0){r(`config-issue`),a(t.stderr);return}r(`ok`),e()}).catch(e=>{s(e instanceof Error?e.message:String(e)),r(`network-error`)})};return(0,I.useEffect)(()=>{c()},[]),n===`checking`?(0,L.jsxs)(W,{"data-testid":`hermes-precheck-checking`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:`Hermes install check`}),(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:`Checking hermes install…`})]}):n===`not-installed`?(0,L.jsxs)(W,{"data-testid":`hermes-precheck-not-installed`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:`Hermes Agent not installed`}),(0,L.jsx)(`p`,{className:`m-0 font-mono text-[13px] text-foreground`,children:`Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:`}),(0,L.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(`pre`,{className:`${PC} flex-1`,children:NC}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`hermes-precheck-copy-install`,"aria-label":`Copy install command`,onClick:()=>{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(NC).catch(()=>{})},children:`Copy`})]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:`outline`,"data-testid":`hermes-precheck-retry`,onClick:c,children:`I've installed Hermes — retry precheck`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`hermes-precheck-cancel`,onClick:t,children:`Cancel`})]})]}):n===`network-error`?(0,L.jsxs)(no,{"data-testid":`hermes-precheck-network-error`,variant:`blocking`,className:`flex flex-col gap-3 border-l-0 border border-destructive p-4`,children:[(0,L.jsx)(ro,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:`Hermes precheck failed`}),(0,L.jsxs)(K,{className:`font-mono text-[13px] text-foreground`,children:[`Could not reach the daemon API to run `,(0,L.jsx)(`code`,{children:`hermes doctor`}),`. Check that the daemon is running and the UI token is valid.`]}),o?(0,L.jsx)(`pre`,{className:PC,children:o}):null,(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:`outline`,"data-testid":`hermes-precheck-retry`,onClick:c,children:`Retry precheck`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`hermes-precheck-cancel`,onClick:t,children:`Cancel`})]})]}):n===`config-issue`?(0,L.jsxs)(no,{"data-testid":`hermes-precheck-config-issue`,variant:`warning`,className:`flex flex-col gap-3 border-l-0 border border-[var(--severity-warning-fg)] p-4`,children:[(0,L.jsx)(ro,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:`Hermes Agent configuration issue`}),(0,L.jsx)(K,{className:`font-mono text-[13px] text-foreground`,children:`Hermes is installed but reports configuration issues:`}),(0,L.jsx)(`pre`,{className:PC,children:i||`(no diagnostic output)`}),(0,L.jsxs)(`p`,{className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:[`Run `,(0,L.jsx)(`code`,{children:`hermes model`}),` or `,(0,L.jsx)(`code`,{children:`hermes setup`}),` to configure a provider, then retry.`]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:`outline`,"data-testid":`hermes-precheck-retry`,onClick:c,children:`Retry precheck`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`hermes-precheck-cancel`,onClick:t,children:`Cancel`})]})]}):(0,L.jsx)(L.Fragment,{})}var IC=0;function LC(){I.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??RC()),document.body.insertAdjacentElement(`beforeend`,e[1]??RC()),IC++,()=>{IC===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),IC--}},[])}function RC(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var zC=`focusScope.autoFocusOnMount`,BC=`focusScope.autoFocusOnUnmount`,VC={bubbles:!1,cancelable:!0},HC=`FocusScope`,UC=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=oa(i),u=oa(a),d=I.useRef(null),f=qn(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:XC(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||XC(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&XC(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){ZC.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(zC,VC);s.addEventListener(zC,l),s.dispatchEvent(t),t.defaultPrevented||(WC(ew(KC(s)),{select:!0}),document.activeElement===e&&XC(s))}return()=>{s.removeEventListener(zC,l),setTimeout(()=>{let t=new CustomEvent(BC,VC);s.addEventListener(BC,u),s.dispatchEvent(t),t.defaultPrevented||XC(e??document.body,{select:!0}),s.removeEventListener(BC,u),ZC.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=GC(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&XC(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&XC(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Yi.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});UC.displayName=HC;function WC(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(XC(r,{select:t}),document.activeElement!==n)return}function GC(e){let t=KC(e);return[qC(t,e),qC(t.reverse(),e)]}function KC(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qC(e,t){for(let n of e)if(!JC(n,{upTo:t}))return n}function JC(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function YC(e){return e instanceof HTMLInputElement&&`select`in e}function XC(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&YC(e)&&t&&e.select()}}var ZC=QC();function QC(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=$C(e,t),e.unshift(t)},remove(t){e=$C(e,t),e[0]?.resume()}}}function $C(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ew(e){return e.filter(e=>e.tagName!==`A`)}function tw(e){let t=nw(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(iw);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function nw(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=ow(n),i=aw(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rw=Symbol(`radix.slottable`);function iw(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===rw}function aw(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ow(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sw=`Popover`,[cw,lw]=ia(sw,[Ul]),uw=Ul(),[dw,fw]=cw(sw),pw=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=uw(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=mu({prop:r,defaultProp:i??!1,onChange:a,caller:sw});return(0,L.jsx)(au,{...s,children:(0,L.jsx)(dw,{scope:t,contentId:ws(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})};pw.displayName=sw;var mw=`PopoverAnchor`,hw=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=fw(mw,n),a=uw(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(ou,{...a,...r,ref:t})});hw.displayName=mw;var gw=`PopoverTrigger`,_w=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=fw(gw,n),a=uw(n),o=qn(t,i.triggerRef),s=(0,L.jsx)(Yi.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mw(i.open),...r,ref:o,onClick:G(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(ou,{asChild:!0,...a,children:s})});_w.displayName=gw;var vw=`PopoverPortal`,[yw,bw]=cw(vw,{forceMount:void 0}),xw=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=fw(vw,t);return(0,L.jsx)(yw,{scope:t,forceMount:n,children:(0,L.jsx)($i,{present:n||a.open,children:(0,L.jsx)(uu,{asChild:!0,container:i,children:r})})})};xw.displayName=vw;var Sw=`PopoverContent`,Cw=I.forwardRef((e,t)=>{let n=bw(Sw,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=fw(Sw,e.__scopePopover);return(0,L.jsx)($i,{present:r||a.open,children:a.modal?(0,L.jsx)(Tw,{...i,ref:t}):(0,L.jsx)(Ew,{...i,ref:t})})});Cw.displayName=Sw;var ww=tw(`PopoverContent.RemoveScroll`),Tw=I.forwardRef((e,t)=>{let n=fw(Sw,e.__scopePopover),r=I.useRef(null),i=qn(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return Px(e)},[]),(0,L.jsx)(Tx,{as:ww,allowPinchZoom:!0,children:(0,L.jsx)(Dw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ew=I.forwardRef((e,t)=>{let n=fw(Sw,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(Dw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Dw=I.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=fw(Sw,n),p=uw(n);return LC(),(0,L.jsx)(UC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(hs,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,L.jsx)(su,{"data-state":Mw(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Ow=`PopoverClose`,kw=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=fw(Ow,n);return(0,L.jsx)(Yi.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})});kw.displayName=Ow;var Aw=`PopoverArrow`,jw=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=uw(n);return(0,L.jsx)(cu,{...i,...r,ref:t})});jw.displayName=Aw;function Mw(e){return e?`open`:`closed`}var Nw=pw,Pw=_w,Fw=xw,Iw=Cw,Lw=Nw,Rw=Pw,zw=I.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,L.jsx)(Fw,{children:(0,L.jsx)(Iw,{ref:i,align:t,sideOffset:n,className:H(`z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,e),...r})}));zw.displayName=Iw.displayName;var Bw=[{name:`network-tools`,version:`0.1.0`,source:`bundled`,defaultIncluded:!0,description:`Jinn runtime tools`},{name:`claude-code-learner`,version:`0.2.0`,source:`bundled`,defaultIncluded:!0,description:`Learner loop`}];function Vw(e){return Ed(e)===`hermes-agent`?Bw.filter(e=>e.name!==`claude-code-learner`):Bw}var Hw=new Set([`swe-rebench-v2-runtime`]),Uw={"network-tools":`Network Tools`,"claude-code-learner":`Learner`,"swe-rebench-v2-runtime":`SWE-rebench v2 Runtime`,"jinn-prediction-plugin":`Prediction Runtime`},Ww=`bundled:`;function Gw(e){return Uw[e]??e}function Kw(e){return e.startsWith(Ww)?e.slice(8):e}function qw(e){return e.source===`bundled`?`${Ww}${e.name}`:e.name}function Jw(e){let t=new Set,n=[];for(let r of e){let e=Kw(r);t.has(e)||(t.add(e),n.push(r))}return n}function Yw(e,t,n){let r=new Set,i=[];for(let e of Vw(n))r.add(e.name),i.push(e);for(let t of e){if(r.has(t.name))continue;r.add(t.name);let e=Hw.has(t.name);i.push({...t,...e?{defaultIncluded:!0}:{recommended:!0},description:t.name===`swe-rebench-v2-runtime`?`SWE-rebench v2 runtime`:`Recommended for this SolverNet`})}for(let e of t){let t=Kw(e);r.has(t)||(r.add(t),i.push({name:t,version:`configured`,source:e.startsWith(Ww)?`bundled`:`custom`,description:`Already configured`}))}return i}function Xw(e){let t=[e.source,e.version];return e.description&&t.push(e.description),t.join(` · `)}function Zw({available:e,selected:t,disabledDefaultPlugins:n=[],onChange:r,rowTestId:i,searchTestId:a,harness:o}){let[s,c]=(0,I.useState)(``),[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),p=(0,I.useMemo)(()=>Yw(e,t,o),[e,t,o]),m=new Set(t.map(Kw)),h=new Set(n.map(Kw)),g=new Set(m);for(let e of p)e.defaultIncluded&&!h.has(e.name)&&g.add(e.name);let _=p.filter(e=>g.has(e.name)),v=_.filter(e=>e.defaultIncluded).length,y=_.length-v,b=p.filter(e=>!g.has(e.name)),x=s.trim().toLowerCase(),S=x?b.filter(e=>`${e.name} ${Gw(e.name)} ${e.source} ${e.description??``}`.toLowerCase().includes(x)):b,C=e=>{let i=e.defaultIncluded?n.filter(t=>Kw(t)!==e.name):n;r(e.defaultIncluded?t:Jw([...t,qw(e)]),i),u(!1),c(``)},w=e=>{if(e.defaultIncluded){f(e),u(!1),c(``);return}r(t.filter(t=>Kw(t)!==e.name),n)};return(0,L.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,L.jsxs)(`span`,{"data-testid":`${i}-chip`,"data-plugin":e.name,className:H(`inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-[5px] pl-2.5 font-mono text-[11px] text-foreground`,e.defaultIncluded?`bg-sunken`:`bg-transparent`),children:[(0,L.jsxs)(`span`,{children:[Gw(e.name),(0,L.jsx)(`span`,{className:`text-dim`,children:e.defaultIncluded?` · default`:` · selected`})]}),(0,L.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove ${Gw(e.name)}`,"data-testid":`${i}-remove`,"data-plugin":e.name,onClick:()=>w(e),className:`h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground`,children:(0,L.jsx)(Un,{"aria-hidden":`true`,className:`!size-3`})})]},e.name))}),d&&(0,L.jsxs)(`div`,{role:`alertdialog`,"data-testid":`${i}-default-warning`,className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-md border border-wane bg-card px-3 py-2.5 font-mono`,children:[(0,L.jsxs)(`span`,{className:`text-[12px] text-foreground`,children:[Gw(d.name),` is part of the default operator baseline. Removing it may break standard SolverNet workflows.`]}),(0,L.jsxs)(`span`,{className:`flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`${i}-default-warning-cancel`,onClick:()=>f(null),children:`Keep`}),(0,L.jsx)(U,{type:`button`,variant:`destructive`,size:`sm`,"data-testid":`${i}-default-warning-confirm`,onClick:()=>{d&&(r(t,Jw([...n,d.name])),f(null))},children:`Remove`})]})]}),(0,L.jsxs)(Lw,{open:l,onOpenChange:e=>{u(e),e||c(``)},children:[(0,L.jsx)(Rw,{asChild:!0,children:(0,L.jsxs)(U,{type:`button`,variant:`outline`,"data-testid":`${i}-trigger`,"aria-haspopup":`listbox`,className:`grid h-auto grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-border bg-background px-3 py-2.5 text-left font-mono text-[12px] normal-case tracking-normal text-foreground hover:bg-sunken hover:text-foreground`,children:[(0,L.jsxs)(`span`,{className:`min-w-0`,children:[`Add plugin`,(0,L.jsxs)(`span`,{className:`text-dim`,children:[` `,`· `,v,` default`,y>0?` · ${y} selected`:``]})]}),l?(0,L.jsx)(wn,{"aria-hidden":`true`,className:`!size-3.5 text-muted-foreground`}):(0,L.jsx)(Sn,{"aria-hidden":`true`,className:`!size-3.5 text-muted-foreground`})]})}),(0,L.jsxs)(zw,{align:`start`,sideOffset:6,className:`w-[min(28rem,90vw)] overflow-hidden p-0`,children:[(0,L.jsx)(y_,{type:`search`,autoFocus:!0,"aria-label":`Search plugins`,"data-testid":a,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(u(!1),c(``))},placeholder:`Search plugins`,className:`h-auto rounded-none border-0 border-b border-border bg-background px-3 py-2.5 text-[12px] focus-visible:ring-0`}),(0,L.jsx)(Ya,{className:`max-h-60`,children:(0,L.jsx)(`div`,{role:`listbox`,"aria-label":`Plugins`,className:`flex flex-col`,children:S.length===0?(0,L.jsx)(`span`,{className:`px-3.5 py-3 font-mono text-[12px] text-dim`,children:b.length===0?`No plugins available to add.`:`No matching plugins.`}):S.map((e,t)=>{let n=g.has(e.name),r=e.defaultIncluded?`text-dim`:e.recommended?`text-primary`:`text-muted-foreground`;return(0,L.jsxs)(U,{type:`button`,variant:`ghost`,role:`option`,"aria-selected":n,"data-testid":i,"data-plugin":e.name,"data-plugin-active":n?`true`:`false`,"data-plugin-default":e.defaultIncluded?`true`:`false`,onClick:()=>C(e),className:H(`grid h-auto w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-none px-3 py-2.5 text-left font-mono normal-case tracking-normal transition-colors`,t===0?``:`border-t border-border`,n?`bg-sunken text-foreground`:`bg-transparent text-foreground`,`hover:bg-sunken focus-visible:bg-sunken`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-[13px] text-foreground`,children:Gw(e.name)}),(0,L.jsx)(`span`,{className:`text-[11px] text-dim`,children:Xw(e)})]}),(0,L.jsx)(`span`,{className:H(`self-center text-[11px] uppercase`,r),children:e.defaultIncluded?`Default`:e.recommended?`Recommended`:`Add`})]},e.name)})})})]})]})]})}var Qw={"claude-opus-4-7":{provider:`anthropic`,inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-sonnet-4-6":{provider:`anthropic`,inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-haiku-4-5-20251001":{provider:`anthropic`,inputPer1kTokens:.001,outputPer1kTokens:.005,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-opus-4.7":{provider:`openrouter`,inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-sonnet-4.6":{provider:`openrouter`,inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4":{provider:`openai`,inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4-mini":{provider:`openai`,inputPer1kTokens:25e-5,outputPer1kTokens:.002,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.5":{provider:`openai`,inputPer1kTokens:.015,outputPer1kTokens:.06,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex":{provider:`openai`,inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex-spark":{provider:`openai`,inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"tencent/hy3-preview":{provider:`openrouter`,inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-pro":{provider:`openrouter`,inputPer1kTokens:.0014,outputPer1kTokens:.0028,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-flash":{provider:`openrouter`,inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"google/gemini-3.1-flash-lite":{provider:`openrouter`,inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"moonshotai/kimi-k2.6":{provider:`openrouter`,inputPer1kTokens:6e-4,outputPer1kTokens:.0025,typicalInputTokens:5e4,typicalOutputTokens:2e4},"openrouter/owl-alpha":{provider:`openrouter`,inputPer1kTokens:.002,outputPer1kTokens:.008,typicalInputTokens:5e4,typicalOutputTokens:2e4},"minimax/minimax-m2.7":{provider:`openrouter`,inputPer1kTokens:8e-4,outputPer1kTokens:.0032,typicalInputTokens:5e4,typicalOutputTokens:2e4},"nousresearch/hermes-4-405b":{provider:`nous`,inputPer1kTokens:9e-4,outputPer1kTokens:9e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4}};function $w(e){let t=Qw[e];if(!t)return null;let n=t.typicalInputTokens/1e3*t.inputPer1kTokens,r=t.typicalOutputTokens/1e3*t.outputPer1kTokens;return{usd:n+r,inputUsd:n,outputUsd:r,typicalInputTokens:t.typicalInputTokens,typicalOutputTokens:t.typicalOutputTokens,entry:t}}function eT(e,t,n=1){if(!e)return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:`Included in subscription, no per-task API cost.`};let r=t?$w(t):null;return r?.entry.subscriptionPath===!0?{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:`Included in subscription, no per-task API cost.`}:{showEstimate:!0,estimate:r,requiresConfirmation:r!==null&&r.usd>n,suppressedReason:null}}function tT(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`<$0.01`:`$${e.toFixed(2)}`:`—`}function nT({modelId:e,usesPaidApiKey:t,thresholdUsd:n=1,variant:r=`card`,testIdPrefix:i=`cost-estimate`}){let a=eT(t,e,n);if(!a.showEstimate)return(0,L.jsxs)(`div`,{"data-testid":`${i}-subscription`,"data-cost-mode":`subscription`,className:H(`flex items-center gap-2.5 font-mono`,r===`card`?`rounded-md border border-border bg-card px-3.5 py-2.5`:`py-1.5`),children:[(0,L.jsx)(kn,{"aria-hidden":`true`,className:`size-3 shrink-0 text-primary`}),(0,L.jsx)(`span`,{className:`text-[12px] text-muted-foreground`,children:a.suppressedReason??`Included in subscription, no per-task API cost.`})]});let o=a.estimate,s=o?.usd??null,c=a.requiresConfirmation;return(0,L.jsxs)(`div`,{"data-testid":`${i}-panel`,"data-cost-mode":`paid-api`,"data-cost-usd":s===null?`unknown`:s.toFixed(4),"data-cost-high-cost":c?`true`:`false`,className:H(`flex flex-col gap-2 rounded-md border bg-card`,c?`border-destructive`:`border-border`,r===`card`?`px-4 py-3.5`:`gap-1 px-2.5 py-2`),children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Estimated cost per task`}),(0,L.jsx)(`span`,{"data-testid":`${i}-amount`,className:H(`font-mono font-medium`,r===`card`?`text-[18px]`:`text-[14px]`,c?`text-destructive`:`text-foreground`),children:s===null?`unavailable`:`~${tT(s)}`})]}),o&&(0,L.jsx)(`span`,{"data-testid":`${i}-heuristic`,className:`font-mono text-[11px] text-muted-foreground`,children:`Rough estimate — actual cost varies.`}),s===null&&(0,L.jsx)(`span`,{"data-testid":`${i}-unknown`,className:`font-mono text-[11px] text-muted-foreground`,children:`No pricing entry for this model id — confirm rates with your provider before joining.`}),c&&(0,L.jsxs)(`span`,{"data-testid":`${i}-warning`,className:`font-mono text-[11px] text-destructive`,children:[`This model is above $`,n.toFixed(2),`/task. You will be asked to confirm before joining.`]})]})}var rT={"claude-code-learner":`claude-code`,"codex-code-learner":`codex`};function iT(e){return rT[e]??e}var aT=.5,oT={units_per_block:100,units_per_week:2800};sT(oT.units_per_block),sT(oT.units_per_week);function sT(e){return Math.round(e/100*aT*1e6)}function cT(e,t,n){if(!e)return null;let r=iT(e);if(!(r===`claude-code`||r===`codex`||r===`hermes-agent`))return 0;if(!t)return null;let i=$w(t);return i?i.usd/aT*100:null}function lT(e){return e<1?e.toFixed(2):e<10?e.toFixed(1):Math.round(e).toString()}function uT({harness:e,modelId:t,variant:n=`card`,testIdPrefix:r=`harness-footprint`}){let i=cT(e,t);if(i===0)return null;if(i===null)return(0,L.jsxs)(`div`,{"data-testid":`${r}-unknown`,className:H(`flex flex-col gap-1 rounded-md border border-border bg-card`,n===`card`?`px-4 py-3`:`gap-1 px-2.5 py-2`),children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`AI-units footprint`}),(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-muted-foreground`,children:`No pricing entry for this model id — footprint unavailable.`})]});let a=i/100*aT,o=oT.units_per_block/i,s=a*o*4,c=i*o*4*7;return(0,L.jsxs)(`div`,{"data-testid":`${r}-panel`,className:H(`flex flex-col gap-2 rounded-md border border-border bg-card`,n===`card`?`px-4 py-3.5`:`gap-1 px-2.5 py-2`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(kn,{"aria-hidden":`true`,className:`size-3 shrink-0 text-primary`}),(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`AI-units footprint`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5 font-mono text-[12px] text-foreground`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`Per 6h block, at cap`}),(0,L.jsxs)(`span`,{"data-testid":`${r}-block`,className:`font-medium`,children:[lT(i),` / `,oT.units_per_block,` units / task`]})]}),(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`Per week, at cap`}),(0,L.jsxs)(`span`,{"data-testid":`${r}-week`,className:`font-medium`,children:[lT(c),` / `,oT.units_per_week,` units`]})]}),(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`~ Daily cost at cap`}),(0,L.jsxs)(`span`,{"data-testid":`${r}-daily-usd`,className:`font-medium`,children:[`~$`,s<1?s.toFixed(2):s.toFixed(1),`/day`]})]})]}),(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:`Node pauses claims for this credential when the 6h or 7d cap is reached, then auto-resumes.`})]})}function dT(e){let{data:t,isPending:n}=dt({queryKey:[`status`],queryFn:()=>z.getStatus()});return e?n||!t?.costSurface?!0:t.costSurface.harnesses[iT(e)]?.usesPaidApiKey??!0:!1}function fT({label:e,children:t,docHref:n,docLabel:r=`Read more`}){let[i,a]=(0,I.useState)(!1);return(0,L.jsxs)(Lw,{open:i,onOpenChange:a,children:[(0,L.jsx)(Rw,{type:`button`,"data-testid":`inline-help-trigger`,"aria-label":e,className:`inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-md border border-muted-foreground bg-card p-0 text-muted-foreground transition-colors hover:border-foreground hover:text-foreground`,children:(0,L.jsx)(jn,{className:`h-2.5 w-2.5`,"aria-hidden":`true`})}),(0,L.jsxs)(zw,{"data-testid":`inline-help-panel`,role:`note`,align:`start`,className:`max-w-[420px] whitespace-pre-line font-mono text-[11px] font-normal leading-relaxed normal-case tracking-normal text-muted-foreground`,children:[t,n&&(0,L.jsxs)(L.Fragment,{children:[` `,(0,L.jsx)(`a`,{"data-testid":`inline-help-doc-link`,href:n,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:r})]})]})]})}var pT=`Self-improving agent by Nous Research. Built-in learning loop.`,mT=`https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md`,hT=xd,gT=`mx-auto flex max-w-[880px] flex-col gap-4 p-6`,_T=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]`,vT=_T,yT=`flex items-start gap-2`,bT=`rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[14px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;function xT(e,t){return e?.nets.find(e=>e.contract.id===t.id&&e.contract.version===t.version)}function ST(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:``}function CT(e){let t=e?.contract.evaluationFunction.implementation;if(t){if(t.includes(`swe-rebench-v2-evaluator`))return`swe-rebench-v2-evaluator`;if(t.includes(`prediction-v1-evaluator`))return`prediction-v1-evaluator`}}function wT(e){let t=[...new Set(e)].sort();return{readiness:dt({queryKey:[`harness-readiness`,t.join(`,`)],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{let e=await Promise.all(t.map(async e=>{try{return[e,await z.harnessReadiness(e)]}catch(t){if(t.code===`harness_not_found`)return[e,void 0];throw t}}));return new Map(e)}}).data??new Map}}function TT({manifestCid:e,navigateTo:t}={}){let n=Gt(),[,r]=qt(),i=t??r,a=Xe(),o=e??n.cid,s=dt({queryKey:[`solvernets`,`manifest`,o],queryFn:()=>z.solvernets.getManifest(o),enabled:!!o,retry:!1}),c=dt({queryKey:[`solvernets`,`catalog`],queryFn:()=>z.getSolverNets()}),l=s.data?.manifest,u=l?xT(c.data,l.contract):void 0,d=(u?.compatibleHarnesses??[]).filter(e=>e.supportsRoles.includes(`solving`)).map(e=>({...e,name:Ed(e.name)})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),f=d[0]?.name??hT,[p,m]=(0,I.useState)({roles:[],harness:f,plugins:[],disabledDefaultPlugins:[],model:Id(f)}),[h,g]=(0,I.useState)(null),[_,v]=(0,I.useState)(null),[y,b]=(0,I.useState)(!1),x=(0,I.useRef)(!1),[S,C]=(0,I.useState)(!1),w=d[0]?.name;(0,I.useEffect)(()=>{x.current||w&&w!==p.harness&&m(e=>({...e,harness:w,model:Id(w)}))},[w]);let T=Fd(p.harness),E=CT(l),{readiness:D}=wT([...d.map(e=>e.name),...p.roles.includes(`evaluator`)&&E?[E]:[]]),O=D.get(p.harness),ee=E?D.get(E):void 0,te=p.roles.includes(`solver`),k=dT(te?p.harness:void 0),A=eT(k,te?p.model:void 0),j=te&&A.requiresConfirmation,M=j&&!S,ne=ft({mutationFn:()=>z.operator.join(o,{...l?.name===void 0?{}:{name:l.name},...l?.contract===void 0?{}:{contract:{id:l.contract.id,version:l.contract.version}},roles:p.roles,...p.roles.includes(`solver`)?{harness:p.harness,plugins:p.plugins,disabledDefaultPlugins:p.disabledDefaultPlugins,model:p.model}:{}}),onSuccess:e=>{a.invalidateQueries({queryKey:[`operator`,`joined`]}),a.invalidateQueries({queryKey:[`bootstrap`]}),v({manifestCid:e.manifestCid,name:e.config.name??l?.name??e.manifestCid,roles:e.config.roles,restartRequired:e.restartRequired})},onError:e=>{g(e instanceof Error?e.message:String(e))}});if(!o)return(0,L.jsx)(`main`,{"data-testid":`join-flow-missing-cid`,className:gT,children:(0,L.jsx)(ET,{message:`No manifest cid supplied.`,onBack:()=>i(`/operator#solvernets`)})});if(s.isLoading)return(0,L.jsx)(`main`,{"data-testid":`join-flow-loading`,className:gT,children:(0,L.jsx)(`p`,{className:`m-0 font-mono text-[13px] text-[var(--fg-muted)]`,children:`Loading manifest…`})});if(s.isError||!l)return(0,L.jsx)(`main`,{"data-testid":`join-flow-error`,className:gT,children:(0,L.jsx)(ET,{message:`Failed to load manifest: ${s.error instanceof Error?s.error.message:`Unknown error`}`,onBack:()=>i(`/operator#solvernets`),onRetry:()=>{s.refetch()}})});if(_)return(0,L.jsx)(`main`,{"data-testid":`join-flow-success`,className:gT,children:(0,L.jsx)(DT,{success:_,navigate:i})});let{openRoles:N}=l,P=e=>{N.includes(e)&&m(t=>{let n=t.roles.includes(e)?t.roles.filter(t=>t!==e):N.filter(n=>n===e||t.roles.includes(n));return{...t,roles:n}})},re=p.roles.includes(`evaluator`),ie=te&&O?.ready===!1,ae=re&&ee?.ready===!1,oe=p.roles.length>0&&!ne.isPending&&!M&&!ie&&!ae,F=ae&&E?(0,L.jsxs)(`div`,{"data-testid":`join-evaluator-not-ready`,"data-harness":E,role:`status`,className:`flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground`,children:[(0,L.jsxs)(`span`,{className:`text-destructive`,children:[Dd(E),` is not ready`,ee?.reason?`: ${ee.reason}`:``]}),ee?.nextStep&&(0,L.jsxs)(`span`,{"data-testid":`join-evaluator-not-ready-next-step`,className:`text-[var(--fg-muted)]`,children:[ee.nextStep.description,ee.nextStep.cli?` (${ee.nextStep.cli})`:``]})]}):null;return(0,L.jsxs)(`main`,{"data-testid":`join-flow`,"data-manifest-cid":o,className:gT,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`span`,{"data-testid":`join-flow-title`,className:`font-mono text-[20px] font-medium text-foreground`,children:[`Join `,l.name]}),(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:l.description})]}),(0,L.jsxs)(W,{"data-testid":`join-flow-summary`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsx)(`span`,{className:_T,children:`Manifest`}),(0,L.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]`,children:[(0,L.jsx)(`span`,{children:`Contract`}),(0,L.jsxs)(`span`,{className:`text-foreground`,children:[l.contract.id,` · `,l.contract.version]}),(0,L.jsx)(`span`,{children:`Solution price`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:Sv(l.solutionPriceWei)}),(0,L.jsx)(`span`,{children:`Verdict price`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:Sv(l.verdictPriceWei)}),(0,L.jsx)(`span`,{children:`Open roles`}),(0,L.jsx)(`span`,{"data-testid":`join-flow-open-roles`,className:`text-foreground`,children:N.join(`, `)||`none`}),(0,L.jsx)(`span`,{children:`Launcher`}),(0,L.jsxs)(`span`,{className:`text-foreground`,children:[ST(l.launcher.safeAddress),` · agentId`,` `,l.launcher.agentId]}),(0,L.jsx)(`span`,{children:`Manifest CID`}),(0,L.jsx)(`span`,{"data-testid":`join-flow-manifest-cid`,className:`truncate text-[var(--fg-dim)]`,children:o})]})]}),(0,L.jsxs)(W,{className:`flex flex-col gap-3 p-4`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(`span`,{className:_T,children:`Roles`}),(0,L.jsxs)(fT,{label:`Roles help`,docHref:`${mT}#solver-vs-evaluator`,children:[`Solver attempts tasks and submits solutions. It is the spending role: you pay for model inference and gas. It also has the most upside per task.`,`
74
+
75
+ `,`Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.`,`
76
+
77
+ `,`You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for.`]})]}),(0,L.jsx)(`div`,{className:`flex overflow-hidden rounded-md border border-border`,children:N.map((e,t)=>{let n=p.roles.includes(e),r=`join-role-${e}`;return(0,L.jsxs)(`label`,{htmlFor:r,"data-testid":`join-role-option`,"data-role":e,"data-role-active":n?`true`:`false`,className:H(`flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono`,n?`bg-[var(--bg)] text-foreground`:`bg-transparent text-[var(--fg-muted)]`,t<N.length-1&&`border-r border-border`),children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{id:r,type:`checkbox`,checked:n,onChange:()=>P(e),"aria-label":e===`solver`?`Solver`:`Evaluator`,className:`size-3.5 accent-primary`}),(0,L.jsx)(`span`,{className:`text-[14px] font-medium`,children:e===`solver`?`Solver`:`Evaluator`})]}),(0,L.jsx)(`span`,{className:H(`pl-[22px] text-[11px]`,n?`text-[var(--fg-muted)]`:`text-[var(--fg-dim)]`),children:e===`solver`?`attempt tasks; submit solutions`:`verify solutions submitted by other operators`})]},e)})})]}),te&&(0,L.jsxs)(W,{"data-testid":`join-flow-solver-fields`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsx)(`span`,{className:_T,children:`Solver configuration`}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(cp,{htmlFor:`join-harness-select`,className:vT,children:`Harness`}),(0,L.jsxs)(fT,{label:`Harness help`,docHref:`${mT}#harness-and-model`,children:[`The harness is the runtime that runs a task.`,`
78
+
79
+ `,`You only need credentials for one harness — the harness, not the harness and the model separately.`,`
80
+
81
+ `,"Claude Code uses whatever the `claude` CLI is signed in with: a Claude subscription or an Anthropic API key. Hermes Agent is a separate package; the join form checks it is installed.",`
82
+
83
+ `,`The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two.`]})]}),(0,L.jsxs)(`select`,{id:`join-harness-select`,"aria-label":`Harness`,"data-testid":`join-harness-select`,value:p.harness,onChange:e=>{let t=e.target.value;x.current=!0,m({...p,harness:t,model:Id(t)}),C(!1)},className:bT,children:[d.map(e=>{let t=D.get(e.name),n=t?.ready===!1;return(0,L.jsxs)(`option`,{value:e.name,disabled:n,"data-testid":`join-harness-option`,"data-harness":e.name,"data-harness-ready":t===void 0?`unknown`:t.ready?`true`:`false`,children:[Od(e.name,e.version),n?` — setup required`:``]},e.name)}),(!u||d.length===0)&&(0,L.jsx)(`option`,{value:p.harness,children:Dd(p.harness)})]}),p.harness===`hermes-agent`&&(0,L.jsx)(`span`,{"data-testid":`join-harness-hermes-description`,className:`font-mono text-[11px] text-[var(--fg-muted)]`,children:pT}),O?.ready===!1&&(0,L.jsxs)(`div`,{"data-testid":`join-harness-not-ready`,"data-harness":p.harness,role:`status`,className:`flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground`,children:[(0,L.jsxs)(`span`,{className:`text-destructive`,children:[Dd(p.harness),` is not ready`,O.reason?`: ${O.reason}`:``]}),O.nextStep&&(0,L.jsxs)(`span`,{"data-testid":`join-harness-not-ready-next-step`,className:`text-[var(--fg-muted)]`,children:[O.nextStep.description,O.nextStep.cli?` (${O.nextStep.cli})`:``]})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(cp,{htmlFor:`join-model-select`,className:vT,children:`Model`}),(0,L.jsxs)(fT,{label:`Model help`,docHref:`${mT}#harness-and-model`,children:[`The model is the LLM the harness runs.`,`
84
+
85
+ `,`This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.`,`
86
+
87
+ `,`You pay for the model through the harness's credentials. There is no extra model subscription on top.`,`
88
+
89
+ `,`Check the cost estimate below before you join.`]})]}),(0,L.jsxs)(`select`,{id:`join-model-select`,"aria-label":`Model`,"data-testid":`join-model-select`,value:p.model,onChange:e=>{m({...p,model:e.target.value}),C(!1)},className:bT,children:[T.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id)),(()=>{let e=Ld(p.model,p.harness);return e.isCustom?(0,L.jsx)(`option`,{value:p.model,children:e.label},p.model):null})()]})]})]}),(0,L.jsx)(nT,{modelId:p.model,usesPaidApiKey:k,testIdPrefix:`join-flow-cost`}),(0,L.jsx)(uT,{harness:p.harness,modelId:p.model,testIdPrefix:`join-flow-footprint`}),j&&(0,L.jsxs)(`label`,{"data-testid":`join-flow-cost-confirmation`,"data-cost-confirmation-checked":S?`true`:`false`,className:`flex cursor-pointer items-start gap-2.5 rounded-md border border-destructive bg-[var(--bg)] p-3 font-mono text-[12px] text-foreground`,children:[(0,L.jsx)(`input`,{type:`checkbox`,"data-testid":`join-flow-cost-confirmation-checkbox`,checked:S,onChange:e=>C(e.target.checked),className:`mt-0.5 size-3.5 accent-destructive`,"aria-label":`I understand the per-task cost and have a budget for this`}),(0,L.jsx)(`span`,{children:`I understand — I have a budget for this. The selected model is estimated at more than $1 per task; I am responsible for the API spend on my own provider key.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(`span`,{className:vT,children:`Plugins`}),(0,L.jsxs)(fT,{label:`Plugins help`,docHref:`${mT}#plug-ins`,children:[`Plug-ins are optional. On your first run you do not need to touch this section.`,`
90
+
91
+ `,`A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.`,`
92
+
93
+ `,`This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.`,`
94
+
95
+ `,`You can re-join later with more plug-ins.`]})]}),(0,L.jsx)(Zw,{available:u?.compatiblePlugins??[],selected:p.plugins,disabledDefaultPlugins:p.disabledDefaultPlugins,onChange:(e,t)=>m({...p,plugins:e,disabledDefaultPlugins:t}),rowTestId:`join-plugin-option`,searchTestId:`join-plugin-search`,harness:p.harness})]})]}),re&&!te&&(0,L.jsxs)(W,{"data-testid":`join-flow-evaluator-info`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(`span`,{className:_T,children:`Evaluator configuration`}),(0,L.jsxs)(fT,{label:`Evaluator configuration help`,docHref:`${mT}#why-the-evaluator-role-has-no-model-selector`,children:[`The evaluator role has no harness or model picker. That is by design.`,`
96
+
97
+ `,`Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.`,`
98
+
99
+ `,`For many SolverNets that function is deterministic and uses no model at all.`]})]}),(0,L.jsxs)(`p`,{className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:[`The evaluator harness is bound to`,` `,(0,L.jsx)(`code`,{className:`text-foreground`,children:l.contract.evaluationFunction.implementation}),` `,`by the manifest's contract; no operator selection required.`]}),F]}),re&&te&&(0,L.jsxs)(W,{"data-testid":`join-flow-evaluator-info`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsxs)(`span`,{className:yT,children:[(0,L.jsx)(`span`,{className:_T,children:`Evaluator binding`}),(0,L.jsxs)(fT,{label:`Evaluator binding help`,docHref:`${mT}#why-the-evaluator-role-has-no-model-selector`,children:[`The SolverNet's manifest sets the evaluator harness for you.`,`
100
+
101
+ `,`Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.`,`
102
+
103
+ `,`The harness and model fields above apply only to the solver role.`]})]}),(0,L.jsxs)(`p`,{className:`m-0 font-mono text-[12px] text-[var(--fg-muted)]`,children:[`Evaluator harness is bound to`,` `,(0,L.jsx)(`code`,{className:`text-foreground`,children:l.contract.evaluationFunction.implementation}),` `,`by the manifest. The fields above only configure the solver role.`]}),F]}),y&&(0,L.jsx)(FC,{onSuccess:()=>{b(!1),ne.mutate()},onCancel:()=>{b(!1)}}),h&&(0,L.jsx)(`p`,{"data-testid":`join-flow-submit-error`,role:`alert`,className:`m-0 font-mono text-[13px] text-destructive`,children:h}),(0,L.jsxs)(`footer`,{className:`flex items-center justify-end gap-3`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`join-flow-cancel`,onClick:()=>i(`/operator#solvernets`),children:`Cancel`}),(0,L.jsx)(U,{type:`button`,variant:`default`,"data-testid":`join-flow-submit`,disabled:!oe,onClick:()=>{if(g(null),p.roles.includes(`solver`)&&p.harness===`hermes-agent`){b(!0);return}ne.mutate()},children:ne.isPending?`Joining…`:`Join SolverNet`})]})]})}function ET({message:e,onBack:t,onRetry:n}){return(0,L.jsxs)(no,{variant:`blocking`,className:`flex items-center justify-between gap-4 border-l-0 border border-destructive p-4`,children:[(0,L.jsx)(K,{className:`font-mono text-[13px] text-destructive`,children:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[n&&(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`join-flow-retry`,onClick:n,children:`Retry`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`join-flow-back`,onClick:t,children:`Back`})]})]})}function DT({success:e,navigate:t}){let n=e.roles.map(e=>e===`solver`?`Solver`:`Evaluator`).join(` + `),[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(null),s=async()=>{i(!0),o(null);try{if(!(await z.restartDaemon()).ok)throw Error(`Restart request failed.`);t(`/overview`)}catch(e){o(e instanceof Error?e.message:`Restart request failed.`),i(!1)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(W,{"data-testid":`join-flow-success-card`,role:`status`,className:`flex flex-col gap-2.5 border-[var(--vow-green)] p-5`,children:[(0,L.jsx)(q,{variant:`success`,className:`self-start`,children:`Joined`}),(0,L.jsxs)(`span`,{"data-testid":`join-flow-success-name`,className:`font-mono text-[18px] font-medium text-foreground`,children:[`You joined `,e.name]}),(0,L.jsxs)(`span`,{className:`font-mono text-[12px] leading-relaxed text-[var(--fg-muted)]`,children:[`You're in as `,n||`an operator`,`. This SolverNet now shows in your joined list.`]}),e.restartRequired&&(0,L.jsx)(`span`,{"data-testid":`join-flow-success-restart`,className:`font-mono text-[12px] leading-relaxed text-[var(--accent-gold)]`,children:`Restart the node to start participating — the daemon picks up SolverNet config on restart.`})]}),a&&(0,L.jsx)(ro,{role:`alert`,"data-testid":`join-flow-success-restart-error`,className:`font-mono text-[12px] leading-relaxed text-destructive`,children:a}),(0,L.jsxs)(`footer`,{className:`flex items-center justify-end gap-3`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`join-flow-success-browse`,onClick:()=>t(`/operator#solvernets`),children:`Browse SolverNets`}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`join-flow-success-view`,onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:`View joined SolverNet`}),(0,L.jsx)(U,{type:`button`,variant:`default`,"data-testid":`join-flow-success-restart-button`,onClick:()=>{s()},disabled:r,children:r?`Restarting…`:`Restart node now`})]})]})}function OT({capture:e}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Executor`}),(0,L.jsxs)(`dl`,{className:`m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]`,children:[(0,L.jsx)(`dt`,{className:`font-mono text-[12px] text-muted-foreground`,children:`Tool`}),(0,L.jsx)(`dd`,{className:`m-0 font-mono text-[12px] text-foreground`,children:e.originatingTool.name}),(0,L.jsx)(`dt`,{className:`font-mono text-[12px] text-muted-foreground`,children:`Version`}),(0,L.jsx)(`dd`,{className:`m-0 font-mono text-[12px] text-foreground`,children:e.originatingTool.version??`unknown`}),(0,L.jsx)(`dt`,{className:`font-mono text-[12px] text-muted-foreground`,children:`Repo`}),(0,L.jsx)(`dd`,{className:`m-0 break-words font-mono text-[12px] text-foreground`,children:e.repoRemoteUrl??`none`}),(0,L.jsx)(`dt`,{className:`font-mono text-[12px] text-muted-foreground`,children:`Commit`}),(0,L.jsx)(`dd`,{className:`m-0 font-mono text-[12px] text-foreground`,children:e.repoCommitHash?.slice(0,12)??`none`})]})]})}function kT({spans:e}){let t=e.flatMap(e=>e.redactedKeys.map(t=>({span:e.name,key:t})));return(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Redactions`}),t.length===0?(0,L.jsx)(`div`,{className:`font-mono text-[12px] text-muted-foreground`,children:`No redacted attributes.`}):(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map((e,t)=>(0,L.jsxs)(`div`,{className:`grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:e.span}),(0,L.jsx)(`span`,{className:`break-words`,children:e.key})]},`${e.span}-${e.key}-${t}`))})]})}function AT({detail:e,approving:t=!1,skipping:n=!1,onApprove:r,onSkip:i,onTrustRepo:a}){let{capture:o,spans:s}=e;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground`,children:o.sessionId}),(0,L.jsxs)(`div`,{className:`mt-1.5 font-mono text-[12px] text-muted-foreground`,children:[new Date(o.capturedAt).toLocaleString(),` · `,s.length,` spans`]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2`,children:[o.repoRemoteUrl?(0,L.jsx)(U,{variant:`secondary`,size:`sm`,onClick:()=>a(!0),children:`Trust repo`}):null,(0,L.jsx)(U,{variant:`secondary`,size:`sm`,disabled:n,onClick:i,children:n?`Skipping`:`Skip`}),(0,L.jsx)(U,{variant:`default`,size:`sm`,disabled:t,onClick:r,children:t?`Approving`:`Approve`})]})]}),(0,L.jsx)(OT,{capture:o}),(0,L.jsx)(kT,{spans:s}),(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Trajectory`}),s.length===0?(0,L.jsx)(`div`,{className:`font-mono text-[12px] text-muted-foreground`,children:`No spans recorded.`}):(0,L.jsx)(W,{children:(0,L.jsx)(Bi,{className:`flex flex-col p-0`,children:s.map((e,t)=>(0,L.jsxs)(`div`,{children:[t>0&&(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-2.5`,children:[(0,L.jsx)(`strong`,{className:`min-w-0 truncate font-mono text-[12px] font-medium text-foreground`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.spanId})]})]},e.spanId))})})]})]})}var jT=`Switch`,[MT,NT]=ia(jT),[PT,FT]=MT(jT),IT=I.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=I.useState(null),m=qn(t,e=>p(e)),h=I.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=mu({prop:i,defaultProp:a??!1,onChange:l,caller:jT});return(0,L.jsxs)(PT,{scope:n,checked:_,disabled:s,children:[(0,L.jsx)(Yi.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":VT(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:G(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,L.jsx)(BT,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});IT.displayName=jT;var LT=`SwitchThumb`,RT=I.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=FT(LT,n);return(0,L.jsx)(Yi.span,{"data-state":VT(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});RT.displayName=LT;var zT=`SwitchBubbleInput`,BT=I.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=I.useRef(null),s=qn(o,a),c=pf(n),l=Bl(t);return I.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,L.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});BT.displayName=zT;function VT(e){return e?`checked`:`unchecked`}var HT=IT,UT=RT,WT=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(HT,{className:H(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--vow-green)] data-[state=unchecked]:bg-border`,e),...t,ref:n,children:(0,L.jsx)(UT,{className:H(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5`)})}));WT.displayName=HT.displayName;function GT(e){return Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)))}function KT(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(GT(e.perArtifactTypePrice))===JSON.stringify(GT(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function qT({label:e,value:t,meta:n}){return(0,L.jsxs)(`div`,{"data-testid":`operator-donation-fact`,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border border-border px-3.5 py-3`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(`strong`,{className:`font-mono text-[18px] font-medium text-foreground`,children:t}),(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-[var(--fg-dim)]`,children:n})]})}function JT({pricing:e,eligibleRuns:t,peerDatasetsUsed:n,saving:r,onSave:i,registerRevert:a}){let[o,s]=(0,I.useState)(e.donation.enabled),[c,l]=(0,I.useState)(!1),u=(0,I.useMemo)(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:o}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,o]),d=!KT(e,u);return(0,L.jsxs)(`div`,{"data-testid":`operator-donation-status`,className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-[260px] flex-[1_1_360px] flex-col gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Donate execution data`}),(0,L.jsx)(`strong`,{"data-testid":`operator-donation-mode`,className:o?`font-mono text-[18px] font-medium text-[var(--vow-green)]`:`font-mono text-[18px] font-medium text-foreground`,children:o?`Donation is on`:`Donation is off`}),(0,L.jsx)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[12px] leading-relaxed text-[var(--fg-dim)]`,children:`Share scrubbed and anonymized solver/evaluator data from future runs with other operators. This lets the network learn from real executions and improve itself. Public testnet donations are free and published to IPFS.`})]}),(0,L.jsxs)(`label`,{"data-testid":`operator-donation-toggle`,className:`inline-flex cursor-pointer items-center gap-3 rounded-full border border-border bg-[var(--bg-sunken)] px-3 py-2`,children:[(0,L.jsx)(`span`,{className:o?`font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--vow-green)]`:`font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground`,children:o?`On`:`Off`}),(0,L.jsx)(WT,{"aria-label":`Donate produced data`,checked:o,onCheckedChange:t=>{if(t&&!o&&!e.donation.enabled){l(!0);return}s(t)}})]})]}),(0,L.jsxs)(`div`,{"data-testid":`operator-donation-facts`,className:`grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]`,children:[(0,L.jsx)(qT,{label:`Eligible runs`,value:String(t),meta:`local history`}),(0,L.jsx)(qT,{label:`Peer datasets used`,value:String(n),meta:`from other operators`})]}),(0,L.jsx)(no,{variant:`info`,"data-testid":`operator-donation-caveat`,children:(0,L.jsx)(K,{children:`Turning donation off stops future publishing. Data already published to IPFS may remain available.`})}),(0,L.jsx)(Wh,{}),(0,L.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{"data-testid":`operator-donation-settings-state`,className:d?`font-mono text-[12px] text-primary`:`font-mono text-[12px] text-[var(--fg-dim)]`,children:d?`Donation changed`:`Current`}),(0,L.jsx)(U,{variant:`default`,size:`sm`,type:`button`,disabled:!d||r,onClick:()=>{let t=e.donation.enabled;o!==t&&a(()=>s(t)),i(u)},children:r?`Saving…`:`Save`})]})}),(0,L.jsx)(nC,{open:c,onOpenChange:l,children:(0,L.jsxs)(aC,{"data-testid":`operator-donation-confirm`,children:[(0,L.jsxs)(oC,{children:[(0,L.jsx)(cC,{children:`Share future execution data`}),(0,L.jsx)(lC,{children:`Future solver/evaluator runs will be scrubbed, anonymized, and published to IPFS so other operators can use them. This helps the network learn from real executions and improve itself. Turning donation off later stops future publishing, but data already published to IPFS may remain available.`})]}),(0,L.jsxs)(sC,{children:[(0,L.jsx)(dC,{children:`Cancel`}),(0,L.jsx)(uC,{onClick:()=>{let e={...u,donation:{enabled:!0}};s(!0),l(!1),a(()=>s(!1)),i(e)},children:`Enable donation`})]})]})})]})}function YT({onRestartPending:e=()=>void 0}){let t=Xe(),{data:n,isLoading:r,isError:i,error:a,refetch:o}=dt({queryKey:[`operator-artifacts`,`served`],queryFn:()=>z.operator.listArtifacts({source:`served`,limit:100}),refetchInterval:1e4}),s=(0,I.useRef)(null),c=e=>{s.current=e},l=ft({mutationFn:e=>z.operator.updatePricing(e),onSuccess:async()=>{s.current=null,Oh.success(`Donation setting saved`,{description:`Restart pending — applies on next daemon start.`}),e(),await t.invalidateQueries({queryKey:[`operator-artifacts`]})},onError:e=>{let t=s.current;s.current=null,t?.(),Oh.error(`Failed to save donation setting`,{description:e instanceof Error?e.message:String(e)})}}),u=n?.summary,d=u?`${u.served.totalCount} eligible runs · donation ${n?.pricing.donation.enabled?`on`:`off`} · ${u.network.totalCount} peer datasets used`:`Donate scrubbed and anonymized run data to IPFS so other operators can use it.`;return(0,L.jsxs)(W,{children:[(0,L.jsxs)(Li,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(Ri,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Bn,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Data donation`]}),(0,L.jsx)(zi,{children:d})]}),(0,L.jsx)(q,{variant:n?.pricing.donation.enabled?`success`:`outline`,children:n?.pricing.donation.enabled?`IPFS donation on`:`Donation off`})]}),(0,L.jsxs)(Bi,{children:[r&&(0,L.jsxs)(`div`,{"data-testid":`operator-data-market-loading`,className:`flex flex-col gap-3`,"aria-label":`Loading execution data`,children:[(0,L.jsx)(gd,{className:`h-6 w-40`}),(0,L.jsx)(gd,{className:`h-4 w-72`}),(0,L.jsx)(gd,{className:`h-20 w-full`})]}),i&&(0,L.jsxs)(no,{variant:`blocking`,role:`alert`,"data-testid":`operator-data-market-error`,className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(ro,{className:`text-[var(--break-red)]`,children:a instanceof Error?a.message:`Failed to load execution data.`}),(0,L.jsxs)(U,{variant:`outline`,size:`sm`,type:`button`,onClick:()=>{o()},children:[(0,L.jsx)(zn,{className:`h-3 w-3`,"aria-hidden":`true`}),`Retry`]})]}),n&&(0,L.jsx)(JT,{pricing:n.pricing,eligibleRuns:n.summary.served.totalCount,peerDatasetsUsed:n.summary.network.totalCount,saving:l.isPending,onSave:e=>l.mutate(e),registerRevert:c},`${n.pricing.publicEndpoint}|${n.pricing.defaultPriceUsdc}|${n.pricing.donation.enabled}|${JSON.stringify(GT(n.pricing.perArtifactTypePrice))}`)]})]})}function XT(e){let t=ZT(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find($T);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ZT(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=tE(n),i=eE(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QT=Symbol(`radix.slottable`);function $T(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===QT}function eE(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function tE(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nE=`Dialog`,[rE,iE]=ia(nE),[aE,oE]=rE(nE),sE=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=I.useRef(null),c=I.useRef(null),[l,u]=mu({prop:r,defaultProp:i??!1,onChange:a,caller:nE});return(0,L.jsx)(aE,{scope:t,triggerRef:s,contentRef:c,contentId:ws(),titleId:ws(),descriptionId:ws(),open:l,onOpenChange:u,onOpenToggle:I.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};sE.displayName=nE;var cE=`DialogTrigger`,lE=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=oE(cE,n),a=qn(t,i.triggerRef);return(0,L.jsx)(Yi.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":kE(i.open),...r,ref:a,onClick:G(e.onClick,i.onOpenToggle)})});lE.displayName=cE;var uE=`DialogPortal`,[dE,fE]=rE(uE,{forceMount:void 0}),pE=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=oE(uE,t);return(0,L.jsx)(dE,{scope:t,forceMount:n,children:I.Children.map(r,e=>(0,L.jsx)($i,{present:n||a.open,children:(0,L.jsx)(uu,{asChild:!0,container:i,children:e})}))})};pE.displayName=uE;var mE=`DialogOverlay`,hE=I.forwardRef((e,t)=>{let n=fE(mE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=oE(mE,e.__scopeDialog);return a.modal?(0,L.jsx)($i,{present:r||a.open,children:(0,L.jsx)(_E,{...i,ref:t})}):null});hE.displayName=mE;var gE=XT(`DialogOverlay.RemoveScroll`),_E=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=oE(mE,n);return(0,L.jsx)(Tx,{as:gE,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Yi.div,{"data-state":kE(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),vE=`DialogContent`,yE=I.forwardRef((e,t)=>{let n=fE(vE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=oE(vE,e.__scopeDialog);return(0,L.jsx)($i,{present:r||a.open,children:a.modal?(0,L.jsx)(bE,{...i,ref:t}):(0,L.jsx)(xE,{...i,ref:t})})});yE.displayName=vE;var bE=I.forwardRef((e,t)=>{let n=oE(vE,e.__scopeDialog),r=I.useRef(null),i=qn(t,n.contentRef,r);return I.useEffect(()=>{let e=r.current;if(e)return Px(e)},[]),(0,L.jsx)(SE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})}),xE=I.forwardRef((e,t)=>{let n=oE(vE,e.__scopeDialog),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(SE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),SE=I.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=oE(vE,n),c=I.useRef(null),l=qn(t,c);return LC(),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(UC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(hs,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":kE(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(NE,{titleId:s.titleId}),(0,L.jsx)(FE,{contentRef:c,descriptionId:s.descriptionId})]})]})}),CE=`DialogTitle`,wE=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=oE(CE,n);return(0,L.jsx)(Yi.h2,{id:i.titleId,...r,ref:t})});wE.displayName=CE;var TE=`DialogDescription`,EE=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=oE(TE,n);return(0,L.jsx)(Yi.p,{id:i.descriptionId,...r,ref:t})});EE.displayName=TE;var DE=`DialogClose`,OE=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=oE(DE,n);return(0,L.jsx)(Yi.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})});OE.displayName=DE;function kE(e){return e?`open`:`closed`}var AE=`DialogTitleWarning`,[jE,ME]=ra(AE,{contentName:vE,titleName:CE,docsSlug:`dialog`}),NE=({titleId:e})=>{let t=ME(AE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
104
+
105
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
106
+
107
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return I.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},PE=`DialogDescriptionWarning`,FE=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ME(PE).contentName}}.`;return I.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},IE=sE,LE=pE,RE=hE,zE=yE,BE=wE,VE=EE,HE=OE,UE=IE,WE=LE,GE=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(RE,{className:H(`fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));GE.displayName=RE.displayName;var KE=lr(`fixed z-50 gap-4 bg-card p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),qE=I.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,L.jsxs)(WE,{children:[(0,L.jsx)(GE,{}),(0,L.jsxs)(zE,{ref:i,className:H(KE({side:e}),t),...r,children:[n,(0,L.jsxs)(HE,{className:`absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none`,children:[(0,L.jsx)(Un,{className:`h-4 w-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));qE.displayName=zE.displayName;var JE=({className:e,...t})=>(0,L.jsx)(`div`,{className:H(`flex flex-col gap-2 text-left`,e),...t});JE.displayName=`SheetHeader`;var YE=({className:e,...t})=>(0,L.jsx)(`div`,{className:H(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t});YE.displayName=`SheetFooter`;var XE=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(BE,{ref:n,className:H(`font-serif text-[20px] text-foreground`,e),...t}));XE.displayName=BE.displayName;var ZE=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(VE,{ref:n,className:H(`font-mono text-[12px] text-[var(--fg-muted)]`,e),...t}));ZE.displayName=VE.displayName;function QE(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?Math.round(n):n.toFixed(1)} ${t[r]}`}function $E(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace(`T`,` `).slice(0,19)+` UTC`}function eD(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function tD(e,t){switch(e){case 8453:return`https://basescan.org/tx/${t}`;case 84532:return`https://sepolia.basescan.org/tx/${t}`;case 11155111:return`https://sepolia.etherscan.io/tx/${t}`;default:return null}}function nD(e){return e==null||!Number.isFinite(e)?`—`:$E(new Date(e*1e3).toISOString())}function rD({title:e,children:t}){return(0,L.jsxs)(W,{children:[(0,L.jsx)(Li,{className:`pb-2`,children:(0,L.jsx)(Ri,{className:`font-mono text-[11px] uppercase tracking-wide text-muted-foreground`,children:e})}),(0,L.jsx)(Bi,{className:`p-4 pt-0`,children:t})]})}function iD({rows:e}){return(0,L.jsx)(`dl`,{className:`m-0 grid gap-x-3.5 gap-y-2.5 [grid-template-columns:140px_minmax(0,1fr)]`,children:e.map(({label:e,value:t})=>(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(`dt`,{className:`font-mono text-[12px] text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`m-0 break-all font-mono text-[12px] text-foreground`,children:t??`—`})]},e))})}function aD(e){return e.source===`served`?e.createdAt:e.fetchedAt}function oD(e){return e.source===`served`?`shared`:e.paidAmountUsdc===`0`?`peer donated`:`peer used`}function sD(e,t){return!e||e.kind!==t.kind?!1:e.kind===`capture`&&t.kind===`capture`?e.id===t.id:e.kind===`artifact`&&t.kind===`artifact`?e.source===t.source&&e.sha256===t.sha256:!1}function cD(e){return e?e instanceof Error?e.message:String(e):`Unknown error`}function lD(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(cD(e))}function uD({kind:e,message:t}){let n=e===`permission`?`Permission required to view execution data. Open the dashboard from the daemon handshake URL or refresh an authenticated session.`:`Execution data could not be loaded${t?`: ${t}`:`.`}`;return(0,L.jsx)(no,{variant:e===`permission`?`warning`:`blocking`,"data-testid":e===`permission`?`execution-data-permission`:`execution-data-error`,children:(0,L.jsx)(K,{children:n})})}function dD(e){return{id:`capture:${e.sessionId}`,selection:{kind:`capture`,id:e.sessionId},title:`execution-capture.v1`,state:e.status,meta:`${e.originatingTool.name} · ${e.spanCount} spans · ${e.redactedSpanCount} redacted`,at:e.capturedAt}}function fD(e){let t=oD(e);return{id:`artifact:${e.source}:${e.sha256}`,selection:{kind:`artifact`,source:e.source,sha256:e.sha256},title:e.artifactType,state:t,meta:`${e.source===`served`?`produced`:`peer`} · ${QE(e.contentSize)} · ${eD(e.sha256)}`,at:aD(e)}}function pD({artifact:e}){let t=aD(e),n=e.projection,r=e.anchors??[],i=[{label:`state`,value:oD(e)},{label:`sha256`,value:e.sha256},{label:`recorded`,value:$E(t)}],a=[{label:`envelope`,value:e.envelopeCid??`—`}];n&&a.push({label:`signature`,value:n.signatureHash},{label:`generated`,value:nD(n.generatedAt)},{label:`role`,value:n.role},{label:`solver`,value:n.solverType},{label:`evidence tier`,value:n.evidenceTier});let o=n?[{label:`safe`,value:n.participantSafeAddress??`—`},{label:`agent EOA`,value:n.participantAgentEoa??`—`},{label:`impl`,value:n.executor.implName??`—`},{label:`impl version`,value:n.executor.implVersion??`—`},{label:`runtime digest`,value:n.executor.runtimeBundleDigest??`—`},{label:`plugins`,value:n.executor.plugins&&n.executor.plugins.length>0?(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.executor.plugins.map(e=>(0,L.jsx)(q,{variant:`outline`,children:e},e))}):`—`}]:null,s=n?[{label:`task CID`,value:n.taskCid??`—`},{label:`task ID`,value:n.taskId??`—`},{label:`request`,value:n.requestId??`—`},{label:`solution ref`,value:n.solutionRef?`${n.solutionRef.envelopeCid}${n.solutionRef.ref?` (${n.solutionRef.ref})`:``}`:`—`}]:null;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(rD,{title:`Identity`,children:(0,L.jsx)(iD,{rows:i})}),(0,L.jsx)(rD,{title:`Envelope`,children:(0,L.jsx)(iD,{rows:a})}),o?(0,L.jsx)(rD,{title:`Participant`,children:(0,L.jsx)(iD,{rows:o})}):null,s?(0,L.jsx)(rD,{title:`Task`,children:(0,L.jsx)(iD,{rows:s})}):null,(0,L.jsx)(rD,{title:`On-chain anchors`,children:r.length===0?(0,L.jsx)(`div`,{className:`font-mono text-[12px] text-muted-foreground`,children:`no on-chain anchor recorded yet`}):(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:r.map(e=>{let t=tD(e.chainId,e.txHash);return(0,L.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-3`,children:[(0,L.jsx)(iD,{rows:[{label:`content kind`,value:e.contentKind},{label:`agent ID`,value:e.agentId},{label:`chain ID`,value:String(e.chainId)},{label:`tx`,value:t?(0,L.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`break-all underline underline-offset-2 hover:text-foreground`,children:e.txHash}):e.txHash},{label:`block`,value:e.blockNumber===null?`pending`:String(e.blockNumber)},{label:`anchored`,value:nD(e.anchoredAt)},{label:`registry`,value:e.identityRegistryAddress},{label:`metadata key`,value:e.metadataKey}]}),(0,L.jsxs)(`details`,{className:`mt-2`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer font-mono text-[11px] text-muted-foreground`,children:`payload (ABI-encoded)`}),(0,L.jsx)(`div`,{className:`mt-1 break-all font-mono text-[11px] text-foreground`,children:e.payloadHex})]})]},`${e.contentKind}:${e.txHash}`)})})}),e.source===`served`?(0,L.jsx)(rD,{title:`Access`,children:(0,L.jsx)(iD,{rows:[{label:`request`,value:e.requestId??`—`},{label:`accesses`,value:`${e.access.accessCount} total · ${e.access.failedPaymentCount} failed`},{label:`paid serves`,value:String(e.access.paidServeCount)},{label:`free serves`,value:String(e.access.freeServeCount)},{label:`revenue`,value:`${e.access.revenueUsdc} USDC`}]})}):(0,L.jsx)(rD,{title:`Source`,children:(0,L.jsx)(iD,{rows:[{label:`operator`,value:e.sourceOperator??`—`},{label:`endpoint`,value:e.sourceEndpoint??`—`},{label:`origin`,value:e.origin},{label:`paid`,value:`${e.paidAmountUsdc} USDC`},{label:`peer catalog`,value:e.peerCatalogId??`—`}]})})]})}function mD(){let e=Xe(),[t,n]=(0,I.useState)(),[r,i]=(0,I.useState)(!1),a=dt({queryKey:[`captures`,`pending`],queryFn:()=>z.captures.listPending(),refetchInterval:2500}),o=dt({queryKey:[`operator-artifacts`,`served`,`execution-data`],queryFn:()=>z.operator.listArtifacts({source:`served`,limit:100}),refetchInterval:1e4}),s=dt({queryKey:[`operator-artifacts`,`network`,`execution-data`],queryFn:()=>z.operator.listArtifacts({source:`network`,limit:100}),refetchInterval:1e4}),c=a.data?.captures??[],l=[...o.data?.artifacts??[],...s.data?.artifacts??[]].sort((e,t)=>aD(t).localeCompare(aD(e))),u=[...c.map(dD),...l.map(fD)].sort((e,t)=>t.at.localeCompare(e.at)),d=t?.kind===`capture`?t.id:void 0,f=t?.kind===`artifact`?l.find(e=>e.source===t.source&&e.sha256===t.sha256):void 0,p=a.isLoading||o.isLoading||s.isLoading,m=[a.isError?a.error:a.failureReason,o.isError?o.error:o.failureReason,s.isError?s.error:s.failureReason].filter(Boolean),h=m.find(lD),g=h??m[0];(0,I.useEffect)(()=>{if(u.length===0){t&&n(void 0),r&&i(!1);return}(!t||!u.some(e=>sD(t,e.selection)))&&n(u[0].selection)},[u,t,r]);let _=dt({queryKey:[`captures`,d],queryFn:()=>z.captures.get(d),enabled:!!d}),v=ft({mutationFn:e=>z.captures.approve(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:[`captures`]}),e.invalidateQueries({queryKey:[`operator-artifacts`]})])}}),y=ft({mutationFn:e=>z.captures.skip(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:[`captures`]})}}),b=ft({mutationFn:e=>z.captures.trustRepo(e,!0)}),x=e=>{n(e),i(!0)},S=t?.kind===`capture`?_.data?.capture.sessionId??`Capture`:f?.artifactType??`Artifact`,C=t?.kind===`capture`&&_.data?`${new Date(_.data.capture.capturedAt).toLocaleString()} · ${_.data.spans.length} spans`:t?.kind===`artifact`&&f?`${oD(f)} · ${QE(f.contentSize)} · ${$E(aD(f))}`:`Execution data detail.`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 p-6`,children:[(0,L.jsx)(YT,{defaultExpanded:!0}),(0,L.jsxs)(W,{children:[(0,L.jsx)(Li,{children:(0,L.jsx)(Ri,{children:`Execution data`})}),(0,L.jsxs)(Bi,{children:[g?(0,L.jsx)(`div`,{className:`mb-3`,children:(0,L.jsx)(uD,{kind:h?`permission`:`error`,message:h?void 0:cD(g)})}):null,p&&u.length===0?(0,L.jsx)(`div`,{className:`p-6 font-mono text-[12px] text-muted-foreground`,children:`Loading execution data.`}):u.length===0?(0,L.jsx)(`div`,{className:`p-6 font-mono text-[12px] text-muted-foreground`,children:`No execution data yet.`}):(0,L.jsx)(Ya,{className:`max-h-[560px]`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-2 pr-2`,children:u.map(e=>{let n=sD(t,e.selection);return(0,L.jsxs)(U,{variant:`ghost`,"data-testid":`execution-data-row`,"data-state":n?`active`:void 0,"aria-current":n?`true`:void 0,onClick:()=>x(e.selection),className:H(`flex h-auto w-full flex-col items-stretch gap-1.5 rounded-md border border-border bg-card px-4 py-3 text-left font-mono text-[12px] normal-case tracking-normal hover:bg-accent`,n&&`border-primary bg-primary/[0.06]`),children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`strong`,{className:`min-w-0 truncate font-medium text-foreground`,children:e.title}),(0,L.jsx)(q,{variant:`outline`,className:`shrink-0`,children:e.state})]}),(0,L.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[e.meta,` · `,$E(e.at)]})]},e.id)})})})]})]}),(0,L.jsx)(UE,{open:r,onOpenChange:i,children:(0,L.jsxs)(qE,{side:`right`,className:`w-full overflow-y-auto sm:max-w-xl`,"data-testid":`execution-data-sheet`,children:[(0,L.jsxs)(JE,{children:[(0,L.jsx)(XE,{className:`break-all`,children:S}),(0,L.jsx)(ZE,{children:C})]}),(0,L.jsx)(`div`,{className:`mt-4`,children:_.error?(0,L.jsx)(uD,{kind:lD(_.error)?`permission`:`error`,message:lD(_.error)?void 0:cD(_.error)}):t?.kind===`capture`&&_.data?(0,L.jsx)(AT,{detail:_.data,approving:v.isPending,skipping:y.isPending,onApprove:()=>d&&v.mutate(d),onSkip:()=>d&&y.mutate(d),onTrustRepo:()=>{let e=_.data.capture.repoRemoteUrl;e&&b.mutate(e)}}):t?.kind===`artifact`&&f?(0,L.jsx)(pD,{artifact:f}):(0,L.jsx)(`div`,{className:`p-6 font-mono text-[12px] text-muted-foreground`,children:p?`Loading execution data.`:`Select execution data.`})})]})})]})}function hD(e){let t=gD(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(vD);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function gD(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=bD(n),i=yD(r,n.props);return n.type!==I.Fragment&&(i.ref=t?Kn(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _D=Symbol(`radix.slottable`);function vD(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_D}function yD(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function bD(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xD=[`Enter`,` `],SD=[`ArrowDown`,`PageUp`,`Home`],CD=[`ArrowUp`,`PageDown`,`End`],wD=[...SD,...CD],TD={ltr:[...xD,`ArrowRight`],rtl:[...xD,`ArrowLeft`]},ED={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},DD=`Menu`,[OD,kD,AD]=Wd(DD),[jD,MD]=ia(DD,[AD,Ul,Qd]),ND=Ul(),PD=Qd(),[FD,ID]=jD(DD),[LD,RD]=jD(DD),zD=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ND(t),[c,l]=I.useState(null),u=I.useRef(!1),d=oa(a),f=ca(i);return I.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,L.jsx)(au,{...s,children:(0,L.jsx)(FD,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(LD,{scope:t,onClose:I.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};zD.displayName=DD;var BD=`MenuAnchor`,VD=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ND(n);return(0,L.jsx)(ou,{...i,...r,ref:t})});VD.displayName=BD;var HD=`MenuPortal`,[UD,WD]=jD(HD,{forceMount:void 0}),GD=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=ID(HD,t);return(0,L.jsx)(UD,{scope:t,forceMount:n,children:(0,L.jsx)($i,{present:n||a.open,children:(0,L.jsx)(uu,{asChild:!0,container:i,children:r})})})};GD.displayName=HD;var KD=`MenuContent`,[qD,JD]=jD(KD),YD=I.forwardRef((e,t)=>{let n=WD(KD,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ID(KD,e.__scopeMenu),o=RD(KD,e.__scopeMenu);return(0,L.jsx)(OD.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)($i,{present:r||a.open,children:(0,L.jsx)(OD.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(XD,{...i,ref:t}):(0,L.jsx)(ZD,{...i,ref:t})})})})}),XD=I.forwardRef((e,t)=>{let n=ID(KD,e.__scopeMenu),r=I.useRef(null),i=qn(t,r);return I.useEffect(()=>{let e=r.current;if(e)return Px(e)},[]),(0,L.jsx)($D,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ZD=I.forwardRef((e,t)=>{let n=ID(KD,e.__scopeMenu);return(0,L.jsx)($D,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),QD=hD(`MenuContent.ScrollLock`),$D=I.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=ID(KD,n),_=RD(KD,n),v=ND(n),y=PD(n),b=kD(n),[x,S]=I.useState(null),C=I.useRef(null),w=qn(t,C,g.onContentChange),T=I.useRef(0),E=I.useRef(``),D=I.useRef(0),O=I.useRef(null),ee=I.useRef(`right`),te=I.useRef(0),k=m?Tx:I.Fragment,A=m?{as:QD,allowPinchZoom:!0}:void 0,j=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=LO(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};I.useEffect(()=>()=>window.clearTimeout(T.current),[]),LC();let M=I.useCallback(e=>ee.current===O.current?.side&&zO(e,O.current?.area),[]);return(0,L.jsx)(qD,{scope:n,searchRef:E,onItemEnter:I.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:I.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:I.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:I.useCallback(e=>{O.current=e},[]),children:(0,L.jsx)(k,{...A,children:(0,L.jsx)(UC,{asChild:!0,trapped:i,onMountAutoFocus:G(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(hs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(df,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:G(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(su,{role:`menu`,"aria-orientation":`vertical`,"data-state":MO(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:G(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=C.current;if(e.target!==i||!wD.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);CD.includes(e.key)&&a.reverse(),FO(a)}),onBlur:G(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:G(e.onPointerMove,BO(e=>{let t=e.target,n=te.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ee.current=e.clientX>te.current?`right`:`left`,te.current=e.clientX)}))})})})})})})});YD.displayName=KD;var eO=`MenuGroup`,tO=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Yi.div,{role:`group`,...r,ref:t})});tO.displayName=eO;var nO=`MenuLabel`,rO=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Yi.div,{...r,ref:t})});rO.displayName=nO;var iO=`MenuItem`,aO=`menu.itemSelect`,oO=I.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=I.useRef(null),o=RD(iO,e.__scopeMenu),s=JD(iO,e.__scopeMenu),c=qn(t,a),l=I.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(aO,{bubbles:!0,cancelable:!0});e.addEventListener(aO,e=>r?.(e),{once:!0}),Xi(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,L.jsx)(sO,{...i,ref:c,disabled:n,onClick:G(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:G(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:G(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||xD.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});oO.displayName=iO;var sO=I.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=JD(iO,n),s=PD(n),c=I.useRef(null),l=qn(t,c),[u,d]=I.useState(!1),[f,p]=I.useState(``);return I.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(OD.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(ff,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(Yi.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:G(e.onPointerMove,BO(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,BO(e=>o.onItemLeave(e))),onFocus:G(e.onFocus,()=>d(!0)),onBlur:G(e.onBlur,()=>d(!1))})})})}),cO=`MenuCheckboxItem`,lO=I.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(_O,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(oO,{role:`menuitemcheckbox`,"aria-checked":NO(n)?`mixed`:n,...i,ref:t,"data-state":PO(n),onSelect:G(i.onSelect,()=>r?.(NO(n)?!0:!n),{checkForDefaultPrevented:!1})})})});lO.displayName=cO;var uO=`MenuRadioGroup`,[dO,fO]=jD(uO,{value:void 0,onValueChange:()=>{}}),pO=I.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=oa(r);return(0,L.jsx)(dO,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,L.jsx)(tO,{...i,ref:t})})});pO.displayName=uO;var mO=`MenuRadioItem`,hO=I.forwardRef((e,t)=>{let{value:n,...r}=e,i=fO(mO,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(_O,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(oO,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":PO(a),onSelect:G(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});hO.displayName=mO;var gO=`MenuItemIndicator`,[_O,vO]=jD(gO,{checked:!1}),yO=I.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=vO(gO,n);return(0,L.jsx)($i,{present:r||NO(a.checked)||a.checked===!0,children:(0,L.jsx)(Yi.span,{...i,ref:t,"data-state":PO(a.checked)})})});yO.displayName=gO;var bO=`MenuSeparator`,xO=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Yi.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});xO.displayName=bO;var SO=`MenuArrow`,CO=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ND(n);return(0,L.jsx)(cu,{...i,...r,ref:t})});CO.displayName=SO;var wO=`MenuSub`,[TO,EO]=jD(wO),DO=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=ID(wO,t),o=ND(t),[s,c]=I.useState(null),[l,u]=I.useState(null),d=oa(i);return I.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,L.jsx)(au,{...o,children:(0,L.jsx)(FD,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,L.jsx)(TO,{scope:t,contentId:ws(),triggerId:ws(),trigger:s,onTriggerChange:c,children:n})})})};DO.displayName=wO;var OO=`MenuSubTrigger`,kO=I.forwardRef((e,t)=>{let n=ID(OO,e.__scopeMenu),r=RD(OO,e.__scopeMenu),i=EO(OO,e.__scopeMenu),a=JD(OO,e.__scopeMenu),o=I.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=I.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return I.useEffect(()=>u,[u]),I.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,L.jsx)(VD,{asChild:!0,...l,children:(0,L.jsx)(sO,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":MO(n.open),...e,ref:Kn(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,BO(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:G(e.onPointerLeave,BO(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||TD[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});kO.displayName=OO;var AO=`MenuSubContent`,jO=I.forwardRef((e,t)=>{let n=WD(KD,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ID(KD,e.__scopeMenu),o=RD(KD,e.__scopeMenu),s=EO(AO,e.__scopeMenu),c=I.useRef(null),l=qn(t,c);return(0,L.jsx)(OD.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)($i,{present:r||a.open,children:(0,L.jsx)(OD.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)($D,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:G(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:G(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ED[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});jO.displayName=AO;function MO(e){return e?`open`:`closed`}function NO(e){return e===`indeterminate`}function PO(e){return NO(e)?`indeterminate`:e?`checked`:`unchecked`}function FO(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function IO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function LO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=IO(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function RO(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function zO(e,t){return t?RO({x:e.clientX,y:e.clientY},t):!1}function BO(e){return t=>t.pointerType===`mouse`?e(t):void 0}var VO=zD,HO=VD,UO=GD,WO=YD,GO=tO,KO=rO,qO=oO,JO=lO,YO=pO,XO=hO,ZO=yO,QO=xO,$O=CO,ek=kO,tk=jO,nk=`DropdownMenu`,[rk,ik]=ia(nk,[MD]),ak=MD(),[ok,sk]=rk(nk),ck=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ak(t),l=I.useRef(null),[u,d]=mu({prop:i,defaultProp:a??!1,onChange:o,caller:nk});return(0,L.jsx)(ok,{scope:t,triggerId:ws(),triggerRef:l,contentId:ws(),open:u,onOpenChange:d,onOpenToggle:I.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(VO,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ck.displayName=nk;var lk=`DropdownMenuTrigger`,uk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=sk(lk,n),o=ak(n);return(0,L.jsx)(HO,{asChild:!0,...o,children:(0,L.jsx)(Yi.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:Kn(t,a.triggerRef),onPointerDown:G(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:G(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});uk.displayName=lk;var dk=`DropdownMenuPortal`,fk=e=>{let{__scopeDropdownMenu:t,...n}=e,r=ak(t);return(0,L.jsx)(UO,{...r,...n})};fk.displayName=dk;var pk=`DropdownMenuContent`,mk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sk(pk,n),a=ak(n),o=I.useRef(!1);return(0,L.jsx)(WO,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:G(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});mk.displayName=pk;var hk=`DropdownMenuGroup`,gk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(GO,{...i,...r,ref:t})});gk.displayName=hk;var _k=`DropdownMenuLabel`,vk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(KO,{...i,...r,ref:t})});vk.displayName=_k;var yk=`DropdownMenuItem`,bk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(qO,{...i,...r,ref:t})});bk.displayName=yk;var xk=`DropdownMenuCheckboxItem`,Sk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(JO,{...i,...r,ref:t})});Sk.displayName=xk;var Ck=`DropdownMenuRadioGroup`,wk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(YO,{...i,...r,ref:t})});wk.displayName=Ck;var Tk=`DropdownMenuRadioItem`,Ek=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(XO,{...i,...r,ref:t})});Ek.displayName=Tk;var Dk=`DropdownMenuItemIndicator`,Ok=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(ZO,{...i,...r,ref:t})});Ok.displayName=Dk;var kk=`DropdownMenuSeparator`,Ak=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(QO,{...i,...r,ref:t})});Ak.displayName=kk;var jk=`DropdownMenuArrow`,Mk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)($O,{...i,...r,ref:t})});Mk.displayName=jk;var Nk=`DropdownMenuSubTrigger`,Pk=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(ek,{...i,...r,ref:t})});Pk.displayName=Nk;var Fk=`DropdownMenuSubContent`,Ik=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ak(n);return(0,L.jsx)(tk,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ik.displayName=Fk;var Lk=ck,Rk=uk,zk=fk,Bk=mk,Vk=vk,Hk=bk,Uk=Sk,Wk=Ok,Gk=Ak,Kk=Lk,qk=Rk,Jk=I.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(zk,{children:(0,L.jsx)(Bk,{ref:r,sideOffset:t,className:H(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,e),...n})}));Jk.displayName=Bk.displayName;var Yk=I.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Hk,{ref:r,className:H(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 font-mono text-[12px] outline-none transition-colors focus:bg-[var(--bg-sunken)] focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));Yk.displayName=Hk.displayName;var Xk=I.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,L.jsxs)(Uk,{ref:i,className:H(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 font-mono text-[12px] outline-none focus:bg-[var(--bg-sunken)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,L.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,L.jsx)(Wk,{children:(0,L.jsx)(xn,{className:`h-3 w-3`})})}),t]}));Xk.displayName=Uk.displayName;var Zk=I.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Vk,{ref:r,className:H(`px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,t&&`pl-8`,e),...n}));Zk.displayName=Vk.displayName;var Qk=I.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Gk,{ref:n,className:H(`-mx-1 my-1 h-px bg-border`,e),...t}));Qk.displayName=Gk.displayName;var $k=[{to:`/operator/memberships`,label:`Memberships`},{to:`/operator/registry`,label:`Registry`},{to:`/operator/execution-data`,label:`Execution data`},{to:`/operator/network`,label:`Network`},{to:`/operator/security`,label:`Security`}];function eA({to:e,label:t}){let[n]=Yt(e);return(0,L.jsx)(`li`,{children:(0,L.jsx)(en,{href:e,"aria-current":n?`page`:void 0,className:H(`block rounded-sm px-3 py-2 font-mono text-[12px] tracking-[0.08em] no-underline transition-colors`,n?`bg-[var(--bg-elevated)] font-medium text-foreground`:`bg-transparent font-normal text-[var(--fg-muted)] hover:text-foreground`),children:t})})}function tA(){let[,e]=qt();return(0,L.jsxs)(`nav`,{"aria-label":`Operator sections`,"data-testid":`operator-sub-nav`,className:`flex min-w-[160px] flex-col pt-1`,children:[(0,L.jsx)(`div`,{className:`mb-2 sm:hidden`,children:(0,L.jsxs)(Kk,{children:[(0,L.jsx)(qk,{asChild:!0,children:(0,L.jsxs)(U,{variant:`outline`,size:`sm`,"data-testid":`operator-sub-nav-trigger`,children:[(0,L.jsx)(Fn,{className:`h-3.5 w-3.5`}),` Sections`]})}),(0,L.jsx)(Jk,{align:`start`,children:$k.map(t=>(0,L.jsx)(Yk,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),(0,L.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-0.5 p-0`,children:$k.map(e=>(0,L.jsx)(eA,{to:e.to,label:e.label},e.to))})]})}function nA({children:e}){return(0,L.jsxs)(`div`,{"data-testid":`operator-shell`,className:`flex items-start gap-6 p-6`,children:[(0,L.jsx)(tA,{}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:e})]})}function rA(e){let t=Ed(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Id(t)}}function iA(e,t){let n=Ed(t.harness);if(e.harness!==n||e.model!==(t.model??Id(n)))return!0;let r=[...e.plugins].sort(),i=[...t.plugins??[]].sort();if(r.length!==i.length)return!0;for(let e=0;e<r.length;e+=1)if(r[e]!==i[e])return!0;let a=[...e.disabledDefaultPlugins].sort(),o=[...t.disabledDefaultPlugins??[]].sort();if(a.length!==o.length)return!0;for(let e=0;e<a.length;e+=1)if(a[e]!==o[e])return!0;return!1}var aA=`flex h-9 w-full rounded-sm border border-border bg-sunken px-2.5 py-1 font-mono text-[13px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;function oA({joined:e,catalogEntry:t,defaultExpanded:n=!1,focusOn:r,onRestartPending:i}){let[a,o]=(0,I.useState)(n),[s,c]=(0,I.useState)(()=>rA(e)),l=(0,I.useRef)(null),u=(0,I.useRef)(null),d=Xe(),f=t!==void 0,p=dt({queryKey:[`solvernets`,`manifest`,e.manifestCid],queryFn:()=>z.solvernets.getManifest(e.manifestCid),enabled:!f&&!!e.manifestCid,staleTime:1/0,retry:!1}),m=dt({queryKey:[`solvernets`,`catalog`],queryFn:()=>z.getSolverNets(),enabled:!f}),h=(()=>{if(f)return t;let e=p.data?.manifest;if(!(!e||!m.data))return m.data.nets.find(t=>t.contract.id===e.contract.id&&t.contract.version===e.contract.version)})(),g=e.contract??h?.contract,_=!f&&(p.isLoading||m.isLoading),v=!f&&p.isError&&!p.isLoading;(0,I.useEffect)(()=>{iA(s,e)||c(rA(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),(0,I.useEffect)(()=>{n&&(o(!0),r===`harness`&&setTimeout(()=>{l.current?.scrollIntoView({block:`center`,behavior:`smooth`}),u.current?.focus()},50))},[n,r]);let y=(h?.compatibleHarnesses??[]).filter(e=>e.supportsRoles.includes(`solving`)).map(e=>({...e,name:Ed(e.name)})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),b=new Set(y.map(e=>e.name)),x=s.harness!==``&&y.length>0&&![...b].some(e=>kd(e,s.harness)),S=h?`${h.contract.id}@${h.contract.version}`:``,C=Fd(s.harness),w=ft({mutationFn:()=>z.operator.join(e.manifestCid,{...e.name===void 0?{}:{name:e.name},...g===void 0?{}:{contract:{id:g.id,version:g.version}},roles:e.roles,...s.harness?{harness:s.harness}:{},plugins:s.plugins,disabledDefaultPlugins:s.disabledDefaultPlugins,...s.model?{model:s.model}:{}}),onSuccess:e=>{d.invalidateQueries({queryKey:[`operator`,`joined`]}),e.restartRequired&&i?.()}}),[T,E]=(0,I.useState)(!1),D=e.roles.includes(`solver`),O=dT(D?s.harness:void 0),ee=eT(O,D?s.model:void 0),te=D&&ee.requiresConfirmation,k=te&&!T,[A,j]=(0,I.useState)(!1),M=ft({mutationFn:()=>z.operator.leave(e.manifestCid),onSuccess:e=>{d.invalidateQueries({queryKey:[`operator`,`joined`]}),e.restartRequired&&i?.(),j(!1)}}),ne=iA(s,e),N=e.name??e.manifestCid,P=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return(0,L.jsxs)(`article`,{"data-testid":`joined-net-card`,"data-manifest-cid":e.manifestCid,"data-expanded":a?`true`:`false`,className:`flex flex-col gap-2.5 rounded-md border border-border bg-background px-4 py-3.5`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`span`,{"data-testid":`joined-net-card-name`,className:`truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]`,children:N}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground`,children:[e.roles.map(e=>(0,L.jsx)(cA,{label:e},e)),(0,L.jsxs)(`span`,{className:`text-dim`,children:[`cid `,P]})]})]}),v?(0,L.jsx)(`div`,{className:`flex flex-col items-end gap-1.5`,children:A?(0,L.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`joined-net-card-leave-cancel`,disabled:M.isPending,onClick:()=>j(!1),children:`Cancel`}),(0,L.jsx)(U,{type:`button`,variant:`destructive`,size:`sm`,"data-testid":`joined-net-card-leave-confirm`,disabled:M.isPending,onClick:()=>M.mutate(),children:M.isPending?`Leaving…`:`Confirm leave`})]}):(0,L.jsxs)(U,{type:`button`,variant:`destructive`,size:`sm`,"data-testid":`joined-net-card-leave`,onClick:()=>j(!0),children:[(0,L.jsx)(Un,{"aria-hidden":`true`,className:`!size-3`}),`Leave`]})}):(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`joined-net-card-toggle`,onClick:()=>o(e=>!e),children:a?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sn,{"aria-hidden":`true`,className:`!size-3.5`}),`Close`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Cn,{"aria-hidden":`true`,className:`!size-3.5`}),`Edit`]})})]}),v&&(0,L.jsxs)(`div`,{"data-testid":`joined-net-card-orphaned`,className:`rounded-sm border border-wane bg-transparent px-3.5 py-2.5 font-mono text-[12px] leading-relaxed text-muted-foreground`,children:[(0,L.jsx)(q,{variant:`pill`,className:`mr-2 align-baseline`,children:`Retired`}),`Manifest no longer in the registry. This SolverNet is not claiming on-chain anymore — leaving it removes the entry from your config. Restart the daemon afterwards so it stops looking for this manifest at startup.`,M.isError&&(0,L.jsx)(`div`,{role:`alert`,className:`mt-1.5 text-[11px] text-destructive`,children:M.error instanceof Error?M.error.message:`Leave failed.`})]}),!a&&!v&&(0,L.jsx)(sA,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:x?`does not support ${S}`:null,warningTestId:`joined-net-card-warn-collapsed`}),v&&(0,L.jsx)(sA,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),a&&!v&&(0,L.jsxs)(`div`,{"data-testid":`joined-net-card-form`,className:`flex flex-col gap-3.5 border-t border-border pt-3`,children:[(0,L.jsxs)(`div`,{ref:l,className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(cp,{htmlFor:`joined-net-card-harness-select`,children:`Harness`}),(0,L.jsxs)(`select`,{ref:u,id:`joined-net-card-harness-select`,"aria-label":`Harness implementation`,"data-testid":`joined-net-card-harness-select`,value:s.harness,onChange:e=>{let t=e.target.value;c(e=>({...e,harness:t,model:Id(t)})),E(!1)},className:H(aA,x&&`border-destructive`),children:[s.harness===``&&(0,L.jsx)(`option`,{value:``,children:`—`}),y.map(e=>(0,L.jsx)(`option`,{value:e.name,children:Od(e.name,e.version)},e.name)),s.harness&&y.length>0&&!b.has(s.harness)&&(0,L.jsxs)(`option`,{value:s.harness,children:[Dd(s.harness),` (incompatible)`]}),s.harness&&y.length===0&&(0,L.jsx)(`option`,{value:s.harness,children:Dd(s.harness)})]}),x&&(0,L.jsxs)(`span`,{"data-testid":`joined-net-card-warn-expanded`,className:`font-mono text-[11px] leading-relaxed text-destructive`,children:[`⚠ This harness does not support `,(0,L.jsx)(`span`,{className:`text-foreground`,children:S}),`.`,y.length>0&&(0,L.jsxs)(L.Fragment,{children:[` Compatible: `,y.map((e,t)=>(0,L.jsxs)(`span`,{className:`text-primary`,children:[Dd(e.name),t<y.length-1?` · `:``]},e.name))]})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(cp,{children:`Plugins`}),_?(0,L.jsx)(`span`,{"data-testid":`joined-net-card-catalog-loading`,className:`font-mono text-[12px] text-dim`,children:`Loading registry catalog…`}):h?(h.compatiblePlugins??[]).length===0?(0,L.jsx)(Zw,{available:[],selected:s.plugins,disabledDefaultPlugins:s.disabledDefaultPlugins,onChange:(e,t)=>c(n=>({...n,plugins:e,disabledDefaultPlugins:t})),rowTestId:`joined-net-card-plugin-row`,searchTestId:`joined-net-card-plugin-search`,harness:s.harness}):(0,L.jsx)(Zw,{available:h?.compatiblePlugins??[],selected:s.plugins,disabledDefaultPlugins:s.disabledDefaultPlugins,onChange:(e,t)=>c(n=>({...n,plugins:e,disabledDefaultPlugins:t})),rowTestId:`joined-net-card-plugin-row`,searchTestId:`joined-net-card-plugin-search`,harness:s.harness}):(0,L.jsx)(`span`,{"data-testid":`joined-net-card-catalog-missing`,className:`font-mono text-[12px] italic text-dim`,children:`Registry catalog has no template for this SolverNet's contract — plugins can't be verified.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(cp,{htmlFor:`joined-net-card-model-select`,children:`Model`}),(0,L.jsxs)(`select`,{id:`joined-net-card-model-select`,"aria-label":`Model`,"data-testid":`joined-net-card-model-select`,value:s.model,onChange:e=>{c({...s,model:e.target.value}),E(!1)},className:aA,children:[C.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id)),(()=>{let e=Ld(s.model,s.harness);return e.isCustom?(0,L.jsx)(`option`,{value:s.model,children:e.label},s.model):null})()]})]}),D&&(0,L.jsx)(nT,{modelId:s.model,usesPaidApiKey:O,variant:`inline`,testIdPrefix:`joined-net-card-cost`}),D&&(0,L.jsx)(uT,{harness:s.harness,modelId:s.model,variant:`inline`,testIdPrefix:`joined-net-card-footprint`}),te&&(0,L.jsxs)(`label`,{"data-testid":`joined-net-card-cost-confirmation`,"data-cost-confirmation-checked":T?`true`:`false`,className:`flex cursor-pointer items-start gap-2 rounded-md border border-destructive bg-background px-3 py-2.5 font-mono text-[12px] text-foreground`,children:[(0,L.jsx)(`input`,{type:`checkbox`,"data-testid":`joined-net-card-cost-confirmation-checkbox`,checked:T,onChange:e=>E(e.target.checked),className:`mt-0.5 size-3.5 accent-destructive`,"aria-label":`I understand the per-task cost and have a budget for this`}),(0,L.jsx)(`span`,{children:`I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key.`})]}),w.isError&&(0,L.jsx)(`span`,{role:`alert`,"data-testid":`joined-net-card-error`,className:`font-mono text-[12px] text-destructive`,children:w.error instanceof Error?w.error.message:`Save failed.`}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between font-mono text-[11px] text-dim`,children:[(0,L.jsx)(`span`,{children:ne?`Restart required to apply.`:`No unsaved changes.`}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`joined-net-card-cancel`,disabled:!ne||w.isPending,onClick:()=>c(rA(e)),children:`Cancel`}),(0,L.jsx)(U,{type:`button`,size:`sm`,"data-testid":`joined-net-card-save`,disabled:!ne||w.isPending||k,onClick:()=>w.mutate(),children:w.isPending?`Saving…`:`Save`})]})]}),(0,L.jsxs)(`div`,{"data-testid":`joined-net-card-leave-zone`,className:`mt-1 flex flex-wrap items-start justify-between gap-3 border-t border-dashed border-border pt-3`,children:[(0,L.jsx)(`span`,{"data-testid":`joined-net-card-leave-explainer`,className:`max-w-[440px] font-mono text-[11px] leading-relaxed text-dim`,children:`Leave removes this SolverNet from your config right away. The running daemon keeps its loaded copy in memory, so it will go on claiming and finishing tasks for this SolverNet until you restart it — restart to actually stop new claims. Tasks already in flight run to completion either way. You can re-join from the Discover catalog later.`}),A?(0,L.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`joined-net-card-leave-cancel`,disabled:M.isPending,onClick:()=>j(!1),children:`Cancel`}),(0,L.jsx)(U,{type:`button`,variant:`destructive`,size:`sm`,"data-testid":`joined-net-card-leave-confirm`,disabled:M.isPending,onClick:()=>M.mutate(),children:M.isPending?`Leaving…`:`Confirm leave`})]}):(0,L.jsxs)(U,{type:`button`,variant:`destructive`,size:`sm`,"data-testid":`joined-net-card-leave`,onClick:()=>j(!0),children:[(0,L.jsx)(Un,{"aria-hidden":`true`,className:`!size-3`}),`Leave SolverNet`]})]})]})]})}function sA({harness:e,plugins:t,model:n,harnessWarning:r,warningTestId:i}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:`harness`}),(0,L.jsxs)(`span`,{className:`text-foreground`,children:[e?Dd(e):(0,L.jsx)(`span`,{className:`text-dim`,children:`—`}),r&&i&&(0,L.jsxs)(`span`,{"data-testid":i,className:`ml-2.5 text-destructive`,children:[`⚠ `,r]})]}),(0,L.jsx)(`span`,{children:`plugins`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:(t??[]).length===0?(0,L.jsx)(`span`,{className:`text-dim`,children:`—`}):`${t.length} active`}),(0,L.jsx)(`span`,{children:`model`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:n?Ld(n,Ed(e)).label:(0,L.jsx)(`span`,{className:`text-dim`,children:`—`})})]})}function cA({label:e}){return(0,L.jsx)(q,{variant:`outline`,"data-testid":`joined-net-card-role`,className:`px-1.5 py-px text-[10px]`,children:e})}function lA({onRestartPending:e}={}){let t=dt({queryKey:[`operator`,`joined`],queryFn:()=>z.operator.listJoined(),refetchInterval:3e4}),n=(0,I.useMemo)(()=>{let e=t.data?.joinedSolverNets??{};return Object.values(e)},[t.data]);return(0,L.jsxs)(`div`,{"data-testid":`memberships-tab`,className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,L.jsxs)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:[`Joined · `,n.length]}),t.isError&&(0,L.jsx)(`span`,{role:`alert`,className:`font-mono text-[11px] text-[var(--break-red)]`,children:`Failed to load joined SolverNets.`})]}),t.isLoading&&(0,L.jsxs)(`div`,{"data-testid":`memberships-tab-loading`,className:`flex flex-col gap-3`,"aria-label":`Loading`,children:[(0,L.jsx)(gd,{className:`h-20 w-full`}),(0,L.jsx)(gd,{className:`h-20 w-full`})]}),!t.isLoading&&n.length===0&&(0,L.jsxs)(`p`,{"data-testid":`memberships-tab-empty`,className:`m-0 font-mono text-[12px] leading-relaxed text-muted-foreground`,children:[`You haven't joined any SolverNets yet. Browse the`,` `,(0,L.jsx)(en,{href:`/operator/registry`,className:`text-primary no-underline hover:underline`,children:`Registry`}),` `,`to participate.`]}),n.map(t=>(0,L.jsx)(oA,{joined:t,onRestartPending:e},t.manifestCid))]})}var uA={launched:{variant:`success`,label:`Launched`},paused:{variant:`pill`,label:`Paused`},retired:{variant:`outline`,label:`Retired`}};function dA(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:``}function fA(e){if(!e)return null;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace(`T`,` `).slice(0,16)+` UTC`}catch{return e}}function pA(e){if(e instanceof Error){let t=e.code;if(typeof t==`string`)return t;if(e.message.includes(`subsystem_not_ready`))return`subsystem_not_ready`;if(e.message.includes(`registry_unavailable`))return`registry_unavailable`;if(e.message.includes(`rpc_rate_limited`))return`rpc_rate_limited`}return null}var mA={title:`Your RPC endpoint is rate-limited.`,detail:`Open the Network section and add your own free key.`,actionHref:`/operator#network`,actionLabel:`Open Network settings →`};function hA(e){switch(pA(e)){case`subsystem_not_ready`:return{title:`SolverNet subsystem is still starting.`,detail:`Wait a few seconds, then retry. If this persists, restart the daemon and check its startup logs.`};case`registry_unavailable`:return{title:`Registry cache is unavailable.`,detail:`The daemon could not read the SolverNet registry cache. Retry after startup finishes; check daemon logs if it keeps failing.`};case`rpc_rate_limited`:return mA;default:return{title:`Failed to load registry catalog.`,detail:e instanceof Error?e.message:`Unknown error`}}}function gA({code:e,message:t}){return e===`rpc_rate_limited`?(0,L.jsxs)(`span`,{"data-testid":`registry-catalog-warn`,"data-error-code":`rpc_rate_limited`,className:`inline-flex gap-2 normal-case tracking-normal text-[var(--wane)]`,children:[(0,L.jsx)(`span`,{children:`RPC rate-limited — add your own key`}),(0,L.jsx)(en,{href:`/operator#network`,"data-testid":`registry-catalog-warn-action`,className:`text-primary no-underline hover:underline`,children:`Network settings →`})]}):(0,L.jsxs)(`span`,{"data-testid":`registry-catalog-warn`,className:`normal-case tracking-normal text-[var(--wane)]`,children:[`stale (`,t,`)`]})}function _A({status:e}){let t=uA[e]??uA.launched;return(0,L.jsx)(q,{"data-testid":`registry-status-badge`,"data-status":e,variant:t.variant,className:`whitespace-nowrap`,children:t.label})}function vA({openRoles:e}){return e.length===0?(0,L.jsx)(`span`,{className:`text-[12px] text-[var(--fg-dim)]`,children:`no open roles`}):(0,L.jsx)(`span`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,L.jsx)(q,{"data-testid":`registry-open-role`,"data-role":e,variant:`outline`,className:`rounded-full text-foreground`,children:e},e))})}function yA({summary:e,joinedRoles:t}){let n=`/operator/join/${encodeURIComponent(e.manifestCid)}`,r=(t??[]).length>0,i=e.status===`launched`;return(0,L.jsx)(W,{"data-testid":`registry-card`,"data-manifest-cid":e.manifestCid,className:`flex flex-col gap-3 p-4`,children:(0,L.jsxs)(`article`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,L.jsx)(`span`,{className:e.name?`truncate font-mono text-[15px] font-medium text-foreground`:`truncate font-mono text-[15px] font-medium italic text-[var(--fg-muted)]`,children:e.name||`Metadata pending`}),(0,L.jsxs)(`span`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:[`Launcher: `,dA(e.launcherSafeAddress),` · agentId`,` `,e.launcherAgentId]})]}),(0,L.jsx)(_A,{status:e.status})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]`,children:[(0,L.jsx)(`span`,{children:`Open roles`}),(0,L.jsx)(vA,{openRoles:e.openRoles}),(0,L.jsx)(`span`,{children:`Solution price`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:Sv(e.solutionPriceWei)}),(0,L.jsx)(`span`,{children:`Verdict price`}),(0,L.jsx)(`span`,{className:`text-foreground`,children:Sv(e.verdictPriceWei)})]}),(0,L.jsxs)(`footer`,{className:`flex items-center justify-end gap-3`,children:[r&&(0,L.jsxs)(q,{"data-testid":`registry-card-joined`,"data-manifest-cid":e.manifestCid,variant:`success`,className:`rounded-full px-2.5 py-1`,children:[`JOINED · `,(t??[]).join(`, `)]}),i?(0,L.jsx)(U,{asChild:!0,variant:r?`secondary`:`default`,"data-testid":`registry-join-cta`,"data-manifest-cid":e.manifestCid,children:(0,L.jsx)(en,{href:n,children:r?`Edit`:`Join`})}):(0,L.jsx)(U,{type:`button`,variant:`secondary`,"data-testid":`registry-join-cta`,"data-manifest-cid":e.manifestCid,disabled:!0,"aria-disabled":!0,className:`pointer-events-none`,children:r?`Edit`:`Join`})]})]})})}function bA({refetchIntervalMs:e=3e4}={}){let{data:t,isLoading:n,isError:r,error:i,refetch:a}=dt({queryKey:[`solvernets`,`registry`],queryFn:()=>z.solvernets.listRegistry(),refetchInterval:e}),o=dt({queryKey:[`operator`,`joined`],queryFn:()=>z.operator.listJoined(),refetchInterval:e}),s=o.data?.joinedSolverNets??{};if(n||o.isLoading)return(0,L.jsx)(`p`,{"data-testid":`registry-catalog-loading`,className:`m-0 font-mono text-[13px] text-[var(--fg-muted)]`,children:`Loading catalog…`});if(r||o.isError){let e=hA(r?i:o.error);return(0,L.jsxs)(no,{"data-testid":`registry-catalog-error`,variant:`blocking`,className:`flex items-center justify-between gap-4 border-l-0 border border-destructive p-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(ro,{className:`font-mono text-[13px] font-medium text-destructive`,children:e.title}),(0,L.jsx)(K,{className:`text-[12px] text-[var(--fg-muted)]`,children:e.detail}),e.actionHref&&e.actionLabel&&(0,L.jsx)(en,{href:e.actionHref,"data-testid":`registry-catalog-error-action`,className:`mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline`,children:e.actionLabel})]}),(0,L.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,"data-testid":`registry-catalog-retry`,onClick:()=>{a()},children:`Retry`})]})}let c=t?.summaries??[],l=c.filter(e=>s[e.manifestCid]===void 0),u=fA(t?.lastRefreshedAt??null),d=t?.lastError??null;return(0,L.jsxs)(`div`,{"data-testid":`registry-catalog`,className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]`,children:[(0,L.jsxs)(`span`,{"data-testid":`registry-catalog-meta`,children:[l.length,` discoverable · last refreshed`,` `,u??`never`]}),d&&(0,L.jsx)(gA,{code:d.code,message:d.message})]}),l.length===0?(0,L.jsx)(W,{"data-testid":`registry-catalog-empty`,className:`p-6 font-mono text-[13px] text-[var(--fg-muted)]`,children:c.length===0?`No launched SolverNets available.`:`No unjoined SolverNets available.`}):(0,L.jsx)(`div`,{className:`flex flex-col gap-2.5`,children:l.map(e=>(0,L.jsx)(yA,{summary:e,joinedRoles:s[e.manifestCid]?.roles},e.manifestCid))})]})}function xA(){return(0,L.jsxs)(`div`,{"data-testid":`registry-tab`,className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,L.jsx)(On,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Discover`]}),(0,L.jsx)(bA,{})]})}function SA({onRestartPending:e=()=>void 0}={}){let{data:t}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:1500}),n=t?.chain??`base-sepolia`;return(0,L.jsxs)(`div`,{"data-testid":`network-tab`,className:`flex flex-col gap-4`,children:[(0,L.jsx)(TA,{chain:n,rpcUrl:t?.rpcUrl??``,defaultRpcUrl:t?.defaultRpcUrl??(n===`base`?`https://mainnet.base.org`:`https://base-sepolia-rpc.publicnode.com`),rpcHealthy:!0,onRestartPending:e}),(0,L.jsx)(wA,{})]})}function CA(e){if(e instanceof Error){let t=e.code;if(typeof t==`string`)return t;if(e.message.includes(`rpc_rate_limited`))return`rpc_rate_limited`;if(e.message.includes(`discovery_unavailable`))return`discovery_unavailable`;if(e.message.includes(`subsystem_not_ready`))return`subsystem_not_ready`}}function wA(){let{data:e,isLoading:t,isError:n,error:r}=dt({queryKey:[`discovery`,`task-post-counts`,`chain`],queryFn:()=>z.discovery.getTaskPostCounts(),refetchInterval:3e4}),i;return i=n?CA(r)===`rpc_rate_limited`?(0,L.jsxs)(no,{variant:`warning`,"data-error-code":`rpc_rate_limited`,children:[(0,L.jsx)(Hn,{className:`h-4 w-4 text-[var(--wane)]`}),(0,L.jsx)(ro,{className:`text-[var(--wane)]`,children:`RPC rate-limited`}),(0,L.jsx)(K,{children:`Your RPC endpoint is rate-limited — add your own free key above to keep the task-post rate live.`})]}):(0,L.jsx)(`p`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:`Task-post rate is unavailable while the indexer catches up.`}):t||!e?(0,L.jsx)(`p`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:`Loading…`}):e.chain?e.chain.h24===0?(0,L.jsx)(`p`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:`No task posts in the last 24h.`}):(0,L.jsx)(`div`,{className:`grid grid-cols-3 gap-4`,children:[[`Last 1h`,e.chain.h1],[`Last 6h`,e.chain.h6],[`Last 24h`,e.chain.h24]].map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--fg-dim)]`,children:e}),(0,L.jsx)(`span`,{className:`font-mono text-[20px] text-foreground`,children:t})]},e))}):(0,L.jsx)(`p`,{className:`font-mono text-[12px] text-[var(--fg-muted)]`,children:`Task-post rate is unavailable while the indexer catches up.`}),(0,L.jsxs)(W,{"data-testid":`network-task-posts`,children:[(0,L.jsxs)(Li,{children:[(0,L.jsxs)(Ri,{className:`flex items-center gap-2`,children:[(0,L.jsx)(yn,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Task posts`]}),(0,L.jsx)(zi,{children:`On-chain task posts on this network (approximate, block-windowed).`})]}),(0,L.jsx)(Bi,{children:i})]})}function TA({chain:e,rpcUrl:t,defaultRpcUrl:n,rpcHealthy:r,onRestartPending:i}){let[a,o]=(0,I.useState)(t),[s,c]=(0,I.useState)(!1),l=a!==t,u=t===n,d=e===`base`?`Base mainnet (chain id 8453)`:`Base Sepolia (chain id 84532)`,f=d.split(` (`)[0],p=async()=>{c(!0);try{let e=a.length===0?null:a,t=await z.updateNetwork({rpcUrl:e});Oh.success(`RPC URL saved`,{description:t.restartRequired?`Restart pending — applies on next daemon start.`:`Applied to the running daemon.`}),t.restartRequired&&i()}catch(e){Oh.error(`Failed to save RPC URL`,{description:e instanceof Error?e.message:String(e)})}finally{c(!1)}};return(0,L.jsxs)(W,{children:[(0,L.jsxs)(Li,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(Ri,{className:`flex items-center gap-2`,children:[(0,L.jsx)(In,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Network`]}),(0,L.jsxs)(zi,{children:[f,` · `,t]})]}),(0,L.jsx)(q,{variant:r?`success`:`destructive`,children:r?`Healthy`:`Unreachable`})]}),(0,L.jsxs)(Bi,{children:[(0,L.jsxs)(`div`,{className:`grid gap-6 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(cp,{children:`Chain`}),(0,L.jsx)(`div`,{className:`rounded-md border border-border bg-[var(--bg-sunken)] px-3 py-2 font-mono text-[13px] text-muted-foreground`,children:d}),(0,L.jsx)(q,{variant:`outline`,className:`self-start`,children:`locked`}),(0,L.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--fg-dim)]`,children:`Switching chains resets fleet state — that's a separate flow.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(cp,{htmlFor:`rpc-url`,children:`RPC URL`}),l&&(0,L.jsx)(q,{variant:`warning`,children:`Restart`})]}),(0,L.jsx)(y_,{id:`rpc-url`,type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:n,className:l?`border-primary`:void 0}),(0,L.jsx)(U,{variant:`link`,size:`sm`,type:`button`,onClick:()=>o(``),className:`h-auto self-start p-0 text-[11px]`,children:`Use default`}),u&&(0,L.jsxs)(no,{variant:`warning`,className:`mt-3`,"data-testid":`network-shared-rpc-warning`,children:[(0,L.jsx)(Hn,{className:`h-4 w-4 text-[var(--wane)]`}),(0,L.jsx)(ro,{className:`text-[var(--wane)]`,children:`Shared RPC`}),(0,L.jsxs)(K,{children:[`You're on the default RPC — a free public gateway shared with every operator on the default config. Fine for setup; not reliable under load. Get your own free key from`,` `,(0,L.jsxs)(`a`,{href:`https://dashboard.tenderly.co/`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Tenderly `,(0,L.jsx)(An,{className:`h-2.5 w-2.5`})]}),`,`,` `,(0,L.jsxs)(`a`,{href:`https://www.alchemy.com/`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Alchemy `,(0,L.jsx)(An,{className:`h-2.5 w-2.5`})]}),`, or`,` `,(0,L.jsxs)(`a`,{href:`https://www.quicknode.com/`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`QuickNode `,(0,L.jsx)(An,{className:`h-2.5 w-2.5`})]}),` `,`and paste it above.`]})]}),(0,L.jsxs)(`p`,{className:`font-mono text-[11px] text-[var(--fg-dim)]`,children:[`Default: `,n]})]})]}),l&&(0,L.jsxs)(`div`,{className:`mt-6 flex items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,L.jsx)(U,{variant:`secondary`,size:`sm`,type:`button`,onClick:()=>o(t),children:`Cancel`}),(0,L.jsx)(U,{variant:`default`,size:`sm`,type:`button`,disabled:s,onClick:()=>{p()},children:s?`Saving…`:`Save`})]})]})]})}var EA=e=>e.type===`checkbox`,DA=e=>e instanceof Date,OA=e=>e==null,kA=e=>typeof e==`object`,AA=e=>!OA(e)&&!Array.isArray(e)&&kA(e)&&!DA(e),jA=e=>AA(e)&&e.target?EA(e.target)?e.target.checked:e.target.value:e,MA=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),NA=e=>{let t=e.constructor&&e.constructor.prototype;return AA(t)&&t.hasOwnProperty(`isPrototypeOf`)},PA=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function FA(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(PA&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(AA(e)&&NA(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=FA(e[t]));return r}var IA={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},LA={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},RA={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},zA=`form`,BA=`root`,VA=[`__proto__`,`constructor`,`prototype`],HA=e=>/^\w*$/.test(e),UA=e=>e===void 0,WA=e=>e.split(/[.[\]'"]/g).filter(Boolean),J=(e,t,n)=>{if(!t||!AA(e))return n;let r=HA(t)?[t]:WA(t);if(r.some(e=>VA.includes(e)))return n;let i=r.reduce((e,t)=>OA(e)?void 0:e[t],e);return UA(i)||i===e?UA(e[t])?n:e[t]:i},GA=e=>typeof e==`boolean`,KA=e=>typeof e==`function`,qA=(e,t,n)=>{let r=-1,i=HA(t)?[t]:WA(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=AA(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(VA.includes(t))return;e[t]=a,e=e[t]}},JA=I.createContext(null);JA.displayName=`HookFormControlContext`;var YA=()=>I.useContext(JA),XA=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==LA.all&&(t._proxyFormState[i]=!r||LA.all),n&&(n[i]=!0),e[i]}});return i},ZA=PA?I.useLayoutEffect:I.useEffect;function QA(e){let t=YA(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[o,s]=I.useState(()=>({...n._formState,defaultValues:n._defaultValues})),c=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ZA(()=>n._subscribe({name:i,formState:c.current,exact:a,callback:e=>{!r&&s({...n._formState,...e,defaultValues:n._defaultValues})}}),[i,r,a]),I.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>XA(o,n,c.current,!1),[o,n])}var $A=e=>typeof e==`string`,ej=(e,t,n,r,i)=>$A(e)?(r&&t.watch.add(e),J(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),J(n,e))):(r&&(t.watchAll=!0),n),tj=e=>OA(e)||!kA(e),nj=(e,t)=>t.length===0&&!Array.isArray(e)&&!NA(e);function rj(e,t,n=new WeakMap){if(e===t)return!0;if(tj(e)||tj(t))return Object.is(e,t);if(DA(e)&&DA(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(nj(e,r)||nj(t,i))return Object.is(e,t);let a=n.get(e);if(a&&a.has(t))return!0;a?a.add(t):n.set(e,new WeakSet([t]));for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(DA(r)&&DA(e)||(AA(r)||Array.isArray(r))&&(AA(e)||Array.isArray(e))?!rj(r,e,n):!Object.is(r,e))return!1}}return!0}function ij(e){let t=YA(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=I.useRef(i),l=I.useRef(s),u=I.useRef(void 0),d=I.useRef(n),f=I.useRef(r);l.current=s;let[p,m]=I.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=I.useCallback(e=>{let t=ej(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=I.useCallback(e=>{if(!a){let t=ej(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);rj(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]);ZA(()=>((d.current!==n||!rj(f.current,r))&&(d.current=n,f.current=r,g()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[n,o,r,g]),I.useEffect(()=>n._removeUnmounted());let _=d.current!==n,v=f.current,y=I.useMemo(()=>{if(a)return null;let e=!_&&!rj(v,r);return _||e?h():null},[a,_,r,v,h]);return y===null?p:y}function aj(e){let t=YA(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=MA(i._names.array,n),l=ij({control:i,name:n,defaultValue:I.useMemo(()=>J(i._formValues,n,J(i._defaultValues,n,o)),[i,n,o]),exact:s}),u=QA({control:i,name:n,exact:s}),d=I.useRef(e),f=I.useRef(null),p=I.useRef(i.register(n,{...e.rules,value:l,...GA(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!J(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!J(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!J(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!J(u.validatingFields,n)},error:{enumerable:!0,get:()=>J(u.errors,n)}}),[u,n]),h=I.useCallback(e=>{let t=jA(e);return J(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:jA(e),name:n},type:IA.CHANGE})},[n,i]),g=I.useCallback(()=>p.current.onBlur({target:{value:J(i._formValues,n),name:n},type:IA.BLUR}),[n,i._formValues]),_=I.useCallback(e=>{e&&(f.current={focus:()=>KA(e.focus)&&e.focus(),select:()=>KA(e.select)&&e.select(),setCustomValidity:t=>KA(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>KA(e.reportValidity)&&e.reportValidity()});let t=J(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current)},[i._fields,n]),v=I.useMemo(()=>({name:n,value:l,...GA(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return I.useEffect(()=>{let e=i._options.shouldUnregister||a;i.register(n,{...d.current.rules,...GA(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=J(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=FA(J(a?i._defaultValues:i._options.values||i._defaultValues,n,J(i._options.defaultValues,n,d.current.defaultValue)));qA(i._defaultValues,n,e),UA(J(i._formValues,n))&&qA(i._formValues,n,e)}if(!c&&i.register(n),f.current){let e=J(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),I.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),I.useMemo(()=>({field:v,formState:u,fieldState:m}),[v,u,m])}var oj=e=>e.render(aj(e)),sj=I.createContext(null);sj.displayName=`HookFormContext`;var cj=()=>I.useContext(sj),lj=({children:e,watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:o,setValues:s,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:p,control:m,register:h,setFocus:g,subscribe:_})=>{let v=I.useMemo(()=>({watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:o,setValues:s,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:p,control:m,register:h,setFocus:g,subscribe:_}),[a,m,l,r,n,f,h,d,u,i,g,o,s,_,c,p,t]);return I.createElement(sj.Provider,{value:v},I.createElement(JA.Provider,{value:v.control},e))},uj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},dj=e=>Array.isArray(e)?e.filter(Boolean):[],fj=e=>Array.isArray(e)?e:[e],pj=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function mj(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&AA(i)&&a){let e=mj(i,a);AA(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var hj=e=>AA(e)&&!Object.keys(e).length,gj=e=>e.type===`file`,_j=e=>{if(!PA)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vj=e=>e.type===`select-multiple`,yj=e=>e.type===`radio`,bj=e=>yj(e)||EA(e),xj=e=>_j(e)&&e.isConnected;function Sj(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;){if(OA(e)){e=void 0;break}e=e[t[r]],r++}return e}function Cj(e){for(let t in e)if(e.hasOwnProperty(t)&&!UA(e[t]))return!1;return!0}function wj(e,t){if($A(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:HA(t)?[t]:WA(t),r=n.length===1?e:Sj(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(AA(r)&&hj(r)||Array.isArray(r)&&Cj(r))&&wj(e,n.slice(0,-1)),e}var Tj=e=>{for(let t in e)if(KA(e[t]))return!0;return!1};function Ej(e){return Array.isArray(e)||AA(e)&&!Tj(e)}function Dj(e,t={}){for(let n in e){let r=e[n];Ej(r)?(t[n]=Array.isArray(r)?[]:{},Dj(r,t[n])):UA(r)||(t[n]=!0)}return t}function Oj(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){let t=e.map(e=>Oj(e));return t.some(e=>e!==void 0)?t:void 0}if(AA(e)){let t={};for(let n in e){let r=Oj(e[n]);UA(r)||(t[n]=r)}return Object.keys(t).length?t:void 0}}}function kj(e,t,n){n||=Dj(t);for(let r in e){let i=e[r];if(Ej(i))UA(t)||tj(n[r])?n[r]=Dj(i,Array.isArray(i)?[]:{}):kj(i,OA(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!rj(i,e)}}return Oj(n)||{}}var Aj={value:!1,isValid:!1},jj={value:!0,isValid:!0},Mj=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!UA(e[0].attributes.value)?UA(e[0].value)||e[0].value===``?jj:{value:e[0].value,isValid:!0}:jj:Aj}return Aj},Nj=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>UA(e)?e:t?e===``?NaN:e&&+e:n&&$A(e)?new Date(e):r?r(e):e,Pj={isValid:!1,value:null},Fj=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Pj):Pj;function Ij(e){let t=e.ref;return gj(t)?t.files:yj(t)?Fj(e.refs).value:vj(t)?[...t.selectedOptions].map(({value:e})=>e):EA(t)?Mj(e.refs).value:Nj(UA(t.value)?e.ref.value:t.value,e)}var Lj=(e,t,n,r)=>{let i={};for(let n of e){let e=J(t,n);e&&qA(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Rj=e=>e instanceof RegExp,zj=e=>UA(e)?e:Rj(e)?e.source:AA(e)?Rj(e.value)?e.value.source:e.value:e,Bj=e=>({isOnSubmit:!e||e===LA.onSubmit,isOnBlur:e===LA.onBlur,isOnChange:e===LA.onChange,isOnAll:e===LA.all,isOnTouch:e===LA.onTouched}),Vj=`AsyncFunction`,Hj=e=>!!e&&!!e.validate&&!!(KA(e.validate)&&e.validate.constructor.name===Vj||AA(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Vj)),Uj=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Wj=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(`${t}.`))),Gj=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=J(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(Gj(a,t))break}else if(AA(a)&&Gj(a,t))break}}};function Kj(e,t,n){let r=J(e,n);if(r||HA(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=J(t,r),o=J(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var qj=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return hj(a)||r&&Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||LA.all))},Jj=(e,t,n)=>!e||!t||e===t||fj(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))),Yj=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Xj=(e,t)=>!dj(J(e,t)).length&&wj(e,t),Zj=(e,t,n)=>{let r=J(e,n),i=Array.isArray(r)?r:[];return qA(i,BA,t[n]),qA(e,n,i),e};function Qj(e,t,n=`validate`){if($A(e)||Array.isArray(e)&&e.every($A)||GA(e)&&!e)return{type:n,message:$A(e)?e:``,ref:t}}var $j=e=>AA(e)&&!Rj(e)?e:{value:e,message:``},eM=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=J(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=GA(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=yj(o),C=EA(o),w=S||C,T=(g||gj(o))&&UA(o.value)&&UA(v)||_j(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=uj.bind(null,h,r,x),D=(e,t,n,r=RA.maxLength,i=RA.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||OA(v))||GA(v)&&!v||C&&!Mj(s).isValid||S&&!Fj(s).isValid)){let{value:e,message:t}=$A(c)?{value:!!c,message:c}:$j(c);if(e&&(x[h]={type:RA.required,message:t,ref:y,...E(RA.required,t)},!r))return b(t),x}if(!T&&(!OA(d)||!OA(f))){let e,t,n=$j(f),i=$j(d);if(!OA(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;OA(n.value)||(e=r>n.value),OA(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;$A(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),$A(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,RA.max,RA.min),!r))return b(x[h].message),x}if((l||u)&&!T&&($A(v)||a&&Array.isArray(v))){let e=$j(l),t=$j(u),n=!OA(e.value)&&v.length>+e.value,i=!OA(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&$A(v)){let{value:e,message:t}=$j(p);if(Rj(e)&&!v.match(e)&&(x[h]={type:RA.pattern,message:t,ref:o,...E(RA.pattern,t)},!r))return b(t),x}if(m){if(KA(m)){let e=Qj(await m(v,n),y);if(e&&(x[h]={...e,...E(RA.validate,e.message)},!r))return b(e.message),x}else if(AA(m)){let e={};for(let t in m){if(!hj(e)&&!r)break;let i=Qj(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!hj(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},tM={mode:LA.onSubmit,reValidateMode:LA.onChange,shouldFocusError:!0},nM={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function rM(e={}){let t={...tM,...e},n={...FA(nM),isLoading:KA(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(AA(t.defaultValues)||AA(t.values))&&FA(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:FA(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={...d},p={array:pj(),state:pj()},m=t.criteriaMode===LA.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||e)){let e;t.resolver?(e=hj((await E()).errors),_()):e=await ee({fields:r,onlyCheckValid:!0,eventType:IA.VALID}),e!==n.isValid&&p.state.next({isValid:e})}},_=(e,r)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?qA(n.validatingFields,e,r):wj(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!hj(n.validatingFields)}))},v=()=>{n.dirtyFields=kj(i,a)},y=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,u&&Array.isArray(J(r,e))){let t=s(J(r,e),c.argA,c.argB);l&&qA(r,e,t)}if(u&&Array.isArray(J(n.errors,e))){let t=s(J(n.errors,e),c.argA,c.argB);l&&qA(n.errors,e,t),Xj(n.errors,e)}if((d.touchedFields||f.touchedFields)&&u&&Array.isArray(J(n.touchedFields,e))){let t=s(J(n.touchedFields,e),c.argA,c.argB);l&&qA(n.touchedFields,e,t)}(d.dirtyFields||f.dirtyFields)&&v(),p.state.next({name:e,isDirty:k(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qA(a,e,i)},b=(e,t)=>{qA(n.errors,e,t),n.errors={...n.errors},p.state.next({errors:n.errors})},x=e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},S=e=>{let t=HA(e)?[e]:WA(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=OA(n)?n:n[i],r=OA(r)?r:r[i],n===null&&r!==null)return!0}return!1},C=(t,c,l,u)=>{let m=J(r,t);if(m){if(S(t))return;let r=UA(J(a,t)),h=J(a,t,UA(l)?J(i,t):l);UA(h)||u&&u.defaultChecked||c?qA(a,t,c?h:Ij(m._f)):M(t,h),o.mount&&!o.action&&(g(),r&&n.isDirty&&(d.isDirty||f.isDirty)&&(k()||(n.isDirty=!1,p.state.next({...n}))),e.shouldUnregister&&r&&!UA(J(a,t))&&Wj(t,s)&&(o.watch=!0))}},w=(e,r,o,s,c)=>{let l=!1,u=!1,m={name:e};if(!t.disabled){if(!o||s){(d.isDirty||f.isDirty)&&(u=n.isDirty,n.isDirty=m.isDirty=k(),l=u!==m.isDirty);let t=rj(J(i,e),r);u=!!J(n.dirtyFields,e),t===n.isDirty?t?wj(n.dirtyFields,e):qA(n.dirtyFields,e,!0):n.dirtyFields=kj(i,a),m.dirtyFields=n.dirtyFields,l||=(d.dirtyFields||f.dirtyFields)&&u!==!t}if(o){let t=J(n.touchedFields,e);t||(qA(n.touchedFields,e,o),m.touchedFields=n.touchedFields,l||=(d.touchedFields||f.touchedFields)&&t!==o)}l&&c&&p.state.next(m)}return l?m:{}},T=(e,r,i,a)=>{let o=J(n.errors,e),s=(d.isValid||f.isValid)&&GA(r)&&n.isValid!==r;if(t.delayError&&i?(c=h(()=>b(e,i)),c(t.delayError)):(clearTimeout(l),c=null,i?qA(n.errors,e,i):wj(n.errors,e),n.errors={...n.errors}),(i?!rj(o,i):o)||!hj(a)||s){let t={...a,...s&&GA(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},E=async e=>(_(e,!0),await t.resolver(a,t.context,Lj(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),D=async e=>{let{errors:t}=await E(e);if(_(e),e){for(let r of e){let e=J(t,r);e?s.array.has(r)&&AA(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?Zj(n.errors,{[r]:e},r):qA(n.errors,r,e):wj(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},O=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(AA(i))for(let e in i){let t=i[e];t&&le(`${zA}.${e}`,{message:$A(t.message)?t.message:``,type:t.type||RA.validate})}else $A(i)||!i?le(zA,{message:i||``,type:RA.validate}):ce(zA);return i}return!0},ee=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await O({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...p}=u;if(r){let o=s.array.has(r.name),c=u._f&&Hj(u._f),p=d.validatingFields||d.isValidating||f.validatingFields||f.isValidating;c&&p&&_([r.name],!0);let h=await eM(u,s.disabled,a,m,t.shouldUseNativeValidation&&!i,o);if(c&&p&&_([r.name]),h[r.name]&&(l.valid=!1,i)||(!i&&(J(h,r.name)?o?Zj(n.errors,h,r.name):qA(n.errors,r.name,h[r.name]):wj(n.errors,r.name)),e.shouldUseNativeValidation&&h[r.name]))break}!hj(p)&&await ee({context:l,onlyCheckValid:i,fields:p,name:o,eventType:c})}}return l.valid},te=()=>{for(let e of s.unMount){let t=J(r,e);t&&(t._f.refs?t._f.refs.every(e=>!xj(e)):!xj(t._f.ref))&&pe(e)}s.unMount=new Set},k=(e,n)=>!t.disabled&&(e&&n&&qA(a,e,n),!rj(F(),i)),A=(e,t,n)=>ej(e,s,{...o.mount?a:UA(t)?i:$A(e)?{[e]:t}:t},n,t),j=e=>dj(J(o.mount?a:i,e,t.shouldUnregister?J(i,e,[]):[])),M=(e,t,n={},i=!1)=>{let o=J(r,e),s=t;if(o){let n=o._f;n&&(!n.disabled&&qA(a,e,Nj(t,n)),s=_j(n.ref)&&OA(t)?``:t,vj(n.ref)?[...n.ref.options].forEach(e=>e.selected=s.includes(e.value)):n.refs?EA(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):n.refs.forEach(e=>e.checked=e.value===s):gj(n.ref)?n.ref.value=``:(n.ref.value=s,n.ref.type||p.state.next({name:e,values:i?a:FA(a)})))}(n.shouldDirty||n.shouldTouch)&&w(e,s,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&oe(e)},ne=(e,t,n,i=!1)=>{for(let a in t){if(!t.hasOwnProperty(a))return;let o=t[a],c=e+`.`+a,l=J(r,c);(s.array.has(e)||AA(o)||l&&!l._f)&&!DA(o)?ne(c,o,n,i):M(c,o,n,i)}},N=(e,t,i,c)=>{let l=J(r,e),u=s.array.has(e),m=c?t:FA(t),h=rj(J(a,e),m);if(h||qA(a,e,m),u)p.array.next({name:e,values:c?a:FA(a)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&i.shouldDirty&&(v(),p.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:k(e,m)}));else{let t=Array.isArray(m)&&!m.length||hj(m);!l||l._f||OA(m)||t?M(e,m,i,c):ne(e,m,i,c)}if(!h){let t=Wj(e,s),r=c?a:FA(a);p.state.next({...t&&n,name:o.mount||t?e:void 0,values:r})}},P=(e,t,n={})=>N(e,t,n,!1),re=(e,t={})=>{let r=KA(e)?e(a):e;if(!rj(a,r)){a={...a,...r};for(let e of s.mount)N(e,J(r,e),t,!0);p.state.next({...n,name:void 0,type:void 0,values:a}),t.shouldValidate&&g()}},ie=async i=>{o.mount=!0;let l=i.target,u=l.name,h=!0,v=J(r,u),y=e=>{h=Number.isNaN(e)||DA(e)&&isNaN(e.getTime())||rj(e,J(a,u,e))},b=Bj(t.mode),x=Bj(t.reValidateMode);if(v){let o,S,C=l.type?Ij(v._f):jA(i),D=i.type===IA.BLUR||i.type===IA.FOCUS_OUT,te=!Uj(v._f)&&!e.validate&&!t.resolver&&!J(n.errors,u)&&!v._f.deps||Yj(D,J(n.touchedFields,u),n.isSubmitted,x,b),k=Wj(u,s,D);qA(a,u,C),D?(!l||!l.readOnly)&&(v._f.onBlur&&v._f.onBlur(i),c&&c(0)):v._f.onChange&&v._f.onChange(i);let A=w(u,C,D),j=!hj(A)||k;if(!D&&p.state.next({name:u,type:i.type,values:FA(a)}),te)return(d.isValid||f.isValid)&&(t.mode===`onBlur`?D&&g():D||g()),j&&p.state.next({name:u,...k?{}:A});if(!t.resolver&&e.validate&&await O({name:u,eventType:i.type}),!D&&k&&p.state.next({...n}),t.resolver){let{errors:e}=await E([u]);if(_([u]),y(C),!h){!hj(A)&&p.state.next(A);return}let t=Kj(n.errors,r,u),i=Kj(e,r,t.name||u);o=i.error,u=i.name,S=hj(e)}else _([u],!0),o=(await eM(v,s.disabled,a,m,t.shouldUseNativeValidation))[u],_([u]),y(C),h&&(o?S=!1:(d.isValid||f.isValid)&&(S=await ee({fields:r,onlyCheckValid:!0,name:u,eventType:i.type})));h&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&oe(v._f.deps),T(u,S,o,A))}},ae=(e,t)=>{if(J(n.errors,t)&&e.focus)return e.focus(),1},oe=async(e,i={})=>{let a,o,c=fj(e);if(t.resolver){let t=await D(UA(e)?e:c);a=hj(t),o=e?!c.some(e=>J(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=J(r,e);return await ee({fields:t&&t._f?{[e]:t}:t,eventType:IA.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await ee({fields:r,name:e,eventType:IA.TRIGGER});return p.state.next({...!$A(e)||(d.isValid||f.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&Gj(r,ae,e?c:s.mount),o},F=(e,t)=>{let r={...o.mount?a:i};return t&&(r=mj(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),UA(e)?r:$A(e)?J(r,e):e.map(e=>J(r,e))},se=(e,t)=>({invalid:!!J((t||n).errors,e),isDirty:!!J((t||n).dirtyFields,e),error:J((t||n).errors,e),isValidating:!!J(n.validatingFields,e),isTouched:!!J((t||n).touchedFields,e)}),ce=e=>{let t=e?fj(e):void 0;t?.forEach(e=>wj(n.errors,e)),t?t.forEach(e=>{p.state.next({name:e,errors:n.errors})}):p.state.next({errors:{}})},le=(e,t,i)=>{let a=(J(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=J(n.errors,e)||{};qA(n.errors,e,{...l,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ue=(e,t)=>KA(e)?p.state.subscribe({next:n=>`values`in n&&e(n.values||A(void 0,t),n)}):A(e,t,!0),de=e=>p.state.subscribe({next:t=>{if(Jj(e.name,t.name,e.exact)&&qj(t,e.formState||d,Ce,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}}).unsubscribe,fe=e=>(o.mount=!0,f={...f,...e.formState},de({...e,formState:{...u,...e.formState}})),pe=(e,o={})=>{for(let c of e?fj(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(wj(r,c),wj(a,c)),!o.keepError&&wj(n.errors,c),!o.keepDirty&&wj(n.dirtyFields,c),!o.keepTouched&&wj(n.touchedFields,c),!o.keepIsValidating&&wj(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&wj(i,c);p.state.next({values:FA(a)}),p.state.next({...n,...o.keepDirty?{isDirty:k()}:{}}),!o.keepIsValid&&g()},me=({disabled:e,name:t})=>{if(GA(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&g()}},he=(e,n={})=>{let a=J(r,e),c=GA(n.disabled)||GA(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return qA(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?me({disabled:GA(n.disabled)?n.disabled:t.disabled,name:e}):C(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:zj(n.min),max:zj(n.max),minLength:zj(n.minLength),maxLength:zj(n.maxLength),pattern:zj(n.pattern)}:{},name:e,onChange:ie,onBlur:ie,ref:c=>{if(c){s.registerName.add(e),he(e,n),s.registerName.delete(e),a=J(r,e);let t=UA(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=bj(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;qA(r,e,{_f:{...a._f,...o?{refs:[...l.filter(xj),t,...Array.isArray(J(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),C(e,!1,void 0,t)}else a=J(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(MA(s.array,e)&&o.action)&&s.unMount.add(e)}}},ge=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Gj(r,ae,s.mount),_e=e=>{GA(e)&&(p.state.next({disabled:e}),Gj(r,(t,n)=>{let i=J(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},ve=(e,i)=>async o=>{let c;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=FA(a);if(p.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await E();_(),n.errors=e,l=FA(t)}else await ee({fields:r,eventType:IA.SUBMIT});if(s.disabled.size)for(let e of s.disabled)wj(l,e);if(wj(n.errors,BA),hj(n.errors)){p.state.next({errors:{}});try{await e(l,o)}catch(e){c=e}}else i&&await i({...n.errors},o),ge(),setTimeout(ge);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hj(n.errors)&&!c,submitCount:n.submitCount+1,errors:n.errors}),c)throw c},ye=(e,t={})=>{J(r,e)&&(UA(t.defaultValue)?P(e,FA(J(i,e))):(P(e,t.defaultValue),qA(i,e,FA(t.defaultValue))),t.keepTouched||wj(n.touchedFields,e),t.keepDirty||(wj(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,FA(J(i,e))):k()),t.keepError||(wj(n.errors,e),d.isValid&&g()),p.state.next({...n}))},be=(e,c={})=>{let l=e?FA(e):i,u=FA(l),f=hj(e),m=u;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...Object.keys(kj(i,a))]);for(let t of Array.from(e)){let e=J(n.dirtyFields,t),r=J(a,t),i=J(m,t);e&&!UA(r)?qA(m,t,r):!e&&!UA(i)&&P(t,i)}}else{if(PA&&UA(e))for(let e of s.mount){let t=J(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(_j(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)P(e,J(m,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?FA(i):{},c.keepFieldsRef)for(let e of s.mount)qA(a,e,J(m,e))}else a=FA(m);p.array.next({values:{...m}}),p.state.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!hj(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,c.keepErrors||(n.errors={}),p.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:f?!1:c.keepDirty?n.isDirty:c.keepValues?k():!!(c.keepDefaultValues&&!rj(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:c.keepDirtyValues?c.keepDefaultValues&&a?kj(i,a):n.dirtyFields:c.keepDefaultValues&&e?kj(i,e):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},xe=(e,n)=>be(KA(e)?e(a):e,{...t.resetOptions,...n}),Se=(e,t={})=>{let n=J(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&KA(e.select)&&e.select()})}},Ce=e=>{n={...n,...e}},we={control:{register:he,unregister:pe,getFieldState:se,handleSubmit:ve,setError:le,_subscribe:de,_runSchema:E,_updateIsValidating:_,_focusError:ge,_getWatch:A,_getDirty:k,_setValid:g,_setFieldArray:y,_setDisabledField:me,_setErrors:x,_getFieldArray:j,_reset:be,_resetDefaultValues:()=>KA(t.defaultValues)&&t.defaultValues().then(e=>{xe(e,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:te,_disableForm:_e,_subjects:p,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e}}},subscribe:fe,trigger:oe,register:he,handleSubmit:ve,watch:ue,setValue:P,setValues:re,getValues:F,reset:xe,resetField:ye,resetDefaultValues:(e,t={})=>{if(i=FA(e),!t.keepDirty){let e=kj(i,a);n.dirtyFields=e,n.isDirty=!hj(e)}t.keepIsValid||g(),p.state.next({...n,defaultValues:i})},clearErrors:ce,unregister:pe,setError:le,setFocus:Se,getFieldState:se};return{...we,formControl:we}}function iM(e={}){let t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),[i,a]=I.useState(()=>({...FA(nM),isLoading:KA(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:KA(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!KA(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=rM(e);t.current={...r,formState:i}}let o=t.current.control;return o._options=e,ZA(()=>{let e=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,e},[o]),I.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),I.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),I.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),I.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),I.useEffect(()=>{e.values&&!rj(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),I.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=I.useMemo(()=>XA(i,o),[o,i]),t.current}var aM=(e,t,n)=>{if(e&&`reportValidity`in e){let r=J(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},oM=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?aM(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>aM(t,n,e))}},sM=(e,t)=>{t.shouldUseNativeValidation&&oM(e,t);let n={};for(let r in e){let i=J(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(cM(t.names||Object.keys(e),r)){let e=Object.assign({},J(n,r));qA(e,`root`,a),qA(n,r,e)}else qA(n,r,a)}return n},cM=(e,t)=>{let n=lM(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>lM(e).match(`^${n}\\.\\d+`))};function lM(e){return e.replace(/[\[\]]/g,``)}var uM;function dM(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var fM=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(uM=globalThis).__zod_globalConfig??(uM.__zod_globalConfig={});var pM=globalThis.__zod_globalConfig;function mM(e){return e&&Object.assign(pM,e),pM}function hM(e,t){return typeof t==`bigint`?t.toString():t}var gM=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};-Number.MAX_VALUE,Number.MAX_VALUE;function _M(e){return typeof e==`string`?e:e?.message}function vM(e,t,n){let r=e.message?e.message:_M(e.inst?._zod.def?.error?.(e))??_M(t?.error?.(e))??_M(n.customError?.(e))??_M(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}var yM=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,hM,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bM=dM(`$ZodError`,yM),xM=dM(`$ZodError`,yM,{Parent:Error}),SM=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new fM;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>vM(e,a,mM())));throw gM(t,i?.callee),t}return o.value})(xM),CM=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>vM(e,a,mM())));throw gM(t,i?.callee),t}return o.value})(xM);function wM(){return wM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wM.apply(null,arguments)}function TM(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function EM(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=uj(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function DM(e,t){for(var n={},r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors[0][0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(wM({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=uj(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function OM(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(TM(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&oM({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:sM(EM(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(TM(function(){return Promise.resolve((n.mode===`sync`?SM:CM)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&oM({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof bM}(e))return{values:{},errors:sM(DM(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var kM;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(kM||={});var AM;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(AM||={});var Y=kM.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),jM=e=>{switch(typeof e){case`undefined`:return Y.undefined;case`string`:return Y.string;case`number`:return Number.isNaN(e)?Y.nan:Y.number;case`boolean`:return Y.boolean;case`function`:return Y.function;case`bigint`:return Y.bigint;case`symbol`:return Y.symbol;case`object`:return Array.isArray(e)?Y.array:e===null?Y.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?Y.promise:typeof Map<`u`&&e instanceof Map?Y.map:typeof Set<`u`&&e instanceof Set?Y.set:typeof Date<`u`&&e instanceof Date?Y.date:Y.object;default:return Y.unknown}},X=kM.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),MM=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,kM.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};MM.create=e=>new MM(e);var NM=(e,t)=>{let n;switch(e.code){case X.invalid_type:n=e.received===Y.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,kM.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${kM.joinValues(e.keys,`, `)}`;break;case X.invalid_union:n=`Invalid input`;break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${kM.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${kM.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:n=`Invalid function arguments`;break;case X.invalid_return_type:n=`Invalid function return type`;break;case X.invalid_date:n=`Invalid date`;break;case X.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:kM.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case X.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case X.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case X.custom:n=`Invalid input`;break;case X.invalid_intersection_types:n=`Intersection results could not be merged`;break;case X.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,kM.assertNever(e)}return{message:n}},PM=NM;function FM(){return PM}var IM=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Z(e,t){let n=FM(),r=IM({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===NM?void 0:NM].filter(e=>!!e)});e.common.issues.push(r)}var LM=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Q;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Q;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Q=Object.freeze({status:`aborted`}),RM=e=>({status:`dirty`,value:e}),zM=e=>({status:`valid`,value:e}),BM=e=>e.status===`aborted`,VM=e=>e.status===`dirty`,HM=e=>e.status===`valid`,UM=e=>typeof Promise<`u`&&e instanceof Promise,$;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})($||={});var WM=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},GM=(e,t)=>{if(HM(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new MM(e.common.issues);return this._error=t,this._error}}};function KM(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var qM=class{get description(){return this._def.description}_getType(e){return jM(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:jM(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new LM,ctx:{common:e.parent.common,data:e.data,parsedType:jM(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(UM(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jM(e)};return GM(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jM(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return HM(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>HM(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jM(e)},r=this._parse({data:e,path:n.path,parent:n});return GM(n,await(UM(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:X.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new XN({schema:this,typeName:aP.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return ZN.create(this,this._def)}nullable(){return QN.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jN.create(this)}promise(){return YN.create(this,this._def)}or(e){return PN.create([this,e],this._def)}and(e){return RN.create(this,e,this._def)}transform(e){return new XN({...KM(this._def),schema:this,typeName:aP.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new $N({...KM(this._def),innerType:this,defaultValue:t,typeName:aP.ZodDefault})}brand(){return new nP({typeName:aP.ZodBranded,type:this,...KM(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new eP({...KM(this._def),innerType:this,catchValue:t,typeName:aP.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return rP.create(this,e)}readonly(){return iP.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},JM=/^c[^\s-]{8,}$/i,YM=/^[0-9a-z]+$/,XM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ZM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,QM=/^[a-z0-9_-]{21}$/i,$M=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nN=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,rN,iN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,oN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,uN=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,dN=RegExp(`^${uN}$`);function fN(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function pN(e){return RegExp(`^${fN(e)}$`)}function mN(e){let t=`${uN}T${fN(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function hN(e,t){return!!((t===`v4`||!t)&&iN.test(e)||(t===`v6`||!t)&&oN.test(e))}function gN(e,t){if(!$M.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function _N(e,t){return!!((t===`v4`||!t)&&aN.test(e)||(t===`v6`||!t)&&sN.test(e))}var vN=class e extends qM{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.string,received:t.parsedType}),Q}let t=new LM,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Z(n,{code:X.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Z(n,{code:X.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)tN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`email`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)rN||=new RegExp(nN,`u`),rN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`emoji`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)ZM.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`uuid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)QM.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`nanoid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)JM.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cuid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)YM.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cuid2`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)XM.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`ulid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Z(n,{validation:`url`,code:X.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`regex`,code:X.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?mN(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?dN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?pN(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?eN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`duration`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?hN(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`ip`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?gN(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`jwt`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?_N(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cidr`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?cN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?lN.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64url`,code:X.invalid_string,message:r.message}),t.dirty()):kM.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:X.invalid_string,...$.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...$.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...$.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...$.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...$.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...$.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...$.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...$.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...$.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...$.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...$.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...$.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...$.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...$.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};vN.create=e=>new vN({checks:[],typeName:aP.ZodString,coerce:e?.coerce??!1,...KM(e)});function yN(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var bN=class e extends qM{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.number,received:t.parsedType}),Q}let t,n=new LM;for(let r of this._def.checks)r.kind===`int`?kM.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Z(t,{code:X.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?yN(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_finite,message:r.message}),n.dirty()):kM.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:$.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:$.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:$.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:$.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&kM.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};bN.create=e=>new bN({checks:[],typeName:aP.ZodNumber,coerce:e?.coerce||!1,...KM(e)});var xN=class e extends qM{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let t,n=new LM;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):kM.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.bigint,received:t.parsedType}),Q}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};xN.create=e=>new xN({checks:[],typeName:aP.ZodBigInt,coerce:e?.coerce??!1,...KM(e)});var SN=class extends qM{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.boolean,received:t.parsedType}),Q}return zM(e.data)}};SN.create=e=>new SN({typeName:aP.ZodBoolean,coerce:e?.coerce||!1,...KM(e)});var CN=class e extends qM{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.date,received:t.parsedType}),Q}if(Number.isNaN(e.data.getTime()))return Z(this._getOrReturnCtx(e),{code:X.invalid_date}),Q;let t=new LM,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):kM.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};CN.create=e=>new CN({checks:[],coerce:e?.coerce||!1,typeName:aP.ZodDate,...KM(e)});var wN=class extends qM{_parse(e){if(this._getType(e)!==Y.symbol){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.symbol,received:t.parsedType}),Q}return zM(e.data)}};wN.create=e=>new wN({typeName:aP.ZodSymbol,...KM(e)});var TN=class extends qM{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.undefined,received:t.parsedType}),Q}return zM(e.data)}};TN.create=e=>new TN({typeName:aP.ZodUndefined,...KM(e)});var EN=class extends qM{_parse(e){if(this._getType(e)!==Y.null){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.null,received:t.parsedType}),Q}return zM(e.data)}};EN.create=e=>new EN({typeName:aP.ZodNull,...KM(e)});var DN=class extends qM{constructor(){super(...arguments),this._any=!0}_parse(e){return zM(e.data)}};DN.create=e=>new DN({typeName:aP.ZodAny,...KM(e)});var ON=class extends qM{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zM(e.data)}};ON.create=e=>new ON({typeName:aP.ZodUnknown,...KM(e)});var kN=class extends qM{_parse(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.never,received:t.parsedType}),Q}};kN.create=e=>new kN({typeName:aP.ZodNever,...KM(e)});var AN=class extends qM{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.void,received:t.parsedType}),Q}return zM(e.data)}};AN.create=e=>new AN({typeName:aP.ZodVoid,...KM(e)});var jN=class e extends qM{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Y.array)return Z(t,{code:X.invalid_type,expected:Y.array,received:t.parsedType}),Q;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Z(t,{code:e?X.too_big:X.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Z(t,{code:X.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Z(t,{code:X.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new WM(t,e,t.path,n)))).then(e=>LM.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new WM(t,e,t.path,n)));return LM.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(e){return this.min(1,e)}};jN.create=(e,t)=>new jN({type:e,minLength:null,maxLength:null,exactLength:null,typeName:aP.ZodArray,...KM(t)});function MN(e){if(e instanceof NN){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ZN.create(MN(r))}return new NN({...e._def,shape:()=>t})}else if(e instanceof jN)return new jN({...e._def,type:MN(e.element)});else if(e instanceof ZN)return ZN.create(MN(e.unwrap()));else if(e instanceof QN)return QN.create(MN(e.unwrap()));else if(e instanceof zN)return zN.create(e.items.map(e=>MN(e)));else return e}var NN=class e extends qM{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=kM.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Y.object){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.object,received:t.parsedType}),Q}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof kN&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new WM(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof kN){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Z(n,{code:X.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new WM(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>LM.mergeObjectSync(t,e)):LM.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:$.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:aP.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of kM.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of kM.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return MN(this)}partial(t){let n={};for(let e of kM.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of kM.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof ZN;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return KN(kM.objectKeys(this.shape))}};NN.create=(e,t)=>new NN({shape:()=>e,unknownKeys:`strip`,catchall:kN.create(),typeName:aP.ZodObject,...KM(t)}),NN.strictCreate=(e,t)=>new NN({shape:()=>e,unknownKeys:`strict`,catchall:kN.create(),typeName:aP.ZodObject,...KM(t)}),NN.lazycreate=(e,t)=>new NN({shape:e,unknownKeys:`strip`,catchall:kN.create(),typeName:aP.ZodObject,...KM(t)});var PN=class extends qM{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new MM(e.ctx.common.issues));return Z(t,{code:X.invalid_union,unionErrors:n}),Q}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new MM(e));return Z(t,{code:X.invalid_union,unionErrors:i}),Q}}get options(){return this._def.options}};PN.create=(e,t)=>new PN({options:e,typeName:aP.ZodUnion,...KM(t)});var FN=e=>e instanceof WN?FN(e.schema):e instanceof XN?FN(e.innerType()):e instanceof GN?[e.value]:e instanceof qN?e.options:e instanceof JN?kM.objectValues(e.enum):e instanceof $N?FN(e._def.innerType):e instanceof TN?[void 0]:e instanceof EN?[null]:e instanceof ZN?[void 0,...FN(e.unwrap())]:e instanceof QN?[null,...FN(e.unwrap())]:e instanceof nP||e instanceof iP?FN(e.unwrap()):e instanceof eP?FN(e._def.innerType):[],IN=class e extends qM{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Y.object)return Z(t,{code:X.invalid_type,expected:Y.object,received:t.parsedType}),Q;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Z(t,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=FN(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:aP.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...KM(r)})}};function LN(e,t){let n=jM(e),r=jM(t);if(e===t)return{valid:!0,data:e};if(n===Y.object&&r===Y.object){let n=kM.objectKeys(t),r=kM.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=LN(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=LN(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===Y.date&&r===Y.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var RN=class extends qM{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(BM(e)||BM(r))return Q;let i=LN(e.value,r.value);return i.valid?((VM(e)||VM(r))&&t.dirty(),{status:t.value,value:i.data}):(Z(n,{code:X.invalid_intersection_types}),Q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};RN.create=(e,t,n)=>new RN({left:e,right:t,typeName:aP.ZodIntersection,...KM(n)});var zN=class e extends qM{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.array)return Z(n,{code:X.invalid_type,expected:Y.array,received:n.parsedType}),Q;if(n.data.length<this._def.items.length)return Z(n,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Q;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new WM(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>LM.mergeArray(t,e)):LM.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};zN.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new zN({items:e,typeName:aP.ZodTuple,rest:null,...KM(t)})};var BN=class e extends qM{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return Z(n,{code:X.invalid_type,expected:Y.object,received:n.parsedType}),Q;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new WM(n,e,n.path,e)),value:a._parse(new WM(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?LM.mergeObjectAsync(t,r):LM.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof qM?new e({keyType:t,valueType:n,typeName:aP.ZodRecord,...KM(r)}):new e({keyType:vN.create(),valueType:t,typeName:aP.ZodRecord,...KM(n)})}},VN=class extends qM{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.map)return Z(n,{code:X.invalid_type,expected:Y.map,received:n.parsedType}),Q;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new WM(n,e,n.path,[a,`key`])),value:i._parse(new WM(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};VN.create=(e,t,n)=>new VN({valueType:t,keyType:e,typeName:aP.ZodMap,...KM(n)});var HN=class e extends qM{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.set)return Z(n,{code:X.invalid_type,expected:Y.set,received:n.parsedType}),Q;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Z(n,{code:X.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Z(n,{code:X.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Q;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new WM(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};HN.create=(e,t)=>new HN({valueType:e,minSize:null,maxSize:null,typeName:aP.ZodSet,...KM(t)});var UN=class e extends qM{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Y.function)return Z(t,{code:X.invalid_type,expected:Y.function,received:t.parsedType}),Q;function n(e,n){return IM({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,FM(),NM].filter(e=>!!e),issueData:{code:X.invalid_arguments,argumentsError:n}})}function r(e,n){return IM({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,FM(),NM].filter(e=>!!e),issueData:{code:X.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof YN){let e=this;return zM(async function(...t){let o=new MM([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return zM(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new MM([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new MM([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:zN.create(t).rest(ON.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||zN.create([]).rest(ON.create()),returns:n||ON.create(),typeName:aP.ZodFunction,...KM(r)})}},WN=class extends qM{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};WN.create=(e,t)=>new WN({getter:e,typeName:aP.ZodLazy,...KM(t)});var GN=class extends qM{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Z(t,{received:t.data,code:X.invalid_literal,expected:this._def.value}),Q}return{status:`valid`,value:e.data}}get value(){return this._def.value}};GN.create=(e,t)=>new GN({value:e,typeName:aP.ZodLiteral,...KM(t)});function KN(e,t){return new qN({values:e,typeName:aP.ZodEnum,...KM(t)})}var qN=class e extends qM{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{expected:kM.joinValues(n),received:t.parsedType,code:X.invalid_type}),Q}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{received:t.data,code:X.invalid_enum_value,options:n}),Q}return zM(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};qN.create=KN;var JN=class extends qM{_parse(e){let t=kM.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Y.string&&n.parsedType!==Y.number){let e=kM.objectValues(t);return Z(n,{expected:kM.joinValues(e),received:n.parsedType,code:X.invalid_type}),Q}if(this._cache||=new Set(kM.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=kM.objectValues(t);return Z(n,{received:n.data,code:X.invalid_enum_value,options:e}),Q}return zM(e.data)}get enum(){return this._def.values}};JN.create=(e,t)=>new JN({values:e,typeName:aP.ZodNativeEnum,...KM(t)});var YN=class extends qM{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==Y.promise&&t.common.async===!1?(Z(t,{code:X.invalid_type,expected:Y.promise,received:t.parsedType}),Q):zM((t.parsedType===Y.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};YN.create=(e,t)=>new YN({type:e,typeName:aP.ZodPromise,...KM(t)});var XN=class extends qM{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===aP.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Z(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Q;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Q:r.status===`dirty`||t.value===`dirty`?RM(r.value):r});{if(t.value===`aborted`)return Q;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Q:r.status===`dirty`||t.value===`dirty`?RM(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Q:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Q:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!HM(e))return Q;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>HM(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Q);kM.assertNever(r)}};XN.create=(e,t,n)=>new XN({schema:e,typeName:aP.ZodEffects,effect:t,...KM(n)}),XN.createWithPreprocess=(e,t,n)=>new XN({schema:t,effect:{type:`preprocess`,transform:e},typeName:aP.ZodEffects,...KM(n)});var ZN=class extends qM{_parse(e){return this._getType(e)===Y.undefined?zM(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ZN.create=(e,t)=>new ZN({innerType:e,typeName:aP.ZodOptional,...KM(t)});var QN=class extends qM{_parse(e){return this._getType(e)===Y.null?zM(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};QN.create=(e,t)=>new QN({innerType:e,typeName:aP.ZodNullable,...KM(t)});var $N=class extends qM{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};$N.create=(e,t)=>new $N({innerType:e,typeName:aP.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...KM(t)});var eP=class extends qM{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return UM(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new MM(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new MM(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};eP.create=(e,t)=>new eP({innerType:e,typeName:aP.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...KM(t)});var tP=class extends qM{_parse(e){if(this._getType(e)!==Y.nan){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.nan,received:t.parsedType}),Q}return{status:`valid`,value:e.data}}};tP.create=e=>new tP({typeName:aP.ZodNaN,...KM(e)});var nP=class extends qM{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},rP=class e extends qM{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Q:e.status===`dirty`?(t.dirty(),RM(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Q:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:aP.ZodPipeline})}},iP=class extends qM{_parse(e){let t=this._def.innerType._parse(e),n=e=>(HM(e)&&(e.value=Object.freeze(e.value)),e);return UM(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};iP.create=(e,t)=>new iP({innerType:e,typeName:aP.ZodReadonly,...KM(t)}),NN.lazycreate;var aP;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(aP||={});var oP=vN.create;bN.create,tP.create,xN.create,SN.create,CN.create,wN.create,TN.create,EN.create,DN.create,ON.create,kN.create,AN.create,jN.create;var sP=NN.create;NN.strictCreate,PN.create,IN.create,RN.create,zN.create,BN.create,VN.create,HN.create,UN.create,WN.create,GN.create,qN.create,JN.create,YN.create,XN.create,ZN.create,QN.create,XN.createWithPreprocess,rP.create;var cP=lj,lP=I.createContext({}),uP=e=>(0,L.jsx)(lP.Provider,{value:{name:e.name},children:(0,L.jsx)(oj,{...e})}),dP=I.createContext({}),fP=()=>{let e=I.useContext(lP),t=I.useContext(dP),{getFieldState:n,formState:r}=cj(),i=n(e.name,r);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},pP=I.forwardRef(({className:e,...t},n)=>{let r=I.useId();return(0,L.jsx)(dP.Provider,{value:{id:r},children:(0,L.jsx)(`div`,{ref:n,className:H(`flex flex-col gap-1.5`,e),...t})})});pP.displayName=`FormItem`;var mP=I.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=fP();return(0,L.jsx)(cp,{ref:n,className:H(r&&`text-[var(--break-red)]`,e),htmlFor:i,...t})});mP.displayName=`FormLabel`;var hP=I.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=fP();return(0,L.jsx)($n,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:i,"aria-invalid":!!n,...e})});hP.displayName=`FormControl`;var gP=I.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=fP();return(0,L.jsx)(`p`,{ref:n,id:r,className:H(`font-mono text-[11px] text-[var(--fg-dim)]`,e),...t})});gP.displayName=`FormDescription`;var _P=I.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=fP(),o=i?String(i?.message??``):t;return o?(0,L.jsx)(`p`,{ref:r,id:a,className:H(`font-mono text-[11px] text-[var(--break-red)]`,e),...n,children:o}):null});_P.displayName=`FormMessage`;var vP=sP({current:oP().min(1,`Current password is required.`),next:oP().min(8,`New password must be at least 8 characters.`)});function yP(){let[e,t]=(0,I.useState)(`idle`),n=iM({resolver:OM(vP),defaultValues:{current:``,next:``}}),r=async e=>{t(`rotating`);try{await z.changeKeystorePassword(e.current,e.next),n.reset({current:``,next:``}),Oh.success(`Password rotated`,{description:"Re-run `jinn run` with the new password."})}catch(e){Oh.error(`Rotation failed`,{description:e instanceof Error?e.message:String(e)})}finally{t(`idle`)}};return(0,L.jsx)(`div`,{"data-testid":`security-tab`,children:(0,L.jsxs)(W,{className:`border-[var(--severity-blocking-border)]`,children:[(0,L.jsxs)(Li,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(Ri,{className:`flex items-center gap-2 text-[var(--break-red)]`,children:[(0,L.jsx)(Vn,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Security`]}),(0,L.jsx)(zi,{children:`Rotate keystore password · last rotated never`})]}),(0,L.jsx)(q,{variant:`destructive`,children:`Danger zone`})]}),(0,L.jsx)(Bi,{children:(0,L.jsx)(cP,{...n,children:(0,L.jsxs)(`form`,{onSubmit:n.handleSubmit(r),className:`flex flex-col gap-4`,"data-testid":`security-password-form`,children:[(0,L.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,L.jsx)(uP,{control:n.control,name:`current`,render:({field:e})=>(0,L.jsxs)(pP,{children:[(0,L.jsx)(mP,{children:`Current password`}),(0,L.jsx)(hP,{children:(0,L.jsx)(y_,{type:`password`,autoComplete:`current-password`,...e})}),(0,L.jsx)(_P,{})]})}),(0,L.jsx)(uP,{control:n.control,name:`next`,render:({field:e})=>(0,L.jsxs)(pP,{children:[(0,L.jsx)(mP,{children:`New password`}),(0,L.jsx)(hP,{children:(0,L.jsx)(y_,{type:`password`,autoComplete:`new-password`,...e})}),(0,L.jsx)(gP,{children:`At least 8 characters.`}),(0,L.jsx)(_P,{})]})})]}),(0,L.jsxs)(U,{type:`submit`,variant:`destructive`,disabled:e===`rotating`||!n.formState.isValid,className:`self-start`,children:[(0,L.jsx)(Mn,{className:`h-3 w-3`,"aria-hidden":`true`}),e===`rotating`?`Rotating…`:`Rotate password`]})]})})})]})})}function bP(e){let t=[],n=e.split(`
108
+ `),r=0;for(;r<n.length;){let e=n[r]??``;if(/^```/.test(e)){let i=e.slice(3).trim(),a=[];for(r++;r<n.length&&!/^```/.test(n[r]??``);)a.push(n[r]??``),r++;r++,t.push({kind:`code`,lang:i,text:a.join(`
109
+ `)});continue}let i=/^(#{1,3})\s+(.*)$/.exec(e);if(i){t.push({kind:`heading`,level:i[1].length,text:i[2]}),r++;continue}if(/^-\s+/.test(e)){let e=[];for(;r<n.length&&/^-\s+/.test(n[r]??``);)e.push((n[r]??``).replace(/^-\s+/,``)),r++;t.push({kind:`list`,items:e});continue}if(e.trim()===``){r++;continue}let a=[e];for(r++;r<n.length&&(n[r]??``).trim()!==``&&!/^(#{1,3}\s|```|-\s)/.test(n[r]??``);)a.push(n[r]??``),r++;t.push({kind:`paragraph`,text:a.join(` `)})}return t}function xP(e){let t=[],n=/`([^`]+)`/g,r=0,i,a=0;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),t.push((0,I.createElement)(`code`,{key:`c-${a++}`},i[1])),r=i.index+i[0].length;return r<e.length&&t.push(e.slice(r)),t}function SP(e){return(0,I.createElement)(I.Fragment,null,...bP(e).map((e,t)=>e.kind===`heading`?e.level===1?(0,I.createElement)(`h1`,{key:t},e.text):e.level===2?(0,I.createElement)(`h2`,{key:t},e.text):(0,I.createElement)(`h3`,{key:t},e.text):e.kind===`code`?(0,I.createElement)(`pre`,{key:t},(0,I.createElement)(`code`,null,e.text??``)):e.kind===`list`?(0,I.createElement)(`ul`,{key:t},...(e.items??[]).map((e,t)=>(0,I.createElement)(`li`,{key:t},...xP(e)))):(0,I.createElement)(`p`,{key:t},...xP(e.text??``))))}var CP=`# Build a plug-in
110
+
111
+ Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
112
+
113
+ ## 1. Scaffold
114
+
115
+ \`\`\`bash
116
+ jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
117
+ cd @you/my-swe-skill
118
+ yarn install
119
+ yarn test
120
+ \`\`\`
121
+
122
+ The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
123
+
124
+ \`\`\`
125
+ @you/my-swe-skill/
126
+ ├── jinn.plugin.json # the canonical manifest
127
+ ├── skills/example/SKILL.md
128
+ ├── test/plugin.test.ts # passes immediately
129
+ ├── package.json
130
+ ├── tsconfig.json
131
+ └── README.md
132
+ \`\`\`
133
+
134
+ ## 2. Edit your skill
135
+
136
+ Open \`skills/example/SKILL.md\` and replace it with the skill your plug-in offers. A SolverType plug-in can ship one or more skills; a runtime plug-in usually ships an MCP server in \`.mcp.json\` instead. See \`shape-reference.md\`.
137
+
138
+ ## 3. Publish to npm + chain
139
+
140
+ \`\`\`bash
141
+ npm publish --access public
142
+ jinn solver-plugins publish npm:@you/my-swe-skill
143
+ \`\`\`
144
+
145
+ \`jinn solver-plugins publish\` lazily completes your identity bootstrap (Stage 1) the first time you call it. If you have not yet funded your agent EOA with ETH on testnet, the verb pauses and tells you what to send where. Re-run when the wallet is funded.
146
+
147
+ The verb packs the plug-in, uploads the tarball to IPFS, and writes a \`plugin:<cid>\` record on the on-chain IdentityRegistry under your builder agentId.
148
+
149
+ ## 4. Confirm it published
150
+
151
+ Open the operator app's \`/build\` route. Under "Published plug-ins for SWE-rebench v2" you should see your plug-in. Under "Your published plug-ins" you should see the same record.
152
+
153
+ ## 5. Run it
154
+
155
+ An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
156
+
157
+ \`\`\`bash
158
+ jinn solver-plugins show npm:@you/my-swe-skill
159
+ jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
160
+ \`\`\`
161
+
162
+ The next task they claim runs against your plug-in. The signed envelope's \`executor.plugins[]\` carries your CID; the network explorer attributes the score to your builder agentId.
163
+
164
+ ## Next
165
+
166
+ - \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
167
+ - \`examples.md\` — annotated reference plug-ins.
168
+ - \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
169
+ - \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
170
+ - \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
171
+ `,wP=`https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md`,TP=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`;function EP(){return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(Li,{className:`mb-2 p-0`,children:(0,L.jsx)(`span`,{className:TP,children:`Quickstart · 60 seconds`})}),(0,L.jsxs)(Bi,{className:`p-0`,children:[(0,L.jsx)(`div`,{className:`hfmf-intro-markdown`,children:SP(CP)}),(0,L.jsx)(Wh,{className:`my-5`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:TP,children:`Next`}),(0,L.jsx)(`a`,{href:wP,target:`_blank`,rel:`noreferrer`,className:`border-b border-border pb-px font-mono text-[12px] text-primary no-underline hover:text-[var(--accent-sky-hover)]`,children:`Read the full quickstart on GitHub →`})]})]})]})}var DP=[{name:`name`,type:`string`,required:!0,description:`npm package name. Used as the canonical identifier across the registry.`},{name:`version`,type:`string`,required:!0,description:`Semantic version. New versions publish under a new IPFS CID.`},{name:`description`,type:`string`,required:!1,description:`Short prose description of what the plug-in offers.`},{name:`jinn.supports`,type:`string[]`,required:!0,description:`Either ["jinn.runtime"] (runtime plug-in) OR one or more SolverType identifiers (solver-type plug-in). Mixing is rejected.`},{name:`jinn.capabilities`,type:`object`,required:!1,description:`Optional capabilities map. Reserved for future use; not consumed by Hermes today.`},{name:`jinn.mcpServers`,type:`object`,required:!1,description:`Optional inline MCP server map. The Hermes harness reads .mcp.json instead; declare MCP there for harness-agnostic portability.`},{name:`jinn.skills`,type:`string[]`,required:!1,description:`Relative paths to SKILL.md files. Each declared skill becomes available to the harness as an external skill directory.`}],OP=[{id:`runtime`,label:`Runtime plug-in`,requires:`singleton — supports must be exactly ["jinn.runtime"]`,example:`{ "jinn": { "supports": ["jinn.runtime"] } }`},{id:`solver-type`,label:`SolverType plug-in`,requires:`one or more SolverType ids; cannot include "jinn.runtime"`,example:`{ "jinn": { "supports": ["swe-rebench-v2.v1"] } }`}],kP=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`;function AP(){return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsxs)(Li,{className:`mb-5 flex flex-col gap-1 p-0`,children:[(0,L.jsx)(`span`,{className:kP,children:`Reference`}),(0,L.jsx)(`h2`,{className:`m-0 font-serif text-[28px] leading-[1.2] text-foreground`,children:`Plug-in shape`})]}),(0,L.jsxs)(Bi,{className:`p-0`,children:[(0,L.jsxs)(fg,{children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{children:[(0,L.jsx)(_g,{children:`Field`}),(0,L.jsx)(_g,{children:`Type`}),(0,L.jsx)(_g,{children:`Required`}),(0,L.jsx)(_g,{children:`Description`})]})}),(0,L.jsx)(mg,{children:DP.map(e=>(0,L.jsxs)(gg,{"data-field-required":e.required?`true`:`false`,children:[(0,L.jsx)(vg,{className:`font-mono text-[13px] text-primary`,children:e.name}),(0,L.jsx)(vg,{className:`font-mono text-[13px] text-muted-foreground`,children:e.type}),(0,L.jsx)(vg,{children:(0,L.jsx)(q,{variant:e.required?`default`:`outline`,children:e.required?`yes`:`no`})}),(0,L.jsx)(vg,{className:`font-mono text-[13px] text-muted-foreground`,children:e.description})]},e.name))})]}),(0,L.jsx)(Wh,{className:`my-8`}),(0,L.jsxs)(`div`,{className:`mb-4 flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:kP,children:`Modes`}),(0,L.jsx)(`h3`,{className:`m-0 font-serif text-[22px] leading-[1.25] text-foreground`,children:`Two modes`}),(0,L.jsx)(`p`,{className:`m-0 mt-1 max-w-[72ch] font-mono text-[13px] leading-[1.7] text-muted-foreground`,children:`The validator enforces exactly two exclusive modes. Mixing is rejected.`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:OP.map((e,t)=>(0,L.jsxs)(W,{className:`flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4`,children:[(0,L.jsx)(`span`,{className:kP,children:t===0?`Mode · 01`:`Mode · 02`}),(0,L.jsx)(`h4`,{className:`m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground`,children:e.label}),(0,L.jsx)(`p`,{className:`m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground`,children:e.requires}),(0,L.jsx)(`pre`,{className:`m-0 overflow-x-auto rounded-sm border border-border bg-background px-3 py-2.5 font-mono text-[12px] leading-[1.5] text-primary`,children:(0,L.jsx)(`code`,{children:e.example})})]},e.id))})]})]})}var jP=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`;function MP(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function NP({solverType:e}){return(0,L.jsxs)(Li,{className:`mb-5 flex flex-col gap-1 p-0`,children:[(0,L.jsx)(`span`,{className:jP,children:`Registry`}),(0,L.jsxs)(`h3`,{className:`m-0 font-serif text-[22px] leading-[1.25] text-foreground`,children:[`Published plug-ins for `,e]})]})}function PP({solverType:e}){let{data:t,isLoading:n,error:r}=dt({queryKey:[`discovery`,`plugin-publications`,e],queryFn:()=>z.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(n)return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(NP,{solverType:e}),(0,L.jsxs)(Bi,{className:`flex flex-col gap-2 p-0`,children:[(0,L.jsx)(gd,{className:`h-4 w-full`}),(0,L.jsx)(gd,{className:`h-4 w-5/6`}),(0,L.jsx)(gd,{className:`h-4 w-4/6`})]})]});if(r)return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(NP,{solverType:e}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsx)(no,{variant:`blocking`,children:(0,L.jsxs)(K,{children:[`Discovery unavailable. `,r.message]})})})]});let i=t?.publications??[];return i.length===0?(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(NP,{solverType:e}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6`,children:[(0,L.jsx)(`span`,{className:jP,children:`Empty registry`}),(0,L.jsx)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-foreground`,children:`No plug-ins published yet. Be the first.`}),(0,L.jsxs)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground`,children:[`Run`,` `,(0,L.jsx)(`code`,{className:`rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary`,children:`jinn solver-plugins publish`}),` `,`and your plug-in appears here under your builder agentId.`]})]})})]}):(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(NP,{solverType:e}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsxs)(fg,{children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{children:[(0,L.jsx)(_g,{children:`Plug-in`}),(0,L.jsx)(_g,{children:`Version`}),(0,L.jsx)(_g,{children:`Builder agentId`}),(0,L.jsx)(_g,{children:`CID`}),(0,L.jsx)(_g,{children:`Status`})]})}),(0,L.jsx)(mg,{children:i.map(e=>(0,L.jsxs)(gg,{children:[(0,L.jsx)(vg,{className:`font-mono text-[12px] text-foreground`,children:e.name}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:e.version}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:e.builderAgentId}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:MP(e.cid)}),(0,L.jsx)(vg,{children:e.revoked?(0,L.jsxs)(q,{variant:`outline`,className:`rounded-full border-[var(--wane)] text-[var(--wane)]`,children:[`Revoked`,e.revokedReason?` · ${e.revokedReason}`:``]}):(0,L.jsx)(q,{variant:`success`,className:`rounded-full`,children:`Active`})})]},`${e.builderAgentId}:${e.cid}`))})]})})]})}var FP=`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,IP=`rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary`;function LP(){return(0,L.jsxs)(Li,{className:`mb-5 flex flex-col gap-1 p-0`,children:[(0,L.jsx)(`span`,{className:FP,children:`Builder`}),(0,L.jsx)(`h3`,{className:`m-0 font-serif text-[22px] leading-[1.25] text-foreground`,children:`Your published plug-ins`})]})}function RP({fleetAgentId:e}){let t=!!e,{data:n,isLoading:r,error:i}=dt({queryKey:[`discovery`,`builder-artifacts`,e],queryFn:()=>z.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return(0,L.jsxs)(W,{className:`bg-[var(--bg-sunken)] p-6`,children:[(0,L.jsx)(LP,{}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-dashed border-border p-6`,children:[(0,L.jsx)(`span`,{className:FP,children:`Identity pending`}),(0,L.jsxs)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground`,children:[`Complete identity bootstrap to see your published plug-ins. Run`,` `,(0,L.jsx)(`code`,{className:IP,children:`jinn solver-plugins publish`}),` on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1).`]})]})})]});if(r)return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(LP,{}),(0,L.jsxs)(Bi,{className:`flex flex-col gap-2 p-0`,children:[(0,L.jsx)(gd,{className:`h-4 w-full`}),(0,L.jsx)(gd,{className:`h-4 w-5/6`}),(0,L.jsx)(gd,{className:`h-4 w-4/6`})]})]});if(i)return(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(LP,{}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsx)(no,{variant:`blocking`,children:(0,L.jsx)(K,{children:`Discovery unavailable.`})})})]});let a=(n?.artifacts??[]).filter(e=>e.artifactType===`plugin`);return a.length===0?(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(LP,{}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6`,children:[(0,L.jsx)(`span`,{className:FP,children:`Nothing yet`}),(0,L.jsxs)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground`,children:[`You have not published any plug-ins yet. Scaffold one with`,` `,(0,L.jsx)(`code`,{className:IP,children:`jinn create plugin`}),`, then publish with `,(0,L.jsx)(`code`,{className:IP,children:`jinn solver-plugins publish`}),`. It will appear here under your builder agentId.`]})]})})]}):(0,L.jsxs)(W,{className:`p-6`,children:[(0,L.jsx)(LP,{}),(0,L.jsx)(Bi,{className:`p-0`,children:(0,L.jsxs)(fg,{children:[(0,L.jsx)(pg,{children:(0,L.jsxs)(gg,{children:[(0,L.jsx)(_g,{children:`Plug-in`}),(0,L.jsx)(_g,{children:`Version`}),(0,L.jsx)(_g,{children:`Supports`}),(0,L.jsx)(_g,{children:`Status`})]})}),(0,L.jsx)(mg,{children:a.map(e=>(0,L.jsxs)(gg,{children:[(0,L.jsx)(vg,{className:`font-mono text-[12px] text-foreground`,children:e.name}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:e.version}),(0,L.jsx)(vg,{className:`font-mono text-[12px] text-muted-foreground`,children:e.supports.join(`, `)}),(0,L.jsx)(vg,{children:e.revoked?(0,L.jsx)(q,{variant:`outline`,className:`rounded-full border-[var(--wane)] text-[var(--wane)]`,children:`Revoked`}):(0,L.jsx)(q,{variant:`success`,className:`rounded-full`,children:`Active`})})]},`${e.builderAgentId}:${e.cid}`))})]})})]})}function zP({value:e,onChange:t}){let n=e===`plugin`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(U,{type:`button`,variant:n?`outline`:`ghost`,size:`sm`,"aria-pressed":n?`true`:`false`,className:`rounded-full`,onClick:()=>{n||t(`plugin`)},children:`Plug-ins`}),(0,L.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:!0,"aria-pressed":`false`,className:`rounded-full opacity-60`,children:[`Harnesses`,(0,L.jsx)(`span`,{className:`ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]`,children:`Coming soon`})]})]})}var BP=`swe-rebench-v2.v1`;function VP(){let{data:e}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:5e3}),[t,n]=(0,I.useState)(`plugin`);return(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-2 pb-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]`,children:`Build · Plug-ins`}),(0,L.jsx)(`p`,{className:`m-0 max-w-[64ch] font-mono text-[14px] leading-[1.7] text-muted-foreground`,children:`Scaffold a SolverPlugin, publish it to npm and IPFS, watch it appear in the registry under your builder identity. Anchored on the SWE-rebench v2 SolverNet for v0.`})]}),(0,L.jsx)(EP,{}),(0,L.jsx)(AP,{}),(0,L.jsx)(Wh,{}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]`,children:`Registry`}),(0,L.jsx)(zP,{value:t,onChange:n})]}),t===`plugin`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(PP,{solverType:BP}),(0,L.jsx)(RP,{fleetAgentId:e?.fleet_agent_id})]}):null]})}function HP(){return(0,L.jsx)(Ep,{notices:Lp().filter(e=>e.kind===`rpc_unreachable`)})}var UP=({...e})=>(0,L.jsx)(Uh,{theme:`dark`,className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg font-mono text-[12px]`,description:`group-[.toast]:text-[var(--fg-muted)]`,actionButton:`group-[.toast]:bg-[var(--accent-sky)] group-[.toast]:text-[var(--bg-sunken)] font-mono text-[10px] uppercase tracking-[0.14em]`,cancelButton:`group-[.toast]:bg-transparent group-[.toast]:text-[var(--fg-muted)] font-mono text-[10px] uppercase tracking-[0.14em]`}},...e});function WP(){let{data:e,isLoading:t}=dt({queryKey:[`bootstrap`],queryFn:()=>z.getBootstrap(),refetchInterval:1500}),n=cn(),[r,i]=(0,I.useState)(!1),a={restartPending:r,setRestartPending:i};if(n.status===`disconnected`&&!e)return(0,L.jsxs)(od,{delayDuration:150,children:[(0,L.jsx)(Sp,{connection:n}),(0,L.jsx)(UP,{})]});let o=e?.onboardingComplete===!0;if(e&&(e.mode!==`running`||!o))return(0,L.jsxs)(od,{delayDuration:150,children:[(0,L.jsx)(HP,{}),(0,L.jsx)(yp,{}),(0,L.jsx)(UP,{})]});if(t||!e)return(0,L.jsxs)(od,{delayDuration:150,children:[(0,L.jsx)($a,{headline:`Starting jinn`}),(0,L.jsx)(UP,{})]});let s=e.chain===`base`?`mainnet`:`testnet`,{pluginBuilderUi:c,embeddedAgent:l}=ns();return(0,L.jsx)(od,{delayDuration:150,children:(0,L.jsxs)(Dp.Provider,{value:a,children:[(0,L.jsx)(Xt,{children:(0,L.jsx)(Rp,{header:(0,L.jsx)(uh,{network:s}),tabs:(0,L.jsx)(fh,{}),rail:l?(0,L.jsx)(ph,{}):void 0,children:(0,L.jsxs)(nn,{children:[(0,L.jsx)($t,{path:`/events/:id`,children:(0,L.jsx)(a_,{})}),(0,L.jsx)($t,{path:`/events`,children:(0,L.jsx)(t_,{})}),(0,L.jsx)($t,{path:`/overview`,component:Wg}),(0,L.jsx)($t,{path:`/operator/join/:cid`,children:(0,L.jsx)(TT,{})}),(0,L.jsx)($t,{path:`/operator/execution-data`,children:(0,L.jsx)(nA,{children:(0,L.jsx)(mD,{})})}),(0,L.jsx)($t,{path:`/operator/memberships`,children:(0,L.jsx)(nA,{children:(0,L.jsx)(lA,{onRestartPending:()=>i(!0)})})}),(0,L.jsx)($t,{path:`/operator/registry`,children:(0,L.jsx)(nA,{children:(0,L.jsx)(xA,{})})}),(0,L.jsx)($t,{path:`/operator/network`,children:(0,L.jsx)(nA,{children:(0,L.jsx)(SA,{onRestartPending:()=>i(!0)})})}),(0,L.jsx)($t,{path:`/operator/security`,children:(0,L.jsx)(nA,{children:(0,L.jsx)(yP,{})})}),(0,L.jsx)($t,{path:`/operator`,children:(0,L.jsx)(rn,{to:`/operator/memberships`})}),(0,L.jsx)($t,{path:`/captures`,children:(0,L.jsx)(rn,{to:`/operator/execution-data`})}),(0,L.jsx)($t,{path:`/configuration`,children:(0,L.jsx)(GP,{})}),(0,L.jsx)($t,{path:`/launcher/create`,children:(0,L.jsx)(gv,{})}),(0,L.jsx)($t,{path:`/launcher/launched/:solverNetId`,children:(0,L.jsx)(kC,{})}),(0,L.jsx)($t,{path:`/launcher`,children:(0,L.jsx)(v_,{})}),(0,L.jsx)($t,{path:`/build`,children:c?(0,L.jsx)(VP,{}):(0,L.jsx)(rn,{to:`/overview`})}),(0,L.jsx)($t,{children:(0,L.jsx)(rn,{to:`/overview`})})]})})}),(0,L.jsx)(UP,{})]})})}function GP(){return(0,L.jsx)(rn,{to:`/operator${typeof window>`u`?``:window.location.hash}`})}var KP=new Ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});on().finally(()=>{mt.createRoot(document.getElementById(`root`)).render((0,L.jsx)(I.StrictMode,{children:(0,L.jsx)(Ze,{client:KP,children:(0,L.jsx)(WP,{})})}))});