@jinn-network/client 0.1.6 → 0.1.7-canary.08ebd916

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 (390) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +67 -1
  3. package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +23 -4
  4. package/deployments/deployment-jinn-mvi-l1-sepolia.json +23 -4
  5. package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +5 -4
  6. package/dist/adapters/mech/adapter.d.ts +38 -2
  7. package/dist/adapters/mech/adapter.js +269 -62
  8. package/dist/adapters/mech/adapter.js.map +1 -1
  9. package/dist/adapters/mech/contracts.d.ts +17 -4
  10. package/dist/adapters/mech/contracts.js +8 -2
  11. package/dist/adapters/mech/contracts.js.map +1 -1
  12. package/dist/adapters/mech/safe-revert.d.ts +20 -0
  13. package/dist/adapters/mech/safe-revert.js +12 -4
  14. package/dist/adapters/mech/safe-revert.js.map +1 -1
  15. package/dist/adapters/mech/safe.d.ts +6 -2
  16. package/dist/adapters/mech/safe.js +32 -11
  17. package/dist/adapters/mech/safe.js.map +1 -1
  18. package/dist/adapters/mech/types.d.ts +6 -1
  19. package/dist/adapters/mech/types.js.map +1 -1
  20. package/dist/adapters/mech/verdict-code.d.ts +1 -0
  21. package/dist/adapters/mech/verdict-code.js +18 -0
  22. package/dist/adapters/mech/verdict-code.js.map +1 -1
  23. package/dist/agent/operator-claude.js +8 -0
  24. package/dist/agent/operator-claude.js.map +1 -1
  25. package/dist/api/activity-events-endpoint.d.ts +14 -0
  26. package/dist/api/activity-events-endpoint.js +59 -0
  27. package/dist/api/activity-events-endpoint.js.map +1 -0
  28. package/dist/api/admin-endpoint.d.ts +15 -3
  29. package/dist/api/admin-endpoint.js +24 -2
  30. package/dist/api/admin-endpoint.js.map +1 -1
  31. package/dist/api/bootstrap-endpoint.d.ts +1 -2
  32. package/dist/api/bootstrap-endpoint.js +85 -18
  33. package/dist/api/bootstrap-endpoint.js.map +1 -1
  34. package/dist/api/codex-doctor-endpoint.d.ts +90 -0
  35. package/dist/api/codex-doctor-endpoint.js +296 -0
  36. package/dist/api/codex-doctor-endpoint.js.map +1 -0
  37. package/dist/api/discovery-endpoint.d.ts +1 -0
  38. package/dist/api/discovery-endpoint.js +26 -0
  39. package/dist/api/discovery-endpoint.js.map +1 -1
  40. package/dist/api/fleet-build.d.ts +1 -0
  41. package/dist/api/fleet-build.js +2 -1
  42. package/dist/api/fleet-build.js.map +1 -1
  43. package/dist/api/gather-status.d.ts +37 -0
  44. package/dist/api/gather-status.js +572 -19
  45. package/dist/api/gather-status.js.map +1 -1
  46. package/dist/api/hermes-doctor-endpoint.d.ts +128 -3
  47. package/dist/api/hermes-doctor-endpoint.js +265 -22
  48. package/dist/api/hermes-doctor-endpoint.js.map +1 -1
  49. package/dist/api/launcher-status.d.ts +25 -17
  50. package/dist/api/launcher-status.js +13 -11
  51. package/dist/api/launcher-status.js.map +1 -1
  52. package/dist/api/launcher-tasks.d.ts +1 -1
  53. package/dist/api/launcher-tasks.js +12 -8
  54. package/dist/api/launcher-tasks.js.map +1 -1
  55. package/dist/api/operator-artifacts-endpoint.js +73 -6
  56. package/dist/api/operator-artifacts-endpoint.js.map +1 -1
  57. package/dist/api/portfolio-v0-build.d.ts +10 -0
  58. package/dist/api/portfolio-v0-build.js +24 -5
  59. package/dist/api/portfolio-v0-build.js.map +1 -1
  60. package/dist/api/prediction-v1-build.d.ts +10 -0
  61. package/dist/api/prediction-v1-build.js +7 -1
  62. package/dist/api/prediction-v1-build.js.map +1 -1
  63. package/dist/api/server.d.ts +31 -1
  64. package/dist/api/server.js +95 -2
  65. package/dist/api/server.js.map +1 -1
  66. package/dist/api/setup-endpoints.d.ts +16 -0
  67. package/dist/api/setup-endpoints.js +89 -135
  68. package/dist/api/setup-endpoints.js.map +1 -1
  69. package/dist/api/setup-retry-endpoint.d.ts +19 -0
  70. package/dist/api/setup-retry-endpoint.js +32 -0
  71. package/dist/api/setup-retry-endpoint.js.map +1 -0
  72. package/dist/api/solvernets-endpoints.d.ts +8 -0
  73. package/dist/api/solvernets-endpoints.js +99 -60
  74. package/dist/api/solvernets-endpoints.js.map +1 -1
  75. package/dist/api/status-build.d.ts +168 -2
  76. package/dist/api/status-build.js +116 -27
  77. package/dist/api/status-build.js.map +1 -1
  78. package/dist/api/status-harness-rollup.d.ts +35 -0
  79. package/dist/api/status-harness-rollup.js +45 -0
  80. package/dist/api/status-harness-rollup.js.map +1 -0
  81. package/dist/api/task-run-routing.d.ts +7 -0
  82. package/dist/api/task-run-routing.js +12 -0
  83. package/dist/api/task-run-routing.js.map +1 -0
  84. package/dist/api/task-runs-build.d.ts +21 -0
  85. package/dist/api/task-runs-build.js +14 -1
  86. package/dist/api/task-runs-build.js.map +1 -1
  87. package/dist/build-info.json +4 -4
  88. package/dist/build-meta.json +1 -1
  89. package/dist/captures/live-publisher.js +24 -4
  90. package/dist/captures/live-publisher.js.map +1 -1
  91. package/dist/captures/publish.d.ts +1 -1
  92. package/dist/chain-read-errors.d.ts +10 -0
  93. package/dist/chain-read-errors.js +15 -0
  94. package/dist/chain-read-errors.js.map +1 -1
  95. package/dist/cli/commands/auth.js +1 -1
  96. package/dist/cli/commands/auth.js.map +1 -1
  97. package/dist/cli/commands/create.js +3 -2
  98. package/dist/cli/commands/create.js.map +1 -1
  99. package/dist/cli/commands/doctor.d.ts +2 -0
  100. package/dist/cli/commands/doctor.js +2 -0
  101. package/dist/cli/commands/doctor.js.map +1 -1
  102. package/dist/cli/commands/rewards.js +11 -7
  103. package/dist/cli/commands/rewards.js.map +1 -1
  104. package/dist/cli/commands/solver-nets.js +101 -15
  105. package/dist/cli/commands/solver-nets.js.map +1 -1
  106. package/dist/cli/commands/solver-plugins-block.d.ts +33 -0
  107. package/dist/cli/commands/solver-plugins-block.js +118 -0
  108. package/dist/cli/commands/solver-plugins-block.js.map +1 -0
  109. package/dist/cli/commands/solver-plugins-feedback.d.ts +72 -0
  110. package/dist/cli/commands/solver-plugins-feedback.js +262 -0
  111. package/dist/cli/commands/solver-plugins-feedback.js.map +1 -0
  112. package/dist/cli/commands/solver-plugins-read.d.ts +54 -0
  113. package/dist/cli/commands/solver-plugins-read.js +259 -0
  114. package/dist/cli/commands/solver-plugins-read.js.map +1 -0
  115. package/dist/cli/commands/solver-plugins.d.ts +35 -0
  116. package/dist/cli/commands/solver-plugins.js +399 -2
  117. package/dist/cli/commands/solver-plugins.js.map +1 -1
  118. package/dist/cli/commands/status.js +1 -1
  119. package/dist/cli/commands/status.js.map +1 -1
  120. package/dist/cli/commands/tasks.js +101 -11
  121. package/dist/cli/commands/tasks.js.map +1 -1
  122. package/dist/cli/commands/update.d.ts +10 -0
  123. package/dist/cli/commands/update.js +36 -0
  124. package/dist/cli/commands/update.js.map +1 -1
  125. package/dist/cli/introspection-context.js +5 -0
  126. package/dist/cli/introspection-context.js.map +1 -1
  127. package/dist/cli/task-native-readiness.d.ts +10 -1
  128. package/dist/cli/task-native-readiness.js +30 -6
  129. package/dist/cli/task-native-readiness.js.map +1 -1
  130. package/dist/config.d.ts +273 -235
  131. package/dist/config.js +305 -114
  132. package/dist/config.js.map +1 -1
  133. package/dist/daemon/checkpoint-loop.d.ts +48 -0
  134. package/dist/daemon/checkpoint-loop.js +76 -0
  135. package/dist/daemon/checkpoint-loop.js.map +1 -0
  136. package/dist/daemon/creator.d.ts +1 -1
  137. package/dist/daemon/creator.js +7 -3
  138. package/dist/daemon/creator.js.map +1 -1
  139. package/dist/daemon/daemon.d.ts +22 -0
  140. package/dist/daemon/daemon.js +156 -23
  141. package/dist/daemon/daemon.js.map +1 -1
  142. package/dist/daemon/eviction-loop.d.ts +40 -0
  143. package/dist/daemon/eviction-loop.js +67 -0
  144. package/dist/daemon/eviction-loop.js.map +1 -0
  145. package/dist/daemon/gate-logger.d.ts +9 -0
  146. package/dist/daemon/gate-logger.js +2 -0
  147. package/dist/daemon/gate-logger.js.map +1 -0
  148. package/dist/daemon/jinn-claim-loop-wiring.d.ts +33 -0
  149. package/dist/daemon/jinn-claim-loop-wiring.js +40 -0
  150. package/dist/daemon/jinn-claim-loop-wiring.js.map +1 -0
  151. package/dist/daemon/jinn-claim-loop.d.ts +24 -17
  152. package/dist/daemon/jinn-claim-loop.js +77 -23
  153. package/dist/daemon/jinn-claim-loop.js.map +1 -1
  154. package/dist/daemon/readiness-gate.d.ts +1 -4
  155. package/dist/daemon/readiness-gate.js.map +1 -1
  156. package/dist/daemon/skip-log-dedup.d.ts +69 -0
  157. package/dist/daemon/skip-log-dedup.js +106 -0
  158. package/dist/daemon/skip-log-dedup.js.map +1 -0
  159. package/dist/daemon/spend-cap-gate.d.ts +40 -0
  160. package/dist/daemon/spend-cap-gate.js +46 -0
  161. package/dist/daemon/spend-cap-gate.js.map +1 -0
  162. package/dist/dashboard/assets/index-C4huIsUW.css +32 -0
  163. package/dist/dashboard/assets/index-DkTglWXU.js +345 -0
  164. package/dist/dashboard/index.html +2 -2
  165. package/dist/discovery/factory.d.ts +17 -5
  166. package/dist/discovery/factory.js +46 -18
  167. package/dist/discovery/factory.js.map +1 -1
  168. package/dist/discovery/http.js +216 -3
  169. package/dist/discovery/http.js.map +1 -1
  170. package/dist/discovery/onchain.d.ts +5 -0
  171. package/dist/discovery/onchain.js +418 -15
  172. package/dist/discovery/onchain.js.map +1 -1
  173. package/dist/discovery/types.d.ts +75 -1
  174. package/dist/discovery/types.js +8 -10
  175. package/dist/discovery/types.js.map +1 -1
  176. package/dist/discovery/with-fallback.d.ts +7 -0
  177. package/dist/discovery/with-fallback.js +20 -0
  178. package/dist/discovery/with-fallback.js.map +1 -1
  179. package/dist/earning/bootstrap.d.ts +100 -4
  180. package/dist/earning/bootstrap.js +221 -74
  181. package/dist/earning/bootstrap.js.map +1 -1
  182. package/dist/earning/contracts.d.ts +14 -0
  183. package/dist/earning/contracts.js +17 -5
  184. package/dist/earning/contracts.js.map +1 -1
  185. package/dist/earning/funding-plan.js +27 -18
  186. package/dist/earning/funding-plan.js.map +1 -1
  187. package/dist/earning/jinn-rewards.d.ts +46 -0
  188. package/dist/earning/jinn-rewards.js +32 -0
  189. package/dist/earning/jinn-rewards.js.map +1 -1
  190. package/dist/earning/safe-adapter.d.ts +2 -0
  191. package/dist/earning/safe-adapter.js +37 -11
  192. package/dist/earning/safe-adapter.js.map +1 -1
  193. package/dist/earning/store.d.ts +8 -0
  194. package/dist/earning/store.js.map +1 -1
  195. package/dist/earning/testnet-setup-migration.d.ts +12 -0
  196. package/dist/earning/testnet-setup-migration.js +27 -1
  197. package/dist/earning/testnet-setup-migration.js.map +1 -1
  198. package/dist/earning/types.d.ts +21 -6
  199. package/dist/earning/viem-clients.d.ts +11 -4
  200. package/dist/earning/viem-clients.js +14 -5
  201. package/dist/earning/viem-clients.js.map +1 -1
  202. package/dist/erc8004/identity.d.ts +19 -3
  203. package/dist/erc8004/identity.js +21 -6
  204. package/dist/erc8004/identity.js.map +1 -1
  205. package/dist/erc8004/index.d.ts +1 -1
  206. package/dist/erc8004/index.js.map +1 -1
  207. package/dist/erc8004/reputation.d.ts +8 -0
  208. package/dist/erc8004/reputation.js +22 -3
  209. package/dist/erc8004/reputation.js.map +1 -1
  210. package/dist/events/types.d.ts +2 -2
  211. package/dist/harnesses/cost-estimates.d.ts +145 -0
  212. package/dist/harnesses/cost-estimates.js +297 -0
  213. package/dist/harnesses/cost-estimates.js.map +1 -0
  214. package/dist/harnesses/engine/engine.d.ts +78 -0
  215. package/dist/harnesses/engine/engine.js +153 -11
  216. package/dist/harnesses/engine/engine.js.map +1 -1
  217. package/dist/harnesses/engine/persistence.d.ts +51 -1
  218. package/dist/harnesses/engine/persistence.js +118 -5
  219. package/dist/harnesses/engine/persistence.js.map +1 -1
  220. package/dist/harnesses/engine/work-dir-reaper.d.ts +65 -0
  221. package/dist/harnesses/engine/work-dir-reaper.js +100 -0
  222. package/dist/harnesses/engine/work-dir-reaper.js.map +1 -0
  223. package/dist/harnesses/impls/hermes-agent/adapter.js +40 -0
  224. package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
  225. package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +20 -0
  226. package/dist/harnesses/impls/hermes-agent/bootstrap.js +40 -6
  227. package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
  228. package/dist/harnesses/impls/hermes-agent/harness.d.ts +59 -1
  229. package/dist/harnesses/impls/hermes-agent/harness.js +104 -0
  230. package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
  231. package/dist/harnesses/impls/hermes-agent/prompt.d.ts +6 -6
  232. package/dist/harnesses/impls/hermes-agent/prompt.js +6 -6
  233. package/dist/harnesses/impls/index.d.ts +7 -0
  234. package/dist/harnesses/impls/index.js +16 -1
  235. package/dist/harnesses/impls/index.js.map +1 -1
  236. package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +9 -0
  237. package/dist/harnesses/impls/learner/adapters/codex-code.js +30 -8
  238. package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
  239. package/dist/harnesses/impls/learner/harness.d.ts +38 -4
  240. package/dist/harnesses/impls/learner/harness.js +96 -2
  241. package/dist/harnesses/impls/learner/harness.js.map +1 -1
  242. package/dist/harnesses/impls/learner/harvest.d.ts +1 -1
  243. package/dist/harnesses/impls/learner/harvest.js +23 -5
  244. package/dist/harnesses/impls/learner/harvest.js.map +1 -1
  245. package/dist/harnesses/impls/learner/plugin-path.d.ts +0 -13
  246. package/dist/harnesses/impls/learner/plugin-path.js +35 -15
  247. package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
  248. package/dist/harnesses/impls/learner/restoration-patch.d.ts +2 -2
  249. package/dist/harnesses/impls/learner/restoration-patch.js +25 -6
  250. package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -1
  251. package/dist/harnesses/impls/learner/types.d.ts +11 -0
  252. package/dist/harnesses/impls/stub.d.ts +58 -0
  253. package/dist/harnesses/impls/stub.js +89 -0
  254. package/dist/harnesses/impls/stub.js.map +1 -0
  255. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +69 -50
  256. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +178 -93
  257. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
  258. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +12 -1
  259. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +121 -7
  260. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
  261. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +88 -4
  262. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +143 -22
  263. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
  264. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +6 -0
  265. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +1 -1
  266. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
  267. package/dist/harnesses/readiness-registry.d.ts +7 -0
  268. package/dist/harnesses/readiness-registry.js +18 -1
  269. package/dist/harnesses/readiness-registry.js.map +1 -1
  270. package/dist/main.js +419 -111
  271. package/dist/main.js.map +1 -1
  272. package/dist/observability/emit-event.d.ts +3 -2
  273. package/dist/observability/emit-event.js +22 -1
  274. package/dist/observability/emit-event.js.map +1 -1
  275. package/dist/operator-errors.d.ts +7 -0
  276. package/dist/operator-errors.js +13 -1
  277. package/dist/operator-errors.js.map +1 -1
  278. package/dist/plugins/learner/.claude-plugin/plugin.json +9 -0
  279. package/dist/plugins/learner/.codex-plugin/plugin.json +39 -0
  280. package/dist/plugins/learner/AGENTS.md +40 -0
  281. package/dist/plugins/learner/CLAUDE.md +33 -0
  282. package/dist/plugins/learner/README.md +59 -0
  283. package/dist/plugins/learner/hooks/hooks.json +16 -0
  284. package/dist/plugins/learner/hooks/session-start +38 -0
  285. package/dist/plugins/learner/skills/learn/SKILL.md +412 -0
  286. package/dist/plugins/learner/skills/learn/analyst-prompt.md +68 -0
  287. package/dist/plugins/learner/skills/learn/consolidator-prompt.md +94 -0
  288. package/dist/plugins/learner/skills/learn/explorer-prompt.md +53 -0
  289. package/dist/plugins/learner/skills/learn/planner-prompt.md +87 -0
  290. package/dist/plugins/learner/skills/learn/promoter-prompt.md +113 -0
  291. package/dist/plugins/learner/skills/learn/step-worker-prompt.md +47 -0
  292. package/dist/plugins/learner/skills/learn/strategist-prompt.md +85 -0
  293. package/dist/preflight/rpc-network.d.ts +40 -0
  294. package/dist/preflight/rpc-network.js +67 -1
  295. package/dist/preflight/rpc-network.js.map +1 -1
  296. package/dist/restart-daemon.d.ts +90 -0
  297. package/dist/restart-daemon.js +95 -0
  298. package/dist/restart-daemon.js.map +1 -0
  299. package/dist/rpc/transport.d.ts +109 -0
  300. package/dist/rpc/transport.js +220 -0
  301. package/dist/rpc/transport.js.map +1 -0
  302. package/dist/scripts/donation-consumption-acceptance.js +7 -28
  303. package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
  304. package/dist/setup/halt-mode.d.ts +14 -0
  305. package/dist/setup/halt-mode.js +17 -0
  306. package/dist/setup/halt-mode.js.map +1 -0
  307. package/dist/solver-nets/prediction-operator-ux.d.ts +1 -2
  308. package/dist/solver-nets/prediction-operator-ux.js +90 -47
  309. package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
  310. package/dist/solver-nets/registry.d.ts +20 -1
  311. package/dist/solver-nets/registry.js +38 -25
  312. package/dist/solver-nets/registry.js.map +1 -1
  313. package/dist/solver-types/_swe-rebench-v2-pool-cache.d.ts +58 -0
  314. package/dist/solver-types/_swe-rebench-v2-pool-cache.js +87 -0
  315. package/dist/solver-types/_swe-rebench-v2-pool-cache.js.map +1 -0
  316. package/dist/solver-types/_swe-rebench-v2-pool.d.ts +9 -2
  317. package/dist/solver-types/_swe-rebench-v2-pool.js +15 -20
  318. package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -1
  319. package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +1 -0
  320. package/dist/solver-types/_swe-rebench-v2-substrate.js +10 -0
  321. package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -1
  322. package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +94 -1
  323. package/dist/solver-types/_swe-rebench-v2-validated-pool.js +305 -39
  324. package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
  325. package/dist/solver-types/swe-rebench-v2-auto.d.ts +22 -7
  326. package/dist/solver-types/swe-rebench-v2-auto.js +57 -20
  327. package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
  328. package/dist/solver-types/swe-rebench-v2.d.ts +18 -2
  329. package/dist/solver-types/swe-rebench-v2.js +310 -94
  330. package/dist/solver-types/swe-rebench-v2.js.map +1 -1
  331. package/dist/solvernets/daemon-init.d.ts +10 -2
  332. package/dist/solvernets/daemon-init.js +22 -2
  333. package/dist/solvernets/daemon-init.js.map +1 -1
  334. package/dist/solvernets/launched-record-dispatcher.d.ts +4 -0
  335. package/dist/solvernets/launched-record-dispatcher.js +44 -7
  336. package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
  337. package/dist/solvernets/store.d.ts +5 -0
  338. package/dist/solvernets/store.js +1 -0
  339. package/dist/solvernets/store.js.map +1 -1
  340. package/dist/spend/credential.d.ts +8 -0
  341. package/dist/spend/credential.js +30 -0
  342. package/dist/spend/credential.js.map +1 -0
  343. package/dist/spend/daemon-config.d.ts +13 -0
  344. package/dist/spend/daemon-config.js +24 -0
  345. package/dist/spend/daemon-config.js.map +1 -0
  346. package/dist/spend/pricing.d.ts +16 -0
  347. package/dist/spend/pricing.js +26 -0
  348. package/dist/spend/pricing.js.map +1 -0
  349. package/dist/spend/record.d.ts +13 -0
  350. package/dist/spend/record.js +30 -0
  351. package/dist/spend/record.js.map +1 -0
  352. package/dist/spend/usage.d.ts +27 -0
  353. package/dist/spend/usage.js +113 -0
  354. package/dist/spend/usage.js.map +1 -0
  355. package/dist/store/store.d.ts +61 -0
  356. package/dist/store/store.js +302 -7
  357. package/dist/store/store.js.map +1 -1
  358. package/dist/tasks/sources.d.ts +18 -1
  359. package/dist/tasks/sources.js +33 -5
  360. package/dist/tasks/sources.js.map +1 -1
  361. package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
  362. package/dist/tx-retry.d.ts +166 -19
  363. package/dist/tx-retry.js +310 -32
  364. package/dist/tx-retry.js.map +1 -1
  365. package/dist/types/payloads/prediction-apy-v0.d.ts +5 -5
  366. package/dist/types/payloads/prediction-v0.d.ts +5 -5
  367. package/dist/types/task-document.d.ts +392 -0
  368. package/dist/types/task-document.js +10 -0
  369. package/dist/types/task-document.js.map +1 -1
  370. package/dist/types/task.d.ts +28 -0
  371. package/dist/util/extract-tx-hash.d.ts +14 -0
  372. package/dist/util/extract-tx-hash.js +19 -0
  373. package/dist/util/extract-tx-hash.js.map +1 -0
  374. package/dist/vendor/@jinn-network/sdk/dist/contracts.js +1 -1
  375. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +3 -0
  376. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -0
  377. package/package.json +36 -13
  378. package/plugins/swe-rebench-v2-diffmin/README.md +10 -9
  379. package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +1 -1
  380. package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +15 -10
  381. package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +10 -12
  382. package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +1 -1
  383. package/plugins/swe-rebench-v2-runtime/.codex-plugin/plugin.json +3 -3
  384. package/plugins/swe-rebench-v2-runtime/README.md +6 -6
  385. package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +2 -3
  386. package/plugins/swe-rebench-v2-runtime/skills/task/SKILL.md +69 -0
  387. package/dist/dashboard/assets/index-DOlzFN8a.css +0 -32
  388. package/dist/dashboard/assets/index-NkZ7CTAT.js +0 -140
  389. package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +0 -29
  390. package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +0 -53
@@ -0,0 +1,345 @@
1
+ var Vg=e=>{throw TypeError(e)};var Md=(e,t,r)=>t.has(e)||Vg("Cannot "+r);var F=(e,t,r)=>(Md(e,t,"read from private field"),r?r.call(e):t.get(e)),xe=(e,t,r)=>t.has(e)?Vg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),de=(e,t,r,n)=>(Md(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Pe=(e,t,r)=>(Md(e,t,"access private method"),r);var nc=(e,t,r,n)=>({set _(s){de(e,t,s,r)},get _(){return F(e,t,n)}});function Ok(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Ty(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ay={exports:{}},Vu={},Dy={exports:{}},Le={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Fl=Symbol.for("react.element"),Ik=Symbol.for("react.portal"),Fk=Symbol.for("react.fragment"),Bk=Symbol.for("react.strict_mode"),$k=Symbol.for("react.profiler"),Hk=Symbol.for("react.provider"),zk=Symbol.for("react.context"),Uk=Symbol.for("react.forward_ref"),Wk=Symbol.for("react.suspense"),Vk=Symbol.for("react.memo"),qk=Symbol.for("react.lazy"),qg=Symbol.iterator;function Kk(e){return e===null||typeof e!="object"?null:(e=qg&&e[qg]||e["@@iterator"],typeof e=="function"?e:null)}var Ly={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},My=Object.assign,Oy={};function ua(e,t,r){this.props=e,this.context=t,this.refs=Oy,this.updater=r||Ly}ua.prototype.isReactComponent={};ua.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};ua.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Iy(){}Iy.prototype=ua.prototype;function Pp(e,t,r){this.props=e,this.context=t,this.refs=Oy,this.updater=r||Ly}var Tp=Pp.prototype=new Iy;Tp.constructor=Pp;My(Tp,ua.prototype);Tp.isPureReactComponent=!0;var Kg=Array.isArray,Fy=Object.prototype.hasOwnProperty,Ap={current:null},By={key:!0,ref:!0,__self:!0,__source:!0};function $y(e,t,r){var n,s={},i=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Fy.call(t,n)&&!By.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:Fl,type:e,key:i,ref:l,props:s,_owner:Ap.current}}function Gk(e,t){return{$$typeof:Fl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fl}function Qk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Gg=/\/+/g;function Od(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Qk(""+e.key):t.toString(36)}function Mc(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Fl:case Ik:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+Od(l,0):n,Kg(s)?(r="",e!=null&&(r=e.replace(Gg,"$&/")+"/"),Mc(s,t,r,"",function(u){return u})):s!=null&&(Dp(s)&&(s=Gk(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(Gg,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",Kg(e))for(var a=0;a<e.length;a++){i=e[a];var c=n+Od(i,a);l+=Mc(i,t,r,c,s)}else if(c=Kk(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=n+Od(i,a++),l+=Mc(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function sc(e,t,r){if(e==null)return e;var n=[],s=0;return Mc(e,n,"","",function(i){return t.call(r,i,s++)}),n}function Yk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Xt={current:null},Oc={transition:null},Zk={ReactCurrentDispatcher:Xt,ReactCurrentBatchConfig:Oc,ReactCurrentOwner:Ap};function Hy(){throw Error("act(...) is not supported in production builds of React.")}Le.Children={map:sc,forEach:function(e,t,r){sc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return sc(e,function(){t++}),t},toArray:function(e){return sc(e,function(t){return t})||[]},only:function(e){if(!Dp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Le.Component=ua;Le.Fragment=Fk;Le.Profiler=$k;Le.PureComponent=Pp;Le.StrictMode=Bk;Le.Suspense=Wk;Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zk;Le.act=Hy;Le.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=My({},e.props),s=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=Ap.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Fy.call(t,c)&&!By.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Fl,type:e.type,key:s,ref:i,props:n,_owner:l}};Le.createContext=function(e){return e={$$typeof:zk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Hk,_context:e},e.Consumer=e};Le.createElement=$y;Le.createFactory=function(e){var t=$y.bind(null,e);return t.type=e,t};Le.createRef=function(){return{current:null}};Le.forwardRef=function(e){return{$$typeof:Uk,render:e}};Le.isValidElement=Dp;Le.lazy=function(e){return{$$typeof:qk,_payload:{_status:-1,_result:e},_init:Yk}};Le.memo=function(e,t){return{$$typeof:Vk,type:e,compare:t===void 0?null:t}};Le.startTransition=function(e){var t=Oc.transition;Oc.transition={};try{e()}finally{Oc.transition=t}};Le.unstable_act=Hy;Le.useCallback=function(e,t){return Xt.current.useCallback(e,t)};Le.useContext=function(e){return Xt.current.useContext(e)};Le.useDebugValue=function(){};Le.useDeferredValue=function(e){return Xt.current.useDeferredValue(e)};Le.useEffect=function(e,t){return Xt.current.useEffect(e,t)};Le.useId=function(){return Xt.current.useId()};Le.useImperativeHandle=function(e,t,r){return Xt.current.useImperativeHandle(e,t,r)};Le.useInsertionEffect=function(e,t){return Xt.current.useInsertionEffect(e,t)};Le.useLayoutEffect=function(e,t){return Xt.current.useLayoutEffect(e,t)};Le.useMemo=function(e,t){return Xt.current.useMemo(e,t)};Le.useReducer=function(e,t,r){return Xt.current.useReducer(e,t,r)};Le.useRef=function(e){return Xt.current.useRef(e)};Le.useState=function(e){return Xt.current.useState(e)};Le.useSyncExternalStore=function(e,t,r){return Xt.current.useSyncExternalStore(e,t,r)};Le.useTransition=function(){return Xt.current.useTransition()};Le.version="18.3.1";Dy.exports=Le;var C=Dy.exports;const Y=Ty(C),qu=Ok({__proto__:null,default:Y},[C]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Xk=C,Jk=Symbol.for("react.element"),eE=Symbol.for("react.fragment"),tE=Object.prototype.hasOwnProperty,rE=Xk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nE={key:!0,ref:!0,__self:!0,__source:!0};function zy(e,t,r){var n,s={},i=null,l=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)tE.call(t,n)&&!nE.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Jk,type:e,key:i,ref:l,props:s,_owner:rE.current}}Vu.Fragment=eE;Vu.jsx=zy;Vu.jsxs=zy;Ay.exports=Vu;var o=Ay.exports,Mh={},Uy={exports:{}},Er={},Wy={exports:{}},Vy={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(N,P){var D=N.length;N.push(P);e:for(;0<D;){var O=D-1>>>1,B=N[O];if(0<s(B,P))N[O]=P,N[D]=B,D=O;else break e}}function r(N){return N.length===0?null:N[0]}function n(N){if(N.length===0)return null;var P=N[0],D=N.pop();if(D!==P){N[0]=D;e:for(var O=0,B=N.length,Q=B>>>1;O<Q;){var ee=2*(O+1)-1,re=N[ee],ye=ee+1,A=N[ye];if(0>s(re,D))ye<B&&0>s(A,re)?(N[O]=A,N[ye]=D,O=ye):(N[O]=re,N[ee]=D,O=ee);else if(ye<B&&0>s(A,D))N[O]=A,N[ye]=D,O=ye;else break e}}return P}function s(N,P){var D=N.sortIndex-P.sortIndex;return D!==0?D:N.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],u=[],g=1,d=null,_=3,v=!1,x=!1,y=!1,h=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(N){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=N)n(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=r(u)}}function b(N){if(y=!1,m(N),!x)if(r(c)!==null)x=!0,W(w);else{var P=r(u);P!==null&&q(b,P.startTime-N)}}function w(N,P){x=!1,y&&(y=!1,p(S),S=-1),v=!0;var D=_;try{for(m(P),d=r(c);d!==null&&(!(d.expirationTime>P)||N&&!M());){var O=d.callback;if(typeof O=="function"){d.callback=null,_=d.priorityLevel;var B=O(d.expirationTime<=P);P=e.unstable_now(),typeof B=="function"?d.callback=B:d===r(c)&&n(c),m(P)}else n(c);d=r(c)}if(d!==null)var Q=!0;else{var ee=r(u);ee!==null&&q(b,ee.startTime-P),Q=!1}return Q}finally{d=null,_=D,v=!1}}var k=!1,E=null,S=-1,j=5,R=-1;function M(){return!(e.unstable_now()-R<j)}function T(){if(E!==null){var N=e.unstable_now();R=N;var P=!0;try{P=E(!0,N)}finally{P?L():(k=!1,E=null)}}else k=!1}var L;if(typeof f=="function")L=function(){f(T)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,z=$.port2;$.port1.onmessage=T,L=function(){z.postMessage(null)}}else L=function(){h(T,0)};function W(N){E=N,k||(k=!0,L())}function q(N,P){S=h(function(){N(e.unstable_now())},P)}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(N){N.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,W(w))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(N){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var D=_;_=P;try{return N()}finally{_=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,P){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var D=_;_=N;try{return P()}finally{_=D}},e.unstable_scheduleCallback=function(N,P,D){var O=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?O+D:O):D=O,N){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=D+B,N={id:g++,callback:P,priorityLevel:N,startTime:D,expirationTime:B,sortIndex:-1},D>O?(N.sortIndex=D,t(u,N),r(c)===null&&N===r(u)&&(y?(p(S),S=-1):y=!0,q(b,D-O))):(N.sortIndex=B,t(c,N),x||v||(x=!0,W(w))),N},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(N){var P=_;return function(){var D=_;_=P;try{return N.apply(this,arguments)}finally{_=D}}}})(Vy);Wy.exports=Vy;var sE=Wy.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var iE=C,wr=sE;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var qy=new Set,ol={};function Bi(e,t){Ko(e,t),Ko(e+"Capture",t)}function Ko(e,t){for(ol[e]=t,e=0;e<t.length;e++)qy.add(t[e])}var Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oh=Object.prototype.hasOwnProperty,oE=/^[: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]*$/,Qg={},Yg={};function aE(e){return Oh.call(Yg,e)?!0:Oh.call(Qg,e)?!1:oE.test(e)?Yg[e]=!0:(Qg[e]=!0,!1)}function lE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cE(e,t,r,n){if(t===null||typeof t>"u"||lE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Jt(e,t,r,n,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new Jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new Jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new Jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new Jt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Lt[e]=new Jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new Jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new Jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new Jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new Jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lp=/[\-:]([a-z])/g;function Mp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Lp,Mp);Lt[t]=new Jt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Lp,Mp);Lt[t]=new Jt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Lp,Mp);Lt[t]=new Jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new Jt(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new Jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new Jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Op(e,t,r,n){var s=Lt.hasOwnProperty(t)?Lt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cE(t,r,s,n)&&(r=null),n||s===null?aE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ss=iE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ic=Symbol.for("react.element"),lo=Symbol.for("react.portal"),co=Symbol.for("react.fragment"),Ip=Symbol.for("react.strict_mode"),Ih=Symbol.for("react.profiler"),Ky=Symbol.for("react.provider"),Gy=Symbol.for("react.context"),Fp=Symbol.for("react.forward_ref"),Fh=Symbol.for("react.suspense"),Bh=Symbol.for("react.suspense_list"),Bp=Symbol.for("react.memo"),gs=Symbol.for("react.lazy"),Qy=Symbol.for("react.offscreen"),Zg=Symbol.iterator;function Sa(e){return e===null||typeof e!="object"?null:(e=Zg&&e[Zg]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Object.assign,Id;function $a(e){if(Id===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Id=t&&t[1]||""}return`
34
+ `+Id+e}var Fd=!1;function Bd(e,t){if(!e||Fd)return"";Fd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
35
+ `),i=n.stack.split(`
36
+ `),l=s.length-1,a=i.length-1;1<=l&&0<=a&&s[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==i[a]){var c=`
37
+ `+s[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=a);break}}}finally{Fd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?$a(e):""}function uE(e){switch(e.tag){case 5:return $a(e.type);case 16:return $a("Lazy");case 13:return $a("Suspense");case 19:return $a("SuspenseList");case 0:case 2:case 15:return e=Bd(e.type,!1),e;case 11:return e=Bd(e.type.render,!1),e;case 1:return e=Bd(e.type,!0),e;default:return""}}function $h(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case co:return"Fragment";case lo:return"Portal";case Ih:return"Profiler";case Ip:return"StrictMode";case Fh:return"Suspense";case Bh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gy:return(e.displayName||"Context")+".Consumer";case Ky:return(e._context.displayName||"Context")+".Provider";case Fp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bp:return t=e.displayName||null,t!==null?t:$h(e.type)||"Memo";case gs:t=e._payload,e=e._init;try{return $h(e(t))}catch{}}return null}function dE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $h(t);case 8:return t===Ip?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ks(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hE(e){var t=Yy(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oc(e){e._valueTracker||(e._valueTracker=hE(e))}function Zy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Yy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Xc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Hh(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Xg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ks(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xy(e,t){t=t.checked,t!=null&&Op(e,"checked",t,!1)}function zh(e,t){Xy(e,t);var r=Ks(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Uh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Uh(e,t.type,Ks(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Uh(e,t,r){(t!=="number"||Xc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ha=Array.isArray;function wo(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Ks(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Wh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ev(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(se(92));if(Ha(r)){if(1<r.length)throw Error(se(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ks(r)}}function Jy(e,t){var r=Ks(t.value),n=Ks(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function tv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function e0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Vh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?e0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ac,t0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ac=ac||document.createElement("div"),ac.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ac.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function al(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ga={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fE=["Webkit","ms","Moz","O"];Object.keys(Ga).forEach(function(e){fE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ga[t]=Ga[e]})});function r0(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ga.hasOwnProperty(e)&&Ga[e]?(""+t).trim():t+"px"}function n0(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=r0(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var pE=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qh(e,t){if(t){if(pE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function Kh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Gh=null;function $p(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qh=null,So=null,Co=null;function rv(e){if(e=Hl(e)){if(typeof Qh!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Zu(t),Qh(e.stateNode,e.type,t))}}function s0(e){So?Co?Co.push(e):Co=[e]:So=e}function i0(){if(So){var e=So,t=Co;if(Co=So=null,rv(e),t)for(e=0;e<t.length;e++)rv(t[e])}}function o0(e,t){return e(t)}function a0(){}var $d=!1;function l0(e,t,r){if($d)return e(t,r);$d=!0;try{return o0(e,t,r)}finally{$d=!1,(So!==null||Co!==null)&&(a0(),i0())}}function ll(e,t){var r=e.stateNode;if(r===null)return null;var n=Zu(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(se(231,t,typeof r));return r}var Yh=!1;if(Yn)try{var Ca={};Object.defineProperty(Ca,"passive",{get:function(){Yh=!0}}),window.addEventListener("test",Ca,Ca),window.removeEventListener("test",Ca,Ca)}catch{Yh=!1}function mE(e,t,r,n,s,i,l,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(g){this.onError(g)}}var Qa=!1,Jc=null,eu=!1,Zh=null,gE={onError:function(e){Qa=!0,Jc=e}};function vE(e,t,r,n,s,i,l,a,c){Qa=!1,Jc=null,mE.apply(gE,arguments)}function _E(e,t,r,n,s,i,l,a,c){if(vE.apply(this,arguments),Qa){if(Qa){var u=Jc;Qa=!1,Jc=null}else throw Error(se(198));eu||(eu=!0,Zh=u)}}function $i(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function c0(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 nv(e){if($i(e)!==e)throw Error(se(188))}function xE(e){var t=e.alternate;if(!t){if(t=$i(e),t===null)throw Error(se(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return nv(s),e;if(i===n)return nv(s),t;i=i.sibling}throw Error(se(188))}if(r.return!==n.return)r=s,n=i;else{for(var l=!1,a=s.child;a;){if(a===r){l=!0,r=s,n=i;break}if(a===n){l=!0,n=s,r=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===r){l=!0,r=i,n=s;break}if(a===n){l=!0,n=i,r=s;break}a=a.sibling}if(!l)throw Error(se(189))}}if(r.alternate!==n)throw Error(se(190))}if(r.tag!==3)throw Error(se(188));return r.stateNode.current===r?e:t}function u0(e){return e=xE(e),e!==null?d0(e):null}function d0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=d0(e);if(t!==null)return t;e=e.sibling}return null}var h0=wr.unstable_scheduleCallback,sv=wr.unstable_cancelCallback,yE=wr.unstable_shouldYield,bE=wr.unstable_requestPaint,vt=wr.unstable_now,wE=wr.unstable_getCurrentPriorityLevel,Hp=wr.unstable_ImmediatePriority,f0=wr.unstable_UserBlockingPriority,tu=wr.unstable_NormalPriority,SE=wr.unstable_LowPriority,p0=wr.unstable_IdlePriority,Ku=null,En=null;function CE(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(Ku,e,void 0,(e.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:jE,kE=Math.log,EE=Math.LN2;function jE(e){return e>>>=0,e===0?32:31-(kE(e)/EE|0)|0}var lc=64,cc=4194304;function za(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ru(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,l=r&268435455;if(l!==0){var a=l&~s;a!==0?n=za(a):(i&=l,i!==0&&(n=za(i)))}else l=r&~s,l!==0?n=za(l):i!==0&&(n=za(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-an(t),s=1<<r,n|=e[r],t&=~s;return n}function NE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function RE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-an(i),a=1<<l,c=s[l];c===-1?(!(a&r)||a&n)&&(s[l]=NE(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Xh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function m0(){var e=lc;return lc<<=1,!(lc&4194240)&&(lc=64),e}function Hd(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Bl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-an(t),e[t]=r}function PE(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-an(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function zp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-an(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ke=0;function g0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var v0,Up,_0,x0,y0,Jh=!1,uc=[],Ms=null,Os=null,Is=null,cl=new Map,ul=new Map,ys=[],TE="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 submit".split(" ");function iv(e,t){switch(e){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Os=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":cl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ul.delete(t.pointerId)}}function ka(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Hl(t),t!==null&&Up(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function AE(e,t,r,n,s){switch(t){case"focusin":return Ms=ka(Ms,e,t,r,n,s),!0;case"dragenter":return Os=ka(Os,e,t,r,n,s),!0;case"mouseover":return Is=ka(Is,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return cl.set(i,ka(cl.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ul.set(i,ka(ul.get(i)||null,e,t,r,n,s)),!0}return!1}function b0(e){var t=hi(e.target);if(t!==null){var r=$i(t);if(r!==null){if(t=r.tag,t===13){if(t=c0(r),t!==null){e.blockedOn=t,y0(e.priority,function(){_0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ef(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Gh=n,r.target.dispatchEvent(n),Gh=null}else return t=Hl(r),t!==null&&Up(t),e.blockedOn=r,!1;t.shift()}return!0}function ov(e,t,r){Ic(e)&&r.delete(t)}function DE(){Jh=!1,Ms!==null&&Ic(Ms)&&(Ms=null),Os!==null&&Ic(Os)&&(Os=null),Is!==null&&Ic(Is)&&(Is=null),cl.forEach(ov),ul.forEach(ov)}function Ea(e,t){e.blockedOn===t&&(e.blockedOn=null,Jh||(Jh=!0,wr.unstable_scheduleCallback(wr.unstable_NormalPriority,DE)))}function dl(e){function t(s){return Ea(s,e)}if(0<uc.length){Ea(uc[0],e);for(var r=1;r<uc.length;r++){var n=uc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ms!==null&&Ea(Ms,e),Os!==null&&Ea(Os,e),Is!==null&&Ea(Is,e),cl.forEach(t),ul.forEach(t),r=0;r<ys.length;r++)n=ys[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ys.length&&(r=ys[0],r.blockedOn===null);)b0(r),r.blockedOn===null&&ys.shift()}var ko=ss.ReactCurrentBatchConfig,nu=!0;function LE(e,t,r,n){var s=Ke,i=ko.transition;ko.transition=null;try{Ke=1,Wp(e,t,r,n)}finally{Ke=s,ko.transition=i}}function ME(e,t,r,n){var s=Ke,i=ko.transition;ko.transition=null;try{Ke=4,Wp(e,t,r,n)}finally{Ke=s,ko.transition=i}}function Wp(e,t,r,n){if(nu){var s=ef(e,t,r,n);if(s===null)Zd(e,t,n,su,r),iv(e,n);else if(AE(s,e,t,r,n))n.stopPropagation();else if(iv(e,n),t&4&&-1<TE.indexOf(e)){for(;s!==null;){var i=Hl(s);if(i!==null&&v0(i),i=ef(e,t,r,n),i===null&&Zd(e,t,n,su,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else Zd(e,t,n,null,r)}}var su=null;function ef(e,t,r,n){if(su=null,e=$p(n),e=hi(e),e!==null)if(t=$i(e),t===null)e=null;else if(r=t.tag,r===13){if(e=c0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return su=e,null}function w0(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(wE()){case Hp:return 1;case f0:return 4;case tu:case SE:return 16;case p0:return 536870912;default:return 16}default:return 16}}var Ts=null,Vp=null,Fc=null;function S0(){if(Fc)return Fc;var e,t=Vp,r=t.length,n,s="value"in Ts?Ts.value:Ts.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[i-n];n++);return Fc=s.slice(e,1<n?1-n:void 0)}function Bc(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 dc(){return!0}function av(){return!1}function jr(e){function t(r,n,s,i,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?dc:av,this.isPropagationStopped=av,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),t}var da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qp=jr(da),$l=ut({},da,{view:0,detail:0}),OE=jr($l),zd,Ud,ja,Gu=ut({},$l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==ja&&(ja&&e.type==="mousemove"?(zd=e.screenX-ja.screenX,Ud=e.screenY-ja.screenY):Ud=zd=0,ja=e),zd)},movementY:function(e){return"movementY"in e?e.movementY:Ud}}),lv=jr(Gu),IE=ut({},Gu,{dataTransfer:0}),FE=jr(IE),BE=ut({},$l,{relatedTarget:0}),Wd=jr(BE),$E=ut({},da,{animationName:0,elapsedTime:0,pseudoElement:0}),HE=jr($E),zE=ut({},da,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),UE=jr(zE),WE=ut({},da,{data:0}),cv=jr(WE),VE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qE={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"},KE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KE[e])?!!t[e]:!1}function Kp(){return GE}var QE=ut({},$l,{key:function(e){if(e.key){var t=VE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(e){return e.type==="keypress"?Bc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),YE=jr(QE),ZE=ut({},Gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uv=jr(ZE),XE=ut({},$l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),JE=jr(XE),ej=ut({},da,{propertyName:0,elapsedTime:0,pseudoElement:0}),tj=jr(ej),rj=ut({},Gu,{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}),nj=jr(rj),sj=[9,13,27,32],Gp=Yn&&"CompositionEvent"in window,Ya=null;Yn&&"documentMode"in document&&(Ya=document.documentMode);var ij=Yn&&"TextEvent"in window&&!Ya,C0=Yn&&(!Gp||Ya&&8<Ya&&11>=Ya),dv=" ",hv=!1;function k0(e,t){switch(e){case"keyup":return sj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function E0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function oj(e,t){switch(e){case"compositionend":return E0(t);case"keypress":return t.which!==32?null:(hv=!0,dv);case"textInput":return e=t.data,e===dv&&hv?null:e;default:return null}}function aj(e,t){if(uo)return e==="compositionend"||!Gp&&k0(e,t)?(e=S0(),Fc=Vp=Ts=null,uo=!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 C0&&t.locale!=="ko"?null:t.data;default:return null}}var lj={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 fv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lj[e.type]:t==="textarea"}function j0(e,t,r,n){s0(n),t=iu(t,"onChange"),0<t.length&&(r=new qp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Za=null,hl=null;function cj(e){F0(e,0)}function Qu(e){var t=po(e);if(Zy(t))return e}function uj(e,t){if(e==="change")return t}var N0=!1;if(Yn){var Vd;if(Yn){var qd="oninput"in document;if(!qd){var pv=document.createElement("div");pv.setAttribute("oninput","return;"),qd=typeof pv.oninput=="function"}Vd=qd}else Vd=!1;N0=Vd&&(!document.documentMode||9<document.documentMode)}function mv(){Za&&(Za.detachEvent("onpropertychange",R0),hl=Za=null)}function R0(e){if(e.propertyName==="value"&&Qu(hl)){var t=[];j0(t,hl,e,$p(e)),l0(cj,t)}}function dj(e,t,r){e==="focusin"?(mv(),Za=t,hl=r,Za.attachEvent("onpropertychange",R0)):e==="focusout"&&mv()}function hj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qu(hl)}function fj(e,t){if(e==="click")return Qu(t)}function pj(e,t){if(e==="input"||e==="change")return Qu(t)}function mj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:mj;function fl(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Oh.call(t,s)||!dn(e[s],t[s]))return!1}return!0}function gv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vv(e,t){var r=gv(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=gv(r)}}function P0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?P0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function T0(){for(var e=window,t=Xc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xc(e.document)}return t}function Qp(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")}function gj(e){var t=T0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&P0(r.ownerDocument.documentElement,r)){if(n!==null&&Qp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=vv(r,i);var l=vv(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vj=Yn&&"documentMode"in document&&11>=document.documentMode,ho=null,tf=null,Xa=null,rf=!1;function _v(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;rf||ho==null||ho!==Xc(n)||(n=ho,"selectionStart"in n&&Qp(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Xa&&fl(Xa,n)||(Xa=n,n=iu(tf,"onSelect"),0<n.length&&(t=new qp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ho)))}function hc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var fo={animationend:hc("Animation","AnimationEnd"),animationiteration:hc("Animation","AnimationIteration"),animationstart:hc("Animation","AnimationStart"),transitionend:hc("Transition","TransitionEnd")},Kd={},A0={};Yn&&(A0=document.createElement("div").style,"AnimationEvent"in window||(delete fo.animationend.animation,delete fo.animationiteration.animation,delete fo.animationstart.animation),"TransitionEvent"in window||delete fo.transitionend.transition);function Yu(e){if(Kd[e])return Kd[e];if(!fo[e])return e;var t=fo[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in A0)return Kd[e]=t[r];return e}var D0=Yu("animationend"),L0=Yu("animationiteration"),M0=Yu("animationstart"),O0=Yu("transitionend"),I0=new Map,xv="abort auxClick 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(" ");function ei(e,t){I0.set(e,t),Bi(t,[e])}for(var Gd=0;Gd<xv.length;Gd++){var Qd=xv[Gd],_j=Qd.toLowerCase(),xj=Qd[0].toUpperCase()+Qd.slice(1);ei(_j,"on"+xj)}ei(D0,"onAnimationEnd");ei(L0,"onAnimationIteration");ei(M0,"onAnimationStart");ei("dblclick","onDoubleClick");ei("focusin","onFocus");ei("focusout","onBlur");ei(O0,"onTransitionEnd");Ko("onMouseEnter",["mouseout","mouseover"]);Ko("onMouseLeave",["mouseout","mouseover"]);Ko("onPointerEnter",["pointerout","pointerover"]);Ko("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="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(" "),yj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ua));function yv(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,_E(n,t,void 0,e),e.currentTarget=null}function F0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var l=n.length-1;0<=l;l--){var a=n[l],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;yv(s,a,u),i=c}else for(l=0;l<n.length;l++){if(a=n[l],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;yv(s,a,u),i=c}}}if(eu)throw e=Zh,eu=!1,Zh=null,e}function rt(e,t){var r=t[lf];r===void 0&&(r=t[lf]=new Set);var n=e+"__bubble";r.has(n)||(B0(t,e,2,!1),r.add(n))}function Yd(e,t,r){var n=0;t&&(n|=4),B0(r,e,n,t)}var fc="_reactListening"+Math.random().toString(36).slice(2);function pl(e){if(!e[fc]){e[fc]=!0,qy.forEach(function(r){r!=="selectionchange"&&(yj.has(r)||Yd(r,!1,e),Yd(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fc]||(t[fc]=!0,Yd("selectionchange",!1,t))}}function B0(e,t,r,n){switch(w0(t)){case 1:var s=LE;break;case 4:s=ME;break;default:s=Wp}r=s.bind(null,t,r,e),s=void 0,!Yh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Zd(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;l=l.return}for(;a!==null;){if(l=hi(a),l===null)return;if(c=l.tag,c===5||c===6){n=i=l;continue e}a=a.parentNode}}n=n.return}l0(function(){var u=i,g=$p(r),d=[];e:{var _=I0.get(e);if(_!==void 0){var v=qp,x=e;switch(e){case"keypress":if(Bc(r)===0)break e;case"keydown":case"keyup":v=YE;break;case"focusin":x="focus",v=Wd;break;case"focusout":x="blur",v=Wd;break;case"beforeblur":case"afterblur":v=Wd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=FE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=JE;break;case D0:case L0:case M0:v=HE;break;case O0:v=tj;break;case"scroll":v=OE;break;case"wheel":v=nj;break;case"copy":case"cut":case"paste":v=UE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=uv}var y=(t&4)!==0,h=!y&&e==="scroll",p=y?_!==null?_+"Capture":null:_;y=[];for(var f=u,m;f!==null;){m=f;var b=m.stateNode;if(m.tag===5&&b!==null&&(m=b,p!==null&&(b=ll(f,p),b!=null&&y.push(ml(f,b,m)))),h)break;f=f.return}0<y.length&&(_=new v(_,x,null,r,g),d.push({event:_,listeners:y}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",_&&r!==Gh&&(x=r.relatedTarget||r.fromElement)&&(hi(x)||x[Zn]))break e;if((v||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,v?(x=r.relatedTarget||r.toElement,v=u,x=x?hi(x):null,x!==null&&(h=$i(x),x!==h||x.tag!==5&&x.tag!==6)&&(x=null)):(v=null,x=u),v!==x)){if(y=lv,b="onMouseLeave",p="onMouseEnter",f="mouse",(e==="pointerout"||e==="pointerover")&&(y=uv,b="onPointerLeave",p="onPointerEnter",f="pointer"),h=v==null?_:po(v),m=x==null?_:po(x),_=new y(b,f+"leave",v,r,g),_.target=h,_.relatedTarget=m,b=null,hi(g)===u&&(y=new y(p,f+"enter",x,r,g),y.target=m,y.relatedTarget=h,b=y),h=b,v&&x)t:{for(y=v,p=x,f=0,m=y;m;m=Yi(m))f++;for(m=0,b=p;b;b=Yi(b))m++;for(;0<f-m;)y=Yi(y),f--;for(;0<m-f;)p=Yi(p),m--;for(;f--;){if(y===p||p!==null&&y===p.alternate)break t;y=Yi(y),p=Yi(p)}y=null}else y=null;v!==null&&bv(d,_,v,y,!1),x!==null&&h!==null&&bv(d,h,x,y,!0)}}e:{if(_=u?po(u):window,v=_.nodeName&&_.nodeName.toLowerCase(),v==="select"||v==="input"&&_.type==="file")var w=uj;else if(fv(_))if(N0)w=pj;else{w=hj;var k=dj}else(v=_.nodeName)&&v.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=fj);if(w&&(w=w(e,u))){j0(d,w,r,g);break e}k&&k(e,_,u),e==="focusout"&&(k=_._wrapperState)&&k.controlled&&_.type==="number"&&Uh(_,"number",_.value)}switch(k=u?po(u):window,e){case"focusin":(fv(k)||k.contentEditable==="true")&&(ho=k,tf=u,Xa=null);break;case"focusout":Xa=tf=ho=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,_v(d,r,g);break;case"selectionchange":if(vj)break;case"keydown":case"keyup":_v(d,r,g)}var E;if(Gp)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else uo?k0(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(C0&&r.locale!=="ko"&&(uo||S!=="onCompositionStart"?S==="onCompositionEnd"&&uo&&(E=S0()):(Ts=g,Vp="value"in Ts?Ts.value:Ts.textContent,uo=!0)),k=iu(u,S),0<k.length&&(S=new cv(S,e,null,r,g),d.push({event:S,listeners:k}),E?S.data=E:(E=E0(r),E!==null&&(S.data=E)))),(E=ij?oj(e,r):aj(e,r))&&(u=iu(u,"onBeforeInput"),0<u.length&&(g=new cv("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:u}),g.data=E))}F0(d,t)})}function ml(e,t,r){return{instance:e,listener:t,currentTarget:r}}function iu(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ll(e,r),i!=null&&n.unshift(ml(e,i,s)),i=ll(e,t),i!=null&&n.push(ml(e,i,s))),e=e.return}return n}function Yi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bv(e,t,r,n,s){for(var i=t._reactName,l=[];r!==null&&r!==n;){var a=r,c=a.alternate,u=a.stateNode;if(c!==null&&c===n)break;a.tag===5&&u!==null&&(a=u,s?(c=ll(r,i),c!=null&&l.unshift(ml(r,c,a))):s||(c=ll(r,i),c!=null&&l.push(ml(r,c,a)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var bj=/\r\n?/g,wj=/\u0000|\uFFFD/g;function wv(e){return(typeof e=="string"?e:""+e).replace(bj,`
38
+ `).replace(wj,"")}function pc(e,t,r){if(t=wv(t),wv(e)!==t&&r)throw Error(se(425))}function ou(){}var nf=null,sf=null;function of(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=typeof setTimeout=="function"?setTimeout:void 0,Sj=typeof clearTimeout=="function"?clearTimeout:void 0,Sv=typeof Promise=="function"?Promise:void 0,Cj=typeof queueMicrotask=="function"?queueMicrotask:typeof Sv<"u"?function(e){return Sv.resolve(null).then(e).catch(kj)}:af;function kj(e){setTimeout(function(){throw e})}function Xd(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),dl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);dl(t)}function Fs(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==="$?")break;if(t==="/$")return null}}return e}function Cv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ha=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ha,gl="__reactProps$"+ha,Zn="__reactContainer$"+ha,lf="__reactEvents$"+ha,Ej="__reactListeners$"+ha,jj="__reactHandles$"+ha;function hi(e){var t=e[Sn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Zn]||r[Sn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Cv(e);e!==null;){if(r=e[Sn])return r;e=Cv(e)}return t}e=r,r=e.parentNode}return null}function Hl(e){return e=e[Sn]||e[Zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function po(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Zu(e){return e[gl]||null}var cf=[],mo=-1;function ti(e){return{current:e}}function st(e){0>mo||(e.current=cf[mo],cf[mo]=null,mo--)}function Xe(e,t){mo++,cf[mo]=e.current,e.current=t}var Gs={},Wt=ti(Gs),ar=ti(!1),Pi=Gs;function Go(e,t){var r=e.type.contextTypes;if(!r)return Gs;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lr(e){return e=e.childContextTypes,e!=null}function au(){st(ar),st(Wt)}function kv(e,t,r){if(Wt.current!==Gs)throw Error(se(168));Xe(Wt,t),Xe(ar,r)}function $0(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(se(108,dE(e)||"Unknown",s));return ut({},r,n)}function lu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gs,Pi=Wt.current,Xe(Wt,e),Xe(ar,ar.current),!0}function Ev(e,t,r){var n=e.stateNode;if(!n)throw Error(se(169));r?(e=$0(e,t,Pi),n.__reactInternalMemoizedMergedChildContext=e,st(ar),st(Wt),Xe(Wt,e)):st(ar),Xe(ar,r)}var $n=null,Xu=!1,Jd=!1;function H0(e){$n===null?$n=[e]:$n.push(e)}function Nj(e){Xu=!0,H0(e)}function ri(){if(!Jd&&$n!==null){Jd=!0;var e=0,t=Ke;try{var r=$n;for(Ke=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}$n=null,Xu=!1}catch(s){throw $n!==null&&($n=$n.slice(e+1)),h0(Hp,ri),s}finally{Ke=t,Jd=!1}}return null}var go=[],vo=0,cu=null,uu=0,Rr=[],Pr=0,Ti=null,Vn=1,qn="";function ui(e,t){go[vo++]=uu,go[vo++]=cu,cu=e,uu=t}function z0(e,t,r){Rr[Pr++]=Vn,Rr[Pr++]=qn,Rr[Pr++]=Ti,Ti=e;var n=Vn;e=qn;var s=32-an(n)-1;n&=~(1<<s),r+=1;var i=32-an(t)+s;if(30<i){var l=s-s%5;i=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Vn=1<<32-an(t)+s|r<<s|n,qn=i+e}else Vn=1<<i|r<<s|n,qn=e}function Yp(e){e.return!==null&&(ui(e,1),z0(e,1,0))}function Zp(e){for(;e===cu;)cu=go[--vo],go[vo]=null,uu=go[--vo],go[vo]=null;for(;e===Ti;)Ti=Rr[--Pr],Rr[Pr]=null,qn=Rr[--Pr],Rr[Pr]=null,Vn=Rr[--Pr],Rr[Pr]=null}var xr=null,_r=null,ot=!1,nn=null;function U0(e,t){var r=Mr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function jv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xr=e,_r=Fs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xr=e,_r=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ti!==null?{id:Vn,overflow:qn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Mr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xr=e,_r=null,!0):!1;default:return!1}}function uf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function df(e){if(ot){var t=_r;if(t){var r=t;if(!jv(e,t)){if(uf(e))throw Error(se(418));t=Fs(r.nextSibling);var n=xr;t&&jv(e,t)?U0(n,r):(e.flags=e.flags&-4097|2,ot=!1,xr=e)}}else{if(uf(e))throw Error(se(418));e.flags=e.flags&-4097|2,ot=!1,xr=e}}}function Nv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xr=e}function mc(e){if(e!==xr)return!1;if(!ot)return Nv(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!of(e.type,e.memoizedProps)),t&&(t=_r)){if(uf(e))throw W0(),Error(se(418));for(;t;)U0(e,t),t=Fs(t.nextSibling)}if(Nv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){_r=Fs(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}_r=null}}else _r=xr?Fs(e.stateNode.nextSibling):null;return!0}function W0(){for(var e=_r;e;)e=Fs(e.nextSibling)}function Qo(){_r=xr=null,ot=!1}function Xp(e){nn===null?nn=[e]:nn.push(e)}var Rj=ss.ReactCurrentBatchConfig;function Na(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(se(309));var n=r.stateNode}if(!n)throw Error(se(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var a=s.refs;l===null?delete a[i]:a[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(se(284));if(!r._owner)throw Error(se(290,e))}return e}function gc(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rv(e){var t=e._init;return t(e._payload)}function V0(e){function t(p,f){if(e){var m=p.deletions;m===null?(p.deletions=[f],p.flags|=16):m.push(f)}}function r(p,f){if(!e)return null;for(;f!==null;)t(p,f),f=f.sibling;return null}function n(p,f){for(p=new Map;f!==null;)f.key!==null?p.set(f.key,f):p.set(f.index,f),f=f.sibling;return p}function s(p,f){return p=zs(p,f),p.index=0,p.sibling=null,p}function i(p,f,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<f?(p.flags|=2,f):m):(p.flags|=2,f)):(p.flags|=1048576,f)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,f,m,b){return f===null||f.tag!==6?(f=oh(m,p.mode,b),f.return=p,f):(f=s(f,m),f.return=p,f)}function c(p,f,m,b){var w=m.type;return w===co?g(p,f,m.props.children,b,m.key):f!==null&&(f.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gs&&Rv(w)===f.type)?(b=s(f,m.props),b.ref=Na(p,f,m),b.return=p,b):(b=qc(m.type,m.key,m.props,null,p.mode,b),b.ref=Na(p,f,m),b.return=p,b)}function u(p,f,m,b){return f===null||f.tag!==4||f.stateNode.containerInfo!==m.containerInfo||f.stateNode.implementation!==m.implementation?(f=ah(m,p.mode,b),f.return=p,f):(f=s(f,m.children||[]),f.return=p,f)}function g(p,f,m,b,w){return f===null||f.tag!==7?(f=Ri(m,p.mode,b,w),f.return=p,f):(f=s(f,m),f.return=p,f)}function d(p,f,m){if(typeof f=="string"&&f!==""||typeof f=="number")return f=oh(""+f,p.mode,m),f.return=p,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case ic:return m=qc(f.type,f.key,f.props,null,p.mode,m),m.ref=Na(p,null,f),m.return=p,m;case lo:return f=ah(f,p.mode,m),f.return=p,f;case gs:var b=f._init;return d(p,b(f._payload),m)}if(Ha(f)||Sa(f))return f=Ri(f,p.mode,m,null),f.return=p,f;gc(p,f)}return null}function _(p,f,m,b){var w=f!==null?f.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(p,f,""+m,b);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ic:return m.key===w?c(p,f,m,b):null;case lo:return m.key===w?u(p,f,m,b):null;case gs:return w=m._init,_(p,f,w(m._payload),b)}if(Ha(m)||Sa(m))return w!==null?null:g(p,f,m,b,null);gc(p,m)}return null}function v(p,f,m,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return p=p.get(m)||null,a(f,p,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ic:return p=p.get(b.key===null?m:b.key)||null,c(f,p,b,w);case lo:return p=p.get(b.key===null?m:b.key)||null,u(f,p,b,w);case gs:var k=b._init;return v(p,f,m,k(b._payload),w)}if(Ha(b)||Sa(b))return p=p.get(m)||null,g(f,p,b,w,null);gc(f,b)}return null}function x(p,f,m,b){for(var w=null,k=null,E=f,S=f=0,j=null;E!==null&&S<m.length;S++){E.index>S?(j=E,E=null):j=E.sibling;var R=_(p,E,m[S],b);if(R===null){E===null&&(E=j);break}e&&E&&R.alternate===null&&t(p,E),f=i(R,f,S),k===null?w=R:k.sibling=R,k=R,E=j}if(S===m.length)return r(p,E),ot&&ui(p,S),w;if(E===null){for(;S<m.length;S++)E=d(p,m[S],b),E!==null&&(f=i(E,f,S),k===null?w=E:k.sibling=E,k=E);return ot&&ui(p,S),w}for(E=n(p,E);S<m.length;S++)j=v(E,p,S,m[S],b),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?S:j.key),f=i(j,f,S),k===null?w=j:k.sibling=j,k=j);return e&&E.forEach(function(M){return t(p,M)}),ot&&ui(p,S),w}function y(p,f,m,b){var w=Sa(m);if(typeof w!="function")throw Error(se(150));if(m=w.call(m),m==null)throw Error(se(151));for(var k=w=null,E=f,S=f=0,j=null,R=m.next();E!==null&&!R.done;S++,R=m.next()){E.index>S?(j=E,E=null):j=E.sibling;var M=_(p,E,R.value,b);if(M===null){E===null&&(E=j);break}e&&E&&M.alternate===null&&t(p,E),f=i(M,f,S),k===null?w=M:k.sibling=M,k=M,E=j}if(R.done)return r(p,E),ot&&ui(p,S),w;if(E===null){for(;!R.done;S++,R=m.next())R=d(p,R.value,b),R!==null&&(f=i(R,f,S),k===null?w=R:k.sibling=R,k=R);return ot&&ui(p,S),w}for(E=n(p,E);!R.done;S++,R=m.next())R=v(E,p,S,R.value,b),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?S:R.key),f=i(R,f,S),k===null?w=R:k.sibling=R,k=R);return e&&E.forEach(function(T){return t(p,T)}),ot&&ui(p,S),w}function h(p,f,m,b){if(typeof m=="object"&&m!==null&&m.type===co&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ic:e:{for(var w=m.key,k=f;k!==null;){if(k.key===w){if(w=m.type,w===co){if(k.tag===7){r(p,k.sibling),f=s(k,m.props.children),f.return=p,p=f;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gs&&Rv(w)===k.type){r(p,k.sibling),f=s(k,m.props),f.ref=Na(p,k,m),f.return=p,p=f;break e}r(p,k);break}else t(p,k);k=k.sibling}m.type===co?(f=Ri(m.props.children,p.mode,b,m.key),f.return=p,p=f):(b=qc(m.type,m.key,m.props,null,p.mode,b),b.ref=Na(p,f,m),b.return=p,p=b)}return l(p);case lo:e:{for(k=m.key;f!==null;){if(f.key===k)if(f.tag===4&&f.stateNode.containerInfo===m.containerInfo&&f.stateNode.implementation===m.implementation){r(p,f.sibling),f=s(f,m.children||[]),f.return=p,p=f;break e}else{r(p,f);break}else t(p,f);f=f.sibling}f=ah(m,p.mode,b),f.return=p,p=f}return l(p);case gs:return k=m._init,h(p,f,k(m._payload),b)}if(Ha(m))return x(p,f,m,b);if(Sa(m))return y(p,f,m,b);gc(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,f!==null&&f.tag===6?(r(p,f.sibling),f=s(f,m),f.return=p,p=f):(r(p,f),f=oh(m,p.mode,b),f.return=p,p=f),l(p)):r(p,f)}return h}var Yo=V0(!0),q0=V0(!1),du=ti(null),hu=null,_o=null,Jp=null;function em(){Jp=_o=hu=null}function tm(e){var t=du.current;st(du),e._currentValue=t}function hf(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Eo(e,t){hu=e,Jp=_o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(or=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(Jp!==e)if(e={context:e,memoizedValue:t,next:null},_o===null){if(hu===null)throw Error(se(308));_o=e,hu.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var fi=null;function rm(e){fi===null?fi=[e]:fi.push(e)}function K0(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,rm(t)):(r.next=s.next,s.next=r),t.interleaved=r,Xn(e,n)}function Xn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var vs=!1;function nm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function G0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ie&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Xn(e,r)}return s=n.interleaved,s===null?(t.next=t,rm(n)):(t.next=s.next,s.next=t),n.interleaved=t,Xn(e,r)}function $c(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,zp(e,r)}}function Pv(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=l:i=i.next=l,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function fu(e,t,r,n){var s=e.updateQueue;vs=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==l&&(a===null?g.firstBaseUpdate=u:a.next=u,g.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;l=0,g=u=c=null,a=i;do{var _=a.lane,v=a.eventTime;if((n&_)===_){g!==null&&(g=g.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,y=a;switch(_=t,v=r,y.tag){case 1:if(x=y.payload,typeof x=="function"){d=x.call(v,d,_);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,_=typeof x=="function"?x.call(v,d,_):x,_==null)break e;d=ut({},d,_);break e;case 2:vs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,_=s.effects,_===null?s.effects=[a]:_.push(a))}else v={eventTime:v,lane:_,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(u=g=v,c=d):g=g.next=v,l|=_;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;_=a,a=_.next,_.next=null,s.lastBaseUpdate=_,s.shared.pending=null}}while(!0);if(g===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=g,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Di|=l,e.lanes=l,e.memoizedState=d}}function Tv(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(se(191,s));s.call(n)}}}var zl={},jn=ti(zl),vl=ti(zl),_l=ti(zl);function pi(e){if(e===zl)throw Error(se(174));return e}function sm(e,t){switch(Xe(_l,t),Xe(vl,e),Xe(jn,zl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vh(t,e)}st(jn),Xe(jn,t)}function Zo(){st(jn),st(vl),st(_l)}function Q0(e){pi(_l.current);var t=pi(jn.current),r=Vh(t,e.type);t!==r&&(Xe(vl,e),Xe(jn,r))}function im(e){vl.current===e&&(st(jn),st(vl))}var at=ti(0);function pu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 eh=[];function om(){for(var e=0;e<eh.length;e++)eh[e]._workInProgressVersionPrimary=null;eh.length=0}var Hc=ss.ReactCurrentDispatcher,th=ss.ReactCurrentBatchConfig,Ai=0,ct=null,wt=null,jt=null,mu=!1,Ja=!1,xl=0,Pj=0;function Ot(){throw Error(se(321))}function am(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!dn(e[r],t[r]))return!1;return!0}function lm(e,t,r,n,s,i){if(Ai=i,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hc.current=e===null||e.memoizedState===null?Lj:Mj,e=r(n,s),Ja){i=0;do{if(Ja=!1,xl=0,25<=i)throw Error(se(301));i+=1,jt=wt=null,t.updateQueue=null,Hc.current=Oj,e=r(n,s)}while(Ja)}if(Hc.current=gu,t=wt!==null&&wt.next!==null,Ai=0,jt=wt=ct=null,mu=!1,t)throw Error(se(300));return e}function cm(){var e=xl!==0;return xl=0,e}function xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?ct.memoizedState=jt=e:jt=jt.next=e,jt}function zr(){if(wt===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=wt.next;var t=jt===null?ct.memoizedState:jt.next;if(t!==null)jt=t,wt=e;else{if(e===null)throw Error(se(310));wt=e,e={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},jt===null?ct.memoizedState=jt=e:jt=jt.next=e}return jt}function yl(e,t){return typeof t=="function"?t(e):t}function rh(e){var t=zr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=wt,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var l=s.next;s.next=i.next,i.next=l}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=l=null,c=null,u=i;do{var g=u.lane;if((Ai&g)===g)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:g,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,l=n):c=c.next=d,ct.lanes|=g,Di|=g}u=u.next}while(u!==null&&u!==i);c===null?l=n:c.next=a,dn(n,t.memoizedState)||(or=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,ct.lanes|=i,Di|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function nh(e){var t=zr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do i=e(i,l.action),l=l.next;while(l!==s);dn(i,t.memoizedState)||(or=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function Y0(){}function Z0(e,t){var r=ct,n=zr(),s=t(),i=!dn(n.memoizedState,s);if(i&&(n.memoizedState=s,or=!0),n=n.queue,um(eb.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||jt!==null&&jt.memoizedState.tag&1){if(r.flags|=2048,bl(9,J0.bind(null,r,n,s,t),void 0,null),Nt===null)throw Error(se(349));Ai&30||X0(r,t,s)}return s}function X0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function J0(e,t,r,n){t.value=r,t.getSnapshot=n,tb(t)&&rb(e)}function eb(e,t,r){return r(function(){tb(t)&&rb(e)})}function tb(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dn(e,r)}catch{return!0}}function rb(e){var t=Xn(e,1);t!==null&&ln(t,e,1,-1)}function Av(e){var t=xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:e},t.queue=e,e=e.dispatch=Dj.bind(null,ct,e),[t.memoizedState,e]}function bl(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function nb(){return zr().memoizedState}function zc(e,t,r,n){var s=xn();ct.flags|=e,s.memoizedState=bl(1|t,r,void 0,n===void 0?null:n)}function Ju(e,t,r,n){var s=zr();n=n===void 0?null:n;var i=void 0;if(wt!==null){var l=wt.memoizedState;if(i=l.destroy,n!==null&&am(n,l.deps)){s.memoizedState=bl(t,r,i,n);return}}ct.flags|=e,s.memoizedState=bl(1|t,r,i,n)}function Dv(e,t){return zc(8390656,8,e,t)}function um(e,t){return Ju(2048,8,e,t)}function sb(e,t){return Ju(4,2,e,t)}function ib(e,t){return Ju(4,4,e,t)}function ob(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ab(e,t,r){return r=r!=null?r.concat([e]):null,Ju(4,4,ob.bind(null,t,e),r)}function dm(){}function lb(e,t){var r=zr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&am(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function cb(e,t){var r=zr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&am(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function ub(e,t,r){return Ai&21?(dn(r,t)||(r=m0(),ct.lanes|=r,Di|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,or=!0),e.memoizedState=r)}function Tj(e,t){var r=Ke;Ke=r!==0&&4>r?r:4,e(!0);var n=th.transition;th.transition={};try{e(!1),t()}finally{Ke=r,th.transition=n}}function db(){return zr().memoizedState}function Aj(e,t,r){var n=Hs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},hb(e))fb(t,r);else if(r=K0(e,t,r,n),r!==null){var s=Yt();ln(r,e,n,s),pb(r,t,n)}}function Dj(e,t,r){var n=Hs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(hb(e))fb(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,r);if(s.hasEagerState=!0,s.eagerState=a,dn(a,l)){var c=t.interleaved;c===null?(s.next=s,rm(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=K0(e,t,s,n),r!==null&&(s=Yt(),ln(r,e,n,s),pb(r,t,n))}}function hb(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function fb(e,t){Ja=mu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function pb(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,zp(e,r)}}var gu={readContext:Hr,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},Lj={readContext:Hr,useCallback:function(e,t){return xn().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:Dv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,zc(4194308,4,ob.bind(null,t,e),r)},useLayoutEffect:function(e,t){return zc(4194308,4,e,t)},useInsertionEffect:function(e,t){return zc(4,2,e,t)},useMemo:function(e,t){var r=xn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=xn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Aj.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=xn();return e={current:e},t.memoizedState=e},useState:Av,useDebugValue:dm,useDeferredValue:function(e){return xn().memoizedState=e},useTransition:function(){var e=Av(!1),t=e[0];return e=Tj.bind(null,e[1]),xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,s=xn();if(ot){if(r===void 0)throw Error(se(407));r=r()}else{if(r=t(),Nt===null)throw Error(se(349));Ai&30||X0(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,Dv(eb.bind(null,n,i,e),[e]),n.flags|=2048,bl(9,J0.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=xn(),t=Nt.identifierPrefix;if(ot){var r=qn,n=Vn;r=(n&~(1<<32-an(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=xl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Pj++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mj={readContext:Hr,useCallback:lb,useContext:Hr,useEffect:um,useImperativeHandle:ab,useInsertionEffect:sb,useLayoutEffect:ib,useMemo:cb,useReducer:rh,useRef:nb,useState:function(){return rh(yl)},useDebugValue:dm,useDeferredValue:function(e){var t=zr();return ub(t,wt.memoizedState,e)},useTransition:function(){var e=rh(yl)[0],t=zr().memoizedState;return[e,t]},useMutableSource:Y0,useSyncExternalStore:Z0,useId:db,unstable_isNewReconciler:!1},Oj={readContext:Hr,useCallback:lb,useContext:Hr,useEffect:um,useImperativeHandle:ab,useInsertionEffect:sb,useLayoutEffect:ib,useMemo:cb,useReducer:nh,useRef:nb,useState:function(){return nh(yl)},useDebugValue:dm,useDeferredValue:function(e){var t=zr();return wt===null?t.memoizedState=e:ub(t,wt.memoizedState,e)},useTransition:function(){var e=nh(yl)[0],t=zr().memoizedState;return[e,t]},useMutableSource:Y0,useSyncExternalStore:Z0,useId:db,unstable_isNewReconciler:!1};function en(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ff(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ed={isMounted:function(e){return(e=e._reactInternals)?$i(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Yt(),s=Hs(e),i=Kn(n,s);i.payload=t,r!=null&&(i.callback=r),t=Bs(e,i,s),t!==null&&(ln(t,e,s,n),$c(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Yt(),s=Hs(e),i=Kn(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Bs(e,i,s),t!==null&&(ln(t,e,s,n),$c(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Yt(),n=Hs(e),s=Kn(r,n);s.tag=2,t!=null&&(s.callback=t),t=Bs(e,s,n),t!==null&&(ln(t,e,n,r),$c(t,e,n))}};function Lv(e,t,r,n,s,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,l):t.prototype&&t.prototype.isPureReactComponent?!fl(r,n)||!fl(s,i):!0}function mb(e,t,r){var n=!1,s=Gs,i=t.contextType;return typeof i=="object"&&i!==null?i=Hr(i):(s=lr(t)?Pi:Wt.current,n=t.contextTypes,i=(n=n!=null)?Go(e,s):Gs),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ed,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Mv(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ed.enqueueReplaceState(t,t.state,null)}function pf(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},nm(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Hr(i):(i=lr(t)?Pi:Wt.current,s.context=Go(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ff(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ed.enqueueReplaceState(s,s.state,null),fu(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Xo(e,t){try{var r="",n=t;do r+=uE(n),n=n.return;while(n);var s=r}catch(i){s=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:s,digest:null}}function sh(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function mf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Ij=typeof WeakMap=="function"?WeakMap:Map;function gb(e,t,r){r=Kn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){_u||(_u=!0,kf=n),mf(e,t)},r}function vb(e,t,r){r=Kn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){mf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){mf(e,t),typeof n!="function"&&($s===null?$s=new Set([this]):$s.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function Ov(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Ij;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=Zj.bind(null,e,t,r),t.then(e,e))}function Iv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Fv(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Kn(-1,1),t.tag=2,Bs(r,t,1))),r.lanes|=1),e)}var Fj=ss.ReactCurrentOwner,or=!1;function Gt(e,t,r,n){t.child=e===null?q0(t,null,r,n):Yo(t,e.child,r,n)}function Bv(e,t,r,n,s){r=r.render;var i=t.ref;return Eo(t,s),n=lm(e,t,r,n,i,s),r=cm(),e!==null&&!or?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jn(e,t,s)):(ot&&r&&Yp(t),t.flags|=1,Gt(e,t,n,s),t.child)}function $v(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!xm(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,_b(e,t,i,n,s)):(e=qc(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var l=i.memoizedProps;if(r=r.compare,r=r!==null?r:fl,r(l,n)&&e.ref===t.ref)return Jn(e,t,s)}return t.flags|=1,e=zs(i,n),e.ref=t.ref,e.return=t,t.child=e}function _b(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(fl(i,n)&&e.ref===t.ref)if(or=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(or=!0);else return t.lanes=e.lanes,Jn(e,t,s)}return gf(e,t,r,n,s)}function xb(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(yo,hr),hr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xe(yo,hr),hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Xe(yo,hr),hr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Xe(yo,hr),hr|=n;return Gt(e,t,s,r),t.child}function yb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function gf(e,t,r,n,s){var i=lr(r)?Pi:Wt.current;return i=Go(t,i),Eo(t,s),r=lm(e,t,r,n,i,s),n=cm(),e!==null&&!or?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jn(e,t,s)):(ot&&n&&Yp(t),t.flags|=1,Gt(e,t,r,s),t.child)}function Hv(e,t,r,n,s){if(lr(r)){var i=!0;lu(t)}else i=!1;if(Eo(t,s),t.stateNode===null)Uc(e,t),mb(t,r,n),pf(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var c=l.context,u=r.contextType;typeof u=="object"&&u!==null?u=Hr(u):(u=lr(r)?Pi:Wt.current,u=Go(t,u));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==n||c!==u)&&Mv(t,l,n,u),vs=!1;var _=t.memoizedState;l.state=_,fu(t,n,l,s),c=t.memoizedState,a!==n||_!==c||ar.current||vs?(typeof g=="function"&&(ff(t,r,g,n),c=t.memoizedState),(a=vs||Lv(t,r,a,n,_,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),l.props=n,l.state=c,l.context=u,n=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,G0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:en(t.type,a),l.props=u,d=t.pendingProps,_=l.context,c=r.contextType,typeof c=="object"&&c!==null?c=Hr(c):(c=lr(r)?Pi:Wt.current,c=Go(t,c));var v=r.getDerivedStateFromProps;(g=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==d||_!==c)&&Mv(t,l,n,c),vs=!1,_=t.memoizedState,l.state=_,fu(t,n,l,s);var x=t.memoizedState;a!==d||_!==x||ar.current||vs?(typeof v=="function"&&(ff(t,r,v,n),x=t.memoizedState),(u=vs||Lv(t,r,u,n,_,x,c)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,x,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,x,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),l.props=n,l.state=x,l.context=c,n=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),n=!1)}return vf(e,t,r,n,i,s)}function vf(e,t,r,n,s,i){yb(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&Ev(t,r,!1),Jn(e,t,i);n=t.stateNode,Fj.current=t;var a=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=Yo(t,e.child,null,i),t.child=Yo(t,null,a,i)):Gt(e,t,a,i),t.memoizedState=n.state,s&&Ev(t,r,!0),t.child}function bb(e){var t=e.stateNode;t.pendingContext?kv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&kv(e,t.context,!1),sm(e,t.containerInfo)}function zv(e,t,r,n,s){return Qo(),Xp(s),t.flags|=256,Gt(e,t,r,n),t.child}var _f={dehydrated:null,treeContext:null,retryLane:0};function xf(e){return{baseLanes:e,cachePool:null,transitions:null}}function wb(e,t,r){var n=t.pendingProps,s=at.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Xe(at,s&1),e===null)return df(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,i?(n=t.mode,i=t.child,l={mode:"hidden",children:l},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=nd(l,n,0,null),e=Ri(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=xf(r),t.memoizedState=_f,e):hm(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Bj(e,t,l,n,a,s,r);if(i){i=n.fallback,l=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=zs(s,c),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zs(a,i):(i=Ri(i,l,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,l=e.child.memoizedState,l=l===null?xf(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~r,t.memoizedState=_f,n}return i=e.child,e=i.sibling,n=zs(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function hm(e,t){return t=nd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vc(e,t,r,n){return n!==null&&Xp(n),Yo(t,e.child,null,r),e=hm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bj(e,t,r,n,s,i,l){if(r)return t.flags&256?(t.flags&=-257,n=sh(Error(se(422))),vc(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=nd({mode:"visible",children:n.children},s,0,null),i=Ri(i,s,l,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Yo(t,e.child,null,l),t.child.memoizedState=xf(l),t.memoizedState=_f,i);if(!(t.mode&1))return vc(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(se(419)),n=sh(i,n,void 0),vc(e,t,l,n)}if(a=(l&e.childLanes)!==0,or||a){if(n=Nt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Xn(e,s),ln(n,e,s,-1))}return _m(),n=sh(Error(se(421))),vc(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Xj.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,_r=Fs(s.nextSibling),xr=t,ot=!0,nn=null,e!==null&&(Rr[Pr++]=Vn,Rr[Pr++]=qn,Rr[Pr++]=Ti,Vn=e.id,qn=e.overflow,Ti=t),t=hm(t,n.children),t.flags|=4096,t)}function Uv(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),hf(e.return,t,r)}function ih(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function Sb(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(Gt(e,t,n.children,r),n=at.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uv(e,r,t);else if(e.tag===19)Uv(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Xe(at,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&pu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),ih(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&pu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}ih(t,!0,r,null,i);break;case"together":ih(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Uc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,r=zs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function $j(e,t,r){switch(t.tag){case 3:bb(t),Qo();break;case 5:Q0(t);break;case 1:lr(t.type)&&lu(t);break;case 4:sm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Xe(du,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Xe(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?wb(e,t,r):(Xe(at,at.current&1),e=Jn(e,t,r),e!==null?e.sibling:null);Xe(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Sb(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Xe(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,xb(e,t,r)}return Jn(e,t,r)}var Cb,yf,kb,Eb;Cb=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};yf=function(){};kb=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,pi(jn.current);var i=null;switch(r){case"input":s=Hh(e,s),n=Hh(e,n),i=[];break;case"select":s=ut({},s,{value:void 0}),n=ut({},n,{value:void 0}),i=[];break;case"textarea":s=Wh(e,s),n=Wh(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=ou)}qh(r,n);var l;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(l in a)a.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ol.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(a=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in c)c.hasOwnProperty(l)&&a[l]!==c[l]&&(r||(r={}),r[l]=c[l])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ol.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&rt("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Eb=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ra(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function It(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Hj(e,t,r){var n=t.pendingProps;switch(Zp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(t),null;case 1:return lr(t.type)&&au(),It(t),null;case 3:return n=t.stateNode,Zo(),st(ar),st(Wt),om(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(mc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nn!==null&&(Nf(nn),nn=null))),yf(e,t),It(t),null;case 5:im(t);var s=pi(_l.current);if(r=t.type,e!==null&&t.stateNode!=null)kb(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(se(166));return It(t),null}if(e=pi(jn.current),mc(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Sn]=t,n[gl]=i,e=(t.mode&1)!==0,r){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(s=0;s<Ua.length;s++)rt(Ua[s],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":Xg(n,i),rt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},rt("invalid",n);break;case"textarea":ev(n,i),rt("invalid",n)}qh(r,i),s=null;for(var l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&pc(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&pc(n.textContent,a,e),s=["children",""+a]):ol.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&rt("scroll",n)}switch(r){case"input":oc(n),Jg(n,i,!0);break;case"textarea":oc(n),tv(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=ou)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=e0(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Sn]=t,e[gl]=n,Cb(e,t,!1,!1),t.stateNode=e;e:{switch(l=Kh(r,n),r){case"dialog":rt("cancel",e),rt("close",e),s=n;break;case"iframe":case"object":case"embed":rt("load",e),s=n;break;case"video":case"audio":for(s=0;s<Ua.length;s++)rt(Ua[s],e);s=n;break;case"source":rt("error",e),s=n;break;case"img":case"image":case"link":rt("error",e),rt("load",e),s=n;break;case"details":rt("toggle",e),s=n;break;case"input":Xg(e,n),s=Hh(e,n),rt("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ut({},n,{value:void 0}),rt("invalid",e);break;case"textarea":ev(e,n),s=Wh(e,n),rt("invalid",e);break;default:s=n}qh(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?n0(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&t0(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&al(e,c):typeof c=="number"&&al(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ol.hasOwnProperty(i)?c!=null&&i==="onScroll"&&rt("scroll",e):c!=null&&Op(e,i,c,l))}switch(r){case"input":oc(e),Jg(e,n,!1);break;case"textarea":oc(e),tv(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ks(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?wo(e,!!n.multiple,i,!1):n.defaultValue!=null&&wo(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ou)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return It(t),null;case 6:if(e&&t.stateNode!=null)Eb(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(se(166));if(r=pi(_l.current),pi(jn.current),mc(t)){if(n=t.stateNode,r=t.memoizedProps,n[Sn]=t,(i=n.nodeValue!==r)&&(e=xr,e!==null))switch(e.tag){case 3:pc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pc(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Sn]=t,t.stateNode=n}return It(t),null;case 13:if(st(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&_r!==null&&t.mode&1&&!(t.flags&128))W0(),Qo(),t.flags|=98560,i=!1;else if(i=mc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(se(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(se(317));i[Sn]=t}else Qo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;It(t),i=!1}else nn!==null&&(Nf(nn),nn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?Ct===0&&(Ct=3):_m())),t.updateQueue!==null&&(t.flags|=4),It(t),null);case 4:return Zo(),yf(e,t),e===null&&pl(t.stateNode.containerInfo),It(t),null;case 10:return tm(t.type._context),It(t),null;case 17:return lr(t.type)&&au(),It(t),null;case 19:if(st(at),i=t.memoizedState,i===null)return It(t),null;if(n=(t.flags&128)!==0,l=i.rendering,l===null)if(n)Ra(i,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=pu(e),l!==null){for(t.flags|=128,Ra(i,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Xe(at,at.current&1|2),t.child}e=e.sibling}i.tail!==null&&vt()>Jo&&(t.flags|=128,n=!0,Ra(i,!1),t.lanes=4194304)}else{if(!n)if(e=pu(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ra(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!ot)return It(t),null}else 2*vt()-i.renderingStartTime>Jo&&r!==1073741824&&(t.flags|=128,n=!0,Ra(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(r=i.last,r!==null?r.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Xe(at,n?r&1|2:r&1),t):(It(t),null);case 22:case 23:return vm(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?hr&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function zj(e,t){switch(Zp(t),t.tag){case 1:return lr(t.type)&&au(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zo(),st(ar),st(Wt),om(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return im(t),null;case 13:if(st(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(at),null;case 4:return Zo(),null;case 10:return tm(t.type._context),null;case 22:case 23:return vm(),null;case 24:return null;default:return null}}var _c=!1,$t=!1,Uj=typeof WeakSet=="function"?WeakSet:Set,pe=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function bf(e,t,r){try{r()}catch(n){ft(e,t,n)}}var Wv=!1;function Wj(e,t){if(nf=nu,e=T0(),Qp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var l=0,a=-1,c=-1,u=0,g=0,d=e,_=null;t:for(;;){for(var v;d!==r||s!==0&&d.nodeType!==3||(a=l+s),d!==i||n!==0&&d.nodeType!==3||(c=l+n),d.nodeType===3&&(l+=d.nodeValue.length),(v=d.firstChild)!==null;)_=d,d=v;for(;;){if(d===e)break t;if(_===r&&++u===s&&(a=l),_===i&&++g===n&&(c=l),(v=d.nextSibling)!==null)break;d=_,_=d.parentNode}d=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(sf={focusedElem:e,selectionRange:r},nu=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,h=x.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:en(t.type,y),h);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(b){ft(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return x=Wv,Wv=!1,x}function el(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&bf(t,r,i)}s=s.next}while(s!==n)}}function td(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function wf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function jb(e){var t=e.alternate;t!==null&&(e.alternate=null,jb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sn],delete t[gl],delete t[lf],delete t[Ej],delete t[jj])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nb(e){return e.tag===5||e.tag===3||e.tag===4}function Vv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nb(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ou));else if(n!==4&&(e=e.child,e!==null))for(Sf(e,t,r),e=e.sibling;e!==null;)Sf(e,t,r),e=e.sibling}function Cf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cf(e,t,r),e=e.sibling;e!==null;)Cf(e,t,r),e=e.sibling}var Tt=null,rn=!1;function ds(e,t,r){for(r=r.child;r!==null;)Rb(e,t,r),r=r.sibling}function Rb(e,t,r){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(Ku,r)}catch{}switch(r.tag){case 5:$t||xo(r,t);case 6:var n=Tt,s=rn;Tt=null,ds(e,t,r),Tt=n,rn=s,Tt!==null&&(rn?(e=Tt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Tt.removeChild(r.stateNode));break;case 18:Tt!==null&&(rn?(e=Tt,r=r.stateNode,e.nodeType===8?Xd(e.parentNode,r):e.nodeType===1&&Xd(e,r),dl(e)):Xd(Tt,r.stateNode));break;case 4:n=Tt,s=rn,Tt=r.stateNode.containerInfo,rn=!0,ds(e,t,r),Tt=n,rn=s;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&bf(r,t,l),s=s.next}while(s!==n)}ds(e,t,r);break;case 1:if(!$t&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ft(r,t,a)}ds(e,t,r);break;case 21:ds(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ds(e,t,r),$t=n):ds(e,t,r);break;default:ds(e,t,r)}}function qv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Uj),t.forEach(function(n){var s=Jj.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Zr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Tt=a.stateNode,rn=!1;break e;case 3:Tt=a.stateNode.containerInfo,rn=!0;break e;case 4:Tt=a.stateNode.containerInfo,rn=!0;break e}a=a.return}if(Tt===null)throw Error(se(160));Rb(i,l,s),Tt=null,rn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){ft(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pb(t,e),t=t.sibling}function Pb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zr(t,e),_n(e),n&4){try{el(3,e,e.return),td(3,e)}catch(y){ft(e,e.return,y)}try{el(5,e,e.return)}catch(y){ft(e,e.return,y)}}break;case 1:Zr(t,e),_n(e),n&512&&r!==null&&xo(r,r.return);break;case 5:if(Zr(t,e),_n(e),n&512&&r!==null&&xo(r,r.return),e.flags&32){var s=e.stateNode;try{al(s,"")}catch(y){ft(e,e.return,y)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,l=r!==null?r.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Xy(s,i),Kh(a,l);var u=Kh(a,i);for(l=0;l<c.length;l+=2){var g=c[l],d=c[l+1];g==="style"?n0(s,d):g==="dangerouslySetInnerHTML"?t0(s,d):g==="children"?al(s,d):Op(s,g,d,u)}switch(a){case"input":zh(s,i);break;case"textarea":Jy(s,i);break;case"select":var _=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?wo(s,!!i.multiple,v,!1):_!==!!i.multiple&&(i.defaultValue!=null?wo(s,!!i.multiple,i.defaultValue,!0):wo(s,!!i.multiple,i.multiple?[]:"",!1))}s[gl]=i}catch(y){ft(e,e.return,y)}}break;case 6:if(Zr(t,e),_n(e),n&4){if(e.stateNode===null)throw Error(se(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){ft(e,e.return,y)}}break;case 3:if(Zr(t,e),_n(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{dl(t.containerInfo)}catch(y){ft(e,e.return,y)}break;case 4:Zr(t,e),_n(e);break;case 13:Zr(t,e),_n(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(mm=vt())),n&4&&qv(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?($t=(u=$t)||g,Zr(t,e),$t=u):Zr(t,e),_n(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!g&&e.mode&1)for(pe=e,g=e.child;g!==null;){for(d=pe=g;pe!==null;){switch(_=pe,v=_.child,_.tag){case 0:case 11:case 14:case 15:el(4,_,_.return);break;case 1:xo(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){n=_,r=_.return;try{t=n,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(y){ft(n,r,y)}}break;case 5:xo(_,_.return);break;case 22:if(_.memoizedState!==null){Gv(d);continue}}v!==null?(v.return=_,pe=v):Gv(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=r0("display",l))}catch(y){ft(e,e.return,y)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){ft(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Zr(t,e),_n(e),n&4&&qv(e);break;case 21:break;default:Zr(t,e),_n(e)}}function _n(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Nb(r)){var n=r;break e}r=r.return}throw Error(se(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(al(s,""),n.flags&=-33);var i=Vv(e);Cf(e,i,s);break;case 3:case 4:var l=n.stateNode.containerInfo,a=Vv(e);Sf(e,a,l);break;default:throw Error(se(161))}}catch(c){ft(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vj(e,t,r){pe=e,Tb(e)}function Tb(e,t,r){for(var n=(e.mode&1)!==0;pe!==null;){var s=pe,i=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||_c;if(!l){var a=s.alternate,c=a!==null&&a.memoizedState!==null||$t;a=_c;var u=$t;if(_c=l,($t=c)&&!u)for(pe=s;pe!==null;)l=pe,c=l.child,l.tag===22&&l.memoizedState!==null?Qv(s):c!==null?(c.return=l,pe=c):Qv(s);for(;i!==null;)pe=i,Tb(i),i=i.sibling;pe=s,_c=a,$t=u}Kv(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,pe=i):Kv(e)}}function Kv(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$t||td(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!$t)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:en(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Tv(t,i,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Tv(t,l,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var g=u.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&dl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}$t||t.flags&512&&wf(t)}catch(_){ft(t,t.return,_)}}if(t===e){pe=null;break}if(r=t.sibling,r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Gv(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Qv(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{td(4,t)}catch(c){ft(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){ft(t,s,c)}}var i=t.return;try{wf(t)}catch(c){ft(t,i,c)}break;case 5:var l=t.return;try{wf(t)}catch(c){ft(t,l,c)}}}catch(c){ft(t,t.return,c)}if(t===e){pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,pe=a;break}pe=t.return}}var qj=Math.ceil,vu=ss.ReactCurrentDispatcher,fm=ss.ReactCurrentOwner,Ir=ss.ReactCurrentBatchConfig,Ie=0,Nt=null,bt=null,Dt=0,hr=0,yo=ti(0),Ct=0,wl=null,Di=0,rd=0,pm=0,tl=null,ir=null,mm=0,Jo=1/0,Fn=null,_u=!1,kf=null,$s=null,xc=!1,As=null,xu=0,rl=0,Ef=null,Wc=-1,Vc=0;function Yt(){return Ie&6?vt():Wc!==-1?Wc:Wc=vt()}function Hs(e){return e.mode&1?Ie&2&&Dt!==0?Dt&-Dt:Rj.transition!==null?(Vc===0&&(Vc=m0()),Vc):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:w0(e.type)),e):1}function ln(e,t,r,n){if(50<rl)throw rl=0,Ef=null,Error(se(185));Bl(e,r,n),(!(Ie&2)||e!==Nt)&&(e===Nt&&(!(Ie&2)&&(rd|=r),Ct===4&&bs(e,Dt)),cr(e,n),r===1&&Ie===0&&!(t.mode&1)&&(Jo=vt()+500,Xu&&ri()))}function cr(e,t){var r=e.callbackNode;RE(e,t);var n=ru(e,e===Nt?Dt:0);if(n===0)r!==null&&sv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&sv(r),t===1)e.tag===0?Nj(Yv.bind(null,e)):H0(Yv.bind(null,e)),Cj(function(){!(Ie&6)&&ri()}),r=null;else{switch(g0(n)){case 1:r=Hp;break;case 4:r=f0;break;case 16:r=tu;break;case 536870912:r=p0;break;default:r=tu}r=Bb(r,Ab.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Ab(e,t){if(Wc=-1,Vc=0,Ie&6)throw Error(se(327));var r=e.callbackNode;if(jo()&&e.callbackNode!==r)return null;var n=ru(e,e===Nt?Dt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=yu(e,n);else{t=n;var s=Ie;Ie|=2;var i=Lb();(Nt!==e||Dt!==t)&&(Fn=null,Jo=vt()+500,Ni(e,t));do try{Qj();break}catch(a){Db(e,a)}while(!0);em(),vu.current=i,Ie=s,bt!==null?t=0:(Nt=null,Dt=0,t=Ct)}if(t!==0){if(t===2&&(s=Xh(e),s!==0&&(n=s,t=jf(e,s))),t===1)throw r=wl,Ni(e,0),bs(e,n),cr(e,vt()),r;if(t===6)bs(e,n);else{if(s=e.current.alternate,!(n&30)&&!Kj(s)&&(t=yu(e,n),t===2&&(i=Xh(e),i!==0&&(n=i,t=jf(e,i))),t===1))throw r=wl,Ni(e,0),bs(e,n),cr(e,vt()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(se(345));case 2:di(e,ir,Fn);break;case 3:if(bs(e,n),(n&130023424)===n&&(t=mm+500-vt(),10<t)){if(ru(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Yt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=af(di.bind(null,e,ir,Fn),t);break}di(e,ir,Fn);break;case 4:if(bs(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-an(n);i=1<<l,l=t[l],l>s&&(s=l),n&=~i}if(n=s,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qj(n/1960))-n,10<n){e.timeoutHandle=af(di.bind(null,e,ir,Fn),n);break}di(e,ir,Fn);break;case 5:di(e,ir,Fn);break;default:throw Error(se(329))}}}return cr(e,vt()),e.callbackNode===r?Ab.bind(null,e):null}function jf(e,t){var r=tl;return e.current.memoizedState.isDehydrated&&(Ni(e,t).flags|=256),e=yu(e,t),e!==2&&(t=ir,ir=r,t!==null&&Nf(t)),e}function Nf(e){ir===null?ir=e:ir.push.apply(ir,e)}function Kj(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!dn(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 bs(e,t){for(t&=~pm,t&=~rd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-an(t),n=1<<r;e[r]=-1,t&=~n}}function Yv(e){if(Ie&6)throw Error(se(327));jo();var t=ru(e,0);if(!(t&1))return cr(e,vt()),null;var r=yu(e,t);if(e.tag!==0&&r===2){var n=Xh(e);n!==0&&(t=n,r=jf(e,n))}if(r===1)throw r=wl,Ni(e,0),bs(e,t),cr(e,vt()),r;if(r===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,di(e,ir,Fn),cr(e,vt()),null}function gm(e,t){var r=Ie;Ie|=1;try{return e(t)}finally{Ie=r,Ie===0&&(Jo=vt()+500,Xu&&ri())}}function Li(e){As!==null&&As.tag===0&&!(Ie&6)&&jo();var t=Ie;Ie|=1;var r=Ir.transition,n=Ke;try{if(Ir.transition=null,Ke=1,e)return e()}finally{Ke=n,Ir.transition=r,Ie=t,!(Ie&6)&&ri()}}function vm(){hr=yo.current,st(yo)}function Ni(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Sj(r)),bt!==null)for(r=bt.return;r!==null;){var n=r;switch(Zp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&au();break;case 3:Zo(),st(ar),st(Wt),om();break;case 5:im(n);break;case 4:Zo();break;case 13:st(at);break;case 19:st(at);break;case 10:tm(n.type._context);break;case 22:case 23:vm()}r=r.return}if(Nt=e,bt=e=zs(e.current,null),Dt=hr=t,Ct=0,wl=null,pm=rd=Di=0,ir=tl=null,fi!==null){for(t=0;t<fi.length;t++)if(r=fi[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var l=i.next;i.next=s,n.next=l}r.pending=n}fi=null}return e}function Db(e,t){do{var r=bt;try{if(em(),Hc.current=gu,mu){for(var n=ct.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}mu=!1}if(Ai=0,jt=wt=ct=null,Ja=!1,xl=0,fm.current=null,r===null||r.return===null){Ct=1,wl=t,bt=null;break}e:{var i=e,l=r.return,a=r,c=t;if(t=Dt,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,g=a,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var v=Iv(l);if(v!==null){v.flags&=-257,Fv(v,l,a,i,t),v.mode&1&&Ov(i,u,t),t=v,c=u;var x=t.updateQueue;if(x===null){var y=new Set;y.add(c),t.updateQueue=y}else x.add(c);break e}else{if(!(t&1)){Ov(i,u,t),_m();break e}c=Error(se(426))}}else if(ot&&a.mode&1){var h=Iv(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),Fv(h,l,a,i,t),Xp(Xo(c,a));break e}}i=c=Xo(c,a),Ct!==4&&(Ct=2),tl===null?tl=[i]:tl.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=gb(i,c,t);Pv(i,p);break e;case 1:a=c;var f=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof f.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&($s===null||!$s.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=vb(i,a,t);Pv(i,b);break e}}i=i.return}while(i!==null)}Ob(r)}catch(w){t=w,bt===r&&r!==null&&(bt=r=r.return);continue}break}while(!0)}function Lb(){var e=vu.current;return vu.current=gu,e===null?gu:e}function _m(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Nt===null||!(Di&268435455)&&!(rd&268435455)||bs(Nt,Dt)}function yu(e,t){var r=Ie;Ie|=2;var n=Lb();(Nt!==e||Dt!==t)&&(Fn=null,Ni(e,t));do try{Gj();break}catch(s){Db(e,s)}while(!0);if(em(),Ie=r,vu.current=n,bt!==null)throw Error(se(261));return Nt=null,Dt=0,Ct}function Gj(){for(;bt!==null;)Mb(bt)}function Qj(){for(;bt!==null&&!yE();)Mb(bt)}function Mb(e){var t=Fb(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?Ob(e):bt=t,fm.current=null}function Ob(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=zj(r,t),r!==null){r.flags&=32767,bt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,bt=null;return}}else if(r=Hj(r,t,hr),r!==null){bt=r;return}if(t=t.sibling,t!==null){bt=t;return}bt=t=e}while(t!==null);Ct===0&&(Ct=5)}function di(e,t,r){var n=Ke,s=Ir.transition;try{Ir.transition=null,Ke=1,Yj(e,t,r,n)}finally{Ir.transition=s,Ke=n}return null}function Yj(e,t,r,n){do jo();while(As!==null);if(Ie&6)throw Error(se(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(PE(e,i),e===Nt&&(bt=Nt=null,Dt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xc||(xc=!0,Bb(tu,function(){return jo(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Ir.transition,Ir.transition=null;var l=Ke;Ke=1;var a=Ie;Ie|=4,fm.current=null,Wj(e,r),Pb(r,e),gj(sf),nu=!!nf,sf=nf=null,e.current=r,Vj(r),bE(),Ie=a,Ke=l,Ir.transition=i}else e.current=r;if(xc&&(xc=!1,As=e,xu=s),i=e.pendingLanes,i===0&&($s=null),CE(r.stateNode),cr(e,vt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(_u)throw _u=!1,e=kf,kf=null,e;return xu&1&&e.tag!==0&&jo(),i=e.pendingLanes,i&1?e===Ef?rl++:(rl=0,Ef=e):rl=0,ri(),null}function jo(){if(As!==null){var e=g0(xu),t=Ir.transition,r=Ke;try{if(Ir.transition=null,Ke=16>e?16:e,As===null)var n=!1;else{if(e=As,As=null,xu=0,Ie&6)throw Error(se(331));var s=Ie;for(Ie|=4,pe=e.current;pe!==null;){var i=pe,l=i.child;if(pe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(pe=u;pe!==null;){var g=pe;switch(g.tag){case 0:case 11:case 15:el(8,g,i)}var d=g.child;if(d!==null)d.return=g,pe=d;else for(;pe!==null;){g=pe;var _=g.sibling,v=g.return;if(jb(g),g===u){pe=null;break}if(_!==null){_.return=v,pe=_;break}pe=v}}}var x=i.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var h=y.sibling;y.sibling=null,y=h}while(y!==null)}}pe=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,pe=l;else e:for(;pe!==null;){if(i=pe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:el(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,pe=p;break e}pe=i.return}}var f=e.current;for(pe=f;pe!==null;){l=pe;var m=l.child;if(l.subtreeFlags&2064&&m!==null)m.return=l,pe=m;else e:for(l=f;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:td(9,a)}}catch(w){ft(a,a.return,w)}if(a===l){pe=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,pe=b;break e}pe=a.return}}if(Ie=s,ri(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(Ku,e)}catch{}n=!0}return n}finally{Ke=r,Ir.transition=t}}return!1}function Zv(e,t,r){t=Xo(r,t),t=gb(e,t,1),e=Bs(e,t,1),t=Yt(),e!==null&&(Bl(e,1,t),cr(e,t))}function ft(e,t,r){if(e.tag===3)Zv(e,e,r);else for(;t!==null;){if(t.tag===3){Zv(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&($s===null||!$s.has(n))){e=Xo(r,e),e=vb(t,e,1),t=Bs(t,e,1),e=Yt(),t!==null&&(Bl(t,1,e),cr(t,e));break}}t=t.return}}function Zj(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Yt(),e.pingedLanes|=e.suspendedLanes&r,Nt===e&&(Dt&r)===r&&(Ct===4||Ct===3&&(Dt&130023424)===Dt&&500>vt()-mm?Ni(e,0):pm|=r),cr(e,t)}function Ib(e,t){t===0&&(e.mode&1?(t=cc,cc<<=1,!(cc&130023424)&&(cc=4194304)):t=1);var r=Yt();e=Xn(e,t),e!==null&&(Bl(e,t,r),cr(e,r))}function Xj(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ib(e,r)}function Jj(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(se(314))}n!==null&&n.delete(t),Ib(e,r)}var Fb;Fb=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ar.current)or=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return or=!1,$j(e,t,r);or=!!(e.flags&131072)}else or=!1,ot&&t.flags&1048576&&z0(t,uu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Uc(e,t),e=t.pendingProps;var s=Go(t,Wt.current);Eo(t,r),s=lm(null,t,n,e,s,r);var i=cm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lr(n)?(i=!0,lu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,nm(t),s.updater=ed,t.stateNode=s,s._reactInternals=t,pf(t,n,e,r),t=vf(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&Yp(t),Gt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Uc(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=tN(n),e=en(n,e),s){case 0:t=gf(null,t,n,e,r);break e;case 1:t=Hv(null,t,n,e,r);break e;case 11:t=Bv(null,t,n,e,r);break e;case 14:t=$v(null,t,n,en(n.type,e),r);break e}throw Error(se(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),gf(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),Hv(e,t,n,s,r);case 3:e:{if(bb(t),e===null)throw Error(se(387));n=t.pendingProps,i=t.memoizedState,s=i.element,G0(e,t),fu(t,n,null,r);var l=t.memoizedState;if(n=l.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Xo(Error(se(423)),t),t=zv(e,t,n,r,s);break e}else if(n!==s){s=Xo(Error(se(424)),t),t=zv(e,t,n,r,s);break e}else for(_r=Fs(t.stateNode.containerInfo.firstChild),xr=t,ot=!0,nn=null,r=q0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qo(),n===s){t=Jn(e,t,r);break e}Gt(e,t,n,r)}t=t.child}return t;case 5:return Q0(t),e===null&&df(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,of(n,s)?l=null:i!==null&&of(n,i)&&(t.flags|=32),yb(e,t),Gt(e,t,l,r),t.child;case 6:return e===null&&df(t),null;case 13:return wb(e,t,r);case 4:return sm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yo(t,null,n,r):Gt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),Bv(e,t,n,s,r);case 7:return Gt(e,t,t.pendingProps,r),t.child;case 8:return Gt(e,t,t.pendingProps.children,r),t.child;case 12:return Gt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,Xe(du,n._currentValue),n._currentValue=l,i!==null)if(dn(i.value,l)){if(i.children===s.children&&!ar.current){t=Jn(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Kn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var g=u.pending;g===null?c.next=c:(c.next=g.next,g.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),hf(i.return,r,t),a.lanes|=r;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(se(341));l.lanes|=r,a=l.alternate,a!==null&&(a.lanes|=r),hf(l,r,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Gt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Eo(t,r),s=Hr(s),n=n(s),t.flags|=1,Gt(e,t,n,r),t.child;case 14:return n=t.type,s=en(n,t.pendingProps),s=en(n.type,s),$v(e,t,n,s,r);case 15:return _b(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),Uc(e,t),t.tag=1,lr(n)?(e=!0,lu(t)):e=!1,Eo(t,r),mb(t,n,s),pf(t,n,s,r),vf(null,t,n,!0,e,r);case 19:return Sb(e,t,r);case 22:return xb(e,t,r)}throw Error(se(156,t.tag))};function Bb(e,t){return h0(e,t)}function eN(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(e,t,r,n){return new eN(e,t,r,n)}function xm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tN(e){if(typeof e=="function")return xm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fp)return 11;if(e===Bp)return 14}return 2}function zs(e,t){var r=e.alternate;return r===null?(r=Mr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function qc(e,t,r,n,s,i){var l=2;if(n=e,typeof e=="function")xm(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case co:return Ri(r.children,s,i,t);case Ip:l=8,s|=8;break;case Ih:return e=Mr(12,r,t,s|2),e.elementType=Ih,e.lanes=i,e;case Fh:return e=Mr(13,r,t,s),e.elementType=Fh,e.lanes=i,e;case Bh:return e=Mr(19,r,t,s),e.elementType=Bh,e.lanes=i,e;case Qy:return nd(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ky:l=10;break e;case Gy:l=9;break e;case Fp:l=11;break e;case Bp:l=14;break e;case gs:l=16,n=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=Mr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ri(e,t,r,n){return e=Mr(7,e,n,t),e.lanes=r,e}function nd(e,t,r,n){return e=Mr(22,e,n,t),e.elementType=Qy,e.lanes=r,e.stateNode={isHidden:!1},e}function oh(e,t,r){return e=Mr(6,e,null,t),e.lanes=r,e}function ah(e,t,r){return t=Mr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rN(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hd(0),this.expirationTimes=Hd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hd(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ym(e,t,r,n,s,i,l,a,c){return e=new rN(e,t,r,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Mr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},nm(i),e}function nN(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:lo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function $b(e){if(!e)return Gs;e=e._reactInternals;e:{if($i(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var r=e.type;if(lr(r))return $0(e,r,t)}return t}function Hb(e,t,r,n,s,i,l,a,c){return e=ym(r,n,!0,e,s,i,l,a,c),e.context=$b(null),r=e.current,n=Yt(),s=Hs(r),i=Kn(n,s),i.callback=t??null,Bs(r,i,s),e.current.lanes=s,Bl(e,s,n),cr(e,n),e}function sd(e,t,r,n){var s=t.current,i=Yt(),l=Hs(s);return r=$b(r),t.context===null?t.context=r:t.pendingContext=r,t=Kn(i,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Bs(s,t,l),e!==null&&(ln(e,s,l,i),$c(e,s,l)),l}function bu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Xv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function bm(e,t){Xv(e,t),(e=e.alternate)&&Xv(e,t)}function sN(){return null}var zb=typeof reportError=="function"?reportError:function(e){console.error(e)};function wm(e){this._internalRoot=e}id.prototype.render=wm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));sd(e,t,null,null)};id.prototype.unmount=wm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Li(function(){sd(null,e,null,null)}),t[Zn]=null}};function id(e){this._internalRoot=e}id.prototype.unstable_scheduleHydration=function(e){if(e){var t=x0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ys.length&&t!==0&&t<ys[r].priority;r++);ys.splice(r,0,e),r===0&&b0(e)}};function Sm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function od(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jv(){}function iN(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=bu(l);i.call(u)}}var l=Hb(t,n,e,0,null,!1,!1,"",Jv);return e._reactRootContainer=l,e[Zn]=l.current,pl(e.nodeType===8?e.parentNode:e),Li(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=bu(c);a.call(u)}}var c=ym(e,0,!1,null,null,!1,!1,"",Jv);return e._reactRootContainer=c,e[Zn]=c.current,pl(e.nodeType===8?e.parentNode:e),Li(function(){sd(t,c,r,n)}),c}function ad(e,t,r,n,s){var i=r._reactRootContainer;if(i){var l=i;if(typeof s=="function"){var a=s;s=function(){var c=bu(l);a.call(c)}}sd(t,l,e,s)}else l=iN(r,t,e,s,n);return bu(l)}v0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=za(t.pendingLanes);r!==0&&(zp(t,r|1),cr(t,vt()),!(Ie&6)&&(Jo=vt()+500,ri()))}break;case 13:Li(function(){var n=Xn(e,1);if(n!==null){var s=Yt();ln(n,e,1,s)}}),bm(e,1)}};Up=function(e){if(e.tag===13){var t=Xn(e,134217728);if(t!==null){var r=Yt();ln(t,e,134217728,r)}bm(e,134217728)}};_0=function(e){if(e.tag===13){var t=Hs(e),r=Xn(e,t);if(r!==null){var n=Yt();ln(r,e,t,n)}bm(e,t)}};x0=function(){return Ke};y0=function(e,t){var r=Ke;try{return Ke=e,t()}finally{Ke=r}};Qh=function(e,t,r){switch(t){case"input":if(zh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Zu(n);if(!s)throw Error(se(90));Zy(n),zh(n,s)}}}break;case"textarea":Jy(e,r);break;case"select":t=r.value,t!=null&&wo(e,!!r.multiple,t,!1)}};o0=gm;a0=Li;var oN={usingClientEntryPoint:!1,Events:[Hl,po,Zu,s0,i0,gm]},Pa={findFiberByHostInstance:hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aN={bundleType:Pa.bundleType,version:Pa.version,rendererPackageName:Pa.rendererPackageName,rendererConfig:Pa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ss.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=u0(e),e===null?null:e.stateNode},findFiberByHostInstance:Pa.findFiberByHostInstance||sN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yc.isDisabled&&yc.supportsFiber)try{Ku=yc.inject(aN),En=yc}catch{}}Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oN;Er.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sm(t))throw Error(se(200));return nN(e,t,null,r)};Er.createRoot=function(e,t){if(!Sm(e))throw Error(se(299));var r=!1,n="",s=zb;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ym(e,1,!1,null,null,r,!1,n,s),e[Zn]=t.current,pl(e.nodeType===8?e.parentNode:e),new wm(t)};Er.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=u0(t),e=e===null?null:e.stateNode,e};Er.flushSync=function(e){return Li(e)};Er.hydrate=function(e,t,r){if(!od(t))throw Error(se(200));return ad(null,e,t,!0,r)};Er.hydrateRoot=function(e,t,r){if(!Sm(e))throw Error(se(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",l=zb;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Hb(t,null,e,1,r??null,s,!1,i,l),e[Zn]=t.current,pl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new id(t)};Er.render=function(e,t,r){if(!od(t))throw Error(se(200));return ad(null,e,t,!1,r)};Er.unmountComponentAtNode=function(e){if(!od(e))throw Error(se(40));return e._reactRootContainer?(Li(function(){ad(null,null,e,!1,function(){e._reactRootContainer=null,e[Zn]=null})}),!0):!1};Er.unstable_batchedUpdates=gm;Er.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!od(r))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return ad(e,t,r,!1,n)};Er.version="18.3.1-next-f1338f8080-20240426";function Ub(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ub)}catch(e){console.error(e)}}Ub(),Uy.exports=Er;var ld=Uy.exports;const Wb=Ty(ld);var e_=ld;Mh.createRoot=e_.createRoot,Mh.hydrateRoot=e_.hydrateRoot;var fa=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(){}},xi,ws,Lo,yy,lN=(yy=class extends fa{constructor(){super();xe(this,xi);xe(this,ws);xe(this,Lo);de(this,Lo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,ws)||this.setEventListener(F(this,Lo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ws))==null||t.call(this),de(this,ws,void 0))}setEventListener(t){var r;de(this,Lo,t),(r=F(this,ws))==null||r.call(this),de(this,ws,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,xi)!==t&&(de(this,xi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,xi)=="boolean"?F(this,xi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xi=new WeakMap,ws=new WeakMap,Lo=new WeakMap,yy),Cm=new lN,cN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ss,Rp,by,uN=(by=class{constructor(){xe(this,Ss,cN);xe(this,Rp,!1)}setTimeoutProvider(e){de(this,Ss,e)}setTimeout(e,t){return F(this,Ss).setTimeout(e,t)}clearTimeout(e){F(this,Ss).clearTimeout(e)}setInterval(e,t){return F(this,Ss).setInterval(e,t)}clearInterval(e){F(this,Ss).clearInterval(e)}},Ss=new WeakMap,Rp=new WeakMap,by),mi=new uN;function dN(e){setTimeout(e,0)}var hN=typeof window>"u"||"Deno"in globalThis;function Qt(){}function fN(e,t){return typeof e=="function"?e(t):e}function Rf(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Us(e,t){return typeof e=="function"?e(t):e}function pr(e,t){return typeof e=="function"?e(t):e}function t_(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:l,stale:a}=e;if(l){if(n){if(t.queryHash!==km(l,t.options))return!1}else if(!Sl(t.queryKey,l))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function r_(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Mi(t.options.mutationKey)!==Mi(i))return!1}else if(!Sl(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function km(e,t){return((t==null?void 0:t.queryKeyHashFn)||Mi)(e)}function Mi(e){return JSON.stringify(e,(t,r)=>Pf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Sl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Sl(e[r],t[r])):!1}var pN=Object.prototype.hasOwnProperty;function qb(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=n_(e)&&n_(t);if(!n&&!(Pf(e)&&Pf(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),a=l.length,c=n?new Array(a):{};let u=0;for(let g=0;g<a;g++){const d=n?g:l[g],_=e[d],v=t[d];if(_===v){c[d]=_,(n?g<i:pN.call(e,d))&&u++;continue}if(_===null||v===null||typeof _!="object"||typeof v!="object"){c[d]=v;continue}const x=qb(_,v,r+1);c[d]=x,x===_&&u++}return i===a&&u===i?e:c}function wu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function n_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pf(e){if(!s_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!s_(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function s_(e){return Object.prototype.toString.call(e)==="[object Object]"}function mN(e){return new Promise(t=>{mi.setTimeout(t,e)})}function Tf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?qb(e,t):t}function gN(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function vN(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Em=Symbol();function Kb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Em?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jm(e,t){return typeof e=="function"?e(...t):!!e}function _N(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Cl=(()=>{let e=()=>hN;return{isServer(){return e()},setIsServer(t){e=t}}})();function Af(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var xN=dN;function yN(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=xN;const i=a=>{t?e.push(a):s(()=>{r(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||l()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var St=yN(),Mo,Cs,Oo,wy,bN=(wy=class extends fa{constructor(){super();xe(this,Mo,!0);xe(this,Cs);xe(this,Oo);de(this,Oo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){F(this,Cs)||this.setEventListener(F(this,Oo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Cs))==null||t.call(this),de(this,Cs,void 0))}setEventListener(t){var r;de(this,Oo,t),(r=F(this,Cs))==null||r.call(this),de(this,Cs,t(this.setOnline.bind(this)))}setOnline(t){F(this,Mo)!==t&&(de(this,Mo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Mo)}},Mo=new WeakMap,Cs=new WeakMap,Oo=new WeakMap,wy),Su=new bN;function wN(e){return Math.min(1e3*2**e,3e4)}function Gb(e){return(e??"online")==="online"?Su.isOnline():!0}var Df=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qb(e){let t=!1,r=0,n;const s=Af(),i=()=>s.status!=="pending",l=y=>{var h;if(!i()){const p=new Df(y);_(p),(h=e.onCancel)==null||h.call(e,p)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>Cm.isFocused()&&(e.networkMode==="always"||Su.isOnline())&&e.canRun(),g=()=>Gb(e.networkMode)&&e.canRun(),d=y=>{i()||(n==null||n(),s.resolve(y))},_=y=>{i()||(n==null||n(),s.reject(y))},v=()=>new Promise(y=>{var h;n=p=>{(i()||u())&&y(p)},(h=e.onPause)==null||h.call(e)}).then(()=>{var y;n=void 0,i()||(y=e.onContinue)==null||y.call(e)}),x=()=>{if(i())return;let y;const h=r===0?e.initialPromise:void 0;try{y=h??e.fn()}catch(p){y=Promise.reject(p)}Promise.resolve(y).then(d).catch(p=>{var k;if(i())return;const f=e.retry??(Cl.isServer()?0:3),m=e.retryDelay??wN,b=typeof m=="function"?m(r,p):m,w=f===!0||typeof f=="number"&&r<f||typeof f=="function"&&f(r,p);if(t||!w){_(p);return}r++,(k=e.onFail)==null||k.call(e,r,p),mN(b).then(()=>u()?void 0:v()).then(()=>{t?_(p):x()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:g,start:()=>(g()?x():v().then(x),s)}}var yi,Sy,Yb=(Sy=class{constructor(){xe(this,yi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rf(this.gcTime)&&de(this,yi,mi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,yi)!==void 0&&(mi.clearTimeout(F(this,yi)),de(this,yi,void 0))}},yi=new WeakMap,Sy);function SN(e){return{onFetch:(t,r)=>{var g,d,_,v,x;const n=t.options,s=(_=(d=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:d.fetchMore)==null?void 0:_.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const h=m=>{_N(m,()=>t.signal,()=>y=!0)},p=Kb(t.options,t.fetchOptions),f=async(m,b,w)=>{if(y)return Promise.reject(t.signal.reason);if(b==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return h(M),M})(),S=await p(E),{maxPages:j}=t.options,R=w?vN:gN;return{pages:R(m.pages,S,j),pageParams:R(m.pageParams,b,j)}};if(s&&i.length){const m=s==="backward",b=m?Zb:Lf,w={pages:i,pageParams:l},k=b(n,w);a=await f(w,k,m)}else{const m=e??i.length;do{const b=c===0?l[0]??n.initialPageParam:Lf(n,a);if(c>0&&b==null)break;a=await f(a,b),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>{var y,h;return(h=(y=t.options).persister)==null?void 0:h.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Lf(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Zb(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function CN(e,t){return t?Lf(e,t)!=null:!1}function kN(e,t){return!t||!e.getPreviousPageParam?!1:Zb(e,t)!=null}var Io,bi,Fo,Nr,wi,Et,Dl,Si,fr,Xb,In,Cy,EN=(Cy=class extends Yb{constructor(t){super();xe(this,fr);xe(this,Io);xe(this,bi);xe(this,Fo);xe(this,Nr);xe(this,wi);xe(this,Et);xe(this,Dl);xe(this,Si);de(this,Si,!1),de(this,Dl,t.defaultOptions),this.setOptions(t.options),this.observers=[],de(this,wi,t.client),de(this,Nr,F(this,wi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,de(this,bi,o_(this.options)),this.state=t.state??F(this,bi),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Io)}get promise(){var t;return(t=F(this,Et))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,Dl),...t},t!=null&&t._type&&de(this,Io,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=o_(this.options);r.data!==void 0&&(this.setState(i_(r.data,r.dataUpdatedAt)),de(this,bi,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Nr).remove(this)}setData(t,r){const n=Tf(this.state.data,t,this.options);return Pe(this,fr,In).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Pe(this,fr,In).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=F(this,Et))==null?void 0:n.promise;return(s=F(this,Et))==null||s.cancel(t),r?r.then(Qt).catch(Qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,bi)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>pr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Em||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Us(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Vb(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Et))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Et))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Nr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,Et)&&(F(this,Si)||Pe(this,fr,Xb).call(this)?F(this,Et).cancel({revert:!0}):F(this,Et).cancelRetry()),this.scheduleGc()),F(this,Nr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pe(this,fr,In).call(this,{type:"invalidate"})}async fetch(t,r){var u,g,d,_,v,x,y,h,p,f,m;if(this.state.fetchStatus!=="idle"&&((u=F(this,Et))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,Et))return F(this,Et).continueRetry(),F(this,Et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(w=>w.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(de(this,Si,!0),n.signal)})},i=()=>{const b=Kb(this.options,r),k=(()=>{const E={client:F(this,wi),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return de(this,Si,!1),this.options.persister?this.options.persister(b,k,this):b(k)},a=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,wi),state:this.state,fetchFn:i};return s(b),b})(),c=F(this,Io)==="infinite"?SN(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),de(this,Fo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=a.fetchOptions)==null?void 0:g.meta))&&Pe(this,fr,In).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),de(this,Et,Qb({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Df&&b.revert&&this.setState({...F(this,Fo),fetchStatus:"idle"}),n.abort()},onFail:(b,w)=>{Pe(this,fr,In).call(this,{type:"failed",failureCount:b,error:w})},onPause:()=>{Pe(this,fr,In).call(this,{type:"pause"})},onContinue:()=>{Pe(this,fr,In).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await F(this,Et).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(v=(_=F(this,Nr).config).onSuccess)==null||v.call(_,b,this),(y=(x=F(this,Nr).config).onSettled)==null||y.call(x,b,this.state.error,this),b}catch(b){if(b instanceof Df){if(b.silent)return F(this,Et).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw Pe(this,fr,In).call(this,{type:"error",error:b}),(p=(h=F(this,Nr).config).onError)==null||p.call(h,b,this),(m=(f=F(this,Nr).config).onSettled)==null||m.call(f,this.state.data,b,this),b}finally{this.scheduleGc()}}},Io=new WeakMap,bi=new WeakMap,Fo=new WeakMap,Nr=new WeakMap,wi=new WeakMap,Et=new WeakMap,Dl=new WeakMap,Si=new WeakMap,fr=new WeakSet,Xb=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},In=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Jb(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...i_(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return de(this,Fo,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),St.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,Nr).notify({query:this,type:"updated",action:t})})},Cy);function Jb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function o_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var rr,Me,Ll,Kt,Ci,Bo,Hn,ks,Ml,$o,Ho,ki,Ei,Es,zo,Ue,Wa,Mf,Of,If,Ff,Bf,$f,Hf,tw,ky,ew=(ky=class extends fa{constructor(t,r){super();xe(this,Ue);xe(this,rr);xe(this,Me);xe(this,Ll);xe(this,Kt);xe(this,Ci);xe(this,Bo);xe(this,Hn);xe(this,ks);xe(this,Ml);xe(this,$o);xe(this,Ho);xe(this,ki);xe(this,Ei);xe(this,Es);xe(this,zo,new Set);this.options=r,de(this,rr,t),de(this,ks,null),de(this,Hn,Af()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Me).addObserver(this),a_(F(this,Me),this.options)?Pe(this,Ue,Wa).call(this):this.updateResult(),Pe(this,Ue,Ff).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zf(F(this,Me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zf(F(this,Me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pe(this,Ue,Bf).call(this),Pe(this,Ue,$f).call(this),F(this,Me).removeObserver(this)}setOptions(t){const r=this.options,n=F(this,Me);if(this.options=F(this,rr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pr(this.options.enabled,F(this,Me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pe(this,Ue,Hf).call(this),F(this,Me).setOptions(this.options),r._defaulted&&!wu(this.options,r)&&F(this,rr).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Me),observer:this});const s=this.hasListeners();s&&l_(F(this,Me),n,this.options,r)&&Pe(this,Ue,Wa).call(this),this.updateResult(),s&&(F(this,Me)!==n||pr(this.options.enabled,F(this,Me))!==pr(r.enabled,F(this,Me))||Us(this.options.staleTime,F(this,Me))!==Us(r.staleTime,F(this,Me)))&&Pe(this,Ue,Mf).call(this);const i=Pe(this,Ue,Of).call(this);s&&(F(this,Me)!==n||pr(this.options.enabled,F(this,Me))!==pr(r.enabled,F(this,Me))||i!==F(this,Es))&&Pe(this,Ue,If).call(this,i)}getOptimisticResult(t){const r=F(this,rr).getQueryCache().build(F(this,rr),t),n=this.createResult(r,t);return NN(this,n)&&(de(this,Kt,n),de(this,Bo,this.options),de(this,Ci,F(this,Me).state)),n}getCurrentResult(){return F(this,Kt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,Hn).status==="pending"&&F(this,Hn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){F(this,zo).add(t)}getCurrentQuery(){return F(this,Me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,rr).defaultQueryOptions(t),n=F(this,rr).getQueryCache().build(F(this,rr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Pe(this,Ue,Wa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,Kt)))}createResult(t,r){var j;const n=F(this,Me),s=this.options,i=F(this,Kt),l=F(this,Ci),a=F(this,Bo),u=t!==n?t.state:F(this,Ll),{state:g}=t;let d={...g},_=!1,v;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&a_(t,r),T=R&&l_(t,n,r,s);(M||T)&&(d={...d,...Jb(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:h}=d;v=d.data;let p=!1;if(r.placeholderData!==void 0&&v===void 0&&h==="pending"){let R;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(R=i.data,p=!0):R=typeof r.placeholderData=="function"?r.placeholderData((j=F(this,Ho))==null?void 0:j.state.data,F(this,Ho)):r.placeholderData,R!==void 0&&(h="success",v=Tf(i==null?void 0:i.data,R,r),_=!0)}if(r.select&&v!==void 0&&!p)if(i&&v===(l==null?void 0:l.data)&&r.select===F(this,Ml))v=F(this,$o);else try{de(this,Ml,r.select),v=r.select(v),v=Tf(i==null?void 0:i.data,v,r),de(this,$o,v),de(this,ks,null)}catch(R){de(this,ks,R)}F(this,ks)&&(x=F(this,ks),v=F(this,$o),y=Date.now(),h="error");const f=d.fetchStatus==="fetching",m=h==="pending",b=h==="error",w=m&&f,k=v!==void 0,S={status:h,fetchStatus:d.fetchStatus,isPending:m,isSuccess:h==="success",isError:b,isInitialLoading:w,isLoading:w,data:v,dataUpdatedAt:d.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:f,isRefetching:f&&!m,isLoadingError:b&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:b&&k,isStale:Nm(t,r),refetch:this.refetch,promise:F(this,Hn),isEnabled:pr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=S.data!==void 0,M=S.status==="error"&&!R,T=z=>{M?z.reject(S.error):R&&z.resolve(S.data)},L=()=>{const z=de(this,Hn,S.promise=Af());T(z)},$=F(this,Hn);switch($.status){case"pending":t.queryHash===n.queryHash&&T($);break;case"fulfilled":(M||S.data!==$.value)&&L();break;case"rejected":(!M||S.error!==$.reason)&&L();break}}return S}updateResult(){const t=F(this,Kt),r=this.createResult(F(this,Me),this.options);if(de(this,Ci,F(this,Me).state),de(this,Bo,this.options),F(this,Ci).data!==void 0&&de(this,Ho,F(this,Me)),wu(r,t))return;de(this,Kt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!F(this,zo).size)return!0;const l=new Set(i??F(this,zo));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,Kt)).some(a=>{const c=a;return F(this,Kt)[c]!==t[c]&&l.has(c)})};Pe(this,Ue,tw).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pe(this,Ue,Ff).call(this)}},rr=new WeakMap,Me=new WeakMap,Ll=new WeakMap,Kt=new WeakMap,Ci=new WeakMap,Bo=new WeakMap,Hn=new WeakMap,ks=new WeakMap,Ml=new WeakMap,$o=new WeakMap,Ho=new WeakMap,ki=new WeakMap,Ei=new WeakMap,Es=new WeakMap,zo=new WeakMap,Ue=new WeakSet,Wa=function(t){Pe(this,Ue,Hf).call(this);let r=F(this,Me).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Qt)),r},Mf=function(){Pe(this,Ue,Bf).call(this);const t=Us(this.options.staleTime,F(this,Me));if(Cl.isServer()||F(this,Kt).isStale||!Rf(t))return;const n=Vb(F(this,Kt).dataUpdatedAt,t)+1;de(this,ki,mi.setTimeout(()=>{F(this,Kt).isStale||this.updateResult()},n))},Of=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Me)):this.options.refetchInterval)??!1},If=function(t){Pe(this,Ue,$f).call(this),de(this,Es,t),!(Cl.isServer()||pr(this.options.enabled,F(this,Me))===!1||!Rf(F(this,Es))||F(this,Es)===0)&&de(this,Ei,mi.setInterval(()=>{(this.options.refetchIntervalInBackground||Cm.isFocused())&&Pe(this,Ue,Wa).call(this)},F(this,Es)))},Ff=function(){Pe(this,Ue,Mf).call(this),Pe(this,Ue,If).call(this,Pe(this,Ue,Of).call(this))},Bf=function(){F(this,ki)!==void 0&&(mi.clearTimeout(F(this,ki)),de(this,ki,void 0))},$f=function(){F(this,Ei)!==void 0&&(mi.clearInterval(F(this,Ei)),de(this,Ei,void 0))},Hf=function(){const t=F(this,rr).getQueryCache().build(F(this,rr),this.options);if(t===F(this,Me))return;const r=F(this,Me);de(this,Me,t),de(this,Ll,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},tw=function(t){St.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,Kt))}),F(this,rr).getQueryCache().notify({query:F(this,Me),type:"observerResultsUpdated"})})},ky);function jN(e,t){return pr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&pr(t.retryOnMount,e)===!1)}function a_(e,t){return jN(e,t)||e.state.data!==void 0&&zf(e,t,t.refetchOnMount)}function zf(e,t,r){if(pr(t.enabled,e)!==!1&&Us(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Nm(e,t)}return!1}function l_(e,t,r,n){return(e!==t||pr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Nm(e,r)}function Nm(e,t){return pr(t.enabled,e)!==!1&&e.isStaleByTime(Us(t.staleTime,e))}function NN(e,t){return!wu(e.getCurrentResult(),t)}var RN=class extends ew{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){var x,y;const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:l,isRefetchError:a}=n,c=(y=(x=r.fetchMeta)==null?void 0:x.fetchMore)==null?void 0:y.direction,u=l&&c==="forward",g=s&&c==="forward",d=l&&c==="backward",_=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:CN(t,r.data),hasPreviousPage:kN(t,r.data),isFetchNextPageError:u,isFetchingNextPage:g,isFetchPreviousPageError:d,isFetchingPreviousPage:_,isRefetchError:a&&!u&&!d,isRefetching:i&&!g&&!_}}},Ol,yn,Ft,ji,bn,ps,Ey,PN=(Ey=class extends Yb{constructor(t){super();xe(this,bn);xe(this,Ol);xe(this,yn);xe(this,Ft);xe(this,ji);de(this,Ol,t.client),this.mutationId=t.mutationId,de(this,Ft,t.mutationCache),de(this,yn,[]),this.state=t.state||rw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,yn).includes(t)||(F(this,yn).push(t),this.clearGcTimeout(),F(this,Ft).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){de(this,yn,F(this,yn).filter(r=>r!==t)),this.scheduleGc(),F(this,Ft).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,yn).length||(this.state.status==="pending"?this.scheduleGc():F(this,Ft).remove(this))}continue(){var t;return((t=F(this,ji))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,c,u,g,d,_,v,x,y,h,p,f,m,b,w,k,E;const r=()=>{Pe(this,bn,ps).call(this,{type:"continue"})},n={client:F(this,Ol),meta:this.options.meta,mutationKey:this.options.mutationKey};de(this,ji,Qb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(S,j)=>{Pe(this,bn,ps).call(this,{type:"failed",failureCount:S,error:j})},onPause:()=>{Pe(this,bn,ps).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Ft).canRun(this)}));const s=this.state.status==="pending",i=!F(this,ji).canStart();try{if(s)r();else{Pe(this,bn,ps).call(this,{type:"pending",variables:t,isPaused:i}),F(this,Ft).config.onMutate&&await F(this,Ft).config.onMutate(t,this,n);const j=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,n));j!==this.state.context&&Pe(this,bn,ps).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const S=await F(this,ji).start();return await((u=(c=F(this,Ft).config).onSuccess)==null?void 0:u.call(c,S,t,this.state.context,this,n)),await((d=(g=this.options).onSuccess)==null?void 0:d.call(g,S,t,this.state.context,n)),await((v=(_=F(this,Ft).config).onSettled)==null?void 0:v.call(_,S,null,this.state.variables,this.state.context,this,n)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,S,null,t,this.state.context,n)),Pe(this,bn,ps).call(this,{type:"success",data:S}),S}catch(S){try{await((p=(h=F(this,Ft).config).onError)==null?void 0:p.call(h,S,t,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((m=(f=this.options).onError)==null?void 0:m.call(f,S,t,this.state.context,n))}catch(j){Promise.reject(j)}try{await((w=(b=F(this,Ft).config).onSettled)==null?void 0:w.call(b,void 0,S,this.state.variables,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((E=(k=this.options).onSettled)==null?void 0:E.call(k,void 0,S,t,this.state.context,n))}catch(j){Promise.reject(j)}throw Pe(this,bn,ps).call(this,{type:"error",error:S}),S}finally{F(this,Ft).runNext(this)}}},Ol=new WeakMap,yn=new WeakMap,Ft=new WeakMap,ji=new WeakMap,bn=new WeakSet,ps=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),St.batch(()=>{F(this,yn).forEach(n=>{n.onMutationUpdate(t)}),F(this,Ft).notify({mutation:this,type:"updated",action:t})})},Ey);function rw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zn,tn,Il,jy,TN=(jy=class extends fa{constructor(t={}){super();xe(this,zn);xe(this,tn);xe(this,Il);this.config=t,de(this,zn,new Set),de(this,tn,new Map),de(this,Il,0)}build(t,r,n){const s=new PN({client:t,mutationCache:this,mutationId:++nc(this,Il)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){F(this,zn).add(t);const r=bc(t);if(typeof r=="string"){const n=F(this,tn).get(r);n?n.push(t):F(this,tn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,zn).delete(t)){const r=bc(t);if(typeof r=="string"){const n=F(this,tn).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&F(this,tn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=bc(t);if(typeof r=="string"){const n=F(this,tn).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=bc(t);if(typeof r=="string"){const s=(n=F(this,tn).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){St.batch(()=>{F(this,zn).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,zn).clear(),F(this,tn).clear()})}getAll(){return Array.from(F(this,zn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>r_(r,n))}findAll(t={}){return this.getAll().filter(r=>r_(t,r))}notify(t){St.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return St.batch(()=>Promise.all(t.map(r=>r.continue().catch(Qt))))}},zn=new WeakMap,tn=new WeakMap,Il=new WeakMap,jy);function bc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Un,js,nr,Wn,Qn,Kc,Uf,Ny,AN=(Ny=class extends fa{constructor(r,n){super();xe(this,Qn);xe(this,Un);xe(this,js);xe(this,nr);xe(this,Wn);de(this,Un,r),this.setOptions(n),this.bindMethods(),Pe(this,Qn,Kc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=F(this,Un).defaultMutationOptions(r),wu(this.options,n)||F(this,Un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,nr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Mi(n.mutationKey)!==Mi(this.options.mutationKey)?this.reset():((s=F(this,nr))==null?void 0:s.state.status)==="pending"&&F(this,nr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,nr))==null||r.removeObserver(this)}onMutationUpdate(r){Pe(this,Qn,Kc).call(this),Pe(this,Qn,Uf).call(this,r)}getCurrentResult(){return F(this,js)}reset(){var r;(r=F(this,nr))==null||r.removeObserver(this),de(this,nr,void 0),Pe(this,Qn,Kc).call(this),Pe(this,Qn,Uf).call(this)}mutate(r,n){var s;return de(this,Wn,n),(s=F(this,nr))==null||s.removeObserver(this),de(this,nr,F(this,Un).getMutationCache().build(F(this,Un),this.options)),F(this,nr).addObserver(this),F(this,nr).execute(r)}},Un=new WeakMap,js=new WeakMap,nr=new WeakMap,Wn=new WeakMap,Qn=new WeakSet,Kc=function(){var n;const r=((n=F(this,nr))==null?void 0:n.state)??rw();de(this,js,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Uf=function(r){St.batch(()=>{var n,s,i,l,a,c,u,g;if(F(this,Wn)&&this.hasListeners()){const d=F(this,js).variables,_=F(this,js).context,v={client:F(this,Un),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=F(this,Wn)).onSuccess)==null||s.call(n,r.data,d,_,v)}catch(x){Promise.reject(x)}try{(l=(i=F(this,Wn)).onSettled)==null||l.call(i,r.data,null,d,_,v)}catch(x){Promise.reject(x)}}else if((r==null?void 0:r.type)==="error"){try{(c=(a=F(this,Wn)).onError)==null||c.call(a,r.error,d,_,v)}catch(x){Promise.reject(x)}try{(g=(u=F(this,Wn)).onSettled)==null||g.call(u,void 0,r.error,d,_,v)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(F(this,js))})})},Ny),wn,Ry,DN=(Ry=class extends fa{constructor(t={}){super();xe(this,wn);this.config=t,de(this,wn,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??km(s,r);let l=this.get(i);return l||(l=new EN({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){F(this,wn).has(t.queryHash)||(F(this,wn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,wn).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,wn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){St.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,wn).get(t)}getAll(){return[...F(this,wn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>t_(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>t_(t,n)):r}notify(t){St.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){St.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){St.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},wn=new WeakMap,Ry),ht,Ns,Rs,Uo,Wo,Ps,Vo,qo,Py,LN=(Py=class{constructor(e={}){xe(this,ht);xe(this,Ns);xe(this,Rs);xe(this,Uo);xe(this,Wo);xe(this,Ps);xe(this,Vo);xe(this,qo);de(this,ht,e.queryCache||new DN),de(this,Ns,e.mutationCache||new TN),de(this,Rs,e.defaultOptions||{}),de(this,Uo,new Map),de(this,Wo,new Map),de(this,Ps,0)}mount(){nc(this,Ps)._++,F(this,Ps)===1&&(de(this,Vo,Cm.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ht).onFocus())})),de(this,qo,Su.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ht).onOnline())})))}unmount(){var e,t;nc(this,Ps)._--,F(this,Ps)===0&&((e=F(this,Vo))==null||e.call(this),de(this,Vo,void 0),(t=F(this,qo))==null||t.call(this),de(this,qo,void 0))}isFetching(e){return F(this,ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Ns).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,ht).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,ht).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Us(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return F(this,ht).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=F(this,ht).get(n.queryHash),i=s==null?void 0:s.state.data,l=fN(t,i);if(l!==void 0)return F(this,ht).build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return St.batch(()=>F(this,ht).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,ht).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,ht);St.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,ht);return St.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=St.batch(()=>F(this,ht).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Qt).catch(Qt)}invalidateQueries(e,t={}){return St.batch(()=>(F(this,ht).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=St.batch(()=>F(this,ht).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Qt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Qt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,ht).build(this,t);return r.isStaleByTime(Us(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qt).catch(Qt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qt).catch(Qt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Su.isOnline()?F(this,Ns).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,ht)}getMutationCache(){return F(this,Ns)}getDefaultOptions(){return F(this,Rs)}setDefaultOptions(e){de(this,Rs,e)}setQueryDefaults(e,t){F(this,Uo).set(Mi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Uo).values()],r={};return t.forEach(n=>{Sl(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){F(this,Wo).set(Mi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Wo).values()],r={};return t.forEach(n=>{Sl(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Rs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=km(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===Em&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Rs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,ht).clear(),F(this,Ns).clear()}},ht=new WeakMap,Ns=new WeakMap,Rs=new WeakMap,Uo=new WeakMap,Wo=new WeakMap,Ps=new WeakMap,Vo=new WeakMap,qo=new WeakMap,Py),nw=C.createContext(void 0),is=e=>{const t=C.useContext(nw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},MN=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(nw.Provider,{value:e,children:t})),sw=C.createContext(!1),ON=()=>C.useContext(sw);sw.Provider;function IN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var FN=C.createContext(IN()),BN=()=>C.useContext(FN),$N=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?jm(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},HN=e=>{C.useEffect(()=>{e.clearReset()},[e])},zN=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||jm(r,[e.error,n])),UN=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},WN=(e,t)=>e.isLoading&&e.isFetching&&!t,VN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,c_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function iw(e,t,r){var _,v,x,y;const n=ON(),s=BN(),i=is(),l=i.defaultQueryOptions(e);(v=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||v.call(_,l);const a=i.getQueryCache().get(l.queryHash);l._optimisticResults=n?"isRestoring":"optimistic",UN(l),$N(l,s,a),HN(s);const c=!i.getQueryCache().get(l.queryHash),[u]=C.useState(()=>new t(i,l)),g=u.getOptimisticResult(l),d=!n&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(h=>{const p=d?u.subscribe(St.batchCalls(h)):Qt;return u.updateResult(),p},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(l)},[l,u]),VN(l,g))throw c_(l,u,s);if(zN({result:g,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw g.error;if((y=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||y.call(x,l,g),l.experimental_prefetchInRender&&!Cl.isServer()&&WN(g,n)){const h=c?c_(l,u,s):a==null?void 0:a.promise;h==null||h.catch(Qt).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?g:u.trackResult(g)}function De(e,t){return iw(e,ew)}function Gn(e,t){const r=is(),[n]=C.useState(()=>new AN(r,e));C.useEffect(()=>{n.setOptions(e)},[n,e]);const s=C.useSyncExternalStore(C.useCallback(l=>n.subscribe(St.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=C.useCallback((l,a)=>{n.mutate(l,a).catch(Qt)},[n]);if(s.error&&jm(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function qN(e,t){return iw(e,RN)}function KN(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,i,l=[],a="",c=e.split("/");for(c[0]||c.shift();s=c.shift();)r=s[0],r==="*"?(l.push(r),a+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),i=s.indexOf(".",1),l.push(s.substring(1,~n?n:~i?i:s.length)),a+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(a+=(~n?"?":"")+"\\"+s.substring(i))):a+="/"+s;return{keys:l,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var ow={exports:{}},aw={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var ea=C;function GN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var QN=typeof Object.is=="function"?Object.is:GN,YN=ea.useState,ZN=ea.useEffect,XN=ea.useLayoutEffect,JN=ea.useDebugValue;function eR(e,t){var r=t(),n=YN({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return XN(function(){s.value=r,s.getSnapshot=t,lh(s)&&i({inst:s})},[e,r,t]),ZN(function(){return lh(s)&&i({inst:s}),e(function(){lh(s)&&i({inst:s})})},[e]),JN(r),r}function lh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!QN(e,r)}catch{return!0}}function tR(e,t){return t()}var rR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tR:eR;aw.useSyncExternalStore=ea.useSyncExternalStore!==void 0?ea.useSyncExternalStore:rR;ow.exports=aw;var nR=ow.exports;const sR=qu.useInsertionEffect,iR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lw=iR?C.useLayoutEffect:C.useEffect,oR=sR||lw,Rm=e=>{const t=C.useRef([e,(...r)=>t[0](...r)]).current;return oR(()=>{t[0]=e}),t[1]},aR="popstate",Pm="pushState",Tm="replaceState",lR="hashchange",u_=[aR,Pm,Tm,lR],cR=e=>{for(const t of u_)addEventListener(t,e);return()=>{for(const t of u_)removeEventListener(t,e)}},cw=(e,t)=>nR.useSyncExternalStore(cR,e,t),d_=()=>location.search,uR=({ssrSearch:e}={})=>cw(d_,e!=null?()=>e:d_),h_=()=>location.pathname,dR=({ssrPath:e}={})=>cw(h_,e!=null?()=>e:h_),hR=(e,{replace:t=!1,state:r=null}={})=>history[t?Tm:Pm](r,"",e),fR=(e={})=>[dR(e),hR],f_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[f_]>"u"){for(const e of[Pm,Tm]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,f_,{value:!0})}const pR=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",uw=(e="")=>e==="/"?"":e,mR=(e,t)=>e[0]==="~"?e.slice(1):uw(t)+e,gR=(e="",t)=>pR(p_(uw(e)),p_(t)),p_=e=>{try{return decodeURI(e)}catch{return e}},dw={hook:fR,searchHook:uR,parser:KN,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},hw=C.createContext(dw),Hi=()=>C.useContext(hw),fw={},pw=C.createContext(fw),cd=()=>C.useContext(pw),Ul=e=>{const[t,r]=e.hook(e);return[gR(e.base,t),Rm((n,s)=>e.aroundNav(r,mR(n,e.base),s))]},Ur=()=>Ul(Hi()),Am=(e,t,r,n)=>{const{pattern:s,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[a,...c]=l;return a!==void 0?[!0,(()=>{const u=i!==!1?Object.fromEntries(i.map((d,_)=>[d,c[_]])):l.groups;let g={...c};return u&&Object.assign(g,u),g})(),...n?[a]:[]]:[!1,null]},vR=e=>Am(Hi().parser,e,Ur()[0]),mw=({children:e,...t})=>{var g,d,_;const r=Hi(),n=t.hook?dw:r;let s=n;const[i,l=t.ssrSearch??""]=((g=t.ssrPath)==null?void 0:g.split("?"))??[];i&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs),t.searchHook=t.searchHook??((_=t.hook)==null?void 0:_.searchHook);let a=C.useRef({}),c=a.current,u=c;for(let v in n){const x=v==="base"?n[v]+(t[v]??""):t[v]??n[v];c===u&&x!==u[v]&&(a.current=u={...u}),u[v]=x,(x!==n[v]||x!==s[v])&&(s=u)}return C.createElement(hw.Provider,{value:s,children:e})},m_=({children:e,component:t},r)=>t?C.createElement(t,{params:r}):typeof e=="function"?e(r):e,_R=e=>{let t=C.useRef(fw);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},Pt=({path:e,nest:t,match:r,...n})=>{const s=Hi(),[i]=Ul(s),[l,a,c]=r??Am(s.parser,e,i,t),u=_R({...cd(),...a});if(!l)return null;const g=c?C.createElement(mw,{base:c},m_(n,u)):m_(n,u);return C.createElement(pw.Provider,{value:u,children:g})},ur=C.forwardRef((e,t)=>{const r=Hi(),[n,s]=Ul(r),{to:i="",href:l=i,onClick:a,asChild:c,children:u,className:g,replace:d,state:_,transition:v,...x}=e,y=Rm(p=>{p.ctrlKey||p.metaKey||p.altKey||p.shiftKey||p.button!==0||(a==null||a(p),p.defaultPrevented||(p.preventDefault(),s(l,e)))}),h=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return c&&C.isValidElement(u)?C.cloneElement(u,{onClick:y,href:h}):C.createElement("a",{...x,onClick:y,href:h,className:g!=null&&g.call?g(n===l):g,children:u,ref:t})}),gw=e=>Array.isArray(e)?e.flatMap(t=>gw(t&&t.type===C.Fragment?t.props.children:t)):[e],xR=({children:e,location:t})=>{const r=Hi(),[n]=Ul(r);for(const s of gw(e)){let i=0;if(C.isValidElement(s)&&(i=Am(r.parser,s.props.path,t||n,s.props.nest))[0])return C.cloneElement(s,{match:i})}return null},Va=e=>{const{to:t,href:r=t}=e,n=Hi(),[,s]=Ul(n),i=Rm(()=>s(t||r,e)),{ssrContext:l}=n;return lw(()=>{i()},[]),l&&(l.redirectTo=t),null};async function yR(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{const r=await e.json();if(typeof r!="object"||r===null)return null;const n=r;return{error:typeof n.error=="string"?n.error:void 0,message:typeof n.message=="string"?n.message:void 0}}catch{return null}}async function be(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok){const n=await yR(r),s=(n==null?void 0:n.message)??(n==null?void 0:n.error),i=new Error(s?`${r.status} ${r.statusText}: ${s} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw i.status=r.status,i.code=n==null?void 0:n.error,i}return r.json()}const me={getStatus:()=>be("/v1/status"),getBootstrap:()=>be("/v1/bootstrap"),getRecentEvents:(e,t=100)=>{const r=new URLSearchParams;return e&&e.length>0&&r.set("kinds",e.join(",")),r.set("limit",String(t)),be(`/v1/events/recent?${r.toString()}`)},getActivityEvents:e=>{const t=new URLSearchParams;e!=null&&e.kinds&&e.kinds.length>0&&t.set("kinds",e.kinds.join(",")),e!=null&&e.outcome&&t.set("outcome",e.outcome),e!=null&&e.requestId&&t.set("requestId",e.requestId),(e==null?void 0:e.beforeId)!==void 0&&t.set("beforeId",String(e.beforeId)),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/activity-events${r?`?${r}`:""}`)},getActivityEvent:e=>be(`/v1/activity-events/${encodeURIComponent(String(e))}`),getClaudeAuth:()=>be("/v1/auth/claude"),installClaudeCode:()=>be("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>be("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:e=>be(e!=null&&e.singleDrip?"/v1/setup/drip?singleDrip=true":"/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>be("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),restartDaemon:e=>be("/api/admin/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),stopDaemon:()=>be("/api/admin/stop",{method:"POST"}),getSolverNets:()=>be("/v1/solvernets"),updateSolverNet:(e,t)=>be(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>be("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),restake:e=>be(`/v1/setup/restake/${encodeURIComponent(String(e))}`,{method:"POST"}),retryAgentBinding:e=>be("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),retryBootstrap:()=>be("/v1/setup/bootstrap/retry",{method:"POST"}),updateHarnessMode:e=>be("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>be("/api/hermes/doctor"),codexDoctor:()=>be("/api/codex/doctor"),harnessReadiness:e=>be(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>be("/v1/launcher/status"),fetchLauncherTasks:(e={})=>{const t=new URLSearchParams;e.cursor&&t.set("cursor",e.cursor),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>be(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>be("/v1/solvernets/drafts"),getDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>be("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}`),listLaunched:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status);const r=t.toString();return be(`/v1/solvernets/launched${r?`?${r}`:""}`)},listRegistry:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.refresh&&t.set("refresh","1");const r=t.toString();return be(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>be(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{const 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));const r=t.toString();return be(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>be("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>be("/v1/operator/joined")},captures:{listPending:()=>be("/api/captures/pending"),get:e=>be(`/api/captures/${encodeURIComponent(e)}`),approve:e=>be(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>be(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>be("/api/captures/trust-repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},discovery:{listPluginPublications:e=>{const t=new URLSearchParams;e!=null&&e.solverType&&t.set("solverType",e.solverType),e!=null&&e.builderAgentId&&t.set("builderAgentId",e.builderAgentId),(e==null?void 0:e.includeRevoked)!==void 0&&t.set("includeRevoked",String(e.includeRevoked));const r=t.toString();return be(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/plugin-scores?${r.toString()}`)},getSolverNetOperatorCount:e=>{const t=new URLSearchParams({cid:e});return be(`/v1/discovery/solvernet-operator-count?${t.toString()}`)}}};async function bR(){const 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 wR(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const s=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json"},cache:"no-store",signal:r.signal});return s.status===502||s.status===503||s.status===504?{ok:!1,error:`daemon unavailable (HTTP ${s.status})`}:{ok:!0,error:null}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}function vw(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:s=3500,probeUrl:i="/v1/status"}=e,[l,a]=C.useState({status:"connected",lastConnectedAt:Date.now()}),c=C.useRef(0),u=C.useRef(t),g=C.useRef(!1);return C.useEffect(()=>{g.current=!1;let d=null;const _=x=>{g.current||(d=setTimeout(v,x))},v=async()=>{const x=await wR(i,s);if(g.current)return;if(x.ok){c.current=0,u.current=t,a(h=>h.status==="connected"?h:{status:"connected",lastConnectedAt:Date.now()}),_(t);return}c.current+=1,c.current>=r?(a(h=>h.status==="disconnected"?{...h,attempts:h.attempts+1,lastError:x.error}:{status:"disconnected",since:Date.now(),lastError:x.error,attempts:1}),u.current=Math.min(Math.max(u.current*2,t*2),n),_(u.current)):_(t)};return v(),()=>{g.current=!0,d!==null&&clearTimeout(d)}},[t,r,n,s,i]),l}/**
49
+ * @license lucide-react v0.454.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */const SR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_w=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
54
+ * @license lucide-react v0.454.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */var CR={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"};/**
59
+ * @license lucide-react v0.454.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */const kR=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:l,...a},c)=>C.createElement("svg",{ref:c,...CR,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:_w("lucide",s),...a},[...l.map(([u,g])=>C.createElement(u,g)),...Array.isArray(i)?i:[i]]));/**
64
+ * @license lucide-react v0.454.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const dt=(e,t)=>{const r=C.forwardRef(({className:n,...s},i)=>C.createElement(kR,{ref:i,iconNode:t,className:_w(`lucide-${SR(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
69
+ * @license lucide-react v0.454.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const ER=dt("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"}]]);/**
74
+ * @license lucide-react v0.454.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const jR=dt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
79
+ * @license lucide-react v0.454.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const NR=dt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
84
+ * @license lucide-react v0.454.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const ud=dt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
89
+ * @license lucide-react v0.454.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const xw=dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
94
+ * @license lucide-react v0.454.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const Dm=dt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
99
+ * @license lucide-react v0.454.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const RR=dt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
104
+ * @license lucide-react v0.454.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const PR=dt("Compass",[["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"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
109
+ * @license lucide-react v0.454.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const TR=dt("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"}]]);/**
114
+ * @license lucide-react v0.454.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const No=dt("ExternalLink",[["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"}]]);/**
119
+ * @license lucide-react v0.454.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const AR=dt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
124
+ * @license lucide-react v0.454.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const DR=dt("KeyRound",[["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"}]]);/**
129
+ * @license lucide-react v0.454.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const LR=dt("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
134
+ * @license lucide-react v0.454.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const Wf=dt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
139
+ * @license lucide-react v0.454.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const MR=dt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
144
+ * @license lucide-react v0.454.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const OR=dt("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"}]]);/**
149
+ * @license lucide-react v0.454.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const IR=dt("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"}]]);/**
154
+ * @license lucide-react v0.454.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const FR=dt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
159
+ * @license lucide-react v0.454.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const BR=dt("RefreshCw",[["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"}]]);/**
164
+ * @license lucide-react v0.454.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const $R=dt("Share2",[["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"}]]);/**
169
+ * @license lucide-react v0.454.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const HR=dt("ShieldAlert",[["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"}]]);/**
174
+ * @license lucide-react v0.454.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const Lm=dt("TriangleAlert",[["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"}]]);/**
179
+ * @license lucide-react v0.454.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const kl=dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function yw(e){const[t,r]=C.useState([]),[n,s]=C.useState(!1);return C.useEffect(()=>{const i=e&&e.length>0?`?kinds=${e.join(",")}`:"",l=new EventSource(`/v1/events${i}`,{withCredentials:!0});return l.onopen=()=>s(!0),l.onerror=()=>s(!1),l.onmessage=a=>{try{const c=JSON.parse(a.data);r(u=>[...u.slice(-499),c])}catch{}},()=>{l.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function g_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function os(...e){return t=>{let r=!1;const n=e.map(s=>{const i=g_(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():g_(e[s],null)}}}}function He(...e){return C.useCallback(os(...e),e)}var zR=Symbol.for("react.lazy"),Cu=qu[" use ".trim().toString()];function UR(e){return typeof e=="object"&&e!==null&&"then"in e}function bw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zR&&"_payload"in e&&UR(e._payload)}function Mm(e){const t=WR(e),r=C.forwardRef((n,s)=>{let{children:i,...l}=n;bw(i)&&typeof Cu=="function"&&(i=Cu(i._payload));const a=C.Children.toArray(i),c=a.find(qR);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var ww=Mm("Slot");function WR(e){const t=C.forwardRef((r,n)=>{let{children:s,...i}=r;if(bw(s)&&typeof Cu=="function"&&(s=Cu(s._payload)),C.isValidElement(s)){const l=GR(s),a=KR(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VR=Symbol("radix.slottable");function qR(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VR}function KR(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function GR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Sw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Sw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Cw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Sw(e))&&(n&&(n+=" "),n+=t);return n}const v_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,__=Cw,dd=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return __(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(u=>{const g=r==null?void 0:r[u],d=i==null?void 0:i[u];if(g===null)return null;const _=v_(g)||v_(d);return s[u][_]}),a=r&&Object.entries(r).reduce((u,g)=>{let[d,_]=g;return _===void 0||(u[d]=_),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,g)=>{let{class:d,className:_,...v}=g;return Object.entries(v).every(x=>{let[y,h]=x;return Array.isArray(h)?h.includes({...i,...a}[y]):{...i,...a}[y]===h})?[...u,d,_]:u},[]);return __(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Om="-",QR=e=>{const t=ZR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Om);return a[0]===""&&a.length!==1&&a.shift(),kw(a,t)||YR(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},kw=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?kw(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Om);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},x_=/^\[(.+)\]$/,YR=e=>{if(x_.test(e)){const t=x_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},ZR=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return JR(Object.entries(e.classGroups),r).forEach(([i,l])=>{Vf(l,n,i,t)}),n},Vf=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:y_(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(XR(s)){Vf(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{Vf(l,y_(t,i),r,n)})})},y_=(e,t)=>{let r=e;return t.split(Om).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},XR=e=>e.isThemeGetter,JR=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,e2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},Ew="!",t2=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,l=a=>{const c=[];let u=0,g=0,d;for(let h=0;h<a.length;h++){let p=a[h];if(u===0){if(p===s&&(n||a.slice(h,h+i)===t)){c.push(a.slice(g,h)),g=h+i;continue}if(p==="/"){d=h;continue}}p==="["?u++:p==="]"&&u--}const _=c.length===0?a:a.substring(g),v=_.startsWith(Ew),x=v?_.substring(1):_,y=d&&d>g?d-g:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}};return r?a=>r({className:a,parseClassName:l}):l},r2=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},n2=e=>({cache:e2(e.cacheSize),parseClassName:t2(e),...QR(e)}),s2=/\s+/,i2=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(s2);let a="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{modifiers:g,hasImportantModifier:d,baseClassName:_,maybePostfixModifierPosition:v}=r(u);let x=!!v,y=n(x?_.substring(0,v):_);if(!y){if(!x){a=u+(a.length>0?" "+a:a);continue}if(y=n(_),!y){a=u+(a.length>0?" "+a:a);continue}x=!1}const h=r2(g).join(":"),p=d?h+Ew:h,f=p+y;if(i.includes(f))continue;i.push(f);const m=s(y,x);for(let b=0;b<m.length;++b){const w=m[b];i.push(p+w)}a=u+(a.length>0?" "+a:a)}return a};function o2(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=jw(t))&&(n&&(n+=" "),n+=r);return n}const jw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=jw(e[n]))&&(r&&(r+=" "),r+=t);return r};function a2(e,...t){let r,n,s,i=l;function l(c){const u=t.reduce((g,d)=>d(g),e());return r=n2(u),n=r.cache.get,s=r.cache.set,i=a,a(c)}function a(c){const u=n(c);if(u)return u;const g=i2(c,r);return s(c,g),g}return function(){return i(o2.apply(null,arguments))}}const tt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Nw=/^\[(?:([a-z-]+):)?(.+)\]$/i,l2=/^\d+\/\d+$/,c2=new Set(["px","full","screen"]),u2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d2=/\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$/,h2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>Ro(e)||c2.has(e)||l2.test(e),hs=e=>pa(e,"length",w2),Ro=e=>!!e&&!Number.isNaN(Number(e)),ch=e=>pa(e,"number",Ro),Ta=e=>!!e&&Number.isInteger(Number(e)),m2=e=>e.endsWith("%")&&Ro(e.slice(0,-1)),Te=e=>Nw.test(e),fs=e=>u2.test(e),g2=new Set(["length","size","percentage"]),v2=e=>pa(e,g2,Rw),_2=e=>pa(e,"position",Rw),x2=new Set(["image","url"]),y2=e=>pa(e,x2,C2),b2=e=>pa(e,"",S2),Aa=()=>!0,pa=(e,t,r)=>{const n=Nw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},w2=e=>d2.test(e)&&!h2.test(e),Rw=()=>!1,S2=e=>f2.test(e),C2=e=>p2.test(e),k2=()=>{const e=tt("colors"),t=tt("spacing"),r=tt("blur"),n=tt("brightness"),s=tt("borderColor"),i=tt("borderRadius"),l=tt("borderSpacing"),a=tt("borderWidth"),c=tt("contrast"),u=tt("grayscale"),g=tt("hueRotate"),d=tt("invert"),_=tt("gap"),v=tt("gradientColorStops"),x=tt("gradientColorStopPositions"),y=tt("inset"),h=tt("margin"),p=tt("opacity"),f=tt("padding"),m=tt("saturate"),b=tt("scale"),w=tt("sepia"),k=tt("skew"),E=tt("space"),S=tt("translate"),j=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Te,t],T=()=>[Te,t],L=()=>["",On,hs],$=()=>["auto",Ro,Te],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",Te],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[Ro,Te];return{cacheSize:500,separator:":",theme:{colors:[Aa],spacing:[On,hs],blur:["none","",fs,Te],brightness:O(),borderColor:[e],borderRadius:["none","","full",fs,Te],borderSpacing:T(),borderWidth:L(),contrast:O(),grayscale:P(),hueRotate:O(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[m2,hs],inset:M(),margin:M(),opacity:O(),padding:T(),saturate:O(),scale:O(),sepia:P(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[fs]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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"],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:[...z(),Te]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ta,Te]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Te]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ta,Te]}],"grid-cols":[{"grid-cols":[Aa]}],"col-start-end":[{col:["auto",{span:["full",Ta,Te]},Te]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Aa]}],"row-start-end":[{row:["auto",{span:[Ta,Te]},Te]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Te]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Te,t]}],"min-w":[{"min-w":[Te,t,"min","max","fit"]}],"max-w":[{"max-w":[Te,t,"none","full","min","max","fit","prose",{screen:[fs]},fs]}],h:[{h:[Te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fs,hs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ch]}],"font-family":[{font:[Aa]}],"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:["tighter","tight","normal","wide","wider","widest",Te]}],"line-clamp":[{"line-clamp":["none",Ro,ch]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,Te]}],"list-image":[{"list-image":["none",Te]}],"list-style-type":[{list:["none","disc","decimal",Te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,hs]}],"underline-offset":[{"underline-offset":["auto",On,Te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),_2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",v2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},y2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:W()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[On,Te]}],"outline-w":[{outline:[On,hs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[On,hs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fs,b2]}],"shadow-color":[{shadow:[Aa]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fs,Te]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[d]}],saturate:[{saturate:[m]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Te]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",Te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ta,Te]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[On,hs,ch]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},E2=a2(k2);function J(...e){return E2(Cw(e))}const Im=dd("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"}}),oe=C.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const l=n?ww:"button";return o.jsx(l,{className:J(Im({variant:t,size:r,className:e})),ref:i,...s})});oe.displayName="Button";const we=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("rounded-lg border border-border bg-card text-card-foreground",e),...t}));we.displayName="Card";const Zt=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("flex flex-col gap-1.5 p-6 pb-3",e),...t}));Zt.displayName="CardHeader";const hn=C.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:J("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",e),...t}));hn.displayName="CardTitle";const Qs=C.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:J("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));Qs.displayName="CardDescription";const Qe=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("px-6 pb-6",e),...t}));Qe.displayName="CardContent";const j2=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("flex items-center px-6 pb-6 pt-0",e),...t}));j2.displayName="CardFooter";function N2(e){const t=R2(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(T2);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function R2(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=D2(s),a=A2(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var P2=Symbol("radix.slottable");function T2(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===P2}function A2(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function D2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var L2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=L2.reduce((e,t)=>{const r=N2(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Pw(e,t){e&&ld.flushSync(()=>e.dispatchEvent(t))}var es=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function M2(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Vt=e=>{const{present:t,children:r}=e,n=O2(t),s=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),i=He(n.ref,I2(s));return typeof r=="function"||n.isPresent?C.cloneElement(s,{ref:i}):null};Vt.displayName="Presence";function O2(e){const[t,r]=C.useState(),n=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),l=e?"mounted":"unmounted",[a,c]=M2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=wc(n.current);i.current=a==="mounted"?u:"none"},[a]),es(()=>{const u=n.current,g=s.current;if(g!==e){const _=i.current,v=wc(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(g&&_!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),es(()=>{if(t){let u;const g=t.ownerDocument.defaultView??window,d=v=>{const y=wc(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&y&&(c("ANIMATION_END"),!s.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",u=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},_=v=>{v.target===t&&(i.current=wc(n.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{g.clearTimeout(u),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function wc(e){return(e==null?void 0:e.animationName)||"none"}function I2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function F2(e,t){const r=C.createContext(t),n=i=>{const{children:l,...a}=i,c=C.useMemo(()=>a,Object.values(a));return o.jsx(r.Provider,{value:c,children:l})};n.displayName=e+"Provider";function s(i){const l=C.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function mn(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l),c=r.length;r=[...r,l];const u=d=>{var p;const{scope:_,children:v,...x}=d,y=((p=_==null?void 0:_[e])==null?void 0:p[c])||a,h=C.useMemo(()=>x,Object.values(x));return o.jsx(y.Provider,{value:h,children:v})};u.displayName=i+"Provider";function g(d,_){var y;const v=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,x=C.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,B2(s,...t)]}function B2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function zt(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var $2=C.createContext(void 0);function Fm(e){const t=C.useContext($2);return e||t||"ltr"}function H2(e,[t,r]){return Math.min(r,Math.max(t,e))}function _e(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function z2(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Bm="ScrollArea",[Tw]=mn(Bm),[U2,Wr]=Tw(Bm),Aw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...l}=e,[a,c]=C.useState(null),[u,g]=C.useState(null),[d,_]=C.useState(null),[v,x]=C.useState(null),[y,h]=C.useState(null),[p,f]=C.useState(0),[m,b]=C.useState(0),[w,k]=C.useState(!1),[E,S]=C.useState(!1),j=He(t,M=>c(M)),R=Fm(s);return o.jsx(U2,{scope:r,type:n,dir:R,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:g,content:d,onContentChange:_,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:w,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:h,scrollbarYEnabled:E,onScrollbarYEnabledChange:S,onCornerWidthChange:f,onCornerHeightChange:b,children:o.jsx(ze.div,{dir:R,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});Aw.displayName=Bm;var Dw="ScrollAreaViewport",Lw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,l=Wr(Dw,r),a=C.useRef(null),c=He(t,a,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.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:s}),o.jsx(ze.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Lw.displayName=Dw;var Tn="ScrollAreaScrollbar",$m=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Tn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):l(!0),()=>{a?i(!1):l(!1)}),[a,i,l]),s.type==="hover"?o.jsx(W2,{...n,ref:t,forceMount:r}):s.type==="scroll"?o.jsx(V2,{...n,ref:t,forceMount:r}):s.type==="auto"?o.jsx(Mw,{...n,ref:t,forceMount:r}):s.type==="always"?o.jsx(Hm,{...n,ref:t}):null});$m.displayName=Tn;var W2=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Tn,e.__scopeScrollArea),[i,l]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),l(!0)},g=()=>{c=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",g)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(Vt,{present:r||i,children:o.jsx(Mw,{"data-state":i?"visible":"hidden",...n,ref:t})})}),V2=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Tn,e.__scopeScrollArea),i=e.orientation==="horizontal",l=fd(()=>c("SCROLL_END"),100),[a,c]=z2("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 C.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const u=s.viewport,g=i?"scrollLeft":"scrollTop";if(u){let d=u[g];const _=()=>{const v=u[g];d!==v&&(c("SCROLL"),l()),d=v};return u.addEventListener("scroll",_),()=>u.removeEventListener("scroll",_)}},[s.viewport,i,c,l]),o.jsx(Vt,{present:r||a!=="hidden",children:o.jsx(Hm,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Mw=C.forwardRef((e,t)=>{const r=Wr(Tn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,l]=C.useState(!1),a=e.orientation==="horizontal",c=fd(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;l(a?u:g)}},10);return ta(r.viewport,c),ta(r.content,c),o.jsx(Vt,{present:n||i,children:o.jsx(Hm,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Hm=C.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=Wr(Tn,e.__scopeScrollArea),i=C.useRef(null),l=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=$w(a.viewport,a.content),g={...n,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:_=>i.current=_,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:_=>l.current=_};function d(_,v){return Z2(_,l.current,a,v)}return r==="horizontal"?o.jsx(q2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const _=s.viewport.scrollLeft,v=b_(_,a,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollLeft=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollLeft=d(_,s.dir))}}):r==="vertical"?o.jsx(K2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const _=s.viewport.scrollTop,v=b_(_,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollTop=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollTop=d(_))}}):null}),q2=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Wr(Tn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=He(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(Iw,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hd(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(i.viewport){const _=i.viewport.scrollLeft+g.deltaX;e.onWheelScroll(_),zw(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Eu(l.paddingLeft),paddingEnd:Eu(l.paddingRight)}})}})}),K2=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Wr(Tn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=He(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(Iw,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hd(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(i.viewport){const _=i.viewport.scrollTop+g.deltaY;e.onWheelScroll(_),zw(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Eu(l.paddingTop),paddingEnd:Eu(l.paddingBottom)}})}})}),[G2,Ow]=Tw(Tn),Iw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:g,onResize:d,..._}=e,v=Wr(Tn,r),[x,y]=C.useState(null),h=He(t,j=>y(j)),p=C.useRef(null),f=C.useRef(""),m=v.viewport,b=n.content-n.viewport,w=zt(g),k=zt(c),E=fd(d,10);function S(j){if(p.current){const R=j.clientX-p.current.left,M=j.clientY-p.current.top;u({x:R,y:M})}}return C.useEffect(()=>{const j=R=>{const M=R.target;(x==null?void 0:x.contains(M))&&w(R,b)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[m,x,b,w]),C.useEffect(k,[n,k]),ta(x,E),ta(v.content,E),o.jsx(G2,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:zt(i),onThumbPointerUp:zt(l),onThumbPositionChange:k,onThumbPointerDown:zt(a),children:o.jsx(ze.div,{..._,ref:h,style:{position:"absolute",..._.style},onPointerDown:_e(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),p.current=x.getBoundingClientRect(),f.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),S(j))}),onPointerMove:_e(e.onPointerMove,S),onPointerUp:_e(e.onPointerUp,j=>{const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=f.current,v.viewport&&(v.viewport.style.scrollBehavior=""),p.current=null})})})}),ku="ScrollAreaThumb",Fw=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ow(ku,e.__scopeScrollArea);return o.jsx(Vt,{present:r||s.hasThumb,children:o.jsx(Q2,{ref:t,...n})})}),Q2=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=Wr(ku,r),l=Ow(ku,r),{onThumbPositionChange:a}=l,c=He(t,d=>l.onThumbChange(d)),u=C.useRef(void 0),g=fd(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const d=i.viewport;if(d){const _=()=>{if(g(),!u.current){const v=X2(d,a);u.current=v,a()}};return a(),d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[i.viewport,g,a]),o.jsx(ze.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_e(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),x=d.clientX-v.left,y=d.clientY-v.top;l.onThumbPointerDown({x,y})}),onPointerUp:_e(e.onPointerUp,l.onThumbPointerUp)})});Fw.displayName=ku;var zm="ScrollAreaCorner",Bw=C.forwardRef((e,t)=>{const r=Wr(zm,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?o.jsx(Y2,{...e,ref:t}):null});Bw.displayName=zm;var Y2=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Wr(zm,r),[i,l]=C.useState(0),[a,c]=C.useState(0),u=!!(i&&a);return ta(s.scrollbarX,()=>{var d;const g=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(g),c(g)}),ta(s.scrollbarY,()=>{var d;const g=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(g),l(g)}),u?o.jsx(ze.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Eu(e){return e?parseInt(e,10):0}function $w(e,t){const r=e/t;return isNaN(r)?0:r}function hd(e){const t=$w(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Z2(e,t,r,n="ltr"){const s=hd(r),i=s/2,l=t||i,a=s-l,c=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,g=r.content-r.viewport,d=n==="ltr"?[0,g]:[g*-1,0];return Hw([c,u],d)(e)}function b_(e,t,r="ltr"){const n=hd(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,l=t.content-t.viewport,a=i-n,c=r==="ltr"?[0,l]:[l*-1,0],u=H2(e,c);return Hw([0,l],[0,a])(u)}function Hw(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function zw(e,t){return e>0&&e<t}var X2=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},l=r.left!==i.left,a=r.top!==i.top;(l||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function fd(e,t){const r=zt(e),n=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),C.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ta(e,t){const r=zt(t);es(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var Uw=Aw,J2=Lw,eP=Bw;const Wl=C.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Uw,{ref:n,className:J("relative overflow-hidden",e),...r,children:[o.jsx(J2,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(Ww,{}),o.jsx(eP,{})]}));Wl.displayName=Uw.displayName;const Ww=C.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx($m,{ref:n,orientation:t,className:J("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),...r,children:o.jsx(Fw,{className:"relative flex-1 rounded-full bg-[var(--border-strong)]"})}));Ww.displayName=$m.displayName;const tP="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",rP="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function nP({headline:e}){const[t,r]=C.useState(!1),{events:n}=yw(),s=n.length>0?n[n.length-1]:null;return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:tP,children:"Jinn · starting up"}),o.jsxs("h1",{className:rP,children:[e,"."]}),o.jsx("p",{className:"min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]",children:s?sP(s):"The daemon is booting. This usually takes a second."}),o.jsxs(oe,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(i=>!i),"aria-expanded":t,children:[t?o.jsx(Dm,{}):o.jsx(ud,{}),t?"Hide details":"Show details"]}),t&&o.jsx(we,{className:"bg-[var(--bg-elevated)]",children:o.jsx(Qe,{className:"p-0",children:o.jsx(Wl,{className:"h-64",children:o.jsxs("div",{className:"px-3 py-2 font-mono text-xs",children:[n.length===0&&o.jsx("div",{className:"text-[var(--fg-dim)]",children:"no events yet"}),n.slice().reverse().map(i=>o.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:i.ts.slice(11,19)}),o.jsx("span",{className:J(i.kind==="error"?"text-[var(--break-red)]":i.kind==="system"?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]"),children:i.kind}),o.jsx("span",{className:"text-foreground",children:i.message})]},i.id))]})})})})]})})}function sP(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const iP=dd("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"}}),Ze=C.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:J(iP({variant:t}),e),...r}));Ze.displayName="Alert";const Rt=C.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:J("mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]",e),...t}));Rt.displayName="AlertTitle";const Je=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("text-[12px] [&_p]:leading-relaxed",e),...t}));Je.displayName="AlertDescription";function oP(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l);a.displayName=i+"Context";const c=r.length;r=[...r,l];const u=d=>{var p;const{scope:_,children:v,...x}=d,y=((p=_==null?void 0:_[e])==null?void 0:p[c])||a,h=C.useMemo(()=>x,Object.values(x));return o.jsx(y.Provider,{value:h,children:v})};u.displayName=i+"Provider";function g(d,_){var y;const v=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,x=C.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,aP(s,...t)]}function aP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var lP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vw=lP.reduce((e,t)=>{const r=Mm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Um="Progress",Wm=100,[cP]=oP(Um),[uP,dP]=cP(Um),qw=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=hP,...l}=e;(s||s===0)&&!w_(s)&&console.error(fP(`${s}`,"Progress"));const a=w_(s)?s:Wm;n!==null&&!S_(n,a)&&console.error(pP(`${n}`,"Progress"));const c=S_(n,a)?n:null,u=ju(c)?i(c,a):void 0;return o.jsx(uP,{scope:r,value:c,max:a,children:o.jsx(Vw.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":ju(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Qw(c,a),"data-value":c??void 0,"data-max":a,...l,ref:t})})});qw.displayName=Um;var Kw="ProgressIndicator",Gw=C.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=dP(Kw,r);return o.jsx(Vw.div,{"data-state":Qw(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});Gw.displayName=Kw;function hP(e,t){return`${Math.round(e/t*100)}%`}function Qw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ju(e){return typeof e=="number"}function w_(e){return ju(e)&&!isNaN(e)&&e>0}function S_(e,t){return ju(e)&&!isNaN(e)&&e<=t&&e>=0}function fP(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Wm}\`.`}function pP(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
184
+ - a positive number
185
+ - less than the value passed to \`max\` (or ${Wm} if no \`max\` prop is set)
186
+ - \`null\` or \`undefined\` if the progress is indeterminate.
187
+
188
+ Defaulting to \`null\`.`}var Yw=qw,mP=Gw;const Vm=C.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Yw,{ref:n,className:J("relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]",e),...r,children:o.jsx(mP,{className:"h-full w-full flex-1 bg-[var(--accent-sky)] transition-all",style:{transform:`translateX(-${100-(t??0)}%)`}})}));Vm.displayName=Yw.displayName;const gP={base:"Base","base-sepolia":"Base Sepolia"},vP="font-mono text-[11px] font-medium uppercase tracking-[0.14em]";function _P({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:s=!1}){var E;const[i,l]=C.useState(!1),[a,c]=C.useState(null),[u,g]=C.useState(0),d=C.useRef(!1),[_,v]=C.useState({state:"idle"});C.useEffect(()=>{if(a===null)return;g(Math.max(0,Math.floor((Date.now()-a)/1e3)));const S=window.setInterval(()=>{g(Math.max(0,Math.floor((Date.now()-a)/1e3)))},1e3);return()=>window.clearInterval(S)},[a]);const x=async()=>{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)},y=async()=>{var S;d.current=!0,c(Date.now()),g(0),v({state:"requesting"});try{const j=await me.triggerDrip();c(null),j.ok?v({state:"sent",txHash:j.txHash??((S=j.txHashes)==null?void 0:S.at(-1)),txHashes:j.txHashes,attempts:j.attempts,balanceWei:j.balanceWei,targetWei:j.targetWei}):j.rateLimited||j.reason&&/rate|claimed|429/i.test(j.reason)?v({state:"rate_limited",reason:j.reason??"faucet rate-limited"}):v({state:"failed",reason:j.reason??"faucet funding failed"})}catch(j){c(null),v({state:"failed",reason:j instanceof Error?j.message:"drip failed"})}},h=C.useRef(t);C.useEffect(()=>{h.current!==t&&(h.current=t,v({state:"idle"}),d.current&&y())},[t]);const p=S=>{if(!S)return"unknown";try{const j=Number(BigInt(S))/1e18;return`${j.toFixed(j<.001?4:3)} ETH`}catch{return`${S} wei`}},f=p(t),m=C.useMemo(()=>_.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(u/60*92))),[_.state,u]),b=_.state==="sent"?((E=_.txHashes)==null?void 0:E.length)??_.attempts??(_.txHash?1:0):0,w=_.state==="sent"&&_.balanceWei!==void 0&&_.targetWei!==void 0&&(()=>{try{return BigInt(_.balanceWei)>=BigInt(_.targetWei)}catch{return!1}})(),k=_.state==="sent"&&!w;return o.jsxs(Ze,{variant:"warning",className:"flex flex-col gap-4 border-l-2 px-6 py-5",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(Rt,{className:J(vP,"text-[var(--accent-gold)]"),children:"Action needed · fund the master EOA"}),o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:"auto-detected on chain"})]}),o.jsxs(Je,{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"break-all font-mono text-xs text-foreground",children:e}),o.jsxs("span",{className:"font-mono text-xs text-[var(--fg-muted)]",children:["send at least ",f," on ",gP[n??""]??"this chain"]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",onClick:y,disabled:_.state==="requesting"||w,className:"bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]",children:_.state==="requesting"?"Funding...":w?"Faucet funded":k?"Fund more":"Fund from faucet"}),o.jsx(oe,{type:"button",variant:"secondary",onClick:x,children:i?"Copied":"Copy address"}),o.jsx(oe,{asChild:!0,variant:"ghost",children:o.jsxs("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(No,{}),"View on explorer"]})})]}),_.state==="sent"&&o.jsxs("p",{className:J("font-mono text-[11px]",w?"text-[var(--vow-green)]":"text-[var(--accent-gold)]"),children:[w?"Faucet funding complete":"Faucet funding partial",b>0?` (${b} drip${b===1?"":"s"})`:"",".",_.balanceWei&&_.targetWei?` Balance ${p(_.balanceWei)} / target ${p(_.targetWei)}.`:"",k?' Click "Fund more" to top up.':"",_.txHash&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:`${r}/tx/${_.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent-sky)] hover:underline",children:"view latest tx"})]})]}),_.state==="requesting"&&o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(Vm,{value:m,className:"h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]"}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:["Requesting faucet drips for ",xP(e),". Elapsed ",u,"s; this can take about a minute on a fresh wallet."]})]}),_.state==="rate_limited"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--wane)]",children:"Faucet rate-limited. Send manually or wait before trying again."}),_.state==="failed"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--break-red)]",children:_.reason}),s&&o.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."})]})}const xP=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var Zw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(l,a,c){var u=this&&this.__decorate||function(m,b,w,k){var E,S=arguments.length,j=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(m,b,w,k);else for(var R=m.length-1;R>=0;R--)(E=m[R])&&(j=(S<3?E(j):S>3?E(b,w,j):E(b,w))||j);return S>3&&j&&Object.defineProperty(b,w,j),j},g=this&&this.__param||function(m,b){return function(w,k){b(w,k,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),_=c(6114),v=c(9924),x=c(844),y=c(5596),h=c(4725),p=c(3656);let f=a.AccessibilityManager=class extends x.Disposable{constructor(m,b){super(),this._terminal=m,this._renderService=b,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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 v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(w=>this._handleResize(w.rows))),this.register(this._terminal.onRender(w=>this._refreshRows(w.start,w.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(w=>this._handleChar(w))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
189
+ `))),this.register(this._terminal.onA11yTab(w=>this._handleTab(w))),this.register(this._terminal.onKey(w=>this._handleKey(w.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new y.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,p.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,x.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(m){for(let b=0;b<m;b++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
190
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.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,_.isMac&&this._liveRegion.remove()}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,b){this._liveRegionDebouncer.refresh(m,b,this._terminal.rows)}_renderRows(m,b){const w=this._terminal.buffer,k=w.lines.length.toString();for(let E=m;E<=b;E++){const S=w.translateBufferLineToString(w.ydisp+E,!0),j=(w.ydisp+E+1).toString(),R=this._rowElements[E];R&&(S.length===0?R.innerText=" ":R.textContent=S,R.setAttribute("aria-posinset",j),R.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,b){const w=m.target,k=this._rowElements[b===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==k)return;let E,S;if(b===0?(E=w,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(E=this._rowElements.shift(),S=w,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=document.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=f=u([g(1,h.IRenderService)],f)},3614:(l,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function u(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function g(_,v,x,y){_=u(_=c(_),x.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),v.value=""}function d(_,v,x){const y=x.getBoundingClientRect(),h=_.clientX-y.left-10,p=_.clientY-y.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${h}px`,v.style.top=`${p}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=u,a.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,v,x,y){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),v,x,y)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(_,v,x,y,h){d(_,v,x),h&&y.rightClickSelect(_),v.value=y.selectionText,v.select()}},7239:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const u=c(1505);a.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(g,d,_){this._css.set(g,d,_)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,_){this._color.set(g,d,_)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,u,g,d){c.addEventListener(u,g,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(u,g,d))}}}},6465:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,m);else for(var E=h.length-1;E>=0;E--)(b=h[E])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},g=this&&this.__param||function(h,p){return function(f,m){p(f,m,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier2=void 0;const d=c(3656),_=c(8460),v=c(844),x=c(2585);let y=a.Linkifier2=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const p=this._linkProviders.indexOf(h);p!==-1&&this._linkProviders.splice(p,1)}}}attachToDom(h,p,f){this._element=h,this._mouseService=p,this._renderService=f,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const p=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const f=h.composedPath();for(let m=0;m<f.length;m++){const b=f[m];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,p){var f,m;this._activeProviderReplies&&p||((f=this._activeProviderReplies)===null||f===void 0||f.forEach(w=>{w==null||w.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let b=!1;for(const[w,k]of this._linkProviders.entries())p?!((m=this._activeProviderReplies)===null||m===void 0)&&m.get(w)&&(b=this._checkLinkProviderResult(w,h,b)):k.provideLinks(h.y,E=>{var S,j;if(this._isMouseOut)return;const R=E==null?void 0:E.map(M=>({link:M}));(S=this._activeProviderReplies)===null||S===void 0||S.set(w,R),b=this._checkLinkProviderResult(w,h,b),((j=this._activeProviderReplies)===null||j===void 0?void 0:j.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,p){const f=new Set;for(let m=0;m<p.size;m++){const b=p.get(m);if(b)for(let w=0;w<b.length;w++){const k=b[w],E=k.link.range.start.y<h?0:k.link.range.start.x,S=k.link.range.end.y>h?this._bufferService.cols:k.link.range.end.x;for(let j=E;j<=S;j++){if(f.has(j)){b.splice(w--,1);break}f.add(j)}}}}_checkLinkProviderResult(h,p,f){var m;if(!this._activeProviderReplies)return f;const b=this._activeProviderReplies.get(h);let w=!1;for(let k=0;k<h;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&b){const k=b.find(E=>this._linkAtPosition(E.link,p));k&&(f=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviders.length&&!f)for(let k=0;k<this._activeProviderReplies.size;k++){const E=(m=this._activeProviderReplies.get(k))===null||m===void 0?void 0:m.find(S=>this._linkAtPosition(S.link,p));if(E){f=!0,this._handleNewLink(E);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!this._currentLink)return;const p=this._positionFromMouseEvent(h,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,p){this._element&&this._currentLink&&this._lastMouseEvent&&(!h||!p||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(h.link,p)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var f,m;return(m=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||m===void 0?void 0:m.decorations.pointerCursor},set:f=>{var m,b;!((m=this._currentLink)===null||m===void 0)&&m.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&((b=this._element)===null||b===void 0||b.classList.toggle("xterm-cursor-pointer",f)))}},underline:{get:()=>{var f,m;return(m=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||m===void 0?void 0:m.decorations.underline},set:f=>{var m,b,w;!((m=this._currentLink)===null||m===void 0)&&m.state&&((w=(b=this._currentLink)===null||b===void 0?void 0:b.state)===null||w===void 0?void 0:w.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,f))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const m=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(m,b),this._lastMouseEvent&&this._element)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(h,p,f){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(f,p.text)}_fireUnderlineEvent(h,p){const f=h.range,m=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-m-1,f.end.x,f.end.y-m-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(h,p,f){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(f,p.text)}_linkAtPosition(h,p){const f=h.range.start.y*this._bufferService.cols+h.range.start.x,m=h.range.end.y*this._bufferService.cols+h.range.end.x,b=p.y*this._bufferService.cols+p.x;return f<=b&&b<=m}_positionFromMouseEvent(h,p,f){const m=f.getCoords(h,p,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,p,f,m,b){return{x1:h,y1:p,x2:f,y2:m,cols:this._bufferService.cols,fg:b}}};a.Linkifier2=y=u([g(0,x.IBufferService)],y)},9042:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,a,c){var u=this&&this.__decorate||function(y,h,p,f){var m,b=arguments.length,w=b<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,h,p,f);else for(var k=y.length-1;k>=0;k--)(m=y[k])&&(w=(b<3?m(w):b>3?m(h,p,w):m(h,p))||w);return b>3&&w&&Object.defineProperty(h,p,w),w},g=this&&this.__param||function(y,h){return function(p,f){h(p,f,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=a.OscLinkProvider=class{constructor(y,h,p){this._bufferService=y,this._optionsService=h,this._oscLinkService=p}provideLinks(y,h){var p;const f=this._bufferService.buffer.lines.get(y-1);if(!f)return void h(void 0);const m=[],b=this._optionsService.rawOptions.linkHandler,w=new d.CellData,k=f.getTrimmedLength();let E=-1,S=-1,j=!1;for(let R=0;R<k;R++)if(S!==-1||f.hasContent(R)){if(f.loadCell(R,w),w.hasExtendedAttrs()&&w.extended.urlId){if(S===-1){S=R,E=w.extended.urlId;continue}j=w.extended.urlId!==E}else S!==-1&&(j=!0);if(j||S!==-1&&R===k-1){const M=(p=this._oscLinkService.getLinkData(E))===null||p===void 0?void 0:p.uri;if(M){const T={start:{x:S+1,y},end:{x:R+(j||R!==k-1?0:1),y}};let L=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const $=new URL(M);["http:","https:"].includes($.protocol)||(L=!0)}catch{L=!0}L||m.push({text:M,range:T,activate:($,z)=>b?b.activate($,z,T):x(0,z),hover:($,z)=>{var W;return(W=b==null?void 0:b.hover)===null||W===void 0?void 0:W.call(b,$,z,T)},leave:($,z)=>{var W;return(W=b==null?void 0:b.leave)===null||W===void 0?void 0:W.call(b,$,z,T)}})}j=!1,w.hasExtendedAttrs()&&w.extended.urlId?(S=R,E=w.extended.urlId):(S=-1,E=-1)}}h(m)}};function x(y,h){if(confirm(`Do you want to navigate to ${h}?
191
+
192
+ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=v=u([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],v)},6193:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,u){this._parentWindow=c,this._renderCallback=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(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();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},5596:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ScreenDprMonitor=void 0;const u=c(844);class g extends u.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,u.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.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)}}a.ScreenDprMonitor=g},3236:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const u=c(3614),g=c(3656),d=c(6465),_=c(9042),v=c(3730),x=c(1680),y=c(3107),h=c(5744),p=c(2950),f=c(1296),m=c(428),b=c(4269),w=c(5114),k=c(8934),E=c(3230),S=c(9312),j=c(4725),R=c(6731),M=c(8055),T=c(8969),L=c(8460),$=c(844),z=c(6114),W=c(8437),q=c(2584),N=c(7399),P=c(5941),D=c(9074),O=c(2585),B=c(5435),Q=c(4567),ee=typeof window<"u"?window.document:null;class re extends T.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(A={}){super(A),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((U,G)=>this.refresh(U,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(U=>this._reportWindowsOptions(U))),this.register(this._inputHandler.onColor(U=>this._handleColorEvent(U))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(U=>this._afterResize(U.cols,U.rows))),this.register((0,$.toDisposable)(()=>{var U,G;this._customKeyEventHandler=void 0,(G=(U=this.element)===null||U===void 0?void 0:U.parentNode)===null||G===void 0||G.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const U of A){let G,K="";switch(U.index){case 256:G="foreground",K="10";break;case 257:G="background",K="11";break;case 258:G="cursor",K="12";break;default:G="ansi",K="4;"+U.index}switch(U.type){case 0:const Z=M.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${K};${(0,P.toRgbString)(Z)}${q.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(X=>X.ansi[U.index]=M.rgba.toColor(...U.color));else{const X=G;this._themeService.modifyColors(ae=>ae[X]=M.rgba.toColor(...U.color))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.updateCursorStyle(A),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var A;return(A=this.textarea)===null||A===void 0?void 0:A.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const A=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(A);if(!U)return;const G=Math.min(this.buffer.x,this.cols-1),K=this._renderService.dimensions.css.cell.height,Z=U.getWidth(G),X=this._renderService.dimensions.css.cell.width*Z,ae=this.buffer.y*this._renderService.dimensions.css.cell.height,je=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=X+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",U=>{this.hasSelection()&&(0,u.copyHandler)(U,this._selectionService)}));const A=U=>(0,u.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,g.addDisposableDomListener)(this.element,"paste",A)),z.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",U=>{U.button===2&&(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",U=>{(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",U=>{U.button===1&&(0,u.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){var U;if(!A)throw new Error("Terminal requires a parent element.");A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=A.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const G=ee.createDocumentFragment();this._viewportElement=ee.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=ee.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=ee.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=ee.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=ee.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),z.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(w.CoreBrowserService,this.textarea,(U=this._document.defaultView)!==null&&U!==void 0?U:window),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",K=>this._handleTextAreaFocus(K))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(K=>this._onRender.fire(K))),this.onResize(K=>this._renderService.resize(K.cols,K.rows)),this._compositionView=ee.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(K=>this.scrollLines(K.amount,K.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(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(K=>this.scrollLines(K.amount,K.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(K=>this._renderService.handleSelectionChanged(K.start,K.end,K.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(K=>{this.textarea.value=K,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(K=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",K=>this._selectionService.handleMouseDown(K))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",K=>this._handleScreenReaderModeOptionChange(K))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",K=>{!this._overviewRulerRenderer&&K&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.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(){const A=this,U=this.element;function G(X){const ae=A._mouseService.getMouseReportCoords(X,A.screenElement);if(!ae)return!1;let je,Oe;switch(X.overrideType||X.type){case"mousemove":Oe=32,X.buttons===void 0?(je=3,X.button!==void 0&&(je=X.button<3?X.button:3)):je=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":Oe=0,je=X.button<3?X.button:3;break;case"mousedown":Oe=1,je=X.button<3?X.button:3;break;case"wheel":if(A.viewport.getLinesScrolled(X)===0)return!1;Oe=X.deltaY<0?0:1,je=4;break;default:return!1}return!(Oe===void 0||je===void 0||je>4)&&A.coreMouseService.triggerMouseEvent({col:ae.col,row:ae.row,x:ae.x,y:ae.y,button:je,action:Oe,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const K={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Z={mouseup:X=>(G(X),X.buttons||(this._document.removeEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.removeEventListener("mousemove",K.mousedrag)),this.cancel(X)),wheel:X=>(G(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&G(X)},mousemove:X=>{X.buttons||G(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),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&X?K.mousemove||(U.addEventListener("mousemove",Z.mousemove),K.mousemove=Z.mousemove):(U.removeEventListener("mousemove",K.mousemove),K.mousemove=null),16&X?K.wheel||(U.addEventListener("wheel",Z.wheel,{passive:!1}),K.wheel=Z.wheel):(U.removeEventListener("wheel",K.wheel),K.wheel=null),2&X?K.mouseup||(U.addEventListener("mouseup",Z.mouseup),K.mouseup=Z.mouseup):(this._document.removeEventListener("mouseup",K.mouseup),U.removeEventListener("mouseup",K.mouseup),K.mouseup=null),4&X?K.mousedrag||(K.mousedrag=Z.mousedrag):(this._document.removeEventListener("mousemove",K.mousedrag),K.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(U,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return G(X),K.mouseup&&this._document.addEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.addEventListener("mousemove",K.mousedrag),this.cancel(X)})),this.register((0,g.addDisposableDomListener)(U,"wheel",X=>{if(!K.wheel){if(!this.buffer.hasScrollback){const ae=this.viewport.getLinesScrolled(X);if(ae===0)return;const je=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let Oe="";for(let Be=0;Be<Math.abs(ae);Be++)Oe+=je;return this.coreService.triggerDataEvent(Oe,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(U,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,g.addDisposableDomListener)(U,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(A,U){var G;(G=this._renderService)===null||G===void 0||G.refreshRows(A,U)}updateCursorStyle(A){var U;!((U=this._selectionService)===null||U===void 0)&&U.shouldColumnSelect(A)?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(A,U,G=0){var K;G===1?(super.scrollLines(A,U,G),this.refresh(0,this.rows-1)):(K=this.viewport)===null||K===void 0||K.scrollLines(A)}paste(A){(0,u.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}registerLinkProvider(A){return this.linkifier2.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,U,G){this._selectionService.setSelection(A,U,G)}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 A;(A=this._selectionService)===null||A===void 0||A.clearSelection()}selectAll(){var A;(A=this._selectionService)===null||A===void 0||A.selectAll()}selectLines(A,U){var G;(G=this._selectionService)===null||G===void 0||G.selectLines(A,U)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!U&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,N.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),G.type===3||G.type===2){const K=this.rows-1;return this.scrollLines(G.type===2?-K:K),this.cancel(A,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(G.cancel&&this.cancel(A,!0),!G.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==q.C0.ETX&&G.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,U){const G=A.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||A.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||A.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?G:G&&(!U.keyCode||U.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)U=A.charCode;else if(A.which===null||A.which===void 0)U=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;U=A.which}return!(!U||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=A.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(A),!0}return!1}resize(A,U){A!==this.cols||U!==this.rows?super.resize(A,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,U){var G,K;(G=this._charSizeService)===null||G===void 0||G.measure(),(K=this.viewport)===null||K===void 0||K.syncScrollArea(!0)}clear(){var A;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 U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(A=this.viewport)===null||A===void 0||A.reset(),this.refresh(0,this.rows-1)}}reset(){var A,U;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(A=this._selectionService)===null||A===void 0||A.reset(),this._decorationService.reset(),(U=this.viewport)===null||U===void 0||U.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var A;(A=this._renderService)===null||A===void 0||A.clearTextureAtlas()}_reportFocus(){var A;!((A=this.element)===null||A===void 0)&&A.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${G};${U}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const K=this._renderService.dimensions.css.cell.width.toFixed(0),Z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${Z};${K}t`)}}cancel(A,U){if(this.options.cancelEvents||U)return A.preventDefault(),A.stopPropagation(),!1}}a.Terminal=re},9924:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(l,a,c){var u=this&&this.__decorate||function(p,f,m,b){var w,k=arguments.length,E=k<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,f,m,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(E=(k<3?w(E):k>3?w(f,m,E):w(f,m))||E);return k>3&&E&&Object.defineProperty(f,m,E),E},g=this&&this.__param||function(p,f){return function(m,b){f(m,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),x=c(844),y=c(2585);let h=a.Viewport=class extends x.Disposable{constructor(p,f,m,b,w,k,E,S){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=m,this._optionsService=b,this._charSizeService=w,this._renderService=k,this._coreBrowserService=E,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 v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(j=>this._activeBuffer=j.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(j=>this._renderDimensions=j)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(j=>this._handleThemeChange(j))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,f){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&m<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var m;let b,w="";const k=[],E=f??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let j=p;j<E;j++){const R=S.get(j);if(!R)continue;const M=(m=S.get(j+1))===null||m===void 0?void 0:m.isWrapped;if(w+=R.translateToString(!M),!M||j===S.length-1){const T=document.createElement("div");T.textContent=w,k.push(T),w.length>0&&(b=T),w=""}}return{bufferElements:k,cursorElement:b}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&f.altKey||m==="ctrl"&&f.ctrlKey||m==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};a.Viewport=h=u([g(2,y.IBufferService),g(3,y.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],h)},3107:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,m);else for(var E=h.length-1;E>=0;E--)(b=h[E])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},g=this&&this.__param||function(h,p){return function(f,m){p(f,m,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(3656),_=c(4725),v=c(844),x=c(2585);let y=a.BufferDecorationRenderer=class extends v.Disposable{constructor(h,p,f,m){super(),this._screenElement=h,this._bufferService=p,this._decorationService=f,this._renderService=m,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,d.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(b=>this._removeDecoration(b))),this.register((0,v.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(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var p,f;const m=document.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((p=h==null?void 0:h.options)===null||p===void 0?void 0:p.layer)==="top"),m.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=(f=h.options.x)!==null&&f!==void 0?f:0;return b&&b>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(h,m),m}_refreshStyle(h){const p=h.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let f=this._decorationElements.get(h);f||(f=this._createElement(h),h.element=f,this._decorationElements.set(h,f),this._container.appendChild(f),h.onDispose(()=>{this._decorationElements.delete(h),f.remove()})),f.style.top=p*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(f)}}_refreshXPosition(h,p=h.element){var f;if(!p)return;const m=(f=h.options.x)!==null&&f!==void 0?f:0;(h.options.anchor||"left")==="right"?p.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var p;(p=this._decorationElements.get(h))===null||p===void 0||p.remove(),this._decorationElements.delete(h),h.dispose()}};a.BufferDecorationRenderer=y=u([g(1,x.IBufferService),g(2,x.IDecorationService),g(3,_.IRenderService)],y)},5871:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,g){return u>=c.startBufferLine-this._linePadding[g||"full"]&&u<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,E){var S,j=arguments.length,R=j<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,w,k,E);else for(var M=b.length-1;M>=0;M--)(S=b[M])&&(R=(j<3?S(R):j>3?S(w,k,R):S(w,k))||R);return j>3&&R&&Object.defineProperty(w,k,R),R},g=this&&this.__param||function(b,w){return function(k,E){w(k,E,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),_=c(3656),v=c(4725),x=c(844),y=c(2585),h={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let m=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,w,k,E,S,j,R){var M;super(),this._viewportElement=b,this._screenElement=w,this._bufferService=k,this._decorationService=E,this._renderService=S,this._optionsService=j,this._coreBrowseService=R,this._colorZoneStore=new d.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(),(M=this._viewportElement.parentElement)===null||M===void 0||M.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.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,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=b,p.center=w,p.right=b,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=p.left,f.right=p.left+p.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowseService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowseService.dpr);h.left=w,h.center=w,h.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const w of b)w.position!=="full"&&this._renderColorZone(w);for(const w of b)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(f[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-h[b.position||"full"]/2),p[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[b.position||"full"]))}_queueRefresh(b,w){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=m=u([g(2,y.IBufferService),g(3,y.IDecorationService),g(4,v.IRenderService),g(5,y.IOptionsService),g(6,v.ICoreBrowserService)],m)},2950:function(l,a,c){var u=this&&this.__decorate||function(y,h,p,f){var m,b=arguments.length,w=b<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,h,p,f);else for(var k=y.length-1;k>=0;k--)(m=y[k])&&(w=(b<3?m(w):b>3?m(h,p,w):m(h,p))||w);return b>3&&w&&Object.defineProperty(h,p,w),w},g=this&&this.__param||function(y,h){return function(p,f){h(p,f,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let x=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,h,p,f,m,b){this._textarea=y,this._compositionView=h,this._bufferService=p,this._optionsService=f,this._coreService=m,this._renderService=b,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(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,p=h.replace(y,"");this._dataAlreadySent=p,h.length>y.length?this._coreService.triggerDataEvent(p,!0):h.length<y.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):h.length===y.length&&h!==y&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a.CompositionHelper=x=u([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,d.IRenderService)],x)},9806:(l,a)=>{function c(u,g,d){const _=d.getBoundingClientRect(),v=u.getComputedStyle(d),x=parseInt(v.getPropertyValue("padding-left")),y=parseInt(v.getPropertyValue("padding-top"));return[g.clientX-_.left-x,g.clientY-_.top-y]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(u,g,d,_,v,x,y,h,p){if(!x)return;const f=c(u,g,d);return f?(f[0]=Math.ceil((f[0]+(p?y/2:0))/y),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),_+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),v),f):void 0}},9504:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const u=c(2584);function g(h,p,f,m){const b=h-d(h,f),w=p-d(p,f),k=Math.abs(b-w)-function(E,S,j){let R=0;const M=E-d(E,j),T=S-d(S,j);for(let L=0;L<Math.abs(M-T);L++){const $=_(E,S)==="A"?-1:1,z=j.buffer.lines.get(M+$*L);z!=null&&z.isWrapped&&R++}return R}(h,p,f);return y(k,x(_(h,p),m))}function d(h,p){let f=0,m=p.buffer.lines.get(h),b=m==null?void 0:m.isWrapped;for(;b&&h>=0&&h<p.rows;)f++,m=p.buffer.lines.get(--h),b=m==null?void 0:m.isWrapped;return f}function _(h,p){return h>p?"A":"B"}function v(h,p,f,m,b,w){let k=h,E=p,S="";for(;k!==f||E!==m;)k+=b?1:-1,b&&k>w.cols-1?(S+=w.buffer.translateBufferLineToString(E,!1,h,k),k=0,h=0,E++):!b&&k<0&&(S+=w.buffer.translateBufferLineToString(E,!1,0,h+1),k=w.cols-1,h=k,E--);return S+w.buffer.translateBufferLineToString(E,!1,h,k)}function x(h,p){const f=p?"O":"[";return u.C0.ESC+f+h}function y(h,p){h=Math.floor(h);let f="";for(let m=0;m<h;m++)f+=p;return f}a.moveToCellSequence=function(h,p,f,m){const b=f.buffer.x,w=f.buffer.y;if(!f.buffer.hasScrollback)return function(S,j,R,M,T,L){return g(j,M,T,L).length===0?"":y(v(S,j,S,j-d(j,T),!1,T).length,x("D",L))}(b,w,0,p,f,m)+g(w,p,f,m)+function(S,j,R,M,T,L){let $;$=g(j,M,T,L).length>0?M-d(M,T):j;const z=M,W=function(q,N,P,D,O,B){let Q;return Q=g(P,D,O,B).length>0?D-d(D,O):N,q<P&&Q<=D||q>=P&&Q<D?"C":"D"}(S,j,R,M,T,L);return y(v(S,$,R,z,W==="C",T).length,x(W,L))}(b,w,h,p,f,m);let k;if(w===p)return k=b>h?"D":"C",y(Math.abs(b-h),x(k,m));k=w>p?"D":"C";const E=Math.abs(w-p);return y(function(S,j){return j.cols-S}(w>p?h:b,f)+(E-1)*f.cols+1+((w>p?b:h)-1),x(k,m))}},1296:function(l,a,c){var u=this&&this.__decorate||function(T,L,$,z){var W,q=arguments.length,N=q<3?L:z===null?z=Object.getOwnPropertyDescriptor(L,$):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(T,L,$,z);else for(var P=T.length-1;P>=0;P--)(W=T[P])&&(N=(q<3?W(N):q>3?W(L,$,N):W(L,$))||N);return q>3&&N&&Object.defineProperty(L,$,N),N},g=this&&this.__param||function(T,L){return function($,z){L($,z,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),x=c(6171),y=c(4725),h=c(8055),p=c(8460),f=c(844),m=c(2585),b="xterm-dom-renderer-owner-",w="xterm-rows",k="xterm-fg-",E="xterm-bg-",S="xterm-focus",j="xterm-selection";let R=1,M=a.DomRenderer=class extends f.Disposable{constructor(T,L,$,z,W,q,N,P,D,O){super(),this._element=T,this._screenElement=L,this._viewportElement=$,this._linkifier2=z,this._charSizeService=q,this._optionsService=N,this._bufferService=P,this._coreBrowserService=D,this._themeService=O,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(w),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(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(B=>this._injectCss(B))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(B=>this._handleLinkHover(B))),this.register(this._linkifier2.onHideLinkUnderline(B=>this._handleLinkLeave(B))),this.register((0,f.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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(const $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,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(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${w} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${w} .xterm-dim { color: ${h.color.multiplyOpacity(T.foreground,.5).css};}`,L+=`${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;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,L+=`${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[$,z]of T.ansi.entries())L+=`${this._terminalSelector} .${k}${$} { color: ${z.css}; }${this._terminalSelector} .${k}${$}.xterm-dim { color: ${h.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${$} { background-color: ${z.css}; }`;L+=`${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(T.background).css}; }${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${E}${v.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,L){for(let $=this._rowElements.length;$<=L;$++){const z=document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,L){this._refreshRowElements(T,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,L,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,L,$),this.renderRows(0,this._bufferService.rows-1),!T||!L)return;const z=T[1]-this._bufferService.buffer.ydisp,W=L[1]-this._bufferService.buffer.ydisp,q=Math.max(z,0),N=Math.min(W,this._bufferService.rows-1);if(q>=this._bufferService.rows||N<0)return;const P=document.createDocumentFragment();if($){const D=T[0]>L[0];P.appendChild(this._createSelectionElement(q,D?L[0]:T[0],D?T[0]:L[0],N-q+1))}else{const D=z===q?T[0]:0,O=q===W?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(q,D,O));const B=N-q-1;if(P.appendChild(this._createSelectionElement(q+1,0,this._bufferService.cols,B)),q!==N){const Q=W===N?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(N,0,Q))}}this._selectionContainer.appendChild(P)}_createSelectionElement(T,L,$,z=1){const W=document.createElement("div");return W.style.height=z*this.dimensions.css.cell.height+"px",W.style.top=T*this.dimensions.css.cell.height+"px",W.style.left=L*this.dimensions.css.cell.width+"px",W.style.width=this.dimensions.css.cell.width*($-L)+"px",W}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(const T of this._rowElements)T.replaceChildren()}renderRows(T,L){const $=this._bufferService.buffer,z=$.ybase+$.y,W=Math.min($.x,this._bufferService.cols-1),q=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=T;D<=L;D++){const O=D+$.ydisp,B=this._rowElements[D],Q=$.lines.get(O);if(!B||!Q)break;B.replaceChildren(...this._rowFactory.createRow(Q,O,O===z,N,P,W,q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,L,$,z,W,q){$<0&&(T=0),z<0&&(L=0);const N=this._bufferService.rows-1;$=Math.max(Math.min($,N),0),z=Math.max(Math.min(z,N),0),W=Math.min(W,this._bufferService.cols);const P=this._bufferService.buffer,D=P.ybase+P.y,O=Math.min(P.x,W-1),B=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=$;re<=z;++re){const ye=re+P.ydisp,A=this._rowElements[re],U=P.lines.get(ye);if(!A||!U)break;A.replaceChildren(...this._rowFactory.createRow(U,ye,ye===D,Q,ee,O,B,this.dimensions.css.cell.width,this._widthCache,q?re===$?T:0:-1,q?(re===z?L:W)-1:-1))}}};a.DomRenderer=M=u([g(4,m.IInstantiationService),g(5,y.ICharSizeService),g(6,m.IOptionsService),g(7,m.IBufferService),g(8,y.ICoreBrowserService),g(9,y.IThemeService)],M)},3787:function(l,a,c){var u=this&&this.__decorate||function(k,E,S,j){var R,M=arguments.length,T=M<3?E:j===null?j=Object.getOwnPropertyDescriptor(E,S):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,E,S,j);else for(var L=k.length-1;L>=0;L--)(R=k[L])&&(T=(M<3?R(T):M>3?R(E,S,T):R(E,S))||T);return M>3&&T&&Object.defineProperty(E,S,T),T},g=this&&this.__param||function(k,E){return function(S,j){E(S,j,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),x=c(2585),y=c(8055),h=c(4725),p=c(4269),f=c(6171),m=c(3734);let b=a.DomRendererRowFactory=class{constructor(k,E,S,j,R,M,T){this._document=k,this._characterJoinerService=E,this._optionsService=S,this._coreBrowserService=j,this._coreService=R,this._decorationService=M,this._themeService=T,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,E,S){this._selectionStart=k,this._selectionEnd=E,this._columnSelectMode=S}createRow(k,E,S,j,R,M,T,L,$,z,W){const q=[],N=this._characterJoinerService.getJoinedCharacters(E),P=this._themeService.colors;let D,O=k.getNoBgTrimmedLength();S&&O<M+1&&(O=M+1);let B=0,Q="",ee=0,re=0,ye=0,A=!1,U=0,G=!1,K=0;const Z=[],X=z!==-1&&W!==-1;for(let ae=0;ae<O;ae++){k.loadCell(ae,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Oe=!1,Be=ae,Se=this._workCell;if(N.length>0&&ae===N[0][0]){Oe=!0;const fe=N.shift();Se=new p.JoinedCellData(this._workCell,k.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),Be=fe[1]-1,je=Se.getWidth()}const Mt=this._isCellInSelection(ae,E),dr=S&&ae===M,Dn=X&&ae>=z&&ae<=W;let qr=!1;this._decorationService.forEachDecorationAtCell(ae,E,void 0,fe=>{qr=!0});let Ln=Se.getChars()||_.WHITESPACE_CELL_CHAR;if(Ln===" "&&(Se.isUnderline()||Se.isOverline())&&(Ln=" "),K=je*L-$.get(Ln,Se.isBold(),Se.isItalic()),D){if(B&&(Mt&&G||!Mt&&!G&&Se.bg===ee)&&(Mt&&G&&P.selectionForeground||Se.fg===re)&&Se.extended.ext===ye&&Dn===A&&K===U&&!dr&&!Oe&&!qr){Q+=Ln,B++;continue}B&&(D.textContent=Q),D=this._document.createElement("span"),B=0,Q=""}else D=this._document.createElement("span");if(ee=Se.bg,re=Se.fg,ye=Se.extended.ext,A=Dn,U=K,G=Mt,Oe&&M>=ae&&M<=Be&&(M=ae),!this._coreService.isCursorHidden&&dr){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&Z.push("xterm-cursor-blink"),Z.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":Z.push("xterm-cursor-outline");break;case"block":Z.push("xterm-cursor-block");break;case"bar":Z.push("xterm-cursor-bar");break;case"underline":Z.push("xterm-cursor-underline")}}if(Se.isBold()&&Z.push("xterm-bold"),Se.isItalic()&&Z.push("xterm-italic"),Se.isDim()&&Z.push("xterm-dim"),Q=Se.isInvisible()?_.WHITESPACE_CELL_CHAR:Se.getChars()||_.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(Z.push(`xterm-underline-${Se.extended.underlineStyle}`),Q===" "&&(Q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let fe=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&fe<8&&(fe+=8),D.style.textDecorationColor=P.ansi[fe].css}Se.isOverline()&&(Z.push("xterm-overline"),Q===" "&&(Q=" ")),Se.isStrikethrough()&&Z.push("xterm-strikethrough"),Dn&&(D.style.textDecoration="underline");let mt=Se.getFgColor(),vn=Se.getFgColorMode(),I=Se.getBgColor(),H=Se.getBgColorMode();const V=!!Se.isInverse();if(V){const fe=mt;mt=I,I=fe;const Re=vn;vn=H,H=Re}let ne,ie,te,ue=!1;switch(this._decorationService.forEachDecorationAtCell(ae,E,void 0,fe=>{fe.options.layer!=="top"&&ue||(fe.backgroundColorRGB&&(H=50331648,I=fe.backgroundColorRGB.rgba>>8&16777215,ne=fe.backgroundColorRGB),fe.foregroundColorRGB&&(vn=50331648,mt=fe.foregroundColorRGB.rgba>>8&16777215,ie=fe.foregroundColorRGB),ue=fe.options.layer==="top")}),!ue&&Mt&&(ne=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,I=ne.rgba>>8&16777215,H=50331648,ue=!0,P.selectionForeground&&(vn=50331648,mt=P.selectionForeground.rgba>>8&16777215,ie=P.selectionForeground)),ue&&Z.push("xterm-decoration-top"),H){case 16777216:case 33554432:te=P.ansi[I],Z.push(`xterm-bg-${I}`);break;case 50331648:te=y.rgba.toColor(I>>16,I>>8&255,255&I),this._addStyle(D,`background-color:#${w((I>>>0).toString(16),"0",6)}`);break;default:V?(te=P.foreground,Z.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):te=P.background}switch(ne||Se.isDim()&&(ne=y.color.multiplyOpacity(te,.5)),vn){case 16777216:case 33554432:Se.isBold()&&mt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(mt+=8),this._applyMinimumContrast(D,te,P.ansi[mt],Se,ne,void 0)||Z.push(`xterm-fg-${mt}`);break;case 50331648:const fe=y.rgba.toColor(mt>>16&255,mt>>8&255,255&mt);this._applyMinimumContrast(D,te,fe,Se,ne,ie)||this._addStyle(D,`color:#${w(mt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,te,P.foreground,Se,ne,void 0)||V&&Z.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}Z.length&&(D.className=Z.join(" "),Z.length=0),dr||Oe||qr?D.textContent=Q:B++,K!==this.defaultSpacing&&(D.style.letterSpacing=`${K}px`),q.push(D),ae=Be}return D&&B&&(D.textContent=Q),q}_applyMinimumContrast(k,E,S,j,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(j.getCode()))return!1;const T=this._getContrastCache(j);let L;if(R||M||(L=T.getColor(E.rgba,S.rgba)),L===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);L=y.color.ensureContrastRatio(R||E,M||S,$),T.setColor((R||E).rgba,(M||S).rgba,L??null)}return!!L&&(this._addStyle(k,`color:${L.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,E){k.setAttribute("style",`${k.getAttribute("style")||""}${E};`)}_isCellInSelection(k,E){const S=this._selectionStart,j=this._selectionEnd;return!(!S||!j)&&(this._columnSelectMode?S[0]<=j[0]?k>=S[0]&&E>=S[1]&&k<j[0]&&E<=j[1]:k<S[0]&&E>=S[1]&&k>=j[0]&&E<=j[1]:E>S[1]&&E<j[1]||S[1]===j[1]&&E===S[1]&&k>=S[0]&&k<j[0]||S[1]<j[1]&&E===j[1]&&k<j[0]||S[1]<j[1]&&E===S[1]&&k>=S[0])}};function w(k,E,S){for(;k.length<S;)k=E+k;return k}a.DomRendererRowFactory=b=u([g(1,h.ICharacterJoinerService),g(2,x.IOptionsService),g(3,h.ICoreBrowserService),g(4,x.ICoreService),g(5,x.IDecorationService),g(6,h.IThemeService)],b)},2550:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const u=c.createElement("span"),g=c.createElement("span");g.style.fontWeight="bold";const d=c.createElement("span");d.style.fontStyle="italic";const _=c.createElement("span");_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[u,g,d,_],this._container.appendChild(u),this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(_),c.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(c,u,g,d){c===this._font&&u===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=u,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,u,g){let d=0;if(!u&&!g&&c.length===1&&(d=c.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(c,0);let _=c;u&&(_+="B"),g&&(_+="I");let v=this._holey.get(_);if(v===void 0){let x=0;u&&(x|=1),g&&(x|=2),v=this._measure(c,x),this._holey.set(_,v)}return v}_measure(c,u){const g=this._measureElements[u];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(l,a)=>{function c(u){return 57508<=u&&u<=57558}Object.defineProperty(a,"__esModule",{value:!0}),a.createRenderDimensions=a.excludeFromContrastRatioDemands=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},a.excludeFromContrastRatioDemands=function(u){return c(u)||function(g){return 9472<=g&&g<=9631}(u)},a.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:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,m);else for(var E=h.length-1;E>=0;E--)(b=h[E])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},g=this&&this.__param||function(h,p){return function(f,m){p(f,m,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let x=a.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,p,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(h,p,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};a.CharSizeService=x=u([g(2,d.IOptionsService)],x);class y{constructor(p,f,m){this._document=p,this._parentElement=f,this._optionsService=m,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`;const p={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return p.width!==0&&p.height!==0&&(this._result.width=p.width/32,this._result.height=Math.ceil(p.height)),this._result}}},4269:function(l,a,c){var u=this&&this.__decorate||function(p,f,m,b){var w,k=arguments.length,E=k<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,f,m,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(E=(k<3?w(E):k>3?w(f,m,E):w(f,m))||E);return k>3&&E&&Object.defineProperty(f,m,E),E},g=this&&this.__param||function(p,f){return function(m,b){f(m,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),x=c(2585);class y extends d.AttributeData{constructor(f,m,b){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=m,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=y;let h=a.CharacterJoinerService=class Xw{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(f){const m={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(m),m.id}deregister(f){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===f)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(f);if(!m||m.length===0)return[];const b=[],w=m.translateToString(!0);let k=0,E=0,S=0,j=m.getFg(0),R=m.getBg(0);for(let M=0;M<m.getTrimmedLength();M++)if(m.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==R){if(M-k>1){const T=this._getJoinedRanges(w,S,E,m,k);for(let L=0;L<T.length;L++)b.push(T[L])}k=M,S=E,j=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const M=this._getJoinedRanges(w,S,E,m,k);for(let T=0;T<M.length;T++)b.push(M[T])}return b}_getJoinedRanges(f,m,b,w,k){const E=f.substring(m,b);let S=[];try{S=this._characterJoiners[0].handler(E)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const R=this._characterJoiners[j].handler(E);for(let M=0;M<R.length;M++)Xw._mergeRanges(S,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(S,w,k),S}_stringRangesToCellRanges(f,m,b){let w=0,k=!1,E=0,S=f[w];if(S){for(let j=b;j<this._bufferService.cols;j++){const R=m.getWidth(j),M=m.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!k&&S[0]<=E&&(S[0]=j,k=!0),S[1]<=E){if(S[1]=j,S=f[++w],!S)break;S[0]<=E?(S[0]=j,k=!0):k=!1}E+=M}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(f,m){let b=!1;for(let w=0;w<f.length;w++){const k=f[w];if(b){if(m[1]<=k[0])return f[w-1][1]=m[1],f;if(m[1]<=k[1])return f[w-1][1]=Math.max(m[1],k[1]),f.splice(w,1),f;f.splice(w,1),w--}else{if(m[1]<=k[0])return f.splice(w,0,m),f;if(m[1]<=k[1])return k[0]=Math.min(m[0],k[0]),f;m[0]<k[1]&&(k[0]=Math.min(m[0],k[0]),b=!0)}}return b?f[f.length-1][1]=m[1]:f.push(m),f}};a.CharacterJoinerService=h=u([g(0,x.IBufferService)],h)},5114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0,a.CoreBrowserService=class{constructor(c,u){this._textarea=c,this.window=u,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(l,a,c){var u=this&&this.__decorate||function(x,y,h,p){var f,m=arguments.length,b=m<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,h):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,y,h,p);else for(var w=x.length-1;w>=0;w--)(f=x[w])&&(b=(m<3?f(b):m>3?f(y,h,b):f(y,h))||b);return m>3&&b&&Object.defineProperty(y,h,b),b},g=this&&this.__param||function(x,y){return function(h,p){y(h,p,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),_=c(9806);let v=a.MouseService=class{constructor(x,y){this._renderService=x,this._charSizeService=y}getCoords(x,y,h,p,f){return(0,_.getCoords)(window,x,y,h,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(x,y){const h=(0,_.getCoordsRelativeToElement)(window,x,y);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};a.MouseService=v=u([g(0,d.IRenderService),g(1,d.ICharSizeService)],v)},3230:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,E){var S,j=arguments.length,R=j<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,w,k,E);else for(var M=b.length-1;M>=0;M--)(S=b[M])&&(R=(j<3?S(R):j>3?S(w,k,R):S(w,k))||R);return j>3&&R&&Object.defineProperty(w,k,R),R},g=this&&this.__param||function(b,w){return function(k,E){w(k,E,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(3656),_=c(6193),v=c(5596),x=c(4725),y=c(8460),h=c(844),p=c(7226),f=c(2585);let m=a.RenderService=class extends h.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,w,k,E,S,j,R,M){if(super(),this._rowCount=b,this._charSizeService=E,this._renderer=this.register(new h.MutableDisposable),this._pausedResizeTask=new p.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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(R.window,(T,L)=>this._renderRows(T,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new v.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(j.onResize(()=>this._fullRefresh())),this.register(j.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()})),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(j.buffer.y,j.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(M.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const T=new R.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});T.observe(w),this.register({dispose:()=>T.disconnect()})}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.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(b,w,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,w,this._rowCount))}_renderRows(b,w){this._renderer.value&&(b=Math.min(b,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(b,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:w}),this._onRender.fire({start:b,end:w}),this._isNextRenderRedrawOnly=!0)}resize(b,w){this._rowCount=w,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(b){this._renderer.value=b,this._renderer.value.onRequestRedraw(w=>this.refreshRows(w.start,w.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var b,w;this._renderer.value&&((w=(b=this._renderer.value).clearTextureAtlas)===null||w===void 0||w.call(b),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(b,w)):this._renderer.value.handleResize(b,w),this._fullRefresh())}handleCharSizeChanged(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCharSizeChanged()}handleBlur(){var b;(b=this._renderer.value)===null||b===void 0||b.handleBlur()}handleFocus(){var b;(b=this._renderer.value)===null||b===void 0||b.handleFocus()}handleSelectionChanged(b,w,k){var E;this._selectionState.start=b,this._selectionState.end=w,this._selectionState.columnSelectMode=k,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(b,w,k)}handleCursorMove(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCursorMove()}clear(){var b;(b=this._renderer.value)===null||b===void 0||b.clear()}};a.RenderService=m=u([g(2,f.IOptionsService),g(3,x.ICharSizeService),g(4,f.IDecorationService),g(5,f.IBufferService),g(6,x.ICoreBrowserService),g(7,x.IThemeService)],m)},9312:function(l,a,c){var u=this&&this.__decorate||function(S,j,R,M){var T,L=arguments.length,$=L<3?j:M===null?M=Object.getOwnPropertyDescriptor(j,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(S,j,R,M);else for(var z=S.length-1;z>=0;z--)(T=S[z])&&($=(L<3?T($):L>3?T(j,R,$):T(j,R))||$);return L>3&&$&&Object.defineProperty(j,R,$),$},g=this&&this.__param||function(S,j){return function(R,M){j(R,M,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),x=c(4725),y=c(8460),h=c(844),p=c(6114),f=c(4841),m=c(511),b=c(2585),w=" ",k=new RegExp(w,"g");let E=a.SelectionService=class extends h.Disposable{constructor(S,j,R,M,T,L,$,z,W){super(),this._element=S,this._screenElement=j,this._linkifier=R,this._bufferService=M,this._coreService=T,this._mouseService=L,this._optionsService=$,this._renderService=z,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new m.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.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(){const S=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!S||!j||S[0]===j[0]&&S[1]===j[1])}get selectionText(){const S=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!S||!j)return"";const R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(S[0]===j[0])return"";const T=S[0]<j[0]?S[0]:j[0],L=S[0]<j[0]?j[0]:S[0];for(let $=S[1];$<=j[1];$++){const z=R.translateBufferLineToString($,!0,T,L);M.push(z)}}else{const T=S[1]===j[1]?j[0]:void 0;M.push(R.translateBufferLineToString(S[1],!0,S[0],T));for(let L=S[1]+1;L<=j[1]-1;L++){const $=R.lines.get(L),z=R.translateBufferLineToString(L,!0);$!=null&&$.isWrapped?M[M.length-1]+=z:M.push(z)}if(S[1]!==j[1]){const L=R.lines.get(j[1]),$=R.translateBufferLineToString(j[1],!0,0,j[0]);L&&L.isWrapped?M[M.length-1]+=$:M.push($)}}return M.map(T=>T.replace(k," ")).join(p.isWindows?`\r
193
+ `:`
194
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p.isLinux&&S&&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(S){const j=this._getMouseBufferCoords(S),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&j)&&this._areCoordsInSelection(j,R,M)}isCellInSelection(S,j){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([S,j],R,M)}_areCoordsInSelection(S,j,R){return S[1]>j[1]&&S[1]<R[1]||j[1]===R[1]&&S[1]===j[1]&&S[0]>=j[0]&&S[0]<R[0]||j[1]<R[1]&&S[1]===R[1]&&S[0]<R[0]||j[1]<R[1]&&S[1]===j[1]&&S[0]>=j[0]}_selectWordAtCursor(S,j){var R,M;const T=(M=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||M===void 0?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(S);return!!L&&(this._selectWordAt(L,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,j){this._model.clearSelection(),S=Math.max(S,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const j=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(S){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=R?0:(j>R&&(j-=R),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(S){return p.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const j=this._getMouseBufferCoords(S);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(S){return S.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[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});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const j=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,_.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,R=!(!S||!j||S[0]===j[0]&&S[1]===j[1]);R?S&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,j,R)):this._oldHasSelection&&this._fireOnSelectionChange(S,j,R)}_fireOnSelectionChange(S,j,R){this._oldSelectionStart=S,this._oldSelectionEnd=j,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(j=>this._handleTrim(j))}_convertViewportColToCharacterIndex(S,j){let R=j;for(let M=0;j>=M;M++){const T=S.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&j!==M&&(R+=T-1)}return R}setSelection(S,j,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,j],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,j,R=!0,M=!0){if(S[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,L=T.lines.get(S[1]);if(!L)return;const $=T.translateBufferLineToString(S[1],!1);let z=this._convertViewportColToCharacterIndex(L,S[0]),W=z;const q=S[0]-z;let N=0,P=0,D=0,O=0;if($.charAt(z)===" "){for(;z>0&&$.charAt(z-1)===" ";)z--;for(;W<$.length&&$.charAt(W+1)===" ";)W++}else{let ee=S[0],re=S[0];L.getWidth(ee)===0&&(N++,ee--),L.getWidth(re)===2&&(P++,re++);const ye=L.getString(re).length;for(ye>1&&(O+=ye-1,W+=ye-1);ee>0&&z>0&&!this._isCharWordSeparator(L.loadCell(ee-1,this._workCell));){L.loadCell(ee-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,ee--):A>1&&(D+=A-1,z-=A-1),z--,ee--}for(;re<L.length&&W+1<$.length&&!this._isCharWordSeparator(L.loadCell(re+1,this._workCell));){L.loadCell(re+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,re++):A>1&&(O+=A-1,W+=A-1),W++,re++}}W++;let B=z+q-N+D,Q=Math.min(this._bufferService.cols,W-z+N+P-D-O);if(j||$.slice(z,W).trim()!==""){if(R&&B===0&&L.getCodePoint(0)!==32){const ee=T.lines.get(S[1]-1);if(ee&&L.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(re){const ye=this._bufferService.cols-re.start;B-=ye,Q+=ye}}}if(M&&B+Q===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const ee=T.lines.get(S[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const re=this._getWordAt([0,S[1]+1],!1,!1,!0);re&&(Q+=re.length)}}return{start:B,length:Q}}}_selectWordAt(S,j){const R=this._getWordAt(S,j);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[R.start,S[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(S){const j=this._getWordAt(S,!0);if(j){let R=S[1];for(;j.start<0;)j.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,R]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const j=this._bufferService.buffer.getWrappedRangeForLine(S),R={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(R,this._bufferService.cols)}};a.SelectionService=E=u([g(3,b.IBufferService),g(4,b.ICoreService),g(5,x.IMouseService),g(6,b.IOptionsService),g(7,x.IRenderService),g(8,x.ICoreBrowserService)],E)},4725:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const u=c(8343);a.ICharSizeService=(0,u.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),a.IMouseService=(0,u.createDecorator)("MouseService"),a.IRenderService=(0,u.createDecorator)("RenderService"),a.ISelectionService=(0,u.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,u.createDecorator)("ThemeService")},6731:function(l,a,c){var u=this&&this.__decorate||function(E,S,j,R){var M,T=arguments.length,L=T<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,j):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,j,R);else for(var $=E.length-1;$>=0;$--)(M=E[$])&&(L=(T<3?M(L):T>3?M(S,j,L):M(S,j))||L);return T>3&&L&&Object.defineProperty(S,j,L),L},g=this&&this.__param||function(E,S){return function(j,R){S(j,R,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),x=c(844),y=c(2585),h=_.css.toColor("#ffffff"),p=_.css.toColor("#000000"),f=_.css.toColor("#ffffff"),m=_.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let j=0;j<216;j++){const R=S[j/36%6|0],M=S[j/6%6|0],T=S[j%6];E.push({css:_.channels.toCss(R,M,T),rgba:_.channels.toRgba(R,M,T)})}for(let j=0;j<24;j++){const R=8+10*j;E.push({css:_.channels.toCss(R,R,R),rgba:_.channels.toRgba(R,R,R)})}return E})());let w=a.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:p,cursor:f,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:_.color.blend(p,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:_.color.blend(p,b),ansi:a.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={}){const S=this._colors;if(S.foreground=k(E.foreground,h),S.background=k(E.background,p),S.cursor=k(E.cursor,f),S.cursorAccent=k(E.cursorAccent,m),S.selectionBackgroundTransparent=k(E.selectionBackground,b),S.selectionBackgroundOpaque=_.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=k(E.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=_.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=E.selectionForeground?k(E.selectionForeground,_.NULL_COLOR):void 0,S.selectionForeground===_.NULL_COLOR&&(S.selectionForeground=void 0),_.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=_.color.opacity(S.selectionBackgroundTransparent,.3)),_.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=_.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=a.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=k(E.black,a.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=k(E.red,a.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=k(E.green,a.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=k(E.yellow,a.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=k(E.blue,a.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=k(E.magenta,a.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=k(E.cyan,a.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=k(E.white,a.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=k(E.brightBlack,a.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=k(E.brightRed,a.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=k(E.brightGreen,a.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=k(E.brightYellow,a.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=k(E.brightBlue,a.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=k(E.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=k(E.brightCyan,a.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=k(E.brightWhite,a.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const j=Math.min(S.ansi.length-16,E.extendedAnsi.length);for(let R=0;R<j;R++)S.ansi[R+16]=k(E.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+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 S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}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 k(E,S){if(E!==void 0)try{return _.css.toColor(E)}catch{}return S}a.ThemeService=w=u([g(0,y.IOptionsService)],w)},6349:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const u=c(8460),g=c(844);class d extends g.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const x=new Array(v);for(let y=0;y<Math.min(v,this.length);y++)x[y]=this._array[this._getCyclicIndex(y)];this._array=x,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let x=this._length;x<v;x++)this._array[x]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,x){this._array[this._getCyclicIndex(v)]=x}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new 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(v,x,...y){if(x){for(let h=v;h<this._length-x;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+x)];this._length-=x,this.onDeleteEmitter.fire({index:v,amount:x})}for(let h=this._length-1;h>=v;h--)this._array[this._getCyclicIndex(h+y.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<y.length;h++)this._array[this._getCyclicIndex(v+h)]=y[h];if(y.length&&this.onInsertEmitter.fire({index:v,amount:y.length}),this._length+y.length>this._maxLength){const h=this._length+y.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=y.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,x,y){if(!(x<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=x-1;p>=0;p--)this.set(v+p+y,this.get(v+p));const h=v+x+y-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<x;h++)this.set(v+h+y,this.get(v+h))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}a.CircularList=d},1439:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(u,g=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const _ in u)d[_]=g<=1?u[_]:u[_]&&c(u[_],g-1);return d}},8055:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;const u=c(6114);let g=0,d=0,_=0,v=0;var x,y,h,p,f;function m(w){const k=w.toString(16);return k.length<2?"0"+k:k}function b(w,k){return w<k?(k+.05)/(w+.05):(w+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(w){w.toCss=function(k,E,S,j){return j!==void 0?`#${m(k)}${m(E)}${m(S)}${m(j)}`:`#${m(k)}${m(E)}${m(S)}`},w.toRgba=function(k,E,S,j=255){return(k<<24|E<<16|S<<8|j)>>>0}}(x||(a.channels=x={})),function(w){function k(E,S){return v=Math.round(255*S),[g,d,_]=f.toChannels(E.rgba),{css:x.toCss(g,d,_,v),rgba:x.toRgba(g,d,_,v)}}w.blend=function(E,S){if(v=(255&S.rgba)/255,v===1)return{css:S.css,rgba:S.rgba};const j=S.rgba>>24&255,R=S.rgba>>16&255,M=S.rgba>>8&255,T=E.rgba>>24&255,L=E.rgba>>16&255,$=E.rgba>>8&255;return g=T+Math.round((j-T)*v),d=L+Math.round((R-L)*v),_=$+Math.round((M-$)*v),{css:x.toCss(g,d,_),rgba:x.toRgba(g,d,_)}},w.isOpaque=function(E){return(255&E.rgba)==255},w.ensureContrastRatio=function(E,S,j){const R=f.ensureContrastRatio(E.rgba,S.rgba,j);if(R)return f.toColor(R>>24&255,R>>16&255,R>>8&255)},w.opaque=function(E){const S=(255|E.rgba)>>>0;return[g,d,_]=f.toChannels(S),{css:x.toCss(g,d,_),rgba:S}},w.opacity=k,w.multiplyOpacity=function(E,S){return v=255&E.rgba,k(E,v*S/255)},w.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(y||(a.color=y={})),function(w){let k,E;if(!u.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const j=S.getContext("2d",{willReadFrequently:!0});j&&(k=j,k.globalCompositeOperation="copy",E=k.createLinearGradient(0,0,1,1))}w.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),f.toColor(g,d,_);case 5:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),v=parseInt(S.slice(4,5).repeat(2),16),f.toColor(g,d,_,v);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const j=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return g=parseInt(j[1]),d=parseInt(j[2]),_=parseInt(j[3]),v=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),f.toColor(g,d,_,v);if(!k||!E)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=E,k.fillStyle=S,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[g,d,_,v]=k.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(g,d,_,v),css:S}}}(h||(a.css=h={})),function(w){function k(E,S,j){const R=E/255,M=S/255,T=j/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}w.relativeLuminance=function(E){return k(E>>16&255,E>>8&255,255&E)},w.relativeLuminance2=k}(p||(a.rgb=p={})),function(w){function k(S,j,R){const M=S>>24&255,T=S>>16&255,L=S>>8&255;let $=j>>24&255,z=j>>16&255,W=j>>8&255,q=b(p.relativeLuminance2($,z,W),p.relativeLuminance2(M,T,L));for(;q<R&&($>0||z>0||W>0);)$-=Math.max(0,Math.ceil(.1*$)),z-=Math.max(0,Math.ceil(.1*z)),W-=Math.max(0,Math.ceil(.1*W)),q=b(p.relativeLuminance2($,z,W),p.relativeLuminance2(M,T,L));return($<<24|z<<16|W<<8|255)>>>0}function E(S,j,R){const M=S>>24&255,T=S>>16&255,L=S>>8&255;let $=j>>24&255,z=j>>16&255,W=j>>8&255,q=b(p.relativeLuminance2($,z,W),p.relativeLuminance2(M,T,L));for(;q<R&&($<255||z<255||W<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),z=Math.min(255,z+Math.ceil(.1*(255-z))),W=Math.min(255,W+Math.ceil(.1*(255-W))),q=b(p.relativeLuminance2($,z,W),p.relativeLuminance2(M,T,L));return($<<24|z<<16|W<<8|255)>>>0}w.ensureContrastRatio=function(S,j,R){const M=p.relativeLuminance(S>>8),T=p.relativeLuminance(j>>8);if(b(M,T)<R){if(T<M){const z=k(S,j,R),W=b(M,p.relativeLuminance(z>>8));if(W<R){const q=E(S,j,R);return W>b(M,p.relativeLuminance(q>>8))?z:q}return z}const L=E(S,j,R),$=b(M,p.relativeLuminance(L>>8));if($<R){const z=k(S,j,R);return $>b(M,p.relativeLuminance(z>>8))?L:z}return L}},w.reduceLuminance=k,w.increaseLuminance=E,w.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},w.toColor=function(S,j,R,M){return{css:x.toCss(S,j,R,M),rgba:x.toRgba(S,j,R,M)}}}(f||(a.rgba=f={})),a.toPaddedHex=m,a.contrastRatio=b},8969:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const u=c(844),g=c(2585),d=c(4348),_=c(7866),v=c(744),x=c(7302),y=c(6975),h=c(8460),p=c(1753),f=c(1480),m=c(7994),b=c(9282),w=c(5435),k=c(5981),E=c(2660);let S=!1;class j extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(M=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(M.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(M){for(const T in M)this.optionsService.options[T]=M[T]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.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(T=>{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(T=>{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 k.WriteBuffer((T,L)=>this._inputHandler.parse(T,L))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,T){this._writeBuffer.write(M,T)}writeSync(M,T){this._logService.logLevel<=g.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(M,T)}resize(M,T){isNaN(M)||isNaN(T)||(M=Math.max(M,v.MINIMUM_COLS),T=Math.max(T,v.MINIMUM_ROWS),this._bufferService.resize(M,T))}scroll(M,T=!1){this._bufferService.scroll(M,T)}scrollLines(M,T,L){this._bufferService.scrollLines(M,T,L)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const T=M-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(M,T){return this._inputHandler.registerEscHandler(M,T)}registerDcsHandler(M,T){return this._inputHandler.registerDcsHandler(M,T)}registerCsiHandler(M,T){return this._inputHandler.registerCsiHandler(M,T)}registerOscHandler(M,T){return this._inputHandler.registerOscHandler(M,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?M=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)(()=>{for(const T of M)T.dispose()})}}}a.CoreTerminal=j},8460:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,u){return c(g=>u.fire(g))}},5435:function(l,a,c){var u=this&&this.__decorate||function(q,N,P,D){var O,B=arguments.length,Q=B<3?N:D===null?D=Object.getOwnPropertyDescriptor(N,P):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(q,N,P,D);else for(var ee=q.length-1;ee>=0;ee--)(O=q[ee])&&(Q=(B<3?O(Q):B>3?O(N,P,Q):O(N,P))||Q);return B>3&&Q&&Object.defineProperty(N,P,Q),Q},g=this&&this.__param||function(q,N){return function(P,D){N(P,D,q)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),x=c(844),y=c(482),h=c(8437),p=c(8460),f=c(643),m=c(511),b=c(3734),w=c(2585),k=c(6242),E=c(6351),S=c(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function M(q,N){if(q>24)return N.setWinLines||!1;switch(q){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var T;(function(q){q[q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",q[q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let L=0;class $ extends x.Disposable{getAttrData(){return this._curAttrData}constructor(N,P,D,O,B,Q,ee,re,ye=new v.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=P,this._coreService=D,this._logService=O,this._optionsService=B,this._oscLinkService=Q,this._coreMouseService=ee,this._unicodeService=re,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new m.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:U.toArray()})}),this._parser.setEscHandlerFallback(A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})}),this._parser.setExecuteHandlerFallback(A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})}),this._parser.setOscHandlerFallback((A,U,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:U,data:G})}),this._parser.setDcsHandlerFallback((A,U,G)=>{U==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:U,payload:G})}),this._parser.setPrintHandler((A,U,G)=>this.print(A,U,G)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new k.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new k.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new k.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new k.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new k.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new k.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new k.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new k.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new k.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new k.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new k.OscHandler(A=>this.restoreCursorColor(A))),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(const A in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},()=>this.selectCharset("("+A)),this._parser.registerEscHandler({intermediates:")",final:A},()=>this.selectCharset(")"+A)),this._parser.registerEscHandler({intermediates:"*",final:A},()=>this.selectCharset("*"+A)),this._parser.registerEscHandler({intermediates:"+",final:A},()=>this.selectCharset("+"+A)),this._parser.registerEscHandler({intermediates:"-",final:A},()=>this.selectCharset("-"+A)),this._parser.registerEscHandler({intermediates:".",final:A},()=>this.selectCharset("."+A)),this._parser.registerEscHandler({intermediates:"/",final:A},()=>this.selectCharset("/"+A));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(A=>(this._logService.error("Parsing error: ",A),A)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((A,U)=>this.requestStatusString(A,U)))}_preserveStack(N,P,D,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=D,this._parseStack.position=O}_logSlowResolvingAsync(N){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([N,new Promise((P,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,P){let D,O=this._activeBuffer.x,B=this._activeBuffer.y,Q=0;const ee=this._parseStack.paused;if(ee){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(D),D;O=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>R&&(Q=this._parseStack.position+R)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,re=>String.fromCharCode(re)).join("")}"`),typeof N=="string"?N.split("").map(re=>re.charCodeAt(0)):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(N.length,R))),ee||this._dirtyRowTracker.clearRange(),N.length>R)for(let re=Q;re<N.length;re+=R){const ye=re+R<N.length?re+R:N.length,A=typeof N=="string"?this._stringDecoder.decode(N.substring(re,ye),this._parseBuffer):this._utf8Decoder.decode(N.subarray(re,ye),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,A))return this._preserveStack(O,B,A,re),this._logSlowResolvingAsync(D),D}else if(!ee){const re=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,re))return this._preserveStack(O,B,re,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===O&&this._activeBuffer.y===B||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(N,P,D){let O,B;const Q=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,re=this._bufferService.cols,ye=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,U=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-P>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodePoint(this._activeBuffer.x-1,0,1,U.fg,U.bg,U.extended);for(let K=P;K<D;++K){if(O=N[K],B=this._unicodeService.wcwidth(O),O<127&&Q){const Z=Q[String.fromCharCode(O)];Z&&(O=Z.charCodeAt(0))}if(ee&&this._onA11yChar.fire((0,y.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),B||!this._activeBuffer.x){if(this._activeBuffer.x+B-1>=re){if(ye){for(;this._activeBuffer.x<re;)G.setCellFromCodePoint(this._activeBuffer.x++,0,1,U.fg,U.bg,U.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),G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=re-1,B===2)continue}if(A&&(G.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(U),U),G.getWidth(re-1)===2&&G.setCellFromCodePoint(re-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,U.fg,U.bg,U.extended)),G.setCellFromCodePoint(this._activeBuffer.x++,O,B,U.fg,U.bg,U.extended),B>0)for(;--B;)G.setCellFromCodePoint(this._activeBuffer.x++,0,0,U.fg,U.bg,U.extended)}else G.getWidth(this._activeBuffer.x-1)?G.addCodepointToCell(this._activeBuffer.x-1,O):G.addCodepointToCell(this._activeBuffer.x-2,O)}D-P>0&&(G.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<re&&D-P>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodePoint(this._activeBuffer.x,0,1,U.fg,U.bg,U.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,P){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,P):this._parser.registerCsiHandler(N,D=>!M(D.params[0],this._optionsService.rawOptions.windowOptions)||P(D))}registerDcsHandler(N,P){return this._parser.registerDcsHandler(N,new E.DcsHandler(P))}registerEscHandler(N,P){return this._parser.registerEscHandler(N,P)}registerOscHandler(N,P){return this._parser.registerOscHandler(N,new k.OscHandler(P))}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(){var N;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&&(!((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||N===void 0)&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=N,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+P)}cursorUp(N){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const P=N.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=N.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=N.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const P=N.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,P,D,O=!1,B=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);Q.replaceCells(P,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),B),O&&(Q.isWrapped=!1)}_resetBufferLine(N,P=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),D.isWrapped=!1)}eraseInDisplay(N,P=!1){let D;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);D<this._bufferService.rows;D++)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(N,P=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let P=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;P--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let P=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;P--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let P=N.params[0]||1;for(;P--;)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(N){let P=N.params[0]||1;for(;P--;)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(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){if(!this._parser.precedingCodepoint)return!0;const P=N.params[0]||1,D=new Uint32Array(P);for(let O=0;O<P;++O)D[O]=this._parser.precedingCodepoint;return this.print(D,0,D.length),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let P=0;P<N.length;P++)switch(N.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let P=0;P<N.length;P++)switch(N.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(N){for(let P=0;P<N.length;P++)switch(N.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let P=0;P<N.length;P++)switch(N.params[P]){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(),N.params[P]===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(N,P){const D=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:B}=this._coreMouseService,Q=this._coreService,{buffers:ee,cols:re}=this._bufferService,{active:ye,alt:A}=ee,U=this._optionsService.rawOptions,G=ae=>ae?1:2,K=N.params[0];return Z=K,X=P?K===2?4:K===4?G(Q.modes.insertMode):K===12?3:K===20?G(U.convertEol):0:K===1?G(D.applicationCursorKeys):K===3?U.windowOptions.setWinLines?re===80?2:re===132?1:0:0:K===6?G(D.origin):K===7?G(D.wraparound):K===8?3:K===9?G(O==="X10"):K===12?G(U.cursorBlink):K===25?G(!Q.isCursorHidden):K===45?G(D.reverseWraparound):K===66?G(D.applicationKeypad):K===67?4:K===1e3?G(O==="VT200"):K===1002?G(O==="DRAG"):K===1003?G(O==="ANY"):K===1004?G(D.sendFocus):K===1005?4:K===1006?G(B==="SGR"):K===1015?4:K===1016?G(B==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?G(ye===A):K===2004?G(D.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${P?"":"?"}${Z};${X}$y`),!0;var Z,X}_updateAttrColor(N,P,D,O,B){return P===2?(N|=50331648,N&=-16777216,N|=b.AttributeData.fromColorRGB([D,O,B])):P===5&&(N&=-50331904,N|=33554432|255&D),N}_extractColor(N,P,D){const O=[0,0,-1,0,0,0];let B=0,Q=0;do{if(O[Q+B]=N.params[P+Q],N.hasSubParams(P+Q)){const ee=N.getSubParams(P+Q);let re=0;do O[1]===5&&(B=1),O[Q+re+1+B]=ee[re];while(++re<ee.length&&re+Q+1+B<O.length);break}if(O[1]===5&&Q+B>=2||O[1]===2&&Q+B>=5)break;O[1]&&(B=1)}while(++Q+P<N.length&&Q+B<O.length);for(let ee=2;ee<O.length;++ee)O[ee]===-1&&(O[ee]=0);switch(O[0]){case 38:D.fg=this._updateAttrColor(D.fg,O[1],O[3],O[4],O[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,O[1],O[3],O[4],O[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,O[1],O[3],O[4],O[5])}return Q}_processUnderline(N,P){P.extended=P.extended.clone(),(!~N||N>5)&&(N=1),P.extended.underlineStyle=N,P.fg|=268435456,N===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(N){N.fg=h.DEFAULT_ATTR_DATA.fg,N.bg=h.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=N.length;let D;const O=this._curAttrData;for(let B=0;B<P;B++)D=N.params[B],D>=30&&D<=37?(O.fg&=-50331904,O.fg|=16777216|D-30):D>=40&&D<=47?(O.bg&=-50331904,O.bg|=16777216|D-40):D>=90&&D<=97?(O.fg&=-50331904,O.fg|=16777224|D-90):D>=100&&D<=107?(O.bg&=-50331904,O.bg|=16777224|D-100):D===0?this._processSGR0(O):D===1?O.fg|=134217728:D===3?O.bg|=67108864:D===4?(O.fg|=268435456,this._processUnderline(N.hasSubParams(B)?N.getSubParams(B)[0]:1,O)):D===5?O.fg|=536870912:D===7?O.fg|=67108864:D===8?O.fg|=1073741824:D===9?O.fg|=2147483648:D===2?O.bg|=134217728:D===21?this._processUnderline(2,O):D===22?(O.fg&=-134217729,O.bg&=-134217729):D===23?O.bg&=-67108865:D===24?(O.fg&=-268435457,this._processUnderline(0,O)):D===25?O.fg&=-536870913:D===27?O.fg&=-67108865:D===28?O.fg&=-1073741825:D===29?O.fg&=2147483647:D===39?(O.fg&=-67108864,O.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):D===49?(O.bg&=-67108864,O.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?B+=this._extractColor(N,B,O):D===53?O.bg|=1073741824:D===55?O.bg&=-1073741825:D===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):D===100?(O.fg&=-67108864,O.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${P};${D}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${P};${D}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.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(N){const P=N.params[0]||1;switch(P){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"}const D=P%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(N){const P=N.params[0]||1;let D;return(N.length<2||(D=N.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(N){if(!M(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const P=[],D=N.split(";");for(;D.length>1;){const O=D.shift(),B=D.shift();if(/^\d+$/.exec(O)){const Q=parseInt(O);if(W(Q))if(B==="?")P.push({type:0,index:Q});else{const ee=(0,S.parseColor)(B);ee&&P.push({type:1,index:Q,color:ee})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(N){const P=N.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(N,P){this._getCurrentLinkId()&&this._finishHyperlink();const D=N.split(":");let O;const B=D.findIndex(Q=>Q.startsWith("id="));return B!==-1&&(O=D[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,P){const D=N.split(";");for(let O=0;O<D.length&&!(P>=this._specialColors.length);++O,++P)if(D[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const B=(0,S.parseColor)(D[O]);B&&this._onColor.fire([{type:1,index:this._specialColors[P],color:B}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const P=[],D=N.split(";");for(let O=0;O<D.length;++O)if(/^\d+$/.exec(D[O])){const B=parseInt(D[O]);W(B)&&P.push({type:2,index:B})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,_.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(j[N[0]],_.CHARSETS[N[1]]||_.DEFAULT_CHARSET),!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){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new m.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const D=this._activeBuffer.ybase+this._activeBuffer.y+P,O=this._activeBuffer.lines.get(D);O&&(O.fill(N),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,P){const D=this._bufferService.buffer,O=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${B}${d.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,P){this._dirtyRowTracker.markRangeDirty(N,P)}}a.InputHandler=$;let z=class{constructor(q){this._bufferService=q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(q){q<this.start?this.start=q:q>this.end&&(this.end=q)}markRangeDirty(q,N){q>N&&(L=q,q=N,N=L),q<this.start&&(this.start=q),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(q){return 0<=q&&q<256}z=u([g(0,w.IBufferService)],z)},844:(l,a)=>{function c(u){for(const g of u)g.dispose();u.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const g=this._disposables.indexOf(u);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var g;this._isDisposed||u===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}},a.toDisposable=function(u){return{dispose:u}},a.disposeArray=c,a.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,_){this._data[g]||(this._data[g]={}),this._data[g][d]=_}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(u,g,d,_,v){this._data.get(u,g)||this._data.set(u,g,new c),this._data.get(u,g).set(d,_,v)}get(u,g,d,_){var v;return(v=this._data.get(u,g))===null||v===void 0?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof navigator>"u";const c=a.isNode?"node":navigator.userAgent,u=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),a.isIpad=u==="iPad",a.isIphone=u==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),a.isLinux=u.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const g=this._getKey(u);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,g){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let g=0,d=this._array.length-1;for(;d>=g;){let _=g+d>>1;const v=this._getKey(this._array[_]);if(v>u)d=_-1;else{if(!(v<u)){for(;_>0&&this._getKey(this._array[_-1])===u;)_--;return _}g=_+1}}return g}}},7226:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const u=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let x=0,y=0,h=v.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),y=Math.max(x,y),p=v.timeRemaining(),1.5*y>p)return h-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-x))}ms`),void this._start();h=p}this.clear()}}class d extends g{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const x=Date.now()+v;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const u=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=d==null?void 0:d.get(g.cols-1),v=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);v&&_&&(v.isWrapped=_[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&_[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}a.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=u},9092:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const u=c(6349),g=c(7226),d=c(3734),_=c(8437),v=c(4634),x=c(511),y=c(643),h=c(4863),p=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(f,m,b){this._hasScrollback=f,this._optionsService=m,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,m){return new _.BufferLine(this._bufferService.cols,this.getNullCell(f),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const m=f+this._optionsService.rawOptions.scrollback;return m>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:m}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=_.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,m){const b=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const k=this._getCorrectBufferLength(m);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<f)for(let S=0;S<this.lines.length;S++)w+=+this.lines.get(S).resize(f,b);let E=0;if(this._rows<m)for(let S=this._rows;S<m;S++)this.lines.length<m+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(f,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(f,b)));else for(let S=this._rows;S>m;S--)this.lines.length>m+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const S=this.lines.length-k;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=k}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,m-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(f,m),this._cols>f))for(let E=0;E<this.lines.length;E++)w+=+this.lines.get(E).resize(f,b);this._cols=f,this._rows=m,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,m){this._cols!==f&&(f>this._cols?this._reflowLarger(f,m):this._reflowSmaller(f,m))}_reflowLarger(f,m){const b=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(b.length>0){const w=(0,v.reflowLargerCreateNewLayout)(this.lines,b);(0,v.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(f,m,w.countRemoved)}}_reflowLargerAdjustViewport(f,m,b){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let k=b;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new _.BufferLine(f,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(f,m){const b=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let k=0;for(let E=this.lines.length-1;E>=0;E--){let S=this.lines.get(E);if(!S||!S.isWrapped&&S.getTrimmedLength()<=f)continue;const j=[S];for(;S.isWrapped&&E>0;)S=this.lines.get(--E),j.unshift(S);const R=this.ybase+this.y;if(R>=E&&R<E+j.length)continue;const M=j[j.length-1].getTrimmedLength(),T=(0,v.reflowSmallerGetNewLineLengths)(j,this._cols,f),L=T.length-j.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const z=[];for(let O=0;O<L;O++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);z.push(B)}z.length>0&&(w.push({start:E+j.length+k,newLines:z}),k+=z.length),j.push(...z);let W=T.length-1,q=T[W];q===0&&(W--,q=T[W]);let N=j.length-L-1,P=M;for(;N>=0;){const O=Math.min(P,q);if(j[W]===void 0)break;if(j[W].copyCellsFrom(j[N],P-O,q-O,O,!0),q-=O,q===0&&(W--,q=T[W]),P-=O,P===0){N--;const B=Math.max(N,0);P=(0,v.getWrappedLineTrimmedLength)(j,B,this._cols)}}for(let O=0;O<j.length;O++)T[O]<f&&j[O].setCell(T[O],b);let D=L-$;for(;D-- >0;)this.ybase===0?this.y<m-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+m-1)}if(w.length>0){const E=[],S=[];for(let W=0;W<this.lines.length;W++)S.push(this.lines.get(W));const j=this.lines.length;let R=j-1,M=0,T=w[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let L=0;for(let W=Math.min(this.lines.maxLength-1,j+k-1);W>=0;W--)if(T&&T.start>R+L){for(let q=T.newLines.length-1;q>=0;q--)this.lines.set(W--,T.newLines[q]);W++,E.push({index:R+1,amount:T.newLines.length}),L+=T.newLines.length,T=w[++M]}else this.lines.set(W,S[R--]);let $=0;for(let W=E.length-1;W>=0;W--)E[W].index+=$,this.lines.onInsertEmitter.fire(E[W]),$+=E[W].amount;const z=Math.max(0,j+k-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(f,m,b=0,w){const k=this.lines.get(f);return k?k.translateToString(m,b,w):""}getWrappedRangeForLine(f){let m=f,b=f;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:m,last:b}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===f&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const m=new h.Marker(f);return this.markers.push(m),m.register(this.lines.onTrim(b=>{m.line-=b,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(b=>{m.line>=b.index&&(m.line+=b.amount)})),m.register(this.lines.onDelete(b=>{m.line>=b.index&&m.line<b.index+b.amount&&m.dispose(),m.line>b.index&&(m.line-=b.amount)})),m.register(m.onDispose(()=>this._removeMarker(m))),m}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const u=c(3734),g=c(511),d=c(643),_=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let v=0;class x{constructor(h,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const m=p||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b<h;++b)this.setCell(b,m);this.length=h}get(h){const p=this._data[3*h+0],f=2097151&p;return[this._data[3*h+1],2097152&p?this._combined[h]:f?(0,_.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[h].charCodeAt(this._combined[h].length-1):f]}set(h,p){this._data[3*h+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=p[1],this._data[3*h+0]=2097152|h|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const p=this._data[3*h+0];return 2097152&p?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&p}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const p=this._data[3*h+0];return 2097152&p?this._combined[h]:2097151&p?(0,_.stringFromCodePoint)(2097151&p):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,p){return v=3*h,p.content=this._data[v+0],p.fg=this._data[v+1],p.bg=this._data[v+2],2097152&p.content&&(p.combinedData=this._combined[h]),268435456&p.bg&&(p.extended=this._extendedAttrs[h]),p}setCell(h,p){2097152&p.content&&(this._combined[h]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[h]=p.extended),this._data[3*h+0]=p.content,this._data[3*h+1]=p.fg,this._data[3*h+2]=p.bg}setCellFromCodePoint(h,p,f,m,b,w){268435456&b&&(this._extendedAttrs[h]=w),this._data[3*h+0]=p|f<<22,this._data[3*h+1]=m,this._data[3*h+2]=b}addCodepointToCell(h,p){let f=this._data[3*h+0];2097152&f?this._combined[h]+=(0,_.stringFromCodePoint)(p):(2097151&f?(this._combined[h]=(0,_.stringFromCodePoint)(2097151&f)+(0,_.stringFromCodePoint)(p),f&=-2097152,f|=2097152):f=p|4194304,this._data[3*h+0]=f)}insertCells(h,p,f,m){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length-h){const b=new g.CellData;for(let w=this.length-h-p-1;w>=0;--w)this.setCell(h+p+w,this.loadCell(h+w,b));for(let w=0;w<p;++w)this.setCell(h+w,f)}else for(let b=h;b<this.length;++b)this.setCell(b,f);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}deleteCells(h,p,f,m){if(h%=this.length,p<this.length-h){const b=new g.CellData;for(let w=0;w<this.length-h-p;++w)this.setCell(h+w,this.loadCell(h+p+w,b));for(let w=this.length-p;w<this.length;++w)this.setCell(w,f)}else for(let b=h;b<this.length;++b)this.setCell(b,f);h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodePoint(h,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}replaceCells(h,p,f,m,b=!1){if(b)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodePoint(h-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);h<p&&h<this.length;)this.isProtected(h)||this.setCell(h,f),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);h<p&&h<this.length;)this.setCell(h++,f)}resize(h,p){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const m=new Uint32Array(f);m.set(this._data),this._data=m}for(let m=this.length;m<h;++m)this.setCell(m,p)}else{this._data=this._data.subarray(0,f);const m=Object.keys(this._combined);for(let w=0;w<m.length;w++){const k=parseInt(m[w],10);k>=h&&delete this._combined[k]}const b=Object.keys(this._extendedAttrs);for(let w=0;w<b.length;w++){const k=parseInt(b[w],10);k>=h&&delete this._extendedAttrs[k]}}return this.length=h,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,h);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const p in h._combined)this._combined[p]=h._combined[p];this._extendedAttrs={};for(const p in h._extendedAttrs)this._extendedAttrs[p]=h._extendedAttrs[p];this.isWrapped=h.isWrapped}clone(){const h=new x(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const p in this._combined)h._combined[p]=this._combined[p];for(const p in this._extendedAttrs)h._extendedAttrs[p]=this._extendedAttrs[p];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,p,f,m,b){const w=h._data;if(b)for(let E=m-1;E>=0;E--){for(let S=0;S<3;S++)this._data[3*(f+E)+S]=w[3*(p+E)+S];268435456&w[3*(p+E)+2]&&(this._extendedAttrs[f+E]=h._extendedAttrs[p+E])}else for(let E=0;E<m;E++){for(let S=0;S<3;S++)this._data[3*(f+E)+S]=w[3*(p+E)+S];268435456&w[3*(p+E)+2]&&(this._extendedAttrs[f+E]=h._extendedAttrs[p+E])}const k=Object.keys(h._combined);for(let E=0;E<k.length;E++){const S=parseInt(k[E],10);S>=p&&(this._combined[S-p+f]=h._combined[S])}}translateToString(h=!1,p=0,f=this.length){h&&(f=Math.min(f,this.getTrimmedLength()));let m="";for(;p<f;){const b=this._data[3*p+0],w=2097151&b;m+=2097152&b?this._combined[p]:w?(0,_.stringFromCodePoint)(w):d.WHITESPACE_CELL_CHAR,p+=b>>22||1}return m}}a.BufferLine=x},4841:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,a)=>{function c(u,g,d){if(g===u.length-1)return u[g].getTrimmedLength();const _=!u[g].hasContent(d-1)&&u[g].getWidth(d-1)===1,v=u[g+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(u,g,d,_,v){const x=[];for(let y=0;y<u.length-1;y++){let h=y,p=u.get(++h);if(!p.isWrapped)continue;const f=[u.get(y)];for(;h<u.length&&p.isWrapped;)f.push(p),p=u.get(++h);if(_>=y&&_<h){y+=f.length-1;continue}let m=0,b=c(f,m,g),w=1,k=0;for(;w<f.length;){const S=c(f,w,g),j=S-k,R=d-b,M=Math.min(j,R);f[m].copyCellsFrom(f[w],k,b,M,!1),b+=M,b===d&&(m++,b=0),k+=M,k===S&&(w++,k=0),b===0&&m!==0&&f[m-1].getWidth(d-1)===2&&(f[m].copyCellsFrom(f[m-1],d-1,b++,1,!1),f[m-1].setCell(d-1,v))}f[m].replaceCells(b,d,v);let E=0;for(let S=f.length-1;S>0&&(S>m||f[S].getTrimmedLength()===0);S--)E++;E>0&&(x.push(y+f.length-E),x.push(E)),y+=f.length-1}return x},a.reflowLargerCreateNewLayout=function(u,g){const d=[];let _=0,v=g[_],x=0;for(let y=0;y<u.length;y++)if(v===y){const h=g[++_];u.onDeleteEmitter.fire({index:y-x,amount:h}),y+=h-1,x+=h,v=g[++_]}else d.push(y);return{layout:d,countRemoved:x}},a.reflowLargerApplyNewLayout=function(u,g){const d=[];for(let _=0;_<g.length;_++)d.push(u.get(g[_]));for(let _=0;_<d.length;_++)u.set(_,d[_]);u.length=g.length},a.reflowSmallerGetNewLineLengths=function(u,g,d){const _=[],v=u.map((p,f)=>c(u,f,g)).reduce((p,f)=>p+f);let x=0,y=0,h=0;for(;h<v;){if(v-h<d){_.push(v-h);break}x+=d;const p=c(u,y,g);x>p&&(x-=p,y++);const f=u[y].getWidth(x-1)===2;f&&x--;const m=f?d-1:d;_.push(m),h+=m}return _},a.getWrappedLineTrimmedLength=c},5295:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const u=c(8460),g=c(844),d=c(9092);class _ extends g.Disposable{constructor(x,y){super(),this._optionsService=x,this._bufferService=y,this._onBufferActivate=this.register(new u.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,y){this._normal.resize(x,y),this._alt.resize(x,y),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}a.BufferSet=_},511:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const u=c(482),g=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const y=new _;return y.setFromCharData(x),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(x[g.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(x[g.CHAR_DATA_CHAR_INDEX].length===2){const h=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const p=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(h-55296)+p-56320+65536|x[g.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[g.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=x[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const u=c(8460),g=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}a.Marker=d,d._nextId=1},7116:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,a)=>{var c,u,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
195
+ `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(a.C0=c={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(u||(a.C1=u={})),function(d){d.ST=`${c.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const u=c(2584),g={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:["'",'"']};a.evaluateKeyboardEvent=function(d,_,v,x){const y={type:0,cancel:!1,key:void 0},h=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?y.key=_?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?y.key=_?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?y.key=_?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(y.key=_?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:if(d.altKey){y.key=u.C0.ESC+u.C0.DEL;break}y.key=u.C0.DEL;break;case 9:if(d.shiftKey){y.key=u.C0.ESC+"[Z";break}y.key=u.C0.HT,y.cancel=!0;break;case 13:y.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,y.cancel=!0;break;case 27:y.key=u.C0.ESC,d.altKey&&(y.key=u.C0.ESC+u.C0.ESC),y.cancel=!0;break;case 37:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"D",y.key===u.C0.ESC+"[1;3D"&&(y.key=u.C0.ESC+(v?"b":"[1;5D"))):y.key=_?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"C",y.key===u.C0.ESC+"[1;3C"&&(y.key=u.C0.ESC+(v?"f":"[1;5C"))):y.key=_?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"A",v||y.key!==u.C0.ESC+"[1;3A"||(y.key=u.C0.ESC+"[1;5A")):y.key=_?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"B",v||y.key!==u.C0.ESC+"[1;3B"||(y.key=u.C0.ESC+"[1;5B")):y.key=_?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(y.key=u.C0.ESC+"[2~");break;case 46:y.key=h?u.C0.ESC+"[3;"+(h+1)+"~":u.C0.ESC+"[3~";break;case 36:y.key=h?u.C0.ESC+"[1;"+(h+1)+"H":_?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:y.key=h?u.C0.ESC+"[1;"+(h+1)+"F":_?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?y.type=2:d.ctrlKey?y.key=u.C0.ESC+"[5;"+(h+1)+"~":y.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?y.type=3:d.ctrlKey?y.key=u.C0.ESC+"[6;"+(h+1)+"~":y.key=u.C0.ESC+"[6~";break;case 112:y.key=h?u.C0.ESC+"[1;"+(h+1)+"P":u.C0.ESC+"OP";break;case 113:y.key=h?u.C0.ESC+"[1;"+(h+1)+"Q":u.C0.ESC+"OQ";break;case 114:y.key=h?u.C0.ESC+"[1;"+(h+1)+"R":u.C0.ESC+"OR";break;case 115:y.key=h?u.C0.ESC+"[1;"+(h+1)+"S":u.C0.ESC+"OS";break;case 116:y.key=h?u.C0.ESC+"[15;"+(h+1)+"~":u.C0.ESC+"[15~";break;case 117:y.key=h?u.C0.ESC+"[17;"+(h+1)+"~":u.C0.ESC+"[17~";break;case 118:y.key=h?u.C0.ESC+"[18;"+(h+1)+"~":u.C0.ESC+"[18~";break;case 119:y.key=h?u.C0.ESC+"[19;"+(h+1)+"~":u.C0.ESC+"[19~";break;case 120:y.key=h?u.C0.ESC+"[20;"+(h+1)+"~":u.C0.ESC+"[20~";break;case 121:y.key=h?u.C0.ESC+"[21;"+(h+1)+"~":u.C0.ESC+"[21~";break;case 122:y.key=h?u.C0.ESC+"[23;"+(h+1)+"~":u.C0.ESC+"[23~";break;case 123:y.key=h?u.C0.ESC+"[24;"+(h+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!x||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?y.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(y.key=u.C0.US),d.key==="@"&&(y.key=u.C0.NUL)):d.keyCode===65&&(y.type=1);else{const p=g[d.keyCode],f=p==null?void 0:p[d.shiftKey?1:0];if(f)y.key=u.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const m=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(m);d.shiftKey&&(b=b.toUpperCase()),y.key=u.C0.ESC+b}else if(d.keyCode===32)y.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let m=d.code.slice(3,4);d.shiftKey||(m=m.toLowerCase()),y.key=u.C0.ESC+m,y.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?y.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?y.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?y.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?y.key=u.C0.DEL:d.keyCode===219?y.key=u.C0.ESC:d.keyCode===220?y.key=u.C0.FS:d.keyCode===221&&(y.key=u.C0.GS)}return y}},482:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,u=0,g=c.length){let d="";for(let _=u;_<g;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const g=c.length;if(!g)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?u[d++]=1024*(this._interim-55296)+v-56320+65536:(u[d++]=this._interim,u[d++]=v),this._interim=0}for(let v=_;v<g;++v){const x=c.charCodeAt(v);if(55296<=x&&x<=56319){if(++v>=g)return this._interim=x,d;const y=c.charCodeAt(v);56320<=y&&y<=57343?u[d++]=1024*(x-55296)+y-56320+65536:(u[d++]=x,u[d++]=y)}else x!==65279&&(u[d++]=x)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const g=c.length;if(!g)return 0;let d,_,v,x,y=0,h=0,p=0;if(this.interim[0]){let b=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let k,E=0;for(;(k=63&this.interim[++E])&&E<4;)w<<=6,w|=k;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=S-E;for(;p<j;){if(p>=g)return 0;if(k=c[p++],(192&k)!=128){p--,b=!0;break}this.interim[E++]=k,w<<=6,w|=63&k}b||(S===2?w<128?p--:u[y++]=w:S===3?w<2048||w>=55296&&w<=57343||w===65279||(u[y++]=w):w<65536||w>1114111||(u[y++]=w)),this.interim.fill(0)}const f=g-4;let m=p;for(;m<g;){for(;!(!(m<f)||128&(d=c[m])||128&(_=c[m+1])||128&(v=c[m+2])||128&(x=c[m+3]));)u[y++]=d,u[y++]=_,u[y++]=v,u[y++]=x,m+=4;if(d=c[m++],d<128)u[y++]=d;else if((224&d)==192){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(h=(31&d)<<6|63&_,h<128){m--;continue}u[y++]=h}else if((240&d)==224){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,y;if(v=c[m++],(192&v)!=128){m--;continue}if(h=(15&d)<<12|(63&_)<<6|63&v,h<2048||h>=55296&&h<=57343||h===65279)continue;u[y++]=h}else if((248&d)==240){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,y;if(v=c[m++],(192&v)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,y;if(x=c[m++],(192&x)!=128){m--;continue}if(h=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&x,h<65536||h>1114111)continue;u[y++]=h}}return y}}},225:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=[[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]],u=[[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]];let g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let d=0;d<c.length;++d)g.fill(0,c[d][0],c[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?g[d]:function(_,v){let x,y=0,h=v.length-1;if(_<v[0][0]||_>v[h][1])return!1;for(;h>=y;)if(x=y+h>>1,_>v[x][1])y=x+1;else{if(!(_<v[x][0]))return!0;h=x-1}return!1}(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const u=c(8460),g=c(844);class d extends g.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,x){if(this._pendingData>5e7)throw new 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+=v.length,this._writeBuffer.push(v),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(x)}_innerWrite(v=0,x=!0){const y=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],p=this._action(h,x);if(p){const m=b=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(y,b);return void p.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(m)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-y>=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()}}a.WriteBuffer=d},5941:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\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})$/,u=/^[\da-f]+$/;function g(d,_){const v=d.toString(16),x=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}a.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const x=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/x*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/x*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),u.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,x=[0,0,0];for(let y=0;y<3;++y){const h=parseInt(_.slice(v*y,v*y+v),16);x[y]=v===1?h<<4:v===2?h:v===3?h>>4:h>>8}return x}},a.toRgbString=function(d,_=16){const[v,x,y]=d;return`rgb:${g(v,_)}/${g(x,_)}/${g(y,_)}`}},5770:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const u=c(482),g=c(8742),d=c(5770),_=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(x,y){this._handlers[x]===void 0&&(this._handlers[x]=[]);const h=this._handlers[x];return h.push(y),{dispose:()=>{const p=h.indexOf(y);p!==-1&&h.splice(p,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(x,y){if(this.reset(),this._ident=x,this._active=this._handlers[x]||_,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(x,y,h){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(x,y,h);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,y,h))}unhook(x,y=!0){if(this._active.length){let h=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,h=y,f=this._stack.fallThrough,this._stack.paused=!1),!f&&h===!1){for(;p>=0&&(h=this._active[p].unhook(x),h!==!0);p--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,h;p--}for(;p>=0;p--)if(h=this._active[p].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const v=new g.Params;v.addParam(0),a.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=v,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():v,this._data="",this._hitLimit=!1}put(x,y,h){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,y,h),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let y=!1;if(this._hitLimit)y=!1;else if(x&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(h=>(this._params=v,this._data="",this._hitLimit=!1,h));return this._params=v,this._data="",this._hitLimit=!1,y}}},2015:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const u=c(844),g=c(8742),d=c(6242),_=c(6351);class v{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,m,b){this.table[f<<8|p]=m<<4|b}addMany(p,f,m,b){for(let w=0;w<p.length;w++)this.table[f<<8|p[w]]=m<<4|b}}a.TransitionTable=v;const x=160;a.VT500_TRANSITION_TABLE=function(){const h=new v(4095),p=Array.apply(null,Array(256)).map((E,S)=>S),f=(E,S)=>p.slice(E,S),m=f(32,127),b=f(0,24);b.push(25),b.push.apply(b,f(28,32));const w=f(0,14);let k;for(k in h.setDefault(1,0),h.addMany(m,0,2,0),w)h.addMany([24,26,153,154],k,3,0),h.addMany(f(128,144),k,3,0),h.addMany(f(144,152),k,3,0),h.add(156,k,0,0),h.add(27,k,11,1),h.add(157,k,4,8),h.addMany([152,158,159],k,0,7),h.add(155,k,11,3),h.add(144,k,11,9);return h.addMany(b,0,3,0),h.addMany(b,1,3,1),h.add(127,1,0,1),h.addMany(b,8,0,8),h.addMany(b,3,3,3),h.add(127,3,0,3),h.addMany(b,4,3,4),h.add(127,4,0,4),h.addMany(b,6,3,6),h.addMany(b,5,3,5),h.add(127,5,0,5),h.addMany(b,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(m,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(f(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(m,7,0,7),h.addMany(b,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(f(64,127),3,7,0),h.addMany(f(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(f(48,60),4,8,4),h.addMany(f(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(f(32,64),6,0,6),h.add(127,6,0,6),h.addMany(f(64,127),6,0,0),h.addMany(f(32,48),3,9,5),h.addMany(f(32,48),5,9,5),h.addMany(f(48,64),5,0,6),h.addMany(f(64,127),5,7,0),h.addMany(f(32,48),4,9,5),h.addMany(f(32,48),1,9,2),h.addMany(f(32,48),2,9,2),h.addMany(f(48,127),2,10,0),h.addMany(f(48,80),1,10,0),h.addMany(f(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(f(96,127),1,10,0),h.add(80,1,11,9),h.addMany(b,9,0,9),h.add(127,9,0,9),h.addMany(f(28,32),9,0,9),h.addMany(f(32,48),9,9,12),h.addMany(f(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(b,11,0,11),h.addMany(f(32,128),11,0,11),h.addMany(f(28,32),11,0,11),h.addMany(b,10,0,10),h.add(127,10,0,10),h.addMany(f(28,32),10,0,10),h.addMany(f(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(f(32,48),10,9,12),h.addMany(b,12,0,12),h.add(127,12,0,12),h.addMany(f(28,32),12,0,12),h.addMany(f(32,48),12,9,12),h.addMany(f(48,64),12,0,11),h.addMany(f(64,127),12,12,13),h.addMany(f(64,127),10,12,13),h.addMany(f(64,127),9,12,13),h.addMany(b,13,13,13),h.addMany(m,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(x,0,2,0),h.add(x,8,5,8),h.add(x,6,0,6),h.add(x,11,0,11),h.add(x,13,13,13),h}();class y extends u.Disposable{constructor(p=a.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(f,m,b)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,m)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,f=[64,126]){let m=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=p.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<p.intermediates.length;++w){const k=p.intermediates.charCodeAt(w);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=k}}if(p.final.length!==1)throw new Error("final must be a single byte");const b=p.final.charCodeAt(0);if(f[0]>b||b>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return m<<=8,m|=b,m}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const m=this._identifier(p,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const b=this._escHandlers[m];return b.push(f),{dispose:()=>{const w=b.indexOf(f);w!==-1&&b.splice(w,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const m=this._identifier(p);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const b=this._csiHandlers[m];return b.push(f),{dispose:()=>{const w=b.indexOf(f);w!==-1&&b.splice(w,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,f,m,b,w){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=m,this._parseStack.transition=b,this._parseStack.chunkPos=w}parse(p,f,m){let b,w=0,k=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(m===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&j>-1){for(;j>=0&&(b=S[j](this._params),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 4:if(m===!1&&j>-1){for(;j>=0&&(b=S[j](),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 6:if(w=p[this._parseStack.chunkPos],b=this._dcsParser.unhook(w!==24&&w!==26,m),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=p[this._parseStack.chunkPos],b=this._oscParser.end(w!==24&&w!==26,m),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=E;S<f;++S){switch(w=p[S],k=this._transitions.table[this.currentState<<8|(w<160?w:x)],k>>4){case 2:for(let L=S+1;;++L){if(L>=f||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|w];let R=j?j.length-1:-1;for(;R>=0&&(b=j[R](this._params),b!==!0);R--)if(b instanceof Promise)return this._preserveStack(3,j,R,k,S),b;R<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingCodepoint=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++S<f&&(w=p[S])>47&&w<60);S--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const M=this._escHandlers[this._collect<<8|w];let T=M?M.length-1:-1;for(;T>=0&&(b=M[T](),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(4,M,T,k,S),b;T<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let L=S+1;;++L)if(L>=f||(w=p[L])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(p,S,L),S=L-1;break}break;case 14:if(b=this._dcsParser.unhook(w!==24&&w!==26),b)return this._preserveStack(6,[],0,k,S),b;w===27&&(k|=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 L=S+1;;L++)if(L>=f||(w=p[L])<32||w>127&&w<x){this._oscParser.put(p,S,L),S=L-1;break}break;case 6:if(b=this._oscParser.end(w!==24&&w!==26),b)return this._preserveStack(5,[],0,k,S),b;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&k}}}a.EscapeSequenceParser=y},6242:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const u=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(v),{dispose:()=>{const y=x.indexOf(v);y!==-1&&x.splice(y,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,x){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(_,v,x);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,v,x))}start(){this.reset(),this._state=1}put(_,v,x){if(this._state!==3){if(this._state===1)for(;v<x;){const y=_[v++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&x-v>0&&this._put(_,v,x)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,y=this._active.length-1,h=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,x=v,h=this._stack.fallThrough,this._stack.paused=!1),!h&&x===!1){for(;y>=0&&(x=this._active[y].end(_),x!==!0);y--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,x;y--}for(;y>=0;y--)if(x=this._active[y].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,x){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,v,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,v}}},8742:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class u{static fromArray(d){const _=new u;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const x=d[v];if(Array.isArray(x))for(let y=0;y<x.length;++y)_.addSubParam(x[y]);else _.addParam(x)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-v>0&&(d[_]=this._subParams.slice(v,x))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,x=v[_-1];v[_-1]=~x?Math.min(10*x+d,c):d}}a.Params=u},5741:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const g={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(g),u.dispose=()=>this._wrappedAddonDispose(g),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){u=g;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const u=c(3785),g=c(511);a.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new u.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const u=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new u.CellData)}translateToString(g,d,_){return this._line.translateToString(g,d,_)}}},8285:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const u=c(8771),g=c(8460),d=c(844);class _ extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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 new 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)}}a.BufferNamespaceApi=_},7975:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,g=>u(g.toArray()))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,(g,d)=>u(g,d.toArray()))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,m);else for(var E=h.length-1;E>=0;E--)(b=h[E])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},g=this&&this.__param||function(h,p){return function(f,m){p(f,m,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),x=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let y=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(h,this))}resize(h,p){this.cols=h,this.rows=p,this.buffers.resize(h,p),this._onResize.fire({cols:h,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,p=!1){const f=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===h.fg&&m.getBg(0)===h.bg||(m=f.getBlankLine(h,p),this._cachedBlankLine=m),m.isWrapped=p;const b=f.ybase+f.scrollTop,w=f.ybase+f.scrollBottom;if(f.scrollTop===0){const k=f.lines.isFull;w===f.lines.length-1?k?f.lines.recycle().copyFrom(m):f.lines.push(m.clone()):f.lines.splice(w+1,0,m.clone()),k?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const k=w-b+1;f.lines.shiftElements(b+1,k-1,-1),f.lines.set(w,m.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(h,p,f){const m=this.buffer;if(h<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else h+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const b=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+h,m.ybase),0),b!==m.ydisp&&(p||this._onScroll.fire(m.ydisp))}};a.BufferService=y=u([g(0,x.IOptionsService)],y)},7994:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(l,a,c){var u=this&&this.__decorate||function(m,b,w,k){var E,S=arguments.length,j=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(m,b,w,k);else for(var R=m.length-1;R>=0;R--)(E=m[R])&&(j=(S<3?E(j):S>3?E(b,w,j):E(b,w))||j);return S>3&&j&&Object.defineProperty(b,w,j),j},g=this&&this.__param||function(m,b){return function(w,k){b(w,k,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:m=>m.button!==4&&m.action===1&&(m.ctrl=!1,m.alt=!1,m.shift=!1,!0)},VT200:{events:19,restrict:m=>m.action!==32},DRAG:{events:23,restrict:m=>m.action!==32||m.button!==3},ANY:{events:31,restrict:m=>!0}};function y(m,b){let w=(m.ctrl?16:0)|(m.shift?4:0)|(m.alt?8:0);return m.button===4?(w|=64,w|=m.action):(w|=3&m.button,4&m.button&&(w|=64),8&m.button&&(w|=128),m.action===32?w|=32:m.action!==0||b||(w|=3)),w}const h=String.fromCharCode,p={DEFAULT:m=>{const b=[y(m,!1)+32,m.col+32,m.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${h(b[0])}${h(b[1])}${h(b[2])}`},SGR:m=>{const b=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.col};${m.row}${b}`},SGR_PIXELS:m=>{const b=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.x};${m.y}${b}`}};let f=a.CoreMouseService=class extends v.Disposable{constructor(m,b){super(),this._bufferService=m,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(p))this.addEncoding(w,p[w]);this.reset()}addProtocol(m,b){this._protocols[m]=b}addEncoding(m,b){this._encodings[m]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(m){if(!this._protocols[m])throw new Error(`unknown protocol "${m}"`);this._activeProtocol=m,this._onProtocolChange.fire(this._protocols[m].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(m){if(!this._encodings[m])throw new Error(`unknown encoding "${m}"`);this._activeEncoding=m}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(m){if(m.col<0||m.col>=this._bufferService.cols||m.row<0||m.row>=this._bufferService.rows||m.button===4&&m.action===32||m.button===3&&m.action!==32||m.button!==4&&(m.action===2||m.action===3)||(m.col++,m.row++,m.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,m,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(m))return!1;const b=this._encodings[this._activeEncoding](m);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=m,!0}explainEvents(m){return{down:!!(1&m),up:!!(2&m),drag:!!(4&m),move:!!(8&m),wheel:!!(16&m)}}_equalEvents(m,b,w){if(w){if(m.x!==b.x||m.y!==b.y)return!1}else if(m.col!==b.col||m.row!==b.row)return!1;return m.button===b.button&&m.action===b.action&&m.ctrl===b.ctrl&&m.alt===b.alt&&m.shift===b.shift}};a.CoreMouseService=f=u([g(0,d.IBufferService),g(1,d.ICoreService)],f)},6975:function(l,a,c){var u=this&&this.__decorate||function(f,m,b,w){var k,E=arguments.length,S=E<3?m:w===null?w=Object.getOwnPropertyDescriptor(m,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,m,b,w);else for(var j=f.length-1;j>=0;j--)(k=f[j])&&(S=(E<3?k(S):E>3?k(m,b,S):k(m,b))||S);return E>3&&S&&Object.defineProperty(m,b,S),S},g=this&&this.__param||function(f,m){return function(b,w){m(b,w,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),x=c(2585),y=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=a.CoreService=class extends v.Disposable{constructor(f,m,b){super(),this._bufferService=f,this._logService=m,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(h)}reset(){this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(h)}triggerDataEvent(f,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,()=>f.split("").map(w=>w.charCodeAt(0))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,()=>f.split("").map(m=>m.charCodeAt(0))),this._onBinary.fire(f))}};a.CoreService=p=u([g(0,x.IBufferService),g(1,x.ILogService),g(2,x.IOptionsService)],p)},9074:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const u=c(8055),g=c(8460),d=c(844),_=c(6106);let v=0,x=0;class y extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(f=>f==null?void 0:f.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(f){if(f.marker.isDisposed)return;const m=new h(f);if(m){const b=m.marker.onDispose(()=>m.dispose());m.onDispose(()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),b.dispose())}),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,m,b){var w,k,E;let S=0,j=0;for(const R of this._decorations.getKeyIterator(m))S=(w=R.options.x)!==null&&w!==void 0?w:0,j=S+((k=R.options.width)!==null&&k!==void 0?k:1),f>=S&&f<j&&(!b||((E=R.options.layer)!==null&&E!==void 0?E:"bottom")===b)&&(yield R)}forEachDecorationAtCell(f,m,b,w){this._decorations.forEachByKey(m,k=>{var E,S,j;v=(E=k.options.x)!==null&&E!==void 0?E:0,x=v+((S=k.options.width)!==null&&S!==void 0?S:1),f>=v&&f<x&&(!b||((j=k.options.layer)!==null&&j!==void 0?j:"bottom")===b)&&w(k)})}}a.DecorationService=y;class h extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const u=c(2585),g=c(8343);class d{constructor(...v){this._entries=new Map;for(const[x,y]of v)this.set(x,y)}set(v,x){const y=this._entries.get(v);return this._entries.set(v,x),y}forEach(v){for(const[x,y]of this._entries.entries())v(x,y)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const x=(0,g.getServiceDependencies)(_).sort((p,f)=>p.index-f.index),y=[];for(const p of x){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${p.id}.`);y.push(f)}const h=x.length>0?x[0].index:v.length;if(v.length!==h)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${h+1} conflicts with ${v.length} static arguments`);return new _(...v,...y)}}},7866:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,m);else for(var E=h.length-1;E>=0;E--)(b=h[E])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},g=this&&this.__param||function(h,p){return function(f,m){p(f,m,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let x,y=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let p=0;p<h.length;p++)typeof h[p]=="function"&&(h[p]=h[p]())}_log(h,p,f){this._evalLazyOptionalParams(f),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(h,...p){var f,m;this._logLevel<=_.LogLevelEnum.TRACE&&this._log((m=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.trace.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,h,p)}debug(h,...p){var f,m;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((m=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.debug.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,h,p)}info(h,...p){var f,m;this._logLevel<=_.LogLevelEnum.INFO&&this._log((m=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.info.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.info,h,p)}warn(h,...p){var f,m;this._logLevel<=_.LogLevelEnum.WARN&&this._log((m=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.warn.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.warn,h,p)}error(h,...p){var f,m;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((m=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.error.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.error,h,p)}};a.LogService=y=u([g(0,_.IOptionsService)],y),a.setTraceLogger=function(h){x=h},a.traceCall=function(h,p,f){if(typeof f.value!="function")throw new Error("not supported");const m=f.value;f.value=function(...b){if(x.logLevel!==_.LogLevelEnum.TRACE)return m.apply(this,b);x.trace(`GlyphRenderer#${m.name}(${b.map(k=>JSON.stringify(k)).join(", ")})`);const w=m.apply(this,b);return x.trace(`GlyphRenderer#${m.name} return`,w),w}}},7302:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const u=c(8460),g=c(844),d=c(6114);a.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends g.Disposable{constructor(y){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h=Object.assign({},a.DEFAULT_OPTIONS);for(const p in y)if(p in h)try{const f=y[p];h[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=h,this.options=Object.assign({},h),this._setupOptions()}onSpecificOptionChange(y,h){return this.onOptionChange(p=>{p===y&&h(this.rawOptions[y])})}onMultipleOptionChange(y,h){return this.onOptionChange(p=>{y.indexOf(p)!==-1&&h()})}_setupOptions(){const y=p=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},h=(p,f)=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:y.bind(this,p),set:h.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(y,h){switch(y){case"cursorStyle":if(h||(h=a.DEFAULT_OPTIONS[y]),!function(p){return p==="block"||p==="underline"||p==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${y}`);break;case"wordSeparator":h||(h=a.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=_.includes(h)?h:a.DEFAULT_OPTIONS[y];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${y} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${y} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}a.OptionsService=v},2660:function(l,a,c){var u=this&&this.__decorate||function(v,x,y,h){var p,f=arguments.length,m=f<3?x:h===null?h=Object.getOwnPropertyDescriptor(x,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(v,x,y,h);else for(var b=v.length-1;b>=0;b--)(p=v[b])&&(m=(f<3?p(m):f>3?p(x,y,m):p(x,y))||m);return f>3&&m&&Object.defineProperty(x,y,m),m},g=this&&this.__param||function(v,x){return function(y,h){x(y,h,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let _=a.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const x=this._bufferService.buffer;if(v.id===void 0){const b=x.addMarker(x.ybase+x.y),w={data:v,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(w,b)),this._dataByLinkId.set(w.id,w),w.id}const y=v,h=this._getEntryIdKey(y),p=this._entriesWithId.get(h);if(p)return this.addLineToLink(p.id,x.ybase+x.y),p.id;const f=x.addMarker(x.ybase+x.y),m={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(m,f)),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(v,x){const y=this._dataByLinkId.get(v);if(y&&y.lines.every(h=>h.line!==x)){const h=this._bufferService.buffer.addMarker(x);y.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(y,h))}}getLinkData(v){var x;return(x=this._dataByLinkId.get(v))===null||x===void 0?void 0:x.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,x){const y=v.lines.indexOf(x);y!==-1&&(v.lines.splice(y,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};a.OscLinkService=_=u([g(0,d.IBufferService)],_)},8343:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",u="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[u]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(_,v,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,h,p){h[c]===h?h[u].push({id:y,index:p}):(h[u]=[{id:y,index:p}],h[c]=h)})(d,_,x)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const u=c(8343);var g;a.IBufferService=(0,u.createDecorator)("BufferService"),a.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),a.ICoreService=(0,u.createDecorator)("CoreService"),a.ICharsetService=(0,u.createDecorator)("CharsetService"),a.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,u.createDecorator)("LogService"),a.IOptionsService=(0,u.createDecorator)("OptionsService"),a.IOscLinkService=(0,u.createDecorator)("OscLinkService"),a.IUnicodeService=(0,u.createDecorator)("UnicodeService"),a.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const u=c(8460),g=c(225);a.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const d=new g.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const v=d.length;for(let x=0;x<v;++x){let y=d.charCodeAt(x);if(55296<=y&&y<=56319){if(++x>=v)return _+this.wcwidth(y);const h=d.charCodeAt(x);56320<=h&&h<=57343?y=1024*(y-55296)+h-56320+65536:_+=this.wcwidth(h)}_+=this.wcwidth(y)}return _}}}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const a=s(9042),c=s(3236),u=s(844),g=s(5741),d=s(8285),_=s(7975),v=s(7090),x=["cols","rows"];class y extends u.Disposable{constructor(p){super(),this._core=this.register(new c.Terminal(p)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const f=b=>this._core.options[b],m=(b,w)=>{this._checkReadonlyOptions(b),this._core.options[b]=w};for(const b in this._core.options){const w={get:f.bind(this,b),set:m.bind(this,b)};Object.defineProperty(this._publicOptions,b,w)}}_checkReadonlyOptions(p){if(x.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new 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||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.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._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){var f,m,b;return this._checkProposedApi(),this._verifyPositiveIntegers((f=p.x)!==null&&f!==void 0?f:0,(m=p.width)!==null&&m!==void 0?m:0,(b=p.height)!==null&&b!==void 0?b:0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,m){this._verifyIntegers(p,f,m),this._core.select(p,f,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
196
+ `,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return a}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),i})())})(Zw);var yP=Zw.exports,Jw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),u=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=u-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(_/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),r})())})(Jw);var bP=Jw.exports,eS={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(u,g,d,_={}){this._terminal=u,this._regex=g,this._handler=d,this._options=_}provideLinks(u,g){const d=c.computeLink(u,this._regex,this._terminal,this._handler);g(this._addCallbacks(d))}_addCallbacks(u){return u.map(g=>(g.leave=this._options.leave,g.hover=(d,_)=>{if(this._options.hover){const{range:v}=g;this._options.hover(d,_,v)}},g))}};class c{static computeLink(g,d,_,v){const x=new RegExp(d.source,(d.flags||"")+"g"),[y,h]=c._getWindowedLineStrings(g-1,_),p=y.join("");let f;const m=[];for(;f=x.exec(p);){const b=f[0];try{const R=new URL(b),M=decodeURI(R.toString());if(b!==M&&b+"/"!==M)continue}catch{continue}const[w,k]=c._mapStrIdx(_,h,0,f.index),[E,S]=c._mapStrIdx(_,w,k,b.length);if(w===-1||k===-1||E===-1||S===-1)continue;const j={start:{x:k+1,y:w+1},end:{x:S,y:E+1}};m.push({range:j,text:b,activate:v})}return m}static _getWindowedLineStrings(g,d){let _,v=g,x=g,y=0,h="";const p=[];if(_=d.buffer.active.getLine(g)){const f=_.translateToString(!0);if(_.isWrapped&&f[0]!==" "){for(y=0;(_=d.buffer.active.getLine(--v))&&y<2048&&(h=_.translateToString(!0),y+=h.length,p.push(h),_.isWrapped&&h.indexOf(" ")===-1););p.reverse()}for(p.push(f),y=0;(_=d.buffer.active.getLine(++x))&&_.isWrapped&&y<2048&&(h=_.translateToString(!0),y+=h.length,p.push(h),h.indexOf(" ")===-1););}return[p,v]}static _mapStrIdx(g,d,_,v){const x=g.buffer.active,y=x.getNullCell();let h=_;for(;v;){const p=x.getLine(d);if(!p)return[-1,-1];for(let f=h;f<p.length;++f){p.getCell(f,y);const m=y.getChars();if(y.getWidth()&&(v-=m.length||1,f===p.length-1&&m==="")){const b=x.getLine(d+1);b&&b.isWrapped&&(b.getCell(0,y),y.getWidth()===2&&(v+=1))}if(v<0)return[d,f]}d++,h=0}return[d,h]}}a.LinkComputer=c}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l](c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const a=s(6),c=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(g,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(g=u,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),i})())})(eS);var wP=eS.exports;const SP=dd("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 Ce({className:e,variant:t,...r}){return o.jsx("span",{className:J(SP({variant:t}),e),...r})}function tS({agentGated:e=!1}={}){const t=C.useRef(null),[r,n]=C.useState(null),[s,i]=C.useState(!1),[l,a]=C.useState(!1),[c,u]=C.useState(null);C.useEffect(()=>{if(!t.current)return;let d=!1,_=null,v=null,x=null;const y=window.location.protocol==="https:"?"wss":"ws",h=new WebSocket(`${y}://${window.location.host}/api/agent/ws`),p=()=>{if(v||!t.current)return v;const f=new yP.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}),m=new bP.FitAddon;f.loadAddon(m),f.loadAddon(new wP.WebLinksAddon),f.open(t.current);const b=()=>{if(!(d||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{m.fit()}catch{}};return _=window.requestAnimationFrame(b),x=new ResizeObserver(()=>{b()}),x.observe(t.current),f.onData(w=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"input",data:w}))}),f.onResize(({cols:w,rows:k})=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"resize",cols:w,rows:k}))}),v=f,f};return h.onopen=()=>{i(!0),p()},h.onclose=()=>i(!1),h.onerror=()=>i(!1),h.onmessage=f=>{try{const m=JSON.parse(f.data);m.kind==="data"&&typeof m.data=="string"?v==null||v.write(m.data):m.kind==="meta"?(n({active:!!m.autoMode,reason:m.reason??""}),typeof m.agentReady=="boolean"&&a(m.agentReady)):m.kind==="auth_url"&&typeof m.url=="string"||(m.kind==="error"?m.recoverable&&m.remediation?u({message:m.message??"agent failed to start",remediation:m.remediation}):v==null||v.write(`\r
197
+ \x1B[31m[error] ${m.message??"unknown error"}\x1B[0m\r
198
+ `):m.kind==="exit"&&(v==null||v.write(`\r
199
+ \x1B[33m[claude session exited]\x1B[0m\r
200
+ `)))}catch{}},()=>{d=!0,_!==null&&window.cancelAnimationFrame(_),h.close(),x==null||x.disconnect(),v==null||v.dispose()}},[]);const g=e&&!l;return o.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--bg-sunken)]",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2",children:[o.jsx("span",{className:J("font-mono text-[11px] tracking-[0.05em]",s?"text-[var(--vow-green)]":"text-[var(--fg-dim)]"),children:s?"● connected":"○ disconnected"}),r&&o.jsx(Ce,{variant:r.active?"warning":"secondary",title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),c&&o.jsxs(Ze,{variant:"blocking",className:"m-3 flex flex-col gap-2",children:[o.jsx(Rt,{className:"text-[var(--break-red)]",children:"Agent panel unavailable"}),o.jsx(Je,{className:"font-mono text-xs text-[var(--fg-muted)]",children:c.message}),c.remediation&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:[o.jsx("span",{className:"text-[var(--fg-muted)]",children:"Fix · "}),c.remediation]})]}),o.jsx("div",{ref:t,className:J("w-full flex-1 bg-[var(--bg-sunken)] p-3","min-h-[400px]",g&&"invisible hidden")}),g&&!c&&o.jsx(CP,{})]})}function CP(){return o.jsx("div",{className:"flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6",children:o.jsxs("div",{className:"flex max-w-[34ch] flex-col items-center gap-4 text-center",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:"The agent will come online once harness setup is complete."})]})})}const kP={pluginBuilderUi:!1,embeddedAgent:!1};function qm(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?kP:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function EP({envelope:e,chainExplorerBase:t}){const r=jP(e),n=NP(e.generatedAt),[s,i]=C.useState("idle"),[l,a]=C.useState(null),c=e.details,g=(typeof(c==null?void 0:c.category)=="string"?c.category:void 0)==="insufficient_funds",d=typeof(c==null?void 0:c.address)=="string"?c.address:null,_=typeof(c==null?void 0:c.requiredWei)=="string"?c.requiredWei:typeof(c==null?void 0:c.needWei)=="string"?c.needWei:null,v=typeof(c==null?void 0:c.haveWei)=="string"?c.haveWei:null,y=(typeof(c==null?void 0:c.txHash)=="string"?c.txHash:null)??r,h=C.useCallback(async()=>{i("retrying"),a(null);try{await me.retryBootstrap(),i("success")}catch(p){i("error"),a(p instanceof Error?p.message:String(p))}},[]);return o.jsxs(Ze,{variant:"blocking",className:"flex flex-col gap-3 px-5 py-4",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs(Rt,{className:"text-[var(--break-red)]",children:["Bootstrap halted · ",e.code]}),n&&o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:n})]}),o.jsx(Je,{className:"break-words font-mono text-xs text-foreground",children:e.message}),g&&d&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Sc,{label:"Send ETH to",children:d}),_&&o.jsx(Sc,{label:"Required",children:uh(_)}),v&&o.jsx(Sc,{label:"Currently have",children:uh(v)}),_&&v&&o.jsx(Sc,{label:"Shortfall",children:uh((BigInt(_)-BigInt(v)).toString())})]}),!g&&e.hint&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Fix · "}),e.hint]}),y&&o.jsx(oe,{asChild:!0,variant:"link",size:"sm",className:"self-start px-0",children:o.jsxs("a",{href:`${t}/tx/${y}`,target:"_blank",rel:"noopener noreferrer",children:["view failed tx",o.jsx(No,{})]})}),o.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[o.jsx(oe,{variant:"destructive",size:"sm",type:"button",onClick:()=>{h()},disabled:s==="retrying",children:s==="retrying"?"Retrying…":s==="success"?"Resuming…":"Retry"}),s==="success"&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:"Daemon resumed — waiting for bootstrap to complete"}),s==="error"&&l&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:l})]}),s==="idle"&&o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Once you've addressed the cause above, click Retry or"," ",o.jsx("code",{className:"text-[var(--fg-muted)]",children:"jinn run"})," to resume from the persisted state."]})]})}function Sc({label:e,children:t}){return o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]",children:e}),o.jsx("span",{className:"break-all font-mono text-[11px] text-foreground",children:t})]})}function uh(e){try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-6?`${t} wei`:`${r.toFixed(6).replace(/\.?0+$/,"")} ETH`}catch{return e}}function jP(e){var r,n;const t=[(r=e.details)==null?void 0:r.txHash,(n=e.details)==null?void 0:n.cause,e.message];for(const s of t){if(typeof s!="string")continue;const i=/(0x[a-fA-F0-9]{64})/.exec(s);if(i)return i[1]}return null}function NP(e){try{const t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;const r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const n=Math.round(r/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}catch{return null}}function RP(e,t=globalThis==null?void 0:globalThis.document){const r=zt(e);C.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var PP="DismissableLayer",qf="dismissableLayer.update",TP="dismissableLayer.pointerDownOutside",AP="dismissableLayer.focusOutside",C_,rS=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vl=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:a,...c}=e,u=C.useContext(rS),[g,d]=C.useState(null),_=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=C.useState({}),x=He(t,E=>d(E)),y=Array.from(u.layers),[h]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(h),f=g?y.indexOf(g):-1,m=u.layersWithOutsidePointerEventsDisabled.size>0,b=f>=p,w=MP(E=>{const S=E.target,j=[...u.branches].some(R=>R.contains(S));!b||j||(s==null||s(E),l==null||l(E),E.defaultPrevented||a==null||a())},_),k=OP(E=>{const S=E.target;[...u.branches].some(R=>R.contains(S))||(i==null||i(E),l==null||l(E),E.defaultPrevented||a==null||a())},_);return RP(E=>{f===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},_),C.useEffect(()=>{if(g)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(C_=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(g)),u.layers.add(g),k_(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=C_)}},[g,_,r,u]),C.useEffect(()=>()=>{g&&(u.layers.delete(g),u.layersWithOutsidePointerEventsDisabled.delete(g),k_())},[g,u]),C.useEffect(()=>{const E=()=>v({});return document.addEventListener(qf,E),()=>document.removeEventListener(qf,E)},[]),o.jsx(ze.div,{...c,ref:x,style:{pointerEvents:m?b?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,k.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,w.onPointerDownCapture)})});Vl.displayName=PP;var DP="DismissableLayerBranch",LP=C.forwardRef((e,t)=>{const r=C.useContext(rS),n=C.useRef(null),s=He(t,n);return C.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),o.jsx(ze.div,{...e,ref:s})});LP.displayName=DP;function MP(e,t=globalThis==null?void 0:globalThis.document){const r=zt(e),n=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let c=function(){nS(TP,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function OP(e,t=globalThis==null?void 0:globalThis.document){const r=zt(e),n=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!n.current&&nS(AP,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function k_(){const e=new CustomEvent(qf);document.dispatchEvent(e)}function nS(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Pw(s,i):s.dispatchEvent(i)}var IP=qu[" useId ".trim().toString()]||(()=>{}),FP=0;function Ws(e){const[t,r]=C.useState(IP());return es(()=>{r(n=>n??String(FP++))},[e]),t?`radix-${t}`:""}const BP=["top","right","bottom","left"],Ys=Math.min,vr=Math.max,Nu=Math.round,Cc=Math.floor,Nn=e=>({x:e,y:e}),$P={left:"right",right:"left",bottom:"top",top:"bottom"};function Kf(e,t,r){return vr(e,Ys(t,r))}function ts(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function ma(e){return e.split("-")[1]}function Km(e){return e==="x"?"y":"x"}function Gm(e){return e==="y"?"height":"width"}function kn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Qm(e){return Km(kn(e))}function HP(e,t,r){r===void 0&&(r=!1);const n=ma(e),s=Qm(e),i=Gm(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ru(l)),[l,Ru(l)]}function zP(e){const t=Ru(e);return[Gf(e),t,Gf(t)]}function Gf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const E_=["left","right"],j_=["right","left"],UP=["top","bottom"],WP=["bottom","top"];function VP(e,t,r){switch(e){case"top":case"bottom":return r?t?j_:E_:t?E_:j_;case"left":case"right":return t?UP:WP;default:return[]}}function qP(e,t,r,n){const s=ma(e);let i=VP(rs(e),r==="start",n);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(Gf)))),i}function Ru(e){const t=rs(e);return $P[t]+e.slice(t.length)}function KP(e){return{top:0,right:0,bottom:0,left:0,...e}}function sS(e){return typeof e!="number"?KP(e):{top:e,right:e,bottom:e,left:e}}function Pu(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function N_(e,t,r){let{reference:n,floating:s}=e;const i=kn(t),l=Qm(t),a=Gm(l),c=rs(t),u=i==="y",g=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,_=n[a]/2-s[a]/2;let v;switch(c){case"top":v={x:g,y:n.y-s.height};break;case"bottom":v={x:g,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(ma(t)){case"start":v[l]-=_*(r&&u?-1:1);break;case"end":v[l]+=_*(r&&u?-1:1);break}return v}async function GP(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:_=!1,padding:v=0}=ts(t,e),x=sS(v),h=a[_?d==="floating"?"reference":"floating":d],p=Pu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:g,strategy:c})),f=d==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Pu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:m,strategy:c}):f);return{top:(p.top-w.top+x.top)/b.y,bottom:(w.bottom-p.bottom+x.bottom)/b.y,left:(p.left-w.left+x.left)/b.x,right:(w.right-p.right+x.right)/b.x}}const QP=50,YP=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:l}=r,a=l.detectOverflow?l:{...l,detectOverflow:GP},c=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:d}=N_(u,n,c),_=n,v=0;const x={};for(let y=0;y<i.length;y++){const h=i[y];if(!h)continue;const{name:p,fn:f}=h,{x:m,y:b,data:w,reset:k}=await f({x:g,y:d,initialPlacement:n,placement:_,strategy:s,middlewareData:x,rects:u,platform:a,elements:{reference:e,floating:t}});g=m??g,d=b??d,x[p]={...x[p],...w},k&&v<QP&&(v++,typeof k=="object"&&(k.placement&&(_=k.placement),k.rects&&(u=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:g,y:d}=N_(u,_,c)),y=-1)}return{x:g,y:d,placement:_,strategy:s,middlewareData:x}},ZP=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:l,elements:a,middlewareData:c}=t,{element:u,padding:g=0}=ts(e,t)||{};if(u==null)return{};const d=sS(g),_={x:r,y:n},v=Qm(s),x=Gm(v),y=await l.getDimensions(u),h=v==="y",p=h?"top":"left",f=h?"bottom":"right",m=h?"clientHeight":"clientWidth",b=i.reference[x]+i.reference[v]-_[v]-i.floating[x],w=_[v]-i.reference[v],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let E=k?k[m]:0;(!E||!await(l.isElement==null?void 0:l.isElement(k)))&&(E=a.floating[m]||i.floating[x]);const S=b/2-w/2,j=E/2-y[x]/2-1,R=Ys(d[p],j),M=Ys(d[f],j),T=R,L=E-y[x]-M,$=E/2-y[x]/2+S,z=Kf(T,$,L),W=!c.arrow&&ma(s)!=null&&$!==z&&i.reference[x]/2-($<T?R:M)-y[x]/2<0,q=W?$<T?$-T:$-L:0;return{[v]:_[v]+q,data:{[v]:z,centerOffset:$-z-q,...W&&{alignmentOffset:q}},reset:W}}}),XP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:_,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...h}=ts(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const p=rs(s),f=kn(a),m=rs(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=_||(m||!y?[Ru(a)]:zP(a)),k=x!=="none";!_&&k&&w.push(...qP(a,y,x,b));const E=[a,...w],S=await c.detectOverflow(t,h),j=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(g&&j.push(S[p]),d){const $=HP(s,l,b);j.push(S[$[0]],S[$[1]])}if(R=[...R,{placement:s,overflows:j}],!j.every($=>$<=0)){var M,T;const $=(((M=i.flip)==null?void 0:M.index)||0)+1,z=E[$];if(z&&(!(d==="alignment"?f!==kn(z):!1)||R.every(N=>kn(N.placement)===f?N.overflows[0]>0:!0)))return{data:{index:$,overflows:R},reset:{placement:z}};let W=(T=R.filter(q=>q.overflows[0]<=0).sort((q,N)=>q.overflows[1]-N.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(v){case"bestFit":{var L;const q=(L=R.filter(N=>{if(k){const P=kn(N.placement);return P===f||P==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(P=>P>0).reduce((P,D)=>P+D,0)]).sort((N,P)=>N[1]-P[1])[0])==null?void 0:L[0];q&&(W=q);break}case"initialPlacement":W=a;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function R_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P_(e){return BP.some(t=>e[t]>=0)}const JP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...i}=ts(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=R_(l,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:P_(a)}}}case"escaped":{const l=await n.detectOverflow(t,{...i,altBoundary:!0}),a=R_(l,r.floating);return{data:{escapedOffsets:a,escaped:P_(a)}}}default:return{}}}}},iS=new Set(["left","top"]);async function eT(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=rs(r),a=ma(r),c=kn(r)==="y",u=iS.has(l)?-1:1,g=i&&c?-1:1,d=ts(t,e);let{mainAxis:_,crossAxis:v,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(v=a==="end"?x*-1:x),c?{x:v*g,y:_*u}:{x:_*u,y:v*g}}const tT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:l,middlewareData:a}=t,c=await eT(t,e);return l===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:l}}}}},rT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:c={fn:p=>{let{x:f,y:m}=p;return{x:f,y:m}}},...u}=ts(e,t),g={x:r,y:n},d=await i.detectOverflow(t,u),_=kn(rs(s)),v=Km(_);let x=g[v],y=g[_];if(l){const p=v==="y"?"top":"left",f=v==="y"?"bottom":"right",m=x+d[p],b=x-d[f];x=Kf(m,x,b)}if(a){const p=_==="y"?"top":"left",f=_==="y"?"bottom":"right",m=y+d[p],b=y-d[f];y=Kf(m,y,b)}const h=c.fn({...t,[v]:x,[_]:y});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[v]:l,[_]:a}}}}}},nT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=ts(e,t),g={x:r,y:n},d=kn(s),_=Km(d);let v=g[_],x=g[d];const y=ts(a,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const m=_==="y"?"height":"width",b=i.reference[_]-i.floating[m]+h.mainAxis,w=i.reference[_]+i.reference[m]-h.mainAxis;v<b?v=b:v>w&&(v=w)}if(u){var p,f;const m=_==="y"?"width":"height",b=iS.has(rs(s)),w=i.reference[d]-i.floating[m]+(b&&((p=l.offset)==null?void 0:p[d])||0)+(b?0:h.crossAxis),k=i.reference[d]+i.reference[m]+(b?0:((f=l.offset)==null?void 0:f[d])||0)-(b?h.crossAxis:0);x<w?x=w:x>k&&(x=k)}return{[_]:v,[d]:x}}}},sT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:l,elements:a}=t,{apply:c=()=>{},...u}=ts(e,t),g=await l.detectOverflow(t,u),d=rs(s),_=ma(s),v=kn(s)==="y",{width:x,height:y}=i.floating;let h,p;d==="top"||d==="bottom"?(h=d,p=_===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,h=_==="end"?"top":"bottom");const f=y-g.top-g.bottom,m=x-g.left-g.right,b=Ys(y-g[h],f),w=Ys(x-g[p],m),k=!t.middlewareData.shift;let E=b,S=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=m),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=f),k&&!_){const R=vr(g.left,0),M=vr(g.right,0),T=vr(g.top,0),L=vr(g.bottom,0);v?S=x-2*(R!==0||M!==0?R+M:vr(g.left,g.right)):E=y-2*(T!==0||L!==0?T+L:vr(g.top,g.bottom))}await c({...t,availableWidth:S,availableHeight:E});const j=await l.getDimensions(a.floating);return x!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function pd(){return typeof window<"u"}function ga(e){return oS(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function An(e){var t;return(t=(oS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oS(e){return pd()?e instanceof Node||e instanceof yr(e).Node:!1}function fn(e){return pd()?e instanceof Element||e instanceof yr(e).Element:!1}function as(e){return pd()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function T_(e){return!pd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function ql(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=pn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function iT(e){return/^(table|td|th)$/.test(ga(e))}function md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oT=/transform|translate|scale|rotate|perspective|filter/,aT=/paint|layout|strict|content/,ii=e=>!!e&&e!=="none";let dh;function Ym(e){const t=fn(e)?pn(e):e;return ii(t.transform)||ii(t.translate)||ii(t.scale)||ii(t.rotate)||ii(t.perspective)||!Zm()&&(ii(t.backdropFilter)||ii(t.filter))||oT.test(t.willChange||"")||aT.test(t.contain||"")}function lT(e){let t=Zs(e);for(;as(t)&&!ra(t);){if(Ym(t))return t;if(md(t))return null;t=Zs(t)}return null}function Zm(){return dh==null&&(dh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dh}function ra(e){return/^(html|body|#document)$/.test(ga(e))}function pn(e){return yr(e).getComputedStyle(e)}function gd(e){return fn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zs(e){if(ga(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T_(e)&&e.host||An(e);return T_(t)?t.host:t}function aS(e){const t=Zs(e);return ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:as(t)&&ql(t)?t:aS(t)}function El(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=aS(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),l=yr(s);if(i){const a=Qf(l);return t.concat(l,l.visualViewport||[],ql(s)?s:[],a&&r?El(a):[])}else return t.concat(s,El(s,[],r))}function Qf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lS(e){const t=pn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=as(e),i=s?e.offsetWidth:r,l=s?e.offsetHeight:n,a=Nu(r)!==i||Nu(n)!==l;return a&&(r=i,n=l),{width:r,height:n,$:a}}function Xm(e){return fn(e)?e:e.contextElement}function Po(e){const t=Xm(e);if(!as(t))return Nn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=lS(t);let l=(i?Nu(r.width):r.width)/n,a=(i?Nu(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const cT=Nn(0);function cS(e){const t=yr(e);return!Zm()||!t.visualViewport?cT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uT(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==yr(e)?!1:t}function Oi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=Xm(e);let l=Nn(1);t&&(n?fn(n)&&(l=Po(n)):l=Po(e));const a=uT(i,r,n)?cS(i):Nn(0);let c=(s.left+a.x)/l.x,u=(s.top+a.y)/l.y,g=s.width/l.x,d=s.height/l.y;if(i){const _=yr(i),v=n&&fn(n)?yr(n):n;let x=_,y=Qf(x);for(;y&&n&&v!==x;){const h=Po(y),p=y.getBoundingClientRect(),f=pn(y),m=p.left+(y.clientLeft+parseFloat(f.paddingLeft))*h.x,b=p.top+(y.clientTop+parseFloat(f.paddingTop))*h.y;c*=h.x,u*=h.y,g*=h.x,d*=h.y,c+=m,u+=b,x=yr(y),y=Qf(x)}}return Pu({width:g,height:d,x:c,y:u})}function vd(e,t){const r=gd(e).scrollLeft;return t?t.left+r:Oi(An(e)).left+r}function uS(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-vd(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function dT(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",l=An(n),a=t?md(t.floating):!1;if(n===l||a&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Nn(1);const g=Nn(0),d=as(n);if((d||!d&&!i)&&((ga(n)!=="body"||ql(l))&&(c=gd(n)),d)){const v=Oi(n);u=Po(n),g.x=v.x+n.clientLeft,g.y=v.y+n.clientTop}const _=l&&!d&&!i?uS(l,c):Nn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+g.x+_.x,y:r.y*u.y-c.scrollTop*u.y+g.y+_.y}}function hT(e){return Array.from(e.getClientRects())}function fT(e){const t=An(e),r=gd(e),n=e.ownerDocument.body,s=vr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=vr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+vd(e);const a=-r.scrollTop;return pn(n).direction==="rtl"&&(l+=vr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:l,y:a}}const A_=25;function pT(e,t){const r=yr(e),n=An(e),s=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;const g=Zm();(!g||g&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const u=vd(n);if(u<=0){const g=n.ownerDocument,d=g.body,_=getComputedStyle(d),v=g.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,x=Math.abs(n.clientWidth-d.clientWidth-v);x<=A_&&(i-=x)}else u<=A_&&(i+=u);return{width:i,height:l,x:a,y:c}}function mT(e,t){const r=Oi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=as(e)?Po(e):Nn(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,u=n*i.y;return{width:l,height:a,x:c,y:u}}function D_(e,t,r){let n;if(t==="viewport")n=pT(e,r);else if(t==="document")n=fT(An(e));else if(fn(t))n=mT(t,r);else{const s=cS(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Pu(n)}function dS(e,t){const r=Zs(e);return r===t||!fn(r)||ra(r)?!1:pn(r).position==="fixed"||dS(r,t)}function gT(e,t){const r=t.get(e);if(r)return r;let n=El(e,[],!1).filter(a=>fn(a)&&ga(a)!=="body"),s=null;const i=pn(e).position==="fixed";let l=i?Zs(e):e;for(;fn(l)&&!ra(l);){const a=pn(l),c=Ym(l);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ql(l)&&!c&&dS(e,l))?n=n.filter(g=>g!==l):s=a,l=Zs(l)}return t.set(e,n),n}function vT(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?md(t)?[]:gT(t,this._c):[].concat(r),n],a=D_(t,l[0],s);let c=a.top,u=a.right,g=a.bottom,d=a.left;for(let _=1;_<l.length;_++){const v=D_(t,l[_],s);c=vr(v.top,c),u=Ys(v.right,u),g=Ys(v.bottom,g),d=vr(v.left,d)}return{width:u-d,height:g-c,x:d,y:c}}function _T(e){const{width:t,height:r}=lS(e);return{width:t,height:r}}function xT(e,t,r){const n=as(t),s=An(t),i=r==="fixed",l=Oi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Nn(0);function u(){c.x=vd(s)}if(n||!n&&!i)if((ga(t)!=="body"||ql(s))&&(a=gd(t)),n){const v=Oi(t,!0,i,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else s&&u();i&&!n&&s&&u();const g=s&&!n&&!i?uS(s,a):Nn(0),d=l.left+a.scrollLeft-c.x-g.x,_=l.top+a.scrollTop-c.y-g.y;return{x:d,y:_,width:l.width,height:l.height}}function hh(e){return pn(e).position==="static"}function L_(e,t){if(!as(e)||pn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return An(e)===r&&(r=r.ownerDocument.body),r}function hS(e,t){const r=yr(e);if(md(e))return r;if(!as(e)){let s=Zs(e);for(;s&&!ra(s);){if(fn(s)&&!hh(s))return s;s=Zs(s)}return r}let n=L_(e,t);for(;n&&iT(n)&&hh(n);)n=L_(n,t);return n&&ra(n)&&hh(n)&&!Ym(n)?r:n||lT(e)||r}const yT=async function(e){const t=this.getOffsetParent||hS,r=this.getDimensions,n=await r(e.floating);return{reference:xT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bT(e){return pn(e).direction==="rtl"}const wT={convertOffsetParentRelativeRectToViewportRelativeRect:dT,getDocumentElement:An,getClippingRect:vT,getOffsetParent:hS,getElementRects:yT,getClientRects:hT,getDimensions:_T,getScale:Po,isElement:fn,isRTL:bT};function fS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ST(e,t){let r=null,n;const s=An(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:g,top:d,width:_,height:v}=u;if(a||t(),!_||!v)return;const x=Cc(d),y=Cc(s.clientWidth-(g+_)),h=Cc(s.clientHeight-(d+v)),p=Cc(g),m={rootMargin:-x+"px "+-y+"px "+-h+"px "+-p+"px",threshold:vr(0,Ys(1,c))||1};let b=!0;function w(k){const E=k[0].intersectionRatio;if(E!==c){if(!b)return l();E?l(!1,E):n=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!fS(u,e.getBoundingClientRect())&&l(),b=!1}try{r=new IntersectionObserver(w,{...m,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,m)}r.observe(e)}return l(!0),i}function CT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Xm(e),g=s||i?[...u?El(u):[],...t?El(t):[]]:[];g.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),i&&p.addEventListener("resize",r)});const d=u&&a?ST(u,r):null;let _=-1,v=null;l&&(v=new ResizeObserver(p=>{let[f]=p;f&&f.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var m;(m=v)==null||m.observe(t)})),r()}),u&&!c&&v.observe(u),t&&v.observe(t));let x,y=c?Oi(e):null;c&&h();function h(){const p=Oi(e);y&&!fS(y,p)&&r(),y=p,x=requestAnimationFrame(h)}return r(),()=>{var p;g.forEach(f=>{s&&f.removeEventListener("scroll",r),i&&f.removeEventListener("resize",r)}),d==null||d(),(p=v)==null||p.disconnect(),v=null,c&&cancelAnimationFrame(x)}}const kT=tT,ET=rT,jT=XP,NT=sT,RT=JP,M_=ZP,PT=nT,TT=(e,t,r)=>{const n=new Map,s={platform:wT,...r},i={...s.platform,_c:n};return YP(e,t,{...s,platform:i})};var AT=typeof document<"u",DT=function(){},Gc=AT?C.useLayoutEffect:DT;function Tu(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 r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Tu(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!Tu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function pS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O_(e,t){const r=pS(e);return Math.round(t*r)/r}function fh(e){const t=C.useRef(e);return Gc(()=>{t.current=e}),t}function LT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[g,d]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[_,v]=C.useState(n);Tu(_,n)||v(n);const[x,y]=C.useState(null),[h,p]=C.useState(null),f=C.useCallback(N=>{N!==k.current&&(k.current=N,y(N))},[]),m=C.useCallback(N=>{N!==E.current&&(E.current=N,p(N))},[]),b=i||x,w=l||h,k=C.useRef(null),E=C.useRef(null),S=C.useRef(g),j=c!=null,R=fh(c),M=fh(s),T=fh(u),L=C.useCallback(()=>{if(!k.current||!E.current)return;const N={placement:t,strategy:r,middleware:_};M.current&&(N.platform=M.current),TT(k.current,E.current,N).then(P=>{const D={...P,isPositioned:T.current!==!1};$.current&&!Tu(S.current,D)&&(S.current=D,ld.flushSync(()=>{d(D)}))})},[_,t,r,M,T]);Gc(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const $=C.useRef(!1);Gc(()=>($.current=!0,()=>{$.current=!1}),[]),Gc(()=>{if(b&&(k.current=b),w&&(E.current=w),b&&w){if(R.current)return R.current(b,w,L);L()}},[b,w,L,R,j]);const z=C.useMemo(()=>({reference:k,floating:E,setReference:f,setFloating:m}),[f,m]),W=C.useMemo(()=>({reference:b,floating:w}),[b,w]),q=C.useMemo(()=>{const N={position:r,left:0,top:0};if(!W.floating)return N;const P=O_(W.floating,g.x),D=O_(W.floating,g.y);return a?{...N,transform:"translate("+P+"px, "+D+"px)",...pS(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:D}},[r,a,W.floating,g.x,g.y]);return C.useMemo(()=>({...g,update:L,refs:z,elements:W,floatingStyles:q}),[g,L,z,W,q])}const MT=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?M_({element:n.current,padding:s}).fn(r):{}:n?M_({element:n,padding:s}).fn(r):{}}}},OT=(e,t)=>{const r=kT(e);return{name:r.name,fn:r.fn,options:[e,t]}},IT=(e,t)=>{const r=ET(e);return{name:r.name,fn:r.fn,options:[e,t]}},FT=(e,t)=>({fn:PT(e).fn,options:[e,t]}),BT=(e,t)=>{const r=jT(e);return{name:r.name,fn:r.fn,options:[e,t]}},$T=(e,t)=>{const r=NT(e);return{name:r.name,fn:r.fn,options:[e,t]}},HT=(e,t)=>{const r=RT(e);return{name:r.name,fn:r.fn,options:[e,t]}},zT=(e,t)=>{const r=MT(e);return{name:r.name,fn:r.fn,options:[e,t]}};var UT="Arrow",mS=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return o.jsx(ze.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});mS.displayName=UT;var WT=mS;function gS(e){const[t,r]=C.useState(void 0);return es(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;l=u.inlineSize,a=u.blockSize}else l=e.offsetWidth,a=e.offsetHeight;r({width:l,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Jm="Popper",[vS,va]=mn(Jm),[VT,_S]=vS(Jm),xS=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return o.jsx(VT,{scope:t,anchor:n,onAnchorChange:s,children:r})};xS.displayName=Jm;var yS="PopperAnchor",bS=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=_S(yS,r),l=C.useRef(null),a=He(t,l),c=C.useRef(null);return C.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||l.current,u!==c.current&&i.onAnchorChange(c.current)}),n?null:o.jsx(ze.div,{...s,ref:a})});bS.displayName=yS;var eg="PopperContent",[qT,KT]=vS(eg),wS=C.forwardRef((e,t)=>{var A,U,G,K,Z,X;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:g=0,sticky:d="partial",hideWhenDetached:_=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,h=_S(eg,r),[p,f]=C.useState(null),m=He(t,ae=>f(ae)),[b,w]=C.useState(null),k=gS(b),E=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,j=n+(i!=="center"?"-"+i:""),R=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},M=Array.isArray(u)?u:[u],T=M.length>0,L={padding:R,boundary:M.filter(QT),altBoundary:T},{refs:$,floatingStyles:z,placement:W,isPositioned:q,middlewareData:N}=LT({strategy:"fixed",placement:j,whileElementsMounted:(...ae)=>CT(...ae,{animationFrame:v==="always"}),elements:{reference:h.anchor},middleware:[OT({mainAxis:s+S,alignmentAxis:l}),c&&IT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?FT():void 0,...L}),c&&BT({...L}),$T({...L,apply:({elements:ae,rects:je,availableWidth:Oe,availableHeight:Be})=>{const{width:Se,height:Mt}=je.reference,dr=ae.floating.style;dr.setProperty("--radix-popper-available-width",`${Oe}px`),dr.setProperty("--radix-popper-available-height",`${Be}px`),dr.setProperty("--radix-popper-anchor-width",`${Se}px`),dr.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),b&&zT({element:b,padding:a}),YT({arrowWidth:E,arrowHeight:S}),_&&HT({strategy:"referenceHidden",...L})]}),[P,D]=kS(W),O=zt(x);es(()=>{q&&(O==null||O())},[q,O]);const B=(A=N.arrow)==null?void 0:A.x,Q=(U=N.arrow)==null?void 0:U.y,ee=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[re,ye]=C.useState();return es(()=>{p&&ye(window.getComputedStyle(p).zIndex)},[p]),o.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:q?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(K=N.transformOrigin)==null?void 0:K.x,(Z=N.transformOrigin)==null?void 0:Z.y].join(" "),...((X=N.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(qT,{scope:r,placedSide:P,onArrowChange:w,arrowX:B,arrowY:Q,shouldHideArrow:ee,children:o.jsx(ze.div,{"data-side":P,"data-align":D,...y,ref:m,style:{...y.style,animation:q?void 0:"none"}})})})});wS.displayName=eg;var SS="PopperArrow",GT={top:"bottom",right:"left",bottom:"top",left:"right"},CS=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=KT(SS,n),l=GT[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]: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:o.jsx(WT,{...s,ref:r,style:{...s.style,display:"block"}})})});CS.displayName=SS;function QT(e){return e!==null}var YT=e=>({name:"transformOrigin",options:e,fn(t){var h,p,f;const{placement:r,rects:n,middlewareData:s}=t,l=((h=s.arrow)==null?void 0:h.centerOffset)!==0,a=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[u,g]=kS(r),d={start:"0%",center:"50%",end:"100%"}[g],_=(((p=s.arrow)==null?void 0:p.x)??0)+a/2,v=(((f=s.arrow)==null?void 0:f.y)??0)+c/2;let x="",y="";return u==="bottom"?(x=l?d:`${_}px`,y=`${-c}px`):u==="top"?(x=l?d:`${_}px`,y=`${n.floating.height+c}px`):u==="right"?(x=`${-c}px`,y=l?d:`${v}px`):u==="left"&&(x=`${n.floating.width+c}px`,y=l?d:`${v}px`),{data:{x,y}}}});function kS(e){const[t,r="center"]=e.split("-");return[t,r]}var tg=xS,_d=bS,rg=wS,ng=CS,ZT="Portal",Kl=C.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=C.useState(!1);es(()=>i(!0),[]);const l=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?Wb.createPortal(o.jsx(ze.div,{...n,ref:t}),l):null});Kl.displayName=ZT;var XT=Symbol("radix.slottable");function JT(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=XT,t}var eA=qu[" useInsertionEffect ".trim().toString()]||es;function _a({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,l]=tA({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:s;{const g=C.useRef(e!==void 0);C.useEffect(()=>{const d=g.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"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.`),g.current=a},[a,n])}const u=C.useCallback(g=>{var d;if(a){const _=rA(g)?g(e):g;_!==e&&((d=l.current)==null||d.call(l,_))}else i(g)},[a,e,i,l]);return[c,u]}function tA({defaultProp:e,onChange:t}){const[r,n]=C.useState(e),s=C.useRef(r),i=C.useRef(t);return eA(()=>{i.current=t},[t]),C.useEffect(()=>{var l;s.current!==r&&((l=i.current)==null||l.call(i,r),s.current=r)},[r,s]),[r,n,i]}function rA(e){return typeof e=="function"}var nA=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"}),sA="VisuallyHidden",ES=C.forwardRef((e,t)=>o.jsx(ze.span,{...e,ref:t,style:{...nA,...e.style}}));ES.displayName=sA;var iA=ES,[xd]=mn("Tooltip",[va]),yd=va(),jS="TooltipProvider",oA=700,Yf="tooltip.open",[aA,sg]=xd(jS),NS=e=>{const{__scopeTooltip:t,delayDuration:r=oA,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,l=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(aA,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),l.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};NS.displayName=jS;var jl="Tooltip",[lA,Gl]=xd(jl),RS=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,c=sg(jl,e.__scopeTooltip),u=yd(t),[g,d]=C.useState(null),_=Ws(),v=C.useRef(0),x=l??c.disableHoverableContent,y=a??c.delayDuration,h=C.useRef(!1),[p,f]=_a({prop:n,defaultProp:s??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Yf))):c.onClose(),i==null||i(E)},caller:jl}),m=C.useMemo(()=>p?h.current?"delayed-open":"instant-open":"closed",[p]),b=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,h.current=!1,f(!0)},[f]),w=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,f(!1)},[f]),k=C.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{h.current=!0,f(!0),v.current=0},y)},[y,f]);return C.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),o.jsx(tg,{...u,children:o.jsx(lA,{scope:t,contentId:_,open:p,stateAttribute:m,trigger:g,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():b()},[c.isOpenDelayedRef,k,b]),onTriggerLeave:C.useCallback(()=>{x?w():(window.clearTimeout(v.current),v.current=0)},[w,x]),onOpen:b,onClose:w,disableHoverableContent:x,children:r})})};RS.displayName=jl;var Zf="TooltipTrigger",PS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Gl(Zf,r),i=sg(Zf,r),l=yd(r),a=C.useRef(null),c=He(t,a,s.onTriggerChange),u=C.useRef(!1),g=C.useRef(!1),d=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),o.jsx(_d,{asChild:!0,...l,children:o.jsx(ze.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:_e(e.onPointerMove,_=>{_.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:_e(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:_e(e.onBlur,s.onClose),onClick:_e(e.onClick,s.onClose)})})});PS.displayName=Zf;var ig="TooltipPortal",[cA,uA]=xd(ig,{forceMount:void 0}),TS=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,i=Gl(ig,t);return o.jsx(cA,{scope:t,forceMount:r,children:o.jsx(Vt,{present:r||i.open,children:o.jsx(Kl,{asChild:!0,container:s,children:n})})})};TS.displayName=ig;var na="TooltipContent",AS=C.forwardRef((e,t)=>{const r=uA(na,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,l=Gl(na,e.__scopeTooltip);return o.jsx(Vt,{present:n||l.open,children:l.disableHoverableContent?o.jsx(DS,{side:s,...i,ref:t}):o.jsx(dA,{side:s,...i,ref:t})})}),dA=C.forwardRef((e,t)=>{const r=Gl(na,e.__scopeTooltip),n=sg(na,e.__scopeTooltip),s=C.useRef(null),i=He(t,s),[l,a]=C.useState(null),{trigger:c,onClose:u}=r,g=s.current,{onPointerInTransitChange:d}=n,_=C.useCallback(()=>{a(null),d(!1)},[d]),v=C.useCallback((x,y)=>{const h=x.currentTarget,p={x:x.clientX,y:x.clientY},f=gA(p,h.getBoundingClientRect()),m=vA(p,f),b=_A(y.getBoundingClientRect()),w=yA([...m,...b]);a(w),d(!0)},[d]);return C.useEffect(()=>()=>_(),[_]),C.useEffect(()=>{if(c&&g){const x=h=>v(h,g),y=h=>v(h,c);return c.addEventListener("pointerleave",x),g.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",x),g.removeEventListener("pointerleave",y)}}},[c,g,v,_]),C.useEffect(()=>{if(l){const x=y=>{const h=y.target,p={x:y.clientX,y:y.clientY},f=(c==null?void 0:c.contains(h))||(g==null?void 0:g.contains(h)),m=!xA(p,l);f?_():m&&(_(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,g,l,u,_]),o.jsx(DS,{...e,ref:i})}),[hA,fA]=xd(jl,{isInside:!1}),pA=JT("TooltipContent"),DS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,c=Gl(na,r),u=yd(r),{onClose:g}=c;return C.useEffect(()=>(document.addEventListener(Yf,g),()=>document.removeEventListener(Yf,g)),[g]),C.useEffect(()=>{if(c.trigger){const d=_=>{const v=_.target;v!=null&&v.contains(c.trigger)&&g()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,g]),o.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d=>d.preventDefault(),onDismiss:g,children:o.jsxs(rg,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.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:[o.jsx(pA,{children:n}),o.jsx(hA,{scope:r,isInside:!0,children:o.jsx(iA,{id:c.contentId,role:"tooltip",children:s||n})})]})})});AS.displayName=na;var LS="TooltipArrow",mA=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=yd(r);return fA(LS,r).isInside?null:o.jsx(ng,{...s,...n,ref:t})});mA.displayName=LS;function gA(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function vA(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function _A(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function xA(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,g=a.y,d=c.x,_=c.y;g>n!=_>n&&r<(d-u)*(n-g)/(_-g)+u&&(s=!s)}return s}function yA(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),bA(t)}function bA(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],l=r[r.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var wA=NS,SA=RS,CA=PS,kA=TS,MS=AS;const Or=wA,cn=SA,un=CA,Fr=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(kA,{children:o.jsx(MS,{ref:n,sideOffset:t,className:J("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),...r})}));Fr.displayName=MS.displayName;function EA({chain:e}){const t=e==="base";return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ce,{variant:t?"secondary":"outline",children:"Testnet"}),o.jsx(Or,{delayDuration:120,children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{children:o.jsx(Ce,{variant:"secondary",className:"border-dashed border-border opacity-60",children:"Mainnet · soon"})})}),o.jsx(Fr,{children:"Mainnet support is coming. v1 supports testnet only."})]})})]})}function jA({status:e}){return e==="done"?o.jsxs(Ce,{variant:"success",className:"gap-1.5",children:[o.jsx(RR,{className:"h-3 w-3"}),"Done"]}):e==="error"?o.jsxs(Ce,{variant:"destructive",className:"gap-1.5",children:[o.jsx(Lm,{className:"h-3 w-3"}),"Failed"]}):e==="active"?o.jsxs(Ce,{variant:"warning",className:"gap-2",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]"}),"Active"]}):o.jsx(Ce,{variant:"secondary",children:"Queued"})}const NA={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function RA({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",i=t==="done",l=n||s,a=s?"text-[var(--break-red)]":n?"text-[var(--accent-gold)]":i?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]",c=s||n?"text-foreground":i?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]",u=l?"font-serif text-[28px] leading-[1.2]":"font-mono text-[14px] leading-[1.2]";return o.jsxs("li",{className:"phase-row border-t border-border","data-status":t,"data-testid":`onboarding-phase-${e}`,children:[o.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[o.jsx("span",{className:J("font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200",a),children:String(e).padStart(2,"0")}),o.jsx("span",{className:J(u,c,"transition-colors duration-200"),children:NA[e]}),o.jsx(jA,{status:t})]}),l&&r&&o.jsx("div",{className:"jinn-anim-fade-slide ml-12 pb-5 pr-2",children:r})]})}function PA({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:i,contractRevertReason:l}){const a=!!l;return o.jsxs("div",{className:J("flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3",a?"border-[var(--break-red)]":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:J("jinn-anim-pulse h-1.5 w-1.5 rounded-full",a?"bg-[var(--break-red)]":"bg-[var(--accent-sky)]")}),o.jsx("span",{className:"font-mono text-sm text-foreground",children:e}),o.jsx("span",{className:J("ml-auto font-mono text-[10px]",a?"text-[var(--break-red)]":"text-[var(--fg-dim)]"),children:a?"binding failed · will retry":"running · no action needed"})]}),o.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:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Current step"}),o.jsx("span",{children:TA(t)}),r!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Service"}),o.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Safe"}),o.jsx("a",{href:`${i}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"break-all text-[var(--accent-sky)] hover:underline",children:s})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Contract revert reason"}),o.jsx("code",{className:"break-words text-xs text-[var(--break-red)]",children:l})]})]})]})}function TA(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const AA={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 DA(e){return AA[e]??{phase:1,subState:null}}function LA(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}const MA="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]";function OA(){var g;const{data:e,isLoading:t}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:2e3});if(t||!e)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:s,subState:i}=DA(e.currentStep),l=e.error,a=e.services.find(d=>d.step===e.currentStep)??e.services[0],c=(g=e.funding)==null?void 0:g.targetMet,u=qm().embeddedAgent;return o.jsx("div",{className:"min-h-screen w-full bg-background text-foreground",children:o.jsxs("div",{className:"mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10",children:[o.jsxs("section",{className:J("col-span-12 flex flex-col gap-8",u&&"lg:col-span-7"),children:[o.jsxs("header",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:MA,children:"Jinn · Onboarding"}),o.jsx(EA,{chain:e.chain})]}),o.jsx("h1",{className:"font-serif text-[76px] leading-[1.05] text-foreground",children:"Welcome to Jinn."}),o.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":"onboarding-progress","aria-label":"Onboarding progress",children:[o.jsx(Vm,{value:Math.min(100,(s-1)/2*100+(s===3?33:0))}),o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:["Phase ",s," of 3"]})]}),o.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(d=>{var x;const _=LA(d,s,c),v=l&&d===s;return o.jsxs(RA,{phase:d,status:v?"error":_,children:[v&&o.jsx(EP,{envelope:l,chainExplorerBase:r}),!v&&d===2&&_==="active"&&n&&o.jsx(_P,{address:n,minimumWei:((x=e.funding)==null?void 0:x.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!v&&d===3&&_==="active"&&o.jsx(PA,{label:i??"Working",step:e.currentStep,serviceIndex:a==null?void 0:a.index,serviceId:a==null?void 0:a.service_id,safeAddress:a==null?void 0:a.safe_address,explorer:r,contractRevertReason:(a==null?void 0:a.error_revert_reason)??null})]},d)})})]}),u&&o.jsxs("aside",{className:"col-span-12 flex flex-col gap-3 lg:col-span-5",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Ask Claude"}),o.jsx(we,{className:"h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0",children:o.jsx(tS,{agentGated:!1})})]})]})})}const IA="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",FA="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function BA({connection:e}){const[t,r]=C.useState(!1);return o.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:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:IA,children:"Jinn · offline"}),o.jsx("h1",{className:FA,children:"Daemon not running."}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:"Open a terminal and run:"}),o.jsx("code",{className:"self-start rounded bg-[var(--bg-elevated)] px-2 py-1 font-mono text-sm text-foreground",children:"jinn run"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:"(or the command you originally used to start it)"})]}),o.jsxs("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:["Reconnecting…",e.attempts>0&&o.jsxs("span",{className:"ml-1 text-[var(--fg-dim)]",children:["(attempt ",e.attempts,")"]})]}),o.jsxs(oe,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(n=>!n),"aria-expanded":t,children:[t?o.jsx(Dm,{}):o.jsx(ud,{}),t?"Hide details":"Show details"]}),t&&e.lastError&&o.jsx(we,{className:"bg-[var(--bg-elevated)]",children:o.jsx(Qe,{className:"px-3 py-2",children:o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:e.lastError})})})]})})}const $A={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)]"},HA={blocking:"text-[var(--severity-blocking-fg)]",warning:"text-[var(--severity-warning-fg)]",info:"text-[var(--severity-info-fg)]"};function zA({notice:e}){return o.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:J("flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground",$A[e.severity]),children:[o.jsx("span",{"aria-hidden":"true",className:J("min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]",HA[e.severity]),children:e.severity}),o.jsx("span",{className:"flex-1",children:e.message}),e.jumpTo?o.jsx(ur,{href:e.jumpTo,className:"font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]",children:"resolve →"}):null]})}function UA({notices:e}){return e.length===0?null:o.jsx("section",{"aria-label":"Notifications",role:"region",children:o.jsx("ul",{className:"m-0 list-none p-0",children:e.map((t,r)=>o.jsx(zA,{notice:t},`${t.kind}-${r}`))})})}const OS=C.createContext({restartPending:!1,setRestartPending:()=>{}});function WA(){return C.useContext(OS)}function IS(e,t,r){if((t==null?void 0:t.enabled)!==!0||typeof e.evictedSince!="string")return!1;const n=Date.parse(e.evictedSince);return Number.isNaN(n)?!1:r-n<=2*t.checkIntervalMs}const VA=3,qA=1e3*60*60*24*90;function KA(e){const t=[],r=e.status;if(e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<VA&&t.push({kind:"funding_low",severity:"warning",message:`Runway is ${r.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:"/overview"}),!r.harness.ready){const s=r.harness.name===null?"A harness":`Harness ${r.harness.name}`,i=r.harness.reason?`: ${r.harness.reason}`:"";t.push({kind:"harness_not_ready",severity:"blocking",message:`${s} is not ready${i}.`,jumpTo:"/operator/memberships"})}r.rpc.reachable||t.push({kind:"rpc_unreachable",severity:"blocking",message:"RPC endpoint is unreachable.",jumpTo:"/operator/network"}),Object.keys(r.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"});const n=r.services.filter(s=>s.evicted);if(n.length>0){const s=e.now??Date.now();n.some(l=>!IS(l,r.autoRestake,s))&&t.push({kind:"service_evicted",severity:"blocking",message:"A service has been evicted from staking. Re-stake to resume.",jumpTo:"/overview"})}return r.services.some(s=>!s.safeBound)&&t.push({kind:"safe_binding_pending",severity:"warning",message:"Safe wallet binding is pending.",jumpTo:"/overview"}),r.restartPending&&t.push({kind:"restart_required",severity:"warning",message:"A configuration change is pending — restart to apply.",jumpTo:"/overview"}),r.latestVersion&&r.latestVersion!==r.daemonVersion&&t.push({kind:"update_available",severity:"info",message:`Daemon ${r.latestVersion} available (running ${r.daemonVersion}).`}),r.passwordRotatedAt&&(e.now??Date.now())-new Date(r.passwordRotatedAt).getTime()>qA&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),t}const I_={blocking:0,warning:1,info:2},GA=30*60*1e3,QA=60*1e3,YA=["intent"];function ZA(e,t,r){var d,_,v,x,y;const n=e??{},s=t??{},i=String(((d=n.masterGas)==null?void 0:d.balanceWei)??"0");let l="0",a=Number.POSITIVE_INFINITY;try{const h=BigInt(i);l=h.toString(),a=h>0n?Number.POSITIVE_INFINITY:0}catch{}const c=Array.isArray((_=n.fleet)==null?void 0:_.services)?n.fleet.services:[],u=s.joinedSolverNets&&typeof s.joinedSolverNets=="object"?s.joinedSolverNets:{},g=n.autoRestake&&typeof n.autoRestake=="object"?{enabled:!!n.autoRestake.enabled,checkIntervalMs:Number.isFinite(n.autoRestake.checkIntervalMs)?Number(n.autoRestake.checkIntervalMs):0}:void 0;return{funds:{eth:l,runwayDays:a},harness:{ready:((v=n.harness)==null?void 0:v.ready)!==!1,name:typeof((x=n.harness)==null?void 0:x.name)=="string"?n.harness.name:null,reason:typeof((y=n.harness)==null?void 0:y.reason)=="string"?n.harness.reason:null},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:c.map(h=>({evicted:!!(h!=null&&h.evicted),safeBound:(h==null?void 0:h.safeBoundToAgent)!==!1,evictedSince:typeof(h==null?void 0:h.evictedSince)=="string"?h.evictedSince:null})),joinedSolverNets:u,passwordRotatedAt:void 0,autoRestake:g}}function XA(){const e=vw(),{restartPending:t}=WA(),r=De({queryKey:["status"],queryFn:()=>me.getStatus()}),n=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap()}),{events:s}=yw(YA),[i,l]=C.useState(()=>Date.now());C.useEffect(()=>{const c=setInterval(()=>l(Date.now()),QA);return()=>clearInterval(c)},[]);const a=C.useMemo(()=>{const c=i-GA,u=new Set,g=s.filter(_=>{if(_.kind!=="intent"||_.errorCode!=="claim_failed")return!1;const v=Date.parse(_.ts);return Number.isNaN(v)||v<c||u.has(_.id)?!1:(u.add(_.id),!0)});if(g.length===0)return null;const d=g.length;return{kind:"claim_failed",severity:"warning",message:`${d} claim attempt${d===1?"":"s"} failed in the last 30 minutes. Check Tasks for details.`,jumpTo:"/overview",details:{count:d,sinceMs:c}}},[s,i]);return C.useMemo(()=>{if(e.status==="disconnected")return[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}];if(!r.data||!n.data)return[];const c=KA({bootstrap:n.data,status:ZA(r.data,n.data,t)});return(a?[...c,a]:[...c]).sort((g,d)=>I_[g.severity]-I_[d.severity])},[e.status,t,r.data,n.data,a])}function JA({header:e,tabs:t,rail:r,children:n}){const s=r!=null,i=XA(),l=i.length>0?"grid-rows-[auto_auto_auto_minmax(0,1fr)]":"grid-rows-[auto_auto_minmax(0,1fr)]";return o.jsxs("div",{className:J("grid h-screen w-full overflow-hidden bg-background text-foreground",s?"grid-cols-[1fr_320px]":"grid-cols-1",l),children:[o.jsx("div",{className:"col-span-full border-b border-border",children:e}),o.jsx("div",{className:"col-span-full border-b border-border",children:t}),i.length>0&&o.jsx("div",{className:"col-span-full border-b border-border",children:o.jsx(UA,{notices:i})}),o.jsx("main",{className:"min-h-0 overflow-y-auto",children:n}),s&&o.jsx("aside",{className:"h-full min-h-0 overflow-y-auto border-l border-border",children:r})]})}function eD({network:e}){return o.jsxs("header",{className:"flex items-center justify-between px-6 py-3.5",children:[o.jsx(ur,{href:"/overview",className:"font-serif text-[26px] text-foreground no-underline",children:"jinn operator"}),o.jsx(Ce,{variant:"outline",children:e})]})}const F_=[{path:"/overview",label:"Dashboard"},{path:"/events",label:"Events"},{path:"/operator",label:"Settings"}];function tD(){const[e]=Ur(),t=e.split(/[?#]/)[0]||"/",r=t==="/launcher"||t.startsWith("/launcher/"),{data:n}=De({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>me.solvernets.listLaunched(),refetchInterval:3e4,enabled:!r}),s=qm().pluginBuilderUi?[...F_,{path:"/build",label:"Build"}]:F_,l=r||((n==null?void 0:n.records.length)??0)>0?[...s,{path:"/launcher",label:"Launcher"}]:s;return o.jsx("nav",{className:"-mb-px flex px-6",children:l.map(a=>{const c=t===a.path||t.startsWith(`${a.path}/`);return o.jsx(ur,{href:a.path,"data-active":c?"true":"false",className:J("border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors",c?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:a.label},a.path)})})}function rD({agentGated:e}){return o.jsxs("div",{className:"agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]",children:"Claude"}),o.jsx(tS,{agentGated:e})]})}var nD=e=>{switch(e){case"success":return oD;case"info":return lD;case"warning":return aD;case"error":return cD;default:return null}},sD=Array(12).fill(0),iD=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},sD.map((r,n)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),oD=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),aD=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),lD=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),cD=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),uD=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),dD=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Xf=1,hD=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=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Xf++,i=this.toasts.find(a=>a.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:r}),{...a,...e,id:s,dismissible:l,title:r}):a):this.addToast({title:r,...n,dismissible:l,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,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 r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,l=n.then(async c=>{if(i=["resolve",c],Y.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(pD(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:g})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:g})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:g})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),a=()=>new Promise((c,u)=>l.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Xf++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},sr=new hD,fD=(e,t)=>{let r=(t==null?void 0:t.id)||Xf++;return sr.addToast({title:e,...t,id:r}),r},pD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mD=fD,gD=()=>sr.toasts,vD=()=>sr.getActiveToasts(),Pn=Object.assign(mD,{success:sr.success,info:sr.info,warning:sr.warning,error:sr.error,custom:sr.custom,message:sr.message,promise:sr.promise,dismiss:sr.dismiss,loading:sr.loading},{getHistory:gD,getToasts:vD});function _D(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}_D(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)}
201
+ `);function kc(e){return e.label!==void 0}var xD=3,yD="32px",bD="16px",B_=4e3,wD=356,SD=14,CD=20,kD=200;function Xr(...e){return e.filter(Boolean).join(" ")}function ED(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var jD=e=>{var t,r,n,s,i,l,a,c,u,g,d;let{invert:_,toast:v,unstyled:x,interacting:y,setHeights:h,visibleToasts:p,heights:f,index:m,toasts:b,expanded:w,removeToast:k,defaultRichColors:E,closeButton:S,style:j,cancelButtonStyle:R,actionButtonStyle:M,className:T="",descriptionClassName:L="",duration:$,position:z,gap:W,loadingIcon:q,expandByDefault:N,classNames:P,icons:D,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:B}=e,[Q,ee]=Y.useState(null),[re,ye]=Y.useState(null),[A,U]=Y.useState(!1),[G,K]=Y.useState(!1),[Z,X]=Y.useState(!1),[ae,je]=Y.useState(!1),[Oe,Be]=Y.useState(!1),[Se,Mt]=Y.useState(0),[dr,Dn]=Y.useState(0),qr=Y.useRef(v.duration||$||B_),Ln=Y.useRef(null),mt=Y.useRef(null),vn=m===0,I=m+1<=p,H=v.type,V=v.dismissible!==!1,ne=v.className||"",ie=v.descriptionClassName||"",te=Y.useMemo(()=>f.findIndex(Ne=>Ne.toastId===v.id)||0,[f,v.id]),ue=Y.useMemo(()=>{var Ne;return(Ne=v.closeButton)!=null?Ne:S},[v.closeButton,S]),fe=Y.useMemo(()=>v.duration||$||B_,[v.duration,$]),Re=Y.useRef(0),et=Y.useRef(0),qt=Y.useRef(0),kt=Y.useRef(null),[Mn,ba]=z.split("-"),Qi=Y.useMemo(()=>f.reduce((Ne,Ge,it)=>it>=te?Ne:Ne+Ge.height,0),[f,te]),tc=dD(),rc=v.invert||_,wa=H==="loading";et.current=Y.useMemo(()=>te*W+Qi,[te,Qi]),Y.useEffect(()=>{qr.current=fe},[fe]),Y.useEffect(()=>{U(!0)},[]),Y.useEffect(()=>{let Ne=mt.current;if(Ne){let Ge=Ne.getBoundingClientRect().height;return Dn(Ge),h(it=>[{toastId:v.id,height:Ge,position:v.position},...it]),()=>h(it=>it.filter(Gr=>Gr.toastId!==v.id))}},[h,v.id]),Y.useLayoutEffect(()=>{if(!A)return;let Ne=mt.current,Ge=Ne.style.height;Ne.style.height="auto";let it=Ne.getBoundingClientRect().height;Ne.style.height=Ge,Dn(it),h(Gr=>Gr.find(Qr=>Qr.toastId===v.id)?Gr.map(Qr=>Qr.toastId===v.id?{...Qr,height:it}:Qr):[{toastId:v.id,height:it,position:v.position},...Gr])},[A,v.title,v.description,h,v.id]);let Kr=Y.useCallback(()=>{K(!0),Mt(et.current),h(Ne=>Ne.filter(Ge=>Ge.toastId!==v.id)),setTimeout(()=>{k(v)},kD)},[v,k,h,et]);Y.useEffect(()=>{if(v.promise&&H==="loading"||v.duration===1/0||v.type==="loading")return;let Ne;return w||y||B&&tc?(()=>{if(qt.current<Re.current){let Ge=new Date().getTime()-Re.current;qr.current=qr.current-Ge}qt.current=new Date().getTime()})():qr.current!==1/0&&(Re.current=new Date().getTime(),Ne=setTimeout(()=>{var Ge;(Ge=v.onAutoClose)==null||Ge.call(v,v),Kr()},qr.current)),()=>clearTimeout(Ne)},[w,y,v,H,B,tc,Kr]),Y.useEffect(()=>{v.delete&&Kr()},[Kr,v.delete]);function Mk(){var Ne,Ge,it;return D!=null&&D.loading?Y.createElement("div",{className:Xr(P==null?void 0:P.loader,(Ne=v==null?void 0:v.classNames)==null?void 0:Ne.loader,"sonner-loader"),"data-visible":H==="loading"},D.loading):q?Y.createElement("div",{className:Xr(P==null?void 0:P.loader,(Ge=v==null?void 0:v.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":H==="loading"},q):Y.createElement(iD,{className:Xr(P==null?void 0:P.loader,(it=v==null?void 0:v.classNames)==null?void 0:it.loader),visible:H==="loading"})}return Y.createElement("li",{tabIndex:0,ref:mt,className:Xr(T,ne,P==null?void 0:P.toast,(t=v==null?void 0:v.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[H],(r=v==null?void 0:v.classNames)==null?void 0:r[H]),"data-sonner-toast":"","data-rich-colors":(n=v.richColors)!=null?n:E,"data-styled":!(v.jsx||v.unstyled||x),"data-mounted":A,"data-promise":!!v.promise,"data-swiped":Oe,"data-removed":G,"data-visible":I,"data-y-position":Mn,"data-x-position":ba,"data-index":m,"data-front":vn,"data-swiping":Z,"data-dismissible":V,"data-type":H,"data-invert":rc,"data-swipe-out":ae,"data-swipe-direction":re,"data-expanded":!!(w||N&&A),style:{"--index":m,"--toasts-before":m,"--z-index":b.length-m,"--offset":`${G?Se:et.current}px`,"--initial-height":N?"auto":`${dr}px`,...j,...v.style},onDragEnd:()=>{X(!1),ee(null),kt.current=null},onPointerDown:Ne=>{wa||!V||(Ln.current=new Date,Mt(et.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(X(!0),kt.current={x:Ne.clientX,y:Ne.clientY}))},onPointerUp:()=>{var Ne,Ge,it,Gr;if(ae||!V)return;kt.current=null;let Qr=Number(((Ne=mt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cs=Number(((Ge=mt.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),si=new Date().getTime()-((it=Ln.current)==null?void 0:it.getTime()),Yr=Q==="x"?Qr:cs,us=Math.abs(Yr)/si;if(Math.abs(Yr)>=CD||us>.11){Mt(et.current),(Gr=v.onDismiss)==null||Gr.call(v,v),ye(Q==="x"?Qr>0?"right":"left":cs>0?"down":"up"),Kr(),je(!0),Be(!1);return}X(!1),ee(null)},onPointerMove:Ne=>{var Ge,it,Gr,Qr;if(!kt.current||!V||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;let cs=Ne.clientY-kt.current.y,si=Ne.clientX-kt.current.x,Yr=(it=e.swipeDirections)!=null?it:ED(z);!Q&&(Math.abs(si)>1||Math.abs(cs)>1)&&ee(Math.abs(si)>Math.abs(cs)?"x":"y");let us={x:0,y:0};Q==="y"?(Yr.includes("top")||Yr.includes("bottom"))&&(Yr.includes("top")&&cs<0||Yr.includes("bottom")&&cs>0)&&(us.y=cs):Q==="x"&&(Yr.includes("left")||Yr.includes("right"))&&(Yr.includes("left")&&si<0||Yr.includes("right")&&si>0)&&(us.x=si),(Math.abs(us.x)>0||Math.abs(us.y)>0)&&Be(!0),(Gr=mt.current)==null||Gr.style.setProperty("--swipe-amount-x",`${us.x}px`),(Qr=mt.current)==null||Qr.style.setProperty("--swipe-amount-y",`${us.y}px`)}},ue&&!v.jsx?Y.createElement("button",{"aria-label":O,"data-disabled":wa,"data-close-button":!0,onClick:wa||!V?()=>{}:()=>{var Ne;Kr(),(Ne=v.onDismiss)==null||Ne.call(v,v)},className:Xr(P==null?void 0:P.closeButton,(s=v==null?void 0:v.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:uD):null,v.jsx||C.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Y.createElement(Y.Fragment,null,H||v.icon||v.promise?Y.createElement("div",{"data-icon":"",className:Xr(P==null?void 0:P.icon,(l=v==null?void 0:v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Mk():null,v.type!=="loading"?v.icon||(D==null?void 0:D[H])||nD(H):null):null,Y.createElement("div",{"data-content":"",className:Xr(P==null?void 0:P.content,(a=v==null?void 0:v.classNames)==null?void 0:a.content)},Y.createElement("div",{"data-title":"",className:Xr(P==null?void 0:P.title,(c=v==null?void 0:v.classNames)==null?void 0:c.title)},typeof v.title=="function"?v.title():v.title),v.description?Y.createElement("div",{"data-description":"",className:Xr(L,ie,P==null?void 0:P.description,(u=v==null?void 0:v.classNames)==null?void 0:u.description)},typeof v.description=="function"?v.description():v.description):null),C.isValidElement(v.cancel)?v.cancel:v.cancel&&kc(v.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||R,onClick:Ne=>{var Ge,it;kc(v.cancel)&&V&&((it=(Ge=v.cancel).onClick)==null||it.call(Ge,Ne),Kr())},className:Xr(P==null?void 0:P.cancelButton,(g=v==null?void 0:v.classNames)==null?void 0:g.cancelButton)},v.cancel.label):null,C.isValidElement(v.action)?v.action:v.action&&kc(v.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||M,onClick:Ne=>{var Ge,it;kc(v.action)&&((it=(Ge=v.action).onClick)==null||it.call(Ge,Ne),!Ne.defaultPrevented&&Kr())},className:Xr(P==null?void 0:P.actionButton,(d=v==null?void 0:v.classNames)==null?void 0:d.actionButton)},v.action.label):null))};function $_(){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 ND(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,l=i?"--mobile-offset":"--offset",a=i?bD:yD;function c(u){["top","right","bottom","left"].forEach(g=>{r[`${l}-${g}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${l}-${u}`]=a:r[`${l}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(a)}),r}var RD=C.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:a,offset:c,mobileOffset:u,theme:g="light",richColors:d,duration:_,style:v,visibleToasts:x=xD,toastOptions:y,dir:h=$_(),gap:p=SD,loadingIcon:f,icons:m,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[k,E]=Y.useState([]),S=Y.useMemo(()=>Array.from(new Set([n].concat(k.filter(B=>B.position).map(B=>B.position)))),[k,n]),[j,R]=Y.useState([]),[M,T]=Y.useState(!1),[L,$]=Y.useState(!1),[z,W]=Y.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Y.useRef(null),N=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Y.useRef(null),D=Y.useRef(!1),O=Y.useCallback(B=>{E(Q=>{var ee;return(ee=Q.find(re=>re.id===B.id))!=null&&ee.delete||sr.dismiss(B.id),Q.filter(({id:re})=>re!==B.id)})},[]);return Y.useEffect(()=>sr.subscribe(B=>{if(B.dismiss){E(Q=>Q.map(ee=>ee.id===B.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Wb.flushSync(()=>{E(Q=>{let ee=Q.findIndex(re=>re.id===B.id);return ee!==-1?[...Q.slice(0,ee),{...Q[ee],...B},...Q.slice(ee+1)]:[B,...Q]})})})}),[]),Y.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:Q})=>{W(Q?"dark":"light")})}catch{B.addListener(({matches:ee})=>{try{W(ee?"dark":"light")}catch(re){console.error(re)}})}},[g]),Y.useEffect(()=>{k.length<=1&&T(!1)},[k]),Y.useEffect(()=>{let B=Q=>{var ee,re;s.every(ye=>Q[ye]||Q.code===ye)&&(T(!0),(ee=q.current)==null||ee.focus()),Q.code==="Escape"&&(document.activeElement===q.current||(re=q.current)!=null&&re.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[s]),Y.useEffect(()=>{if(q.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,D.current=!1)}},[q.current]),Y.createElement("section",{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((B,Q)=>{var ee;let[re,ye]=B.split("-");return k.length?Y.createElement("ol",{key:B,dir:h==="auto"?$_():h,tabIndex:-1,ref:q,className:a,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":re,"data-lifted":M&&k.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((ee=j[0])==null?void 0:ee.height)||0}px`,"--width":`${wD}px`,"--gap":`${p}px`,...v,...ND(c,u)},onBlur:A=>{D.current&&!A.currentTarget.contains(A.relatedTarget)&&(D.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||D.current||(D.current=!0,P.current=A.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(A=>!A.position&&Q===0||A.position===B).map((A,U)=>{var G,K;return Y.createElement(jD,{key:A.id,icons:m,index:U,toast:A,defaultRichColors:d,duration:(G=y==null?void 0:y.duration)!=null?G:_,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:x,closeButton:(K=y==null?void 0:y.closeButton)!=null?K:l,interacting:L,position:B,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:O,toasts:k.filter(Z=>Z.position==A.position),heights:j.filter(Z=>Z.position==A.position),setHeights:R,expandByDefault:i,gap:p,loadingIcon:f,expanded:M,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const Ye=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>o.jsx("div",{ref:s,role:r?"none":"separator","aria-orientation":t,className:J("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));Ye.displayName="Separator";const PD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",ph="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",TD="font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground",AD="font-mono text-[12px] font-medium text-[var(--fg-muted)]",H_="font-mono text-[12px] text-[var(--fg-dim)]";function DD(e,t,r){switch(e){case"ready":return{value:t,copy:null};case"error":return{value:"unavailable",copy:r??"Sepolia tJINN balance temporarily unavailable."};case"pending":return{value:"pending",copy:"Waiting for Sepolia balance."}}}function LD({totalEth:e,runwayDays:t,tjinnEarned:r,tjinnEarnedLast24h:n,tjinnState:s,tjinnError:i,lastPasswordRotationAt:l,onTopUp:a,actionsDisabled:c=!1}){const[,u]=Ur(),{value:g,copy:d}=DD(s,r,i);return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Wallet","data-testid":"wallet-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:PD,children:"Wallet"}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-rewards",children:[o.jsx("span",{className:ph,children:"Rewards"}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-24h-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"JINN earned last 24hrs"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-2xl font-bold tracking-tight","data-testid":"tjinn-earned-24h-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:n??(s==="error"?"unavailable":"pending")}),n!==null&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state-prefix",children:"Lifetime"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-base font-medium","data-testid":"tjinn-earned-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:g}),s==="ready"&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]}),d&&o.jsx("span",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state",children:d})]})]}),o.jsx(Ye,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-gas",children:[o.jsx("span",{className:ph,children:"Gas"}),o.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[o.jsx("span",{className:TD,children:e}),o.jsx("span",{className:AD,children:"ETH"}),o.jsx("span",{className:H_,children:"·"}),o.jsxs("span",{className:H_,children:[t,"d runway"]})]}),o.jsx(oe,{variant:"outline",size:"sm","aria-label":"Top up from faucet",onClick:a,disabled:c,"data-testid":"wallet-topup",className:"self-start",children:"Top up from faucet (free)"})]}),o.jsx(Ye,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-password",children:[o.jsx("span",{className:ph,children:"Password"}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-dim)]",children:["last rotated:"," ",l?o.jsx("time",{dateTime:l,className:"text-[var(--fg-muted)]",children:l}):o.jsx("span",{className:"text-[var(--fg-muted)]",children:"never"})]}),o.jsx(oe,{variant:"secondary",size:"sm","aria-label":"Change password",onClick:()=>u("/operator/security"),"data-testid":"wallet-change-password",className:"self-start",children:"Change password"})]})]})})}const MD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",OD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",Jf="font-mono text-[14px] text-foreground",ID="font-mono text-[14px] text-[var(--fg-muted)]";function FD(e){return e.length<10?e:`${e.slice(0,6)}…${e.slice(-4)}`}function ep(){return o.jsx("span",{"data-testid":"identity-stat-empty",className:ID,children:"—"})}function tp({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:OD,children:e}),t]})}function z_({label:e,address:t,testId:r}){return o.jsx(tp,{label:e,children:t?o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{"data-testid":r,tabIndex:0,className:`cursor-help ${Jf}`,children:FD(t)})}),o.jsx(Fr,{children:t})]}):o.jsx(ep,{})})}function BD({masterAddress:e,safeAddress:t,serviceId:r,agentId:n,services:s=[],bindingError:i}){const l=s.find(h=>h.agentId!==null&&!h.safeBoundToAgent),[a,c]=C.useState(!1),[u,g]=C.useState(!1),[d,_]=C.useState(null),[v,x]=C.useState(i??null),y=async()=>{if(l){g(!0),_(null),x(null);try{const p=(await me.retryAgentBinding({serviceIndex:l.index})).attempts[0];(p==null?void 0:p.status)==="success"?(_("success"),c(!1)):(_("reverted"),x((p==null?void 0:p.detail)??"Bind reverted on chain."))}catch(h){_("reverted"),x(h instanceof Error?h.message:String(h))}finally{g(!1)}}};return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Identity","data-testid":"identity-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:MD,children:"Identity"}),o.jsxs("div",{className:"flex flex-wrap gap-8",children:[o.jsx(tp,{label:"Service",children:r!==null?o.jsxs("span",{"data-testid":"identity-service-id",className:Jf,children:["#",r]}):o.jsx(ep,{})}),o.jsx(tp,{label:"Agent",children:o.jsxs("span",{className:`flex items-center gap-2 ${Jf}`,children:[n!==null?`#${n}`:o.jsx(ep,{}),l&&o.jsx("button",{type:"button",onClick:()=>c(h=>!h),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"&&o.jsx(Ce,{variant:"success",className:"rounded-full normal-case tracking-[0.12em]",children:"bound"})]})}),o.jsx(z_,{label:"Master",address:e,testId:"identity-master-address"}),o.jsx(z_,{label:"Safe",address:t,testId:"identity-safe-address"})]}),l&&o.jsxs(Ze,{variant:"warning","data-testid":"identity-state-message-safe-not-bound",className:"flex flex-col gap-2",children:[o.jsxs(Je,{children:["Service #",l.index," Safe is not yet bound to agent #",l.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),a&&v&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:v}),o.jsx(oe,{variant:"default",size:"sm",onClick:()=>{a||c(!0),y()},disabled:u,className:"self-start",children:u?"Retrying…":"Retry binding"})]}),n===null&&o.jsx(Ze,{variant:"warning","data-testid":"identity-state-message-agent-id-not-minted",children:o.jsx(Je,{children:"Agent ID has not yet been minted. The daemon mints it during bootstrap; if this persists, check the bootstrap logs."})})]})})}const og="claude-code",bd="codex",sa="hermes-agent",$D={"claude-code-learner":og,"codex-code-learner":bd},HD={[og]:"Claude Code",[bd]:"Codex",[sa]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function Sr(e){return e?$D[e]??e:""}function Vs(e){const t=Sr(e);return HD[t]??t}function FS(e,t){const r=Vs(e);return t?`${r} ${t}`:r}function zD(e,t){return Sr(e)===Sr(t)}const UD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",WD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function VD({name:e}){var _;const t=is(),{data:r,isError:n,error:s}=De({queryKey:["harness-readiness",e],queryFn:()=>me.harnessReadiness(e),refetchInterval:3e4}),i=Sr(e)===bd,l=De({queryKey:["codex-doctor"],queryFn:()=>me.codexDoctor(),refetchInterval:3e4,enabled:i});function a(){return n?"error":(r==null?void 0:r.ready)===!0?"ready":(r==null?void 0:r.ready)===!1?"not-ready":null}const c=a(),u=c==="not-ready",g=()=>{t.invalidateQueries({queryKey:["harness-readiness",e]})},d=()=>{const v=r==null?void 0:r.nextStep;if(v){if(v.url){window.open(v.url,"_blank","noopener,noreferrer");return}v.cli&&navigator.clipboard.writeText(v.cli).then(()=>Pn.success("Command copied",{description:v.cli,duration:5e3})).catch(()=>Pn.error("Could not copy",{description:v.cli,duration:1/0}))}};return o.jsxs("div",{"data-testid":`harness-row-${e}`,className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline gap-3",children:[o.jsx("span",{className:WD,children:e}),c==="ready"&&o.jsx(Ce,{variant:"success","data-testid":`harness-pill-ready-${e}`,children:"ready"}),c==="not-ready"&&o.jsx(Ce,{variant:"destructive","data-testid":`harness-pill-not-ready-${e}`,children:"not ready"}),c==="error"&&o.jsx(Ce,{variant:"outline","data-testid":`harness-pill-error-${e}`,children:"unavailable"})]}),c==="not-ready"&&(r==null?void 0:r.reason)&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--break-red)]",children:r.reason}),c==="not-ready"&&(r==null?void 0:r.nextStep)&&o.jsxs("span",{"data-testid":`harness-next-step-${e}`,className:"font-mono text-[12px] text-[var(--fg-muted)]",children:[r.nextStep.description,r.nextStep.cli?` (${r.nextStep.cli})`:""]}),c==="error"&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:s instanceof Error?s.message:"Readiness check failed."}),i&&((_=l.data)==null?void 0:_.versionStatus)==="untested"&&o.jsxs("span",{"data-testid":"codex-version-hint-untested",className:"font-mono text-[12px] text-[var(--severity-warning-fg)]",children:["Codex CLI ",l.data.cliVersion," is outside the tested range — harness may break."]}),u&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{variant:"default",size:"sm","data-testid":`harness-reauth-${e}`,onClick:d,children:"Re-authenticate"}),o.jsx(oe,{variant:"outline",size:"sm","data-testid":`harness-recheck-${e}`,onClick:g,children:"Re-check"})]})]})}function qD(){const[,e]=Ur();return o.jsxs("div",{className:"flex flex-col gap-2","data-testid":"harness-empty-state",children:[o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"No SolverNets joined — Harness Readiness will populate after you join one."}),o.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/operator/registry"),"data-testid":"harness-empty-state-browse",className:"self-start",children:"Browse SolverNets"})]})}function KD({harnessNames:e}){return o.jsxs(we,{role:"region","aria-label":"Harness Readiness","data-testid":"harness-status-panel",className:"flex flex-col gap-4 p-6",children:[o.jsx("span",{className:UD,children:"Harness Readiness"}),e.length===0?o.jsx(qD,{}):o.jsx("div",{className:"flex flex-col gap-4",children:e.map((t,r)=>o.jsxs(C.Fragment,{children:[r>0&&o.jsx(Ye,{}),o.jsx(VD,{name:t})]},t))})]})}const mh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",U_="flex items-center gap-2 font-mono text-[17px] font-medium text-foreground";function W_({tone:e}){const t=e==="good"?"bg-[var(--vow-green)]":e==="bad"?"bg-[var(--break-red)]":"bg-[var(--fg-muted)]";return o.jsx("span",{"aria-hidden":"true",className:J("inline-block h-2 w-2 rounded-full",t)})}function GD({daemonStatus:e,daemonStateMessage:t,rpcStatus:r,onRestart:n}){const[,s]=Ur(),[i,l]=C.useState(null),a=e==="running",c=r==="healthy";function u(){i||!n||(l("restart"),Promise.resolve().then(n).catch(g=>console.error("[node-health] restart failed:",g)).finally(()=>l(null)))}return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{"data-testid":"node-health-card","aria-labelledby":"node-health-heading",className:"flex flex-col gap-4 p-6",children:[o.jsx("h2",{id:"node-health-heading",className:J(mh,"m-0 text-[var(--fg-dim)]"),children:"Node health"}),o.jsxs("div",{"data-testid":"node-health-daemon-row","data-status":e,className:"flex flex-col gap-2",children:[o.jsx("span",{className:mh,children:"Daemon"}),o.jsxs("span",{className:U_,children:[o.jsx(W_,{tone:a?"good":"bad"}),a?"Running":"Stopped"]}),t&&o.jsx("span",{"data-testid":"node-health-daemon-state",className:"font-mono text-[12px] leading-snug text-[var(--fg-muted)]",children:t}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{tabIndex:a?-1:0,children:o.jsx(oe,{variant:"outline",size:"sm",disabled:!a||i!==null,"data-testid":"node-health-restart",onClick:u,children:i==="restart"?"Restarting...":"Restart"})})}),o.jsx(Fr,{children:a?"Restart the daemon. The dashboard reconnects when it comes back.":"Daemon is stopped — re-run jinn from your terminal to start it."})]})})]}),o.jsxs("div",{"data-testid":"node-health-rpc-row","data-status":r,className:"flex flex-col gap-2",children:[o.jsx("span",{className:mh,children:"RPC"}),o.jsxs("span",{className:U_,children:[o.jsx(W_,{tone:c?"good":"bad"}),c?"Healthy":"Unreachable"]}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsx(oe,{variant:"outline",size:"sm","data-testid":"node-health-rpc-settings",onClick:()=>s("/operator/network"),children:"Manage RPC"})})]})]})})}const zi=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:J("w-full caption-bottom font-mono text-[12px]",e),...t})}));zi.displayName="Table";const Ui=C.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:J("[&_tr]:border-b [&_tr]:border-border",e),...t}));Ui.displayName="TableHeader";const Wi=C.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:J("[&_tr:last-child]:border-0",e),...t}));Wi.displayName="TableBody";const QD=C.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:J("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));QD.displayName="TableFooter";const Cr=C.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:J("border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]",e),...t}));Cr.displayName="TableRow";const Ve=C.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:J("h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",e),...t}));Ve.displayName="TableHead";const qe=C.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:J("px-2 py-2 align-middle",e),...t}));qe.displayName="TableCell";const YD=C.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:J("mt-4 text-[12px] text-[var(--fg-muted)]",e),...t}));YD.displayName="TableCaption";const ZD=new Set(["DISCOVERED","CLAIMED","WAITING","PRE_SNAPSHOT","RUNNING","POST_SNAPSHOT","PACKAGING","DELIVERING"]);function XD(e,t=6,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}…${e.slice(-r)}`}function JD(e){return e==="restoration"?"solve":e==="evaluation"?"evaluate":"—"}function eL(e){return e==="COMPLETE"?{label:"succeeded",detail:"COMPLETE",tone:"good"}:e==="FAILED"?{label:"failed",detail:"FAILED",tone:"bad"}:ZD.has(e)?{label:"active",detail:e.toLowerCase().replace(/_/g," "),tone:"active"}:{label:e.toLowerCase().replace(/_/g," "),detail:e,tone:"neutral"}}function tL(e){return e==="bad"?"destructive":e==="good"?"success":e==="active"?"default":"outline"}function rL(e){if(!e)return"—";const 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 nL(e){return e==="solving"||e==="solver"?"solver":e==="evaluating"||e==="evaluator"?"evaluator":e}const sL="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0";function rp({children:e,className:t}){return o.jsx("h3",{className:J(sL,t),children:e})}function Ec({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(rp,{children:e}),o.jsx("div",{className:"font-mono text-[12px] text-foreground",children:t})]})}function iL({joined:e,tasks:t}){var a,c;const[,r]=Ur(),[n,s]=C.useState(((a=e[0])==null?void 0:a.manifestCid)??((c=e[0])==null?void 0:c.name)??null),i=C.useMemo(()=>e.find(u=>(u.manifestCid??u.name)===n)??e[0]??null,[e,n]),l=C.useMemo(()=>i?t.filter(u=>{if(u.state==="FAILED"){if(u.runStartedAt===null)return!1;const g=(u.failureReason??"").toLowerCase();if(g.includes("not ready")||g.includes("not enabled"))return!1}return e.length<=1?!0:u.manifestCid&&i.manifestCid?u.manifestCid===i.manifestCid:!0}):[],[t,i,e.length,n]);return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Activity","data-testid":"activity-card",children:[o.jsxs(Zt,{className:"flex flex-row items-center justify-between gap-3 pb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ER,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),o.jsx(hn,{children:"Activity"})]}),o.jsxs(oe,{variant:"secondary",size:"sm","data-testid":"activity-view-event-log",onClick:()=>r("/events"),children:[o.jsx(LR,{className:"h-3 w-3","aria-hidden":"true"}),"View event log"]})]}),o.jsx(Qe,{children:o.jsxs("div",{className:"grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]",children:[o.jsxs("div",{"data-testid":"activity-joined",className:"flex min-w-0 flex-col gap-3",children:[o.jsx(rp,{children:"Joined"}),e.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNets joined."}):o.jsx(Wl,{className:"max-h-[280px]",children:o.jsx("div",{className:"flex flex-col gap-1 pr-2",children:e.map(u=>{const g=u.manifestCid??u.name,d=g===((i==null?void 0:i.manifestCid)??(i==null?void 0:i.name));return o.jsx(oe,{variant:"ghost",size:"sm","data-testid":`activity-joined-row-${g}`,"data-state":d?"active":void 0,"aria-current":d?"true":void 0,onClick:()=>s(g),className:J("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",d?"border-l-primary bg-accent text-foreground":"border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground"),children:o.jsx("span",{className:"truncate",children:u.name})},g)})})}),o.jsxs(oe,{variant:"outline",size:"sm","data-testid":"activity-join-more",onClick:()=>r("/operator/registry"),className:"self-start",children:[o.jsx(FR,{className:"h-3 w-3","aria-hidden":"true"}),"Join more SolverNets"]})]}),o.jsxs("div",{"data-testid":"activity-tasks",className:"flex min-w-0 flex-col gap-3",children:[i&&o.jsx("h2",{className:"m-0 font-serif text-[20px] font-normal leading-tight text-foreground",children:i.name}),l.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No task runs recorded yet."}):o.jsx("div",{"data-testid":"activity-tasks-table",children:o.jsxs(zi,{children:[o.jsx(Ui,{children:o.jsxs(Cr,{className:"hover:bg-transparent",children:[o.jsx(Ve,{children:"Run"}),o.jsx(Ve,{children:"Task"}),o.jsx(Ve,{children:"State"}),o.jsx(Ve,{children:"Started"})]})}),o.jsx(Wi,{children:l.map(u=>{const g=eL(u.state),d=g.tone==="active";return o.jsxs(Cr,{"data-active":d?"true":void 0,"data-testid":`activity-task-row-${u.requestId}`,className:J("border-l-2",d?"border-l-primary bg-primary/[0.06]":"border-l-transparent"),children:[o.jsx(qe,{className:"text-muted-foreground",children:JD(u.taskRole)}),o.jsx(qe,{children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("button",{type:"button",className:"bg-transparent p-0 font-mono text-[12px] text-[var(--accent-sky)] underline-offset-4 hover:underline",onClick:()=>r(`/events?requestId=${encodeURIComponent(u.requestId)}`),children:XD(u.requestId)})}),o.jsx(Fr,{children:u.requestId})]})}),o.jsx(qe,{children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0",children:o.jsx(Ce,{variant:tL(g.tone),children:g.label})})}),o.jsx(Fr,{children:g.detail})]})}),o.jsx(qe,{className:"text-muted-foreground",children:rL(u.runStartedAt??u.stateUpdatedAt)})]},u.requestId)})})]})})]}),o.jsxs("div",{"data-testid":"activity-settings",className:"flex min-w-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(rp,{children:"Settings"}),o.jsxs(oe,{variant:"link",size:"sm","data-testid":"activity-settings-edit",onClick:()=>r("/operator/memberships"),className:"h-auto gap-1 p-0 text-[11px] uppercase tracking-[0.14em]",children:[o.jsx(IR,{className:"h-3 w-3","aria-hidden":"true"}),"Edit"]})]}),i?o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx(Ec,{label:"Roles",children:i.roles.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.roles.map(u=>o.jsx(Ce,{variant:"outline",children:nL(u)},u))})}),o.jsx(Ye,{}),o.jsx(Ec,{label:"Harness",children:i.harness??"—"}),o.jsx(Ye,{}),o.jsx(Ec,{label:"Model",children:o.jsx("span",{className:J(!i.model&&"text-muted-foreground"),children:i.model??"—"})}),o.jsx(Ye,{}),o.jsx(Ec,{label:"Plugins",children:!i.plugins||i.plugins.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:i.plugins.map(u=>o.jsxs("li",{"data-testid":`activity-plugin-${u.name}`,className:"flex items-center gap-2 overflow-hidden",children:[o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground",children:u.displayName})}),o.jsx(Fr,{children:u.name})]}),u.defaultIncluded&&o.jsx(Ce,{variant:"secondary",className:"shrink-0",children:"default"})]},u.name))})})]}):o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNet selected."})]})]})})]})})}const oL=[{name:"network-tools",version:"0.1.0",defaultIncluded:!0},{name:"claude-code-learner",version:"0.1.0",defaultIncluded:!0}],aL=new Set(["swe-rebench-v2-runtime"]),lL={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},np="bundled:";function sp(e){return lL[e]??e}function jc(e){return e.startsWith(np)?e.slice(np.length):e}function cL(e){const t=Sr(e)===sa;return oL.filter(r=>!(t&&r.name==="claude-code-learner")).map(r=>({name:r.name,displayName:sp(r.name),source:"bundled",version:r.version,defaultIncluded:!0}))}function uL({harness:e,explicit:t,disabledDefaults:r,catalogCompatible:n=[]}){const s=new Set(r.map(jc)),i=new Set(t.map(jc));new Map(t.map(c=>[jc(c),c]));const l=[],a=new Set;for(const c of cL(e))a.has(c.name)||(a.add(c.name),!s.has(c.name)&&l.push(c));for(const c of n){if(a.has(c.name))continue;a.add(c.name);const u=aL.has(c.name),g=i.has(c.name);!u&&!g||u&&s.has(c.name)||l.push({name:c.name,displayName:sp(c.name),source:"catalog",version:c.version,defaultIncluded:u})}for(const c of t){const u=jc(c);a.has(u)||(a.add(u),l.push({name:u,displayName:sp(u),source:c.startsWith(np)?"bundled":"custom",version:"configured",defaultIncluded:!1}))}return l}function oi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function dL(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function hL(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function fL(e,t,r){if(e)return e.filter(n=>n.evicted===!0).find(n=>!IS(n,t,r))}function pL({serviceId:e,onRestake:t}){const[r,n]=C.useState(!1);return o.jsxs(Ze,{variant:"blocking","data-testid":"overview-eviction-banner","aria-live":"polite",className:"flex flex-col gap-2",children:[o.jsx(Lm,{className:"h-4 w-4 text-[var(--break-red)]"}),o.jsx(Rt,{className:"text-[var(--break-red)]",children:"Service evicted"}),o.jsx(Je,{className:"text-base text-foreground",children:"A service has been evicted from staking. Re-stake to resume earning."}),e!=null&&o.jsx(oe,{variant:"destructive",size:"sm",type:"button","data-testid":"overview-eviction-restake",disabled:r,onClick:async()=>{if(!r){n(!0);try{await t(e)}finally{n(!1)}}},className:"mt-2 self-start",children:r?"Working…":"Re-stake now"})]})}function mL(){var L,$,z,W,q,N,P,D,O,B,Q,ee,re,ye,A,U,G;const[e,t]=C.useState(null),r=is(),{data:n,isError:s}=De({queryKey:["status"],queryFn:()=>me.getStatus(),refetchInterval:5e3}),{data:i}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:3e4}),{data:l}=De({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets(),refetchInterval:5*6e4}),a=(((L=n==null?void 0:n.fleet)==null?void 0:L.services)??[]).map(K=>({index:K.index,serviceId:K.serviceId??null,safeAddress:K.safeAddress??"",agentId:K.agentId??null,safeBoundToAgent:K.safeBoundToAgent??!1})),c=(($=a.find(K=>K.serviceId!==null))==null?void 0:$.serviceId)??null,u=C.useMemo(()=>{const K=Z=>{const X=new Set;for(const ae of Object.values(Z??{}))ae!=null&&ae.harness&&X.add(ae.harness);return X};return Array.from(K(i==null?void 0:i.joinedSolverNets)).sort()},[i]),g=fL((z=n==null?void 0:n.fleet)==null?void 0:z.services,n==null?void 0:n.autoRestake,Date.now()),d=g!=null,_=(g==null?void 0:g.serviceId)??null,v=((W=n==null?void 0:n.tJinn)==null?void 0:W.state)??"pending",x=((q=n==null?void 0:n.tJinn)==null?void 0:q.state)==="ready"?oi(n.tJinn.safeBalanceWei??"0"):oi(((N=n==null?void 0:n.tJinn)==null?void 0:N.safeBalanceWei)??void 0),y=((P=n==null?void 0:n.tJinn)==null?void 0:P.operatorMintedLast24hWei)!=null?oi(n.tJinn.operatorMintedLast24hWei):null,h=((D=n==null?void 0:n.tJinn)==null?void 0:D.error)??null,p=oi((O=n==null?void 0:n.masterGas)==null?void 0:O.balanceWei),f=((B=n==null?void 0:n.masterGas)==null?void 0:B.runwayDaysExcess)??"—",m=(Q=n==null?void 0:n.balances)==null?void 0:Q.eth,b=oi(((ee=m==null?void 0:m.master)==null?void 0:ee.balanceWei)??void 0),w=oi(((re=m==null?void 0:m.agent)==null?void 0:re.balanceWei)??void 0),k=oi(((ye=m==null?void 0:m.safe)==null?void 0:ye.balanceWei)??void 0),E=C.useMemo(()=>{const K=[],Z=i==null?void 0:i.joinedSolverNets;if(!Z)return K;for(const[X,ae]of Object.entries(Z)){if(!ae)continue;const je=ae.contract?l==null?void 0:l.nets.find(Be=>{var Se,Mt;return Be.contract.id===((Se=ae.contract)==null?void 0:Se.id)&&Be.contract.version===((Mt=ae.contract)==null?void 0:Mt.version)}):void 0,Oe=uL({harness:ae.harness,explicit:Array.isArray(ae.plugins)?ae.plugins:[],disabledDefaults:Array.isArray(ae.disabledDefaultPlugins)?ae.disabledDefaultPlugins:[],catalogCompatible:je==null?void 0:je.compatiblePlugins});K.push({name:ae.name??ae.manifestCid??X,manifestCid:ae.manifestCid??X,roles:Array.isArray(ae.roles)?ae.roles:[],harness:ae.harness,model:ae.model,plugins:Oe})}return K},[i,l]),S=C.useMemo(()=>{var X,ae,je;const K=new Map,Z=Oe=>{if(Oe)for(const Be of Oe)Be.requestId&&(K.has(Be.requestId)||K.set(Be.requestId,{requestId:Be.requestId,manifestCid:Be.manifestCid??null,taskRole:Be.taskRole,state:Be.state,implName:Be.implName??null,windowStartTs:Be.windowStartTs??0,runStartedAt:Be.runStartedAt??null,stateUpdatedAt:Be.stateUpdatedAt,deliveryTxHash:Be.deliveryTxHash??null,failureReason:Be.failureReason??null}))};return Z((X=n==null?void 0:n.taskRuns)==null?void 0:X.recentTasks),Z((ae=n==null?void 0:n.taskRuns)==null?void 0:ae.inFlight),Z((je=n==null?void 0:n.predictionV1)==null?void 0:je.recentTasks),Array.from(K.values()).sort((Oe,Be)=>Be.stateUpdatedAt-Oe.stateUpdatedAt)},[n]),j=s&&n===void 0?"stopped":"running",R="healthy",M=void 0,T=(K,Z,X)=>{t(K),Promise.resolve().then(Z).then(ae=>{Pn.success(K,{description:ae==null?void 0:ae.message,duration:X==null?void 0:X.autoClearMs})}).catch(ae=>{Pn.error(`${K} failed`,{description:ae instanceof Error?ae.message:String(ae),duration:1/0})}).finally(()=>t(null))};return o.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:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-6",children:[d&&o.jsx(pL,{serviceId:_,onRestake:async K=>{const Z=await me.restake(K);if(!Z.ok)throw new Error(Z.error??"Re-stake failed.");await r.invalidateQueries({queryKey:["status"]})}}),o.jsx(BD,{masterAddress:(i==null?void 0:i.master_address)??null,agentAddress:null,safeAddress:((A=a[0])==null?void 0:A.safeAddress)??null,serviceId:c,agentId:((U=a[0])==null?void 0:U.agentId)??null,services:a}),o.jsx(KD,{harnessNames:u}),o.jsx(iL,{joined:E,tasks:S})]}),o.jsxs("aside",{className:"flex flex-col gap-6",children:[o.jsx(GD,{daemonStatus:j,daemonStateMessage:M,rpcStatus:R,onStop:async()=>{if(!(await me.stopDaemon()).ok)throw new Error("Stop request failed.")},onRestart:async()=>{if(!(await me.restartDaemon({forceRespawn:!0})).ok)throw new Error("Restart request failed.")}}),o.jsx(LD,{totalEth:p,runwayDays:f,actionsDisabled:e!==null,perRole:{master:b,agent:w,safe:k},tjinnEarned:x,tjinnEarnedLast24h:y,tjinnState:v,tjinnError:h,lastPasswordRotationAt:((G=n==null?void 0:n.security)==null?void 0:G.lastPasswordRotationAt)??null,onTopUp:()=>T("Top up gas",async()=>{var je;const K=await me.triggerDrip({singleDrip:!0});if(!K.ok)throw new Error(K.reason??"Gas top-up failed.");const Z=K.txHash??((je=K.txHashes)==null?void 0:je.at(-1));if(!Z)return{message:"Gas top-up checked; the faucet sent no funds."};const X=dL(K.deltaWei),ae=hL(Z);return{message:X?`Gas topped up: +${X} · tx ${ae}`:`Gas top-up sent · tx ${ae}`}},{autoClearMs:5e3})})]})]})}const gL=["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"],vL={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:"JINN claim emitted",description:"A JINN earnings claim was emitted locally.",tone:"info"},jinn_claim_ticket_recorded:{label:"JINN ticket recorded",description:"A JINN claim ticket was recorded for later submission.",tone:"info"},jinn_claim_submitted:{label:"JINN claim submitted",description:"A JINN earnings claim was submitted on-chain.",tone:"success"},jinn_claim_canonical_skip:{label:"JINN claim skipped",description:"A JINN 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 _L(e){const t=e.replace(/_/g," ").trim();return t.length===0?"Event":t.charAt(0).toUpperCase()+t.slice(1)}function Au(e){const t=vL[e];return t||{label:_L(e),description:"A daemon lifecycle event.",tone:"neutral"}}function ip(e,t){if(t==="failed")return"destructive";if(t==="warn")return"warning";const r=Au(e).tone;return r==="error"?"destructive":r==="warning"?"warning":r==="success"||r==="reward"?"success":r==="neutral"?"secondary":"default"}const xL=50;function yL(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)}function V_(e,t=8,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}...${e.slice(-r)}`}function bL(e){return e.requestId??e.solverType??"-"}function wL(){const[e]=Ur();return C.useMemo(()=>{var i;const t=e.includes("?")?e.split("?")[1]:"",r=typeof window>"u"?"":window.location.search.replace(/^\?/,""),n=t||r;return((i=new URLSearchParams(n).get("requestId"))==null?void 0:i.trim())||void 0},[e])}function SL({pageSize:e=xL}={}){var d,_;const t=wL(),[r,n]=C.useState([]),[s,i]=C.useState("all"),l=qN({queryKey:["activity-events",r,s,t,e],queryFn:({pageParam:v})=>me.getActivityEvents({kinds:r.length>0?r:void 0,outcome:s==="all"?void 0:s,requestId:t,beforeId:typeof v=="number"?v:void 0,limit:e}),initialPageParam:void 0,getNextPageParam:v=>v.nextCursor??void 0}),a=((d=l.data)==null?void 0:d.pages)??[],c=a.flatMap(v=>v.events),u=((_=a[0])==null?void 0:_.counts)??{};function g(v){n(x=>x.includes(v)?x.filter(y=>y!==v):[...x,v])}return o.jsxs("main",{"data-testid":"events-page",className:"mx-auto flex w-full max-w-6xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:"Events"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"Persistent lifecycle activity from this operator."})]}),o.jsx(oe,{asChild:!0,variant:"secondary",size:"sm",children:o.jsx(ur,{href:"/overview","data-testid":"events-back",children:"Overview"})})]}),t&&o.jsxs(Ze,{variant:"info","data-testid":"events-request-scope",children:[o.jsx(Rt,{children:"Request scoped"}),o.jsxs(Je,{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"break-all",children:["Showing events for ",t]}),o.jsx(oe,{asChild:!0,variant:"link",size:"sm",className:"h-auto p-0",children:o.jsxs(ur,{href:"/events","data-testid":"events-clear-request",children:[o.jsx(kl,{"aria-hidden":"true"}),"Clear"]})})]})]}),o.jsxs(we,{children:[o.jsxs(Zt,{children:[o.jsx(hn,{children:"Filters"}),o.jsx(Qs,{children:"Kind and outcome filters page through the same durable log."})]}),o.jsxs(Qe,{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Kind"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:gL.map(v=>{const x=r.includes(v),y=Au(v);return o.jsxs(oe,{type:"button",size:"sm",variant:x?"outline":"secondary","aria-pressed":x?"true":"false","data-testid":`events-kind-filter-${v}`,onClick:()=>g(v),className:"normal-case tracking-normal",children:[y.label,u[v]!==void 0&&o.jsx(Ce,{variant:"secondary",children:u[v]})]},v)})})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Outcome"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","ok","failed","warn"].map(v=>o.jsx(oe,{type:"button",size:"sm",variant:s===v?"outline":"secondary","aria-pressed":s===v?"true":"false","data-testid":`events-outcome-${v}`,onClick:()=>i(v),children:v},v))})]})]})]}),o.jsxs(we,{"data-testid":"events-list-section",children:[o.jsxs(Zt,{children:[o.jsx(hn,{children:"Event Log"}),o.jsxs(Qs,{children:[c.length," loaded"]})]}),o.jsxs(Qe,{className:"flex flex-col gap-4",children:[l.isLoading&&o.jsxs("div",{"data-testid":"events-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Wf,{className:"animate-spin","aria-hidden":"true"}),"Loading events"]}),l.isError&&o.jsxs(Ze,{variant:"blocking","data-testid":"events-error",children:[o.jsx(Rt,{children:"Events unavailable"}),o.jsxs(Je,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:l.error instanceof Error?l.error.message:"Failed to load events."}),o.jsx(oe,{type:"button",size:"sm",variant:"secondary",onClick:()=>{l.refetch()},children:"Retry"})]})]}),!l.isLoading&&!l.isError&&c.length===0&&o.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&&o.jsx("div",{"data-testid":"events-list",className:"overflow-x-auto",children:o.jsxs(zi,{children:[o.jsx(Ui,{children:o.jsxs(Cr,{className:"hover:bg-transparent",children:[o.jsx(Ve,{children:"Time"}),o.jsx(Ve,{children:"Kind"}),o.jsx(Ve,{children:"Subject"}),o.jsx(Ve,{children:"Outcome"}),o.jsx(Ve,{children:"Tx"}),o.jsx(Ve,{className:"w-8"})]})}),o.jsx(Wi,{children:c.map(v=>{const x=Au(v.kind);return o.jsxs(Cr,{"data-testid":"events-row",children:[o.jsx(qe,{className:"whitespace-nowrap text-muted-foreground",children:yL(v.ts)}),o.jsx(qe,{children:o.jsx(Ce,{variant:ip(v.kind,v.outcome),children:x.label})}),o.jsx(qe,{className:"max-w-[280px] font-mono text-[12px]",children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{className:J(v.requestId&&"cursor-help"),children:v.requestId?V_(v.requestId):bL(v)})}),v.requestId&&o.jsx(Fr,{children:v.requestId})]})}),o.jsx(qe,{children:o.jsx(Ce,{variant:ip(v.kind,v.outcome),children:v.outcome??"-"})}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:v.txHash?V_(v.txHash,6,4):"-"}),o.jsx(qe,{className:"text-right",children:o.jsx(oe,{asChild:!0,variant:"ghost",size:"icon","aria-label":`Inspect event ${v.id}`,children:o.jsx(ur,{href:`/events/${v.id}`,"data-testid":"events-row-link",children:o.jsx(xw,{"aria-hidden":"true"})})})})]},v.id)})})]})}),l.hasNextPage&&o.jsxs(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"events-load-more",disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},className:"self-start",children:[l.isFetchingNextPage&&o.jsx(Wf,{className:"animate-spin","aria-hidden":"true"}),l.isFetchingNextPage?"Loading":"Load more"]})]})]})]})}function CL(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().replace("T"," ").slice(0,19)} UTC`}function kL(e){return e==="base"?"https://basescan.org":"https://sepolia.basescan.org"}function ai({label:e,children:t}){return o.jsxs("div",{className:"grid gap-1 py-2 sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-4",children:[o.jsx("dt",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:e}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:t})]})}function EL(){const t=cd().id??"",{data:r}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap()}),{data:n,isLoading:s,isError:i,error:l,refetch:a}=De({queryKey:["activity-events","detail",t],queryFn:()=>me.getActivityEvent(t),enabled:t.length>0}),c=n?Au(n.kind):null,u=kL(r==null?void 0:r.chain);return o.jsxs("main",{"data-testid":"event-detail",className:"mx-auto flex w-full max-w-4xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:c?c.label:"Event"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:["Event ",t]})]}),o.jsx(oe,{asChild:!0,variant:"secondary",size:"sm",children:o.jsxs(ur,{href:"/events","data-testid":"event-detail-back",children:[o.jsx(jR,{"aria-hidden":"true"}),"Events"]})})]}),s&&o.jsxs("div",{"data-testid":"event-detail-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Wf,{className:"animate-spin","aria-hidden":"true"}),"Loading event"]}),i&&o.jsxs(Ze,{variant:"blocking","data-testid":"event-detail-error",children:[o.jsx(Rt,{children:"Event unavailable"}),o.jsxs(Je,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:(l==null?void 0:l.status)===404?"This event could not be found.":l instanceof Error?l.message:"Failed to load this event."}),o.jsx(oe,{type:"button",size:"sm",variant:"secondary",onClick:()=>{a()},children:"Retry"})]})]}),n&&c&&o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"event-detail-summary",children:[o.jsxs(Zt,{children:[o.jsx(hn,{children:"Summary"}),o.jsx(Qs,{children:c.description})]}),o.jsxs(Qe,{className:"flex flex-wrap gap-2",children:[o.jsx(Ce,{variant:ip(n.kind,n.outcome),children:n.outcome??"-"}),o.jsx(Ce,{variant:"outline",children:CL(n.ts)})]})]}),o.jsxs(we,{"data-testid":"event-detail-payload",children:[o.jsxs(Zt,{children:[o.jsx(hn,{children:"Details"}),o.jsx(Qs,{children:"Raw event fields from the persistent activity log."})]}),o.jsx(Qe,{children:o.jsxs("dl",{className:"m-0",children:[o.jsx(ai,{label:"Event id",children:n.id}),o.jsx(Ye,{}),o.jsx(ai,{label:"Kind",children:n.kind}),o.jsx(Ye,{}),o.jsx(ai,{label:"Request id",children:n.requestId??"-"}),o.jsx(Ye,{}),o.jsx(ai,{label:"Service index",children:n.serviceIndex!==null?n.serviceIndex:"-"}),o.jsx(Ye,{}),o.jsx(ai,{label:"Solver type",children:n.solverType??"-"}),o.jsx(Ye,{}),o.jsx(ai,{label:"Transaction",children:n.txHash?o.jsx(oe,{asChild:!0,variant:"link",size:"sm",className:"h-auto justify-start p-0 font-mono text-[12px] normal-case tracking-normal",children:o.jsxs("a",{"data-testid":"event-detail-tx-link",href:`${u}/tx/${n.txHash}`,target:"_blank",rel:"noreferrer",children:[n.txHash,o.jsx(No,{"aria-hidden":"true"})]})}):"-"}),o.jsx(Ye,{}),o.jsx(ai,{label:"Detail",children:n.detail??"-"})]})})]})]})]})}function xa(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function gi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${q_(t,18,t>=r?4:6)} ETH`:t>=s?`${q_(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function q_(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function K_(e){const t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw new Error("not a non-negative integer");return BigInt(t)}const G_={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 jL(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function NL(e){try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function RL({status:e}){const t=G_[e]??G_.launching;return o.jsx(Ce,{variant:t.variant,className:"whitespace-nowrap",children:t.label})}function PL({label:e}){return o.jsx(Ce,{"data-testid":"launcher-owned-row-role",variant:"outline",className:"normal-case tracking-[0.12em] text-[var(--fg-muted)]",children:e})}function TL({record:e}){const[,t]=Ur(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,s=(n==null?void 0:n.name)??e.solverNetId,i=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return o.jsx("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:l=>{l.preventDefault(),t(r)},className:"block text-inherit no-underline",children:o.jsxs(we,{className:J("grid grid-cols-[1fr_auto] items-center gap-4 p-4","transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer"),children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("div",{"data-testid":"launcher-owned-row-primary",className:J("truncate text-foreground",n!==void 0?"font-serif text-[18px] font-normal tracking-[-0.01em]":"font-mono text-[14px] font-medium"),children:s}),i!==null&&o.jsx("div",{"data-testid":"launcher-owned-row-contract",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:i}),n!==void 0&&o.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:[o.jsxs("span",{children:["solution ",gi(n.solutionPriceWei)]}),o.jsxs("span",{children:["verdict ",gi(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&o.jsx("div",{"data-testid":"launcher-owned-row-roles",className:"flex flex-wrap gap-1.5",children:n.openRoles.map(l=>o.jsx(PL,{label:l},l))}),o.jsxs("div",{className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["cid ",jL(e.manifestCid)]}),o.jsxs("span",{children:["launched ",NL(e.launchedAt)]})]})]}),o.jsx(RL,{status:e.status})]})})}function AL(){return o.jsxs(we,{"data-testid":"launcher-empty-state",className:"flex flex-col gap-3.5 p-8",children:[o.jsx("h2",{className:"m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground",children:"No SolverNets created yet."}),o.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."}),o.jsx("div",{children:o.jsx(oe,{asChild:!0,variant:"default",size:"lg",children:o.jsx(ur,{href:"/launcher/create",children:"Create SolverNet"})})})]})}function DL(){const{data:e,isLoading:t,isError:r,error:n,refetch:s}=De({queryKey:["solvernets","launched","owned"],queryFn:()=>me.solvernets.listLaunched(),refetchInterval:3e4});return o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex items-end justify-between",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal text-foreground",children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&o.jsx(oe,{asChild:!0,variant:"default","data-testid":"launcher-create-cta",children:o.jsx(ur,{href:"/launcher/create",children:"Create SolverNet"})})]}),t&&o.jsx("p",{"data-testid":"launcher-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"}),r&&o.jsxs(Ze,{"data-testid":"launcher-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Rt,{className:"font-mono text-[13px] font-medium text-destructive",children:"Failed to load your SolverNets."}),o.jsx(Je,{className:"text-[12px] text-[var(--fg-muted)]",children:n instanceof Error?n.message:"Unknown error"})]}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm",onClick:()=>{s()},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&o.jsx(AL,{}),!t&&!r&&e&&e.records.length>0&&o.jsx("div",{className:"flex flex-col gap-2",children:e.records.map(i=>o.jsx(TL,{record:i},i.solverNetId))})]})}const pt=C.forwardRef(({className:e,type:t,...r},n)=>o.jsx("input",{type:t,ref:n,className:J("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),...r}));pt.displayName="Input";var LL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ML=LL.reduce((e,t)=>{const r=Mm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),OL="Label",BS=C.forwardRef((e,t)=>o.jsx(ML.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));BS.displayName=OL;var $S=BS;const br=C.forwardRef(({className:e,...t},r)=>o.jsx($S,{ref:r,className:J("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}));br.displayName=$S.displayName;function IL({current:e,total:t=5}){return o.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:[o.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex max-w-[320px] flex-1 gap-1",children:Array.from({length:t}).map((r,n)=>{const s=n+1,i=s<=e;return o.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":i?"true":"false",className:J("h-[3px] flex-1 rounded-sm",i?"bg-accent-sky":"bg-border")},s)})})]})}function Vi({step:e,total:t=5,title:r,blurb:n,children:s,footer:i,error:l}){return o.jsxs("main",{"data-testid":`launcher-create-step-${e}`,className:"mx-auto flex max-w-[720px] flex-col gap-5 p-6",children:[o.jsx(IL,{current:e,total:t}),o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground",children:r}),n&&o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-fg-muted",children:n})]}),l&&o.jsx(Ze,{variant:"blocking","data-testid":"launcher-create-error",className:"font-mono text-[13px]",children:o.jsx(Je,{children:l})}),o.jsx("div",{className:"flex flex-col gap-4",children:s}),o.jsx(Ye,{}),o.jsx("div",{className:"flex items-center justify-between gap-3",children:i})]})}function qi({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:i}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{children:e&&o.jsx(oe,{type:"button",variant:"secondary",size:"lg","data-testid":"launcher-create-back",onClick:e,disabled:s,children:"Back"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[i,t&&o.jsx(oe,{type:"button",size:"lg","data-testid":"launcher-create-next",onClick:t,disabled:n||s,children:r})]})]})}function yt({label:e,helperText:t,error:r,children:n,asLabel:s=!0}){const i=o.jsxs(o.Fragment,{children:[o.jsx(br,{children:e}),n,r?o.jsx("span",{className:"font-mono text-[12px] text-break-red",children:r}):t&&o.jsx("span",{className:"font-mono text-[11px] text-fg-dim",children:t})]});return s?o.jsx("label",{className:"flex flex-col gap-1.5",children:i}):o.jsx("div",{className:"flex flex-col gap-1.5",children:i})}const FL="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 Q_({draft:e,onAdvance:t,busy:r,error:n}){const[s,i]=C.useState(e.name??""),[l,a]=C.useState(e.description??""),[c,u]=C.useState(!1),g=c&&s.trim().length===0?"Name is required.":null,d=c&&l.trim().length===0?"Description is required.":null,_=async v=>{v==null||v.preventDefault(),u(!0),!(s.trim().length===0||l.trim().length===0)&&await t({name:s.trim(),description:l.trim(),completedSteps:xa(e.completedSteps,"define")})};return o.jsx(Vi,{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:n,footer:o.jsx(qi,{onNext:()=>{_()},nextDisabled:s.trim().length===0||l.trim().length===0,busy:r}),children:o.jsxs("form",{onSubmit:v=>{_(v)},className:"flex flex-col gap-4",children:[o.jsx(yt,{label:"Name",error:g,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:o.jsx(pt,{"data-testid":"launcher-create-name",type:"text",value:s,onChange:v=>i(v.target.value),placeholder:"e.g. Polymarket forecasts",className:J(g&&"border-break-red"),disabled:r})}),o.jsx(yt,{label:"Description",error:d,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:o.jsx("textarea",{"data-testid":"launcher-create-description",value:l,onChange:v=>a(v.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",className:J(FL,"min-h-[96px] resize-y",d&&"border-break-red"),disabled:r})}),o.jsx(oe,{type:"submit",className:"hidden","aria-hidden":!0,tabIndex:-1})]})})}const ya={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:30*60},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:6*60*60*1e3,submissionWindowMs:6*60*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:"10000",minVolume24hUsd:"2500",maxYesSpread:"0.10",maxOrderbookAgeSeconds:60}},HS={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:60*60},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,N_max_postings_per_task:10,posting_window_ms:24*60*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:60*60}},op={"prediction.v1":ya,"swe-rebench-v2.v1":HS},BL="prediction.v1",$L="font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim";function HL({draft:e,template:t=ya,onAdvance:r,onBack:n,busy:s,error:i}){const l=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:xa(e.completedSteps,"reviewContract")})};return o.jsx(Vi,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:i,footer:o.jsx(qi,{onBack:n,onNext:l,busy:s}),children:o.jsx(we,{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,children:o.jsxs(Qe,{className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:$L,children:[t.id,".",t.version]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:t.name}),o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:t.description})]}),o.jsxs(Da,{title:"Schemas",children:[o.jsx(tr,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),o.jsx(tr,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),o.jsx(tr,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),o.jsxs(Da,{title:"Evaluation function",children:[o.jsx(tr,{label:"Id",value:t.evaluationFunction.id,mono:!0}),o.jsx(tr,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),o.jsx(tr,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),o.jsx(tr,{label:"Output",value:t.evaluationFunction.output})]}),o.jsxs(Da,{title:"Aggregation function",children:[o.jsx(tr,{label:"Id",value:t.aggregationFunction.id,mono:!0}),o.jsx(tr,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),o.jsx(tr,{label:"Output",value:t.aggregationFunction.output})]}),o.jsxs(Da,{title:"Claim policy defaults",children:[o.jsx(tr,{label:"Mode",value:t.claimPolicyDefaults.mode}),o.jsx(tr,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),o.jsx(tr,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),o.jsx(tr,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),o.jsxs(Da,{title:"Credential requirements",children:[o.jsx(gh,{role:"creator",creds:t.credentialRequirements.creator}),o.jsx(gh,{role:"solver",creds:t.credentialRequirements.solver}),o.jsx(gh,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})})}function Da({title:e,children:t}){return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx(Ye,{}),o.jsx("h3",{className:J("m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted"),children:e}),o.jsx("div",{className:"flex flex-col gap-1.5",children:t})]})}function tr({label:e,value:t,hint:r,mono:n}){return o.jsxs("div",{className:"grid grid-cols-[140px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:J("text-[13px] text-foreground",n?"font-mono":"font-sans"),children:t}),r&&o.jsx("span",{className:"font-mono text-[12px] leading-relaxed text-fg-muted",children:r})]})]})}function gh({role:e,creds:t}){return o.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim",children:e}),t.length===0?o.jsx("div",{className:"text-[12px] text-fg-muted",children:"None."}):t.map(r=>o.jsxs("div",{className:"flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-accent-sky",children:r.id}),o.jsx(Ce,{variant:"secondary",children:r.kind}),r.required&&o.jsx(Ce,{variant:"warning",children:"required"})]}),o.jsx("div",{className:"text-fg-muted",children:r.description})]},r.id))]})}const Y_="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 zL(e){const t=e.template??ya;switch(t.id){case"prediction":return o.jsx(WL,{...e,template:t});case"swe-rebench-v2":return o.jsx(qL,{...e,template:t});default:return o.jsx(Vi,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:o.jsx(qi,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:o.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const Z_=6e4;function Tr(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function X_(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function UL(e){const t=ya.generatorDefaults,r=60*60*1e3;return{cadenceMs:Tr(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:Tr((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:Tr(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:Tr(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Tr(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:Tr(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:X_(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:X_(e==null?void 0:e.blocklistConditionIds)}}function J_(e){const t={},r=Ar(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<Z_&&(t.cadenceMs=`Cadence must be at least ${Z_/1e3}s.`);const n=Ar(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=Ar(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const i=Ar(e.maxNewRoundsPerPoll);i===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const l=Ar(e.maxNewRoundsPerDay);l===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const a=Ar(e.maxOpenRounds);return a===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:i,maxNewRoundsPerDay:l,maxOpenRounds:a,allowlistConditionIds:ex(e.allowlistConditionIds),blocklistConditionIds:ex(e.blocklistConditionIds)}}}function Ar(e){const t=e.trim();if(t.length===0||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function ex(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function WL({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>UL(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),g=c?J_(l):{ok:!0,errors:{}},d=c?g.errors:{},_=()=>{u(!0);const x=J_(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:xa(e.completedSteps,"configureGenerator")})},v=(x,y)=>{a(h=>({...h,[x]:y}))};return o.jsxs(Vi,{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:s,footer:o.jsx(qi,{onBack:r,onNext:_,busy:n,nextDisabled:c&&!g.ok}),children:[o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(yt,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:d.cadenceMs??null,children:o.jsx(pt,{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:l.cadenceMs,onChange:x=>v("cadenceMs",x.target.value),className:J(d.cadenceMs&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:d.windowMs??null,children:o.jsx(pt,{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:l.windowMs,onChange:x=>v("windowMs",x.target.value),className:J(d.windowMs&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:d.resolveGapMs??null,children:o.jsx(pt,{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:l.resolveGapMs,onChange:x=>v("resolveGapMs",x.target.value),className:J(d.resolveGapMs&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:d.maxNewRoundsPerPoll??null,children:o.jsx(pt,{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerPoll,onChange:x=>v("maxNewRoundsPerPoll",x.target.value),className:J(d.maxNewRoundsPerPoll&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:d.maxNewRoundsPerDay??null,children:o.jsx(pt,{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerDay,onChange:x=>v("maxNewRoundsPerDay",x.target.value),className:J(d.maxNewRoundsPerDay&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:d.maxOpenRounds??null,children:o.jsx(pt,{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:l.maxOpenRounds,onChange:x=>v("maxOpenRounds",x.target.value),className:J(d.maxOpenRounds&&"border-break-red"),disabled:n})})]}),o.jsx(yt,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:o.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:l.allowlistConditionIds,onChange:x=>v("allowlistConditionIds",x.target.value),rows:2,placeholder:"0xabc…, 0xdef…",className:Y_,disabled:n})}),o.jsx(yt,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:o.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:l.blocklistConditionIds,onChange:x=>v("blocklistConditionIds",x.target.value),rows:2,placeholder:"0xabc…",className:Y_,disabled:n})})]})}function VL(e){const t=HS.generatorDefaults,r=typeof(e==null?void 0:e.claimPolicy)=="object"&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:Tr(e==null?void 0:e.N_target_successes,t.N_target_successes),N_max_postings_per_task:Tr(e==null?void 0:e.N_max_postings_per_task,t.N_max_postings_per_task),posting_window_ms:Tr(e==null?void 0:e.posting_window_ms,t.posting_window_ms),post_batch_size:Tr(e==null?void 0:e.post_batch_size,t.post_batch_size),maxClaimsPerOperator:Tr((e==null?void 0:e.maxClaimsPerOperator)??r.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:Tr((e==null?void 0:e.claimLeaseTtlSeconds)??r.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function tx(e){const t={},r=Ar(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=Ar(e.N_max_postings_per_task);n===null?t.N_max_postings_per_task="Must be a positive integer.":r!==null&&n<r&&(t.N_max_postings_per_task="Max postings must be ≥ target successes — otherwise saturation is unreachable.");const s=Ar(e.posting_window_ms);s===null&&(t.posting_window_ms="Must be a positive integer (ms).");const i=Ar(e.post_batch_size);i===null&&(t.post_batch_size="Must be a positive integer.");const l=Ar(e.maxClaimsPerOperator);l===null&&(t.maxClaimsPerOperator="Must be a positive integer.");const a=Ar(e.claimLeaseTtlSeconds);return a===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:r,N_max_postings_per_task:n,posting_window_ms:s,post_batch_size:i,maxClaimsPerOperator:l,claimLeaseTtlSeconds:a}}}function qL({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>VL(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),g=c?tx(l):{ok:!0,errors:{}},d=c?g.errors:{},_=()=>{u(!0);const x=tx(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:xa(e.completedSteps,"configureGenerator")})},v=(x,y)=>{a(h=>({...h,[x]:y}))};return o.jsx(Vi,{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:s,footer:o.jsx(qi,{onBack:r,onNext:_,busy:n,nextDisabled:c&&!g.ok}),children:o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(yt,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:d.N_target_successes??null,children:o.jsx(pt,{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:l.N_target_successes,onChange:x=>v("N_target_successes",x.target.value),className:J(d.N_target_successes&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Max Task postings per instance",helperText:"Hard ceiling on Task postings to bound spend on impossible SWE instances.",error:d.N_max_postings_per_task??null,children:o.jsx(pt,{"data-testid":"launcher-create-N_max_postings_per_task",type:"text",inputMode:"numeric",value:l.N_max_postings_per_task,onChange:x=>v("N_max_postings_per_task",x.target.value),className:J(d.N_max_postings_per_task&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Posting window (ms)",helperText:"A posting stays live for this long; expired unsaturated instances can be reposted.",error:d.posting_window_ms??null,children:o.jsx(pt,{"data-testid":"launcher-create-posting_window_ms",type:"text",inputMode:"numeric",value:l.posting_window_ms,onChange:x=>v("posting_window_ms",x.target.value),className:J(d.posting_window_ms&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Post batch size",helperText:"Maximum number of SWE instances to post in one creator tick.",error:d.post_batch_size??null,children:o.jsx(pt,{"data-testid":"launcher-create-post_batch_size",type:"text",inputMode:"numeric",value:l.post_batch_size,onChange:x=>v("post_batch_size",x.target.value),className:J(d.post_batch_size&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Max claims per operator",helperText:"Optional cap; each posting is still limited by remaining target successes.",error:d.maxClaimsPerOperator??null,children:o.jsx(pt,{"data-testid":"launcher-create-maxClaimsPerOperator",type:"text",inputMode:"numeric",value:l.maxClaimsPerOperator,onChange:x=>v("maxClaimsPerOperator",x.target.value),className:J(d.maxClaimsPerOperator&&"border-break-red"),disabled:n})}),o.jsx(yt,{label:"Claim lease (seconds)",helperText:"How long a claimed SWE task slot stays leased.",error:d.claimLeaseTtlSeconds??null,children:o.jsx(pt,{"data-testid":"launcher-create-claimLeaseTtlSeconds",type:"text",inputMode:"numeric",value:l.claimLeaseTtlSeconds,onChange:x=>v("claimLeaseTtlSeconds",x.target.value),className:J(d.claimLeaseTtlSeconds&&"border-break-red"),disabled:n})})]})})}function KL(e,t){const r={};let n,s;try{n=K_(e),n===null?r.solutionPriceWei="Required.":n<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",n=null}try{s=K_(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return n!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:s??void 0}}function GL(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const i=t+r*BigInt(n);return i<=0n?null:{tasks:Number(s/i),perTaskWei:i}}function QL({draft:e,template:t=ya,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:i,busy:l,error:a}){var m,b;const[c,u]=C.useState(e.solutionPriceWei??""),[g,d]=C.useState(e.verdictPriceWei??""),[_,v]=C.useState(!1),x=C.useMemo(()=>KL(c,g),[c,g]),y=t.claimPolicyDefaults.maxClaimsPerOperator,h=C.useMemo(()=>GL(i??null,x.solutionWei,x.verdictWei,y),[i,x.solutionWei,x.verdictWei,y]),p=()=>{v(!0),x.ok&&r({solutionPriceWei:c,verdictPriceWei:g,completedSteps:xa(e.completedSteps,"configurePricing")})},f=_?x.errors:{};return o.jsxs(Vi,{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:a,footer:o.jsx(qi,{onBack:n,onNext:p,busy:l,nextDisabled:_&&!x.ok}),children:[o.jsx(yt,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",asLabel:!1,children:o.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:s??"— (master Safe will be picked at launch)"})}),o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(yt,{label:"Solution price (wei)",helperText:`≈ ${gi((m=x.solutionWei)==null?void 0:m.toString())}`,error:f.solutionPriceWei??null,children:o.jsx(pt,{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:c,onChange:w=>u(w.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",className:J(f.solutionPriceWei&&"border-break-red"),disabled:l})}),o.jsx(yt,{label:"Verdict price (wei)",helperText:`≈ ${gi((b=x.verdictWei)==null?void 0:b.toString())}`,error:f.verdictPriceWei??null,children:o.jsx(pt,{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:g,onChange:w=>d(w.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",className:J(f.verdictPriceWei&&"border-break-red"),disabled:l})})]}),f.combined&&o.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",className:"font-mono text-[12px] text-break-red",children:f.combined}),o.jsx(we,{"data-testid":"launcher-create-projection",children:o.jsxs(Qe,{className:"flex flex-col gap-2.5 p-5",children:[o.jsx("h3",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted",children:"Runway projection"}),o.jsx(Ye,{}),o.jsx(vh,{label:"Safe balance",value:i?`${gi(i)} (${i} wei)`:"—"}),o.jsx(vh,{label:"Per-Task cost",value:h?`${gi(h.perTaskWei.toString())} (${h.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${y})`}),o.jsx(vh,{label:"Projected Tasks",value:h?`~${h.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})})]})}function vh({label:e,value:t,hint:r,testId:n}){return o.jsxs("div",{"data-testid":n,className:"grid grid-cols-[160px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t}),r&&o.jsx("span",{className:"text-[12px] text-fg-muted",children:r})]})]})}const YL=1500,rx=["pinning","recording","broadcasting","confirming","spawning"],ZL={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function XL({draft:e,template:t=ya,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:i,pollIntervalMs:l=YL}){const[,a]=Ur(),c=i??a,u=C.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[g,d]=C.useState(u),[_,v]=C.useState({kind:"idle"}),x=C.useRef(!1);C.useEffect(()=>()=>{x.current=!0},[]);const y=m=>{d(b=>b.includes(m)?b.filter(w=>w!==m):[...b,m])},h=async()=>{var m,b,w;if(g.length!==0){v(k=>k.kind==="failed"?{kind:"idle"}:k),x.current=!1;try{await r({openRoles:g,completedSteps:xa(e.completedSteps,"configurePricing")});const k=await me.solvernets.launch(e.draftId);if(x.current)return;let E="pinning";for(v({kind:"launching",phase:E,solverNetId:k.solverNetId});;){if(x.current)return;let S;try{S=await me.solvernets.get(k.solverNetId)}catch{if(x.current)return;await ox(l);continue}if((m=S.launchProgress)!=null&&m.phase&&(E=S.launchProgress.phase),S.status==="launched"){v({kind:"launching",phase:"spawning",solverNetId:k.solverNetId}),c(`/launcher/launched/${encodeURIComponent(k.solverNetId)}`);return}if(S.status==="failed"){const j=((w=(b=S.launchProgress)==null?void 0:b.txError)==null?void 0:w.message)??`Launch failed during ${E}.`;v({kind:"failed",message:j,solverNetId:k.solverNetId}),s==null||s();return}v({kind:"launching",phase:E,solverNetId:k.solverNetId}),await ox(l)}}catch(k){if(x.current)return;v({kind:"failed",message:k instanceof Error?k.message:String(k)}),s==null||s()}}},p=_.kind==="launching",f=g.length===0||p;return o.jsxs(Vi,{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:o.jsx(qi,{onBack:n,onNext:()=>{h()},nextLabel:p?"Launching…":"Launch",nextDisabled:f,busy:p,right:p&&o.jsx(JL,{current:_.kind==="launching"?_.phase:"pinning"})}),children:[o.jsx(eM,{draft:e,template:t}),o.jsxs(yt,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",asLabel:!1,children:[o.jsxs("div",{"data-testid":"launcher-create-openRoles",className:"flex flex-col gap-2.5",children:[o.jsx(ix,{role:"solver",checked:g.includes("solver"),onChange:()=>y("solver"),disabled:p}),o.jsx(ix,{role:"evaluator",checked:g.includes("evaluator"),onChange:()=>y("evaluator"),disabled:p})]}),g.length===0&&o.jsx("span",{"data-testid":"launcher-create-openRoles-error",className:"font-mono text-[12px] text-break-red",children:"At least one role must be open."})]}),_.kind==="failed"&&o.jsxs(Ze,{variant:"blocking","data-testid":"launcher-create-launch-failure",children:[o.jsx(Rt,{className:"font-mono text-[13px] font-medium text-break-red",children:"Launch failed."}),o.jsx(Je,{className:"font-mono text-[12px] text-fg-muted",children:_.message}),o.jsxs("div",{className:"mt-2.5 flex gap-2",children:[o.jsx(oe,{type:"button",size:"sm","data-testid":"launcher-create-launch-retry",onClick:()=>{h()},children:"Retry"}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-create-launch-abandon",onClick:()=>{c("/launcher")},children:"Abandon"})]})]})]})}function JL({current:e}){const t=rx.indexOf(e);return o.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:[o.jsx("span",{"data-testid":"launcher-create-launch-phase",children:ZL[e]}),o.jsx("div",{className:"flex gap-[3px]",children:rx.map((r,n)=>o.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",className:J("h-[3px] w-2 rounded-sm",n<=t?"bg-accent-sky":"bg-border")},r))})]})}function eM({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return o.jsx(we,{"data-testid":"launcher-create-manifest-summary",children:o.jsxs(Qe,{className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim",children:[n,".",s]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:e.name??"— unnamed"}),e.description&&o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:e.description})]}),o.jsx(Ye,{}),o.jsxs(nM,{children:[o.jsx(sn,{label:"Solution price",value:nx(e.solutionPriceWei)}),o.jsx(sn,{label:"Verdict price",value:nx(e.verdictPriceWei)}),t.id==="prediction"?o.jsx(tM,{generator:r}):o.jsx(rM,{generator:r})]})]})})}function tM({generator:e}){const t=vi(e.cadenceMs),r=vi(e.windowMs??e.submissionWindowMs),n=vi(e.maxOpenRounds);return o.jsxs(o.Fragment,{children:[o.jsx(sn,{label:"Cadence",value:t?`${t} ms`:"—"}),o.jsx(sn,{label:"Window",value:r?`${r} ms`:"—"}),o.jsx(sn,{label:"Max open rounds",value:n??"—"}),o.jsx(sn,{label:"Allowlist",value:sx(e.allowlistConditionIds)}),o.jsx(sn,{label:"Blocklist",value:sx(e.blocklistConditionIds)})]})}function rM({generator:e}){const t=vi(e.N_target_successes),r=vi(e.N_max_postings_per_task),n=vi(e.posting_window_ms),s=vi(e.post_batch_size);return o.jsxs(o.Fragment,{children:[o.jsx(sn,{label:"Target successes",value:t??"—"}),o.jsx(sn,{label:"Max postings / Task",value:r??"—"}),o.jsx(sn,{label:"Posting window",value:n?`${n} ms`:"—"}),o.jsx(sn,{label:"Batch size",value:s??"—"})]})}function nx(e){return e?`${e} wei (${gi(e)})`:"—"}function vi(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function sx(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function nM({children:e}){return o.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2",children:e})}function sn({label:e,value:t}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim",children:e}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t})]})}function ix({role:e,checked:t,onChange:r,disabled:n}){return o.jsxs("label",{className:J("flex items-center gap-2.5",n?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[o.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n,className:"h-4 w-4 cursor-pointer accent-accent-sky"}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:e})]})}function ox(e){return new Promise(t=>setTimeout(t,e))}const ap="jinn.launcher-create.draftId.v1";function sM(){if(typeof window>"u")return null;try{return window.localStorage.getItem(ap)}catch{return null}}function ax(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(ap):window.localStorage.setItem(ap,e)}catch{}}function iM(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function oM({templateKey:e}={}){var k;const t=e??iM()??BL,r=C.useMemo(()=>op[t]??null,[t]),[n,s]=C.useState(null),[i,l]=C.useState(null),[a,c]=C.useState(1),[u,g]=C.useState(!1),[d,_]=C.useState(null),v=C.useRef(!1),{data:x}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:3e4}),{data:y}=De({queryKey:["status"],queryFn:()=>me.getStatus(),refetchInterval:3e4}),h=(x==null?void 0:x.master_address)??(y==null?void 0:y.master_address)??null,p=((k=y==null?void 0:y.masterGas)==null?void 0:k.balanceWei)??null;C.useEffect(()=>{if(v.current)return;v.current=!0;let E=!1;return(async()=>{const j=sM();if(j)try{const R=await me.solvernets.getDraft(j);if(E)return;s(R);return}catch{ax(null)}try{const R=await me.solvernets.createDraft();if(E)return;ax(R.draftId),s(R)}catch(R){if(E)return;l(R instanceof Error?R.message:"Failed to create draft.")}})(),()=>{E=!0}},[]);const f=async E=>{if(n){g(!0),_(null);try{const S=await me.solvernets.updateDraft(n.draftId,E);s(S),c(j=>j<5?j+1:j)}catch(S){_(S instanceof Error?S.message:String(S))}finally{g(!1)}}},m=async E=>{if(n){g(!0),_(null);try{const S=await me.solvernets.updateDraft(n.draftId,E);s(S)}catch(S){_(S instanceof Error?S.message:String(S))}finally{g(!1)}}},b=()=>{_(null),c(E=>E>1?E-1:E)},w=()=>{_(null)};if(r===null)return o.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:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Unknown SolverNet template"}),o.jsx(Ze,{variant:"blocking",children:o.jsxs(Je,{className:"font-mono text-[13px]",children:["No template registered for ",o.jsx("code",{children:t}),". Available keys:"," ",Object.keys(op).map(E=>`?template=${E}`).join(", "),"."]})})]});if(i)return o.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Couldn't start a new draft"}),o.jsxs(Ze,{variant:"blocking",children:[o.jsx(Rt,{className:"font-mono text-[12px]",children:"Bootstrap error"}),o.jsx(Je,{className:"font-mono text-[13px]",children:i})]})]});if(!n)return o.jsx("main",{"data-testid":"launcher-create-loading",className:"p-6 font-mono text-[13px] text-fg-muted",children:"Loading draft…"});switch(a){case 1:return o.jsx(Q_,{draft:n,onAdvance:f,busy:u,error:d});case 2:return o.jsx(HL,{draft:n,template:r,onAdvance:f,onBack:b,busy:u,error:d});case 3:return o.jsx(zL,{draft:n,template:r,onAdvance:f,onBack:b,busy:u,error:d});case 4:return o.jsx(QL,{draft:n,template:r,onAdvance:f,onBack:b,fundingSafeAddress:h,fundingSafeBalanceWei:p??null,busy:u,error:d});case 5:return o.jsx(XL,{draft:n,template:r,onUpdateDraft:m,onBack:b,onLaunchFailure:w});default:return o.jsx(Q_,{draft:n,onAdvance:f,busy:u,error:d})}}function zS(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function US(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function wd(e){if(!e)return"—";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}const aM={launched:["paused","retired"],paused:["launched","retired"]};function lx(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function Ds(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${lx(t,18,t>=r?4:6)} ETH`:t>=s?`${lx(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function lM(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let n;try{n=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(n/s),perTaskWei:s}}const cx=6e4;function cM(e){const t=e??{};return{cadenceMs:Dr(t.cadenceMs),windowMs:Dr(t.windowMs??t.submissionWindowMs),resolveGapMs:Dr(t.resolveGapMs),maxNewRoundsPerPoll:Dr(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Dr(t.maxNewRoundsPerDay),maxOpenRounds:Dr(t.maxOpenRounds),allowlistConditionIds:ux(t.allowlistConditionIds),blocklistConditionIds:ux(t.blocklistConditionIds)}}function uM(e,t){const r=e??{},n=dM(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:Dr(r.N_target_successes),N_max_postings_per_task:Dr(r.N_max_postings_per_task),posting_window_ms:Dr(r.posting_window_ms),post_batch_size:Dr(r.post_batch_size),maxClaimsPerOperator:Dr(r.maxClaimsPerOperator??n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:Dr(r.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function dM(e){return typeof e=="object"&&e!==null?e:{}}function Dr(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function ux(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function Qc(e){const t=e.trim();if(!t||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function hM(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function fM(e,t){const r={},n={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=Qc(e[s]);if(i===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&i<cx){r[s]=`Cadence must be at least ${cx/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=i:n[s]=i}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=hM(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function pM(e,t){const r={},n={},s=Qc(e.N_target_successes),i=Qc(e.N_max_postings_per_task);for(const l of["N_target_successes","N_max_postings_per_task","posting_window_ms","post_batch_size","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[l]===t[l]||e[l].trim().length===0)continue;const a=Qc(e[l]);if(a===null){r[l]=l==="posting_window_ms"?"Must be a positive integer (ms).":l==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}n[l]=a}return s!==null&&i!==null&&i<s&&(r.N_max_postings_per_task="Max postings must be >= target successes."),{ok:Object.keys(r).length===0,patch:n,errors:r}}function mM(e,t){var n;if(t)return t.id==="swe-rebench-v2"&&t.version==="v1";if(((n=e.summary)==null?void 0:n.contractId)==="swe-rebench-v2"&&e.summary.contractVersion==="v1")return!0;const r=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(r,"N_target_successes")||Object.prototype.hasOwnProperty.call(r,"N_max_postings_per_task")||Object.prototype.hasOwnProperty.call(r,"posting_window_ms")||Object.prototype.hasOwnProperty.call(r,"cooldown_ms")}function gM({record:e,manifest:t,template:r,onSave:n}){return mM(e,r)?o.jsx(_M,{record:e,manifest:t,onSave:n}):o.jsx(vM,{record:e,onSave:n})}function WS({record:e,configExpanded:t,setConfigExpanded:r,children:n}){var s,i;return o.jsxs(we,{"data-testid":"launcher-launched-generator-panel",role:"region","aria-label":"Generator",className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Generator"}),o.jsx(SM,{record:e})]}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-generator-toggle","aria-expanded":t,"aria-controls":"launcher-launched-generator-config",onClick:()=>r(l=>!l),children:t?"Hide config":"Edit config"})]}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Bn,{label:"Last poll",value:wd((s=e.generatorState)==null?void 0:s.lastPollAt),testid:"launcher-launched-generator-last-poll"}),o.jsx(Bn,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),o.jsx(xM,{record:e}),o.jsx(wM,{record:e}),((i=e.generatorState)==null?void 0:i.lastError)&&o.jsx(bM,{record:e}),n]})}function vM({record:e,onSave:t}){const r=C.useMemo(()=>cM(e.generatorConfig),[e.generatorConfig]),[n,s]=C.useState(r),[i,l]=C.useState({kind:"idle"}),[a,c]=C.useState(!1);C.useEffect(()=>{s(y=>JSON.stringify(y)!==JSON.stringify(x())?y:r);function x(){return r}},[JSON.stringify(e.generatorConfig)]);const u=(x,y)=>{s(h=>({...h,[x]:y}))},g=C.useMemo(()=>fM(n,r),[n,r]),d=Object.keys(g.patch).length>0,_=i.kind==="saving",v=async()=>{if(!(!g.ok||!d||_)){l({kind:"saving"});try{await t(g.patch),l({kind:"saved",at:new Date})}catch(x){l({kind:"error",message:x instanceof Error?x.message:String(x)})}}};return o.jsx(WS,{record:e,configExpanded:a,setConfigExpanded:c,children:a&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Ye,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Lr,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:x=>u("cadenceMs",x),error:g.errors.cadenceMs,disabled:_}),o.jsx(Lr,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:x=>u("windowMs",x),error:g.errors.windowMs,disabled:_}),o.jsx(Lr,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:x=>u("resolveGapMs",x),error:g.errors.resolveGapMs,disabled:_}),o.jsx(Lr,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:x=>u("maxNewRoundsPerPoll",x),error:g.errors.maxNewRoundsPerPoll,disabled:_}),o.jsx(Lr,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:x=>u("maxNewRoundsPerDay",x),error:g.errors.maxNewRoundsPerDay,disabled:_}),o.jsx(Lr,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:x=>u("maxOpenRounds",x),error:g.errors.maxOpenRounds,disabled:_})]}),o.jsx(dx,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:x=>u("allowlistConditionIds",x),disabled:_}),o.jsx(dx,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:x=>u("blocklistConditionIds",x),disabled:_}),o.jsx(VS,{dirty:d,saving:_,validationOk:g.ok,saveStatus:i,onSubmit:v})]})})}function _M({record:e,manifest:t,onSave:r}){const n=C.useMemo(()=>uM(e.generatorConfig,t),[e.generatorConfig,t]),[s,i]=C.useState(n),[l,a]=C.useState({kind:"idle"}),[c,u]=C.useState(!1);C.useEffect(()=>{i(y=>JSON.stringify(y)!==JSON.stringify(n)?y:n)},[JSON.stringify(e.generatorConfig)]);const g=(y,h)=>{i(p=>({...p,[y]:h}))},d=C.useMemo(()=>pM(s,n),[s,n]),_=Object.keys(d.patch).length>0,v=l.kind==="saving",x=async()=>{if(!(!d.ok||!_||v)){a({kind:"saving"});try{await r(d.patch),a({kind:"saved",at:new Date})}catch(y){a({kind:"error",message:y instanceof Error?y.message:String(y)})}}};return o.jsx(WS,{record:e,configExpanded:c,setConfigExpanded:u,children:c&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Ye,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Lr,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:y=>g("N_target_successes",y),error:d.errors.N_target_successes,disabled:v}),o.jsx(Lr,{label:"Max Task postings per instance",testid:"launcher-launched-generator-N_max_postings_per_task",value:s.N_max_postings_per_task,onChange:y=>g("N_max_postings_per_task",y),error:d.errors.N_max_postings_per_task,disabled:v}),o.jsx(Lr,{label:"Posting window (ms)",testid:"launcher-launched-generator-posting_window_ms",value:s.posting_window_ms,onChange:y=>g("posting_window_ms",y),error:d.errors.posting_window_ms,disabled:v}),o.jsx(Lr,{label:"Post batch size",testid:"launcher-launched-generator-post_batch_size",value:s.post_batch_size,onChange:y=>g("post_batch_size",y),error:d.errors.post_batch_size,disabled:v})]}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Claim policy"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Lr,{label:"Max claims per operator",testid:"launcher-launched-generator-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:y=>g("maxClaimsPerOperator",y),error:d.errors.maxClaimsPerOperator,disabled:v}),o.jsx(Lr,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:y=>g("claimLeaseTtlSeconds",y),error:d.errors.claimLeaseTtlSeconds,disabled:v})]}),o.jsx(VS,{dirty:_,saving:v,validationOk:d.ok,saveStatus:l,onSubmit:x})]})})}function VS({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const i=e&&r&&!t;return o.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[o.jsx(Ye,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[o.jsx(CM,{status:n}),o.jsx(oe,{type:"button",variant:"default","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!i,children:t?"Saving…":"Save"})]})]})}function xM({record:e}){var r;const t=(r=e.generatorState)==null?void 0:r.lastPollSummary;return yM(t)?o.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:[o.jsx(Bn,{label:"Pool",value:String(t.poolSize),testid:"launcher-launched-generator-poolSize"}),o.jsx(Bn,{label:"Posted",value:String(t.posted),testid:"launcher-launched-generator-posted"}),o.jsx(Bn,{label:"Unposted",value:String(t.unposted),testid:"launcher-launched-generator-unposted"}),o.jsx(Bn,{label:"Live",value:String(t.live),testid:"launcher-launched-generator-live"}),o.jsx(Bn,{label:"Repostable",value:String(t.repostable),testid:"launcher-launched-generator-repostable"}),o.jsx(Bn,{label:"Saturated",value:String(t.saturated),testid:"launcher-launched-generator-saturated"}),o.jsx(Bn,{label:"Abandoned",value:String(t.abandoned),testid:"launcher-launched-generator-abandoned"})]}):null}function yM(e){if(typeof e!="object"||e===null)return!1;const t=e;return["poolSize","posted","unposted","live","repostable","saturated","abandoned"].every(r=>typeof t[r]=="number")}function bM({record:e}){var t,r,n,s;return o.jsxs("div",{"data-testid":"launcher-launched-generator-error",className:"flex flex-col gap-1 rounded-md border border-destructive bg-card p-3",children:[o.jsxs("span",{className:"font-mono text-[12px] font-medium text-destructive",children:["Last error · ",wd((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:(s=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:s.message})]})}function wM({record:e}){var i,l,a;const t=(i=e.generatorState)==null?void 0:i.poolPublicationUpdatedAt;if(!t)return null;const r=(l=e.generatorState)==null?void 0:l.poolPublicationPriorSize,n=(a=e.generatorState)==null?void 0:a.poolPublicationCurrentSize,s=typeof r=="number"&&typeof n=="number"?`Pool grew from ${r} → ${n} scorable tasks`:"Pool re-published";return o.jsxs(Ze,{"data-testid":"launcher-launched-generator-pool-republished",variant:"default",children:[o.jsx(Rt,{children:"Vetted pool re-published"}),o.jsxs(Je,{children:[s," · ",wd(t)]})]})}function SM({record:e}){var s;const t=e.generatorEnabled,n=!!((s=e.generatorState)!=null&&s.lastError)?{variant:"destructive",label:"Errored"}:t?{variant:"success",label:"Enabled"}:{variant:"outline",label:"Disabled"};return o.jsx(Ce,{"data-testid":"launcher-launched-generator-state-badge",variant:n.variant,children:n.label})}function CM({status:e}){if(e.kind==="saving")return o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--vow-green)]",children:["Saved at ",t," UTC"]})}return e.kind==="error"?o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-destructive",children:["Save failed: ",e.message]}):o.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 Lr({label:e,testid:t,value:r,onChange:n,error:s,disabled:i}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(br,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx(pt,{id:t,"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:l=>n(l.target.value),disabled:i,className:J(s&&"border-destructive")}),s&&o.jsx("span",{"data-testid":`${t}-error`,className:"font-mono text-[11px] text-destructive",children:s})]})}function dx({label:e,testid:t,value:r,onChange:n,disabled:s}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(br,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("textarea",{id:t,"data-testid":t,value:r,onChange:i=>n(i.target.value),disabled:s,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 Bn({label:e,value:t,testid:r}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("dd",{"data-testid":r,className:"m-0 font-mono text-[13px] text-foreground",children:t})]})}var _h="focusScope.autoFocusOnMount",xh="focusScope.autoFocusOnUnmount",hx={bubbles:!1,cancelable:!0},kM="FocusScope",Sd=C.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[a,c]=C.useState(null),u=zt(s),g=zt(i),d=C.useRef(null),_=He(t,y=>c(y)),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let y=function(m){if(v.paused||!a)return;const b=m.target;a.contains(b)?d.current=b:ms(d.current,{select:!0})},h=function(m){if(v.paused||!a)return;const b=m.relatedTarget;b!==null&&(a.contains(b)||ms(d.current,{select:!0}))},p=function(m){if(document.activeElement===document.body)for(const w of m)w.removedNodes.length>0&&ms(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",h);const f=new MutationObserver(p);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",h),f.disconnect()}}},[n,a,v.paused]),C.useEffect(()=>{if(a){px.add(v);const y=document.activeElement;if(!a.contains(y)){const p=new CustomEvent(_h,hx);a.addEventListener(_h,u),a.dispatchEvent(p),p.defaultPrevented||(EM(TM(qS(a)),{select:!0}),document.activeElement===y&&ms(a))}return()=>{a.removeEventListener(_h,u),setTimeout(()=>{const p=new CustomEvent(xh,hx);a.addEventListener(xh,g),a.dispatchEvent(p),p.defaultPrevented||ms(y??document.body,{select:!0}),a.removeEventListener(xh,g),px.remove(v)},0)}}},[a,u,g,v]);const x=C.useCallback(y=>{if(!r&&!n||v.paused)return;const h=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(h&&p){const f=y.currentTarget,[m,b]=jM(f);m&&b?!y.shiftKey&&p===b?(y.preventDefault(),r&&ms(m,{select:!0})):y.shiftKey&&p===m&&(y.preventDefault(),r&&ms(b,{select:!0})):p===f&&y.preventDefault()}},[r,n,v.paused]);return o.jsx(ze.div,{tabIndex:-1,...l,ref:_,onKeyDown:x})});Sd.displayName=kM;function EM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ms(n,{select:t}),document.activeElement!==r)return}function jM(e){const t=qS(e),r=fx(t,e),n=fx(t.reverse(),e);return[r,n]}function qS(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function fx(e,t){for(const r of e)if(!NM(r,{upTo:t}))return r}function NM(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 RM(e){return e instanceof HTMLInputElement&&"select"in e}function ms(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&RM(e)&&t&&e.select()}}var px=PM();function PM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=mx(e,t),e.unshift(t)},remove(t){var r;e=mx(e,t),(r=e[0])==null||r.resume()}}}function mx(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function TM(e){return e.filter(t=>t.tagName!=="A")}var yh=0;function ag(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gx()),document.body.insertAdjacentElement("beforeend",e[1]??gx()),yh++,()=>{yh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yh--}},[])}function gx(){const 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 Cn=function(){return Cn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Cn.apply(this,arguments)};function KS(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function AM(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Yc="right-scroll-bar-position",Zc="width-before-scroll-bar",DM="with-scroll-bars-hidden",LM="--removed-body-scroll-bar-size";function bh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MM(e,t){var r=C.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var OM=typeof window<"u"?C.useLayoutEffect:C.useEffect,vx=new WeakMap;function IM(e,t){var r=MM(null,function(n){return e.forEach(function(s){return bh(s,n)})});return OM(function(){var n=vx.get(r);if(n){var s=new Set(n),i=new Set(e),l=r.current;s.forEach(function(a){i.has(a)||bh(a,null)}),i.forEach(function(a){s.has(a)||bh(a,l)})}vx.set(r,e)},[e]),r}function FM(e){return e}function BM(e,t){t===void 0&&(t=FM);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var l=t(i,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(i),l=r}var c=function(){var g=l;l=[],g.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(g){l.push(g),u()},filter:function(g){return l=l.filter(g),r}}}};return s}function $M(e){e===void 0&&(e={});var t=BM(null);return t.options=Cn({async:!0,ssr:!1},e),t}var GS=function(e){var t=e.sideCar,r=KS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,Cn({},r))};GS.isSideCarExport=!0;function HM(e,t){return e.useMedium(t),GS}var QS=$M(),wh=function(){},Cd=C.forwardRef(function(e,t){var r=C.useRef(null),n=C.useState({onScrollCapture:wh,onWheelCapture:wh,onTouchMoveCapture:wh}),s=n[0],i=n[1],l=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,g=e.enabled,d=e.shards,_=e.sideCar,v=e.noRelative,x=e.noIsolation,y=e.inert,h=e.allowPinchZoom,p=e.as,f=p===void 0?"div":p,m=e.gapMode,b=KS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=_,k=IM([r,t]),E=Cn(Cn({},b),s);return C.createElement(C.Fragment,null,g&&C.createElement(w,{sideCar:QS,removeScrollBar:u,shards:d,noRelative:v,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:m}),l?C.cloneElement(C.Children.only(a),Cn(Cn({},E),{ref:k})):C.createElement(f,Cn({},E,{className:c,ref:k}),a))});Cd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cd.classNames={fullWidth:Zc,zeroRight:Yc};var zM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zM();return t&&e.setAttribute("nonce",t),e}function WM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=UM())&&(WM(t,r),VM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KM=function(){var e=qM();return function(t,r){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},YS=function(){var e=KM(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},GM={left:0,top:0,right:0,gap:0},Sh=function(e){return parseInt(e||"",10)||0},QM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Sh(r),Sh(n),Sh(s)]},YM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GM;var t=QM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ZM=YS(),To="data-scroll-locked",XM=function(e,t,r,n){var s=e.left,i=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),`
202
+ .`.concat(DM,` {
203
+ overflow: hidden `).concat(n,`;
204
+ padding-right: `).concat(a,"px ").concat(n,`;
205
+ }
206
+ body[`).concat(To,`] {
207
+ overflow: hidden `).concat(n,`;
208
+ overscroll-behavior: contain;
209
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
210
+ padding-left: `.concat(s,`px;
211
+ padding-top: `).concat(i,`px;
212
+ padding-right: `).concat(l,`px;
213
+ margin-left:0;
214
+ margin-top:0;
215
+ margin-right: `).concat(a,"px ").concat(n,`;
216
+ `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
217
+ }
218
+
219
+ .`).concat(Yc,` {
220
+ right: `).concat(a,"px ").concat(n,`;
221
+ }
222
+
223
+ .`).concat(Zc,` {
224
+ margin-right: `).concat(a,"px ").concat(n,`;
225
+ }
226
+
227
+ .`).concat(Yc," .").concat(Yc,` {
228
+ right: 0 `).concat(n,`;
229
+ }
230
+
231
+ .`).concat(Zc," .").concat(Zc,` {
232
+ margin-right: 0 `).concat(n,`;
233
+ }
234
+
235
+ body[`).concat(To,`] {
236
+ `).concat(LM,": ").concat(a,`px;
237
+ }
238
+ `)},_x=function(){var e=parseInt(document.body.getAttribute(To)||"0",10);return isFinite(e)?e:0},JM=function(){C.useEffect(function(){return document.body.setAttribute(To,(_x()+1).toString()),function(){var e=_x()-1;e<=0?document.body.removeAttribute(To):document.body.setAttribute(To,e.toString())}},[])},eO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;JM();var i=C.useMemo(function(){return YM(s)},[s]);return C.createElement(ZM,{styles:XM(i,!t,s,r?"":"!important")})},lp=!1;if(typeof window<"u")try{var Nc=Object.defineProperty({},"passive",{get:function(){return lp=!0,!0}});window.addEventListener("test",Nc,Nc),window.removeEventListener("test",Nc,Nc)}catch{lp=!1}var Zi=lp?{passive:!1}:!1,tO=function(e){return e.tagName==="TEXTAREA"},ZS=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!tO(e)&&r[t]==="visible")},rO=function(e){return ZS(e,"overflowY")},nO=function(e){return ZS(e,"overflowX")},xx=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=XS(e,n);if(s){var i=JS(e,n),l=i[1],a=i[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},sO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},iO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},XS=function(e,t){return e==="v"?rO(t):nO(t)},JS=function(e,t){return e==="v"?sO(t):iO(t)},oO=function(e,t){return e==="h"&&t==="rtl"?-1:1},aO=function(e,t,r,n,s){var i=oO(e,window.getComputedStyle(t).direction),l=i*n,a=r.target,c=t.contains(a),u=!1,g=l>0,d=0,_=0;do{if(!a)break;var v=JS(e,a),x=v[0],y=v[1],h=v[2],p=y-h-i*x;(x||p)&&XS(e,a)&&(d+=p,_+=x);var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(g&&Math.abs(d)<1||!g&&Math.abs(_)<1)&&(u=!0),u},Rc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yx=function(e){return[e.deltaX,e.deltaY]},bx=function(e){return e&&"current"in e?e.current:e},lO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cO=function(e){return`
239
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
240
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
241
+ `)},uO=0,Xi=[];function dO(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(uO++)[0],i=C.useState(YS)[0],l=C.useRef(e);C.useEffect(function(){l.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=AM([e.lockRef.current],(e.shards||[]).map(bx),!0).filter(Boolean);return y.forEach(function(h){return h.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(y,h){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var p=Rc(y),f=r.current,m="deltaX"in y?y.deltaX:f[0]-p[0],b="deltaY"in y?y.deltaY:f[1]-p[1],w,k=y.target,E=Math.abs(m)>Math.abs(b)?"h":"v";if("touches"in y&&E==="h"&&k.type==="range")return!1;var S=window.getSelection(),j=S&&S.anchorNode,R=j?j===k||j.contains(k):!1;if(R)return!1;var M=xx(E,k);if(!M)return!0;if(M?w=E:(w=E==="v"?"h":"v",M=xx(E,k)),!M)return!1;if(!n.current&&"changedTouches"in y&&(m||b)&&(n.current=w),!w)return!0;var T=n.current||w;return aO(T,h,y,T==="h"?m:b)},[]),c=C.useCallback(function(y){var h=y;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var p="deltaY"in h?yx(h):Rc(h),f=t.current.filter(function(w){return w.name===h.type&&(w.target===h.target||h.target===w.shadowParent)&&lO(w.delta,p)})[0];if(f&&f.should){h.cancelable&&h.preventDefault();return}if(!f){var m=(l.current.shards||[]).map(bx).filter(Boolean).filter(function(w){return w.contains(h.target)}),b=m.length>0?a(h,m[0]):!l.current.noIsolation;b&&h.cancelable&&h.preventDefault()}}},[]),u=C.useCallback(function(y,h,p,f){var m={name:y,delta:h,target:p,should:f,shadowParent:hO(p)};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(b){return b!==m})},1)},[]),g=C.useCallback(function(y){r.current=Rc(y),n.current=void 0},[]),d=C.useCallback(function(y){u(y.type,yx(y),y.target,a(y,e.lockRef.current))},[]),_=C.useCallback(function(y){u(y.type,Rc(y),y.target,a(y,e.lockRef.current))},[]);C.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:_}),document.addEventListener("wheel",c,Zi),document.addEventListener("touchmove",c,Zi),document.addEventListener("touchstart",g,Zi),function(){Xi=Xi.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,Zi),document.removeEventListener("touchmove",c,Zi),document.removeEventListener("touchstart",g,Zi)}},[]);var v=e.removeScrollBar,x=e.inert;return C.createElement(C.Fragment,null,x?C.createElement(i,{styles:cO(s)}):null,v?C.createElement(eO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fO=HM(QS,dO);var kd=C.forwardRef(function(e,t){return C.createElement(Cd,Cn({},e,{ref:t,sideCar:fO}))});kd.classNames=Cd.classNames;var pO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ji=new WeakMap,Pc=new WeakMap,Tc={},Ch=0,e1=function(e){return e&&(e.host||e1(e.parentNode))},mO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=e1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},gO=function(e,t,r,n){var s=mO(t,Array.isArray(e)?e:[e]);Tc[r]||(Tc[r]=new WeakMap);var i=Tc[r],l=[],a=new Set,c=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var g=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(_){if(a.has(_))g(_);else try{var v=_.getAttribute(n),x=v!==null&&v!=="false",y=(Ji.get(_)||0)+1,h=(i.get(_)||0)+1;Ji.set(_,y),i.set(_,h),l.push(_),y===1&&x&&Pc.set(_,!0),h===1&&_.setAttribute(r,"true"),x||_.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",_,p)}})};return g(t),a.clear(),Ch++,function(){l.forEach(function(d){var _=Ji.get(d)-1,v=i.get(d)-1;Ji.set(d,_),i.set(d,v),_||(Pc.has(d)||d.removeAttribute(n),Pc.delete(d)),v||d.removeAttribute(r)}),Ch--,Ch||(Ji=new WeakMap,Ji=new WeakMap,Pc=new WeakMap,Tc={})}},lg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=pO(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),gO(n,s,r,"aria-hidden")):function(){return null}};function vO(e){const t=_O(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(yO);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function _O(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=wO(s),a=bO(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xO=Symbol("radix.slottable");function yO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xO}function bO(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function wO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ed="Dialog",[t1,r1]=mn(Ed),[SO,gn]=t1(Ed),n1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,a=C.useRef(null),c=C.useRef(null),[u,g]=_a({prop:n,defaultProp:s??!1,onChange:i,caller:Ed});return o.jsx(SO,{scope:t,triggerRef:a,contentRef:c,contentId:Ws(),titleId:Ws(),descriptionId:Ws(),open:u,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(d=>!d),[g]),modal:l,children:r})};n1.displayName=Ed;var s1="DialogTrigger",i1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=gn(s1,r),i=He(t,s.triggerRef);return o.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":dg(s.open),...n,ref:i,onClick:_e(e.onClick,s.onOpenToggle)})});i1.displayName=s1;var cg="DialogPortal",[CO,o1]=t1(cg,{forceMount:void 0}),a1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=gn(cg,t);return o.jsx(CO,{scope:t,forceMount:r,children:C.Children.map(n,l=>o.jsx(Vt,{present:r||i.open,children:o.jsx(Kl,{asChild:!0,container:s,children:l})}))})};a1.displayName=cg;var Du="DialogOverlay",l1=C.forwardRef((e,t)=>{const r=o1(Du,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=gn(Du,e.__scopeDialog);return i.modal?o.jsx(Vt,{present:n||i.open,children:o.jsx(EO,{...s,ref:t})}):null});l1.displayName=Du;var kO=vO("DialogOverlay.RemoveScroll"),EO=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=gn(Du,r);return o.jsx(kd,{as:kO,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(ze.div,{"data-state":dg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ii="DialogContent",c1=C.forwardRef((e,t)=>{const r=o1(Ii,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=gn(Ii,e.__scopeDialog);return o.jsx(Vt,{present:n||i.open,children:i.modal?o.jsx(jO,{...s,ref:t}):o.jsx(NO,{...s,ref:t})})});c1.displayName=Ii;var jO=C.forwardRef((e,t)=>{const r=gn(Ii,e.__scopeDialog),n=C.useRef(null),s=He(t,r.contentRef,n);return C.useEffect(()=>{const i=n.current;if(i)return lg(i)},[]),o.jsx(u1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),NO=C.forwardRef((e,t)=>{const r=gn(Ii,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(u1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),u1=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,a=gn(Ii,r),c=C.useRef(null),u=He(t,c);return ag(),o.jsxs(o.Fragment,{children:[o.jsx(Sd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Vl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":dg(a.open),...l,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(PO,{titleId:a.titleId}),o.jsx(AO,{contentRef:c,descriptionId:a.descriptionId})]})]})}),ug="DialogTitle",d1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=gn(ug,r);return o.jsx(ze.h2,{id:s.titleId,...n,ref:t})});d1.displayName=ug;var h1="DialogDescription",f1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=gn(h1,r);return o.jsx(ze.p,{id:s.descriptionId,...n,ref:t})});f1.displayName=h1;var p1="DialogClose",m1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=gn(p1,r);return o.jsx(ze.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});m1.displayName=p1;function dg(e){return e?"open":"closed"}var g1="DialogTitleWarning",[RO,v1]=F2(g1,{contentName:Ii,titleName:ug,docsSlug:"dialog"}),PO=({titleId:e})=>{const t=v1(g1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
242
+
243
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
244
+
245
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},TO="DialogDescriptionWarning",AO=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${v1(TO).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},_1=n1,DO=i1,x1=a1,hg=l1,fg=c1,pg=d1,mg=f1,gg=m1,LO=Symbol("radix.slottable");function MO(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=LO,t}var y1="AlertDialog",[OO]=mn(y1,[r1]),ls=r1(),b1=e=>{const{__scopeAlertDialog:t,...r}=e,n=ls(t);return o.jsx(_1,{...n,...r,modal:!0})};b1.displayName=y1;var IO="AlertDialogTrigger",FO=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(DO,{...s,...n,ref:t})});FO.displayName=IO;var BO="AlertDialogPortal",w1=e=>{const{__scopeAlertDialog:t,...r}=e,n=ls(t);return o.jsx(x1,{...n,...r})};w1.displayName=BO;var $O="AlertDialogOverlay",S1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(hg,{...s,...n,ref:t})});S1.displayName=$O;var Ao="AlertDialogContent",[HO,zO]=OO(Ao),UO=MO("AlertDialogContent"),C1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=ls(r),l=C.useRef(null),a=He(t,l),c=C.useRef(null);return o.jsx(RO,{contentName:Ao,titleName:k1,docsSlug:"alert-dialog",children:o.jsx(HO,{scope:r,cancelRef:c,children:o.jsxs(fg,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:_e(s.onOpenAutoFocus,u=>{var g;u.preventDefault(),(g=c.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx(UO,{children:n}),o.jsx(VO,{contentRef:l})]})})})});C1.displayName=Ao;var k1="AlertDialogTitle",E1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(pg,{...s,...n,ref:t})});E1.displayName=k1;var j1="AlertDialogDescription",N1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(mg,{...s,...n,ref:t})});N1.displayName=j1;var WO="AlertDialogAction",R1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(gg,{...s,...n,ref:t})});R1.displayName=WO;var P1="AlertDialogCancel",T1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=zO(P1,r),i=ls(r),l=He(t,s);return o.jsx(gg,{...i,...n,ref:l})});T1.displayName=P1;var VO=({contentRef:e})=>{const t=`\`${Ao}\` requires a description for the component to be accessible for screen reader users.
246
+
247
+ You can add a description to the \`${Ao}\` by passing a \`${j1}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
248
+
249
+ 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 \`${Ao}\`. 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.
250
+
251
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},qO=b1,KO=w1,A1=S1,D1=C1,L1=R1,M1=T1,O1=E1,I1=N1;const F1=qO,GO=KO,B1=C.forwardRef(({className:e,...t},r)=>o.jsx(A1,{className:J("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:r}));B1.displayName=A1.displayName;const vg=C.forwardRef(({className:e,...t},r)=>o.jsxs(GO,{children:[o.jsx(B1,{}),o.jsx(D1,{ref:r,className:J("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})]}));vg.displayName=D1.displayName;const _g=({className:e,...t})=>o.jsx("div",{className:J("flex flex-col gap-2 text-left",e),...t});_g.displayName="AlertDialogHeader";const xg=({className:e,...t})=>o.jsx("div",{className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});xg.displayName="AlertDialogFooter";const yg=C.forwardRef(({className:e,...t},r)=>o.jsx(O1,{ref:r,className:J("font-serif text-[20px] leading-tight text-foreground",e),...t}));yg.displayName=O1.displayName;const bg=C.forwardRef(({className:e,...t},r)=>o.jsx(I1,{ref:r,className:J("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));bg.displayName=I1.displayName;const wg=C.forwardRef(({className:e,...t},r)=>o.jsx(L1,{ref:r,className:J(Im(),e),...t}));wg.displayName=L1.displayName;const Sg=C.forwardRef(({className:e,...t},r)=>o.jsx(M1,{ref:r,className:J(Im({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));Sg.displayName=M1.displayName;const QO={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 YO({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:i=!1,errorMessage:l}){const[a,c]=C.useState("");C.useEffect(()=>{e||c("")},[e,t]);const u=QO[t],g=t==="retired",d=!g||a.trim().toLowerCase()===r.trim().toLowerCase(),_=i||!d;return o.jsx(F1,{open:e,onOpenChange:v=>{!v&&!i&&s()},children:o.jsxs(vg,{"data-testid":"launcher-launched-dialog","data-target":t,className:J("gap-4",u.danger&&"border-destructive"),children:[o.jsxs(_g,{children:[o.jsx(yg,{className:J(u.danger&&"text-destructive"),children:u.title}),o.jsx(bg,{children:u.body})]}),g&&o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(br,{htmlFor:"launcher-launched-dialog-typed",className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:["Type"," ",o.jsx("span",{className:"text-foreground",children:r})," to confirm"]}),o.jsx(pt,{id:"launcher-launched-dialog-typed","data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:a,onChange:v=>c(v.target.value),disabled:i,className:J(d&&"border-[var(--vow-green)]")})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-dialog-error",className:"font-mono text-[12px] text-destructive",children:l}),o.jsxs(xg,{children:[o.jsx(Sg,{"data-testid":"launcher-launched-dialog-cancel",onClick:v=>{v.preventDefault(),s()},disabled:i,children:"Cancel"}),o.jsx(wg,{"data-testid":"launcher-launched-dialog-confirm",onClick:v=>{if(_){v.preventDefault();return}v.preventDefault(),n()},disabled:_,className:J(u.danger&&"border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]"),children:i?`${u.confirmLabel}…`:u.confirmLabel})]})]})})}function ZO({record:e,manifest:t,fetchLauncherStatus:r}){var x,y;const n=r??(()=>me.fetchLauncherStatus()),{data:s,isLoading:i,isError:l}=De({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),a=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=a?s==null?void 0:s.nets.find(h=>{var p;return h.solverType===a||h.name===((t==null?void 0:t.name)??((p=e.summary)==null?void 0:p.name))}):void 0,u=c==null?void 0:c.budget.safeBalanceWei,g=(c==null?void 0:c.budget.safeAddress)??e.launcherSafeAddress,d=(t==null?void 0:t.solutionPriceWei)??((x=e.summary)==null?void 0:x.solutionPriceWei),_=(t==null?void 0:t.verdictPriceWei)??((y=e.summary)==null?void 0:y.verdictPriceWei),v=lM(u,d,_);return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-spend-panel",role:"region","aria-label":"Spend and runway",className:"flex flex-col gap-3 p-6",children:[o.jsx("header",{className:"flex items-center justify-between gap-3",children:o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Spend & runway"})}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(eo,{label:"Safe address",value:US(g),tooltip:g,testid:"launcher-launched-spend-safe-address"}),o.jsx(eo,{label:"Safe balance",value:i?"—":u?Ds(u):"unavailable",tooltip:u?`${u} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),o.jsx(eo,{label:"Solution price",value:d?Ds(d):"—",tooltip:d?`${d} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),o.jsx(eo,{label:"Verdict price",value:_?Ds(_):"—",tooltip:_?`${_} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),o.jsx(eo,{label:"Per-Task cost",value:v?Ds(v.perTaskWei.toString()):"—",tooltip:v?`${v.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),o.jsx(eo,{label:"Projected runway",value:v?`${v.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-spend-error",className:"font-mono text-[12px] text-destructive",children:"Failed to load Safe balance."}),o.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, before any operator participation cost adjustments."})]})})}function eo({label:e,value:t,testid:r,tooltip:n}){const s=o.jsx("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:n?0:void 0,children:t});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),n?o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:s}),o.jsx(Fr,{children:n})]}):s]})}const XO={paused:"Pause",launched:"Resume",retired:"Retire"},wx={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 JO({record:e,manifest:t,operatorCount:r,onAction:n,pending:s}){var c;const i=wx[e.status]??wx.launching,l=aM[e.status]??[],a=(t==null?void 0:t.name)??((c=e.summary)==null?void 0:c.name)??e.solverNetId;return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{"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:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("h1",{"data-testid":"launcher-launched-name",className:"m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground",children:a}),o.jsx(Ce,{"data-testid":"launcher-launched-status-badge",variant:i.variant,className:"whitespace-nowrap",children:i.label})]}),(t==null?void 0:t.description)&&o.jsx("p",{className:"m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]",children:t.description})]}),o.jsx(eI,{allowed:l,onAction:n,pending:s??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),o.jsx(Ye,{}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(La,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id"}),o.jsx(La,{label:"Manifest cid",value:zS(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],tooltip:e.manifestCid}),o.jsx(La,{label:"Launcher Safe",value:US(e.launcherSafeAddress),testid:"launcher-launched-safe",tooltip:e.launcherSafeAddress}),o.jsx(La,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent"}),r!==void 0&&o.jsx(La,{label:"Operators",value:String(r),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 La({label:e,value:t,testid:r,additionalTestIds:n,tooltip:s}){const i=o.jsxs("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:s?0:void 0,children:[t,n==null?void 0:n.map(l=>o.jsx("span",{"data-testid":l,className:"hidden","aria-hidden":"true",children:t},l))]});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),s?o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:i}),o.jsx(Fr,{children:s})]}):i]})}function eI({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?o.jsx(Ce,{"data-testid":"launcher-launched-terminal-pill",variant:"outline",className:"self-start whitespace-nowrap",children:"Retired — no further actions"}):s?o.jsx(Ce,{"data-testid":"launcher-launched-launching-pill",variant:"outline",className:"self-start whitespace-nowrap border-primary text-primary",children:"Launching…"}):e.length===0?null:o.jsx("div",{"data-testid":"launcher-launched-actions",className:"flex flex-wrap gap-2 self-start",children:e.map(i=>{const l=XO[i],a=r===i,c=i==="retired";return o.jsx(oe,{type:"button",variant:c?"destructive":"default","data-testid":`launcher-launched-action-${i}`,onClick:()=>t(i),disabled:r!==null,className:r!==null&&!a?"opacity-60":void 0,children:a?`${l}…`:l},i)})})}const Sx=5,tI={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 rI({record:e,fetchTasks:t}){var v;const[r,n]=C.useState([void 0]),s=r[r.length-1],i=t??(x=>me.fetchLauncherTasks(x)),{data:l,isLoading:a,isError:c,error:u,refetch:g}=De({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>i({cursor:s,limit:Sx}),refetchInterval:15e3}),d=()=>{var x;(x=l==null?void 0:l.cursor)!=null&&x.before&&n(y=>[...y,l.cursor.before])},_=()=>{n(x=>x.length>1?x.slice(0,-1):x)};return o.jsx(Or,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-tasks-panel",role:"region","aria-label":"Recent posted Tasks",className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex items-center justify-between gap-3",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Recent posted Tasks"}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{g()},children:"Refresh"})]}),a&&o.jsx("p",{"data-testid":"launcher-launched-tasks-loading",className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}),c&&o.jsxs("div",{"data-testid":"launcher-launched-tasks-error",className:"font-mono text-[12px] text-destructive",children:["Failed to load tasks: ",u instanceof Error?u.message:"unknown error"]}),!a&&!c&&l&&l.tasks.length===0&&o.jsx(sI,{}),!a&&!c&&l&&l.tasks.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{"data-testid":"launcher-launched-tasks-list",className:"overflow-hidden rounded-md border border-border",children:o.jsxs(zi,{className:"table-fixed",children:[o.jsx(Ui,{children:o.jsxs(Cr,{className:"bg-[var(--bg)] hover:bg-[var(--bg)]",children:[o.jsx(Ve,{className:"w-[34%]",children:"Task"}),o.jsx(Ve,{className:"w-[16%]",children:"SolverType"}),o.jsx(Ve,{className:"w-[22%]",children:"Posted"}),o.jsx(Ve,{className:"w-[14%]",children:"State"}),o.jsx(Ve,{className:"w-[14%] text-right",children:"Claims"})]})}),o.jsx(Wi,{children:l.tasks.map(x=>o.jsx(nI,{task:x},x.taskId))})]})}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-prev",onClick:_,disabled:r.length<=1,children:"← Newer"}),o.jsxs("span",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Page ",r.length,l.tasks.length<Sx&&l.cursor===void 0?" · end":""]}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-next",onClick:d,disabled:!((v=l.cursor)!=null&&v.before),children:"Older →"})]})]})]})})}function nI({task:e}){var s;const t=tI[e.state]??{variant:"secondary",label:e.state},r=((s=e.summary)==null?void 0:s.title)??zS(e.taskCid),n=e.solverType??e.solverNet;return o.jsxs(Cr,{"data-testid":"launcher-launched-task-row","data-task-id":e.taskId,children:[o.jsx(qe,{className:"font-mono text-[13px] text-foreground",children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:r})}),o.jsx(Fr,{children:e.taskCid})]})}),o.jsx(qe,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:o.jsxs(cn,{children:[o.jsx(un,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:n})}),o.jsx(Fr,{children:n})]})}),o.jsx(qe,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:wd(e.postedAt)}),o.jsx(qe,{children:o.jsx(Ce,{variant:t.variant,className:"normal-case tracking-[0.1em]",children:t.label})}),o.jsxs(qe,{className:"text-right font-mono text-[12px] text-[var(--fg-muted)]",children:[e.claims.current," / ",e.claims.max]})]})}function sI(){return o.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."})}const iI=2500,oI=3e4,Ac="mx-auto flex max-w-[960px] flex-col gap-4 p-6";function aI({pollIntervalMs:e=iI,navigateTo:t,solverNetId:r}={}){var k,E,S,j;const n=cd(),[,s]=Ur(),i=t??s,l=is(),a=r??n.solverNetId,c=De({queryKey:["solvernets","launched",a],queryFn:()=>me.solvernets.get(a),refetchInterval:e,enabled:!!a}),u=(k=c.data)==null?void 0:k.manifestCid,g=De({queryKey:["solvernets","manifest",u],queryFn:()=>me.solvernets.getManifest(u),enabled:!!u,staleTime:1/0}),d=De({queryKey:["solvernets","operator-count",u],queryFn:async()=>(await me.discovery.getSolverNetOperatorCount(u)).operatorCount,enabled:!!u,refetchInterval:oI}),[_,v]=C.useState(null),[x,y]=C.useState(null),h=Gn({mutationFn:({target:R})=>me.solvernets.transitionLifecycle(a,R),onSuccess:async R=>{await l.cancelQueries({queryKey:["solvernets","launched",a]}),l.setQueryData(["solvernets","launched",a],R),v(null),y(null)},onError:R=>{y(R instanceof Error?R.message:String(R))}}),p=Gn({mutationFn:R=>me.solvernets.updateGeneratorConfig(a,R),onSuccess:()=>{l.invalidateQueries({queryKey:["solvernets","launched",a]})}});if(!a)return o.jsx("main",{"data-testid":"launcher-launched-missing-id",className:Ac,children:o.jsx(Cx,{message:"No solverNetId supplied.",onBack:()=>i("/launcher")})});if(c.isLoading)return o.jsx("main",{"data-testid":"launcher-launched-loading",className:Ac,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"})});if(c.isError||!c.data){const R=c.error instanceof Error?c.error.message:"Unknown error";return o.jsx("main",{"data-testid":"launcher-launched-error",className:Ac,children:o.jsx(Cx,{message:`Failed to load SolverNet: ${R}`,onBack:()=>i("/launcher"),onRetry:()=>{c.refetch()}})})}const f=c.data,m=(E=g.data)==null?void 0:E.manifest,b=cI(f,m),w=(m==null?void 0:m.name)??((S=f.summary)==null?void 0:S.name)??f.solverNetId;return o.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":a,className:Ac,children:[o.jsx(JO,{record:f,manifest:m,operatorCount:d.data,onAction:R=>{y(null),v(R)},pending:h.isPending?((j=h.variables)==null?void 0:j.target)??null:null}),o.jsx(gM,{record:f,manifest:m,template:b,onSave:async R=>{await p.mutateAsync(R)}}),o.jsx(ZO,{record:f,manifest:m}),o.jsx(rI,{record:f}),g.isError&&o.jsxs("p",{"data-testid":"launcher-launched-manifest-error",className:"m-0 font-mono text-[12px] text-destructive",children:["Failed to load manifest:"," ",lI(g.error)]}),o.jsx(YO,{open:_!==null,target:_??"paused",solverNetName:w,pending:h.isPending,errorMessage:x??void 0,onCancel:()=>{h.isPending||(v(null),y(null))},onConfirm:()=>{_&&h.mutate({target:_})}})]})}function lI(e){const 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 cI(e,t){const r=(t==null?void 0:t.contract)??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(r)return op[`${r.id}.${r.version}`]}function Cx({message:e,onBack:t,onRetry:r}){return o.jsxs(Ze,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(Je,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-retry",onClick:r,children:"Retry"}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-back",onClick:t,children:"Back to launcher"})]})]})}const kx="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",kh="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 uI({onSuccess:e,onCancel:t}){const[r,n]=C.useState("checking"),[s,i]=C.useState(""),[l,a]=C.useState(""),c=()=>{n("checking"),me.hermesDoctor().then(g=>{if(!g.installed){n("not-installed");return}if(g.exitCode!==0){n("config-issue"),i(g.stderr);return}n("ok"),e()}).catch(g=>{a(g instanceof Error?g.message:String(g)),n("network-error")})},u=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(kx).catch(()=>{})};return C.useEffect(()=>{c()},[]),r==="checking"?o.jsxs(we,{"data-testid":"hermes-precheck-checking",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes install check"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Checking hermes install…"})]}):r==="not-installed"?o.jsxs(we,{"data-testid":"hermes-precheck-not-installed",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent not installed"}),o.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:"}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("pre",{className:`${kh} flex-1`,children:kx}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:u,children:"Copy"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"I've installed Hermes — retry precheck"}),o.jsx(oe,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="network-error"?o.jsxs(Ze,{"data-testid":"hermes-precheck-network-error",variant:"blocking",className:"flex flex-col gap-3 border-l-0 border border-destructive p-4",children:[o.jsx(Rt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes precheck failed"}),o.jsxs(Je,{className:"font-mono text-[13px] text-foreground",children:["Could not reach the daemon API to run ",o.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),l?o.jsx("pre",{className:kh,children:l}):null,o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(oe,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="config-issue"?o.jsxs(Ze,{"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:[o.jsx(Rt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent configuration issue"}),o.jsx(Je,{className:"font-mono text-[13px] text-foreground",children:"Hermes is installed but reports configuration issues:"}),o.jsx("pre",{className:kh,children:s||"(no diagnostic output)"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Run ",o.jsx("code",{children:"hermes model"})," or ",o.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(oe,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):o.jsx(o.Fragment,{})}const $1=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],H1=[{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"}],z1=[{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 dI(e){return Sr(e)===bd}function hI(e){return Sr(e)===sa}function jd(e){return hI(e)?z1:dI(e)?H1:$1}function Do(e){return jd(e)[0].id}function Cg(e,t){const n=jd(t).find(s=>s.id===e)??null??$1.find(s=>s.id===e)??H1.find(s=>s.id===e)??z1.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function fI(e){const t=pI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(gI);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function pI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=_I(s),a=vI(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mI=Symbol("radix.slottable");function gI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mI}function vI(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function _I(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Nd="Popover",[U1]=mn(Nd,[va]),Ql=va(),[xI,ni]=U1(Nd),W1=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,a=Ql(t),c=C.useRef(null),[u,g]=C.useState(!1),[d,_]=_a({prop:n,defaultProp:s??!1,onChange:i,caller:Nd});return o.jsx(tg,{...a,children:o.jsx(xI,{scope:t,contentId:Ws(),triggerRef:c,open:d,onOpenChange:_,onOpenToggle:C.useCallback(()=>_(v=>!v),[_]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>g(!0),[]),onCustomAnchorRemove:C.useCallback(()=>g(!1),[]),modal:l,children:r})})};W1.displayName=Nd;var V1="PopoverAnchor",yI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ni(V1,r),i=Ql(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(l(),()=>a()),[l,a]),o.jsx(_d,{...i,...n,ref:t})});yI.displayName=V1;var q1="PopoverTrigger",K1=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ni(q1,r),i=Ql(r),l=He(t,s.triggerRef),a=o.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":X1(s.open),...n,ref:l,onClick:_e(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:o.jsx(_d,{asChild:!0,...i,children:a})});K1.displayName=q1;var kg="PopoverPortal",[bI,wI]=U1(kg,{forceMount:void 0}),G1=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=ni(kg,t);return o.jsx(bI,{scope:t,forceMount:r,children:o.jsx(Vt,{present:r||i.open,children:o.jsx(Kl,{asChild:!0,container:s,children:n})})})};G1.displayName=kg;var ia="PopoverContent",Q1=C.forwardRef((e,t)=>{const r=wI(ia,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=ni(ia,e.__scopePopover);return o.jsx(Vt,{present:n||i.open,children:i.modal?o.jsx(CI,{...s,ref:t}):o.jsx(kI,{...s,ref:t})})});Q1.displayName=ia;var SI=fI("PopoverContent.RemoveScroll"),CI=C.forwardRef((e,t)=>{const r=ni(ia,e.__scopePopover),n=C.useRef(null),s=He(t,n),i=C.useRef(!1);return C.useEffect(()=>{const l=n.current;if(l)return lg(l)},[]),o.jsx(kd,{as:SI,allowPinchZoom:!0,children:o.jsx(Y1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:_e(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),kI=C.forwardRef((e,t)=>{const r=ni(ia,e.__scopePopover),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(Y1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Y1=C.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:g,...d}=e,_=ni(ia,r),v=Ql(r);return ag(),o.jsx(Sd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>_.onOpenChange(!1),children:o.jsx(rg,{"data-state":X1(_.open),role:"dialog",id:_.contentId,...v,...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)"}})})})}),Z1="PopoverClose",EI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ni(Z1,r);return o.jsx(ze.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});EI.displayName=Z1;var jI="PopoverArrow",NI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ql(r);return o.jsx(ng,{...s,...n,ref:t})});NI.displayName=jI;function X1(e){return e?"open":"closed"}var RI=W1,PI=K1,TI=G1,J1=Q1;const eC=RI,tC=PI,Eg=C.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(TI,{children:o.jsx(J1,{ref:s,align:t,sideOffset:r,className:J("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),...n})}));Eg.displayName=J1.displayName;const Ex=[{name:"network-tools",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Jinn runtime tools"},{name:"claude-code-learner",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Learner loop"}];function AI(e){return Sr(e)===sa?Ex.filter(t=>t.name!=="claude-code-learner"):Ex}const DI=new Set(["swe-rebench-v2-runtime"]),LI={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Lu="bundled:";function Ma(e){return LI[e]??e}function bo(e){return e.startsWith(Lu)?e.slice(Lu.length):e}function MI(e){return e.source==="bundled"?`${Lu}${e.name}`:e.name}function jx(e){const t=new Set,r=[];for(const n of e){const s=bo(n);t.has(s)||(t.add(s),r.push(n))}return r}function OI(e,t,r){const n=new Set,s=[];for(const i of AI(r))n.add(i.name),s.push(i);for(const i of e){if(n.has(i.name))continue;n.add(i.name);const l=DI.has(i.name);s.push({...i,...l?{defaultIncluded:!0}:{recommended:!0},description:i.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const i of t){const l=bo(i);n.has(l)||(n.add(l),s.push({name:l,version:"configured",source:i.startsWith(Lu)?"bundled":"custom",description:"Already configured"}))}return s}function II(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function cp({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:i,harness:l}){const[a,c]=C.useState(""),[u,g]=C.useState(!1),[d,_]=C.useState(null),v=C.useMemo(()=>OI(e,t,l),[e,t,l]),x=new Set(t.map(bo)),y=new Set(r.map(bo)),h=new Set(x);for(const R of v)R.defaultIncluded&&!y.has(R.name)&&h.add(R.name);const p=v.filter(R=>h.has(R.name)),f=p.filter(R=>R.defaultIncluded).length,m=p.length-f,b=v.filter(R=>!h.has(R.name)),w=a.trim().toLowerCase(),k=w?b.filter(R=>`${R.name} ${Ma(R.name)} ${R.source} ${R.description??""}`.toLowerCase().includes(w)):b,E=R=>{const M=R.defaultIncluded?r.filter(L=>bo(L)!==R.name):r,T=R.defaultIncluded?t:jx([...t,MI(R)]);n(T,M),g(!1),c("")},S=R=>{if(R.defaultIncluded){_(R),g(!1),c("");return}n(t.filter(M=>bo(M)!==R.name),r)},j=()=>{d&&(n(t,jx([...r,d.name])),_(null))};return o.jsxs("div",{className:"relative flex flex-col gap-2",children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(R=>o.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":R.name,className:J("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",R.defaultIncluded?"bg-sunken":"bg-transparent"),children:[o.jsxs("span",{children:[Ma(R.name),o.jsx("span",{className:"text-dim",children:R.defaultIncluded?" · default":" · selected"})]}),o.jsx(oe,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove ${Ma(R.name)}`,"data-testid":`${s}-remove`,"data-plugin":R.name,onClick:()=>S(R),className:"h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:o.jsx(kl,{"aria-hidden":"true",className:"!size-3"})})]},R.name))}),d&&o.jsxs("div",{role:"alertdialog","data-testid":`${s}-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:[o.jsxs("span",{className:"text-[12px] text-foreground",children:[Ma(d.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),o.jsxs("span",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":`${s}-default-warning-cancel`,onClick:()=>_(null),children:"Keep"}),o.jsx(oe,{type:"button",variant:"destructive",size:"sm","data-testid":`${s}-default-warning-confirm`,onClick:j,children:"Remove"})]})]}),o.jsxs(eC,{open:u,onOpenChange:R=>{g(R),R||c("")},children:[o.jsx(tC,{asChild:!0,children:o.jsxs(oe,{type:"button",variant:"outline","data-testid":`${s}-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:[o.jsxs("span",{className:"min-w-0",children:["Add plugin",o.jsxs("span",{className:"text-dim",children:[" ","· ",f," default",m>0?` · ${m} selected`:""]})]}),u?o.jsx(Dm,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"}):o.jsx(ud,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"})]})}),o.jsxs(Eg,{align:"start",sideOffset:6,className:"w-[min(28rem,90vw)] overflow-hidden p-0",children:[o.jsx(pt,{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":i,value:a,onChange:R=>c(R.target.value),onKeyDown:R=>{R.key==="Escape"&&(g(!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"}),o.jsx(Wl,{className:"max-h-60",children:o.jsx("div",{role:"listbox","aria-label":"Plugins",className:"flex flex-col",children:k.length===0?o.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."}):k.map((R,M)=>{const T=h.has(R.name),L=R.defaultIncluded?"text-dim":R.recommended?"text-primary":"text-muted-foreground";return o.jsxs(oe,{type:"button",variant:"ghost",role:"option","aria-selected":T,"data-testid":s,"data-plugin":R.name,"data-plugin-active":T?"true":"false","data-plugin-default":R.defaultIncluded?"true":"false",onClick:()=>E(R),className:J("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",M===0?"":"border-t border-border",T?"bg-sunken text-foreground":"bg-transparent text-foreground","hover:bg-sunken focus-visible:bg-sunken"),children:[o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{className:"text-[13px] text-foreground",children:Ma(R.name)}),o.jsx("span",{className:"text-[11px] text-dim",children:II(R)})]}),o.jsx("span",{className:J("self-center text-[11px] uppercase",L),children:R.defaultIncluded?"Default":R.recommended?"Recommended":"Add"})]},R.name)})})})]})]})]})}const rC="claude-code",nC="codex",FI="hermes-agent",BI={"claude-code-learner":rC,"codex-code-learner":nC};function $I(e){return BI[e]??e}const HI={"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}},zI={[rC]:{subscriptionPath:!0},[nC]:{subscriptionPath:!0},[FI]:{subscriptionPath:!1}},jg=1;function UI(e){const t=HI[e];if(!t)return null;const r=t.typicalInputTokens/1e3*t.inputPer1kTokens,n=t.typicalOutputTokens/1e3*t.outputPer1kTokens;return{usd:r+n,inputUsd:r,outputUsd:n,typicalInputTokens:t.typicalInputTokens,typicalOutputTokens:t.typicalOutputTokens,entry:t}}function WI(e){if(!e)return!1;const t=$I(e),r=zI[t];return r?!r.subscriptionPath:!0}function sC(e,t,r=jg){if(!WI(e))return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?UI(t):null;return(n==null?void 0:n.entry.subscriptionPath)===!0?{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."}:{showEstimate:!0,estimate:n,requiresConfirmation:n!==null&&n.usd>r,suppressedReason:null}}function VI(e){return Number.isFinite(e)?e===0?"$0":e<.01?"<$0.01":e<1?`$${e.toFixed(2)}`:e<10?`$${e.toFixed(2)}`:`$${e.toFixed(2)}`:"—"}function iC(e,t,r=jg){return sC(e,t,r)}function oC({harness:e,modelId:t,thresholdUsd:r=jg,variant:n="card",testIdPrefix:s="cost-estimate"}){const i=sC(e,t,r);if(!i.showEstimate)return o.jsxs("div",{"data-testid":`${s}-subscription`,"data-cost-mode":"subscription",className:J("flex items-center gap-2.5 font-mono",n==="card"?"rounded-md border border-border bg-card px-3.5 py-2.5":"py-1.5"),children:[o.jsx(TR,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"text-[12px] text-muted-foreground",children:i.suppressedReason??"Included in subscription, no per-task API cost."})]});const l=i.estimate,a=(l==null?void 0:l.usd)??null,c=i.requiresConfirmation;return o.jsxs("div",{"data-testid":`${s}-panel`,"data-cost-mode":"paid-api","data-cost-usd":a!==null?a.toFixed(4):"unknown","data-cost-high-cost":c?"true":"false",className:J("flex flex-col gap-2 rounded-md border bg-card",c?"border-destructive":"border-border",n==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Estimated cost per task"}),o.jsx("span",{"data-testid":`${s}-amount`,className:J("font-mono font-medium",n==="card"?"text-[18px]":"text-[14px]",c?"text-destructive":"text-foreground"),children:a!==null?`~${VI(a)}`:"unavailable"})]}),l&&o.jsx("span",{"data-testid":`${s}-heuristic`,className:"font-mono text-[11px] text-muted-foreground",children:"Rough estimate — actual cost varies."}),a===null&&o.jsx("span",{"data-testid":`${s}-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&&o.jsxs("span",{"data-testid":`${s}-warning`,className:"font-mono text-[11px] text-destructive",children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}function to({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[s,i]=C.useState(!1);return o.jsxs(eC,{open:s,onOpenChange:i,children:[o.jsx(tC,{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:o.jsx(AR,{className:"h-2.5 w-2.5","aria-hidden":"true"})}),o.jsxs(Eg,{"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,r&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:n})]})]})]})}const qI="Self-improving agent by Nous Research. Built-in learning loop.",ro="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",KI=og,Oa="mx-auto flex max-w-[880px] flex-col gap-4 p-6",io="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",Eh=io,no="flex items-start gap-2",Nx="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 GI(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function QI(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function YI(e){const t=e==null?void 0: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 ZI(e){const t=[...new Set(e)].sort();return{readiness:De({queryKey:["harness-readiness",t.join(",")],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{const n=await Promise.all(t.map(async s=>{try{return[s,await me.harnessReadiness(s)]}catch(i){if(i.code==="harness_not_found")return[s,void 0];throw i}}));return new Map(n)}}).data??new Map}}function XI({manifestCid:e,navigateTo:t}={}){var U,G,K;const r=cd(),[,n]=Ur(),s=t??n,i=is(),l=e??r.cid,a=De({queryKey:["solvernets","manifest",l],queryFn:()=>me.solvernets.getManifest(l),enabled:!!l,retry:!1}),c=De({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets()}),u=(U=a.data)==null?void 0:U.manifest,g=u?GI(c.data,u.contract):void 0,d=((g==null?void 0:g.compatibleHarnesses)??[]).filter(Z=>Z.supportsRoles.includes("solving")).map(Z=>({...Z,name:Sr(Z.name)})).filter((Z,X,ae)=>ae.findIndex(je=>je.name===Z.name)===X),_=((G=d[0])==null?void 0:G.name)??KI,v=Do(_),[x,y]=C.useState({roles:[],harness:_,plugins:[],disabledDefaultPlugins:[],model:v}),[h,p]=C.useState(null),[f,m]=C.useState(null),[b,w]=C.useState(!1),k=C.useRef(!1),[E,S]=C.useState(!1),j=(K=d[0])==null?void 0:K.name;C.useEffect(()=>{k.current||j&&j!==x.harness&&y(Z=>({...Z,harness:j,model:Do(j)}))},[j]);const R=jd(x.harness),M=YI(u),T=[...d.map(Z=>Z.name),...x.roles.includes("evaluator")&&M?[M]:[]],{readiness:L}=ZI(T),$=L.get(x.harness),z=M?L.get(M):void 0,W=Gn({mutationFn:()=>me.operator.join(l,{...(u==null?void 0:u.name)!==void 0?{name:u.name}:{},...(u==null?void 0:u.contract)!==void 0?{contract:{id:u.contract.id,version:u.contract.version}}:{},roles:x.roles,...x.roles.includes("solver")?{harness:x.harness,plugins:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,model:x.model}:{}}),onSuccess:Z=>{i.invalidateQueries({queryKey:["operator","joined"]}),i.invalidateQueries({queryKey:["bootstrap"]}),m({manifestCid:Z.manifestCid,name:Z.config.name??(u==null?void 0:u.name)??Z.manifestCid,roles:Z.config.roles,restartRequired:Z.restartRequired})},onError:Z=>{p(Z instanceof Error?Z.message:String(Z))}});if(!l)return o.jsx("main",{"data-testid":"join-flow-missing-cid",className:Oa,children:o.jsx(Rx,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(a.isLoading)return o.jsx("main",{"data-testid":"join-flow-loading",className:Oa,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading manifest…"})});if(a.isError||!u){const Z=a.error instanceof Error?a.error.message:"Unknown error";return o.jsx("main",{"data-testid":"join-flow-error",className:Oa,children:o.jsx(Rx,{message:`Failed to load manifest: ${Z}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{a.refetch()}})})}if(f)return o.jsx("main",{"data-testid":"join-flow-success",className:Oa,children:o.jsx(JI,{success:f,navigate:s})});const{openRoles:q}=u,N=Z=>{q.includes(Z)&&y(X=>{const je=X.roles.includes(Z)?X.roles.filter(Oe=>Oe!==Z):q.filter(Oe=>Oe===Z||X.roles.includes(Oe));return{...X,roles:je}})},P=x.roles.includes("solver"),D=x.roles.includes("evaluator"),O=iC(P?x.harness:void 0,P?x.model:void 0),B=P&&O.requiresConfirmation,Q=B&&!E,ee=P&&($==null?void 0:$.ready)===!1,re=D&&(z==null?void 0:z.ready)===!1,ye=x.roles.length>0&&!W.isPending&&!Q&&!ee&&!re,A=re&&M?o.jsxs("div",{"data-testid":"join-evaluator-not-ready","data-harness":M,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:[o.jsxs("span",{className:"text-destructive",children:[Vs(M)," is not ready",z!=null&&z.reason?`: ${z.reason}`:""]}),(z==null?void 0:z.nextStep)&&o.jsxs("span",{"data-testid":"join-evaluator-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[z.nextStep.description,z.nextStep.cli?` (${z.nextStep.cli})`:""]})]}):null;return o.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":l,className:Oa,children:[o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{"data-testid":"join-flow-title",className:"font-mono text-[20px] font-medium text-foreground",children:["Join ",u.name]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:u.description})]}),o.jsxs(we,{"data-testid":"join-flow-summary",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:io,children:"Manifest"}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Contract"}),o.jsxs("span",{className:"text-foreground",children:[u.contract.id," · ",u.contract.version]}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:Ds(u.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:Ds(u.verdictPriceWei)}),o.jsx("span",{children:"Open roles"}),o.jsx("span",{"data-testid":"join-flow-open-roles",className:"text-foreground",children:q.join(", ")||"none"}),o.jsx("span",{children:"Launcher"}),o.jsxs("span",{className:"text-foreground",children:[QI(u.launcher.safeAddress)," · agentId"," ",u.launcher.agentId]}),o.jsx("span",{children:"Manifest CID"}),o.jsx("span",{"data-testid":"join-flow-manifest-cid",className:"truncate text-[var(--fg-dim)]",children:l})]})]}),o.jsxs(we,{className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:no,children:[o.jsx("span",{className:io,children:"Roles"}),o.jsxs(to,{label:"Roles help",docHref:`${ro}#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.",`
252
+
253
+ `,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
254
+
255
+ `,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),o.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:q.map((Z,X)=>{const ae=x.roles.includes(Z),je=`join-role-${Z}`;return o.jsxs("label",{htmlFor:je,"data-testid":"join-role-option","data-role":Z,"data-role-active":ae?"true":"false",className:J("flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono",ae?"bg-[var(--bg)] text-foreground":"bg-transparent text-[var(--fg-muted)]",X<q.length-1&&"border-r border-border"),children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("input",{id:je,type:"checkbox",checked:ae,onChange:()=>N(Z),"aria-label":Z==="solver"?"Solver":"Evaluator",className:"size-3.5 accent-primary"}),o.jsx("span",{className:"text-[14px] font-medium",children:Z==="solver"?"Solver":"Evaluator"})]}),o.jsx("span",{className:J("pl-[22px] text-[11px]",ae?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]"),children:Z==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},Z)})})]}),P&&o.jsxs(we,{"data-testid":"join-flow-solver-fields",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:io,children:"Solver configuration"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:no,children:[o.jsx(br,{htmlFor:"join-harness-select",className:Eh,children:"Harness"}),o.jsxs(to,{label:"Harness help",docHref:`${ro}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
256
+
257
+ `,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
258
+
259
+ `,"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.",`
260
+
261
+ `,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),o.jsxs("select",{id:"join-harness-select","aria-label":"Harness","data-testid":"join-harness-select",value:x.harness,onChange:Z=>{const X=Z.target.value;k.current=!0,y({...x,harness:X,model:Do(X)}),S(!1)},className:Nx,children:[d.map(Z=>{const X=L.get(Z.name),ae=(X==null?void 0:X.ready)===!1;return o.jsxs("option",{value:Z.name,disabled:ae,"data-testid":"join-harness-option","data-harness":Z.name,"data-harness-ready":X===void 0?"unknown":X.ready?"true":"false",children:[FS(Z.name,Z.version),ae?" — setup required":""]},Z.name)}),(!g||d.length===0)&&o.jsx("option",{value:x.harness,children:Vs(x.harness)})]}),x.harness===sa&&o.jsx("span",{"data-testid":"join-harness-hermes-description",className:"font-mono text-[11px] text-[var(--fg-muted)]",children:qI}),($==null?void 0:$.ready)===!1&&o.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":x.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:[o.jsxs("span",{className:"text-destructive",children:[Vs(x.harness)," is not ready",$.reason?`: ${$.reason}`:""]}),$.nextStep&&o.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[$.nextStep.description,$.nextStep.cli?` (${$.nextStep.cli})`:""]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:no,children:[o.jsx(br,{htmlFor:"join-model-select",className:Eh,children:"Model"}),o.jsxs(to,{label:"Model help",docHref:`${ro}#harness-and-model`,children:["The model is the LLM the harness runs.",`
262
+
263
+ `,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
264
+
265
+ `,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
266
+
267
+ `,"Check the cost estimate below before you join."]})]}),o.jsxs("select",{id:"join-model-select","aria-label":"Model","data-testid":"join-model-select",value:x.model,onChange:Z=>{y({...x,model:Z.target.value}),S(!1)},className:Nx,children:[R.map(Z=>o.jsx("option",{value:Z.id,children:Z.label},Z.id)),(()=>{const Z=Cg(x.model,x.harness);return Z.isCustom?o.jsx("option",{value:x.model,children:Z.label},x.model):null})()]})]})]}),o.jsx(oC,{harness:x.harness,modelId:x.model,testIdPrefix:"join-flow-cost"}),B&&o.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":E?"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:[o.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:E,onChange:Z=>S(Z.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"}),o.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."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("span",{className:no,children:[o.jsx("span",{className:Eh,children:"Plugins"}),o.jsxs(to,{label:"Plugins help",docHref:`${ro}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
268
+
269
+ `,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
270
+
271
+ `,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
272
+
273
+ `,"You can re-join later with more plug-ins."]})]}),o.jsx(cp,{available:(g==null?void 0:g.compatiblePlugins)??[],selected:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,onChange:(Z,X)=>y({...x,plugins:Z,disabledDefaultPlugins:X}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:x.harness})]})]}),D&&!P&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:no,children:[o.jsx("span",{className:io,children:"Evaluator configuration"}),o.jsxs(to,{label:"Evaluator configuration help",docHref:`${ro}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
274
+
275
+ `,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
276
+
277
+ `,"For many SolverNets that function is deterministic and uses no model at all."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["The evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]}),A]}),D&&P&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:no,children:[o.jsx("span",{className:io,children:"Evaluator binding"}),o.jsxs(to,{label:"Evaluator binding help",docHref:`${ro}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
278
+
279
+ `,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
280
+
281
+ `,"The harness and model fields above apply only to the solver role."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]}),A]}),b&&o.jsx(uI,{onSuccess:()=>{w(!1),W.mutate()},onCancel:()=>{w(!1)}}),h&&o.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",className:"m-0 font-mono text-[13px] text-destructive",children:h}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(oe,{type:"button",variant:"secondary","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),children:"Cancel"}),o.jsx(oe,{type:"button",variant:"default","data-testid":"join-flow-submit",disabled:!ye,onClick:()=>{if(p(null),x.roles.includes("solver")&&x.harness===sa){w(!0);return}W.mutate()},children:W.isPending?"Joining…":"Join SolverNet"})]})]})}function Rx({message:e,onBack:t,onRetry:r}){return o.jsxs(Ze,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(Je,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-retry",onClick:r,children:"Retry"}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-back",onClick:t,children:"Back"})]})]})}function JI({success:e,navigate:t}){const r=e.roles.map(c=>c==="solver"?"Solver":"Evaluator").join(" + "),[n,s]=C.useState(!1),[i,l]=C.useState(null),a=async()=>{s(!0),l(null);try{if(!(await me.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(c){l(c instanceof Error?c.message:"Restart request failed."),s(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"join-flow-success-card",role:"status",className:"flex flex-col gap-2.5 border-[var(--vow-green)] p-5",children:[o.jsx(Ce,{variant:"success",className:"self-start",children:"Joined"}),o.jsxs("span",{"data-testid":"join-flow-success-name",className:"font-mono text-[18px] font-medium text-foreground",children:["You joined ",e.name]}),o.jsxs("span",{className:"font-mono text-[12px] leading-relaxed text-[var(--fg-muted)]",children:["You're in as ",r||"an operator",". This SolverNet now shows in your joined list."]}),e.restartRequired&&o.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."})]}),i&&o.jsx(Rt,{role:"alert","data-testid":"join-flow-success-restart-error",className:"font-mono text-[12px] leading-relaxed text-destructive",children:i}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(oe,{type:"button",variant:"secondary","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),children:"Browse SolverNets"}),o.jsx(oe,{type:"button",variant:"secondary","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:"View joined SolverNet"}),o.jsx(oe,{type:"button",variant:"default","data-testid":"join-flow-success-restart-button",onClick:()=>{a()},disabled:n,children:n?"Restarting…":"Restart node now"})]})]})}function e3({capture:e}){var t;return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Executor"}),o.jsxs("dl",{className:"m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]",children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Tool"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.name}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Version"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.version??"unknown"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Repo"}),o.jsx("dd",{className:"m-0 break-words font-mono text-[12px] text-foreground",children:e.repoRemoteUrl??"none"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Commit"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function t3({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Redactions"}),t.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No redacted attributes."}):o.jsx("div",{className:"flex flex-col gap-1.5",children:t.map((r,n)=>o.jsxs("div",{className:"grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]",children:[o.jsx("span",{className:"text-muted-foreground",children:r.span}),o.jsx("span",{className:"break-words",children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function r3({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:i}){const{capture:l,spans:a}=e;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:l.sessionId}),o.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[new Date(l.capturedAt).toLocaleString()," · ",a.length," spans"]})]}),o.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[l.repoRemoteUrl?o.jsx(oe,{variant:"secondary",size:"sm",onClick:()=>i(!0),children:"Trust repo"}):null,o.jsx(oe,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),o.jsx(oe,{variant:"default",size:"sm",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),o.jsx(e3,{capture:l}),o.jsx(t3,{spans:a}),o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Trajectory"}),a.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No spans recorded."}):o.jsx(we,{children:o.jsx(Qe,{className:"flex flex-col p-0",children:a.map((c,u)=>o.jsxs("div",{children:[u>0&&o.jsx(Ye,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5",children:[o.jsx("strong",{className:"min-w-0 truncate font-mono text-[12px] font-medium text-foreground",children:c.name}),o.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:c.spanId})]})]},c.spanId))})})]})]})}function n3(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Rd="Switch",[s3]=mn(Rd),[i3,o3]=s3(Rd),aC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:l,disabled:a,value:c="on",onCheckedChange:u,form:g,...d}=e,[_,v]=C.useState(null),x=He(t,m=>v(m)),y=C.useRef(!1),h=_?g||!!_.closest("form"):!0,[p,f]=_a({prop:s,defaultProp:i??!1,onChange:u,caller:Rd});return o.jsxs(i3,{scope:r,checked:p,disabled:a,children:[o.jsx(ze.button,{type:"button",role:"switch","aria-checked":p,"aria-required":l,"data-state":dC(p),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onClick:_e(e.onClick,m=>{f(b=>!b),h&&(y.current=m.isPropagationStopped(),y.current||m.stopPropagation())})}),h&&o.jsx(uC,{control:_,bubbles:!y.current,name:n,value:c,checked:p,required:l,disabled:a,form:g,style:{transform:"translateX(-100%)"}})]})});aC.displayName=Rd;var lC="SwitchThumb",cC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=o3(lC,r);return o.jsx(ze.span,{"data-state":dC(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});cC.displayName=lC;var a3="SwitchBubbleInput",uC=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const l=C.useRef(null),a=He(l,i),c=n3(r),u=gS(t);return C.useEffect(()=>{const g=l.current;if(!g)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&v){const x=new Event("click",{bubbles:n});v.call(g,r),g.dispatchEvent(x)}},[c,r,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});uC.displayName=a3;function dC(e){return e?"checked":"unchecked"}var hC=aC,l3=cC;const fC=C.forwardRef(({className:e,...t},r)=>o.jsx(hC,{className:J("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:r,children:o.jsx(l3,{className:J("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")})}));fC.displayName=hC.displayName;const Br=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:J("animate-pulse rounded-md bg-muted",e),...t}));Br.displayName="Skeleton";function up(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function c3(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(up(e.perArtifactTypePrice))===JSON.stringify(up(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function Px({label:e,value:t,meta:r}){return o.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:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:e}),o.jsx("strong",{className:"font-mono text-[18px] font-medium text-foreground",children:t}),o.jsx("span",{className:"truncate font-mono text-[12px] text-[var(--fg-dim)]",children:r})]})}function u3({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,onSave:s,registerRevert:i}){const[l,a]=C.useState(e.donation.enabled),[c,u]=C.useState(!1),g=C.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:l}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,l]),d=!c3(e,g),_=x=>{if(x&&!l&&!e.donation.enabled){u(!0);return}a(x)},v=()=>{const x={...g,donation:{enabled:!0}};a(!0),u(!1),i(()=>a(!1)),s(x)};return o.jsxs("div",{"data-testid":"operator-donation-status",className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-[260px] flex-[1_1_360px] flex-col gap-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Donate execution data"}),o.jsx("strong",{"data-testid":"operator-donation-mode",className:l?"font-mono text-[18px] font-medium text-[var(--vow-green)]":"font-mono text-[18px] font-medium text-foreground",children:l?"Donation is on":"Donation is off"}),o.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."})]}),o.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:[o.jsx("span",{className:l?"font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--vow-green)]":"font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:l?"On":"Off"}),o.jsx(fC,{"aria-label":"Donate produced data",checked:l,onCheckedChange:_})]})]}),o.jsxs("div",{"data-testid":"operator-donation-facts",className:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]",children:[o.jsx(Px,{label:"Eligible runs",value:String(t),meta:"local history"}),o.jsx(Px,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),o.jsx(Ze,{variant:"info","data-testid":"operator-donation-caveat",children:o.jsx(Je,{children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."})}),o.jsx(Ye,{}),o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.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"}),o.jsx(oe,{variant:"default",size:"sm",type:"button",disabled:!d||n,onClick:()=>{const x=e.donation.enabled;l!==x&&i(()=>a(x)),s(g)},children:n?"Saving…":"Save"})]})}),o.jsx(F1,{open:c,onOpenChange:u,children:o.jsxs(vg,{"data-testid":"operator-donation-confirm",children:[o.jsxs(_g,{children:[o.jsx(yg,{children:"Share future execution data"}),o.jsx(bg,{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."})]}),o.jsxs(xg,{children:[o.jsx(Sg,{children:"Cancel"}),o.jsx(wg,{onClick:v,children:"Enable donation"})]})]})})]})}function d3({onRestartPending:e=()=>{}}){const t=is(),{data:r,isLoading:n,isError:s,error:i,refetch:l}=De({queryKey:["operator-artifacts","served"],queryFn:()=>me.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=C.useRef(null),c=_=>{a.current=_},u=Gn({mutationFn:_=>me.operator.updatePricing(_),onSuccess:async()=>{a.current=null,Pn.success("Donation setting saved",{description:"Restart pending — applies on next daemon start."}),e(),await t.invalidateQueries({queryKey:["operator-artifacts"]})},onError:_=>{const v=a.current;a.current=null,v==null||v(),Pn.error("Failed to save donation setting",{description:_ instanceof Error?_.message:String(_)})}}),g=r==null?void 0:r.summary,d=g?`${g.served.totalCount} eligible runs · donation ${r!=null&&r.pricing.donation.enabled?"on":"off"} · ${g.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return o.jsxs(we,{children:[o.jsxs(Zt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(hn,{className:"flex items-center gap-2",children:[o.jsx($R,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Data donation"]}),o.jsx(Qs,{children:d})]}),o.jsx(Ce,{variant:r!=null&&r.pricing.donation.enabled?"success":"outline",children:r!=null&&r.pricing.donation.enabled?"IPFS donation on":"Donation off"})]}),o.jsxs(Qe,{children:[n&&o.jsxs("div",{"data-testid":"operator-data-market-loading",className:"flex flex-col gap-3","aria-label":"Loading execution data",children:[o.jsx(Br,{className:"h-6 w-40"}),o.jsx(Br,{className:"h-4 w-72"}),o.jsx(Br,{className:"h-20 w-full"})]}),s&&o.jsxs(Ze,{variant:"blocking",role:"alert","data-testid":"operator-data-market-error",className:"flex items-center justify-between gap-3",children:[o.jsx(Rt,{className:"text-[var(--break-red)]",children:i instanceof Error?i.message:"Failed to load execution data."}),o.jsxs(oe,{variant:"outline",size:"sm",type:"button",onClick:()=>{l()},children:[o.jsx(BR,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]})]}),r&&o.jsx(u3,{pricing:r.pricing,eligibleRuns:r.summary.served.totalCount,peerDatasetsUsed:r.summary.network.totalCount,saving:u.isPending,onSave:_=>u.mutate(_),registerRevert:c},`${r.pricing.publicEndpoint}|${r.pricing.defaultPriceUsdc}|${r.pricing.donation.enabled}|${JSON.stringify(up(r.pricing.perArtifactTypePrice))}`)]})]})}const h3=_1,f3=x1,pC=C.forwardRef(({className:e,...t},r)=>o.jsx(hg,{className:J("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:r}));pC.displayName=hg.displayName;const p3=dd("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"}}),mC=C.forwardRef(({side:e="right",className:t,children:r,...n},s)=>o.jsxs(f3,{children:[o.jsx(pC,{}),o.jsxs(fg,{ref:s,className:J(p3({side:e}),t),...n,children:[r,o.jsxs(gg,{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:[o.jsx(kl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mC.displayName=fg.displayName;const gC=({className:e,...t})=>o.jsx("div",{className:J("flex flex-col gap-2 text-left",e),...t});gC.displayName="SheetHeader";const vC=C.forwardRef(({className:e,...t},r)=>o.jsx(pg,{ref:r,className:J("font-serif text-[20px] text-foreground",e),...t}));vC.displayName=pg.displayName;const _C=C.forwardRef(({className:e,...t},r)=>o.jsx(mg,{ref:r,className:J("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));_C.displayName=mg.displayName;function xC(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB"];let r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function Mu(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function m3(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function g3(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 Tx(e){return e==null||!Number.isFinite(e)?"—":Mu(new Date(e*1e3).toISOString())}function li({title:e,children:t}){return o.jsxs(we,{children:[o.jsx(Zt,{className:"pb-2",children:o.jsx(hn,{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:e})}),o.jsx(Qe,{className:"p-4 pt-0",children:t})]})}function ci({rows:e}){return o.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:t,value:r})=>o.jsxs(C.Fragment,{children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:t}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:r??"—"})]},t))})}function nl(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Ng(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function Ax(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 dp(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function jh(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(dp(e))}function Dx({kind:e,message:t}){const r=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 o.jsx(Ze,{variant:e==="permission"?"warning":"blocking","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",children:o.jsx(Je,{children:r})})}function v3(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 _3(e){const t=Ng(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"} · ${xC(e.contentSize)} · ${m3(e.sha256)}`,at:nl(e)}}function x3({artifact:e}){const t=nl(e),r=e.projection,n=e.anchors??[],s=[{label:"state",value:Ng(e)},{label:"sha256",value:e.sha256},{label:"recorded",value:Mu(t)}],i=[{label:"envelope",value:e.envelopeCid??"—"}];r&&i.push({label:"signature",value:r.signatureHash},{label:"generated",value:Tx(r.generatedAt)},{label:"role",value:r.role},{label:"solver",value:r.solverType},{label:"evidence tier",value:r.evidenceTier});const l=r?[{label:"safe",value:r.participantSafeAddress??"—"},{label:"agent EOA",value:r.participantAgentEoa??"—"},{label:"impl",value:r.executor.implName??"—"},{label:"impl version",value:r.executor.implVersion??"—"},{label:"runtime digest",value:r.executor.runtimeBundleDigest??"—"},{label:"plugins",value:r.executor.plugins&&r.executor.plugins.length>0?o.jsx("div",{className:"flex flex-wrap gap-1",children:r.executor.plugins.map(c=>o.jsx(Ce,{variant:"outline",children:c},c))}):"—"}]:null,a=r?[{label:"task CID",value:r.taskCid??"—"},{label:"task ID",value:r.taskId??"—"},{label:"request",value:r.requestId??"—"},{label:"solution ref",value:r.solutionRef?`${r.solutionRef.envelopeCid}${r.solutionRef.ref?` (${r.solutionRef.ref})`:""}`:"—"}]:null;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsx(li,{title:"Identity",children:o.jsx(ci,{rows:s})}),o.jsx(li,{title:"Envelope",children:o.jsx(ci,{rows:i})}),l?o.jsx(li,{title:"Participant",children:o.jsx(ci,{rows:l})}):null,a?o.jsx(li,{title:"Task",children:o.jsx(ci,{rows:a})}):null,o.jsx(li,{title:"On-chain anchors",children:n.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"no on-chain anchor recorded yet"}):o.jsx("div",{className:"flex flex-col gap-3",children:n.map(c=>{const u=g3(c.chainId,c.txHash),g=[{label:"content kind",value:c.contentKind},{label:"agent ID",value:c.agentId},{label:"chain ID",value:String(c.chainId)},{label:"tx",value:u?o.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"break-all underline underline-offset-2 hover:text-foreground",children:c.txHash}):c.txHash},{label:"block",value:c.blockNumber!==null?String(c.blockNumber):"pending"},{label:"anchored",value:Tx(c.anchoredAt)},{label:"registry",value:c.identityRegistryAddress},{label:"metadata key",value:c.metadataKey}];return o.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[o.jsx(ci,{rows:g}),o.jsxs("details",{className:"mt-2",children:[o.jsx("summary",{className:"cursor-pointer font-mono text-[11px] text-muted-foreground",children:"payload (ABI-encoded)"}),o.jsx("div",{className:"mt-1 break-all font-mono text-[11px] text-foreground",children:c.payloadHex})]})]},`${c.contentKind}:${c.txHash}`)})})}),e.source==="served"?o.jsx(li,{title:"Access",children:o.jsx(ci,{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`}]})}):o.jsx(li,{title:"Source",children:o.jsx(ci,{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 y3(){var S,j,R,M;const e=is(),[t,r]=C.useState(),[n,s]=C.useState(!1),i=De({queryKey:["captures","pending"],queryFn:()=>me.captures.listPending(),refetchInterval:2500}),l=De({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>me.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=De({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>me.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),c=((S=i.data)==null?void 0:S.captures)??[],u=[...((j=l.data)==null?void 0:j.artifacts)??[],...((R=a.data)==null?void 0:R.artifacts)??[]].sort((T,L)=>nl(L).localeCompare(nl(T))),g=[...c.map(v3),...u.map(_3)].sort((T,L)=>L.at.localeCompare(T.at)),d=(t==null?void 0:t.kind)==="capture"?t.id:void 0,_=(t==null?void 0:t.kind)==="artifact"?u.find(T=>T.source===t.source&&T.sha256===t.sha256):void 0,v=i.isLoading||l.isLoading||a.isLoading,x=[i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason,a.isError?a.error:a.failureReason].filter(Boolean),y=x.find(jh),h=y??x[0];C.useEffect(()=>{if(g.length===0){t&&r(void 0),n&&s(!1);return}(!t||!g.some(T=>Ax(t,T.selection)))&&r(g[0].selection)},[g,t,n]);const p=De({queryKey:["captures",d],queryFn:()=>me.captures.get(d),enabled:!!d}),f=Gn({mutationFn:T=>me.captures.approve(T),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),m=Gn({mutationFn:T=>me.captures.skip(T),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),b=Gn({mutationFn:T=>me.captures.trustRepo(T,!0)}),w=T=>{r(T),s(!0)},k=(t==null?void 0:t.kind)==="capture"?((M=p.data)==null?void 0:M.capture.sessionId)??"Capture":(_==null?void 0:_.artifactType)??"Artifact",E=(t==null?void 0:t.kind)==="capture"&&p.data?`${new Date(p.data.capture.capturedAt).toLocaleString()} · ${p.data.spans.length} spans`:(t==null?void 0:t.kind)==="artifact"&&_?`${Ng(_)} · ${xC(_.contentSize)} · ${Mu(nl(_))}`:"Execution data detail.";return o.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[o.jsx(d3,{defaultExpanded:!0}),o.jsxs(we,{children:[o.jsx(Zt,{children:o.jsx(hn,{children:"Execution data"})}),o.jsxs(Qe,{children:[h?o.jsx("div",{className:"mb-3",children:o.jsx(Dx,{kind:y?"permission":"error",message:y?void 0:dp(h)})}):null,v&&g.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"Loading execution data."}):g.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"No execution data yet."}):o.jsx(Wl,{className:"max-h-[560px]",children:o.jsx("div",{className:"flex flex-col gap-2 pr-2",children:g.map(T=>{const L=Ax(t,T.selection);return o.jsxs(oe,{variant:"ghost","data-testid":"execution-data-row","data-state":L?"active":void 0,"aria-current":L?"true":void 0,onClick:()=>w(T.selection),className:J("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",L&&"border-primary bg-primary/[0.06]"),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("strong",{className:"min-w-0 truncate font-medium text-foreground",children:T.title}),o.jsx(Ce,{variant:"outline",className:"shrink-0",children:T.state})]}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[T.meta," · ",Mu(T.at)]})]},T.id)})})})]})]}),o.jsx(h3,{open:n,onOpenChange:s,children:o.jsxs(mC,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl","data-testid":"execution-data-sheet",children:[o.jsxs(gC,{children:[o.jsx(vC,{className:"break-all",children:k}),o.jsx(_C,{children:E})]}),o.jsx("div",{className:"mt-4",children:p.error?o.jsx(Dx,{kind:jh(p.error)?"permission":"error",message:jh(p.error)?void 0:dp(p.error)}):(t==null?void 0:t.kind)==="capture"&&p.data?o.jsx(r3,{detail:p.data,approving:f.isPending,skipping:m.isPending,onApprove:()=>d&&f.mutate(d),onSkip:()=>d&&m.mutate(d),onTrustRepo:()=>{const T=p.data.capture.repoRemoteUrl;T&&b.mutate(T)}}):(t==null?void 0:t.kind)==="artifact"&&_?o.jsx(x3,{artifact:_}):o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:v?"Loading execution data.":"Select execution data."})})]})})]})}function Lx(e){const t=b3(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(S3);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function b3(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=k3(s),a=C3(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var w3=Symbol("radix.slottable");function S3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===w3}function C3(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function k3(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function yC(e){const t=e+"CollectionProvider",[r,n]=mn(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:h,children:p}=y,f=Y.useRef(null),m=Y.useRef(new Map).current;return o.jsx(s,{scope:h,itemMap:m,collectionRef:f,children:p})};l.displayName=t;const a=e+"CollectionSlot",c=Lx(a),u=Y.forwardRef((y,h)=>{const{scope:p,children:f}=y,m=i(a,p),b=He(h,m.collectionRef);return o.jsx(c,{ref:b,children:f})});u.displayName=a;const g=e+"CollectionItemSlot",d="data-radix-collection-item",_=Lx(g),v=Y.forwardRef((y,h)=>{const{scope:p,children:f,...m}=y,b=Y.useRef(null),w=He(h,b),k=i(g,p);return Y.useEffect(()=>(k.itemMap.set(b,{ref:b,...m}),()=>void k.itemMap.delete(b))),o.jsx(_,{[d]:"",ref:w,children:f})});v.displayName=g;function x(y){const h=i(e+"CollectionConsumer",y);return Y.useCallback(()=>{const f=h.collectionRef.current;if(!f)return[];const m=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((k,E)=>m.indexOf(k.ref.current)-m.indexOf(E.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:u,ItemSlot:v},x,n]}var Nh="rovingFocusGroup.onEntryFocus",E3={bubbles:!1,cancelable:!0},Yl="RovingFocusGroup",[hp,bC,j3]=yC(Yl),[N3,wC]=mn(Yl,[j3]),[R3,P3]=N3(Yl),SC=C.forwardRef((e,t)=>o.jsx(hp.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(hp.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(T3,{...e,ref:t})})}));SC.displayName=Yl;var T3=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:g=!1,...d}=e,_=C.useRef(null),v=He(t,_),x=Fm(i),[y,h]=_a({prop:l,defaultProp:a??null,onChange:c,caller:Yl}),[p,f]=C.useState(!1),m=zt(u),b=bC(r),w=C.useRef(!1),[k,E]=C.useState(0);return C.useEffect(()=>{const S=_.current;if(S)return S.addEventListener(Nh,m),()=>S.removeEventListener(Nh,m)},[m]),o.jsx(R3,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:y,onItemFocus:C.useCallback(S=>h(S),[h]),onItemShiftTab:C.useCallback(()=>f(!0),[]),onFocusableItemAdd:C.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:C.useCallback(()=>E(S=>S-1),[]),children:o.jsx(ze.div,{tabIndex:p||k===0?-1:0,"data-orientation":n,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{w.current=!0}),onFocus:_e(e.onFocus,S=>{const j=!w.current;if(S.target===S.currentTarget&&j&&!p){const R=new CustomEvent(Nh,E3);if(S.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=b().filter(W=>W.focusable),T=M.find(W=>W.active),L=M.find(W=>W.id===y),z=[T,L,...M].filter(Boolean).map(W=>W.ref.current);EC(z,g)}}w.current=!1}),onBlur:_e(e.onBlur,()=>f(!1))})})}),CC="RovingFocusGroupItem",kC=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:l,...a}=e,c=Ws(),u=i||c,g=P3(CC,r),d=g.currentTabStopId===u,_=bC(r),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:y}=g;return C.useEffect(()=>{if(n)return v(),()=>x()},[n,v,x]),o.jsx(hp.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:o.jsx(ze.span,{tabIndex:d?0:-1,"data-orientation":g.orientation,...a,ref:t,onMouseDown:_e(e.onMouseDown,h=>{n?g.onItemFocus(u):h.preventDefault()}),onFocus:_e(e.onFocus,()=>g.onItemFocus(u)),onKeyDown:_e(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){g.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const p=L3(h,g.orientation,g.dir);if(p!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let m=_().filter(b=>b.focusable).map(b=>b.ref.current);if(p==="last")m.reverse();else if(p==="prev"||p==="next"){p==="prev"&&m.reverse();const b=m.indexOf(h.currentTarget);m=g.loop?M3(m,b+1):m.slice(b+1)}setTimeout(()=>EC(m))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});kC.displayName=CC;var A3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function D3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function L3(e,t,r){const n=D3(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return A3[n]}function EC(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function M3(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var O3=SC,I3=kC;function F3(e){const t=B3(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(H3);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function B3(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=U3(s),a=z3(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $3=Symbol("radix.slottable");function H3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$3}function z3(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function U3(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var fp=["Enter"," "],W3=["ArrowDown","PageUp","Home"],jC=["ArrowUp","PageDown","End"],V3=[...W3,...jC],q3={ltr:[...fp,"ArrowRight"],rtl:[...fp,"ArrowLeft"]},K3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zl="Menu",[Nl,G3,Q3]=yC(Zl),[Ki,NC]=mn(Zl,[Q3,va,wC]),Pd=va(),RC=wC(),[Y3,Gi]=Ki(Zl),[Z3,Xl]=Ki(Zl),PC=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:l=!0}=e,a=Pd(t),[c,u]=C.useState(null),g=C.useRef(!1),d=zt(i),_=Fm(s);return C.useEffect(()=>{const v=()=>{g.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>g.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),o.jsx(tg,{...a,children:o.jsx(Y3,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:o.jsx(Z3,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:g,dir:_,modal:l,children:n})})})};PC.displayName=Zl;var X3="MenuAnchor",Rg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Pd(r);return o.jsx(_d,{...s,...n,ref:t})});Rg.displayName=X3;var Pg="MenuPortal",[J3,TC]=Ki(Pg,{forceMount:void 0}),AC=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=Gi(Pg,t);return o.jsx(J3,{scope:t,forceMount:r,children:o.jsx(Vt,{present:r||i.open,children:o.jsx(Kl,{asChild:!0,container:s,children:n})})})};AC.displayName=Pg;var $r="MenuContent",[e5,Tg]=Ki($r),DC=C.forwardRef((e,t)=>{const r=TC($r,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Gi($r,e.__scopeMenu),l=Xl($r,e.__scopeMenu);return o.jsx(Nl.Provider,{scope:e.__scopeMenu,children:o.jsx(Vt,{present:n||i.open,children:o.jsx(Nl.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(t5,{...s,ref:t}):o.jsx(r5,{...s,ref:t})})})})}),t5=C.forwardRef((e,t)=>{const r=Gi($r,e.__scopeMenu),n=C.useRef(null),s=He(t,n);return C.useEffect(()=>{const i=n.current;if(i)return lg(i)},[]),o.jsx(Ag,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),r5=C.forwardRef((e,t)=>{const r=Gi($r,e.__scopeMenu);return o.jsx(Ag,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),n5=F3("MenuContent.ScrollLock"),Ag=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:v,disableOutsideScroll:x,...y}=e,h=Gi($r,r),p=Xl($r,r),f=Pd(r),m=RC(r),b=G3(r),[w,k]=C.useState(null),E=C.useRef(null),S=He(t,E,h.onContentChange),j=C.useRef(0),R=C.useRef(""),M=C.useRef(0),T=C.useRef(null),L=C.useRef("right"),$=C.useRef(0),z=x?kd:C.Fragment,W=x?{as:n5,allowPinchZoom:!0}:void 0,q=P=>{var A,U;const D=R.current+P,O=b().filter(G=>!G.disabled),B=document.activeElement,Q=(A=O.find(G=>G.ref.current===B))==null?void 0:A.textValue,ee=O.map(G=>G.textValue),re=m5(ee,D,Q),ye=(U=O.find(G=>G.textValue===re))==null?void 0:U.ref.current;(function G(K){R.current=K,window.clearTimeout(j.current),K!==""&&(j.current=window.setTimeout(()=>G(""),1e3))})(D),ye&&setTimeout(()=>ye.focus())};C.useEffect(()=>()=>window.clearTimeout(j.current),[]),ag();const N=C.useCallback(P=>{var O,B;return L.current===((O=T.current)==null?void 0:O.side)&&v5(P,(B=T.current)==null?void 0:B.area)},[]);return o.jsx(e5,{scope:r,searchRef:R,onItemEnter:C.useCallback(P=>{N(P)&&P.preventDefault()},[N]),onItemLeave:C.useCallback(P=>{var D;N(P)||((D=E.current)==null||D.focus(),k(null))},[N]),onTriggerLeave:C.useCallback(P=>{N(P)&&P.preventDefault()},[N]),pointerGraceTimerRef:M,onPointerGraceIntentChange:C.useCallback(P=>{T.current=P},[]),children:o.jsx(z,{...W,children:o.jsx(Sd,{asChild:!0,trapped:s,onMountAutoFocus:_e(i,P=>{var D;P.preventDefault(),(D=E.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:v,children:o.jsx(O3,{asChild:!0,...m,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:_e(c,P=>{p.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(rg,{role:"menu","aria-orientation":"vertical","data-state":QC(h.open),"data-radix-menu-content":"",dir:p.dir,...f,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:_e(y.onKeyDown,P=>{const O=P.target.closest("[data-radix-menu-content]")===P.currentTarget,B=P.ctrlKey||P.altKey||P.metaKey,Q=P.key.length===1;O&&(P.key==="Tab"&&P.preventDefault(),!B&&Q&&q(P.key));const ee=E.current;if(P.target!==ee||!V3.includes(P.key))return;P.preventDefault();const ye=b().filter(A=>!A.disabled).map(A=>A.ref.current);jC.includes(P.key)&&ye.reverse(),f5(ye)}),onBlur:_e(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(j.current),R.current="")}),onPointerMove:_e(e.onPointerMove,Rl(P=>{const D=P.target,O=$.current!==P.clientX;if(P.currentTarget.contains(D)&&O){const B=P.clientX>$.current?"right":"left";L.current=B,$.current=P.clientX}}))})})})})})})});DC.displayName=$r;var s5="MenuGroup",Dg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(ze.div,{role:"group",...n,ref:t})});Dg.displayName=s5;var i5="MenuLabel",LC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(ze.div,{...n,ref:t})});LC.displayName=i5;var Ou="MenuItem",Mx="menu.itemSelect",Td=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=C.useRef(null),l=Xl(Ou,e.__scopeMenu),a=Tg(Ou,e.__scopeMenu),c=He(t,i),u=C.useRef(!1),g=()=>{const d=i.current;if(!r&&d){const _=new CustomEvent(Mx,{bubbles:!0,cancelable:!0});d.addEventListener(Mx,v=>n==null?void 0:n(v),{once:!0}),Pw(d,_),_.defaultPrevented?u.current=!1:l.onClose()}};return o.jsx(MC,{...s,ref:c,disabled:r,onClick:_e(e.onClick,g),onPointerDown:d=>{var _;(_=e.onPointerDown)==null||_.call(e,d),u.current=!0},onPointerUp:_e(e.onPointerUp,d=>{var _;u.current||(_=d.currentTarget)==null||_.click()}),onKeyDown:_e(e.onKeyDown,d=>{const _=a.searchRef.current!=="";r||_&&d.key===" "||fp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Td.displayName=Ou;var MC=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,l=Tg(Ou,r),a=RC(r),c=C.useRef(null),u=He(t,c),[g,d]=C.useState(!1),[_,v]=C.useState("");return C.useEffect(()=>{const x=c.current;x&&v((x.textContent??"").trim())},[i.children]),o.jsx(Nl.ItemSlot,{scope:r,disabled:n,textValue:s??_,children:o.jsx(I3,{asChild:!0,...a,focusable:!n,children:o.jsx(ze.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:_e(e.onPointerMove,Rl(x=>{n?l.onItemLeave(x):(l.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,Rl(x=>l.onItemLeave(x))),onFocus:_e(e.onFocus,()=>d(!0)),onBlur:_e(e.onBlur,()=>d(!1))})})})}),o5="MenuCheckboxItem",OC=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return o.jsx(HC,{scope:e.__scopeMenu,checked:r,children:o.jsx(Td,{role:"menuitemcheckbox","aria-checked":Iu(r)?"mixed":r,...s,ref:t,"data-state":Mg(r),onSelect:_e(s.onSelect,()=>n==null?void 0:n(Iu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});OC.displayName=o5;var IC="MenuRadioGroup",[a5,l5]=Ki(IC,{value:void 0,onValueChange:()=>{}}),FC=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=zt(n);return o.jsx(a5,{scope:e.__scopeMenu,value:r,onValueChange:i,children:o.jsx(Dg,{...s,ref:t})})});FC.displayName=IC;var BC="MenuRadioItem",$C=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=l5(BC,e.__scopeMenu),i=r===s.value;return o.jsx(HC,{scope:e.__scopeMenu,checked:i,children:o.jsx(Td,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Mg(i),onSelect:_e(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});$C.displayName=BC;var Lg="MenuItemIndicator",[HC,c5]=Ki(Lg,{checked:!1}),zC=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=c5(Lg,r);return o.jsx(Vt,{present:n||Iu(i.checked)||i.checked===!0,children:o.jsx(ze.span,{...s,ref:t,"data-state":Mg(i.checked)})})});zC.displayName=Lg;var u5="MenuSeparator",UC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});UC.displayName=u5;var d5="MenuArrow",WC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Pd(r);return o.jsx(ng,{...s,...n,ref:t})});WC.displayName=d5;var h5="MenuSub",[qF,VC]=Ki(h5),qa="MenuSubTrigger",qC=C.forwardRef((e,t)=>{const r=Gi(qa,e.__scopeMenu),n=Xl(qa,e.__scopeMenu),s=VC(qa,e.__scopeMenu),i=Tg(qa,e.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},g=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>g,[g]),C.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),o.jsx(Rg,{asChild:!0,...u,children:o.jsx(MC,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":QC(r.open),...e,ref:os(t,s.onTriggerChange),onClick:d=>{var _;(_=e.onClick)==null||_.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,Rl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:_e(e.onPointerLeave,Rl(d=>{var v,x;g();const _=(v=r.content)==null?void 0:v.getBoundingClientRect();if(_){const y=(x=r.content)==null?void 0:x.dataset.side,h=y==="right",p=h?-5:5,f=_[h?"left":"right"],m=_[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:f,y:_.top},{x:m,y:_.top},{x:m,y:_.bottom},{x:f,y:_.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,d=>{var v;const _=i.searchRef.current!=="";e.disabled||_&&d.key===" "||q3[n.dir].includes(d.key)&&(r.onOpenChange(!0),(v=r.content)==null||v.focus(),d.preventDefault())})})})});qC.displayName=qa;var KC="MenuSubContent",GC=C.forwardRef((e,t)=>{const r=TC($r,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Gi($r,e.__scopeMenu),l=Xl($r,e.__scopeMenu),a=VC(KC,e.__scopeMenu),c=C.useRef(null),u=He(t,c);return o.jsx(Nl.Provider,{scope:e.__scopeMenu,children:o.jsx(Vt,{present:n||i.open,children:o.jsx(Nl.Slot,{scope:e.__scopeMenu,children:o.jsx(Ag,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var d;l.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:_e(e.onFocusOutside,g=>{g.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:_e(e.onKeyDown,g=>{var v;const d=g.currentTarget.contains(g.target),_=K3[l.dir].includes(g.key);d&&_&&(i.onOpenChange(!1),(v=a.trigger)==null||v.focus(),g.preventDefault())})})})})})});GC.displayName=KC;function QC(e){return e?"open":"closed"}function Iu(e){return e==="indeterminate"}function Mg(e){return Iu(e)?"indeterminate":e?"checked":"unchecked"}function f5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function p5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function m5(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=p5(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==r));const c=l.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function g5(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,g=a.y,d=c.x,_=c.y;g>n!=_>n&&r<(d-u)*(n-g)/(_-g)+u&&(s=!s)}return s}function v5(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return g5(r,t)}function Rl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _5=PC,x5=Rg,y5=AC,b5=DC,w5=Dg,S5=LC,C5=Td,k5=OC,E5=FC,j5=$C,N5=zC,R5=UC,P5=WC,T5=qC,A5=GC,Ad="DropdownMenu",[D5]=mn(Ad,[NC]),er=NC(),[L5,YC]=D5(Ad),ZC=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:a=!0}=e,c=er(t),u=C.useRef(null),[g,d]=_a({prop:s,defaultProp:i??!1,onChange:l,caller:Ad});return o.jsx(L5,{scope:t,triggerId:Ws(),triggerRef:u,contentId:Ws(),open:g,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(_=>!_),[d]),modal:a,children:o.jsx(_5,{...c,open:g,onOpenChange:d,dir:n,modal:a,children:r})})};ZC.displayName=Ad;var XC="DropdownMenuTrigger",JC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=YC(XC,r),l=er(r);return o.jsx(x5,{asChild:!0,...l,children:o.jsx(ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:os(t,i.triggerRef),onPointerDown:_e(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:_e(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});JC.displayName=XC;var M5="DropdownMenuPortal",ek=e=>{const{__scopeDropdownMenu:t,...r}=e,n=er(t);return o.jsx(y5,{...n,...r})};ek.displayName=M5;var tk="DropdownMenuContent",rk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=YC(tk,r),i=er(r),l=C.useRef(!1);return o.jsx(b5,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,a=>{var c;l.current||(c=s.triggerRef.current)==null||c.focus(),l.current=!1,a.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,g=c.button===2||u;(!s.modal||g)&&(l.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)"}})});rk.displayName=tk;var O5="DropdownMenuGroup",I5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(w5,{...s,...n,ref:t})});I5.displayName=O5;var F5="DropdownMenuLabel",nk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(S5,{...s,...n,ref:t})});nk.displayName=F5;var B5="DropdownMenuItem",sk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(C5,{...s,...n,ref:t})});sk.displayName=B5;var $5="DropdownMenuCheckboxItem",ik=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(k5,{...s,...n,ref:t})});ik.displayName=$5;var H5="DropdownMenuRadioGroup",z5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(E5,{...s,...n,ref:t})});z5.displayName=H5;var U5="DropdownMenuRadioItem",W5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(j5,{...s,...n,ref:t})});W5.displayName=U5;var V5="DropdownMenuItemIndicator",ok=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(N5,{...s,...n,ref:t})});ok.displayName=V5;var q5="DropdownMenuSeparator",ak=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(R5,{...s,...n,ref:t})});ak.displayName=q5;var K5="DropdownMenuArrow",G5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(P5,{...s,...n,ref:t})});G5.displayName=K5;var Q5="DropdownMenuSubTrigger",Y5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(T5,{...s,...n,ref:t})});Y5.displayName=Q5;var Z5="DropdownMenuSubContent",X5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=er(r);return o.jsx(A5,{...s,...n,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)"}})});X5.displayName=Z5;var J5=ZC,e4=JC,t4=ek,lk=rk,ck=nk,uk=sk,dk=ik,r4=ok,hk=ak;const n4=J5,s4=e4,fk=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(t4,{children:o.jsx(lk,{ref:n,sideOffset:t,className:J("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),...r})}));fk.displayName=lk.displayName;const pk=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(uk,{ref:n,className:J("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),...r}));pk.displayName=uk.displayName;const i4=C.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(dk,{ref:s,className:J("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:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(r4,{children:o.jsx(NR,{className:"h-3 w-3"})})}),t]}));i4.displayName=dk.displayName;const o4=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(ck,{ref:n,className:J("px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",t&&"pl-8",e),...r}));o4.displayName=ck.displayName;const a4=C.forwardRef(({className:e,...t},r)=>o.jsx(hk,{ref:r,className:J("-mx-1 my-1 h-px bg-border",e),...t}));a4.displayName=hk.displayName;const Ox=[{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 l4({to:e,label:t}){const[r]=vR(e);return o.jsx("li",{children:o.jsx(ur,{href:e,"aria-current":r?"page":void 0,className:J("block rounded-sm px-3 py-2 font-mono text-[12px] tracking-[0.08em] no-underline transition-colors",r?"bg-[var(--bg-elevated)] font-medium text-foreground":"bg-transparent font-normal text-[var(--fg-muted)] hover:text-foreground"),children:t})})}function c4(){const[,e]=Ur();return o.jsxs("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",className:"flex min-w-[160px] flex-col pt-1",children:[o.jsx("div",{className:"mb-2 sm:hidden",children:o.jsxs(n4,{children:[o.jsx(s4,{asChild:!0,children:o.jsxs(oe,{variant:"outline",size:"sm","data-testid":"operator-sub-nav-trigger",children:[o.jsx(MR,{className:"h-3.5 w-3.5"})," Sections"]})}),o.jsx(fk,{align:"start",children:Ox.map(t=>o.jsx(pk,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),o.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:Ox.map(t=>o.jsx(l4,{to:t.to,label:t.label},t.to))})]})}function Ia({children:e}){return o.jsxs("div",{"data-testid":"operator-shell",className:"flex items-start gap-6 p-6",children:[o.jsx(c4,{}),o.jsx("div",{className:"min-w-0 flex-1",children:e})]})}function Rh(e){const t=Sr(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Do(t)}}function Ix(e,t){const r=Sr(t.harness);if(e.harness!==r||e.model!==(t.model??Do(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let a=0;a<n.length;a+=1)if(n[a]!==s[a])return!0;const i=[...e.disabledDefaultPlugins].sort(),l=[...t.disabledDefaultPlugins??[]].sort();if(i.length!==l.length)return!0;for(let a=0;a<i.length;a+=1)if(i[a]!==l[a])return!0;return!1}const Fx="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 u4({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[i,l]=C.useState(r),[a,c]=C.useState(()=>Rh(e)),u=C.useRef(null),g=C.useRef(null),d=is(),_=t!==void 0,v=De({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>me.solvernets.getManifest(e.manifestCid),enabled:!_&&!!e.manifestCid,staleTime:1/0,retry:!1}),x=De({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets(),enabled:!_}),h=(()=>{var Q;if(_)return t;const B=(Q=v.data)==null?void 0:Q.manifest;if(!(!B||!x.data))return x.data.nets.find(ee=>ee.contract.id===B.contract.id&&ee.contract.version===B.contract.version)})(),p=e.contract??(h==null?void 0:h.contract),f=!_&&(v.isLoading||x.isLoading),m=!_&&v.isError&&!v.isLoading;C.useEffect(()=>{Ix(a,e)||c(Rh(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),C.useEffect(()=>{r&&(l(!0),n==="harness"&&setTimeout(()=>{var B,Q;(B=u.current)==null||B.scrollIntoView({block:"center",behavior:"smooth"}),(Q=g.current)==null||Q.focus()},50))},[r,n]);const b=((h==null?void 0:h.compatibleHarnesses)??[]).filter(B=>B.supportsRoles.includes("solving")).map(B=>({...B,name:Sr(B.name)})).filter((B,Q,ee)=>ee.findIndex(re=>re.name===B.name)===Q),w=new Set(b.map(B=>B.name)),k=a.harness!==""&&b.length>0&&![...w].some(B=>zD(B,a.harness)),E=h?`${h.contract.id}@${h.contract.version}`:"",S=jd(a.harness),j=Gn({mutationFn:()=>me.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...p!==void 0?{contract:{id:p.id,version:p.version}}:{},roles:e.roles,...a.harness?{harness:a.harness}:{},plugins:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,...a.model?{model:a.model}:{}}),onSuccess:B=>{d.invalidateQueries({queryKey:["operator","joined"]}),B.restartRequired&&(s==null||s())}}),[R,M]=C.useState(!1),T=e.roles.includes("solver"),L=iC(T?a.harness:void 0,T?a.model:void 0),$=T&&L.requiresConfirmation,z=$&&!R,[W,q]=C.useState(!1),N=Gn({mutationFn:()=>me.operator.leave(e.manifestCid),onSuccess:B=>{d.invalidateQueries({queryKey:["operator","joined"]}),B.restartRequired&&(s==null||s()),q(!1)}}),P=Ix(a,e),D=e.name??e.manifestCid,O=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return o.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":i?"true":"false",className:"flex flex-col gap-2.5 rounded-md border border-border bg-background px-4 py-3.5",children:[o.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{"data-testid":"joined-net-card-name",className:"truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]",children:D}),o.jsxs("div",{className:"flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground",children:[e.roles.map(B=>o.jsx(d4,{label:B},B)),o.jsxs("span",{className:"text-dim",children:["cid ",O]})]})]}),m?o.jsx("div",{className:"flex flex-col items-end gap-1.5",children:W?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:N.isPending,onClick:()=>q(!1),children:"Cancel"}),o.jsx(oe,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:N.isPending,onClick:()=>N.mutate(),children:N.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(oe,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>q(!0),children:[o.jsx(kl,{"aria-hidden":"true",className:"!size-3"}),"Leave"]})}):o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-toggle",onClick:()=>l(B=>!B),children:i?o.jsxs(o.Fragment,{children:[o.jsx(ud,{"aria-hidden":"true",className:"!size-3.5"}),"Close"]}):o.jsxs(o.Fragment,{children:[o.jsx(xw,{"aria-hidden":"true",className:"!size-3.5"}),"Edit"]})})]}),m&&o.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:[o.jsx(Ce,{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.",N.isError&&o.jsx("div",{role:"alert",className:"mt-1.5 text-[11px] text-destructive",children:N.error instanceof Error?N.error.message:"Leave failed."})]}),!i&&!m&&o.jsx(Bx,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:k?`does not support ${E}`:null,warningTestId:"joined-net-card-warn-collapsed"}),m&&o.jsx(Bx,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),i&&!m&&o.jsxs("div",{"data-testid":"joined-net-card-form",className:"flex flex-col gap-3.5 border-t border-border pt-3",children:[o.jsxs("div",{ref:u,className:"flex flex-col gap-1.5",children:[o.jsx(br,{htmlFor:"joined-net-card-harness-select",children:"Harness"}),o.jsxs("select",{ref:g,id:"joined-net-card-harness-select","aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:a.harness,onChange:B=>{const Q=B.target.value;c(ee=>({...ee,harness:Q,model:Do(Q)})),M(!1)},className:J(Fx,k&&"border-destructive"),children:[a.harness===""&&o.jsx("option",{value:"",children:"—"}),b.map(B=>o.jsx("option",{value:B.name,children:FS(B.name,B.version)},B.name)),a.harness&&b.length>0&&!w.has(a.harness)&&o.jsxs("option",{value:a.harness,children:[Vs(a.harness)," (incompatible)"]}),a.harness&&b.length===0&&o.jsx("option",{value:a.harness,children:Vs(a.harness)})]}),k&&o.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",className:"font-mono text-[11px] leading-relaxed text-destructive",children:["⚠ This harness does not support ",o.jsx("span",{className:"text-foreground",children:E}),".",b.length>0&&o.jsxs(o.Fragment,{children:[" Compatible: ",b.map((B,Q)=>o.jsxs("span",{className:"text-primary",children:[Vs(B.name),Q<b.length-1?" · ":""]},B.name))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(br,{children:"Plugins"}),f?o.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?o.jsx(cp,{available:[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(B,Q)=>c(ee=>({...ee,plugins:B,disabledDefaultPlugins:Q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx(cp,{available:(h==null?void 0:h.compatiblePlugins)??[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(B,Q)=>c(ee=>({...ee,plugins:B,disabledDefaultPlugins:Q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.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."})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(br,{htmlFor:"joined-net-card-model-select",children:"Model"}),o.jsxs("select",{id:"joined-net-card-model-select","aria-label":"Model","data-testid":"joined-net-card-model-select",value:a.model,onChange:B=>{c({...a,model:B.target.value}),M(!1)},className:Fx,children:[S.map(B=>o.jsx("option",{value:B.id,children:B.label},B.id)),(()=>{const B=Cg(a.model,a.harness);return B.isCustom?o.jsx("option",{value:a.model,children:B.label},a.model):null})()]})]}),T&&o.jsx(oC,{harness:a.harness,modelId:a.model,variant:"inline",testIdPrefix:"joined-net-card-cost"}),$&&o.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":R?"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:[o.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:R,onChange:B=>M(B.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"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),j.isError&&o.jsx("span",{role:"alert","data-testid":"joined-net-card-error",className:"font-mono text-[12px] text-destructive",children:j.error instanceof Error?j.error.message:"Save failed."}),o.jsx(Ye,{}),o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-dim",children:[o.jsx("span",{children:P?"Restart required to apply.":"No unsaved changes."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-cancel",disabled:!P||j.isPending,onClick:()=>c(Rh(e)),children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm","data-testid":"joined-net-card-save",disabled:!P||j.isPending||z,onClick:()=>j.mutate(),children:j.isPending?"Saving…":"Save"})]})]}),o.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:[o.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."}),W?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:N.isPending,onClick:()=>q(!1),children:"Cancel"}),o.jsx(oe,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:N.isPending,onClick:()=>N.mutate(),children:N.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(oe,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>q(!0),children:[o.jsx(kl,{"aria-hidden":"true",className:"!size-3"}),"Leave SolverNet"]})]})]})]})}function Bx({harness:e,plugins:t,model:r,harnessWarning:n,warningTestId:s}){return o.jsxs("div",{className:"grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground",children:[o.jsx("span",{children:"harness"}),o.jsxs("span",{className:"text-foreground",children:[e?Vs(e):o.jsx("span",{className:"text-dim",children:"—"}),n&&s&&o.jsxs("span",{"data-testid":s,className:"ml-2.5 text-destructive",children:["⚠ ",n]})]}),o.jsx("span",{children:"plugins"}),o.jsx("span",{className:"text-foreground",children:(t??[]).length===0?o.jsx("span",{className:"text-dim",children:"—"}):`${t.length} active`}),o.jsx("span",{children:"model"}),o.jsx("span",{className:"text-foreground",children:r?Cg(r,Sr(e)).label:o.jsx("span",{className:"text-dim",children:"—"})})]})}function d4({label:e}){return o.jsx(Ce,{variant:"outline","data-testid":"joined-net-card-role",className:"px-1.5 py-px text-[10px]",children:e})}function h4({onRestartPending:e}={}){const t=De({queryKey:["operator","joined"],queryFn:()=>me.operator.listJoined(),refetchInterval:3e4}),r=C.useMemo(()=>{var s;const n=((s=t.data)==null?void 0:s.joinedSolverNets)??{};return Object.values(n)},[t.data]);return o.jsxs("div",{"data-testid":"memberships-tab",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Joined · ",r.length]}),t.isError&&o.jsx("span",{role:"alert",className:"font-mono text-[11px] text-[var(--break-red)]",children:"Failed to load joined SolverNets."})]}),t.isLoading&&o.jsxs("div",{"data-testid":"memberships-tab-loading",className:"flex flex-col gap-3","aria-label":"Loading",children:[o.jsx(Br,{className:"h-20 w-full"}),o.jsx(Br,{className:"h-20 w-full"})]}),!t.isLoading&&r.length===0&&o.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"," ",o.jsx(ur,{href:"/operator/registry",className:"text-primary no-underline hover:underline",children:"Registry"})," ","to participate."]}),r.map(n=>o.jsx(u4,{joined:n,onRestartPending:e},n.manifestCid))]})}const $x={launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"}};function f4(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function p4(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function m4(e){if(e instanceof Error){const 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}const g4={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 v4(e){switch(m4(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 g4;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function _4({code:e,message:t}){return e==="rpc_rate_limited"?o.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:[o.jsx("span",{children:"RPC rate-limited — add your own key"}),o.jsx(ur,{href:"/operator#network","data-testid":"registry-catalog-warn-action",className:"text-primary no-underline hover:underline",children:"Network settings →"})]}):o.jsxs("span",{"data-testid":"registry-catalog-warn",className:"normal-case tracking-normal text-[var(--wane)]",children:["stale (",t,")"]})}function x4({status:e}){const t=$x[e]??$x.launched;return o.jsx(Ce,{"data-testid":"registry-status-badge","data-status":e,variant:t.variant,className:"whitespace-nowrap",children:t.label})}function y4({openRoles:e}){return e.length===0?o.jsx("span",{className:"text-[12px] text-[var(--fg-dim)]",children:"no open roles"}):o.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map(t=>o.jsx(Ce,{"data-testid":"registry-open-role","data-role":t,variant:"outline",className:"rounded-full text-foreground",children:t},t))})}function b4({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0,s=e.status==="launched";return o.jsx(we,{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,className:"flex flex-col gap-3 p-4",children:o.jsxs("article",{className:"flex flex-col gap-3",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-[15px] font-medium text-foreground",children:e.name}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:["Launcher: ",f4(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),o.jsx(x4,{status:e.status})]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Open roles"}),o.jsx(y4,{openRoles:e.openRoles}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:Ds(e.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:Ds(e.verdictPriceWei)})]}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[n&&o.jsxs(Ce,{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,variant:"success",className:"rounded-full px-2.5 py-1",children:["JOINED · ",(t??[]).join(", ")]}),s?o.jsx(oe,{asChild:!0,variant:n?"secondary":"default","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,children:o.jsx(ur,{href:r,children:n?"Edit":"Join"})}):o.jsx(oe,{type:"button",variant:"secondary","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,disabled:!0,"aria-disabled":!0,className:"pointer-events-none",children:n?"Edit":"Join"})]})]})})}function w4({refetchIntervalMs:e=3e4}={}){var _;const{data:t,isLoading:r,isError:n,error:s,refetch:i}=De({queryKey:["solvernets","registry"],queryFn:()=>me.solvernets.listRegistry(),refetchInterval:e}),l=De({queryKey:["operator","joined"],queryFn:()=>me.operator.listJoined(),refetchInterval:e}),a=((_=l.data)==null?void 0:_.joinedSolverNets)??{};if(r||l.isLoading)return o.jsx("p",{"data-testid":"registry-catalog-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading catalog…"});if(n||l.isError){const v=n?s:l.error,x=v4(v);return o.jsxs(Ze,{"data-testid":"registry-catalog-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Rt,{className:"font-mono text-[13px] font-medium text-destructive",children:x.title}),o.jsx(Je,{className:"text-[12px] text-[var(--fg-muted)]",children:x.detail}),x.actionHref&&x.actionLabel&&o.jsx(ur,{href:x.actionHref,"data-testid":"registry-catalog-error-action",className:"mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline",children:x.actionLabel})]}),o.jsx(oe,{type:"button",variant:"secondary",size:"sm","data-testid":"registry-catalog-retry",onClick:()=>{i()},children:"Retry"})]})}const c=(t==null?void 0:t.summaries)??[],u=c.filter(v=>a[v.manifestCid]===void 0),g=p4((t==null?void 0:t.lastRefreshedAt)??null),d=(t==null?void 0:t.lastError)??null;return o.jsxs("div",{"data-testid":"registry-catalog",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:[o.jsxs("span",{"data-testid":"registry-catalog-meta",children:[u.length," discoverable · last refreshed"," ",g??"never"]}),d&&o.jsx(_4,{code:d.code,message:d.message})]}),u.length===0?o.jsx(we,{"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."}):o.jsx("div",{className:"flex flex-col gap-2.5",children:u.map(v=>{var x;return o.jsx(b4,{summary:v,joinedRoles:(x=a[v.manifestCid])==null?void 0:x.roles},v.manifestCid)})})]})}function S4(){return o.jsxs("div",{"data-testid":"registry-tab",className:"flex flex-col gap-3",children:[o.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[o.jsx(PR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Discover"]}),o.jsx(w4,{})]})}function C4({onRestartPending:e=()=>{}}={}){const{data:t}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:1500}),r=(t==null?void 0:t.chain)??"base-sepolia",n=(t==null?void 0:t.rpcUrl)??"",s=(t==null?void 0:t.defaultRpcUrl)??(r==="base"?"https://mainnet.base.org":"https://base-sepolia-rpc.publicnode.com");return o.jsx("div",{"data-testid":"network-tab",children:o.jsx(k4,{chain:r,rpcUrl:n,defaultRpcUrl:s,rpcHealthy:!0,onRestartPending:e})})}function k4({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s}){const[i,l]=C.useState(t),[a,c]=C.useState(!1),u=i!==t,g=t===r,d=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",_=d.split(" (")[0],v=async()=>{c(!0);try{const x=i.length===0?null:i,y=await me.updateNetwork({rpcUrl:x});Pn.success("RPC URL saved",{description:y.restartRequired?"Restart pending — applies on next daemon start.":"Applied to the running daemon."}),y.restartRequired&&s()}catch(x){Pn.error("Failed to save RPC URL",{description:x instanceof Error?x.message:String(x)})}finally{c(!1)}};return o.jsxs(we,{children:[o.jsxs(Zt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(hn,{className:"flex items-center gap-2",children:[o.jsx(OR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Network"]}),o.jsxs(Qs,{children:[_," · ",t]})]}),o.jsx(Ce,{variant:n?"success":"destructive",children:n?"Healthy":"Unreachable"})]}),o.jsxs(Qe,{children:[o.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(br,{children:"Chain"}),o.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}),o.jsx(Ce,{variant:"outline",className:"self-start",children:"locked"}),o.jsx("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Switching chains resets fleet state — that's a separate flow."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(br,{htmlFor:"rpc-url",children:"RPC URL"}),u&&o.jsx(Ce,{variant:"warning",children:"Restart"})]}),o.jsx(pt,{id:"rpc-url",type:"text",value:i,onChange:x=>l(x.target.value),placeholder:r,className:u?"border-primary":void 0}),o.jsx(oe,{variant:"link",size:"sm",type:"button",onClick:()=>l(""),className:"h-auto self-start p-0 text-[11px]",children:"Use default"}),g&&o.jsxs(Ze,{variant:"warning",className:"mt-3","data-testid":"network-shared-rpc-warning",children:[o.jsx(Lm,{className:"h-4 w-4 text-[var(--wane)]"}),o.jsx(Rt,{className:"text-[var(--wane)]",children:"Shared RPC"}),o.jsxs(Je,{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"," ",o.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 ",o.jsx(No,{className:"h-2.5 w-2.5"})]}),","," ",o.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 ",o.jsx(No,{className:"h-2.5 w-2.5"})]}),", or"," ",o.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 ",o.jsx(No,{className:"h-2.5 w-2.5"})]})," ","and paste it above."]})]}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Default: ",r]})]})]}),u&&o.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2 border-t border-border pt-4",children:[o.jsx(oe,{variant:"secondary",size:"sm",type:"button",onClick:()=>l(t),children:"Cancel"}),o.jsx(oe,{variant:"default",size:"sm",type:"button",disabled:a,onClick:()=>{v()},children:a?"Saving…":"Save"})]})]})]})}var Jl=e=>e.type==="checkbox",_i=e=>e instanceof Date,At=e=>e==null;const mk=e=>typeof e=="object";var lt=e=>!At(e)&&!Array.isArray(e)&&mk(e)&&!_i(e),gk=e=>lt(e)&&e.target?Jl(e.target)?e.target.checked:e.target.value:e,pp=(e,t)=>{const r=t.split("."),n=[];let s=r[0];for(let i=1;i<r.length;s+="."+r[i++])!isNaN(+r[i])&&e.has(s)&&n.push(s);return n},E4=e=>{const t=e.constructor&&e.constructor.prototype;return lt(t)&&t.hasOwnProperty("isPrototypeOf")},Og=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Og&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(lt(e)&&E4(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=gt(e[s]));return n}var ec=e=>/^\w*$/.test(e),nt=e=>e===void 0,Ig=e=>Array.isArray(e)?e.filter(Boolean):[],Dd=e=>Ig(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ce=(e,t,r)=>{if(!t||!lt(e))return r;const s=(ec(t)?[t]:Dd(t)).reduce((i,l)=>At(i)?void 0:i[l],e);return nt(s)||s===e?nt(e[t])?r:e[t]:s},mr=e=>typeof e=="boolean",Ht=e=>typeof e=="function",We=(e,t,r)=>{let n=-1;const s=ec(t)?[t]:Dd(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const u=e[a];c=lt(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const _s={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},on={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ph="form",vk="root",Fg=Y.createContext(null);Fg.displayName="HookFormControlContext";const Bg=()=>Y.useContext(Fg);var _k=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==on.all&&(t._proxyFormState[l]=!n||on.all),r&&(r[l]=!0),e[l]}});return s};const $g=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function j4(e){const t=Bg(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[l,a]=Y.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=Y.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $g(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),Y.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Y.useMemo(()=>_k(l,r,c.current,!1),[l,r])}var Ut=e=>typeof e=="string",mp=(e,t,r,n,s)=>Ut(e)?(n&&t.watch.add(e),ce(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),ce(r,i))):(n&&(t.watchAll=!0),r),gp=e=>At(e)||!mk(e);function gr(e,t,r=new WeakSet){if(e===t)return!0;if(gp(e)||gp(t))return Object.is(e,t);if(_i(e)&&_i(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const l=e[i];if(!(i in t))return!1;if(i!=="ref"){const a=t[i];if(_i(l)&&_i(a)||(lt(l)||Array.isArray(l))&&(lt(a)||Array.isArray(a))?!gr(l,a,r):!Object.is(l,a))return!1}}return!0}function N4(e){const t=Bg(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=Y.useRef(s),u=Y.useRef(a),g=Y.useRef(void 0),d=Y.useRef(r),_=Y.useRef(n);u.current=a;const[v,x]=Y.useState(()=>{const b=r._getWatch(n,c.current);return u.current?u.current(b):b}),y=Y.useCallback(b=>{const w=mp(n,r._names,b||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),h=Y.useCallback(b=>{if(!i){const w=mp(n,r._names,b||r._formValues,!1,c.current);if(u.current){const k=u.current(w);gr(k,g.current)||(x(k),g.current=k)}else x(w)}},[r._formValues,r._names,i,n]);$g(()=>((d.current!==r||!gr(_.current,n))&&(d.current=r,_.current=n,h()),r._subscribe({name:n,formState:{values:!0},exact:l,callback:b=>{h(b.values)}})),[r,l,n,h]),Y.useEffect(()=>r._removeUnmounted());const p=d.current!==r,f=_.current,m=Y.useMemo(()=>{if(i)return null;const b=!p&&!gr(f,n);return p||b?y():null},[i,p,n,f,y]);return m!==null?m:v}function R4(e){const t=Bg(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:l,exact:a=!0}=e,c=!!pp(s._names.array,r).length,u=Y.useMemo(()=>ce(s._formValues,r,ce(s._defaultValues,r,l)),[s,r,l]),g=N4({control:s,name:r,defaultValue:u,exact:a}),d=j4({control:s,name:r,exact:a}),_=Y.useRef(e),v=Y.useRef(s.register(r,{...e.rules,value:g,...mr(e.disabled)?{disabled:e.disabled}:{}}));_.current=e;const x=Y.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!ce(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ce(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ce(d.validatingFields,r)},error:{enumerable:!0,get:()=>ce(d.errors,r)}}),[d,r]),y=Y.useCallback(m=>v.current.onChange({target:{value:gk(m),name:r},type:_s.CHANGE}),[r]),h=Y.useCallback(()=>v.current.onBlur({target:{value:ce(s._formValues,r),name:r},type:_s.BLUR}),[r,s._formValues]),p=Y.useCallback(m=>{const b=ce(s._fields,r);b&&b._f&&m&&(b._f.ref={focus:()=>Ht(m.focus)&&m.focus(),select:()=>Ht(m.select)&&m.select(),setCustomValidity:w=>Ht(m.setCustomValidity)&&m.setCustomValidity(w),reportValidity:()=>Ht(m.reportValidity)&&m.reportValidity()})},[s._fields,r]),f=Y.useMemo(()=>({name:r,value:g,...mr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:y,onBlur:h,ref:p}),[r,n,d.disabled,y,h,p,g]);return Y.useEffect(()=>{const m=s._options.shouldUnregister||i;s.register(r,{..._.current.rules,...mr(_.current.disabled)?{disabled:_.current.disabled}:{}});const b=(w,k)=>{const E=ce(s._fields,w);E&&E._f&&(E._f.mount=k)};if(b(r,!0),m){const w=gt(ce(s._defaultValues,r,ce(s._options.defaultValues,r,_.current.defaultValue)));We(s._defaultValues,r,w),nt(ce(s._formValues,r))&&We(s._formValues,r,w)}return!c&&s.register(r),()=>{(c?m&&!s._state.action:m)?s.unregister(r):b(r,!1)}},[r,s,c,i]),Y.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),Y.useMemo(()=>({field:f,formState:d,fieldState:x}),[f,d,x])}const P4=e=>e.render(R4(e)),Hg=Y.createContext(null);Hg.displayName="HookFormContext";const T4=()=>Y.useContext(Hg),A4=e=>{const{children:t,watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:g,resetField:d,reset:_,handleSubmit:v,unregister:x,control:y,register:h,setFocus:p,subscribe:f}=e,m=Y.useMemo(()=>({watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:g,resetField:d,reset:_,handleSubmit:v,unregister:x,control:y,register:h,setFocus:p,subscribe:f}),[l,y,g,s,n,v,h,_,d,i,p,a,c,f,u,x,r]);return Y.createElement(Hg.Provider,{value:m},Y.createElement(Fg.Provider,{value:m.control},t))};var xk=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},sl=e=>Array.isArray(e)?e:[e],Hx=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function yk(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&lt(s)&&i){const l=yk(s,i);lt(l)&&(r[n]=l)}else e[n]&&(r[n]=i)}return r}var Bt=e=>lt(e)&&!Object.keys(e).length,zg=e=>e.type==="file",Fu=e=>{if(!Og)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},bk=e=>e.type==="select-multiple",Ug=e=>e.type==="radio",D4=e=>Ug(e)||Jl(e),Th=e=>Fu(e)&&e.isConnected;function L4(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(At(e)){e=void 0;break}e=e[t[n]],n++}return e}function M4(e){for(const t in e)if(e.hasOwnProperty(t)&&!nt(e[t]))return!1;return!0}function _t(e,t){if(Ut(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:ec(t)?[t]:Dd(t),n=r.length===1?e:L4(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(lt(n)&&Bt(n)||Array.isArray(n)&&M4(n))&&_t(e,r.slice(0,-1)),e}var O4=e=>{for(const t in e)if(Ht(e[t]))return!0;return!1};function wk(e){return Array.isArray(e)||lt(e)&&!O4(e)}function vp(e,t={}){for(const r in e){const n=e[r];wk(n)?(t[r]=Array.isArray(n)?[]:{},vp(n,t[r])):nt(n)||(t[r]=!0)}return t}function _p(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>_p(r));return t.some(r=>r!==void 0)?t:void 0}if(lt(e)){const t={};for(const r in e){const n=_p(e[r]);nt(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function oo(e,t,r){r||(r=vp(t));for(const n in e){const s=e[n];if(wk(s))nt(t)||gp(r[n])?r[n]=vp(s,Array.isArray(s)?[]:{}):oo(s,At(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!gr(s,i)}}return _p(r)||{}}const zx={value:!1,isValid:!1},Ux={value:!0,isValid:!0};var Sk=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!nt(e[0].attributes.value)?nt(e[0].value)||e[0].value===""?Ux:{value:e[0].value,isValid:!0}:Ux:zx}return zx},Ck=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>nt(e)?e:t?e===""?NaN:e&&+e:r&&Ut(e)?new Date(e):n?n(e):e;const Wx={isValid:!1,value:null};var kk=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Wx):Wx;function Vx(e){const t=e.ref;return zg(t)?t.files:Ug(t)?kk(e.refs).value:bk(t)?[...t.selectedOptions].map(({value:r})=>r):Jl(t)?Sk(e.refs).value:Ck(nt(t.value)?e.ref.value:t.value,e)}var I4=(e,t,r,n)=>{const s={};for(const i of e){const l=ce(t,i);l&&We(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Bu=e=>e instanceof RegExp,Fa=e=>nt(e)?e:Bu(e)?e.source:lt(e)?Bu(e.value)?e.value.source:e.value:e,qx=e=>({isOnSubmit:!e||e===on.onSubmit,isOnBlur:e===on.onBlur,isOnChange:e===on.onChange,isOnAll:e===on.all,isOnTouch:e===on.onTouched});const Kx="AsyncFunction";var F4=e=>!!e&&!!e.validate&&!!(Ht(e.validate)&&e.validate.constructor.name===Kx||lt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Kx)),B4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Gx=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const il=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=ce(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(il(a,t))break}else if(lt(a)&&il(a,t))break}}};function Qx(e,t,r){const n=ce(e,r);if(n||ec(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=ce(t,i),a=ce(e,i);if(l&&!Array.isArray(l)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var $4=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Bt(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!n||on.all))},H4=(e,t,r)=>!e||!t||e===t||sl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),z4=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,U4=(e,t)=>!Ig(ce(e,t)).length&&_t(e,t),Yx=(e,t,r)=>{const n=sl(ce(e,r));return We(n,vk,t[r]),We(e,r,n),e};function Zx(e,t,r="validate"){if(Ut(e)||Array.isArray(e)&&e.every(Ut)||mr(e)&&!e)return{type:r,message:Ut(e)?e:"",ref:t}}var so=e=>lt(e)&&!Bu(e)?e:{value:e,message:""},Xx=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:u,minLength:g,min:d,max:_,pattern:v,validate:x,name:y,valueAsNumber:h,mount:p}=e._f,f=ce(r,y);if(!p||t.has(y))return{};const m=a?a[0]:l,b=T=>{s&&m.reportValidity&&(m.setCustomValidity(mr(T)?"":T||""),m.reportValidity())},w={},k=Ug(l),E=Jl(l),S=k||E,j=(h||zg(l))&&nt(l.value)&&nt(f)||Fu(l)&&l.value===""||f===""||Array.isArray(f)&&!f.length||h&&typeof f=="number"&&isNaN(f),R=xk.bind(null,y,n,w),M=(T,L,$,z=Jr.maxLength,W=Jr.minLength)=>{const q=T?L:$;w[y]={type:T?z:W,message:q,ref:l,...R(T?z:W,q)}};if(i?!Array.isArray(f)||!f.length:c&&(!S&&(j||At(f))||mr(f)&&!f||E&&!Sk(a).isValid||k&&!kk(a).isValid)){const{value:T,message:L}=Ut(c)?{value:!!c,message:c}:so(c);if(T&&(w[y]={type:Jr.required,message:L,ref:m,...R(Jr.required,L)},!n))return b(L),w}if(!j&&(!At(d)||!At(_))){let T,L;const $=so(_),z=so(d);if(!At(f)&&!isNaN(f)){const W=l.valueAsNumber||f&&+f;At($.value)||(T=W>$.value),At(z.value)||(L=W<z.value)}else{const W=l.valueAsDate||new Date(f),q=D=>new Date(new Date().toDateString()+" "+D),N=l.type=="time",P=l.type=="week";Ut($.value)&&f&&(T=N?q(f)>q($.value):P?f>$.value:W>new Date($.value)),Ut(z.value)&&f&&(L=N?q(f)<q(z.value):P?f<z.value:W<new Date(z.value))}if((T||L)&&(M(!!T,$.message,z.message,Jr.max,Jr.min),!n))return b(w[y].message),w}if((u||g)&&!j&&(Ut(f)||i&&Array.isArray(f))){const T=so(u),L=so(g),$=!At(T.value)&&f.length>+T.value,z=!At(L.value)&&f.length<+L.value;if(($||z)&&(M($,T.message,L.message),!n))return b(w[y].message),w}if(v&&!j&&Ut(f)){const{value:T,message:L}=so(v);if(Bu(T)&&!f.match(T)&&(w[y]={type:Jr.pattern,message:L,ref:l,...R(Jr.pattern,L)},!n))return b(L),w}if(x){if(Ht(x)){const T=await x(f,r),L=Zx(T,m);if(L&&(w[y]={...L,...R(Jr.validate,L.message)},!n))return b(L.message),w}else if(lt(x)){let T={};for(const L in x){if(!Bt(T)&&!n)break;const $=Zx(await x[L](f,r),m,L);$&&(T={...$,...R(L,$.message)},b($.message),n&&(w[y]=T))}if(!Bt(T)&&(w[y]={ref:m,...T},!n))return w}}return b(!0),w};const W4={mode:on.onSubmit,reValidateMode:on.onChange,shouldFocusError:!0},Ek={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function V4(e={}){let t={...W4,...e},r={...gt(Ek),isLoading:Ht(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=lt(t.defaultValues)||lt(t.values)?gt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:gt(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...g};let _={...d};const v={array:Hx(),state:Hx()},x=t.criteriaMode===on.all,y=I=>H=>{clearTimeout(u),u=setTimeout(I,H)},h=async I=>{if(!l.keepIsValid&&!t.disabled&&(d.isValid||_.isValid||I)){let H;t.resolver?(H=Bt((await R()).errors),p()):H=await L({fields:n,onlyCheckValid:!0,eventType:_s.VALID}),H!==r.isValid&&v.state.next({isValid:H})}},p=(I,H)=>{!t.disabled&&(d.isValidating||d.validatingFields||_.isValidating||_.validatingFields)&&((I||Array.from(a.mount)).forEach(V=>{V&&(H?We(r.validatingFields,V,H):_t(r.validatingFields,V))}),v.state.next({validatingFields:r.validatingFields,isValidating:!Bt(r.validatingFields)}))},f=()=>{r.dirtyFields=oo(s,i)},m=(I,H=[],V,ne,ie=!0,te=!0)=>{if(ne&&V&&!t.disabled){if(l.action=!0,te&&Array.isArray(ce(n,I))){const ue=V(ce(n,I),ne.argA,ne.argB);ie&&We(n,I,ue)}if(te&&Array.isArray(ce(r.errors,I))){const ue=V(ce(r.errors,I),ne.argA,ne.argB);ie&&We(r.errors,I,ue),U4(r.errors,I)}if((d.touchedFields||_.touchedFields)&&te&&Array.isArray(ce(r.touchedFields,I))){const ue=V(ce(r.touchedFields,I),ne.argA,ne.argB);ie&&We(r.touchedFields,I,ue)}(d.dirtyFields||_.dirtyFields)&&f(),v.state.next({name:I,isDirty:z(I,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else We(i,I,H)},b=(I,H)=>{We(r.errors,I,H),v.state.next({errors:r.errors})},w=I=>{r.errors=I,v.state.next({errors:r.errors,isValid:!1})},k=I=>{const H=ec(I)?[I]:Dd(I);let V=i,ne=s;for(let ie=0;ie<H.length-1;ie++){const te=H[ie];if(V=At(V)?V:V[te],ne=At(ne)?ne:ne[te],V===null&&ne!==null)return!0}return!1},E=(I,H,V,ne)=>{const ie=ce(n,I);if(ie){if(k(I))return;const te=nt(ce(i,I)),ue=ce(i,I,nt(V)?ce(s,I):V);nt(ue)||ne&&ne.defaultChecked||H?We(i,I,H?ue:Vx(ie._f)):N(I,ue),l.mount&&!l.action&&(h(),te&&r.isDirty&&(d.isDirty||_.isDirty)&&(z()||(r.isDirty=!1,v.state.next({...r}))))}},S=(I,H,V,ne,ie)=>{let te=!1,ue=!1;const fe={name:I};if(!t.disabled){if(!V||ne){(d.isDirty||_.isDirty)&&(ue=r.isDirty,r.isDirty=fe.isDirty=z(),te=ue!==fe.isDirty);const Re=gr(ce(s,I),H);ue=!!ce(r.dirtyFields,I),Re!==r.isDirty?r.dirtyFields=oo(s,i):Re?_t(r.dirtyFields,I):We(r.dirtyFields,I,!0),fe.dirtyFields=r.dirtyFields,te=te||(d.dirtyFields||_.dirtyFields)&&ue!==!Re}if(V){const Re=ce(r.touchedFields,I);Re||(We(r.touchedFields,I,V),fe.touchedFields=r.touchedFields,te=te||(d.touchedFields||_.touchedFields)&&Re!==V)}te&&ie&&v.state.next(fe)}return te?fe:{}},j=(I,H,V,ne)=>{const ie=ce(r.errors,I),te=(d.isValid||_.isValid)&&mr(H)&&r.isValid!==H;if(t.delayError&&V?(c=y(()=>b(I,V)),c(t.delayError)):(clearTimeout(u),c=null,V?We(r.errors,I,V):_t(r.errors,I)),(V?!gr(ie,V):ie)||!Bt(ne)||te){const ue={...ne,...te&&mr(H)?{isValid:H}:{},errors:r.errors,name:I};r={...r,...ue},v.state.next(ue)}},R=async I=>(p(I,!0),await t.resolver(i,t.context,I4(I||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),M=async I=>{const{errors:H}=await R(I);if(p(I),I)for(const V of I){const ne=ce(H,V);ne?a.array.has(V)&&lt(ne)?Yx(r.errors,{[V]:ne},V):We(r.errors,V,ne):_t(r.errors,V)}else r.errors=H;return H},T=async({name:I,eventType:H})=>{if(e.validate){const V=await e.validate({formValues:i,formState:r,name:I,eventType:H});if(lt(V))for(const ne in V){const ie=V[ne];ie&&U(`${Ph}.${ne}`,{message:Ut(ie.message)?ie.message:"",type:ie.type||Jr.validate})}else Ut(V)||!V?U(Ph,{message:V||"",type:Jr.validate}):A(Ph);return V}return!0},L=async({fields:I,onlyCheckValid:H,name:V,eventType:ne,context:ie={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(ie.runRootValidation=!0,!await T({name:V,eventType:ne})&&(ie.valid=!1,H)))return ie.valid;for(const te in I){const ue=I[te];if(ue){const{_f:fe,...Re}=ue;if(fe){const et=a.array.has(fe.name),qt=ue._f&&F4(ue._f),kt=d.validatingFields||d.isValidating||_.validatingFields||_.isValidating;qt&&kt&&p([fe.name],!0);const Mn=await Xx(ue,a.disabled,i,x,t.shouldUseNativeValidation&&!H,et);if(qt&&kt&&p([fe.name]),Mn[fe.name]&&(ie.valid=!1,H)||(!H&&(ce(Mn,fe.name)?et?Yx(r.errors,Mn,fe.name):We(r.errors,fe.name,Mn[fe.name]):_t(r.errors,fe.name)),e.shouldUseNativeValidation&&Mn[fe.name]))break}!Bt(Re)&&await L({context:ie,onlyCheckValid:H,fields:Re,name:te,eventType:ne})}}return ie.valid},$=()=>{for(const I of a.unMount){const H=ce(n,I);H&&(H._f.refs?H._f.refs.every(V=>!Th(V)):!Th(H._f.ref))&&X(I)}a.unMount=new Set},z=(I,H)=>!t.disabled&&(I&&H&&We(i,I,H),!gr(re(),s)),W=(I,H,V)=>mp(I,a,{...l.mount?i:nt(H)?s:Ut(I)?{[I]:H}:H},V,H),q=I=>Ig(ce(l.mount?i:s,I,t.shouldUnregister?ce(s,I,[]):[])),N=(I,H,V={})=>{const ne=ce(n,I);let ie=H;if(ne){const te=ne._f;te&&(!te.disabled&&We(i,I,Ck(H,te)),ie=Fu(te.ref)&&At(H)?"":H,bk(te.ref)?[...te.ref.options].forEach(ue=>ue.selected=ie.includes(ue.value)):te.refs?Jl(te.ref)?te.refs.forEach(ue=>{(!ue.defaultChecked||!ue.disabled)&&(Array.isArray(ie)?ue.checked=!!ie.find(fe=>fe===ue.value):ue.checked=ie===ue.value||!!ie)}):te.refs.forEach(ue=>ue.checked=ue.value===ie):zg(te.ref)?te.ref.value="":(te.ref.value=ie,te.ref.type||v.state.next({name:I,values:gt(i)})))}(V.shouldDirty||V.shouldTouch)&&S(I,ie,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&ee(I)},P=(I,H,V)=>{for(const ne in H){if(!H.hasOwnProperty(ne))return;const ie=H[ne],te=I+"."+ne,ue=ce(n,te);(a.array.has(I)||lt(ie)||ue&&!ue._f)&&!_i(ie)?P(te,ie,V):N(te,ie,V)}},D=(I,H,V={})=>{const ne=ce(n,I),ie=a.array.has(I),te=gt(H),ue=ce(i,I),fe=gr(ue,te);if(fe||We(i,I,te),ie)v.array.next({name:I,values:gt(i)}),(d.isDirty||d.dirtyFields||_.isDirty||_.dirtyFields)&&V.shouldDirty&&(f(),v.state.next({name:I,dirtyFields:r.dirtyFields,isDirty:z(I,te)}));else{const Re=Array.isArray(te)&&!te.length||Bt(te);!ne||ne._f||At(te)||Re?N(I,te,V):P(I,te,V)}if(!fe){const Re=Gx(I,a),et=gt(i);if(!ie)for(const qt of pp(a.array,I))v.array.next({name:qt,values:et});v.state.next({...Re&&r,name:l.mount||Re?I:void 0,values:et})}},O=I=>{const H=Ht(I)?I(i):I;if(!gr(i,H)){i={...i,...H};for(const V of a.mount)D(V,ce(H,V));v.state.next({...r,values:i})}},B=async I=>{l.mount=!0;const H=I.target;let V=H.name,ne=!0;const ie=ce(n,V),te=Re=>{ne=Number.isNaN(Re)||_i(Re)&&isNaN(Re.getTime())||gr(Re,ce(i,V,Re))},ue=qx(t.mode),fe=qx(t.reValidateMode);if(ie){let Re,et;const qt=H.type?Vx(ie._f):gk(I),kt=I.type===_s.BLUR||I.type===_s.FOCUS_OUT,Mn=!B4(ie._f)&&!e.validate&&!t.resolver&&!ce(r.errors,V)&&!ie._f.deps||z4(kt,ce(r.touchedFields,V),r.isSubmitted,fe,ue),ba=Gx(V,a,kt);We(i,V,qt),kt?(!H||!H.readOnly)&&(ie._f.onBlur&&ie._f.onBlur(I),c&&c(0)):ie._f.onChange&&ie._f.onChange(I);const Qi=S(V,qt,kt),tc=!Bt(Qi)||ba;if(!kt&&v.state.next({name:V,type:I.type,values:gt(i)}),Mn)return(d.isValid||_.isValid)&&(t.mode==="onBlur"?kt&&h():kt||h()),tc&&v.state.next({name:V,...ba?{}:Qi});if(!t.resolver&&e.validate&&await T({name:V,eventType:I.type}),!kt&&ba&&v.state.next({...r}),t.resolver){const{errors:rc}=await R([V]);if(p([V]),te(qt),ne){const wa=Qx(r.errors,n,V),Kr=Qx(rc,n,wa.name||V);Re=Kr.error,V=Kr.name,et=Bt(rc)}}else p([V],!0),Re=(await Xx(ie,a.disabled,i,x,t.shouldUseNativeValidation))[V],p([V]),te(qt),ne&&(Re?et=!1:(d.isValid||_.isValid)&&(et=await L({fields:n,onlyCheckValid:!0,name:V,eventType:I.type})));ne&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&ee(ie._f.deps),j(V,et,Re,Qi))}},Q=(I,H)=>{if(ce(r.errors,H)&&I.focus)return I.focus(),1},ee=async(I,H={})=>{let V,ne;const ie=sl(I);if(t.resolver){const te=await M(nt(I)?I:ie);V=Bt(te),ne=I?!ie.some(ue=>ce(te,ue)):V}else I?(ne=(await Promise.all(ie.map(async te=>{const ue=ce(n,te);return await L({fields:ue&&ue._f?{[te]:ue}:ue,eventType:_s.TRIGGER})}))).every(Boolean),!(!ne&&!r.isValid)&&h()):ne=V=await L({fields:n,name:I,eventType:_s.TRIGGER});return v.state.next({...!Ut(I)||(d.isValid||_.isValid)&&V!==r.isValid?{}:{name:I},...t.resolver||!I?{isValid:V}:{},errors:r.errors}),H.shouldFocus&&!ne&&il(n,Q,I?ie:a.mount),ne},re=(I,H)=>{let V={...l.mount?i:s};return H&&(V=yk(H.dirtyFields?r.dirtyFields:r.touchedFields,V)),nt(I)?V:Ut(I)?ce(V,I):I.map(ne=>ce(V,ne))},ye=(I,H)=>({invalid:!!ce((H||r).errors,I),isDirty:!!ce((H||r).dirtyFields,I),error:ce((H||r).errors,I),isValidating:!!ce(r.validatingFields,I),isTouched:!!ce((H||r).touchedFields,I)}),A=I=>{const H=I?sl(I):void 0;H==null||H.forEach(V=>_t(r.errors,V)),H?H.forEach(V=>{v.state.next({name:V,errors:r.errors})}):v.state.next({errors:{}})},U=(I,H,V)=>{const ne=(ce(n,I,{_f:{}})._f||{}).ref,ie=ce(r.errors,I)||{},{ref:te,message:ue,type:fe,...Re}=ie;We(r.errors,I,{...Re,...H,ref:ne}),v.state.next({name:I,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&ne&&ne.focus&&ne.focus()},G=(I,H)=>Ht(I)?v.state.subscribe({next:V=>"values"in V&&I(V.values||W(void 0,H),V)}):W(I,H,!0),K=I=>v.state.subscribe({next:H=>{if(H4(I.name,H.name,I.exact)&&$4(H,I.formState||d,Ln,I.reRenderRoot)){const V={...i};I.callback({values:V,...r,...H,defaultValues:s})}}}).unsubscribe,Z=I=>(l.mount=!0,_={..._,...I.formState},K({...I,formState:{...g,...I.formState}})),X=(I,H={})=>{for(const V of I?sl(I):a.mount)a.mount.delete(V),a.array.delete(V),H.keepValue||(_t(n,V),_t(i,V)),!H.keepError&&_t(r.errors,V),!H.keepDirty&&_t(r.dirtyFields,V),!H.keepTouched&&_t(r.touchedFields,V),!H.keepIsValidating&&_t(r.validatingFields,V),!t.shouldUnregister&&!H.keepDefaultValue&&_t(s,V);v.state.next({values:gt(i)}),v.state.next({...r,...H.keepDirty?{isDirty:z()}:{}}),!H.keepIsValid&&h()},ae=({disabled:I,name:H})=>{if(mr(I)&&l.mount||I||a.disabled.has(H)){const ie=a.disabled.has(H)!==!!I;I?a.disabled.add(H):a.disabled.delete(H),ie&&l.mount&&!l.action&&h()}},je=(I,H={})=>{let V=ce(n,I);const ne=mr(H.disabled)||mr(t.disabled),ie=!a.registerName.has(I)&&V&&V._f&&!V._f.mount;return We(n,I,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:I}},name:I,mount:!0,...H}}),a.mount.add(I),V&&!ie?ae({disabled:mr(H.disabled)?H.disabled:t.disabled,name:I}):E(I,!0,H.value),{...ne?{disabled:H.disabled||t.disabled}:{},...t.progressive?{required:!!H.required,min:Fa(H.min),max:Fa(H.max),minLength:Fa(H.minLength),maxLength:Fa(H.maxLength),pattern:Fa(H.pattern)}:{},name:I,onChange:B,onBlur:B,ref:te=>{if(te){a.registerName.add(I),je(I,H),a.registerName.delete(I),V=ce(n,I);const ue=nt(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,fe=D4(ue),Re=V._f.refs||[];if(fe?Re.find(et=>et===ue):ue===V._f.ref)return;We(n,I,{_f:{...V._f,...fe?{refs:[...Re.filter(Th),ue,...Array.isArray(ce(s,I))?[{}]:[]],ref:{type:ue.type,name:I}}:{ref:ue}}}),E(I,!1,void 0,ue)}else V=ce(n,I,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||H.shouldUnregister)&&!(pp(a.array,I).length&&l.action)&&a.unMount.add(I)}}},Oe=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&il(n,Q,a.mount),Be=I=>{mr(I)&&(v.state.next({disabled:I}),il(n,(H,V)=>{const ne=ce(n,V);ne&&(H.disabled=ne._f.disabled||I,Array.isArray(ne._f.refs)&&ne._f.refs.forEach(ie=>{ie.disabled=ne._f.disabled||I}))},0,!1))},Se=(I,H)=>async V=>{let ne;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ie=gt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ue}=await R();p(),r.errors=te,ie=gt(ue)}else await L({fields:n,eventType:_s.SUBMIT});if(a.disabled.size)for(const te of a.disabled)_t(ie,te);if(_t(r.errors,vk),Bt(r.errors)){v.state.next({errors:{}});try{await I(ie,V)}catch(te){ne=te}}else H&&await H({...r.errors},V),Oe(),setTimeout(Oe);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bt(r.errors)&&!ne,submitCount:r.submitCount+1,errors:r.errors}),ne)throw ne},Mt=(I,H={})=>{ce(n,I)&&(nt(H.defaultValue)?D(I,gt(ce(s,I))):(D(I,H.defaultValue),We(s,I,gt(H.defaultValue))),H.keepTouched||_t(r.touchedFields,I),H.keepDirty||(_t(r.dirtyFields,I),r.isDirty=H.defaultValue?z(I,gt(ce(s,I))):z()),H.keepError||(_t(r.errors,I),d.isValid&&h()),v.state.next({...r}))},dr=(I,H={})=>{const V=I?gt(I):s,ne=gt(V),ie=Bt(I),te=ie?s:ne;if(H.keepDefaultValues||(s=V),!H.keepValues){if(H.keepDirtyValues){const ue=new Set([...a.mount,...Object.keys(oo(s,i))]);for(const fe of Array.from(ue)){const Re=ce(r.dirtyFields,fe),et=ce(i,fe),qt=ce(te,fe);Re&&!nt(et)?We(te,fe,et):!Re&&!nt(qt)&&D(fe,qt)}}else{if(Og&&nt(I))for(const ue of a.mount){const fe=ce(n,ue);if(fe&&fe._f){const Re=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Fu(Re)){const et=Re.closest("form");if(et){et.reset();break}}}}if(H.keepFieldsRef)for(const ue of a.mount)D(ue,ce(te,ue));else n={}}i=t.shouldUnregister?H.keepDefaultValues?gt(s):{}:gt(te),v.array.next({values:{...te}}),v.state.next({values:{...te}})}a={mount:H.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!H.keepIsValid||!!H.keepDirtyValues||!t.shouldUnregister&&!Bt(te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!H.keepIsValid,l.action=!1,H.keepErrors||(r.errors={}),v.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:ie?!1:H.keepDirty?r.isDirty:!!(H.keepDefaultValues&&!gr(I,s)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ie?{}:H.keepDirtyValues?H.keepDefaultValues&&i?oo(s,i):r.dirtyFields:H.keepDefaultValues&&I?oo(s,I):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Dn=(I,H)=>dr(Ht(I)?I(i):I,{...t.resetOptions,...H}),qr=(I,H={})=>{const V=ce(n,I),ne=V&&V._f;if(ne){const ie=ne.refs?ne.refs[0]:ne.ref;ie.focus&&setTimeout(()=>{ie.focus(),H.shouldSelect&&Ht(ie.select)&&ie.select()})}},Ln=I=>{r={...r,...I}},vn={control:{register:je,unregister:X,getFieldState:ye,handleSubmit:Se,setError:U,_subscribe:K,_runSchema:R,_updateIsValidating:p,_focusError:Oe,_getWatch:W,_getDirty:z,_setValid:h,_setFieldArray:m,_setDisabledField:ae,_setErrors:w,_getFieldArray:q,_reset:dr,_resetDefaultValues:()=>Ht(t.defaultValues)&&t.defaultValues().then(I=>{Dn(I,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Be,_subjects:v,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(I){l=I},get _defaultValues(){return s},get _names(){return a},set _names(I){a=I},get _formState(){return r},get _options(){return t},set _options(I){t={...t,...I}}},subscribe:Z,trigger:ee,register:je,handleSubmit:Se,watch:G,setValue:D,setValues:O,getValues:re,reset:Dn,resetField:Mt,clearErrors:A,unregister:X,setError:U,setFocus:qr,getFieldState:ye};return{...vn,formControl:vn}}function q4(e={}){const t=Y.useRef(void 0),r=Y.useRef(void 0),[n,s]=Y.useState(()=>({...gt(Ek),isLoading:Ht(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ht(e.defaultValues)?void 0:e.defaultValues}));if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Ht(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=V4(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,$g(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),Y.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Y.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Y.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Y.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Y.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),Y.useEffect(()=>{var l;e.values&&!gr(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((l=i._options.resetOptions)===null||l===void 0)&&l.keepIsValid||i._setValid(),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),Y.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Y.useMemo(()=>_k(n,i),[i,n]),t.current}const Jx=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},jk=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Jx(n.ref,r,e):n.refs&&n.refs.forEach(s=>Jx(s,r,e))}},K4=(e,t)=>{t.shouldUseNativeValidation&&jk(e,t);const r={};for(const n in e){const s=ce(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(G4(t.names||Object.keys(e),n)){const l=Object.assign({},ce(r,n));We(l,"root",i),We(r,n,l)}else We(r,n,i)}return r},G4=(e,t)=>e.some(r=>r.startsWith(t+"."));var Q4=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,l=n.path.join(".");if(!r[l])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[l]={message:a.message,type:a.code}}else r[l]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(g){return g.errors.forEach(function(d){return e.push(d)})}),t){var c=r[l].types,u=c&&c[n.code];r[l]=xk(l,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},Y4=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,a){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&jk({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(l){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(l))return{values:{},errors:K4(Q4(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}}},$e;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),l={};for(const a of i)l[a]=s[a];return e.objectValues(l)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},e.find=(s,i)=>{for(const l of s)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})($e||($e={}));var ey;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(ey||(ey={}));const ge=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xs=e=>{switch(typeof e){case"undefined":return ge.undefined;case"string":return ge.string;case"number":return Number.isNaN(e)?ge.nan:ge.number;case"boolean":return ge.boolean;case"function":return ge.function;case"bigint":return ge.bigint;case"symbol":return ge.symbol;case"object":return Array.isArray(e)?ge.array:e===null?ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ge.promise:typeof Map<"u"&&e instanceof Map?ge.map:typeof Set<"u"&&e instanceof Set?ge.set:typeof Date<"u"&&e instanceof Date?ge.date:ge.object;default:return ge.unknown}},le=$e.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"]);class ns extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let a=n,c=0;for(;c<l.path.length;){const u=l.path[c];c===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(l))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof ns))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ns.create=e=>new ns(e);const xp=(e,t)=>{let r;switch(e.code){case le.invalid_type:e.received===ge.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case le.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,$e.jsonStringifyReplacer)}`;break;case le.unrecognized_keys:r=`Unrecognized key(s) in object: ${$e.joinValues(e.keys,", ")}`;break;case le.invalid_union:r="Invalid input";break;case le.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$e.joinValues(e.options)}`;break;case le.invalid_enum_value:r=`Invalid enum value. Expected ${$e.joinValues(e.options)}, received '${e.received}'`;break;case le.invalid_arguments:r="Invalid function arguments";break;case le.invalid_return_type:r="Invalid function return type";break;case le.invalid_date:r="Invalid date";break;case le.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:$e.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case le.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case le.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case le.custom:r="Invalid input";break;case le.invalid_intersection_types:r="Intersection results could not be merged";break;case le.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case le.not_finite:r="Number must be finite";break;default:r=t.defaultError,$e.assertNever(e)}return{message:r}};let Z4=xp;function X4(){return Z4}const J4=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)a=u(l,{data:t,defaultError:a}).message;return{...s,path:i,message:a}};function he(e,t){const r=X4(),n=J4({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xp?void 0:xp].filter(s=>!!s)});e.common.issues.push(n)}class kr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return ke;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,l=await s.value;n.push({key:i,value:l})}return kr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return ke;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(n[i.value]=l.value)}return{status:t.value,value:n}}}const ke=Object.freeze({status:"aborted"}),Ka=e=>({status:"dirty",value:e}),Vr=e=>({status:"valid",value:e}),ty=e=>e.status==="aborted",ry=e=>e.status==="dirty",oa=e=>e.status==="valid",$u=e=>typeof Promise<"u"&&e instanceof Promise;var ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ve||(ve={}));class Xs{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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}}const ny=(e,t)=>{if(oa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ns(e.common.issues);return this._error=r,this._error}}};function Ae(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(l,a)=>{const{message:c}=e;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}class Fe{get description(){return this._def.description}_getType(t){return xs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new kr,ctx:{common:t.parent.common,data:t.data,parsedType:xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if($u(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xs(t)},s=this._parseSync({data:t,path:n.path,parent:n});return ny(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xs(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return oa(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>oa(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xs(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await($u(s)?s:Promise.resolve(s));return ny(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const l=t(s),a=()=>i.addIssue({code:le.custom,...n(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new la({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return qs.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rn.create(this)}promise(){return Wu.create(this,this._def)}or(t){return zu.create([this,t],this._def)}and(t){return Uu.create(this,t,this._def)}transform(t){return new la({...Ae(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new bp({...Ae(this._def),innerType:this,defaultValue:r,typeName:Ee.ZodDefault})}brand(){return new wF({typeName:Ee.ZodBranded,type:this,...Ae(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new wp({...Ae(this._def),innerType:this,catchValue:r,typeName:Ee.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wg.create(this,t)}readonly(){return Sp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const eF=/^c[^\s-]{8,}$/i,tF=/^[0-9a-z]+$/,rF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nF=/^[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,sF=/^[a-z0-9_-]{21}$/i,iF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oF=/^[-+]?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)?)??$/,aF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ah;const cF=/^(?:(?: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])$/,uF=/^(?:(?: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])$/,dF=/^(([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]))$/,hF=/^(([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])$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nk="((\\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])))",mF=new RegExp(`^${Nk}$`);function Rk(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function gF(e){return new RegExp(`^${Rk(e)}$`)}function vF(e){let t=`${Nk}T${Rk(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function _F(e,t){return!!((t==="v4"||!t)&&cF.test(e)||(t==="v6"||!t)&&dF.test(e))}function xF(e,t){if(!iF.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function yF(e,t){return!!((t==="v4"||!t)&&uF.test(e)||(t==="v6"||!t)&&hF.test(e))}class Ls extends Fe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ge.string){const i=this._getOrReturnCtx(t);return he(i,{code:le.invalid_type,expected:ge.string,received:i.parsedType}),ke}const n=new kr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:le.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:le.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,a=t.data.length<i.value;(l||a)&&(s=this._getOrReturnCtx(t,s),l?he(s,{code:le.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&he(s,{code:le.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")aF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"email",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ah||(Ah=new RegExp(lF,"u")),Ah.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"emoji",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")nF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"uuid",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")sF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"nanoid",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")eF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cuid",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")tF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cuid2",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")rF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"ulid",code:le.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),he(s,{validation:"url",code:le.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"regex",code:le.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?vF(i).test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?mF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?gF(i).test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:le.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?oF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"duration",code:le.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?_F(t.data,i.version)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"ip",code:le.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?xF(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"jwt",code:le.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?yF(t.data,i.version)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cidr",code:le.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?fF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"base64",code:le.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?pF.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"base64url",code:le.invalid_string,message:i.message}),n.dirty()):$e.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:le.invalid_string,...ve.errToObj(n)})}_addCheck(t){return new Ls({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ve.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ve.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ve.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ve.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ve.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ve.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ve.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ve.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ve.errToObj(r)})}nonempty(t){return this.min(1,ve.errToObj(t))}trim(){return new Ls({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ls({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ls({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ls.create=e=>new Ls({checks:[],typeName:Ee.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ae(e)});function bF(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return i%l/10**s}class Pl extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ge.number){const i=this._getOrReturnCtx(t);return he(i,{code:le.invalid_type,expected:ge.number,received:i.parsedType}),ke}let n;const s=new kr;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),he(n,{code:le.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?bF(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),he(n,{code:le.not_finite,message:i.message}),s.dirty()):$e.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Pl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Pl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&$e.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Pl.create=e=>new Pl({checks:[],typeName:Ee.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class Tl extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ge.bigint)return this._getInvalidInput(t);let n;const s=new kr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),he(n,{code:le.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):$e.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return he(r,{code:le.invalid_type,expected:ge.bigint,received:r.parsedType}),ke}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Tl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Tl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Tl.create=e=>new Tl({checks:[],typeName:Ee.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ae(e)});class sy extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ge.boolean){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.boolean,received:n.parsedType}),ke}return Vr(t.data)}}sy.create=e=>new sy({typeName:Ee.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class Hu extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ge.date){const i=this._getOrReturnCtx(t);return he(i,{code:le.invalid_type,expected:ge.date,received:i.parsedType}),ke}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return he(i,{code:le.invalid_date}),ke}const n=new kr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:le.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:le.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):$e.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hu({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ve.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ve.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Hu.create=e=>new Hu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...Ae(e)});class iy extends Fe{_parse(t){if(this._getType(t)!==ge.symbol){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.symbol,received:n.parsedType}),ke}return Vr(t.data)}}iy.create=e=>new iy({typeName:Ee.ZodSymbol,...Ae(e)});class oy extends Fe{_parse(t){if(this._getType(t)!==ge.undefined){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.undefined,received:n.parsedType}),ke}return Vr(t.data)}}oy.create=e=>new oy({typeName:Ee.ZodUndefined,...Ae(e)});class ay extends Fe{_parse(t){if(this._getType(t)!==ge.null){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.null,received:n.parsedType}),ke}return Vr(t.data)}}ay.create=e=>new ay({typeName:Ee.ZodNull,...Ae(e)});class ly extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Vr(t.data)}}ly.create=e=>new ly({typeName:Ee.ZodAny,...Ae(e)});class cy extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vr(t.data)}}cy.create=e=>new cy({typeName:Ee.ZodUnknown,...Ae(e)});class Js extends Fe{_parse(t){const r=this._getOrReturnCtx(t);return he(r,{code:le.invalid_type,expected:ge.never,received:r.parsedType}),ke}}Js.create=e=>new Js({typeName:Ee.ZodNever,...Ae(e)});class uy extends Fe{_parse(t){if(this._getType(t)!==ge.undefined){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.void,received:n.parsedType}),ke}return Vr(t.data)}}uy.create=e=>new uy({typeName:Ee.ZodVoid,...Ae(e)});class Rn extends Fe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ge.array)return he(r,{code:le.invalid_type,expected:ge.array,received:r.parsedType}),ke;if(s.exactLength!==null){const l=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(l||a)&&(he(r,{code:l?le.too_big:le.too_small,minimum:a?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(he(r,{code:le.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(he(r,{code:le.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,a)=>s.type._parseAsync(new Xs(r,l,r.path,a)))).then(l=>kr.mergeArray(n,l));const i=[...r.data].map((l,a)=>s.type._parseSync(new Xs(r,l,r.path,a)));return kr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Rn({...this._def,minLength:{value:t,message:ve.toString(r)}})}max(t,r){return new Rn({...this._def,maxLength:{value:t,message:ve.toString(r)}})}length(t,r){return new Rn({...this._def,exactLength:{value:t,message:ve.toString(r)}})}nonempty(t){return this.min(1,t)}}Rn.create=(e,t)=>new Rn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...Ae(t)});function ao(e){if(e instanceof xt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=qs.create(ao(n))}return new xt({...e._def,shape:()=>t})}else return e instanceof Rn?new Rn({...e._def,type:ao(e.element)}):e instanceof qs?qs.create(ao(e.unwrap())):e instanceof ca?ca.create(ao(e.unwrap())):e instanceof Fi?Fi.create(e.items.map(t=>ao(t))):e}class xt extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=$e.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ge.object){const u=this._getOrReturnCtx(t);return he(u,{code:le.invalid_type,expected:ge.object,received:u.parsedType}),ke}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Js&&this._def.unknownKeys==="strip"))for(const u in s.data)l.includes(u)||a.push(u);const c=[];for(const u of l){const g=i[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:g._parse(new Xs(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Js){const u=this._def.unknownKeys;if(u==="passthrough")for(const g of a)c.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(u==="strict")a.length>0&&(he(s,{code:le.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const g of a){const d=s.data[g];c.push({key:{status:"valid",value:g},value:u._parse(new Xs(s,d,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const g of c){const d=await g.key,_=await g.value;u.push({key:d,value:_,alwaysSet:g.alwaysSet})}return u}).then(u=>kr.mergeObjectSync(n,u)):kr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return ve.errToObj,new xt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,l;const s=((l=(i=this._def).errorMap)==null?void 0:l.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ve.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new xt({...this._def,unknownKeys:"strip"})}passthrough(){return new xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ee.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new xt({...this._def,catchall:t})}pick(t){const r={};for(const n of $e.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new xt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of $e.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new xt({...this._def,shape:()=>r})}deepPartial(){return ao(this)}partial(t){const r={};for(const n of $e.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new xt({...this._def,shape:()=>r})}required(t){const r={};for(const n of $e.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof qs;)i=i._def.innerType;r[n]=i}return new xt({...this._def,shape:()=>r})}keyof(){return Pk($e.objectKeys(this.shape))}}xt.create=(e,t)=>new xt({shape:()=>e,unknownKeys:"strip",catchall:Js.create(),typeName:Ee.ZodObject,...Ae(t)});xt.strictCreate=(e,t)=>new xt({shape:()=>e,unknownKeys:"strict",catchall:Js.create(),typeName:Ee.ZodObject,...Ae(t)});xt.lazycreate=(e,t)=>new xt({shape:e,unknownKeys:"strip",catchall:Js.create(),typeName:Ee.ZodObject,...Ae(t)});class zu extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new ns(a.ctx.common.issues));return he(r,{code:le.invalid_union,unionErrors:l}),ke}if(r.common.async)return Promise.all(n.map(async i=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},g=c._parseSync({data:r.data,path:r.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(c=>new ns(c));return he(r,{code:le.invalid_union,unionErrors:a}),ke}}get options(){return this._def.options}}zu.create=(e,t)=>new zu({options:e,typeName:Ee.ZodUnion,...Ae(t)});function yp(e,t){const r=xs(e),n=xs(t);if(e===t)return{valid:!0,data:e};if(r===ge.object&&n===ge.object){const s=$e.objectKeys(t),i=$e.objectKeys(e).filter(a=>s.indexOf(a)!==-1),l={...e,...t};for(const a of i){const c=yp(e[a],t[a]);if(!c.valid)return{valid:!1};l[a]=c.data}return{valid:!0,data:l}}else if(r===ge.array&&n===ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const l=e[i],a=t[i],c=yp(l,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===ge.date&&n===ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Uu extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(i,l)=>{if(ty(i)||ty(l))return ke;const a=yp(i.value,l.value);return a.valid?((ry(i)||ry(l))&&r.dirty(),{status:r.value,value:a.data}):(he(n,{code:le.invalid_intersection_types}),ke)};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(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Uu.create=(e,t,r)=>new Uu({left:e,right:t,typeName:Ee.ZodIntersection,...Ae(r)});class Fi extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.array)return he(n,{code:le.invalid_type,expected:ge.array,received:n.parsedType}),ke;if(n.data.length<this._def.items.length)return he(n,{code:le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&n.data.length>this._def.items.length&&(he(n,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((l,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Xs(n,l,n.path,a)):null}).filter(l=>!!l);return n.common.async?Promise.all(i).then(l=>kr.mergeArray(r,l)):kr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Fi({...this._def,rest:t})}}Fi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fi({items:e,typeName:Ee.ZodTuple,rest:null,...Ae(t)})};class dy extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.map)return he(n,{code:le.invalid_type,expected:ge.map,received:n.parsedType}),ke;const s=this._def.keyType,i=this._def.valueType,l=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Xs(n,a,n.path,[u,"key"])),value:i._parse(new Xs(n,c,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of l){const u=await c.key,g=await c.value;if(u.status==="aborted"||g.status==="aborted")return ke;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),a.set(u.value,g.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of l){const u=c.key,g=c.value;if(u.status==="aborted"||g.status==="aborted")return ke;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),a.set(u.value,g.value)}return{status:r.value,value:a}}}}dy.create=(e,t,r)=>new dy({valueType:t,keyType:e,typeName:Ee.ZodMap,...Ae(r)});class Al extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.set)return he(n,{code:le.invalid_type,expected:ge.set,received:n.parsedType}),ke;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(he(n,{code:le.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(he(n,{code:le.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function l(c){const u=new Set;for(const g of c){if(g.status==="aborted")return ke;g.status==="dirty"&&r.dirty(),u.add(g.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((c,u)=>i._parse(new Xs(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>l(c)):l(a)}min(t,r){return new Al({...this._def,minSize:{value:t,message:ve.toString(r)}})}max(t,r){return new Al({...this._def,maxSize:{value:t,message:ve.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Al.create=(e,t)=>new Al({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...Ae(t)});class hy extends Fe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}hy.create=(e,t)=>new hy({getter:e,typeName:Ee.ZodLazy,...Ae(t)});class fy extends Fe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return he(r,{received:r.data,code:le.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}}fy.create=(e,t)=>new fy({value:e,typeName:Ee.ZodLiteral,...Ae(t)});function Pk(e,t){return new aa({values:e,typeName:Ee.ZodEnum,...Ae(t)})}class aa extends Fe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return he(r,{expected:$e.joinValues(n),received:r.parsedType,code:le.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return he(r,{received:r.data,code:le.invalid_enum_value,options:n}),ke}return Vr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return aa.create(t,{...this._def,...r})}exclude(t,r=this._def){return aa.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}aa.create=Pk;class py extends Fe{_parse(t){const r=$e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ge.string&&n.parsedType!==ge.number){const s=$e.objectValues(r);return he(n,{expected:$e.joinValues(s),received:n.parsedType,code:le.invalid_type}),ke}if(this._cache||(this._cache=new Set($e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=$e.objectValues(r);return he(n,{received:n.data,code:le.invalid_enum_value,options:s}),ke}return Vr(t.data)}get enum(){return this._def.values}}py.create=(e,t)=>new py({values:e,typeName:Ee.ZodNativeEnum,...Ae(t)});class Wu extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ge.promise&&r.common.async===!1)return he(r,{code:le.invalid_type,expected:ge.promise,received:r.parsedType}),ke;const n=r.parsedType===ge.promise?r.data:Promise.resolve(r.data);return Vr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Wu.create=(e,t)=>new Wu({type:e,typeName:Ee.ZodPromise,...Ae(t)});class la extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:l=>{he(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(n.data,i);if(n.common.async)return Promise.resolve(l).then(async a=>{if(r.value==="aborted")return ke;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?ke:c.status==="dirty"||r.value==="dirty"?Ka(c.value):c});{if(r.value==="aborted")return ke;const a=this._def.schema._parseSync({data:l,path:n.path,parent:n});return a.status==="aborted"?ke:a.status==="dirty"||r.value==="dirty"?Ka(a.value):a}}if(s.type==="refinement"){const l=a=>{const c=s.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ke:(a.status==="dirty"&&r.dirty(),l(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?ke:(a.status==="dirty"&&r.dirty(),l(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!oa(l))return ke;const a=s.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>oa(l)?Promise.resolve(s.transform(l.value,i)).then(a=>({status:r.value,value:a})):ke);$e.assertNever(s)}}la.create=(e,t,r)=>new la({schema:e,typeName:Ee.ZodEffects,effect:t,...Ae(r)});la.createWithPreprocess=(e,t,r)=>new la({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...Ae(r)});class qs extends Fe{_parse(t){return this._getType(t)===ge.undefined?Vr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qs.create=(e,t)=>new qs({innerType:e,typeName:Ee.ZodOptional,...Ae(t)});class ca extends Fe{_parse(t){return this._getType(t)===ge.null?Vr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ca.create=(e,t)=>new ca({innerType:e,typeName:Ee.ZodNullable,...Ae(t)});class bp extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ge.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}bp.create=(e,t)=>new bp({innerType:e,typeName:Ee.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ae(t)});class wp extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return $u(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ns(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ns(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}wp.create=(e,t)=>new wp({innerType:e,typeName:Ee.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ae(t)});class my extends Fe{_parse(t){if(this._getType(t)!==ge.nan){const n=this._getOrReturnCtx(t);return he(n,{code:le.invalid_type,expected:ge.nan,received:n.parsedType}),ke}return{status:"valid",value:t.data}}}my.create=e=>new my({typeName:Ee.ZodNaN,...Ae(e)});class wF extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Wg extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ke:i.status==="dirty"?(r.dirty(),Ka(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ke:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Wg({in:t,out:r,typeName:Ee.ZodPipeline})}}class Sp extends Fe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(oa(s)&&(s.value=Object.freeze(s.value)),s);return $u(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Sp.create=(e,t)=>new Sp({innerType:e,typeName:Ee.ZodReadonly,...Ae(t)});var Ee;(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"})(Ee||(Ee={}));const gy=Ls.create;Js.create;Rn.create;const SF=xt.create;zu.create;Uu.create;Fi.create;aa.create;Wu.create;qs.create;ca.create;const CF=A4,Tk=C.createContext({}),vy=e=>o.jsx(Tk.Provider,{value:{name:e.name},children:o.jsx(P4,{...e})}),Ak=C.createContext({}),Ld=()=>{const e=C.useContext(Tk),t=C.useContext(Ak),{getFieldState:r,formState:n}=T4(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},Cp=C.forwardRef(({className:e,...t},r)=>{const n=C.useId();return o.jsx(Ak.Provider,{value:{id:n},children:o.jsx("div",{ref:r,className:J("flex flex-col gap-1.5",e),...t})})});Cp.displayName="FormItem";const kp=C.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Ld();return o.jsx(br,{ref:r,className:J(n&&"text-[var(--break-red)]",e),htmlFor:s,...t})});kp.displayName="FormLabel";const Ep=C.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=Ld();return o.jsx(ww,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:s,"aria-invalid":!!r,...e})});Ep.displayName="FormControl";const Dk=C.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Ld();return o.jsx("p",{ref:r,id:n,className:J("font-mono text-[11px] text-[var(--fg-dim)]",e),...t})});Dk.displayName="FormDescription";const jp=C.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=Ld(),l=s?String((s==null?void 0:s.message)??""):t;return l?o.jsx("p",{ref:n,id:i,className:J("font-mono text-[11px] text-[var(--break-red)]",e),...r,children:l}):null});jp.displayName="FormMessage";const kF=SF({current:gy().min(1,"Current password is required."),next:gy().min(8,"New password must be at least 8 characters.")});function EF(){const[e,t]=C.useState("idle"),r=q4({resolver:Y4(kF),defaultValues:{current:"",next:""}}),n=async s=>{t("rotating");try{await me.changeKeystorePassword(s.current,s.next),r.reset({current:"",next:""}),Pn.success("Password rotated",{description:"Re-run `jinn run` with the new password."})}catch(i){Pn.error("Rotation failed",{description:i instanceof Error?i.message:String(i)})}finally{t("idle")}};return o.jsx("div",{"data-testid":"security-tab",children:o.jsxs(we,{className:"border-[var(--severity-blocking-border)]",children:[o.jsxs(Zt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(hn,{className:"flex items-center gap-2 text-[var(--break-red)]",children:[o.jsx(HR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Security"]}),o.jsx(Qs,{children:"Rotate keystore password · last rotated never"})]}),o.jsx(Ce,{variant:"destructive",children:"Danger zone"})]}),o.jsx(Qe,{children:o.jsx(CF,{...r,children:o.jsxs("form",{onSubmit:r.handleSubmit(n),className:"flex flex-col gap-4","data-testid":"security-password-form",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsx(vy,{control:r.control,name:"current",render:({field:s})=>o.jsxs(Cp,{children:[o.jsx(kp,{children:"Current password"}),o.jsx(Ep,{children:o.jsx(pt,{type:"password",autoComplete:"current-password",...s})}),o.jsx(jp,{})]})}),o.jsx(vy,{control:r.control,name:"next",render:({field:s})=>o.jsxs(Cp,{children:[o.jsx(kp,{children:"New password"}),o.jsx(Ep,{children:o.jsx(pt,{type:"password",autoComplete:"new-password",...s})}),o.jsx(Dk,{children:"At least 8 characters."}),o.jsx(jp,{})]})})]}),o.jsxs(oe,{type:"submit",variant:"destructive",disabled:e==="rotating"||!r.formState.isValid,className:"self-start",children:[o.jsx(DR,{className:"h-3 w-3","aria-hidden":"true"}),e==="rotating"?"Rotating…":"Rotate password"]})]})})})]})})}function jF(e){const t=[],r=e.split(`
282
+ `);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const a=s.slice(3).trim(),c=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)c.push(r[n]??""),n++;n++,t.push({kind:"code",lang:a,text:c.join(`
283
+ `)});continue}const i=/^(#{1,3})\s+(.*)$/.exec(s);if(i){t.push({kind:"heading",level:i[1].length,text:i[2]}),n++;continue}if(/^-\s+/.test(s)){const a=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)a.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:a});continue}if(s.trim()===""){n++;continue}const l=[s];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)l.push(r[n]??""),n++;t.push({kind:"paragraph",text:l.join(" ")})}return t}function _y(e){const t=[],r=/`([^`]+)`/g;let n=0,s,i=0;for(;(s=r.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(C.createElement("code",{key:`c-${i++}`},s[1])),n=s.index+s[0].length;return n<e.length&&t.push(e.slice(n)),t}function NF(e){const t=jF(e);return C.createElement(C.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?C.createElement("h1",{key:n},r.text):r.level===2?C.createElement("h2",{key:n},r.text):C.createElement("h3",{key:n},r.text):r.kind==="code"?C.createElement("pre",{key:n},C.createElement("code",null,r.text??"")):r.kind==="list"?C.createElement("ul",{key:n},...(r.items??[]).map((s,i)=>C.createElement("li",{key:i},..._y(s)))):C.createElement("p",{key:n},..._y(r.text??""))))}const RF=`# Build a plug-in
284
+
285
+ Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
286
+
287
+ ## 1. Scaffold
288
+
289
+ \`\`\`bash
290
+ jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
291
+ cd @you/my-swe-skill
292
+ yarn install
293
+ yarn test
294
+ \`\`\`
295
+
296
+ The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
297
+
298
+ \`\`\`
299
+ @you/my-swe-skill/
300
+ ├── jinn.plugin.json # the canonical manifest
301
+ ├── skills/example/SKILL.md
302
+ ├── test/plugin.test.ts # passes immediately
303
+ ├── package.json
304
+ ├── tsconfig.json
305
+ └── README.md
306
+ \`\`\`
307
+
308
+ ## 2. Edit your skill
309
+
310
+ 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\`.
311
+
312
+ ## 3. Publish to npm + chain
313
+
314
+ \`\`\`bash
315
+ npm publish --access public
316
+ jinn solver-plugins publish npm:@you/my-swe-skill
317
+ \`\`\`
318
+
319
+ \`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.
320
+
321
+ 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.
322
+
323
+ ## 4. Confirm it published
324
+
325
+ 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.
326
+
327
+ ## 5. Run it
328
+
329
+ An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
330
+
331
+ \`\`\`bash
332
+ jinn solver-plugins show npm:@you/my-swe-skill
333
+ jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
334
+ \`\`\`
335
+
336
+ 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.
337
+
338
+ ## Next
339
+
340
+ - \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
341
+ - \`examples.md\` — annotated reference plug-ins.
342
+ - \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
343
+ - \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
344
+ - \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
345
+ `,PF="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md",xy="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function TF(){return o.jsxs(we,{className:"p-6",children:[o.jsx(Zt,{className:"mb-2 p-0",children:o.jsx("span",{className:xy,children:"Quickstart · 60 seconds"})}),o.jsxs(Qe,{className:"p-0",children:[o.jsx("div",{className:"hfmf-intro-markdown",children:NF(RF)}),o.jsx(Ye,{className:"my-5"}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{className:xy,children:"Next"}),o.jsx("a",{href:PF,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 →"})]})]})]})}const AF=[{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."}],DF=[{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"] } }'}],Dh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function LF(){return o.jsxs(we,{className:"p-6",children:[o.jsxs(Zt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:Dh,children:"Reference"}),o.jsx("h2",{className:"m-0 font-serif text-[28px] leading-[1.2] text-foreground",children:"Plug-in shape"})]}),o.jsxs(Qe,{className:"p-0",children:[o.jsxs(zi,{children:[o.jsx(Ui,{children:o.jsxs(Cr,{children:[o.jsx(Ve,{children:"Field"}),o.jsx(Ve,{children:"Type"}),o.jsx(Ve,{children:"Required"}),o.jsx(Ve,{children:"Description"})]})}),o.jsx(Wi,{children:AF.map(e=>o.jsxs(Cr,{"data-field-required":e.required?"true":"false",children:[o.jsx(qe,{className:"font-mono text-[13px] text-primary",children:e.name}),o.jsx(qe,{className:"font-mono text-[13px] text-muted-foreground",children:e.type}),o.jsx(qe,{children:o.jsx(Ce,{variant:e.required?"default":"outline",children:e.required?"yes":"no"})}),o.jsx(qe,{className:"font-mono text-[13px] text-muted-foreground",children:e.description})]},e.name))})]}),o.jsx(Ye,{className:"my-8"}),o.jsxs("div",{className:"mb-4 flex flex-col gap-1",children:[o.jsx("span",{className:Dh,children:"Modes"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Two modes"}),o.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."})]}),o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:DF.map((e,t)=>o.jsxs(we,{className:"flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4",children:[o.jsx("span",{className:Dh,children:t===0?"Mode · 01":"Mode · 02"}),o.jsx("h4",{className:"m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground",children:e.label}),o.jsx("p",{className:"m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground",children:e.requires}),o.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:o.jsx("code",{children:e.example})})]},e.id))})]})]})}const Lk="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function MF(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function Dc({solverType:e}){return o.jsxs(Zt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:Lk,children:"Registry"}),o.jsxs("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:["Published plug-ins for ",e]})]})}function OF({solverType:e}){const{data:t,isLoading:r,error:n}=De({queryKey:["discovery","plugin-publications",e],queryFn:()=>me.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return o.jsxs(we,{className:"p-6",children:[o.jsx(Dc,{solverType:e}),o.jsxs(Qe,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Br,{className:"h-4 w-full"}),o.jsx(Br,{className:"h-4 w-5/6"}),o.jsx(Br,{className:"h-4 w-4/6"})]})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Dc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsx(Ze,{variant:"blocking",children:o.jsxs(Je,{children:["Discovery unavailable. ",n.message]})})})]});const s=(t==null?void 0:t.publications)??[];return s.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Dc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:Lk,children:"Empty registry"}),o.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."}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Run"," ",o.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."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Dc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsxs(zi,{children:[o.jsx(Ui,{children:o.jsxs(Cr,{children:[o.jsx(Ve,{children:"Plug-in"}),o.jsx(Ve,{children:"Version"}),o.jsx(Ve,{children:"Builder agentId"}),o.jsx(Ve,{children:"CID"}),o.jsx(Ve,{children:"Status"})]})}),o.jsx(Wi,{children:s.map(i=>o.jsxs(Cr,{children:[o.jsx(qe,{className:"font-mono text-[12px] text-foreground",children:i.name}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:i.version}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:i.builderAgentId}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:MF(i.cid)}),o.jsx(qe,{children:i.revoked?o.jsxs(Ce,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:["Revoked",i.revokedReason?` · ${i.revokedReason}`:""]}):o.jsx(Ce,{variant:"success",className:"rounded-full",children:"Active"})})]},`${i.builderAgentId}:${i.cid}`))})]})})]})}const Np="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",Lh="rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary";function Ba(){return o.jsxs(Zt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:Np,children:"Builder"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Your published plug-ins"})]})}function IF({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=De({queryKey:["discovery","builder-artifacts",e],queryFn:()=>me.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return o.jsxs(we,{className:"bg-[var(--bg-sunken)] p-6",children:[o.jsx(Ba,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border p-6",children:[o.jsx("span",{className:Np,children:"Identity pending"}),o.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"," ",o.jsx("code",{className:Lh,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Ba,{}),o.jsxs(Qe,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Br,{className:"h-4 w-full"}),o.jsx(Br,{className:"h-4 w-5/6"}),o.jsx(Br,{className:"h-4 w-4/6"})]})]});if(s)return o.jsxs(we,{className:"p-6",children:[o.jsx(Ba,{}),o.jsx(Qe,{className:"p-0",children:o.jsx(Ze,{variant:"blocking",children:o.jsx(Je,{children:"Discovery unavailable."})})})]});const i=((r==null?void 0:r.artifacts)??[]).filter(l=>l.artifactType==="plugin");return i.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Ba,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:Np,children:"Nothing yet"}),o.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"," ",o.jsx("code",{className:Lh,children:"jinn create plugin"}),", then publish with ",o.jsx("code",{className:Lh,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Ba,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs(zi,{children:[o.jsx(Ui,{children:o.jsxs(Cr,{children:[o.jsx(Ve,{children:"Plug-in"}),o.jsx(Ve,{children:"Version"}),o.jsx(Ve,{children:"Supports"}),o.jsx(Ve,{children:"Status"})]})}),o.jsx(Wi,{children:i.map(l=>o.jsxs(Cr,{children:[o.jsx(qe,{className:"font-mono text-[12px] text-foreground",children:l.name}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:l.version}),o.jsx(qe,{className:"font-mono text-[12px] text-muted-foreground",children:l.supports.join(", ")}),o.jsx(qe,{children:l.revoked?o.jsx(Ce,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:"Revoked"}):o.jsx(Ce,{variant:"success",className:"rounded-full",children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}function FF({value:e,onChange:t}){const r=e==="plugin";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(oe,{type:"button",variant:r?"outline":"ghost",size:"sm","aria-pressed":r?"true":"false",className:"rounded-full",onClick:()=>{r||t("plugin")},children:"Plug-ins"}),o.jsxs(oe,{type:"button",variant:"ghost",size:"sm",disabled:!0,"aria-pressed":"false",className:"rounded-full opacity-60",children:["Harnesses",o.jsx("span",{className:"ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]",children:"Coming soon"})]})]})}const BF="swe-rebench-v2.v1";function $F(){const{data:e}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:5e3}),[t,r]=C.useState("plugin");return o.jsxs("div",{className:"mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8",children:[o.jsxs("header",{className:"flex flex-col gap-2 pb-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",children:"Build · Plug-ins"}),o.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."})]}),o.jsx(TF,{}),o.jsx(LF,{}),o.jsx(Ye,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4 pt-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Registry"}),o.jsx(FF,{value:t,onChange:r})]}),t==="plugin"?o.jsxs(o.Fragment,{children:[o.jsx(OF,{solverType:BF}),o.jsx(IF,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}const Lc=({...e})=>o.jsx(RD,{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 HF(){const{data:e,isLoading:t}=De({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:1500}),r=vw(),[n,s]=C.useState(!1),i={restartPending:n,setRestartPending:s};if(r.status==="disconnected"&&!e)return o.jsxs(Or,{delayDuration:150,children:[o.jsx(BA,{connection:r}),o.jsx(Lc,{})]});if(e&&e.mode!=="running")return o.jsxs(Or,{delayDuration:150,children:[o.jsx(OA,{}),o.jsx(Lc,{})]});if(t||!e)return o.jsxs(Or,{delayDuration:150,children:[o.jsx(nP,{headline:"Starting jinn"}),o.jsx(Lc,{})]});const l=e.chain==="base"?"mainnet":"testnet",{pluginBuilderUi:a,embeddedAgent:c}=qm();return o.jsx(Or,{delayDuration:150,children:o.jsxs(OS.Provider,{value:i,children:[o.jsx(mw,{children:o.jsx(JA,{header:o.jsx(eD,{network:l}),tabs:o.jsx(tD,{}),rail:c?o.jsx(rD,{}):void 0,children:o.jsxs(xR,{children:[o.jsx(Pt,{path:"/events/:id",children:o.jsx(EL,{})}),o.jsx(Pt,{path:"/events",children:o.jsx(SL,{})}),o.jsx(Pt,{path:"/overview",component:mL}),o.jsx(Pt,{path:"/operator/join/:cid",children:o.jsx(XI,{})}),o.jsx(Pt,{path:"/operator/execution-data",children:o.jsx(Ia,{children:o.jsx(y3,{})})}),o.jsx(Pt,{path:"/operator/memberships",children:o.jsx(Ia,{children:o.jsx(h4,{onRestartPending:()=>s(!0)})})}),o.jsx(Pt,{path:"/operator/registry",children:o.jsx(Ia,{children:o.jsx(S4,{})})}),o.jsx(Pt,{path:"/operator/network",children:o.jsx(Ia,{children:o.jsx(C4,{onRestartPending:()=>s(!0)})})}),o.jsx(Pt,{path:"/operator/security",children:o.jsx(Ia,{children:o.jsx(EF,{})})}),o.jsx(Pt,{path:"/operator",children:o.jsx(Va,{to:"/operator/memberships"})}),o.jsx(Pt,{path:"/captures",children:o.jsx(Va,{to:"/operator/execution-data"})}),o.jsx(Pt,{path:"/configuration",children:o.jsx(zF,{})}),o.jsx(Pt,{path:"/launcher/create",children:o.jsx(oM,{})}),o.jsx(Pt,{path:"/launcher/launched/:solverNetId",children:o.jsx(aI,{})}),o.jsx(Pt,{path:"/launcher",children:o.jsx(DL,{})}),o.jsx(Pt,{path:"/build",children:a?o.jsx($F,{}):o.jsx(Va,{to:"/overview"})}),o.jsx(Pt,{children:o.jsx(Va,{to:"/overview"})})]})})}),o.jsx(Lc,{})]})})}function zF(){const e=typeof window>"u"?"":window.location.hash;return o.jsx(Va,{to:`/operator${e}`})}const UF=new LN({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});bR().finally(()=>{Mh.createRoot(document.getElementById("root")).render(o.jsx(Y.StrictMode,{children:o.jsx(MN,{client:UF,children:o.jsx(HF,{})})}))});