@jinn-network/client 0.1.5 → 0.1.6-canary.107ea271
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.
- package/CHANGELOG.md +131 -0
- package/dist/adapters/mech/adapter.d.ts +23 -1
- package/dist/adapters/mech/adapter.js +169 -33
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +1 -0
- package/dist/adapters/mech/contracts.js +1 -0
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs-pinfile.d.ts +22 -0
- package/dist/adapters/mech/ipfs-pinfile.js +54 -0
- package/dist/adapters/mech/ipfs-pinfile.js.map +1 -0
- package/dist/adapters/mech/ipfs.d.ts +1 -0
- package/dist/adapters/mech/ipfs.js +24 -1
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/verdict-code.d.ts +1 -0
- package/dist/adapters/mech/verdict-code.js +18 -0
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/bootstrap-endpoint.js +63 -1
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +73 -0
- package/dist/api/codex-doctor-endpoint.js +158 -0
- package/dist/api/codex-doctor-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +31 -0
- package/dist/api/discovery-endpoint.js +78 -0
- package/dist/api/discovery-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +8 -0
- package/dist/api/fleet-build.js +8 -2
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.js +90 -4
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-readiness-endpoint.d.ts +25 -0
- package/dist/api/harness-readiness-endpoint.js +24 -0
- package/dist/api/harness-readiness-endpoint.js.map +1 -0
- package/dist/api/hermes-doctor-endpoint.d.ts +66 -0
- package/dist/api/hermes-doctor-endpoint.js +75 -0
- package/dist/api/hermes-doctor-endpoint.js.map +1 -0
- package/dist/api/portfolio-v0-build.d.ts +10 -0
- package/dist/api/portfolio-v0-build.js +24 -5
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +9 -0
- package/dist/api/prediction-v1-build.js +6 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +70 -0
- package/dist/api/server.js +107 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +21 -0
- package/dist/api/setup-endpoints.js +101 -8
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/setup-retry-endpoint.d.ts +19 -0
- package/dist/api/setup-retry-endpoint.js +32 -0
- package/dist/api/setup-retry-endpoint.js.map +1 -0
- package/dist/api/solvernets-endpoints.js +8 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +14 -0
- package/dist/api/status-build.js +23 -18
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +7 -0
- package/dist/api/task-run-routing.js +12 -0
- package/dist/api/task-run-routing.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +20 -0
- package/dist/api/task-runs-build.js +4 -0
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/chain-read-errors.d.ts +10 -0
- package/dist/chain-read-errors.js +15 -0
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/auth.js +3 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/create.d.ts +5 -3
- package/dist/cli/commands/create.js +102 -36
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/solver-nets.d.ts +19 -0
- package/dist/cli/commands/solver-nets.js +164 -11
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins-publish.d.ts +31 -0
- package/dist/cli/commands/solver-plugins-publish.js +169 -0
- package/dist/cli/commands/solver-plugins-publish.js.map +1 -0
- package/dist/cli/commands/solver-plugins-revoke.d.ts +15 -0
- package/dist/cli/commands/solver-plugins-revoke.js +91 -0
- package/dist/cli/commands/solver-plugins-revoke.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +50 -6
- package/dist/cli/commands/solver-plugins.js +205 -68
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/update.d.ts +10 -0
- package/dist/cli/commands/update.js +36 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/config.d.ts +51 -0
- package/dist/config.js +49 -2
- package/dist/config.js.map +1 -1
- package/dist/conformance/checks/hash-signature.js +6 -2
- package/dist/conformance/checks/hash-signature.js.map +1 -1
- package/dist/conformance/checks/payload.js +4 -2
- package/dist/conformance/checks/payload.js.map +1 -1
- package/dist/conformance/checks/verdict.d.ts +10 -10
- package/dist/conformance/checks/verdict.js +16 -15
- package/dist/conformance/checks/verdict.js.map +1 -1
- package/dist/conformance/harness.d.ts +1 -1
- package/dist/conformance/harness.js +16 -9
- package/dist/conformance/harness.js.map +1 -1
- package/dist/conformance/types.d.ts +10 -3
- package/dist/conformance/types.js.map +1 -1
- package/dist/corpus/acquire.d.ts +1 -3
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/envelope-projection.d.ts +1 -1
- package/dist/corpus/envelope-projection.js +14 -7
- package/dist/corpus/envelope-projection.js.map +1 -1
- package/dist/corpus/index.d.ts +2 -1
- package/dist/corpus/index.js.map +1 -1
- package/dist/corpus/prediction-brier-scoreboard-report.js +1 -1
- package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -1
- package/dist/corpus/prediction-brier-scoreboard.js +3 -1
- package/dist/corpus/prediction-brier-scoreboard.js.map +1 -1
- package/dist/corpus/types.d.ts +2 -2
- package/dist/daemon/daemon.d.ts +26 -1
- package/dist/daemon/daemon.js +63 -1
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +40 -0
- package/dist/daemon/eviction-loop.js +67 -0
- package/dist/daemon/eviction-loop.js.map +1 -0
- package/dist/daemon/freeze-fence.js +6 -3
- package/dist/daemon/freeze-fence.js.map +1 -1
- package/dist/daemon/readiness-gate.d.ts +30 -0
- package/dist/daemon/readiness-gate.js +31 -0
- package/dist/daemon/readiness-gate.js.map +1 -0
- package/dist/daemon/skip-log-dedup.d.ts +69 -0
- package/dist/daemon/skip-log-dedup.js +106 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -0
- package/dist/dashboard/assets/{index-D_NMfDfV.css → index-DE4qUnzV.css} +1 -1
- package/dist/dashboard/assets/index-Di7xA4eB.js +170 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.js +121 -0
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.d.ts +5 -0
- package/dist/discovery/onchain.js +292 -7
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +127 -1
- package/dist/discovery/types.js +8 -10
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +9 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/agent-wallet-binding.d.ts +20 -1
- package/dist/earning/agent-wallet-binding.js +54 -16
- package/dist/earning/agent-wallet-binding.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +178 -0
- package/dist/earning/bootstrap.js +628 -57
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +12 -0
- package/dist/earning/contracts.js +16 -1
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/funding-plan.js +15 -2
- package/dist/earning/funding-plan.js.map +1 -1
- package/dist/earning/jinn-rewards.d.ts +46 -0
- package/dist/earning/jinn-rewards.js +32 -0
- package/dist/earning/jinn-rewards.js.map +1 -1
- package/dist/earning/store.d.ts +8 -0
- package/dist/earning/store.js +48 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +12 -0
- package/dist/earning/testnet-setup-migration.js +27 -1
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +45 -0
- package/dist/earning/types.js +37 -0
- package/dist/earning/types.js.map +1 -1
- package/dist/erc8004/abis.d.ts +64 -0
- package/dist/erc8004/abis.js +48 -0
- package/dist/erc8004/abis.js.map +1 -1
- package/dist/erc8004/plugin-registry.d.ts +102 -0
- package/dist/erc8004/plugin-registry.js +165 -0
- package/dist/erc8004/plugin-registry.js.map +1 -0
- package/dist/erc8004/reputation.d.ts +8 -0
- package/dist/erc8004/reputation.js +22 -3
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/events/types.d.ts +2 -2
- package/dist/harnesses/cost-estimates.d.ts +145 -0
- package/dist/harnesses/cost-estimates.js +297 -0
- package/dist/harnesses/cost-estimates.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +40 -0
- package/dist/harnesses/engine/engine.js +69 -8
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/envelope-assembly.d.ts +2 -2
- package/dist/harnesses/engine/envelope-assembly.js +4 -2
- package/dist/harnesses/engine/envelope-assembly.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +21 -0
- package/dist/harnesses/engine/persistence.js +39 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/work-dir-reaper.d.ts +65 -0
- package/dist/harnesses/engine/work-dir-reaper.js +100 -0
- package/dist/harnesses/engine/work-dir-reaper.js.map +1 -0
- package/dist/harnesses/freeze.d.ts +4 -1
- package/dist/harnesses/freeze.js +12 -2
- package/dist/harnesses/freeze.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +4 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +7 -2
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.d.ts +4 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +7 -2
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/evaluation-context.d.ts +15 -4
- package/dist/harnesses/impls/evaluation-context.js +24 -8
- package/dist/harnesses/impls/evaluation-context.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +34 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +205 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +18 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +231 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +49 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.js +132 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +58 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +118 -0
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/index.d.ts +5 -0
- package/dist/harnesses/impls/hermes-agent/index.js +7 -0
- package/dist/harnesses/impls/hermes-agent/index.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/prompt.d.ts +15 -0
- package/dist/harnesses/impls/hermes-agent/prompt.js +37 -0
- package/dist/harnesses/impls/hermes-agent/prompt.js.map +1 -0
- package/dist/harnesses/impls/index.d.ts +13 -0
- package/dist/harnesses/impls/index.js +32 -4
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.js +13 -34
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/codex-workspace.js.map +1 -0
- package/dist/harnesses/impls/learner/harness.d.ts +62 -0
- package/dist/harnesses/impls/learner/harness.js +179 -0
- package/dist/harnesses/impls/learner/harness.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.js +15 -3
- package/dist/harnesses/impls/learner/harvest.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/index.d.ts +5 -5
- package/dist/harnesses/impls/{claude-code-learner → learner}/index.js +4 -4
- package/dist/harnesses/impls/learner/index.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.d.ts +4 -4
- package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.js +7 -7
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.js +3 -1
- package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -0
- package/dist/harnesses/impls/learner/test-utils/fake-plugin-outputs.js.map +1 -0
- package/dist/harnesses/impls/learner/test-utils/noop-adapter.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/types.d.ts +23 -2
- package/dist/harnesses/impls/learner/types.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +13 -12
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +7 -7
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +3 -3
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js +7 -6
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +11 -10
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js +11 -10
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +58 -0
- package/dist/harnesses/impls/stub.js +89 -0
- package/dist/harnesses/impls/stub.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +10 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +24 -5
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +104 -4
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +9 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +25 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/names.d.ts +1 -0
- package/dist/harnesses/names.js +3 -0
- package/dist/harnesses/names.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +48 -0
- package/dist/harnesses/readiness-registry.js +144 -0
- package/dist/harnesses/readiness-registry.js.map +1 -0
- package/dist/harnesses/types.d.ts +7 -0
- package/dist/main.d.ts +14 -0
- package/dist/main.js +372 -90
- package/dist/main.js.map +1 -1
- package/dist/mcp/server.js +14 -13
- package/dist/mcp/server.js.map +1 -1
- package/dist/operator-errors.d.ts +7 -0
- package/dist/operator-errors.js +26 -2
- package/dist/operator-errors.js.map +1 -1
- package/dist/preflight/claude-auth.d.ts +18 -0
- package/dist/preflight/claude-auth.js +38 -0
- package/dist/preflight/claude-auth.js.map +1 -1
- package/dist/restart-daemon.d.ts +71 -0
- package/dist/restart-daemon.js +82 -0
- package/dist/restart-daemon.js.map +1 -0
- package/dist/scripts/donation-consumption-acceptance.js +1 -1
- package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-known-bad.json +12 -0
- package/dist/scripts/swe-rebench-v2-seed-pool.json +26 -0
- package/dist/setup/halt-mode.d.ts +14 -0
- package/dist/setup/halt-mode.js +17 -0
- package/dist/setup/halt-mode.js.map +1 -0
- package/dist/solver-nets/prediction-operator-ux.js +43 -3
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +1 -0
- package/dist/solver-nets/registry.js +1 -1
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +52 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +76 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +38 -12
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +136 -27
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +6 -0
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +1 -0
- package/dist/solver-types/swe-rebench-v2.js +19 -6
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +10 -2
- package/dist/solvernets/daemon-init.js +22 -2
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/store/store.js +12 -4
- package/dist/store/store.js.map +1 -1
- package/dist/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
- package/dist/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
- package/dist/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
- package/dist/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
- package/dist/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
- package/dist/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
- package/dist/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
- package/dist/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
- package/dist/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
- package/dist/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
- package/dist/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
- package/dist/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
- package/dist/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
- package/dist/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
- package/dist/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
- package/dist/tx-retry.d.ts +13 -0
- package/dist/tx-retry.js +22 -0
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +28 -21
- package/dist/types/envelope.js +8 -3
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/payloads/index.d.ts +2 -2
- package/dist/types/payloads/index.js +13 -12
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +60 -10
- package/dist/types/payloads/portfolio-v0.js +16 -6
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +56 -14
- package/dist/types/payloads/prediction-apy-v0.js +16 -6
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +53 -14
- package/dist/types/payloads/prediction-v0.js +16 -6
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/util/extract-tx-hash.d.ts +14 -0
- package/dist/util/extract-tx-hash.js +19 -0
- package/dist/util/extract-tx-hash.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +45 -6
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +16 -6
- package/dist/x402/handler.js +51 -20
- package/dist/x402/handler.js.map +1 -1
- package/package.json +38 -13
- package/plugins/swe-rebench-v2-diffmin/.claude-plugin/plugin.json +5 -0
- package/plugins/swe-rebench-v2-diffmin/.mcp.json +8 -0
- package/plugins/swe-rebench-v2-diffmin/README.md +69 -0
- package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +12 -0
- package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats-server.mjs +72 -0
- package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats.mjs +48 -0
- package/plugins/swe-rebench-v2-diffmin/package.json +19 -0
- package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +116 -0
- package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +126 -0
- package/plugins/swe-rebench-v2-diffmin/test/diff-stats.test.ts +62 -0
- package/plugins/swe-rebench-v2-diffmin/test/manifest.test.ts +53 -0
- package/plugins/swe-rebench-v2-diffmin/tsconfig.json +12 -0
- package/plugins/swe-rebench-v2-runtime/README.md +13 -0
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +7 -3
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +6 -17
- package/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
- package/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
- package/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
- package/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
- package/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
- package/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
- package/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
- package/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
- package/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
- package/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
- package/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
- package/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
- package/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
- package/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
- package/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
- package/dist/dashboard/assets/index-BjtltOGc.js +0 -76
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/adapters/codex-code.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/adapters/codex-workspace.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/harness.d.ts +0 -22
- package/dist/harnesses/impls/claude-code-learner/harness.js +0 -62
- package/dist/harnesses/impls/claude-code-learner/harness.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/harvest.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/index.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/restoration-patch.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/types.js.map +0 -1
- package/dist/preflight/claude-required.d.ts +0 -8
- package/dist/preflight/claude-required.js +0 -17
- package/dist/preflight/claude-required.js.map +0 -1
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/types.js +0 -0
- /package/plugins/{claude-code-learner → learner}/.claude-plugin/plugin.json +0 -0
- /package/plugins/{claude-code-learner → learner}/.codex-plugin/plugin.json +0 -0
- /package/plugins/{claude-code-learner → learner}/AGENTS.md +0 -0
- /package/plugins/{claude-code-learner → learner}/CLAUDE.md +0 -0
- /package/plugins/{claude-code-learner → learner}/README.md +0 -0
- /package/plugins/{claude-code-learner → learner}/hooks/hooks.json +0 -0
- /package/plugins/{claude-code-learner → learner}/hooks/session-start +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/SKILL.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/analyst-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/consolidator-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/explorer-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/planner-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/promoter-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/step-worker-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/strategist-prompt.md +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var Uu=e=>{throw TypeError(e)};var Ta=(e,t,r)=>t.has(e)||Uu("Cannot "+r);var I=(e,t,r)=>(Ta(e,t,"read from private field"),r?r.call(e):t.get(e)),te=(e,t,r)=>t.has(e)?Uu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(Ta(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),se=(e,t,r)=>(Ta(e,t,"access private method"),r);var zi=(e,t,r,n)=>({set _(i){Y(e,t,i,r)},get _(){return I(e,t,n)}});function Fv(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(n,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>n[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const g of l.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function r(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(i){if(i.ep)return;i.ep=!0;const l=r(i);fetch(i.href,l)}})();function Nv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bf={exports:{}},aa={},wf={exports:{}},ae={};/**
|
|
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 Bi=Symbol.for("react.element"),Hv=Symbol.for("react.portal"),zv=Symbol.for("react.fragment"),$v=Symbol.for("react.strict_mode"),Wv=Symbol.for("react.profiler"),Uv=Symbol.for("react.provider"),Jv=Symbol.for("react.context"),qv=Symbol.for("react.forward_ref"),Kv=Symbol.for("react.suspense"),Vv=Symbol.for("react.memo"),Qv=Symbol.for("react.lazy"),Ju=Symbol.iterator;function Gv(e){return e===null||typeof e!="object"?null:(e=Ju&&e[Ju]||e["@@iterator"],typeof e=="function"?e:null)}var Cf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kf=Object.assign,Ef={};function Ss(e,t,r){this.props=e,this.context=t,this.refs=Ef,this.updater=r||Cf}Ss.prototype.isReactComponent={};Ss.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")};Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jf(){}jf.prototype=Ss.prototype;function Lc(e,t,r){this.props=e,this.context=t,this.refs=Ef,this.updater=r||Cf}var Bc=Lc.prototype=new jf;Bc.constructor=Lc;kf(Bc,Ss.prototype);Bc.isPureReactComponent=!0;var qu=Array.isArray,Rf=Object.prototype.hasOwnProperty,Ic={current:null},Tf={key:!0,ref:!0,__self:!0,__source:!0};function Df(e,t,r){var n,i={},l=null,g=null;if(t!=null)for(n in t.ref!==void 0&&(g=t.ref),t.key!==void 0&&(l=""+t.key),t)Rf.call(t,n)&&!Tf.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1<o){for(var a=Array(o),f=0;f<o;f++)a[f]=arguments[f+2];i.children=a}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)i[n]===void 0&&(i[n]=o[n]);return{$$typeof:Bi,type:e,key:l,ref:g,props:i,_owner:Ic.current}}function Yv(e,t){return{$$typeof:Bi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ac(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bi}function Xv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ku=/\/+/g;function Da(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Xv(""+e.key):t.toString(36)}function yo(e,t,r,n,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var g=!1;if(e===null)g=!0;else switch(l){case"string":case"number":g=!0;break;case"object":switch(e.$$typeof){case Bi:case Hv:g=!0}}if(g)return g=e,i=i(g),e=n===""?"."+Da(g,0):n,qu(i)?(r="",e!=null&&(r=e.replace(Ku,"$&/")+"/"),yo(i,t,r,"",function(f){return f})):i!=null&&(Ac(i)&&(i=Yv(i,r+(!i.key||g&&g.key===i.key?"":(""+i.key).replace(Ku,"$&/")+"/")+e)),t.push(i)),1;if(g=0,n=n===""?".":n+":",qu(e))for(var o=0;o<e.length;o++){l=e[o];var a=n+Da(l,o);g+=yo(l,t,r,a,i)}else if(a=Gv(e),typeof a=="function")for(e=a.call(e),o=0;!(l=e.next()).done;)l=l.value,a=n+Da(l,o++),g+=yo(l,t,r,a,i);else if(l==="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 g}function $i(e,t,r){if(e==null)return e;var n=[],i=0;return yo(e,n,"","",function(l){return t.call(r,l,i++)}),n}function Zv(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 Ve={current:null},_o={transition:null},em={ReactCurrentDispatcher:Ve,ReactCurrentBatchConfig:_o,ReactCurrentOwner:Ic};function Pf(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:$i,forEach:function(e,t,r){$i(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return $i(e,function(){t++}),t},toArray:function(e){return $i(e,function(t){return t})||[]},only:function(e){if(!Ac(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=Ss;ae.Fragment=zv;ae.Profiler=Wv;ae.PureComponent=Lc;ae.StrictMode=$v;ae.Suspense=Kv;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=em;ae.act=Pf;ae.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=kf({},e.props),i=e.key,l=e.ref,g=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,g=Ic.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(a in t)Rf.call(t,a)&&!Tf.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&o!==void 0?o[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){o=Array(a);for(var f=0;f<a;f++)o[f]=arguments[f+2];n.children=o}return{$$typeof:Bi,type:e.type,key:i,ref:l,props:n,_owner:g}};ae.createContext=function(e){return e={$$typeof:Jv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Uv,_context:e},e.Consumer=e};ae.createElement=Df;ae.createFactory=function(e){var t=Df.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:qv,render:e}};ae.isValidElement=Ac;ae.lazy=function(e){return{$$typeof:Qv,_payload:{_status:-1,_result:e},_init:Zv}};ae.memo=function(e,t){return{$$typeof:Vv,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=_o.transition;_o.transition={};try{e()}finally{_o.transition=t}};ae.unstable_act=Pf;ae.useCallback=function(e,t){return Ve.current.useCallback(e,t)};ae.useContext=function(e){return Ve.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return Ve.current.useDeferredValue(e)};ae.useEffect=function(e,t){return Ve.current.useEffect(e,t)};ae.useId=function(){return Ve.current.useId()};ae.useImperativeHandle=function(e,t,r){return Ve.current.useImperativeHandle(e,t,r)};ae.useInsertionEffect=function(e,t){return Ve.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return Ve.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return Ve.current.useMemo(e,t)};ae.useReducer=function(e,t,r){return Ve.current.useReducer(e,t,r)};ae.useRef=function(e){return Ve.current.useRef(e)};ae.useState=function(e){return Ve.current.useState(e)};ae.useSyncExternalStore=function(e,t,r){return Ve.current.useSyncExternalStore(e,t,r)};ae.useTransition=function(){return Ve.current.useTransition()};ae.version="18.3.1";wf.exports=ae;var O=wf.exports;const Mf=Nv(O),tm=Fv({__proto__:null,default:Mf},[O]);/**
|
|
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 rm=O,nm=Symbol.for("react.element"),sm=Symbol.for("react.fragment"),im=Object.prototype.hasOwnProperty,om=rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,am={key:!0,ref:!0,__self:!0,__source:!0};function Lf(e,t,r){var n,i={},l=null,g=null;r!==void 0&&(l=""+r),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(g=t.ref);for(n in t)im.call(t,n)&&!am.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:nm,type:e,key:l,ref:g,props:i,_owner:om.current}}aa.Fragment=sm;aa.jsx=Lf;aa.jsxs=Lf;bf.exports=aa;var s=bf.exports,vl={},Bf={exports:{}},dt={},If={exports:{}},Af={};/**
|
|
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(j,D){var M=j.length;j.push(D);e:for(;0<M;){var A=M-1>>>1,F=j[A];if(0<i(F,D))j[A]=D,j[M]=F,M=A;else break e}}function r(j){return j.length===0?null:j[0]}function n(j){if(j.length===0)return null;var D=j[0],M=j.pop();if(M!==D){j[0]=M;e:for(var A=0,F=j.length,q=F>>>1;A<q;){var G=2*(A+1)-1,X=j[G],K=G+1,T=j[K];if(0>i(X,M))K<F&&0>i(T,X)?(j[A]=T,j[K]=M,A=K):(j[A]=X,j[G]=M,A=G);else if(K<F&&0>i(T,M))j[A]=T,j[K]=M,A=K;else break e}}return D}function i(j,D){var M=j.sortIndex-D.sortIndex;return M!==0?M:j.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var g=Date,o=g.now();e.unstable_now=function(){return g.now()-o}}var a=[],f=[],y=1,p=null,v=3,_=!1,S=!1,x=!1,d=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(j){for(var D=r(f);D!==null;){if(D.callback===null)n(f);else if(D.startTime<=j)n(f),D.sortIndex=D.expirationTime,t(a,D);else break;D=r(f)}}function m(j){if(x=!1,h(j),!S)if(r(a)!==null)S=!0,J(w);else{var D=r(f);D!==null&&U(m,D.startTime-j)}}function w(j,D){S=!1,x&&(x=!1,u(b),b=-1),_=!0;var M=v;try{for(h(D),p=r(a);p!==null&&(!(p.expirationTime>D)||j&&!L());){var A=p.callback;if(typeof A=="function"){p.callback=null,v=p.priorityLevel;var F=A(p.expirationTime<=D);D=e.unstable_now(),typeof F=="function"?p.callback=F:p===r(a)&&n(a),h(D)}else n(a);p=r(a)}if(p!==null)var q=!0;else{var G=r(f);G!==null&&U(m,G.startTime-D),q=!1}return q}finally{p=null,v=M,_=!1}}var C=!1,E=null,b=-1,k=5,R=-1;function L(){return!(e.unstable_now()-R<k)}function P(){if(E!==null){var j=e.unstable_now();R=j;var D=!0;try{D=E(!0,j)}finally{D?B():(C=!1,E=null)}}else C=!1}var B;if(typeof c=="function")B=function(){c(P)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,z=H.port2;H.port1.onmessage=P,B=function(){z.postMessage(null)}}else B=function(){d(P,0)};function J(j){E=j,C||(C=!0,B())}function U(j,D){b=d(function(){j(e.unstable_now())},D)}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(j){j.callback=null},e.unstable_continueExecution=function(){S||_||(S=!0,J(w))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(j){switch(v){case 1:case 2:case 3:var D=3;break;default:D=v}var M=v;v=D;try{return j()}finally{v=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,D){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var M=v;v=j;try{return D()}finally{v=M}},e.unstable_scheduleCallback=function(j,D,M){var A=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?A+M:A):M=A,j){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=M+F,j={id:y++,callback:D,priorityLevel:j,startTime:M,expirationTime:F,sortIndex:-1},M>A?(j.sortIndex=M,t(f,j),r(a)===null&&j===r(f)&&(x?(u(b),b=-1):x=!0,U(m,M-A))):(j.sortIndex=F,t(a,j),S||_||(S=!0,J(w))),j},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(j){var D=v;return function(){var M=v;v=D;try{return j.apply(this,arguments)}finally{v=M}}}})(Af);If.exports=Af;var lm=If.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 cm=O,ut=lm;function V(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 Of=new Set,li={};function xn(e,t){fs(e,t),fs(e+"Capture",t)}function fs(e,t){for(li[e]=t,e=0;e<t.length;e++)Of.add(t[e])}var ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ml=Object.prototype.hasOwnProperty,um=/^[: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]*$/,Vu={},Qu={};function dm(e){return ml.call(Qu,e)?!0:ml.call(Vu,e)?!1:um.test(e)?Qu[e]=!0:(Vu[e]=!0,!1)}function hm(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 fm(e,t,r,n){if(t===null||typeof t>"u"||hm(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 Qe(e,t,r,n,i,l,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=g}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Qe(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){Ae[e]=new Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oc=/[\-:]([a-z])/g;function Fc(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(Oc,Fc);Ae[t]=new Qe(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(Oc,Fc);Ae[t]=new Qe(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(Oc,Fc);Ae[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nc(e,t,r,n){var i=Ae.hasOwnProperty(t)?Ae[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(fm(t,r,i,n)&&(r=null),n||i===null?dm(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var cr=cm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wi=Symbol.for("react.element"),Ln=Symbol.for("react.portal"),Bn=Symbol.for("react.fragment"),Hc=Symbol.for("react.strict_mode"),yl=Symbol.for("react.profiler"),Ff=Symbol.for("react.provider"),Nf=Symbol.for("react.context"),zc=Symbol.for("react.forward_ref"),_l=Symbol.for("react.suspense"),xl=Symbol.for("react.suspense_list"),$c=Symbol.for("react.memo"),pr=Symbol.for("react.lazy"),Hf=Symbol.for("react.offscreen"),Gu=Symbol.iterator;function Ps(e){return e===null||typeof e!="object"?null:(e=Gu&&e[Gu]||e["@@iterator"],typeof e=="function"?e:null)}var be=Object.assign,Pa;function qs(e){if(Pa===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Pa=t&&t[1]||""}return`
|
|
34
|
+
`+Pa+e}var Ma=!1;function La(e,t){if(!e||Ma)return"";Ma=!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(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
|
|
35
|
+
`),l=n.stack.split(`
|
|
36
|
+
`),g=i.length-1,o=l.length-1;1<=g&&0<=o&&i[g]!==l[o];)o--;for(;1<=g&&0<=o;g--,o--)if(i[g]!==l[o]){if(g!==1||o!==1)do if(g--,o--,0>o||i[g]!==l[o]){var a=`
|
|
37
|
+
`+i[g].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=g&&0<=o);break}}}finally{Ma=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?qs(e):""}function pm(e){switch(e.tag){case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return qs("Suspense");case 19:return qs("SuspenseList");case 0:case 2:case 15:return e=La(e.type,!1),e;case 11:return e=La(e.type.render,!1),e;case 1:return e=La(e.type,!0),e;default:return""}}function Sl(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 Bn:return"Fragment";case Ln:return"Portal";case yl:return"Profiler";case Hc:return"StrictMode";case _l:return"Suspense";case xl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nf:return(e.displayName||"Context")+".Consumer";case Ff:return(e._context.displayName||"Context")+".Provider";case zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $c:return t=e.displayName||null,t!==null?t:Sl(e.type)||"Memo";case pr:t=e._payload,e=e._init;try{return Sl(e(t))}catch{}}return null}function gm(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 Sl(t);case 8:return t===Hc?"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 Hr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vm(e){var t=zf(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 i=r.get,l=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(g){n=""+g,l.call(this,g)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ui(e){e._valueTracker||(e._valueTracker=vm(e))}function $f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zf(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Mo(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 bl(e,t){var r=t.checked;return be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Yu(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Hr(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 Wf(e,t){t=t.checked,t!=null&&Nc(e,"checked",t,!1)}function wl(e,t){Wf(e,t);var r=Hr(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")?Cl(e,t.type,r):t.hasOwnProperty("defaultValue")&&Cl(e,t.type,Hr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xu(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 Cl(e,t,r){(t!=="number"||Mo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ks=Array.isArray;function qn(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Hr(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function kl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zu(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(V(92));if(Ks(r)){if(1<r.length)throw Error(V(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Hr(r)}}function Uf(e,t){var r=Hr(t.value),n=Hr(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 ed(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jf(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 El(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ji,qf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ji=Ji||document.createElement("div"),Ji.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ji.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ci(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Zs={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},mm=["Webkit","ms","Moz","O"];Object.keys(Zs).forEach(function(e){mm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zs[t]=Zs[e]})});function Kf(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Zs.hasOwnProperty(e)&&Zs[e]?(""+t).trim():t+"px"}function Vf(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Kf(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var ym=be({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 jl(e,t){if(t){if(ym[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Rl(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 Tl=null;function Wc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dl=null,Kn=null,Vn=null;function td(e){if(e=Oi(e)){if(typeof Dl!="function")throw Error(V(280));var t=e.stateNode;t&&(t=ha(t),Dl(e.stateNode,e.type,t))}}function Qf(e){Kn?Vn?Vn.push(e):Vn=[e]:Kn=e}function Gf(){if(Kn){var e=Kn,t=Vn;if(Vn=Kn=null,td(e),t)for(e=0;e<t.length;e++)td(t[e])}}function Yf(e,t){return e(t)}function Xf(){}var Ba=!1;function Zf(e,t,r){if(Ba)return e(t,r);Ba=!0;try{return Yf(e,t,r)}finally{Ba=!1,(Kn!==null||Vn!==null)&&(Xf(),Gf())}}function ui(e,t){var r=e.stateNode;if(r===null)return null;var n=ha(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(V(231,t,typeof r));return r}var Pl=!1;if(ir)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){Pl=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{Pl=!1}function _m(e,t,r,n,i,l,g,o,a){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(y){this.onError(y)}}var ei=!1,Lo=null,Bo=!1,Ml=null,xm={onError:function(e){ei=!0,Lo=e}};function Sm(e,t,r,n,i,l,g,o,a){ei=!1,Lo=null,_m.apply(xm,arguments)}function bm(e,t,r,n,i,l,g,o,a){if(Sm.apply(this,arguments),ei){if(ei){var f=Lo;ei=!1,Lo=null}else throw Error(V(198));Bo||(Bo=!0,Ml=f)}}function Sn(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 ep(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 rd(e){if(Sn(e)!==e)throw Error(V(188))}function wm(e){var t=e.alternate;if(!t){if(t=Sn(e),t===null)throw Error(V(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var l=i.alternate;if(l===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===r)return rd(i),e;if(l===n)return rd(i),t;l=l.sibling}throw Error(V(188))}if(r.return!==n.return)r=i,n=l;else{for(var g=!1,o=i.child;o;){if(o===r){g=!0,r=i,n=l;break}if(o===n){g=!0,n=i,r=l;break}o=o.sibling}if(!g){for(o=l.child;o;){if(o===r){g=!0,r=l,n=i;break}if(o===n){g=!0,n=l,r=i;break}o=o.sibling}if(!g)throw Error(V(189))}}if(r.alternate!==n)throw Error(V(190))}if(r.tag!==3)throw Error(V(188));return r.stateNode.current===r?e:t}function tp(e){return e=wm(e),e!==null?rp(e):null}function rp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=rp(e);if(t!==null)return t;e=e.sibling}return null}var np=ut.unstable_scheduleCallback,nd=ut.unstable_cancelCallback,Cm=ut.unstable_shouldYield,km=ut.unstable_requestPaint,ke=ut.unstable_now,Em=ut.unstable_getCurrentPriorityLevel,Uc=ut.unstable_ImmediatePriority,sp=ut.unstable_UserBlockingPriority,Io=ut.unstable_NormalPriority,jm=ut.unstable_LowPriority,ip=ut.unstable_IdlePriority,la=null,$t=null;function Rm(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(la,e,void 0,(e.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:Pm,Tm=Math.log,Dm=Math.LN2;function Pm(e){return e>>>=0,e===0?32:31-(Tm(e)/Dm|0)|0}var qi=64,Ki=4194304;function Vs(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 Ao(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,l=e.pingedLanes,g=r&268435455;if(g!==0){var o=g&~i;o!==0?n=Vs(o):(l&=g,l!==0&&(n=Vs(l)))}else g=r&~i,g!==0?n=Vs(g):l!==0&&(n=Vs(l));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,l=t&-t,i>=l||i===16&&(l&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-Pt(t),i=1<<r,n|=e[r],t&=~i;return n}function Mm(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 Lm(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var g=31-Pt(l),o=1<<g,a=i[g];a===-1?(!(o&r)||o&n)&&(i[g]=Mm(o,t)):a<=t&&(e.expiredLanes|=o),l&=~o}}function Ll(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function op(){var e=qi;return qi<<=1,!(qi&4194240)&&(qi=64),e}function Ia(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ii(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pt(t),e[t]=r}function Bm(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 i=31-Pt(r),l=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~l}}function Jc(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Pt(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var he=0;function ap(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lp,qc,cp,up,dp,Bl=!1,Vi=[],Pr=null,Mr=null,Lr=null,di=new Map,hi=new Map,vr=[],Im="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 sd(e,t){switch(e){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Lr=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hi.delete(t.pointerId)}}function Ls(e,t,r,n,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:l,targetContainers:[i]},t!==null&&(t=Oi(t),t!==null&&qc(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Am(e,t,r,n,i){switch(t){case"focusin":return Pr=Ls(Pr,e,t,r,n,i),!0;case"dragenter":return Mr=Ls(Mr,e,t,r,n,i),!0;case"mouseover":return Lr=Ls(Lr,e,t,r,n,i),!0;case"pointerover":var l=i.pointerId;return di.set(l,Ls(di.get(l)||null,e,t,r,n,i)),!0;case"gotpointercapture":return l=i.pointerId,hi.set(l,Ls(hi.get(l)||null,e,t,r,n,i)),!0}return!1}function hp(e){var t=Gr(e.target);if(t!==null){var r=Sn(t);if(r!==null){if(t=r.tag,t===13){if(t=ep(r),t!==null){e.blockedOn=t,dp(e.priority,function(){cp(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 xo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Il(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Tl=n,r.target.dispatchEvent(n),Tl=null}else return t=Oi(r),t!==null&&qc(t),e.blockedOn=r,!1;t.shift()}return!0}function id(e,t,r){xo(e)&&r.delete(t)}function Om(){Bl=!1,Pr!==null&&xo(Pr)&&(Pr=null),Mr!==null&&xo(Mr)&&(Mr=null),Lr!==null&&xo(Lr)&&(Lr=null),di.forEach(id),hi.forEach(id)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,Bl||(Bl=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,Om)))}function fi(e){function t(i){return Bs(i,e)}if(0<Vi.length){Bs(Vi[0],e);for(var r=1;r<Vi.length;r++){var n=Vi[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Pr!==null&&Bs(Pr,e),Mr!==null&&Bs(Mr,e),Lr!==null&&Bs(Lr,e),di.forEach(t),hi.forEach(t),r=0;r<vr.length;r++)n=vr[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<vr.length&&(r=vr[0],r.blockedOn===null);)hp(r),r.blockedOn===null&&vr.shift()}var Qn=cr.ReactCurrentBatchConfig,Oo=!0;function Fm(e,t,r,n){var i=he,l=Qn.transition;Qn.transition=null;try{he=1,Kc(e,t,r,n)}finally{he=i,Qn.transition=l}}function Nm(e,t,r,n){var i=he,l=Qn.transition;Qn.transition=null;try{he=4,Kc(e,t,r,n)}finally{he=i,Qn.transition=l}}function Kc(e,t,r,n){if(Oo){var i=Il(e,t,r,n);if(i===null)Ja(e,t,n,Fo,r),sd(e,n);else if(Am(i,e,t,r,n))n.stopPropagation();else if(sd(e,n),t&4&&-1<Im.indexOf(e)){for(;i!==null;){var l=Oi(i);if(l!==null&&lp(l),l=Il(e,t,r,n),l===null&&Ja(e,t,n,Fo,r),l===i)break;i=l}i!==null&&n.stopPropagation()}else Ja(e,t,n,null,r)}}var Fo=null;function Il(e,t,r,n){if(Fo=null,e=Wc(n),e=Gr(e),e!==null)if(t=Sn(e),t===null)e=null;else if(r=t.tag,r===13){if(e=ep(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 Fo=e,null}function fp(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(Em()){case Uc:return 1;case sp:return 4;case Io:case jm:return 16;case ip:return 536870912;default:return 16}default:return 16}}var Rr=null,Vc=null,So=null;function pp(){if(So)return So;var e,t=Vc,r=t.length,n,i="value"in Rr?Rr.value:Rr.textContent,l=i.length;for(e=0;e<r&&t[e]===i[e];e++);var g=r-e;for(n=1;n<=g&&t[r-n]===i[l-n];n++);return So=i.slice(e,1<n?1-n:void 0)}function bo(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 Qi(){return!0}function od(){return!1}function ht(e){function t(r,n,i,l,g){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=l,this.target=g,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Qi:od,this.isPropagationStopped=od,this}return be(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=Qi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Qi)},persist:function(){},isPersistent:Qi}),t}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qc=ht(bs),Ai=be({},bs,{view:0,detail:0}),Hm=ht(Ai),Aa,Oa,Is,ca=be({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gc,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!==Is&&(Is&&e.type==="mousemove"?(Aa=e.screenX-Is.screenX,Oa=e.screenY-Is.screenY):Oa=Aa=0,Is=e),Aa)},movementY:function(e){return"movementY"in e?e.movementY:Oa}}),ad=ht(ca),zm=be({},ca,{dataTransfer:0}),$m=ht(zm),Wm=be({},Ai,{relatedTarget:0}),Fa=ht(Wm),Um=be({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),Jm=ht(Um),qm=be({},bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Km=ht(qm),Vm=be({},bs,{data:0}),ld=ht(Vm),Qm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gm={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"},Ym={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ym[e])?!!t[e]:!1}function Gc(){return Xm}var Zm=be({},Ai,{key:function(e){if(e.key){var t=Qm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gc,charCode:function(e){return e.type==="keypress"?bo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ey=ht(Zm),ty=be({},ca,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cd=ht(ty),ry=be({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gc}),ny=ht(ry),sy=be({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),iy=ht(sy),oy=be({},ca,{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}),ay=ht(oy),ly=[9,13,27,32],Yc=ir&&"CompositionEvent"in window,ti=null;ir&&"documentMode"in document&&(ti=document.documentMode);var cy=ir&&"TextEvent"in window&&!ti,gp=ir&&(!Yc||ti&&8<ti&&11>=ti),ud=" ",dd=!1;function vp(e,t){switch(e){case"keyup":return ly.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function uy(e,t){switch(e){case"compositionend":return mp(t);case"keypress":return t.which!==32?null:(dd=!0,ud);case"textInput":return e=t.data,e===ud&&dd?null:e;default:return null}}function dy(e,t){if(In)return e==="compositionend"||!Yc&&vp(e,t)?(e=pp(),So=Vc=Rr=null,In=!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 gp&&t.locale!=="ko"?null:t.data;default:return null}}var hy={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 hd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hy[e.type]:t==="textarea"}function yp(e,t,r,n){Qf(n),t=No(t,"onChange"),0<t.length&&(r=new Qc("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ri=null,pi=null;function fy(e){Tp(e,0)}function ua(e){var t=Fn(e);if($f(t))return e}function py(e,t){if(e==="change")return t}var _p=!1;if(ir){var Na;if(ir){var Ha="oninput"in document;if(!Ha){var fd=document.createElement("div");fd.setAttribute("oninput","return;"),Ha=typeof fd.oninput=="function"}Na=Ha}else Na=!1;_p=Na&&(!document.documentMode||9<document.documentMode)}function pd(){ri&&(ri.detachEvent("onpropertychange",xp),pi=ri=null)}function xp(e){if(e.propertyName==="value"&&ua(pi)){var t=[];yp(t,pi,e,Wc(e)),Zf(fy,t)}}function gy(e,t,r){e==="focusin"?(pd(),ri=t,pi=r,ri.attachEvent("onpropertychange",xp)):e==="focusout"&&pd()}function vy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ua(pi)}function my(e,t){if(e==="click")return ua(t)}function yy(e,t){if(e==="input"||e==="change")return ua(t)}function _y(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:_y;function gi(e,t){if(Lt(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 i=r[n];if(!ml.call(t,i)||!Lt(e[i],t[i]))return!1}return!0}function gd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vd(e,t){var r=gd(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=gd(r)}}function Sp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bp(){for(var e=window,t=Mo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Mo(e.document)}return t}function Xc(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 xy(e){var t=bp(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Sp(r.ownerDocument.documentElement,r)){if(n!==null&&Xc(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 i=r.textContent.length,l=Math.min(n.start,i);n=n.end===void 0?l:Math.min(n.end,i),!e.extend&&l>n&&(i=n,n=l,l=i),i=vd(r,l);var g=vd(r,n);i&&g&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>n?(e.addRange(t),e.extend(g.node,g.offset)):(t.setEnd(g.node,g.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 Sy=ir&&"documentMode"in document&&11>=document.documentMode,An=null,Al=null,ni=null,Ol=!1;function md(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ol||An==null||An!==Mo(n)||(n=An,"selectionStart"in n&&Xc(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}),ni&&gi(ni,n)||(ni=n,n=No(Al,"onSelect"),0<n.length&&(t=new Qc("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=An)))}function Gi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var On={animationend:Gi("Animation","AnimationEnd"),animationiteration:Gi("Animation","AnimationIteration"),animationstart:Gi("Animation","AnimationStart"),transitionend:Gi("Transition","TransitionEnd")},za={},wp={};ir&&(wp=document.createElement("div").style,"AnimationEvent"in window||(delete On.animationend.animation,delete On.animationiteration.animation,delete On.animationstart.animation),"TransitionEvent"in window||delete On.transitionend.transition);function da(e){if(za[e])return za[e];if(!On[e])return e;var t=On[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in wp)return za[e]=t[r];return e}var Cp=da("animationend"),kp=da("animationiteration"),Ep=da("animationstart"),jp=da("transitionend"),Rp=new Map,yd="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 $r(e,t){Rp.set(e,t),xn(t,[e])}for(var $a=0;$a<yd.length;$a++){var Wa=yd[$a],by=Wa.toLowerCase(),wy=Wa[0].toUpperCase()+Wa.slice(1);$r(by,"on"+wy)}$r(Cp,"onAnimationEnd");$r(kp,"onAnimationIteration");$r(Ep,"onAnimationStart");$r("dblclick","onDoubleClick");$r("focusin","onFocus");$r("focusout","onBlur");$r(jp,"onTransitionEnd");fs("onMouseEnter",["mouseout","mouseover"]);fs("onMouseLeave",["mouseout","mouseover"]);fs("onPointerEnter",["pointerout","pointerover"]);fs("onPointerLeave",["pointerout","pointerover"]);xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xn("onBeforeInput",["compositionend","keypress","textInput","paste"]);xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qs="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(" "),Cy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qs));function _d(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,bm(n,t,void 0,e),e.currentTarget=null}function Tp(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var l=void 0;if(t)for(var g=n.length-1;0<=g;g--){var o=n[g],a=o.instance,f=o.currentTarget;if(o=o.listener,a!==l&&i.isPropagationStopped())break e;_d(i,o,f),l=a}else for(g=0;g<n.length;g++){if(o=n[g],a=o.instance,f=o.currentTarget,o=o.listener,a!==l&&i.isPropagationStopped())break e;_d(i,o,f),l=a}}}if(Bo)throw e=Ml,Bo=!1,Ml=null,e}function ve(e,t){var r=t[$l];r===void 0&&(r=t[$l]=new Set);var n=e+"__bubble";r.has(n)||(Dp(t,e,2,!1),r.add(n))}function Ua(e,t,r){var n=0;t&&(n|=4),Dp(r,e,n,t)}var Yi="_reactListening"+Math.random().toString(36).slice(2);function vi(e){if(!e[Yi]){e[Yi]=!0,Of.forEach(function(r){r!=="selectionchange"&&(Cy.has(r)||Ua(r,!1,e),Ua(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yi]||(t[Yi]=!0,Ua("selectionchange",!1,t))}}function Dp(e,t,r,n){switch(fp(t)){case 1:var i=Fm;break;case 4:i=Nm;break;default:i=Kc}r=i.bind(null,t,r,e),i=void 0,!Pl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Ja(e,t,r,n,i){var l=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var g=n.tag;if(g===3||g===4){var o=n.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(g===4)for(g=n.return;g!==null;){var a=g.tag;if((a===3||a===4)&&(a=g.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;g=g.return}for(;o!==null;){if(g=Gr(o),g===null)return;if(a=g.tag,a===5||a===6){n=l=g;continue e}o=o.parentNode}}n=n.return}Zf(function(){var f=l,y=Wc(r),p=[];e:{var v=Rp.get(e);if(v!==void 0){var _=Qc,S=e;switch(e){case"keypress":if(bo(r)===0)break e;case"keydown":case"keyup":_=ey;break;case"focusin":S="focus",_=Fa;break;case"focusout":S="blur",_=Fa;break;case"beforeblur":case"afterblur":_=Fa;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":_=ad;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=$m;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=ny;break;case Cp:case kp:case Ep:_=Jm;break;case jp:_=iy;break;case"scroll":_=Hm;break;case"wheel":_=ay;break;case"copy":case"cut":case"paste":_=Km;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=cd}var x=(t&4)!==0,d=!x&&e==="scroll",u=x?v!==null?v+"Capture":null:v;x=[];for(var c=f,h;c!==null;){h=c;var m=h.stateNode;if(h.tag===5&&m!==null&&(h=m,u!==null&&(m=ui(c,u),m!=null&&x.push(mi(c,m,h)))),d)break;c=c.return}0<x.length&&(v=new _(v,S,null,r,y),p.push({event:v,listeners:x}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",v&&r!==Tl&&(S=r.relatedTarget||r.fromElement)&&(Gr(S)||S[or]))break e;if((_||v)&&(v=y.window===y?y:(v=y.ownerDocument)?v.defaultView||v.parentWindow:window,_?(S=r.relatedTarget||r.toElement,_=f,S=S?Gr(S):null,S!==null&&(d=Sn(S),S!==d||S.tag!==5&&S.tag!==6)&&(S=null)):(_=null,S=f),_!==S)){if(x=ad,m="onMouseLeave",u="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(x=cd,m="onPointerLeave",u="onPointerEnter",c="pointer"),d=_==null?v:Fn(_),h=S==null?v:Fn(S),v=new x(m,c+"leave",_,r,y),v.target=d,v.relatedTarget=h,m=null,Gr(y)===f&&(x=new x(u,c+"enter",S,r,y),x.target=h,x.relatedTarget=d,m=x),d=m,_&&S)t:{for(x=_,u=S,c=0,h=x;h;h=En(h))c++;for(h=0,m=u;m;m=En(m))h++;for(;0<c-h;)x=En(x),c--;for(;0<h-c;)u=En(u),h--;for(;c--;){if(x===u||u!==null&&x===u.alternate)break t;x=En(x),u=En(u)}x=null}else x=null;_!==null&&xd(p,v,_,x,!1),S!==null&&d!==null&&xd(p,d,S,x,!0)}}e:{if(v=f?Fn(f):window,_=v.nodeName&&v.nodeName.toLowerCase(),_==="select"||_==="input"&&v.type==="file")var w=py;else if(hd(v))if(_p)w=yy;else{w=vy;var C=gy}else(_=v.nodeName)&&_.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(w=my);if(w&&(w=w(e,f))){yp(p,w,r,y);break e}C&&C(e,v,f),e==="focusout"&&(C=v._wrapperState)&&C.controlled&&v.type==="number"&&Cl(v,"number",v.value)}switch(C=f?Fn(f):window,e){case"focusin":(hd(C)||C.contentEditable==="true")&&(An=C,Al=f,ni=null);break;case"focusout":ni=Al=An=null;break;case"mousedown":Ol=!0;break;case"contextmenu":case"mouseup":case"dragend":Ol=!1,md(p,r,y);break;case"selectionchange":if(Sy)break;case"keydown":case"keyup":md(p,r,y)}var E;if(Yc)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else In?vp(e,r)&&(b="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(b="onCompositionStart");b&&(gp&&r.locale!=="ko"&&(In||b!=="onCompositionStart"?b==="onCompositionEnd"&&In&&(E=pp()):(Rr=y,Vc="value"in Rr?Rr.value:Rr.textContent,In=!0)),C=No(f,b),0<C.length&&(b=new ld(b,e,null,r,y),p.push({event:b,listeners:C}),E?b.data=E:(E=mp(r),E!==null&&(b.data=E)))),(E=cy?uy(e,r):dy(e,r))&&(f=No(f,"onBeforeInput"),0<f.length&&(y=new ld("onBeforeInput","beforeinput",null,r,y),p.push({event:y,listeners:f}),y.data=E))}Tp(p,t)})}function mi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function No(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=ui(e,r),l!=null&&n.unshift(mi(e,l,i)),l=ui(e,t),l!=null&&n.push(mi(e,l,i))),e=e.return}return n}function En(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xd(e,t,r,n,i){for(var l=t._reactName,g=[];r!==null&&r!==n;){var o=r,a=o.alternate,f=o.stateNode;if(a!==null&&a===n)break;o.tag===5&&f!==null&&(o=f,i?(a=ui(r,l),a!=null&&g.unshift(mi(r,a,o))):i||(a=ui(r,l),a!=null&&g.push(mi(r,a,o)))),r=r.return}g.length!==0&&e.push({event:t,listeners:g})}var ky=/\r\n?/g,Ey=/\u0000|\uFFFD/g;function Sd(e){return(typeof e=="string"?e:""+e).replace(ky,`
|
|
38
|
+
`).replace(Ey,"")}function Xi(e,t,r){if(t=Sd(t),Sd(e)!==t&&r)throw Error(V(425))}function Ho(){}var Fl=null,Nl=null;function Hl(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 zl=typeof setTimeout=="function"?setTimeout:void 0,jy=typeof clearTimeout=="function"?clearTimeout:void 0,bd=typeof Promise=="function"?Promise:void 0,Ry=typeof queueMicrotask=="function"?queueMicrotask:typeof bd<"u"?function(e){return bd.resolve(null).then(e).catch(Ty)}:zl;function Ty(e){setTimeout(function(){throw e})}function qa(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),fi(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);fi(t)}function Br(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 wd(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 ws=Math.random().toString(36).slice(2),Ht="__reactFiber$"+ws,yi="__reactProps$"+ws,or="__reactContainer$"+ws,$l="__reactEvents$"+ws,Dy="__reactListeners$"+ws,Py="__reactHandles$"+ws;function Gr(e){var t=e[Ht];if(t)return t;for(var r=e.parentNode;r;){if(t=r[or]||r[Ht]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=wd(e);e!==null;){if(r=e[Ht])return r;e=wd(e)}return t}e=r,r=e.parentNode}return null}function Oi(e){return e=e[Ht]||e[or],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function ha(e){return e[yi]||null}var Wl=[],Nn=-1;function Wr(e){return{current:e}}function me(e){0>Nn||(e.current=Wl[Nn],Wl[Nn]=null,Nn--)}function fe(e,t){Nn++,Wl[Nn]=e.current,e.current=t}var zr={},$e=Wr(zr),tt=Wr(!1),pn=zr;function ps(e,t){var r=e.type.contextTypes;if(!r)return zr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in r)i[l]=t[l];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function rt(e){return e=e.childContextTypes,e!=null}function zo(){me(tt),me($e)}function Cd(e,t,r){if($e.current!==zr)throw Error(V(168));fe($e,t),fe(tt,r)}function Pp(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(V(108,gm(e)||"Unknown",i));return be({},r,n)}function $o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zr,pn=$e.current,fe($e,e),fe(tt,tt.current),!0}function kd(e,t,r){var n=e.stateNode;if(!n)throw Error(V(169));r?(e=Pp(e,t,pn),n.__reactInternalMemoizedMergedChildContext=e,me(tt),me($e),fe($e,e)):me(tt),fe(tt,r)}var Kt=null,fa=!1,Ka=!1;function Mp(e){Kt===null?Kt=[e]:Kt.push(e)}function My(e){fa=!0,Mp(e)}function Ur(){if(!Ka&&Kt!==null){Ka=!0;var e=0,t=he;try{var r=Kt;for(he=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Kt=null,fa=!1}catch(i){throw Kt!==null&&(Kt=Kt.slice(e+1)),np(Uc,Ur),i}finally{he=t,Ka=!1}}return null}var Hn=[],zn=0,Wo=null,Uo=0,gt=[],vt=0,gn=null,er=1,tr="";function Kr(e,t){Hn[zn++]=Uo,Hn[zn++]=Wo,Wo=e,Uo=t}function Lp(e,t,r){gt[vt++]=er,gt[vt++]=tr,gt[vt++]=gn,gn=e;var n=er;e=tr;var i=32-Pt(n)-1;n&=~(1<<i),r+=1;var l=32-Pt(t)+i;if(30<l){var g=i-i%5;l=(n&(1<<g)-1).toString(32),n>>=g,i-=g,er=1<<32-Pt(t)+i|r<<i|n,tr=l+e}else er=1<<l|r<<i|n,tr=e}function Zc(e){e.return!==null&&(Kr(e,1),Lp(e,1,0))}function eu(e){for(;e===Wo;)Wo=Hn[--zn],Hn[zn]=null,Uo=Hn[--zn],Hn[zn]=null;for(;e===gn;)gn=gt[--vt],gt[vt]=null,tr=gt[--vt],gt[vt]=null,er=gt[--vt],gt[vt]=null}var ct=null,lt=null,ye=!1,Tt=null;function Bp(e,t){var r=_t(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 Ed(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,ct=e,lt=Br(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=gn!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=_t(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ct=e,lt=null,!0):!1;default:return!1}}function Ul(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Jl(e){if(ye){var t=lt;if(t){var r=t;if(!Ed(e,t)){if(Ul(e))throw Error(V(418));t=Br(r.nextSibling);var n=ct;t&&Ed(e,t)?Bp(n,r):(e.flags=e.flags&-4097|2,ye=!1,ct=e)}}else{if(Ul(e))throw Error(V(418));e.flags=e.flags&-4097|2,ye=!1,ct=e}}}function jd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function Zi(e){if(e!==ct)return!1;if(!ye)return jd(e),ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hl(e.type,e.memoizedProps)),t&&(t=lt)){if(Ul(e))throw Ip(),Error(V(418));for(;t;)Bp(e,t),t=Br(t.nextSibling)}if(jd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){lt=Br(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}lt=null}}else lt=ct?Br(e.stateNode.nextSibling):null;return!0}function Ip(){for(var e=lt;e;)e=Br(e.nextSibling)}function gs(){lt=ct=null,ye=!1}function tu(e){Tt===null?Tt=[e]:Tt.push(e)}var Ly=cr.ReactCurrentBatchConfig;function As(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(V(309));var n=r.stateNode}if(!n)throw Error(V(147,e));var i=n,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(g){var o=i.refs;g===null?delete o[l]:o[l]=g},t._stringRef=l,t)}if(typeof e!="string")throw Error(V(284));if(!r._owner)throw Error(V(290,e))}return e}function eo(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rd(e){var t=e._init;return t(e._payload)}function Ap(e){function t(u,c){if(e){var h=u.deletions;h===null?(u.deletions=[c],u.flags|=16):h.push(c)}}function r(u,c){if(!e)return null;for(;c!==null;)t(u,c),c=c.sibling;return null}function n(u,c){for(u=new Map;c!==null;)c.key!==null?u.set(c.key,c):u.set(c.index,c),c=c.sibling;return u}function i(u,c){return u=Fr(u,c),u.index=0,u.sibling=null,u}function l(u,c,h){return u.index=h,e?(h=u.alternate,h!==null?(h=h.index,h<c?(u.flags|=2,c):h):(u.flags|=2,c)):(u.flags|=1048576,c)}function g(u){return e&&u.alternate===null&&(u.flags|=2),u}function o(u,c,h,m){return c===null||c.tag!==6?(c=el(h,u.mode,m),c.return=u,c):(c=i(c,h),c.return=u,c)}function a(u,c,h,m){var w=h.type;return w===Bn?y(u,c,h.props.children,m,h.key):c!==null&&(c.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===pr&&Rd(w)===c.type)?(m=i(c,h.props),m.ref=As(u,c,h),m.return=u,m):(m=To(h.type,h.key,h.props,null,u.mode,m),m.ref=As(u,c,h),m.return=u,m)}function f(u,c,h,m){return c===null||c.tag!==4||c.stateNode.containerInfo!==h.containerInfo||c.stateNode.implementation!==h.implementation?(c=tl(h,u.mode,m),c.return=u,c):(c=i(c,h.children||[]),c.return=u,c)}function y(u,c,h,m,w){return c===null||c.tag!==7?(c=hn(h,u.mode,m,w),c.return=u,c):(c=i(c,h),c.return=u,c)}function p(u,c,h){if(typeof c=="string"&&c!==""||typeof c=="number")return c=el(""+c,u.mode,h),c.return=u,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Wi:return h=To(c.type,c.key,c.props,null,u.mode,h),h.ref=As(u,null,c),h.return=u,h;case Ln:return c=tl(c,u.mode,h),c.return=u,c;case pr:var m=c._init;return p(u,m(c._payload),h)}if(Ks(c)||Ps(c))return c=hn(c,u.mode,h,null),c.return=u,c;eo(u,c)}return null}function v(u,c,h,m){var w=c!==null?c.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return w!==null?null:o(u,c,""+h,m);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Wi:return h.key===w?a(u,c,h,m):null;case Ln:return h.key===w?f(u,c,h,m):null;case pr:return w=h._init,v(u,c,w(h._payload),m)}if(Ks(h)||Ps(h))return w!==null?null:y(u,c,h,m,null);eo(u,h)}return null}function _(u,c,h,m,w){if(typeof m=="string"&&m!==""||typeof m=="number")return u=u.get(h)||null,o(c,u,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Wi:return u=u.get(m.key===null?h:m.key)||null,a(c,u,m,w);case Ln:return u=u.get(m.key===null?h:m.key)||null,f(c,u,m,w);case pr:var C=m._init;return _(u,c,h,C(m._payload),w)}if(Ks(m)||Ps(m))return u=u.get(h)||null,y(c,u,m,w,null);eo(c,m)}return null}function S(u,c,h,m){for(var w=null,C=null,E=c,b=c=0,k=null;E!==null&&b<h.length;b++){E.index>b?(k=E,E=null):k=E.sibling;var R=v(u,E,h[b],m);if(R===null){E===null&&(E=k);break}e&&E&&R.alternate===null&&t(u,E),c=l(R,c,b),C===null?w=R:C.sibling=R,C=R,E=k}if(b===h.length)return r(u,E),ye&&Kr(u,b),w;if(E===null){for(;b<h.length;b++)E=p(u,h[b],m),E!==null&&(c=l(E,c,b),C===null?w=E:C.sibling=E,C=E);return ye&&Kr(u,b),w}for(E=n(u,E);b<h.length;b++)k=_(E,u,b,h[b],m),k!==null&&(e&&k.alternate!==null&&E.delete(k.key===null?b:k.key),c=l(k,c,b),C===null?w=k:C.sibling=k,C=k);return e&&E.forEach(function(L){return t(u,L)}),ye&&Kr(u,b),w}function x(u,c,h,m){var w=Ps(h);if(typeof w!="function")throw Error(V(150));if(h=w.call(h),h==null)throw Error(V(151));for(var C=w=null,E=c,b=c=0,k=null,R=h.next();E!==null&&!R.done;b++,R=h.next()){E.index>b?(k=E,E=null):k=E.sibling;var L=v(u,E,R.value,m);if(L===null){E===null&&(E=k);break}e&&E&&L.alternate===null&&t(u,E),c=l(L,c,b),C===null?w=L:C.sibling=L,C=L,E=k}if(R.done)return r(u,E),ye&&Kr(u,b),w;if(E===null){for(;!R.done;b++,R=h.next())R=p(u,R.value,m),R!==null&&(c=l(R,c,b),C===null?w=R:C.sibling=R,C=R);return ye&&Kr(u,b),w}for(E=n(u,E);!R.done;b++,R=h.next())R=_(E,u,b,R.value,m),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?b:R.key),c=l(R,c,b),C===null?w=R:C.sibling=R,C=R);return e&&E.forEach(function(P){return t(u,P)}),ye&&Kr(u,b),w}function d(u,c,h,m){if(typeof h=="object"&&h!==null&&h.type===Bn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Wi:e:{for(var w=h.key,C=c;C!==null;){if(C.key===w){if(w=h.type,w===Bn){if(C.tag===7){r(u,C.sibling),c=i(C,h.props.children),c.return=u,u=c;break e}}else if(C.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===pr&&Rd(w)===C.type){r(u,C.sibling),c=i(C,h.props),c.ref=As(u,C,h),c.return=u,u=c;break e}r(u,C);break}else t(u,C);C=C.sibling}h.type===Bn?(c=hn(h.props.children,u.mode,m,h.key),c.return=u,u=c):(m=To(h.type,h.key,h.props,null,u.mode,m),m.ref=As(u,c,h),m.return=u,u=m)}return g(u);case Ln:e:{for(C=h.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===h.containerInfo&&c.stateNode.implementation===h.implementation){r(u,c.sibling),c=i(c,h.children||[]),c.return=u,u=c;break e}else{r(u,c);break}else t(u,c);c=c.sibling}c=tl(h,u.mode,m),c.return=u,u=c}return g(u);case pr:return C=h._init,d(u,c,C(h._payload),m)}if(Ks(h))return S(u,c,h,m);if(Ps(h))return x(u,c,h,m);eo(u,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,c!==null&&c.tag===6?(r(u,c.sibling),c=i(c,h),c.return=u,u=c):(r(u,c),c=el(h,u.mode,m),c.return=u,u=c),g(u)):r(u,c)}return d}var vs=Ap(!0),Op=Ap(!1),Jo=Wr(null),qo=null,$n=null,ru=null;function nu(){ru=$n=qo=null}function su(e){var t=Jo.current;me(Jo),e._currentValue=t}function ql(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 Gn(e,t){qo=e,ru=$n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(ru!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(qo===null)throw Error(V(308));$n=e,qo.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var Yr=null;function iu(e){Yr===null?Yr=[e]:Yr.push(e)}function Fp(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,iu(t)):(r.next=i.next,i.next=r),t.interleaved=r,ar(e,n)}function ar(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 gr=!1;function ou(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Np(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 rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ce&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ar(e,r)}return i=n.interleaved,i===null?(t.next=t,iu(n)):(t.next=i.next,i.next=t),n.interleaved=t,ar(e,r)}function wo(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,Jc(e,r)}}function Td(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,l=null;if(r=r.firstBaseUpdate,r!==null){do{var g={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};l===null?i=l=g:l=l.next=g,r=r.next}while(r!==null);l===null?i=l=t:l=l.next=t}else i=l=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:l,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 Ko(e,t,r,n){var i=e.updateQueue;gr=!1;var l=i.firstBaseUpdate,g=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var a=o,f=a.next;a.next=null,g===null?l=f:g.next=f,g=a;var y=e.alternate;y!==null&&(y=y.updateQueue,o=y.lastBaseUpdate,o!==g&&(o===null?y.firstBaseUpdate=f:o.next=f,y.lastBaseUpdate=a))}if(l!==null){var p=i.baseState;g=0,y=f=a=null,o=l;do{var v=o.lane,_=o.eventTime;if((n&v)===v){y!==null&&(y=y.next={eventTime:_,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var S=e,x=o;switch(v=t,_=r,x.tag){case 1:if(S=x.payload,typeof S=="function"){p=S.call(_,p,v);break e}p=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=x.payload,v=typeof S=="function"?S.call(_,p,v):S,v==null)break e;p=be({},p,v);break e;case 2:gr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,v=i.effects,v===null?i.effects=[o]:v.push(o))}else _={eventTime:_,lane:v,tag:o.tag,payload:o.payload,callback:o.callback,next:null},y===null?(f=y=_,a=p):y=y.next=_,g|=v;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;v=o,o=v.next,v.next=null,i.lastBaseUpdate=v,i.shared.pending=null}}while(!0);if(y===null&&(a=p),i.baseState=a,i.firstBaseUpdate=f,i.lastBaseUpdate=y,t=i.shared.interleaved,t!==null){i=t;do g|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);mn|=g,e.lanes=g,e.memoizedState=p}}function Dd(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(V(191,i));i.call(n)}}}var Fi={},Wt=Wr(Fi),_i=Wr(Fi),xi=Wr(Fi);function Xr(e){if(e===Fi)throw Error(V(174));return e}function au(e,t){switch(fe(xi,t),fe(_i,e),fe(Wt,Fi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:El(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=El(t,e)}me(Wt),fe(Wt,t)}function ms(){me(Wt),me(_i),me(xi)}function Hp(e){Xr(xi.current);var t=Xr(Wt.current),r=El(t,e.type);t!==r&&(fe(_i,e),fe(Wt,r))}function lu(e){_i.current===e&&(me(Wt),me(_i))}var xe=Wr(0);function Vo(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 Va=[];function cu(){for(var e=0;e<Va.length;e++)Va[e]._workInProgressVersionPrimary=null;Va.length=0}var Co=cr.ReactCurrentDispatcher,Qa=cr.ReactCurrentBatchConfig,vn=0,Se=null,je=null,Pe=null,Qo=!1,si=!1,Si=0,By=0;function Oe(){throw Error(V(321))}function uu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Lt(e[r],t[r]))return!1;return!0}function du(e,t,r,n,i,l){if(vn=l,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Co.current=e===null||e.memoizedState===null?Fy:Ny,e=r(n,i),si){l=0;do{if(si=!1,Si=0,25<=l)throw Error(V(301));l+=1,Pe=je=null,t.updateQueue=null,Co.current=Hy,e=r(n,i)}while(si)}if(Co.current=Go,t=je!==null&&je.next!==null,vn=0,Pe=je=Se=null,Qo=!1,t)throw Error(V(300));return e}function hu(){var e=Si!==0;return Si=0,e}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?Se.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function wt(){if(je===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=je.next;var t=Pe===null?Se.memoizedState:Pe.next;if(t!==null)Pe=t,je=e;else{if(e===null)throw Error(V(310));je=e,e={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},Pe===null?Se.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function bi(e,t){return typeof t=="function"?t(e):t}function Ga(e){var t=wt(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var n=je,i=n.baseQueue,l=r.pending;if(l!==null){if(i!==null){var g=i.next;i.next=l.next,l.next=g}n.baseQueue=i=l,r.pending=null}if(i!==null){l=i.next,n=n.baseState;var o=g=null,a=null,f=l;do{var y=f.lane;if((vn&y)===y)a!==null&&(a=a.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var p={lane:y,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};a===null?(o=a=p,g=n):a=a.next=p,Se.lanes|=y,mn|=y}f=f.next}while(f!==null&&f!==l);a===null?g=n:a.next=o,Lt(n,t.memoizedState)||(et=!0),t.memoizedState=n,t.baseState=g,t.baseQueue=a,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do l=i.lane,Se.lanes|=l,mn|=l,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ya(e){var t=wt(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,l=t.memoizedState;if(i!==null){r.pending=null;var g=i=i.next;do l=e(l,g.action),g=g.next;while(g!==i);Lt(l,t.memoizedState)||(et=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),r.lastRenderedState=l}return[l,n]}function zp(){}function $p(e,t){var r=Se,n=wt(),i=t(),l=!Lt(n.memoizedState,i);if(l&&(n.memoizedState=i,et=!0),n=n.queue,fu(Jp.bind(null,r,n,e),[e]),n.getSnapshot!==t||l||Pe!==null&&Pe.memoizedState.tag&1){if(r.flags|=2048,wi(9,Up.bind(null,r,n,i,t),void 0,null),Me===null)throw Error(V(349));vn&30||Wp(r,t,i)}return i}function Wp(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Up(e,t,r,n){t.value=r,t.getSnapshot=n,qp(t)&&Kp(e)}function Jp(e,t,r){return r(function(){qp(t)&&Kp(e)})}function qp(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Lt(e,r)}catch{return!0}}function Kp(e){var t=ar(e,1);t!==null&&Mt(t,e,1,-1)}function Pd(e){var t=At();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:e},t.queue=e,e=e.dispatch=Oy.bind(null,Se,e),[t.memoizedState,e]}function wi(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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 Vp(){return wt().memoizedState}function ko(e,t,r,n){var i=At();Se.flags|=e,i.memoizedState=wi(1|t,r,void 0,n===void 0?null:n)}function pa(e,t,r,n){var i=wt();n=n===void 0?null:n;var l=void 0;if(je!==null){var g=je.memoizedState;if(l=g.destroy,n!==null&&uu(n,g.deps)){i.memoizedState=wi(t,r,l,n);return}}Se.flags|=e,i.memoizedState=wi(1|t,r,l,n)}function Md(e,t){return ko(8390656,8,e,t)}function fu(e,t){return pa(2048,8,e,t)}function Qp(e,t){return pa(4,2,e,t)}function Gp(e,t){return pa(4,4,e,t)}function Yp(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 Xp(e,t,r){return r=r!=null?r.concat([e]):null,pa(4,4,Yp.bind(null,t,e),r)}function pu(){}function Zp(e,t){var r=wt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&uu(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function eg(e,t){var r=wt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&uu(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function tg(e,t,r){return vn&21?(Lt(r,t)||(r=op(),Se.lanes|=r,mn|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=r)}function Iy(e,t){var r=he;he=r!==0&&4>r?r:4,e(!0);var n=Qa.transition;Qa.transition={};try{e(!1),t()}finally{he=r,Qa.transition=n}}function rg(){return wt().memoizedState}function Ay(e,t,r){var n=Or(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ng(e))sg(t,r);else if(r=Fp(e,t,r,n),r!==null){var i=Ke();Mt(r,e,n,i),ig(r,t,n)}}function Oy(e,t,r){var n=Or(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ng(e))sg(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var g=t.lastRenderedState,o=l(g,r);if(i.hasEagerState=!0,i.eagerState=o,Lt(o,g)){var a=t.interleaved;a===null?(i.next=i,iu(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}r=Fp(e,t,i,n),r!==null&&(i=Ke(),Mt(r,e,n,i),ig(r,t,n))}}function ng(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function sg(e,t){si=Qo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ig(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Jc(e,r)}}var Go={readContext:bt,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},Fy={readContext:bt,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Md,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ko(4194308,4,Yp.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return ko(4,2,e,t)},useMemo:function(e,t){var r=At();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=At();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=Ay.bind(null,Se,e),[n.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:Pd,useDebugValue:pu,useDeferredValue:function(e){return At().memoizedState=e},useTransition:function(){var e=Pd(!1),t=e[0];return e=Iy.bind(null,e[1]),At().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Se,i=At();if(ye){if(r===void 0)throw Error(V(407));r=r()}else{if(r=t(),Me===null)throw Error(V(349));vn&30||Wp(n,t,r)}i.memoizedState=r;var l={value:r,getSnapshot:t};return i.queue=l,Md(Jp.bind(null,n,l,e),[e]),n.flags|=2048,wi(9,Up.bind(null,n,l,r,t),void 0,null),r},useId:function(){var e=At(),t=Me.identifierPrefix;if(ye){var r=tr,n=er;r=(n&~(1<<32-Pt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Si++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=By++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ny={readContext:bt,useCallback:Zp,useContext:bt,useEffect:fu,useImperativeHandle:Xp,useInsertionEffect:Qp,useLayoutEffect:Gp,useMemo:eg,useReducer:Ga,useRef:Vp,useState:function(){return Ga(bi)},useDebugValue:pu,useDeferredValue:function(e){var t=wt();return tg(t,je.memoizedState,e)},useTransition:function(){var e=Ga(bi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:zp,useSyncExternalStore:$p,useId:rg,unstable_isNewReconciler:!1},Hy={readContext:bt,useCallback:Zp,useContext:bt,useEffect:fu,useImperativeHandle:Xp,useInsertionEffect:Qp,useLayoutEffect:Gp,useMemo:eg,useReducer:Ya,useRef:Vp,useState:function(){return Ya(bi)},useDebugValue:pu,useDeferredValue:function(e){var t=wt();return je===null?t.memoizedState=e:tg(t,je.memoizedState,e)},useTransition:function(){var e=Ya(bi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:zp,useSyncExternalStore:$p,useId:rg,unstable_isNewReconciler:!1};function Et(e,t){if(e&&e.defaultProps){t=be({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Kl(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:be({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ga={isMounted:function(e){return(e=e._reactInternals)?Sn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Ke(),i=Or(e),l=rr(n,i);l.payload=t,r!=null&&(l.callback=r),t=Ir(e,l,i),t!==null&&(Mt(t,e,i,n),wo(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Ke(),i=Or(e),l=rr(n,i);l.tag=1,l.payload=t,r!=null&&(l.callback=r),t=Ir(e,l,i),t!==null&&(Mt(t,e,i,n),wo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ke(),n=Or(e),i=rr(r,n);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,n),t!==null&&(Mt(t,e,n,r),wo(t,e,n))}};function Ld(e,t,r,n,i,l,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,l,g):t.prototype&&t.prototype.isPureReactComponent?!gi(r,n)||!gi(i,l):!0}function og(e,t,r){var n=!1,i=zr,l=t.contextType;return typeof l=="object"&&l!==null?l=bt(l):(i=rt(t)?pn:$e.current,n=t.contextTypes,l=(n=n!=null)?ps(e,i):zr),t=new t(r,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ga,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Bd(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&&ga.enqueueReplaceState(t,t.state,null)}function Vl(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},ou(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=bt(l):(l=rt(t)?pn:$e.current,i.context=ps(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Kl(e,t,l,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ga.enqueueReplaceState(i,i.state,null),Ko(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,t){try{var r="",n=t;do r+=pm(n),n=n.return;while(n);var i=r}catch(l){i=`
|
|
39
|
+
Error generating stack: `+l.message+`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:i,digest:null}}function Xa(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ql(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var zy=typeof WeakMap=="function"?WeakMap:Map;function ag(e,t,r){r=rr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Xo||(Xo=!0,ic=n),Ql(e,t)},r}function lg(e,t,r){r=rr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Ql(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(r.callback=function(){Ql(e,t),typeof n!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function Id(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new zy;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=t_.bind(null,e,t,r),t.then(e,e))}function Ad(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 Od(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=rr(-1,1),t.tag=2,Ir(r,t,1))),r.lanes|=1),e)}var $y=cr.ReactCurrentOwner,et=!1;function Ue(e,t,r,n){t.child=e===null?Op(t,null,r,n):vs(t,e.child,r,n)}function Fd(e,t,r,n,i){r=r.render;var l=t.ref;return Gn(t,i),n=du(e,t,r,n,l,i),r=hu(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lr(e,t,i)):(ye&&r&&Zc(t),t.flags|=1,Ue(e,t,n,i),t.child)}function Nd(e,t,r,n,i){if(e===null){var l=r.type;return typeof l=="function"&&!bu(l)&&l.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=l,cg(e,t,l,n,i)):(e=To(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var g=l.memoizedProps;if(r=r.compare,r=r!==null?r:gi,r(g,n)&&e.ref===t.ref)return lr(e,t,i)}return t.flags|=1,e=Fr(l,n),e.ref=t.ref,e.return=t,t.child=e}function cg(e,t,r,n,i){if(e!==null){var l=e.memoizedProps;if(gi(l,n)&&e.ref===t.ref)if(et=!1,t.pendingProps=n=l,(e.lanes&i)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,lr(e,t,i)}return Gl(e,t,r,n,i)}function ug(e,t,r){var n=t.pendingProps,i=n.children,l=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Un,st),st|=r;else{if(!(r&1073741824))return e=l!==null?l.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Un,st),st|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=l!==null?l.baseLanes:r,fe(Un,st),st|=n}else l!==null?(n=l.baseLanes|r,t.memoizedState=null):n=r,fe(Un,st),st|=n;return Ue(e,t,i,r),t.child}function dg(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Gl(e,t,r,n,i){var l=rt(r)?pn:$e.current;return l=ps(t,l),Gn(t,i),r=du(e,t,r,n,l,i),n=hu(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lr(e,t,i)):(ye&&n&&Zc(t),t.flags|=1,Ue(e,t,r,i),t.child)}function Hd(e,t,r,n,i){if(rt(r)){var l=!0;$o(t)}else l=!1;if(Gn(t,i),t.stateNode===null)Eo(e,t),og(t,r,n),Vl(t,r,n,i),n=!0;else if(e===null){var g=t.stateNode,o=t.memoizedProps;g.props=o;var a=g.context,f=r.contextType;typeof f=="object"&&f!==null?f=bt(f):(f=rt(r)?pn:$e.current,f=ps(t,f));var y=r.getDerivedStateFromProps,p=typeof y=="function"||typeof g.getSnapshotBeforeUpdate=="function";p||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==n||a!==f)&&Bd(t,g,n,f),gr=!1;var v=t.memoizedState;g.state=v,Ko(t,n,g,i),a=t.memoizedState,o!==n||v!==a||tt.current||gr?(typeof y=="function"&&(Kl(t,r,y,n),a=t.memoizedState),(o=gr||Ld(t,r,o,n,v,a,f))?(p||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=a),g.props=n,g.state=a,g.context=f,n=o):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{g=t.stateNode,Np(e,t),o=t.memoizedProps,f=t.type===t.elementType?o:Et(t.type,o),g.props=f,p=t.pendingProps,v=g.context,a=r.contextType,typeof a=="object"&&a!==null?a=bt(a):(a=rt(r)?pn:$e.current,a=ps(t,a));var _=r.getDerivedStateFromProps;(y=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==p||v!==a)&&Bd(t,g,n,a),gr=!1,v=t.memoizedState,g.state=v,Ko(t,n,g,i);var S=t.memoizedState;o!==p||v!==S||tt.current||gr?(typeof _=="function"&&(Kl(t,r,_,n),S=t.memoizedState),(f=gr||Ld(t,r,f,n,v,S,a)||!1)?(y||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(n,S,a),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(n,S,a)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=S),g.props=n,g.state=S,g.context=a,n=f):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),n=!1)}return Yl(e,t,r,n,l,i)}function Yl(e,t,r,n,i,l){dg(e,t);var g=(t.flags&128)!==0;if(!n&&!g)return i&&kd(t,r,!1),lr(e,t,l);n=t.stateNode,$y.current=t;var o=g&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&g?(t.child=vs(t,e.child,null,l),t.child=vs(t,null,o,l)):Ue(e,t,o,l),t.memoizedState=n.state,i&&kd(t,r,!0),t.child}function hg(e){var t=e.stateNode;t.pendingContext?Cd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cd(e,t.context,!1),au(e,t.containerInfo)}function zd(e,t,r,n,i){return gs(),tu(i),t.flags|=256,Ue(e,t,r,n),t.child}var Xl={dehydrated:null,treeContext:null,retryLane:0};function Zl(e){return{baseLanes:e,cachePool:null,transitions:null}}function fg(e,t,r){var n=t.pendingProps,i=xe.current,l=!1,g=(t.flags&128)!==0,o;if((o=g)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),fe(xe,i&1),e===null)return Jl(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):(g=n.children,e=n.fallback,l?(n=t.mode,l=t.child,g={mode:"hidden",children:g},!(n&1)&&l!==null?(l.childLanes=0,l.pendingProps=g):l=ya(g,n,0,null),e=hn(e,n,r,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Zl(r),t.memoizedState=Xl,e):gu(t,g));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Wy(e,t,g,n,o,i,r);if(l){l=n.fallback,g=t.mode,i=e.child,o=i.sibling;var a={mode:"hidden",children:n.children};return!(g&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=a,t.deletions=null):(n=Fr(i,a),n.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=Fr(o,l):(l=hn(l,g,r,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,n=l,l=t.child,g=e.child.memoizedState,g=g===null?Zl(r):{baseLanes:g.baseLanes|r,cachePool:null,transitions:g.transitions},l.memoizedState=g,l.childLanes=e.childLanes&~r,t.memoizedState=Xl,n}return l=e.child,e=l.sibling,n=Fr(l,{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 gu(e,t){return t=ya({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function to(e,t,r,n){return n!==null&&tu(n),vs(t,e.child,null,r),e=gu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wy(e,t,r,n,i,l,g){if(r)return t.flags&256?(t.flags&=-257,n=Xa(Error(V(422))),to(e,t,g,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=n.fallback,i=t.mode,n=ya({mode:"visible",children:n.children},i,0,null),l=hn(l,i,g,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,t.mode&1&&vs(t,e.child,null,g),t.child.memoizedState=Zl(g),t.memoizedState=Xl,l);if(!(t.mode&1))return to(e,t,g,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var o=n.dgst;return n=o,l=Error(V(419)),n=Xa(l,n,void 0),to(e,t,g,n)}if(o=(g&e.childLanes)!==0,et||o){if(n=Me,n!==null){switch(g&-g){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|g)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,ar(e,i),Mt(n,e,i,-1))}return Su(),n=Xa(Error(V(421))),to(e,t,g,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=r_.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,lt=Br(i.nextSibling),ct=t,ye=!0,Tt=null,e!==null&&(gt[vt++]=er,gt[vt++]=tr,gt[vt++]=gn,er=e.id,tr=e.overflow,gn=t),t=gu(t,n.children),t.flags|=4096,t)}function $d(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ql(e.return,t,r)}function Za(e,t,r,n,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=n,l.tail=r,l.tailMode=i)}function pg(e,t,r){var n=t.pendingProps,i=n.revealOrder,l=n.tail;if(Ue(e,t,n.children,r),n=xe.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&&$d(e,r,t);else if(e.tag===19)$d(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(fe(xe,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Vo(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Za(t,!1,i,r,l);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Za(t,!0,r,null,l);break;case"together":Za(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Eo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,r=Fr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Fr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Uy(e,t,r){switch(t.tag){case 3:hg(t),gs();break;case 5:Hp(t);break;case 1:rt(t.type)&&$o(t);break;case 4:au(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;fe(Jo,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(fe(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?fg(e,t,r):(fe(xe,xe.current&1),e=lr(e,t,r),e!==null?e.sibling:null);fe(xe,xe.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return pg(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),fe(xe,xe.current),n)break;return null;case 22:case 23:return t.lanes=0,ug(e,t,r)}return lr(e,t,r)}var gg,ec,vg,mg;gg=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}};ec=function(){};vg=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Xr(Wt.current);var l=null;switch(r){case"input":i=bl(e,i),n=bl(e,n),l=[];break;case"select":i=be({},i,{value:void 0}),n=be({},n,{value:void 0}),l=[];break;case"textarea":i=kl(e,i),n=kl(e,n),l=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Ho)}jl(r,n);var g;r=null;for(f in i)if(!n.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var o=i[f];for(g in o)o.hasOwnProperty(g)&&(r||(r={}),r[g]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(li.hasOwnProperty(f)?l||(l=[]):(l=l||[]).push(f,null));for(f in n){var a=n[f];if(o=i!=null?i[f]:void 0,n.hasOwnProperty(f)&&a!==o&&(a!=null||o!=null))if(f==="style")if(o){for(g in o)!o.hasOwnProperty(g)||a&&a.hasOwnProperty(g)||(r||(r={}),r[g]="");for(g in a)a.hasOwnProperty(g)&&o[g]!==a[g]&&(r||(r={}),r[g]=a[g])}else r||(l||(l=[]),l.push(f,r)),r=a;else f==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,o=o?o.__html:void 0,a!=null&&o!==a&&(l=l||[]).push(f,a)):f==="children"?typeof a!="string"&&typeof a!="number"||(l=l||[]).push(f,""+a):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(li.hasOwnProperty(f)?(a!=null&&f==="onScroll"&&ve("scroll",e),l||o===a||(l=[])):(l=l||[]).push(f,a))}r&&(l=l||[]).push("style",r);var f=l;(t.updateQueue=f)&&(t.flags|=4)}};mg=function(e,t,r,n){r!==n&&(t.flags|=4)};function Os(e,t){if(!ye)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 Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Jy(e,t,r){var n=t.pendingProps;switch(eu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return rt(t.type)&&zo(),Fe(t),null;case 3:return n=t.stateNode,ms(),me(tt),me($e),cu(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tt!==null&&(lc(Tt),Tt=null))),ec(e,t),Fe(t),null;case 5:lu(t);var i=Xr(xi.current);if(r=t.type,e!==null&&t.stateNode!=null)vg(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(V(166));return Fe(t),null}if(e=Xr(Wt.current),Zi(t)){n=t.stateNode,r=t.type;var l=t.memoizedProps;switch(n[Ht]=t,n[yi]=l,e=(t.mode&1)!==0,r){case"dialog":ve("cancel",n),ve("close",n);break;case"iframe":case"object":case"embed":ve("load",n);break;case"video":case"audio":for(i=0;i<Qs.length;i++)ve(Qs[i],n);break;case"source":ve("error",n);break;case"img":case"image":case"link":ve("error",n),ve("load",n);break;case"details":ve("toggle",n);break;case"input":Yu(n,l),ve("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!l.multiple},ve("invalid",n);break;case"textarea":Zu(n,l),ve("invalid",n)}jl(r,l),i=null;for(var g in l)if(l.hasOwnProperty(g)){var o=l[g];g==="children"?typeof o=="string"?n.textContent!==o&&(l.suppressHydrationWarning!==!0&&Xi(n.textContent,o,e),i=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&Xi(n.textContent,o,e),i=["children",""+o]):li.hasOwnProperty(g)&&o!=null&&g==="onScroll"&&ve("scroll",n)}switch(r){case"input":Ui(n),Xu(n,l,!0);break;case"textarea":Ui(n),ed(n);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(n.onclick=Ho)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{g=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jf(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=g.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=g.createElement(r,{is:n.is}):(e=g.createElement(r),r==="select"&&(g=e,n.multiple?g.multiple=!0:n.size&&(g.size=n.size))):e=g.createElementNS(e,r),e[Ht]=t,e[yi]=n,gg(e,t,!1,!1),t.stateNode=e;e:{switch(g=Rl(r,n),r){case"dialog":ve("cancel",e),ve("close",e),i=n;break;case"iframe":case"object":case"embed":ve("load",e),i=n;break;case"video":case"audio":for(i=0;i<Qs.length;i++)ve(Qs[i],e);i=n;break;case"source":ve("error",e),i=n;break;case"img":case"image":case"link":ve("error",e),ve("load",e),i=n;break;case"details":ve("toggle",e),i=n;break;case"input":Yu(e,n),i=bl(e,n),ve("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=be({},n,{value:void 0}),ve("invalid",e);break;case"textarea":Zu(e,n),i=kl(e,n),ve("invalid",e);break;default:i=n}jl(r,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var a=o[l];l==="style"?Vf(e,a):l==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&qf(e,a)):l==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&ci(e,a):typeof a=="number"&&ci(e,""+a):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(li.hasOwnProperty(l)?a!=null&&l==="onScroll"&&ve("scroll",e):a!=null&&Nc(e,l,a,g))}switch(r){case"input":Ui(e),Xu(e,n,!1);break;case"textarea":Ui(e),ed(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Hr(n.value));break;case"select":e.multiple=!!n.multiple,l=n.value,l!=null?qn(e,!!n.multiple,l,!1):n.defaultValue!=null&&qn(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ho)}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 Fe(t),null;case 6:if(e&&t.stateNode!=null)mg(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(V(166));if(r=Xr(xi.current),Xr(Wt.current),Zi(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ht]=t,(l=n.nodeValue!==r)&&(e=ct,e!==null))switch(e.tag){case 3:Xi(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xi(n.nodeValue,r,(e.mode&1)!==0)}l&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ht]=t,t.stateNode=n}return Fe(t),null;case 13:if(me(xe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ye&<!==null&&t.mode&1&&!(t.flags&128))Ip(),gs(),t.flags|=98560,l=!1;else if(l=Zi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(V(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(V(317));l[Ht]=t}else gs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fe(t),l=!1}else Tt!==null&&(lc(Tt),Tt=null),l=!0;if(!l)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||xe.current&1?Te===0&&(Te=3):Su())),t.updateQueue!==null&&(t.flags|=4),Fe(t),null);case 4:return ms(),ec(e,t),e===null&&vi(t.stateNode.containerInfo),Fe(t),null;case 10:return su(t.type._context),Fe(t),null;case 17:return rt(t.type)&&zo(),Fe(t),null;case 19:if(me(xe),l=t.memoizedState,l===null)return Fe(t),null;if(n=(t.flags&128)!==0,g=l.rendering,g===null)if(n)Os(l,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(g=Vo(e),g!==null){for(t.flags|=128,Os(l,!1),n=g.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)l=r,e=n,l.flags&=14680066,g=l.alternate,g===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,e=g.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return fe(xe,xe.current&1|2),t.child}e=e.sibling}l.tail!==null&&ke()>_s&&(t.flags|=128,n=!0,Os(l,!1),t.lanes=4194304)}else{if(!n)if(e=Vo(g),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Os(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!ye)return Fe(t),null}else 2*ke()-l.renderingStartTime>_s&&r!==1073741824&&(t.flags|=128,n=!0,Os(l,!1),t.lanes=4194304);l.isBackwards?(g.sibling=t.child,t.child=g):(r=l.last,r!==null?r.sibling=g:t.child=g,l.last=g)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ke(),t.sibling=null,r=xe.current,fe(xe,n?r&1|2:r&1),t):(Fe(t),null);case 22:case 23:return xu(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?st&1073741824&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function qy(e,t){switch(eu(t),t.tag){case 1:return rt(t.type)&&zo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),me(tt),me($e),cu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lu(t),null;case 13:if(me(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(xe),null;case 4:return ms(),null;case 10:return su(t.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var ro=!1,ze=!1,Ky=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Wn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ce(e,t,n)}else r.current=null}function tc(e,t,r){try{r()}catch(n){Ce(e,t,n)}}var Wd=!1;function Vy(e,t){if(Fl=Oo,e=bp(),Xc(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 i=n.anchorOffset,l=n.focusNode;n=n.focusOffset;try{r.nodeType,l.nodeType}catch{r=null;break e}var g=0,o=-1,a=-1,f=0,y=0,p=e,v=null;t:for(;;){for(var _;p!==r||i!==0&&p.nodeType!==3||(o=g+i),p!==l||n!==0&&p.nodeType!==3||(a=g+n),p.nodeType===3&&(g+=p.nodeValue.length),(_=p.firstChild)!==null;)v=p,p=_;for(;;){if(p===e)break t;if(v===r&&++f===i&&(o=g),v===l&&++y===n&&(a=g),(_=p.nextSibling)!==null)break;p=v,v=p.parentNode}p=_}r=o===-1||a===-1?null:{start:o,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Nl={focusedElem:e,selectionRange:r},Oo=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var x=S.memoizedProps,d=S.memoizedState,u=t.stateNode,c=u.getSnapshotBeforeUpdate(t.elementType===t.type?x:Et(t.type,x),d);u.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(m){Ce(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return S=Wd,Wd=!1,S}function ii(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&tc(t,r,l)}i=i.next}while(i!==n)}}function va(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 rc(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 yg(e){var t=e.alternate;t!==null&&(e.alternate=null,yg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[yi],delete t[$l],delete t[Dy],delete t[Py])),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 _g(e){return e.tag===5||e.tag===3||e.tag===4}function Ud(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_g(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 nc(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=Ho));else if(n!==4&&(e=e.child,e!==null))for(nc(e,t,r),e=e.sibling;e!==null;)nc(e,t,r),e=e.sibling}function sc(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(sc(e,t,r),e=e.sibling;e!==null;)sc(e,t,r),e=e.sibling}var Le=null,Rt=!1;function hr(e,t,r){for(r=r.child;r!==null;)xg(e,t,r),r=r.sibling}function xg(e,t,r){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(la,r)}catch{}switch(r.tag){case 5:ze||Wn(r,t);case 6:var n=Le,i=Rt;Le=null,hr(e,t,r),Le=n,Rt=i,Le!==null&&(Rt?(e=Le,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Le.removeChild(r.stateNode));break;case 18:Le!==null&&(Rt?(e=Le,r=r.stateNode,e.nodeType===8?qa(e.parentNode,r):e.nodeType===1&&qa(e,r),fi(e)):qa(Le,r.stateNode));break;case 4:n=Le,i=Rt,Le=r.stateNode.containerInfo,Rt=!0,hr(e,t,r),Le=n,Rt=i;break;case 0:case 11:case 14:case 15:if(!ze&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var l=i,g=l.destroy;l=l.tag,g!==void 0&&(l&2||l&4)&&tc(r,t,g),i=i.next}while(i!==n)}hr(e,t,r);break;case 1:if(!ze&&(Wn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Ce(r,t,o)}hr(e,t,r);break;case 21:hr(e,t,r);break;case 22:r.mode&1?(ze=(n=ze)||r.memoizedState!==null,hr(e,t,r),ze=n):hr(e,t,r);break;default:hr(e,t,r)}}function Jd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Ky),t.forEach(function(n){var i=n_.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var l=e,g=t,o=g;e:for(;o!==null;){switch(o.tag){case 5:Le=o.stateNode,Rt=!1;break e;case 3:Le=o.stateNode.containerInfo,Rt=!0;break e;case 4:Le=o.stateNode.containerInfo,Rt=!0;break e}o=o.return}if(Le===null)throw Error(V(160));xg(l,g,i),Le=null,Rt=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(f){Ce(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Sg(t,e),t=t.sibling}function Sg(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kt(t,e),It(e),n&4){try{ii(3,e,e.return),va(3,e)}catch(x){Ce(e,e.return,x)}try{ii(5,e,e.return)}catch(x){Ce(e,e.return,x)}}break;case 1:kt(t,e),It(e),n&512&&r!==null&&Wn(r,r.return);break;case 5:if(kt(t,e),It(e),n&512&&r!==null&&Wn(r,r.return),e.flags&32){var i=e.stateNode;try{ci(i,"")}catch(x){Ce(e,e.return,x)}}if(n&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,g=r!==null?r.memoizedProps:l,o=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&Wf(i,l),Rl(o,g);var f=Rl(o,l);for(g=0;g<a.length;g+=2){var y=a[g],p=a[g+1];y==="style"?Vf(i,p):y==="dangerouslySetInnerHTML"?qf(i,p):y==="children"?ci(i,p):Nc(i,y,p,f)}switch(o){case"input":wl(i,l);break;case"textarea":Uf(i,l);break;case"select":var v=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var _=l.value;_!=null?qn(i,!!l.multiple,_,!1):v!==!!l.multiple&&(l.defaultValue!=null?qn(i,!!l.multiple,l.defaultValue,!0):qn(i,!!l.multiple,l.multiple?[]:"",!1))}i[yi]=l}catch(x){Ce(e,e.return,x)}}break;case 6:if(kt(t,e),It(e),n&4){if(e.stateNode===null)throw Error(V(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(x){Ce(e,e.return,x)}}break;case 3:if(kt(t,e),It(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(x){Ce(e,e.return,x)}break;case 4:kt(t,e),It(e);break;case 13:kt(t,e),It(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(yu=ke())),n&4&&Jd(e);break;case 22:if(y=r!==null&&r.memoizedState!==null,e.mode&1?(ze=(f=ze)||y,kt(t,e),ze=f):kt(t,e),It(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!y&&e.mode&1)for(Z=e,y=e.child;y!==null;){for(p=Z=y;Z!==null;){switch(v=Z,_=v.child,v.tag){case 0:case 11:case 14:case 15:ii(4,v,v.return);break;case 1:Wn(v,v.return);var S=v.stateNode;if(typeof S.componentWillUnmount=="function"){n=v,r=v.return;try{t=n,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(x){Ce(n,r,x)}}break;case 5:Wn(v,v.return);break;case 22:if(v.memoizedState!==null){Kd(p);continue}}_!==null?(_.return=v,Z=_):Kd(p)}y=y.sibling}e:for(y=null,p=e;;){if(p.tag===5){if(y===null){y=p;try{i=p.stateNode,f?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=p.stateNode,a=p.memoizedProps.style,g=a!=null&&a.hasOwnProperty("display")?a.display:null,o.style.display=Kf("display",g))}catch(x){Ce(e,e.return,x)}}}else if(p.tag===6){if(y===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(x){Ce(e,e.return,x)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;y===p&&(y=null),p=p.return}y===p&&(y=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:kt(t,e),It(e),n&4&&Jd(e);break;case 21:break;default:kt(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(_g(r)){var n=r;break e}r=r.return}throw Error(V(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(ci(i,""),n.flags&=-33);var l=Ud(e);sc(e,l,i);break;case 3:case 4:var g=n.stateNode.containerInfo,o=Ud(e);nc(e,o,g);break;default:throw Error(V(161))}}catch(a){Ce(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qy(e,t,r){Z=e,bg(e)}function bg(e,t,r){for(var n=(e.mode&1)!==0;Z!==null;){var i=Z,l=i.child;if(i.tag===22&&n){var g=i.memoizedState!==null||ro;if(!g){var o=i.alternate,a=o!==null&&o.memoizedState!==null||ze;o=ro;var f=ze;if(ro=g,(ze=a)&&!f)for(Z=i;Z!==null;)g=Z,a=g.child,g.tag===22&&g.memoizedState!==null?Vd(i):a!==null?(a.return=g,Z=a):Vd(i);for(;l!==null;)Z=l,bg(l),l=l.sibling;Z=i,ro=o,ze=f}qd(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,Z=l):qd(e)}}function qd(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ze||va(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!ze)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Et(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Dd(t,l,n);break;case 3:var g=t.updateQueue;if(g!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Dd(t,g,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var y=f.memoizedState;if(y!==null){var p=y.dehydrated;p!==null&&fi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}ze||t.flags&512&&rc(t)}catch(v){Ce(t,t.return,v)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function Kd(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function Vd(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{va(4,t)}catch(a){Ce(t,r,a)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(a){Ce(t,i,a)}}var l=t.return;try{rc(t)}catch(a){Ce(t,l,a)}break;case 5:var g=t.return;try{rc(t)}catch(a){Ce(t,g,a)}}}catch(a){Ce(t,t.return,a)}if(t===e){Z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Z=o;break}Z=t.return}}var Gy=Math.ceil,Yo=cr.ReactCurrentDispatcher,vu=cr.ReactCurrentOwner,xt=cr.ReactCurrentBatchConfig,ce=0,Me=null,Ee=null,Ie=0,st=0,Un=Wr(0),Te=0,Ci=null,mn=0,ma=0,mu=0,oi=null,Ze=null,yu=0,_s=1/0,qt=null,Xo=!1,ic=null,Ar=null,no=!1,Tr=null,Zo=0,ai=0,oc=null,jo=-1,Ro=0;function Ke(){return ce&6?ke():jo!==-1?jo:jo=ke()}function Or(e){return e.mode&1?ce&2&&Ie!==0?Ie&-Ie:Ly.transition!==null?(Ro===0&&(Ro=op()),Ro):(e=he,e!==0||(e=window.event,e=e===void 0?16:fp(e.type)),e):1}function Mt(e,t,r,n){if(50<ai)throw ai=0,oc=null,Error(V(185));Ii(e,r,n),(!(ce&2)||e!==Me)&&(e===Me&&(!(ce&2)&&(ma|=r),Te===4&&mr(e,Ie)),nt(e,n),r===1&&ce===0&&!(t.mode&1)&&(_s=ke()+500,fa&&Ur()))}function nt(e,t){var r=e.callbackNode;Lm(e,t);var n=Ao(e,e===Me?Ie:0);if(n===0)r!==null&&nd(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&nd(r),t===1)e.tag===0?My(Qd.bind(null,e)):Mp(Qd.bind(null,e)),Ry(function(){!(ce&6)&&Ur()}),r=null;else{switch(ap(n)){case 1:r=Uc;break;case 4:r=sp;break;case 16:r=Io;break;case 536870912:r=ip;break;default:r=Io}r=Dg(r,wg.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function wg(e,t){if(jo=-1,Ro=0,ce&6)throw Error(V(327));var r=e.callbackNode;if(Yn()&&e.callbackNode!==r)return null;var n=Ao(e,e===Me?Ie:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ea(e,n);else{t=n;var i=ce;ce|=2;var l=kg();(Me!==e||Ie!==t)&&(qt=null,_s=ke()+500,dn(e,t));do try{Zy();break}catch(o){Cg(e,o)}while(!0);nu(),Yo.current=l,ce=i,Ee!==null?t=0:(Me=null,Ie=0,t=Te)}if(t!==0){if(t===2&&(i=Ll(e),i!==0&&(n=i,t=ac(e,i))),t===1)throw r=Ci,dn(e,0),mr(e,n),nt(e,ke()),r;if(t===6)mr(e,n);else{if(i=e.current.alternate,!(n&30)&&!Yy(i)&&(t=ea(e,n),t===2&&(l=Ll(e),l!==0&&(n=l,t=ac(e,l))),t===1))throw r=Ci,dn(e,0),mr(e,n),nt(e,ke()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(V(345));case 2:Vr(e,Ze,qt);break;case 3:if(mr(e,n),(n&130023424)===n&&(t=yu+500-ke(),10<t)){if(Ao(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Ke(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=zl(Vr.bind(null,e,Ze,qt),t);break}Vr(e,Ze,qt);break;case 4:if(mr(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var g=31-Pt(n);l=1<<g,g=t[g],g>i&&(i=g),n&=~l}if(n=i,n=ke()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Gy(n/1960))-n,10<n){e.timeoutHandle=zl(Vr.bind(null,e,Ze,qt),n);break}Vr(e,Ze,qt);break;case 5:Vr(e,Ze,qt);break;default:throw Error(V(329))}}}return nt(e,ke()),e.callbackNode===r?wg.bind(null,e):null}function ac(e,t){var r=oi;return e.current.memoizedState.isDehydrated&&(dn(e,t).flags|=256),e=ea(e,t),e!==2&&(t=Ze,Ze=r,t!==null&&lc(t)),e}function lc(e){Ze===null?Ze=e:Ze.push.apply(Ze,e)}function Yy(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 i=r[n],l=i.getSnapshot;i=i.value;try{if(!Lt(l(),i))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 mr(e,t){for(t&=~mu,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Pt(t),n=1<<r;e[r]=-1,t&=~n}}function Qd(e){if(ce&6)throw Error(V(327));Yn();var t=Ao(e,0);if(!(t&1))return nt(e,ke()),null;var r=ea(e,t);if(e.tag!==0&&r===2){var n=Ll(e);n!==0&&(t=n,r=ac(e,n))}if(r===1)throw r=Ci,dn(e,0),mr(e,t),nt(e,ke()),r;if(r===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vr(e,Ze,qt),nt(e,ke()),null}function _u(e,t){var r=ce;ce|=1;try{return e(t)}finally{ce=r,ce===0&&(_s=ke()+500,fa&&Ur())}}function yn(e){Tr!==null&&Tr.tag===0&&!(ce&6)&&Yn();var t=ce;ce|=1;var r=xt.transition,n=he;try{if(xt.transition=null,he=1,e)return e()}finally{he=n,xt.transition=r,ce=t,!(ce&6)&&Ur()}}function xu(){st=Un.current,me(Un)}function dn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,jy(r)),Ee!==null)for(r=Ee.return;r!==null;){var n=r;switch(eu(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&zo();break;case 3:ms(),me(tt),me($e),cu();break;case 5:lu(n);break;case 4:ms();break;case 13:me(xe);break;case 19:me(xe);break;case 10:su(n.type._context);break;case 22:case 23:xu()}r=r.return}if(Me=e,Ee=e=Fr(e.current,null),Ie=st=t,Te=0,Ci=null,mu=ma=mn=0,Ze=oi=null,Yr!==null){for(t=0;t<Yr.length;t++)if(r=Yr[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,l=r.pending;if(l!==null){var g=l.next;l.next=i,n.next=g}r.pending=n}Yr=null}return e}function Cg(e,t){do{var r=Ee;try{if(nu(),Co.current=Go,Qo){for(var n=Se.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Qo=!1}if(vn=0,Pe=je=Se=null,si=!1,Si=0,vu.current=null,r===null||r.return===null){Te=1,Ci=t,Ee=null;break}e:{var l=e,g=r.return,o=r,a=t;if(t=Ie,o.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var f=a,y=o,p=y.tag;if(!(y.mode&1)&&(p===0||p===11||p===15)){var v=y.alternate;v?(y.updateQueue=v.updateQueue,y.memoizedState=v.memoizedState,y.lanes=v.lanes):(y.updateQueue=null,y.memoizedState=null)}var _=Ad(g);if(_!==null){_.flags&=-257,Od(_,g,o,l,t),_.mode&1&&Id(l,f,t),t=_,a=f;var S=t.updateQueue;if(S===null){var x=new Set;x.add(a),t.updateQueue=x}else S.add(a);break e}else{if(!(t&1)){Id(l,f,t),Su();break e}a=Error(V(426))}}else if(ye&&o.mode&1){var d=Ad(g);if(d!==null){!(d.flags&65536)&&(d.flags|=256),Od(d,g,o,l,t),tu(ys(a,o));break e}}l=a=ys(a,o),Te!==4&&(Te=2),oi===null?oi=[l]:oi.push(l),l=g;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var u=ag(l,a,t);Td(l,u);break e;case 1:o=a;var c=l.type,h=l.stateNode;if(!(l.flags&128)&&(typeof c.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ar===null||!Ar.has(h)))){l.flags|=65536,t&=-t,l.lanes|=t;var m=lg(l,o,t);Td(l,m);break e}}l=l.return}while(l!==null)}jg(r)}catch(w){t=w,Ee===r&&r!==null&&(Ee=r=r.return);continue}break}while(!0)}function kg(){var e=Yo.current;return Yo.current=Go,e===null?Go:e}function Su(){(Te===0||Te===3||Te===2)&&(Te=4),Me===null||!(mn&268435455)&&!(ma&268435455)||mr(Me,Ie)}function ea(e,t){var r=ce;ce|=2;var n=kg();(Me!==e||Ie!==t)&&(qt=null,dn(e,t));do try{Xy();break}catch(i){Cg(e,i)}while(!0);if(nu(),ce=r,Yo.current=n,Ee!==null)throw Error(V(261));return Me=null,Ie=0,Te}function Xy(){for(;Ee!==null;)Eg(Ee)}function Zy(){for(;Ee!==null&&!Cm();)Eg(Ee)}function Eg(e){var t=Tg(e.alternate,e,st);e.memoizedProps=e.pendingProps,t===null?jg(e):Ee=t,vu.current=null}function jg(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=qy(r,t),r!==null){r.flags&=32767,Ee=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Ee=null;return}}else if(r=Jy(r,t,st),r!==null){Ee=r;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Te===0&&(Te=5)}function Vr(e,t,r){var n=he,i=xt.transition;try{xt.transition=null,he=1,e_(e,t,r,n)}finally{xt.transition=i,he=n}return null}function e_(e,t,r,n){do Yn();while(Tr!==null);if(ce&6)throw Error(V(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var l=r.lanes|r.childLanes;if(Bm(e,l),e===Me&&(Ee=Me=null,Ie=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||no||(no=!0,Dg(Io,function(){return Yn(),null})),l=(r.flags&15990)!==0,r.subtreeFlags&15990||l){l=xt.transition,xt.transition=null;var g=he;he=1;var o=ce;ce|=4,vu.current=null,Vy(e,r),Sg(r,e),xy(Nl),Oo=!!Fl,Nl=Fl=null,e.current=r,Qy(r),km(),ce=o,he=g,xt.transition=l}else e.current=r;if(no&&(no=!1,Tr=e,Zo=i),l=e.pendingLanes,l===0&&(Ar=null),Rm(r.stateNode),nt(e,ke()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Xo)throw Xo=!1,e=ic,ic=null,e;return Zo&1&&e.tag!==0&&Yn(),l=e.pendingLanes,l&1?e===oc?ai++:(ai=0,oc=e):ai=0,Ur(),null}function Yn(){if(Tr!==null){var e=ap(Zo),t=xt.transition,r=he;try{if(xt.transition=null,he=16>e?16:e,Tr===null)var n=!1;else{if(e=Tr,Tr=null,Zo=0,ce&6)throw Error(V(331));var i=ce;for(ce|=4,Z=e.current;Z!==null;){var l=Z,g=l.child;if(Z.flags&16){var o=l.deletions;if(o!==null){for(var a=0;a<o.length;a++){var f=o[a];for(Z=f;Z!==null;){var y=Z;switch(y.tag){case 0:case 11:case 15:ii(8,y,l)}var p=y.child;if(p!==null)p.return=y,Z=p;else for(;Z!==null;){y=Z;var v=y.sibling,_=y.return;if(yg(y),y===f){Z=null;break}if(v!==null){v.return=_,Z=v;break}Z=_}}}var S=l.alternate;if(S!==null){var x=S.child;if(x!==null){S.child=null;do{var d=x.sibling;x.sibling=null,x=d}while(x!==null)}}Z=l}}if(l.subtreeFlags&2064&&g!==null)g.return=l,Z=g;else e:for(;Z!==null;){if(l=Z,l.flags&2048)switch(l.tag){case 0:case 11:case 15:ii(9,l,l.return)}var u=l.sibling;if(u!==null){u.return=l.return,Z=u;break e}Z=l.return}}var c=e.current;for(Z=c;Z!==null;){g=Z;var h=g.child;if(g.subtreeFlags&2064&&h!==null)h.return=g,Z=h;else e:for(g=c;Z!==null;){if(o=Z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:va(9,o)}}catch(w){Ce(o,o.return,w)}if(o===g){Z=null;break e}var m=o.sibling;if(m!==null){m.return=o.return,Z=m;break e}Z=o.return}}if(ce=i,Ur(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(la,e)}catch{}n=!0}return n}finally{he=r,xt.transition=t}}return!1}function Gd(e,t,r){t=ys(r,t),t=ag(e,t,1),e=Ir(e,t,1),t=Ke(),e!==null&&(Ii(e,1,t),nt(e,t))}function Ce(e,t,r){if(e.tag===3)Gd(e,e,r);else for(;t!==null;){if(t.tag===3){Gd(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ar===null||!Ar.has(n))){e=ys(r,e),e=lg(t,e,1),t=Ir(t,e,1),e=Ke(),t!==null&&(Ii(t,1,e),nt(t,e));break}}t=t.return}}function t_(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&r,Me===e&&(Ie&r)===r&&(Te===4||Te===3&&(Ie&130023424)===Ie&&500>ke()-yu?dn(e,0):mu|=r),nt(e,t)}function Rg(e,t){t===0&&(e.mode&1?(t=Ki,Ki<<=1,!(Ki&130023424)&&(Ki=4194304)):t=1);var r=Ke();e=ar(e,t),e!==null&&(Ii(e,t,r),nt(e,r))}function r_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Rg(e,r)}function n_(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(V(314))}n!==null&&n.delete(t),Rg(e,r)}var Tg;Tg=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)et=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return et=!1,Uy(e,t,r);et=!!(e.flags&131072)}else et=!1,ye&&t.flags&1048576&&Lp(t,Uo,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Eo(e,t),e=t.pendingProps;var i=ps(t,$e.current);Gn(t,r),i=du(null,t,n,e,i,r);var l=hu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(n)?(l=!0,$o(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ou(t),i.updater=ga,t.stateNode=i,i._reactInternals=t,Vl(t,n,e,r),t=Yl(null,t,n,!0,l,r)):(t.tag=0,ye&&l&&Zc(t),Ue(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Eo(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=i_(n),e=Et(n,e),i){case 0:t=Gl(null,t,n,e,r);break e;case 1:t=Hd(null,t,n,e,r);break e;case 11:t=Fd(null,t,n,e,r);break e;case 14:t=Nd(null,t,n,Et(n.type,e),r);break e}throw Error(V(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Et(n,i),Gl(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Et(n,i),Hd(e,t,n,i,r);case 3:e:{if(hg(t),e===null)throw Error(V(387));n=t.pendingProps,l=t.memoizedState,i=l.element,Np(e,t),Ko(t,n,null,r);var g=t.memoizedState;if(n=g.element,l.isDehydrated)if(l={element:n,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=ys(Error(V(423)),t),t=zd(e,t,n,r,i);break e}else if(n!==i){i=ys(Error(V(424)),t),t=zd(e,t,n,r,i);break e}else for(lt=Br(t.stateNode.containerInfo.firstChild),ct=t,ye=!0,Tt=null,r=Op(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(gs(),n===i){t=lr(e,t,r);break e}Ue(e,t,n,r)}t=t.child}return t;case 5:return Hp(t),e===null&&Jl(t),n=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,g=i.children,Hl(n,i)?g=null:l!==null&&Hl(n,l)&&(t.flags|=32),dg(e,t),Ue(e,t,g,r),t.child;case 6:return e===null&&Jl(t),null;case 13:return fg(e,t,r);case 4:return au(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=vs(t,null,n,r):Ue(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Et(n,i),Fd(e,t,n,i,r);case 7:return Ue(e,t,t.pendingProps,r),t.child;case 8:return Ue(e,t,t.pendingProps.children,r),t.child;case 12:return Ue(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,l=t.memoizedProps,g=i.value,fe(Jo,n._currentValue),n._currentValue=g,l!==null)if(Lt(l.value,g)){if(l.children===i.children&&!tt.current){t=lr(e,t,r);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){g=l.child;for(var a=o.firstContext;a!==null;){if(a.context===n){if(l.tag===1){a=rr(-1,r&-r),a.tag=2;var f=l.updateQueue;if(f!==null){f=f.shared;var y=f.pending;y===null?a.next=a:(a.next=y.next,y.next=a),f.pending=a}}l.lanes|=r,a=l.alternate,a!==null&&(a.lanes|=r),ql(l.return,r,t),o.lanes|=r;break}a=a.next}}else if(l.tag===10)g=l.type===t.type?null:l.child;else if(l.tag===18){if(g=l.return,g===null)throw Error(V(341));g.lanes|=r,o=g.alternate,o!==null&&(o.lanes|=r),ql(g,r,t),g=l.sibling}else g=l.child;if(g!==null)g.return=l;else for(g=l;g!==null;){if(g===t){g=null;break}if(l=g.sibling,l!==null){l.return=g.return,g=l;break}g=g.return}l=g}Ue(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Gn(t,r),i=bt(i),n=n(i),t.flags|=1,Ue(e,t,n,r),t.child;case 14:return n=t.type,i=Et(n,t.pendingProps),i=Et(n.type,i),Nd(e,t,n,i,r);case 15:return cg(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Et(n,i),Eo(e,t),t.tag=1,rt(n)?(e=!0,$o(t)):e=!1,Gn(t,r),og(t,n,i),Vl(t,n,i,r),Yl(null,t,n,!0,e,r);case 19:return pg(e,t,r);case 22:return ug(e,t,r)}throw Error(V(156,t.tag))};function Dg(e,t){return np(e,t)}function s_(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 _t(e,t,r,n){return new s_(e,t,r,n)}function bu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function i_(e){if(typeof e=="function")return bu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zc)return 11;if(e===$c)return 14}return 2}function Fr(e,t){var r=e.alternate;return r===null?(r=_t(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 To(e,t,r,n,i,l){var g=2;if(n=e,typeof e=="function")bu(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case Bn:return hn(r.children,i,l,t);case Hc:g=8,i|=8;break;case yl:return e=_t(12,r,t,i|2),e.elementType=yl,e.lanes=l,e;case _l:return e=_t(13,r,t,i),e.elementType=_l,e.lanes=l,e;case xl:return e=_t(19,r,t,i),e.elementType=xl,e.lanes=l,e;case Hf:return ya(r,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ff:g=10;break e;case Nf:g=9;break e;case zc:g=11;break e;case $c:g=14;break e;case pr:g=16,n=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=_t(g,r,t,i),t.elementType=e,t.type=n,t.lanes=l,t}function hn(e,t,r,n){return e=_t(7,e,n,t),e.lanes=r,e}function ya(e,t,r,n){return e=_t(22,e,n,t),e.elementType=Hf,e.lanes=r,e.stateNode={isHidden:!1},e}function el(e,t,r){return e=_t(6,e,null,t),e.lanes=r,e}function tl(e,t,r){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function o_(e,t,r,n,i){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=Ia(0),this.expirationTimes=Ia(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ia(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function wu(e,t,r,n,i,l,g,o,a){return e=new o_(e,t,r,o,a),t===1?(t=1,l===!0&&(t|=8)):t=0,l=_t(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ou(l),e}function a_(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ln,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Pg(e){if(!e)return zr;e=e._reactInternals;e:{if(Sn(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var r=e.type;if(rt(r))return Pp(e,r,t)}return t}function Mg(e,t,r,n,i,l,g,o,a){return e=wu(r,n,!0,e,i,l,g,o,a),e.context=Pg(null),r=e.current,n=Ke(),i=Or(r),l=rr(n,i),l.callback=t??null,Ir(r,l,i),e.current.lanes=i,Ii(e,i,n),nt(e,n),e}function _a(e,t,r,n){var i=t.current,l=Ke(),g=Or(i);return r=Pg(r),t.context===null?t.context=r:t.pendingContext=r,t=rr(l,g),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ir(i,t,g),e!==null&&(Mt(e,i,g,l),wo(e,i,g)),g}function ta(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 Yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Cu(e,t){Yd(e,t),(e=e.alternate)&&Yd(e,t)}function l_(){return null}var Lg=typeof reportError=="function"?reportError:function(e){console.error(e)};function ku(e){this._internalRoot=e}xa.prototype.render=ku.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));_a(e,t,null,null)};xa.prototype.unmount=ku.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yn(function(){_a(null,e,null,null)}),t[or]=null}};function xa(e){this._internalRoot=e}xa.prototype.unstable_scheduleHydration=function(e){if(e){var t=up();e={blockedOn:null,target:e,priority:t};for(var r=0;r<vr.length&&t!==0&&t<vr[r].priority;r++);vr.splice(r,0,e),r===0&&hp(e)}};function Eu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xd(){}function c_(e,t,r,n,i){if(i){if(typeof n=="function"){var l=n;n=function(){var f=ta(g);l.call(f)}}var g=Mg(t,n,e,0,null,!1,!1,"",Xd);return e._reactRootContainer=g,e[or]=g.current,vi(e.nodeType===8?e.parentNode:e),yn(),g}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var o=n;n=function(){var f=ta(a);o.call(f)}}var a=wu(e,0,!1,null,null,!1,!1,"",Xd);return e._reactRootContainer=a,e[or]=a.current,vi(e.nodeType===8?e.parentNode:e),yn(function(){_a(t,a,r,n)}),a}function ba(e,t,r,n,i){var l=r._reactRootContainer;if(l){var g=l;if(typeof i=="function"){var o=i;i=function(){var a=ta(g);o.call(a)}}_a(t,g,e,i)}else g=c_(r,t,e,i,n);return ta(g)}lp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Vs(t.pendingLanes);r!==0&&(Jc(t,r|1),nt(t,ke()),!(ce&6)&&(_s=ke()+500,Ur()))}break;case 13:yn(function(){var n=ar(e,1);if(n!==null){var i=Ke();Mt(n,e,1,i)}}),Cu(e,1)}};qc=function(e){if(e.tag===13){var t=ar(e,134217728);if(t!==null){var r=Ke();Mt(t,e,134217728,r)}Cu(e,134217728)}};cp=function(e){if(e.tag===13){var t=Or(e),r=ar(e,t);if(r!==null){var n=Ke();Mt(r,e,t,n)}Cu(e,t)}};up=function(){return he};dp=function(e,t){var r=he;try{return he=e,t()}finally{he=r}};Dl=function(e,t,r){switch(t){case"input":if(wl(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 i=ha(n);if(!i)throw Error(V(90));$f(n),wl(n,i)}}}break;case"textarea":Uf(e,r);break;case"select":t=r.value,t!=null&&qn(e,!!r.multiple,t,!1)}};Yf=_u;Xf=yn;var u_={usingClientEntryPoint:!1,Events:[Oi,Fn,ha,Qf,Gf,_u]},Fs={findFiberByHostInstance:Gr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},d_={bundleType:Fs.bundleType,version:Fs.version,rendererPackageName:Fs.rendererPackageName,rendererConfig:Fs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=tp(e),e===null?null:e.stateNode},findFiberByHostInstance:Fs.findFiberByHostInstance||l_,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 so=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!so.isDisabled&&so.supportsFiber)try{la=so.inject(d_),$t=so}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u_;dt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Eu(t))throw Error(V(200));return a_(e,t,null,r)};dt.createRoot=function(e,t){if(!Eu(e))throw Error(V(299));var r=!1,n="",i=Lg;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=wu(e,1,!1,null,null,r,!1,n,i),e[or]=t.current,vi(e.nodeType===8?e.parentNode:e),new ku(t)};dt.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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=tp(t),e=e===null?null:e.stateNode,e};dt.flushSync=function(e){return yn(e)};dt.hydrate=function(e,t,r){if(!Sa(t))throw Error(V(200));return ba(null,e,t,!0,r)};dt.hydrateRoot=function(e,t,r){if(!Eu(e))throw Error(V(405));var n=r!=null&&r.hydratedSources||null,i=!1,l="",g=Lg;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),t=Mg(t,null,e,1,r??null,i,!1,l,g),e[or]=t.current,vi(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new xa(t)};dt.render=function(e,t,r){if(!Sa(t))throw Error(V(200));return ba(null,e,t,!1,r)};dt.unmountComponentAtNode=function(e){if(!Sa(e))throw Error(V(40));return e._reactRootContainer?(yn(function(){ba(null,null,e,!1,function(){e._reactRootContainer=null,e[or]=null})}),!0):!1};dt.unstable_batchedUpdates=_u;dt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Sa(r))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return ba(e,t,r,!1,n)};dt.version="18.3.1-next-f1338f8080-20240426";function Bg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bg)}catch(e){console.error(e)}}Bg(),Bf.exports=dt;var h_=Bf.exports,Zd=h_;vl.createRoot=Zd.createRoot,vl.hydrateRoot=Zd.hydrateRoot;var Cs=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(){}},tn,_r,es,df,f_=(df=class extends Cs{constructor(){super();te(this,tn);te(this,_r);te(this,es);Y(this,es,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,_r)||this.setEventListener(I(this,es))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,_r))==null||t.call(this),Y(this,_r,void 0))}setEventListener(t){var r;Y(this,es,t),(r=I(this,_r))==null||r.call(this),Y(this,_r,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,tn)!==t&&(Y(this,tn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,tn)=="boolean"?I(this,tn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tn=new WeakMap,_r=new WeakMap,es=new WeakMap,df),ju=new f_,p_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},xr,Mc,hf,g_=(hf=class{constructor(){te(this,xr,p_);te(this,Mc,!1)}setTimeoutProvider(e){Y(this,xr,e)}setTimeout(e,t){return I(this,xr).setTimeout(e,t)}clearTimeout(e){I(this,xr).clearTimeout(e)}setInterval(e,t){return I(this,xr).setInterval(e,t)}clearInterval(e){I(this,xr).clearInterval(e)}},xr=new WeakMap,Mc=new WeakMap,hf),Zr=new g_;function v_(e){setTimeout(e,0)}var m_=typeof window>"u"||"Deno"in globalThis;function Je(){}function y_(e,t){return typeof e=="function"?e(t):e}function cc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ig(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nr(e,t){return typeof e=="function"?e(t):e}function ot(e,t){return typeof e=="function"?e(t):e}function eh(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:l,queryKey:g,stale:o}=e;if(g){if(n){if(t.queryHash!==Ru(g,t.options))return!1}else if(!ki(t.queryKey,g))return!1}if(r!=="all"){const a=t.isActive();if(r==="active"&&!a||r==="inactive"&&a)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||l&&!l(t))}function th(e,t){const{exact:r,status:n,predicate:i,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(_n(t.options.mutationKey)!==_n(l))return!1}else if(!ki(t.options.mutationKey,l))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Ru(e,t){return((t==null?void 0:t.queryKeyHashFn)||_n)(e)}function _n(e){return JSON.stringify(e,(t,r)=>uc(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function ki(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ki(e[r],t[r])):!1}var __=Object.prototype.hasOwnProperty;function Ag(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=rh(e)&&rh(t);if(!n&&!(uc(e)&&uc(t)))return t;const l=(n?e:Object.keys(e)).length,g=n?t:Object.keys(t),o=g.length,a=n?new Array(o):{};let f=0;for(let y=0;y<o;y++){const p=n?y:g[y],v=e[p],_=t[p];if(v===_){a[p]=v,(n?y<l:__.call(e,p))&&f++;continue}if(v===null||_===null||typeof v!="object"||typeof _!="object"){a[p]=_;continue}const S=Ag(v,_,r+1);a[p]=S,S===v&&f++}return l===o&&f===l?e:a}function ra(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 rh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uc(e){if(!nh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!nh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nh(e){return Object.prototype.toString.call(e)==="[object Object]"}function x_(e){return new Promise(t=>{Zr.setTimeout(t,e)})}function dc(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Ag(e,t):t}function S_(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function b_(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tu=Symbol();function Og(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tu?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Du(e,t){return typeof e=="function"?e(...t):!!e}function w_(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Ei=(()=>{let e=()=>m_;return{isServer(){return e()},setIsServer(t){e=t}}})();function hc(){let e,t;const r=new Promise((i,l)=>{e=i,t=l});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var C_=v_;function k_(){let e=[],t=0,r=o=>{o()},n=o=>{o()},i=C_;const l=o=>{t?e.push(o):i(()=>{r(o)})},g=()=>{const o=e;e=[],o.length&&i(()=>{n(()=>{o.forEach(a=>{r(a)})})})};return{batch:o=>{let a;t++;try{a=o()}finally{t--,t||g()}return a},batchCalls:o=>(...a)=>{l(()=>{o(...a)})},schedule:l,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Re=k_(),ts,Sr,rs,ff,E_=(ff=class extends Cs{constructor(){super();te(this,ts,!0);te(this,Sr);te(this,rs);Y(this,rs,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(){I(this,Sr)||this.setEventListener(I(this,rs))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,Sr))==null||t.call(this),Y(this,Sr,void 0))}setEventListener(t){var r;Y(this,rs,t),(r=I(this,Sr))==null||r.call(this),Y(this,Sr,t(this.setOnline.bind(this)))}setOnline(t){I(this,ts)!==t&&(Y(this,ts,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,ts)}},ts=new WeakMap,Sr=new WeakMap,rs=new WeakMap,ff),na=new E_;function j_(e){return Math.min(1e3*2**e,3e4)}function Fg(e){return(e??"online")==="online"?na.isOnline():!0}var fc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ng(e){let t=!1,r=0,n;const i=hc(),l=()=>i.status!=="pending",g=x=>{var d;if(!l()){const u=new fc(x);v(u),(d=e.onCancel)==null||d.call(e,u)}},o=()=>{t=!0},a=()=>{t=!1},f=()=>ju.isFocused()&&(e.networkMode==="always"||na.isOnline())&&e.canRun(),y=()=>Fg(e.networkMode)&&e.canRun(),p=x=>{l()||(n==null||n(),i.resolve(x))},v=x=>{l()||(n==null||n(),i.reject(x))},_=()=>new Promise(x=>{var d;n=u=>{(l()||f())&&x(u)},(d=e.onPause)==null||d.call(e)}).then(()=>{var x;n=void 0,l()||(x=e.onContinue)==null||x.call(e)}),S=()=>{if(l())return;let x;const d=r===0?e.initialPromise:void 0;try{x=d??e.fn()}catch(u){x=Promise.reject(u)}Promise.resolve(x).then(p).catch(u=>{var C;if(l())return;const c=e.retry??(Ei.isServer()?0:3),h=e.retryDelay??j_,m=typeof h=="function"?h(r,u):h,w=c===!0||typeof c=="number"&&r<c||typeof c=="function"&&c(r,u);if(t||!w){v(u);return}r++,(C=e.onFail)==null||C.call(e,r,u),x_(m).then(()=>f()?void 0:_()).then(()=>{t?v(u):S()})})};return{promise:i,status:()=>i.status,cancel:g,continue:()=>(n==null||n(),i),cancelRetry:o,continueRetry:a,canStart:y,start:()=>(y()?S():_().then(S),i)}}var rn,pf,Hg=(pf=class{constructor(){te(this,rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cc(this.gcTime)&&Y(this,rn,Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ei.isServer()?1/0:5*60*1e3))}clearGcTimeout(){I(this,rn)!==void 0&&(Zr.clearTimeout(I(this,rn)),Y(this,rn,void 0))}},rn=new WeakMap,pf);function R_(e){return{onFetch:(t,r)=>{var y,p,v,_,S;const n=t.options,i=(v=(p=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,l=((_=t.state.data)==null?void 0:_.pages)||[],g=((S=t.state.data)==null?void 0:S.pageParams)||[];let o={pages:[],pageParams:[]},a=0;const f=async()=>{let x=!1;const d=h=>{w_(h,()=>t.signal,()=>x=!0)},u=Og(t.options,t.fetchOptions),c=async(h,m,w)=>{if(x)return Promise.reject(t.signal.reason);if(m==null&&h.pages.length)return Promise.resolve(h);const E=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:m,direction:w?"backward":"forward",meta:t.options.meta};return d(L),L})(),b=await u(E),{maxPages:k}=t.options,R=w?b_:S_;return{pages:R(h.pages,b,k),pageParams:R(h.pageParams,m,k)}};if(i&&l.length){const h=i==="backward",m=h?T_:sh,w={pages:l,pageParams:g},C=m(n,w);o=await c(w,C,h)}else{const h=e??l.length;do{const m=a===0?g[0]??n.initialPageParam:sh(n,o);if(a>0&&m==null)break;o=await c(o,m),a++}while(a<h)}return o};t.options.persister?t.fetchFn=()=>{var x,d;return(d=(x=t.options).persister)==null?void 0:d.call(x,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=f}}}function sh(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 T_(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}var ns,nn,ss,pt,sn,De,Ti,on,it,zg,Jt,gf,D_=(gf=class extends Hg{constructor(t){super();te(this,it);te(this,ns);te(this,nn);te(this,ss);te(this,pt);te(this,sn);te(this,De);te(this,Ti);te(this,on);Y(this,on,!1),Y(this,Ti,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,sn,t.client),Y(this,pt,I(this,sn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,nn,oh(this.options)),this.state=t.state??I(this,nn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,ns)}get promise(){var t;return(t=I(this,De))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Ti),...t},t!=null&&t._type&&Y(this,ns,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=oh(this.options);r.data!==void 0&&(this.setState(ih(r.data,r.dataUpdatedAt)),Y(this,nn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,pt).remove(this)}setData(t,r){const n=dc(this.state.data,t,this.options);return se(this,it,Jt).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){se(this,it,Jt).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=I(this,De))==null?void 0:n.promise;return(i=I(this,De))==null||i.cancel(t),r?r.then(Je).catch(Je):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,nn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ot(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Nr(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:!Ig(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,De))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,De))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,pt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(I(this,De)&&(I(this,on)||se(this,it,zg).call(this)?I(this,De).cancel({revert:!0}):I(this,De).cancelRetry()),this.scheduleGc()),I(this,pt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,it,Jt).call(this,{type:"invalidate"})}async fetch(t,r){var f,y,p,v,_,S,x,d,u,c,h;if(this.state.fetchStatus!=="idle"&&((f=I(this,De))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,De))return I(this,De).continueRetry(),I(this,De).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(w=>w.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Y(this,on,!0),n.signal)})},l=()=>{const m=Og(this.options,r),C=(()=>{const E={client:I(this,sn),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return Y(this,on,!1),this.options.persister?this.options.persister(m,C,this):m(C)},o=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,sn),state:this.state,fetchFn:l};return i(m),m})(),a=I(this,ns)==="infinite"?R_(this.options.pages):this.options.behavior;a==null||a.onFetch(o,this),Y(this,ss,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=o.fetchOptions)==null?void 0:y.meta))&&se(this,it,Jt).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Y(this,De,Ng({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:m=>{m instanceof fc&&m.revert&&this.setState({...I(this,ss),fetchStatus:"idle"}),n.abort()},onFail:(m,w)=>{se(this,it,Jt).call(this,{type:"failed",failureCount:m,error:w})},onPause:()=>{se(this,it,Jt).call(this,{type:"pause"})},onContinue:()=>{se(this,it,Jt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const m=await I(this,De).start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),(_=(v=I(this,pt).config).onSuccess)==null||_.call(v,m,this),(x=(S=I(this,pt).config).onSettled)==null||x.call(S,m,this.state.error,this),m}catch(m){if(m instanceof fc){if(m.silent)return I(this,De).promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw se(this,it,Jt).call(this,{type:"error",error:m}),(u=(d=I(this,pt).config).onError)==null||u.call(d,m,this),(h=(c=I(this,pt).config).onSettled)==null||h.call(c,this.state.data,m,this),m}finally{this.scheduleGc()}}},ns=new WeakMap,nn=new WeakMap,ss=new WeakMap,pt=new WeakMap,sn=new WeakMap,De=new WeakMap,Ti=new WeakMap,on=new WeakMap,it=new WeakSet,zg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Jt=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,...$g(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...ih(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,ss,t.manual?i:void 0),i;case"error":const l=t.error;return{...n,error:l,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Re.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,pt).notify({query:this,type:"updated",action:t})})},gf);function $g(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ih(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oh(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 Ye,le,Di,We,an,is,Gt,br,Pi,os,as,ln,cn,wr,ls,de,Gs,pc,gc,vc,mc,yc,_c,xc,Wg,vf,P_=(vf=class extends Cs{constructor(t,r){super();te(this,de);te(this,Ye);te(this,le);te(this,Di);te(this,We);te(this,an);te(this,is);te(this,Gt);te(this,br);te(this,Pi);te(this,os);te(this,as);te(this,ln);te(this,cn);te(this,wr);te(this,ls,new Set);this.options=r,Y(this,Ye,t),Y(this,br,null),Y(this,Gt,hc()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,le).addObserver(this),ah(I(this,le),this.options)?se(this,de,Gs).call(this):this.updateResult(),se(this,de,mc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sc(I(this,le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sc(I(this,le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,de,yc).call(this),se(this,de,_c).call(this),I(this,le).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,le);if(this.options=I(this,Ye).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ot(this.options.enabled,I(this,le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,de,xc).call(this),I(this,le).setOptions(this.options),r._defaulted&&!ra(this.options,r)&&I(this,Ye).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,le),observer:this});const i=this.hasListeners();i&&lh(I(this,le),n,this.options,r)&&se(this,de,Gs).call(this),this.updateResult(),i&&(I(this,le)!==n||ot(this.options.enabled,I(this,le))!==ot(r.enabled,I(this,le))||Nr(this.options.staleTime,I(this,le))!==Nr(r.staleTime,I(this,le)))&&se(this,de,pc).call(this);const l=se(this,de,gc).call(this);i&&(I(this,le)!==n||ot(this.options.enabled,I(this,le))!==ot(r.enabled,I(this,le))||l!==I(this,wr))&&se(this,de,vc).call(this,l)}getOptimisticResult(t){const r=I(this,Ye).getQueryCache().build(I(this,Ye),t),n=this.createResult(r,t);return L_(this,n)&&(Y(this,We,n),Y(this,is,this.options),Y(this,an,I(this,le).state)),n}getCurrentResult(){return I(this,We)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,Gt).status==="pending"&&I(this,Gt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){I(this,ls).add(t)}getCurrentQuery(){return I(this,le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,Ye).defaultQueryOptions(t),n=I(this,Ye).getQueryCache().build(I(this,Ye),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return se(this,de,Gs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,We)))}createResult(t,r){var k;const n=I(this,le),i=this.options,l=I(this,We),g=I(this,an),o=I(this,is),f=t!==n?t.state:I(this,Di),{state:y}=t;let p={...y},v=!1,_;if(r._optimisticResults){const R=this.hasListeners(),L=!R&&ah(t,r),P=R&&lh(t,n,r,i);(L||P)&&(p={...p,...$g(y.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:x,status:d}=p;_=p.data;let u=!1;if(r.placeholderData!==void 0&&_===void 0&&d==="pending"){let R;l!=null&&l.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(R=l.data,u=!0):R=typeof r.placeholderData=="function"?r.placeholderData((k=I(this,as))==null?void 0:k.state.data,I(this,as)):r.placeholderData,R!==void 0&&(d="success",_=dc(l==null?void 0:l.data,R,r),v=!0)}if(r.select&&_!==void 0&&!u)if(l&&_===(g==null?void 0:g.data)&&r.select===I(this,Pi))_=I(this,os);else try{Y(this,Pi,r.select),_=r.select(_),_=dc(l==null?void 0:l.data,_,r),Y(this,os,_),Y(this,br,null)}catch(R){Y(this,br,R)}I(this,br)&&(S=I(this,br),_=I(this,os),x=Date.now(),d="error");const c=p.fetchStatus==="fetching",h=d==="pending",m=d==="error",w=h&&c,C=_!==void 0,b={status:d,fetchStatus:p.fetchStatus,isPending:h,isSuccess:d==="success",isError:m,isInitialLoading:w,isLoading:w,data:_,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:c,isRefetching:c&&!h,isLoadingError:m&&!C,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:m&&C,isStale:Pu(t,r),refetch:this.refetch,promise:I(this,Gt),isEnabled:ot(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=b.data!==void 0,L=b.status==="error"&&!R,P=z=>{L?z.reject(b.error):R&&z.resolve(b.data)},B=()=>{const z=Y(this,Gt,b.promise=hc());P(z)},H=I(this,Gt);switch(H.status){case"pending":t.queryHash===n.queryHash&&P(H);break;case"fulfilled":(L||b.data!==H.value)&&B();break;case"rejected":(!L||b.error!==H.reason)&&B();break}}return b}updateResult(){const t=I(this,We),r=this.createResult(I(this,le),this.options);if(Y(this,an,I(this,le).state),Y(this,is,this.options),I(this,an).data!==void 0&&Y(this,as,I(this,le)),ra(r,t))return;Y(this,We,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!I(this,ls).size)return!0;const g=new Set(l??I(this,ls));return this.options.throwOnError&&g.add("error"),Object.keys(I(this,We)).some(o=>{const a=o;return I(this,We)[a]!==t[a]&&g.has(a)})};se(this,de,Wg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,de,mc).call(this)}},Ye=new WeakMap,le=new WeakMap,Di=new WeakMap,We=new WeakMap,an=new WeakMap,is=new WeakMap,Gt=new WeakMap,br=new WeakMap,Pi=new WeakMap,os=new WeakMap,as=new WeakMap,ln=new WeakMap,cn=new WeakMap,wr=new WeakMap,ls=new WeakMap,de=new WeakSet,Gs=function(t){se(this,de,xc).call(this);let r=I(this,le).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Je)),r},pc=function(){se(this,de,yc).call(this);const t=Nr(this.options.staleTime,I(this,le));if(Ei.isServer()||I(this,We).isStale||!cc(t))return;const n=Ig(I(this,We).dataUpdatedAt,t)+1;Y(this,ln,Zr.setTimeout(()=>{I(this,We).isStale||this.updateResult()},n))},gc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,le)):this.options.refetchInterval)??!1},vc=function(t){se(this,de,_c).call(this),Y(this,wr,t),!(Ei.isServer()||ot(this.options.enabled,I(this,le))===!1||!cc(I(this,wr))||I(this,wr)===0)&&Y(this,cn,Zr.setInterval(()=>{(this.options.refetchIntervalInBackground||ju.isFocused())&&se(this,de,Gs).call(this)},I(this,wr)))},mc=function(){se(this,de,pc).call(this),se(this,de,vc).call(this,se(this,de,gc).call(this))},yc=function(){I(this,ln)!==void 0&&(Zr.clearTimeout(I(this,ln)),Y(this,ln,void 0))},_c=function(){I(this,cn)!==void 0&&(Zr.clearInterval(I(this,cn)),Y(this,cn,void 0))},xc=function(){const t=I(this,Ye).getQueryCache().build(I(this,Ye),this.options);if(t===I(this,le))return;const r=I(this,le);Y(this,le,t),Y(this,Di,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Wg=function(t){Re.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,We))}),I(this,Ye).getQueryCache().notify({query:I(this,le),type:"observerResultsUpdated"})})},vf);function M_(e,t){return ot(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&ot(t.retryOnMount,e)===!1)}function ah(e,t){return M_(e,t)||e.state.data!==void 0&&Sc(e,t,t.refetchOnMount)}function Sc(e,t,r){if(ot(t.enabled,e)!==!1&&Nr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Pu(e,t)}return!1}function lh(e,t,r,n){return(e!==t||ot(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Pu(e,r)}function Pu(e,t){return ot(t.enabled,e)!==!1&&e.isStaleByTime(Nr(t.staleTime,e))}function L_(e,t){return!ra(e.getCurrentResult(),t)}var Mi,Ot,He,un,Ft,fr,mf,B_=(mf=class extends Hg{constructor(t){super();te(this,Ft);te(this,Mi);te(this,Ot);te(this,He);te(this,un);Y(this,Mi,t.client),this.mutationId=t.mutationId,Y(this,He,t.mutationCache),Y(this,Ot,[]),this.state=t.state||Ug(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Ot).includes(t)||(I(this,Ot).push(t),this.clearGcTimeout(),I(this,He).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,Ot,I(this,Ot).filter(r=>r!==t)),this.scheduleGc(),I(this,He).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Ot).length||(this.state.status==="pending"?this.scheduleGc():I(this,He).remove(this))}continue(){var t;return((t=I(this,un))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var g,o,a,f,y,p,v,_,S,x,d,u,c,h,m,w,C,E;const r=()=>{se(this,Ft,fr).call(this,{type:"continue"})},n={client:I(this,Mi),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,un,Ng({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(b,k)=>{se(this,Ft,fr).call(this,{type:"failed",failureCount:b,error:k})},onPause:()=>{se(this,Ft,fr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,He).canRun(this)}));const i=this.state.status==="pending",l=!I(this,un).canStart();try{if(i)r();else{se(this,Ft,fr).call(this,{type:"pending",variables:t,isPaused:l}),I(this,He).config.onMutate&&await I(this,He).config.onMutate(t,this,n);const k=await((o=(g=this.options).onMutate)==null?void 0:o.call(g,t,n));k!==this.state.context&&se(this,Ft,fr).call(this,{type:"pending",context:k,variables:t,isPaused:l})}const b=await I(this,un).start();return await((f=(a=I(this,He).config).onSuccess)==null?void 0:f.call(a,b,t,this.state.context,this,n)),await((p=(y=this.options).onSuccess)==null?void 0:p.call(y,b,t,this.state.context,n)),await((_=(v=I(this,He).config).onSettled)==null?void 0:_.call(v,b,null,this.state.variables,this.state.context,this,n)),await((x=(S=this.options).onSettled)==null?void 0:x.call(S,b,null,t,this.state.context,n)),se(this,Ft,fr).call(this,{type:"success",data:b}),b}catch(b){try{await((u=(d=I(this,He).config).onError)==null?void 0:u.call(d,b,t,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((h=(c=this.options).onError)==null?void 0:h.call(c,b,t,this.state.context,n))}catch(k){Promise.reject(k)}try{await((w=(m=I(this,He).config).onSettled)==null?void 0:w.call(m,void 0,b,this.state.variables,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,b,t,this.state.context,n))}catch(k){Promise.reject(k)}throw se(this,Ft,fr).call(this,{type:"error",error:b}),b}finally{I(this,He).runNext(this)}}},Mi=new WeakMap,Ot=new WeakMap,He=new WeakMap,un=new WeakMap,Ft=new WeakSet,fr=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),Re.batch(()=>{I(this,Ot).forEach(n=>{n.onMutationUpdate(t)}),I(this,He).notify({mutation:this,type:"updated",action:t})})},mf);function Ug(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yt,jt,Li,yf,I_=(yf=class extends Cs{constructor(t={}){super();te(this,Yt);te(this,jt);te(this,Li);this.config=t,Y(this,Yt,new Set),Y(this,jt,new Map),Y(this,Li,0)}build(t,r,n){const i=new B_({client:t,mutationCache:this,mutationId:++zi(this,Li)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){I(this,Yt).add(t);const r=io(t);if(typeof r=="string"){const n=I(this,jt).get(r);n?n.push(t):I(this,jt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Yt).delete(t)){const r=io(t);if(typeof r=="string"){const n=I(this,jt).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&I(this,jt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=io(t);if(typeof r=="string"){const n=I(this,jt).get(r),i=n==null?void 0:n.find(l=>l.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=io(t);if(typeof r=="string"){const i=(n=I(this,jt).get(r))==null?void 0:n.find(l=>l!==t&&l.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Re.batch(()=>{I(this,Yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Yt).clear(),I(this,jt).clear()})}getAll(){return Array.from(I(this,Yt))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>th(r,n))}findAll(t={}){return this.getAll().filter(r=>th(t,r))}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Re.batch(()=>Promise.all(t.map(r=>r.continue().catch(Je))))}},Yt=new WeakMap,jt=new WeakMap,Li=new WeakMap,yf);function io(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Xt,Cr,Xe,Zt,sr,Do,bc,_f,A_=(_f=class extends Cs{constructor(r,n){super();te(this,sr);te(this,Xt);te(this,Cr);te(this,Xe);te(this,Zt);Y(this,Xt,r),this.setOptions(n),this.bindMethods(),se(this,sr,Do).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=I(this,Xt).defaultMutationOptions(r),ra(this.options,n)||I(this,Xt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,Xe),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&_n(n.mutationKey)!==_n(this.options.mutationKey)?this.reset():((i=I(this,Xe))==null?void 0:i.state.status)==="pending"&&I(this,Xe).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=I(this,Xe))==null||r.removeObserver(this)}onMutationUpdate(r){se(this,sr,Do).call(this),se(this,sr,bc).call(this,r)}getCurrentResult(){return I(this,Cr)}reset(){var r;(r=I(this,Xe))==null||r.removeObserver(this),Y(this,Xe,void 0),se(this,sr,Do).call(this),se(this,sr,bc).call(this)}mutate(r,n){var i;return Y(this,Zt,n),(i=I(this,Xe))==null||i.removeObserver(this),Y(this,Xe,I(this,Xt).getMutationCache().build(I(this,Xt),this.options)),I(this,Xe).addObserver(this),I(this,Xe).execute(r)}},Xt=new WeakMap,Cr=new WeakMap,Xe=new WeakMap,Zt=new WeakMap,sr=new WeakSet,Do=function(){var n;const r=((n=I(this,Xe))==null?void 0:n.state)??Ug();Y(this,Cr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},bc=function(r){Re.batch(()=>{var n,i,l,g,o,a,f,y;if(I(this,Zt)&&this.hasListeners()){const p=I(this,Cr).variables,v=I(this,Cr).context,_={client:I(this,Xt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(i=(n=I(this,Zt)).onSuccess)==null||i.call(n,r.data,p,v,_)}catch(S){Promise.reject(S)}try{(g=(l=I(this,Zt)).onSettled)==null||g.call(l,r.data,null,p,v,_)}catch(S){Promise.reject(S)}}else if((r==null?void 0:r.type)==="error"){try{(a=(o=I(this,Zt)).onError)==null||a.call(o,r.error,p,v,_)}catch(S){Promise.reject(S)}try{(y=(f=I(this,Zt)).onSettled)==null||y.call(f,void 0,r.error,p,v,_)}catch(S){Promise.reject(S)}}}this.listeners.forEach(p=>{p(I(this,Cr))})})},_f),Nt,xf,O_=(xf=class extends Cs{constructor(t={}){super();te(this,Nt);this.config=t,Y(this,Nt,new Map)}build(t,r,n){const i=r.queryKey,l=r.queryHash??Ru(i,r);let g=this.get(l);return g||(g=new D_({client:t,queryKey:i,queryHash:l,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(g)),g}add(t){I(this,Nt).has(t.queryHash)||(I(this,Nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,Nt).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,Nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Re.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Nt).get(t)}getAll(){return[...I(this,Nt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>eh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>eh(t,n)):r}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Re.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Re.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nt=new WeakMap,xf),we,kr,Er,cs,us,jr,ds,hs,Sf,F_=(Sf=class{constructor(e={}){te(this,we);te(this,kr);te(this,Er);te(this,cs);te(this,us);te(this,jr);te(this,ds);te(this,hs);Y(this,we,e.queryCache||new O_),Y(this,kr,e.mutationCache||new I_),Y(this,Er,e.defaultOptions||{}),Y(this,cs,new Map),Y(this,us,new Map),Y(this,jr,0)}mount(){zi(this,jr)._++,I(this,jr)===1&&(Y(this,ds,ju.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,we).onFocus())})),Y(this,hs,na.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,we).onOnline())})))}unmount(){var e,t;zi(this,jr)._--,I(this,jr)===0&&((e=I(this,ds))==null||e.call(this),Y(this,ds,void 0),(t=I(this,hs))==null||t.call(this),Y(this,hs,void 0))}isFetching(e){return I(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,kr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,we).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,we).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Nr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(this,we).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=I(this,we).get(n.queryHash),l=i==null?void 0:i.state.data,g=y_(t,l);if(g!==void 0)return I(this,we).build(this,n).setData(g,{...r,manual:!0})}setQueriesData(e,t,r){return Re.batch(()=>I(this,we).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,we).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,we);Re.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,we);return Re.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Re.batch(()=>I(this,we).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Je).catch(Je)}invalidateQueries(e,t={}){return Re.batch(()=>(I(this,we).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=Re.batch(()=>I(this,we).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let l=i.fetch(void 0,r);return r.throwOnError||(l=l.catch(Je)),i.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(n).then(Je)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,we).build(this,t);return r.isStaleByTime(Nr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Je).catch(Je)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Je).catch(Je)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return na.isOnline()?I(this,kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,we)}getMutationCache(){return I(this,kr)}getDefaultOptions(){return I(this,Er)}setDefaultOptions(e){Y(this,Er,e)}setQueryDefaults(e,t){I(this,cs).set(_n(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,cs).values()],r={};return t.forEach(n=>{ki(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,us).set(_n(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,us).values()],r={};return t.forEach(n=>{ki(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Er).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ru(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===Tu&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Er).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,we).clear(),I(this,kr).clear()}},we=new WeakMap,kr=new WeakMap,Er=new WeakMap,cs=new WeakMap,us=new WeakMap,jr=new WeakMap,ds=new WeakMap,hs=new WeakMap,Sf),Jg=O.createContext(void 0),Jr=e=>{const t=O.useContext(Jg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},N_=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Jg.Provider,{value:e,children:t})),qg=O.createContext(!1),H_=()=>O.useContext(qg);qg.Provider;function z_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $_=O.createContext(z_()),W_=()=>O.useContext($_),U_=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Du(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},J_=e=>{O.useEffect(()=>{e.clearReset()},[e])},q_=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||Du(r,[e.error,n])),K_=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},V_=(e,t)=>e.isLoading&&e.isFetching&&!t,Q_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ch=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function G_(e,t,r){var v,_,S,x;const n=H_(),i=W_(),l=Jr(),g=l.defaultQueryOptions(e);(_=(v=l.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||_.call(v,g);const o=l.getQueryCache().get(g.queryHash);g._optimisticResults=n?"isRestoring":"optimistic",K_(g),U_(g,i,o),J_(i);const a=!l.getQueryCache().get(g.queryHash),[f]=O.useState(()=>new t(l,g)),y=f.getOptimisticResult(g),p=!n&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(d=>{const u=p?f.subscribe(Re.batchCalls(d)):Je;return f.updateResult(),u},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),O.useEffect(()=>{f.setOptions(g)},[g,f]),Q_(g,y))throw ch(g,f,i);if(q_({result:y,errorResetBoundary:i,throwOnError:g.throwOnError,query:o,suspense:g.suspense}))throw y.error;if((x=(S=l.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||x.call(S,g,y),g.experimental_prefetchInRender&&!Ei.isServer()&&V_(y,n)){const d=a?ch(g,f,i):o==null?void 0:o.promise;d==null||d.catch(Je).finally(()=>{f.updateResult()})}return g.notifyOnChangeProps?y:f.trackResult(y)}function ue(e,t){return G_(e,P_)}function nr(e,t){const r=Jr(),[n]=O.useState(()=>new A_(r,e));O.useEffect(()=>{n.setOptions(e)},[n,e]);const i=O.useSyncExternalStore(O.useCallback(g=>n.subscribe(Re.batchCalls(g)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),l=O.useCallback((g,o)=>{n.mutate(g,o).catch(Je)},[n]);if(i.error&&Du(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:l,mutateAsync:i.mutate}}function Y_(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,i,l,g=[],o="",a=e.split("/");for(a[0]||a.shift();i=a.shift();)r=i[0],r==="*"?(g.push(r),o+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=i.indexOf("?",1),l=i.indexOf(".",1),g.push(i.substring(1,~n?n:~l?l:i.length)),o+=~n&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(o+=(~n?"?":"")+"\\"+i.substring(l))):o+="/"+i;return{keys:g,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var Kg={exports:{}},Vg={};/**
|
|
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 xs=O;function X_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z_=typeof Object.is=="function"?Object.is:X_,ex=xs.useState,tx=xs.useEffect,rx=xs.useLayoutEffect,nx=xs.useDebugValue;function sx(e,t){var r=t(),n=ex({inst:{value:r,getSnapshot:t}}),i=n[0].inst,l=n[1];return rx(function(){i.value=r,i.getSnapshot=t,rl(i)&&l({inst:i})},[e,r,t]),tx(function(){return rl(i)&&l({inst:i}),e(function(){rl(i)&&l({inst:i})})},[e]),nx(r),r}function rl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Z_(e,r)}catch{return!0}}function ix(e,t){return t()}var ox=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ix:sx;Vg.useSyncExternalStore=xs.useSyncExternalStore!==void 0?xs.useSyncExternalStore:ox;Kg.exports=Vg;var ax=Kg.exports;const lx=tm.useInsertionEffect,cx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qg=cx?O.useLayoutEffect:O.useEffect,ux=lx||Qg,Mu=e=>{const t=O.useRef([e,(...r)=>t[0](...r)]).current;return ux(()=>{t[0]=e}),t[1]},dx="popstate",Lu="pushState",Bu="replaceState",hx="hashchange",uh=[dx,Lu,Bu,hx],fx=e=>{for(const t of uh)addEventListener(t,e);return()=>{for(const t of uh)removeEventListener(t,e)}},Gg=(e,t)=>ax.useSyncExternalStore(fx,e,t),dh=()=>location.search,px=({ssrSearch:e}={})=>Gg(dh,e!=null?()=>e:dh),hh=()=>location.pathname,gx=({ssrPath:e}={})=>Gg(hh,e!=null?()=>e:hh),vx=(e,{replace:t=!1,state:r=null}={})=>history[t?Bu:Lu](r,"",e),mx=(e={})=>[gx(e),vx],fh=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[fh]>"u"){for(const e of[Lu,Bu]){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,fh,{value:!0})}const yx=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Yg=(e="")=>e==="/"?"":e,_x=(e,t)=>e[0]==="~"?e.slice(1):Yg(t)+e,xx=(e="",t)=>yx(ph(Yg(e)),ph(t)),ph=e=>{try{return decodeURI(e)}catch{return e}},Xg={hook:mx,searchHook:px,parser:Y_,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},Zg=O.createContext(Xg),bn=()=>O.useContext(Zg),ev={},tv=O.createContext(ev),Iu=()=>O.useContext(tv),Ni=e=>{const[t,r]=e.hook(e);return[xx(e.base,t),Mu((n,i)=>e.aroundNav(r,_x(n,e.base),i))]},wn=()=>Ni(bn()),Au=(e,t,r,n)=>{const{pattern:i,keys:l}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),g=i.exec(r)||[],[o,...a]=g;return o!==void 0?[!0,(()=>{const f=l!==!1?Object.fromEntries(l.map((p,v)=>[p,a[v]])):g.groups;let y={...a};return f&&Object.assign(y,f),y})(),...n?[o]:[]]:[!1,null]},Sx=e=>Au(bn().parser,e,wn()[0]),rv=({children:e,...t})=>{var y,p,v;const r=bn(),n=t.hook?Xg:r;let i=n;const[l,g=t.ssrSearch??""]=((y=t.ssrPath)==null?void 0:y.split("?"))??[];l&&(t.ssrSearch=g,t.ssrPath=l),t.hrefs=t.hrefs??((p=t.hook)==null?void 0:p.hrefs),t.searchHook=t.searchHook??((v=t.hook)==null?void 0:v.searchHook);let o=O.useRef({}),a=o.current,f=a;for(let _ in n){const S=_==="base"?n[_]+(t[_]??""):t[_]??n[_];a===f&&S!==f[_]&&(o.current=f={...f}),f[_]=S,(S!==n[_]||S!==i[_])&&(i=f)}return O.createElement(Zg.Provider,{value:i,children:e})},gh=({children:e,component:t},r)=>t?O.createElement(t,{params:r}):typeof e=="function"?e(r):e,bx=e=>{let t=O.useRef(ev);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,i])=>i!==r[n])?e:r},Ne=({path:e,nest:t,match:r,...n})=>{const i=bn(),[l]=Ni(i),[g,o,a]=r??Au(i.parser,e,l,t),f=bx({...Iu(),...o});if(!g)return null;const y=a?O.createElement(rv,{base:a},gh(n,f)):gh(n,f);return O.createElement(tv.Provider,{value:f,children:y})},Ct=O.forwardRef((e,t)=>{const r=bn(),[n,i]=Ni(r),{to:l="",href:g=l,onClick:o,asChild:a,children:f,className:y,replace:p,state:v,transition:_,...S}=e,x=Mu(u=>{u.ctrlKey||u.metaKey||u.altKey||u.shiftKey||u.button!==0||(o==null||o(u),u.defaultPrevented||(u.preventDefault(),i(g,e)))}),d=r.hrefs(g[0]==="~"?g.slice(1):r.base+g,r);return a&&O.isValidElement(f)?O.cloneElement(f,{onClick:x,href:d}):O.createElement("a",{...S,onClick:x,href:d,className:y!=null&&y.call?y(n===g):y,children:f,ref:t})}),nv=e=>Array.isArray(e)?e.flatMap(t=>nv(t&&t.type===O.Fragment?t.props.children:t)):[e],wx=({children:e,location:t})=>{const r=bn(),[n]=Ni(r);for(const i of nv(e)){let l=0;if(O.isValidElement(i)&&(l=Au(r.parser,i.props.path,t||n,i.props.nest))[0])return O.cloneElement(i,{match:l})}return null},Ys=e=>{const{to:t,href:r=t}=e,n=bn(),[,i]=Ni(n),l=Mu(()=>i(t||r,e)),{ssrContext:g}=n;return Qg(()=>{l()},[]),g&&(g.redirectTo=t),null};async function Cx(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 re(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 Cx(r),i=(n==null?void 0:n.message)??(n==null?void 0:n.error),l=new Error(i?`${r.status} ${r.statusText}: ${i} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw l.status=r.status,l.code=n==null?void 0:n.error,l}return r.json()}const ee={getStatus:()=>re("/v1/status"),getBootstrap:()=>re("/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)),re(`/v1/events/recent?${r.toString()}`)},getClaudeAuth:()=>re("/v1/auth/claude"),installClaudeCode:()=>re("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>re("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:e=>re(e!=null&&e.singleDrip?"/v1/setup/drip?singleDrip=true":"/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>re("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),claimRewards:()=>re("/api/admin/claim-rewards",{method:"POST"}),restartDaemon:()=>re("/api/admin/restart",{method:"POST"}),getSolverNets:()=>re("/v1/solvernets"),updateSolverNet:(e,t)=>re(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>re("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),restake:e=>re(`/v1/setup/restake/${encodeURIComponent(String(e))}`,{method:"POST"}),retryAgentBinding:e=>re("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),retryBootstrap:()=>re("/v1/setup/bootstrap/retry",{method:"POST"}),updateHarnessMode:e=>re("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>re("/api/hermes/doctor"),harnessReadiness:e=>re(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>re("/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 re(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>re(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>re("/v1/solvernets/drafts"),getDraft:e=>re(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>re("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>re(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>re(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>re(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>re(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>re(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>re(`/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 re(`/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 re(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>re(`/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 re(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>re("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>re(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>re(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>re("/v1/operator/joined")},captures:{listPending:()=>re("/api/captures/pending"),get:e=>re(`/api/captures/${encodeURIComponent(e)}`),approve:e=>re(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>re(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>re("/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 re(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),re(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),re(`/v1/discovery/plugin-scores?${r.toString()}`)}}};async function kx(){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())}}function sv(e){const[t,r]=O.useState([]),[n,i]=O.useState(!1);return O.useEffect(()=>{const l="",g=new EventSource(`/v1/events${l}`,{withCredentials:!0});return g.onopen=()=>i(!0),g.onerror=()=>i(!1),g.onmessage=o=>{try{const a=JSON.parse(o.data);r(f=>[...f.slice(-499),a])}catch{}},()=>{g.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function Ex({headline:e}){const[t,r]=O.useState(!1),{events:n}=sv(),i=n.length>0?n[n.length-1]:null;return s.jsx("div",{className:"min-h-screen flex items-center justify-center px-10 py-16",style:{background:"var(--bg)",color:"var(--fg)"},children:s.jsxs("div",{className:"max-w-xl w-full flex flex-col gap-6",children:[s.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · starting up"}),s.jsxs("h1",{className:"j-display",style:{fontSize:"64px",lineHeight:1.05},children:[e,"."]}),s.jsx("p",{className:"j-mono text-sm",style:{color:"var(--fg-muted)",minHeight:"1.5em"},children:i?jx(i):"The daemon is booting. This usually takes a second."}),s.jsx("button",{type:"button",onClick:()=>r(l=>!l),className:"j-label hover:opacity-80 self-start",style:{color:"var(--fg-dim)"},children:t?"Hide details":"Show details"}),t&&s.jsxs("div",{className:"j-mono text-xs max-h-64 overflow-y-auto px-3 py-2",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)"},children:[n.length===0&&s.jsx("div",{style:{color:"var(--fg-dim)"},children:"no events yet"}),n.slice().reverse().map(l=>s.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:l.ts.slice(11,19)}),s.jsx("span",{style:{color:l.kind==="error"?"var(--break-red)":l.kind==="system"?"var(--accent-sky)":"var(--fg-dim)"},children:l.kind}),s.jsx("span",{style:{color:"var(--fg)"},children:l.message})]},l.id))]})]})})}function jx(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const Rx={base:"Base","base-sepolia":"Base Sepolia"};function Tx({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:i=!1}){var E;const[l,g]=O.useState(!1),[o,a]=O.useState(null),[f,y]=O.useState(0),p=O.useRef(!1),[v,_]=O.useState({state:"idle"});O.useEffect(()=>{if(o===null)return;y(Math.max(0,Math.floor((Date.now()-o)/1e3)));const b=window.setInterval(()=>{y(Math.max(0,Math.floor((Date.now()-o)/1e3)))},1e3);return()=>window.clearInterval(b)},[o]);const S=async()=>{await navigator.clipboard.writeText(e),g(!0),setTimeout(()=>g(!1),1500)},x=async()=>{var b;p.current=!0,a(Date.now()),y(0),_({state:"requesting"});try{const k=await ee.triggerDrip();a(null),k.ok?_({state:"sent",txHash:k.txHash??((b=k.txHashes)==null?void 0:b.at(-1)),txHashes:k.txHashes,attempts:k.attempts,balanceWei:k.balanceWei,targetWei:k.targetWei}):k.rateLimited||k.reason&&/rate|claimed|429/i.test(k.reason)?_({state:"rate_limited",reason:k.reason??"faucet rate-limited"}):_({state:"failed",reason:k.reason??"faucet funding failed"})}catch(k){a(null),_({state:"failed",reason:k instanceof Error?k.message:"drip failed"})}},d=O.useRef(t);O.useEffect(()=>{d.current!==t&&(d.current=t,_({state:"idle"}),p.current&&x())},[t]);const u=b=>{if(!b)return"unknown";try{const k=Number(BigInt(b))/1e18;return`${k.toFixed(k<.001?4:3)} ETH`}catch{return`${b} wei`}},c=u(t),h=O.useMemo(()=>v.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(f/60*92))),[v.state,f]),m=v.state==="sent"?((E=v.txHashes)==null?void 0:E.length)??v.attempts??(v.txHash?1:0):0,w=v.state==="sent"&&v.balanceWei!==void 0&&v.targetWei!==void 0&&(()=>{try{return BigInt(v.balanceWei)>=BigInt(v.targetWei)}catch{return!1}})(),C=v.state==="sent"&&!w;return s.jsxs("div",{className:"px-6 py-5 flex flex-col gap-4",style:{border:"1px solid var(--accent-gold)",background:"rgba(220, 184, 102, 0.04)",borderRadius:"var(--radius-2)"},children:[s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Action needed · fund the master EOA"}),s.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:"auto-detected on chain"})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"j-mono text-xs break-all",style:{color:"var(--fg)"},children:e}),s.jsxs("span",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:["send at least ",c," on ",Rx[n??""]??"this chain"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("button",{onClick:x,type:"button",disabled:v.state==="requesting"||w,className:"px-3 py-1.5 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--accent-gold)",color:"var(--bg)",borderRadius:"var(--radius-1)"},children:v.state==="requesting"?"Funding...":w?"Faucet funded":C?"Fund more":"Fund from faucet"}),s.jsx("button",{onClick:S,type:"button",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border-strong)",color:"var(--fg)",borderRadius:"var(--radius-1)",background:"transparent"},children:l?"Copied":"Copy address"}),s.jsx("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border)",color:"var(--fg-muted)",borderRadius:"var(--radius-1)"},children:"View on explorer"})]}),v.state==="sent"&&s.jsxs("p",{className:"j-mono text-[11px]",style:{color:w?"var(--vow-green)":"var(--accent-gold)"},children:[w?"Faucet funding complete":"Faucet funding partial",m>0?` (${m} drip${m===1?"":"s"})`:"",".",v.balanceWei&&v.targetWei?` Balance ${u(v.balanceWei)} / target ${u(v.targetWei)}.`:"",C?' Click "Fund more" to top up.':"",v.txHash&&s.jsxs(s.Fragment,{children:[" ",s.jsx("a",{href:`${r}/tx/${v.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--accent-sky)"},children:"view latest tx"})]})]}),v.state==="requesting"&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"h-1.5 overflow-hidden",style:{background:"var(--bg-sunken)",borderRadius:"999px"},children:s.jsx("div",{className:"h-full transition-all",style:{width:`${h}%`,background:"var(--accent-gold)",borderRadius:"999px"}})}),s.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:["Requesting faucet drips for ",Dx(e),". Elapsed ",f,"s; this can take about a minute on a fresh wallet."]})]}),v.state==="rate_limited"&&s.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--wane)"},children:"Faucet rate-limited. Send manually or wait before trying again."}),v.state==="failed"&&s.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--break-red)"},children:v.reason}),i&&s.jsx("p",{"data-testid":"onboarding-shared-rpc-nudge",className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:"Using a shared trial RPC — add your own key in the Network section for reliable operation."})]})}const Dx=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var iv={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(g,o,a){var f=this&&this.__decorate||function(h,m,w,C){var E,b=arguments.length,k=b<3?m:C===null?C=Object.getOwnPropertyDescriptor(m,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,m,w,C);else for(var R=h.length-1;R>=0;R--)(E=h[R])&&(k=(b<3?E(k):b>3?E(m,w,k):E(m,w))||k);return b>3&&k&&Object.defineProperty(m,w,k),k},y=this&&this.__param||function(h,m){return function(w,C){m(w,C,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const p=a(9042),v=a(6114),_=a(9924),S=a(844),x=a(5596),d=a(4725),u=a(3656);let c=o.AccessibilityManager=class extends S.Disposable{constructor(h,m){super(),this._terminal=h,this._renderService=m,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 _.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(`
|
|
49
|
+
`))),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 x.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,u.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,S.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(h){for(let m=0;m<h;m++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
|
|
50
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),v.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,v.isMac&&this._liveRegion.remove()}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,m){this._liveRegionDebouncer.refresh(h,m,this._terminal.rows)}_renderRows(h,m){const w=this._terminal.buffer,C=w.lines.length.toString();for(let E=h;E<=m;E++){const b=w.translateBufferLineToString(w.ydisp+E,!0),k=(w.ydisp+E+1).toString(),R=this._rowElements[E];R&&(b.length===0?R.innerText=" ":R.textContent=b,R.setAttribute("aria-posinset",k),R.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,m){const w=h.target,C=this._rowElements[m===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==C)return;let E,b;if(m===0?(E=w,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(E=this._rowElements.shift(),b=w,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=document.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=c=f([y(1,d.IRenderService)],c)},3614:(g,o)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function f(v,_){return _?"\x1B[200~"+v+"\x1B[201~":v}function y(v,_,S,x){v=f(v=a(v),S.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(v,!0),_.value=""}function p(v,_,S){const x=S.getBoundingClientRect(),d=v.clientX-x.left-10,u=v.clientY-x.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${d}px`,_.style.top=`${u}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=a,o.bracketTextForPaste=f,o.copyHandler=function(v,_){v.clipboardData&&v.clipboardData.setData("text/plain",_.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,_,S,x){v.stopPropagation(),v.clipboardData&&y(v.clipboardData.getData("text/plain"),_,S,x)},o.paste=y,o.moveTextAreaUnderMouseCursor=p,o.rightClickHandler=function(v,_,S,x,d){p(v,_,S),d&&x.rightClickSelect(v),_.value=x.selectionText,_.select()}},7239:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=a(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(y,p,v){this._css.set(y,p,v)}getCss(y,p){return this._css.get(y,p)}setColor(y,p,v){this._color.set(y,p,v)}getColor(y,p){return this._color.get(y,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(a,f,y,p){a.addEventListener(f,y,p);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(f,y,p))}}}},6465:function(g,o,a){var f=this&&this.__decorate||function(d,u,c,h){var m,w=arguments.length,C=w<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,c,h);else for(var E=d.length-1;E>=0;E--)(m=d[E])&&(C=(w<3?m(C):w>3?m(u,c,C):m(u,c))||C);return w>3&&C&&Object.defineProperty(u,c,C),C},y=this&&this.__param||function(d,u){return function(c,h){u(c,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier2=void 0;const p=a(3656),v=a(8460),_=a(844),S=a(2585);let x=o.Linkifier2=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(d){super(),this._bufferService=d,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(d){return this._linkProviders.push(d),{dispose:()=>{const u=this._linkProviders.indexOf(d);u!==-1&&this._linkProviders.splice(u,1)}}}attachToDom(d,u,c){this._element=d,this._mouseService=u,this._renderService=c,this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){if(this._lastMouseEvent=d,!this._element||!this._mouseService)return;const u=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!u)return;this._isMouseOut=!1;const c=d.composedPath();for(let h=0;h<c.length;h++){const m=c[h];if(m.classList.contains("xterm"))break;if(m.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._handleHover(u),this._lastBufferCell=u)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,u){var c,h;this._activeProviderReplies&&u||((c=this._activeProviderReplies)===null||c===void 0||c.forEach(w=>{w==null||w.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=d.y);let m=!1;for(const[w,C]of this._linkProviders.entries())u?!((h=this._activeProviderReplies)===null||h===void 0)&&h.get(w)&&(m=this._checkLinkProviderResult(w,d,m)):C.provideLinks(d.y,E=>{var b,k;if(this._isMouseOut)return;const R=E==null?void 0:E.map(L=>({link:L}));(b=this._activeProviderReplies)===null||b===void 0||b.set(w,R),m=this._checkLinkProviderResult(w,d,m),((k=this._activeProviderReplies)===null||k===void 0?void 0:k.size)===this._linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)})}_removeIntersectingLinks(d,u){const c=new Set;for(let h=0;h<u.size;h++){const m=u.get(h);if(m)for(let w=0;w<m.length;w++){const C=m[w],E=C.link.range.start.y<d?0:C.link.range.start.x,b=C.link.range.end.y>d?this._bufferService.cols:C.link.range.end.x;for(let k=E;k<=b;k++){if(c.has(k)){m.splice(w--,1);break}c.add(k)}}}}_checkLinkProviderResult(d,u,c){var h;if(!this._activeProviderReplies)return c;const m=this._activeProviderReplies.get(d);let w=!1;for(let C=0;C<d;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(w=!0);if(!w&&m){const C=m.find(E=>this._linkAtPosition(E.link,u));C&&(c=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!c)for(let C=0;C<this._activeProviderReplies.size;C++){const E=(h=this._activeProviderReplies.get(C))===null||h===void 0?void 0:h.find(b=>this._linkAtPosition(b.link,u));if(E){c=!0,this._handleNewLink(E);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._element||!this._mouseService||!this._currentLink)return;const u=this._positionFromMouseEvent(d,this._element,this._mouseService);u&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,u){this._element&&this._currentLink&&this._lastMouseEvent&&(!d||!u||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._linkAtPosition(d.link,u)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>{var c,h;return(h=(c=this._currentLink)===null||c===void 0?void 0:c.state)===null||h===void 0?void 0:h.decorations.pointerCursor},set:c=>{var h,m;!((h=this._currentLink)===null||h===void 0)&&h.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&((m=this._element)===null||m===void 0||m.classList.toggle("xterm-cursor-pointer",c)))}},underline:{get:()=>{var c,h;return(h=(c=this._currentLink)===null||c===void 0?void 0:c.state)===null||h===void 0?void 0:h.decorations.underline},set:c=>{var h,m,w;!((h=this._currentLink)===null||h===void 0)&&h.state&&((w=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||w===void 0?void 0:w.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,c))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(c=>{if(!this._currentLink)return;const h=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,m=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=m&&(this._clearCurrentLink(h,m),this._lastMouseEvent&&this._element)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(d,u,c){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(c,u.text)}_fireUnderlineEvent(d,u){const c=d.range,h=this._bufferService.buffer.ydisp,m=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-h-1,c.end.x,c.end.y-h-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(m)}_linkLeave(d,u,c){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(c,u.text)}_linkAtPosition(d,u){const c=d.range.start.y*this._bufferService.cols+d.range.start.x,h=d.range.end.y*this._bufferService.cols+d.range.end.x,m=u.y*this._bufferService.cols+u.x;return c<=m&&m<=h}_positionFromMouseEvent(d,u,c){const h=c.getCoords(d,u,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,u,c,h,m){return{x1:d,y1:u,x2:c,y2:h,cols:this._bufferService.cols,fg:m}}};o.Linkifier2=x=f([y(0,S.IBufferService)],x)},9042:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(g,o,a){var f=this&&this.__decorate||function(x,d,u,c){var h,m=arguments.length,w=m<3?d:c===null?c=Object.getOwnPropertyDescriptor(d,u):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,d,u,c);else for(var C=x.length-1;C>=0;C--)(h=x[C])&&(w=(m<3?h(w):m>3?h(d,u,w):h(d,u))||w);return m>3&&w&&Object.defineProperty(d,u,w),w},y=this&&this.__param||function(x,d){return function(u,c){d(u,c,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const p=a(511),v=a(2585);let _=o.OscLinkProvider=class{constructor(x,d,u){this._bufferService=x,this._optionsService=d,this._oscLinkService=u}provideLinks(x,d){var u;const c=this._bufferService.buffer.lines.get(x-1);if(!c)return void d(void 0);const h=[],m=this._optionsService.rawOptions.linkHandler,w=new p.CellData,C=c.getTrimmedLength();let E=-1,b=-1,k=!1;for(let R=0;R<C;R++)if(b!==-1||c.hasContent(R)){if(c.loadCell(R,w),w.hasExtendedAttrs()&&w.extended.urlId){if(b===-1){b=R,E=w.extended.urlId;continue}k=w.extended.urlId!==E}else b!==-1&&(k=!0);if(k||b!==-1&&R===C-1){const L=(u=this._oscLinkService.getLinkData(E))===null||u===void 0?void 0:u.uri;if(L){const P={start:{x:b+1,y:x},end:{x:R+(k||R!==C-1?0:1),y:x}};let B=!1;if(!(m!=null&&m.allowNonHttpProtocols))try{const H=new URL(L);["http:","https:"].includes(H.protocol)||(B=!0)}catch{B=!0}B||h.push({text:L,range:P,activate:(H,z)=>m?m.activate(H,z,P):S(0,z),hover:(H,z)=>{var J;return(J=m==null?void 0:m.hover)===null||J===void 0?void 0:J.call(m,H,z,P)},leave:(H,z)=>{var J;return(J=m==null?void 0:m.leave)===null||J===void 0?void 0:J.call(m,H,z,P)}})}k=!1,w.hasExtendedAttrs()&&w.extended.urlId?(b=R,E=w.extended.urlId):(b=-1,E=-1)}}d(h)}};function S(x,d){if(confirm(`Do you want to navigate to ${d}?
|
|
51
|
+
|
|
52
|
+
WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=_=f([y(0,v.IBufferService),y(1,v.IOptionsService),y(2,v.IOscLinkService)],_)},6193:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(a,f){this._parentWindow=a,this._renderCallback=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,f,y){this._rowCount=y,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,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 a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ScreenDprMonitor=void 0;const f=a(844);class y extends f.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.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)}}o.ScreenDprMonitor=y},3236:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=a(3614),y=a(3656),p=a(6465),v=a(9042),_=a(3730),S=a(1680),x=a(3107),d=a(5744),u=a(2950),c=a(1296),h=a(428),m=a(4269),w=a(5114),C=a(8934),E=a(3230),b=a(9312),k=a(4725),R=a(6731),L=a(8055),P=a(8969),B=a(8460),H=a(844),z=a(6114),J=a(8437),U=a(2584),j=a(7399),D=a(5941),M=a(9074),A=a(2585),F=a(5435),q=a(4567),G=typeof window<"u"?window.document:null;class X extends P.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(T={}){super(T),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(p.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((N,W)=>this.refresh(N,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(N=>this._reportWindowsOptions(N))),this.register(this._inputHandler.onColor(N=>this._handleColorEvent(N))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(N=>this._afterResize(N.cols,N.rows))),this.register((0,H.toDisposable)(()=>{var N,W;this._customKeyEventHandler=void 0,(W=(N=this.element)===null||N===void 0?void 0:N.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(T){if(this._themeService)for(const N of T){let W,$="";switch(N.index){case 256:W="foreground",$="10";break;case 257:W="background",$="11";break;case 258:W="cursor",$="12";break;default:W="ansi",$="4;"+N.index}switch(N.type){case 0:const ne=L.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${$};${(0,D.toRgbString)(ne)}${U.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(Q=>Q.ansi[N.index]=L.rgba.toColor(...N.color));else{const Q=W;this._themeService.modifyColors(ie=>ie[Q]=L.rgba.toColor(...N.color))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.updateCursorStyle(T),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)===null||T===void 0?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.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 T=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(T);if(!N)return;const W=Math.min(this.buffer.x,this.cols-1),$=this._renderService.dimensions.css.cell.height,ne=N.getWidth(W),Q=this._renderService.dimensions.css.cell.width*ne,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=$+"px",this.textarea.style.lineHeight=$+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",N=>{this.hasSelection()&&(0,f.copyHandler)(N,this._selectionService)}));const T=N=>(0,f.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,y.addDisposableDomListener)(this.element,"paste",T)),z.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",N=>{N.button===2&&(0,f.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",N=>{(0,f.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",N=>{N.button===1&&(0,f.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",T=>this._keyUp(T),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",T=>this._keyDown(T),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",T=>this._keyPress(T),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",T=>this._compositionHelper.compositionupdate(T))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,y.addDisposableDomListener)(this.textarea,"input",T=>this._inputEvent(T),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(T){var N;if(!T)throw new Error("Terminal requires a parent element.");T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=T.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),T.appendChild(this.element);const W=G.createDocumentFragment();this._viewportElement=G.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=G.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=G.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=G.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=G.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.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,(N=this._document.defaultView)!==null&&N!==void 0?N:window),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",$=>this._handleTextAreaFocus($))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange($=>this._onRender.fire($))),this.onResize($=>this._renderService.resize($.cols,$.rows)),this._compositionView=G.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines($=>this.scrollLines($.amount,$.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(b.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines($=>this.scrollLines($.amount,$.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event($=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",$=>this._selectionService.handleMouseDown($))),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",$=>this._handleScreenReaderModeOptionChange($))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",$=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(c.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const T=this,N=this.element;function W(Q){const ie=T._mouseService.getMouseReportCoords(Q,T.screenElement);if(!ie)return!1;let pe,ge;switch(Q.overrideType||Q.type){case"mousemove":ge=32,Q.buttons===void 0?(pe=3,Q.button!==void 0&&(pe=Q.button<3?Q.button:3)):pe=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":ge=0,pe=Q.button<3?Q.button:3;break;case"mousedown":ge=1,pe=Q.button<3?Q.button:3;break;case"wheel":if(T.viewport.getLinesScrolled(Q)===0)return!1;ge=Q.deltaY<0?0:1,pe=4;break;default:return!1}return!(ge===void 0||pe===void 0||pe>4)&&T.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:pe,action:ge,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const $={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ne={mouseup:Q=>(W(Q),Q.buttons||(this._document.removeEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.removeEventListener("mousemove",$.mousedrag)),this.cancel(Q)),wheel:Q=>(W(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&W(Q)},mousemove:Q=>{Q.buttons||W(Q)}};this.register(this.coreMouseService.onProtocolChange(Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),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&Q?$.mousemove||(N.addEventListener("mousemove",ne.mousemove),$.mousemove=ne.mousemove):(N.removeEventListener("mousemove",$.mousemove),$.mousemove=null),16&Q?$.wheel||(N.addEventListener("wheel",ne.wheel,{passive:!1}),$.wheel=ne.wheel):(N.removeEventListener("wheel",$.wheel),$.wheel=null),2&Q?$.mouseup||(N.addEventListener("mouseup",ne.mouseup),$.mouseup=ne.mouseup):(this._document.removeEventListener("mouseup",$.mouseup),N.removeEventListener("mouseup",$.mouseup),$.mouseup=null),4&Q?$.mousedrag||($.mousedrag=ne.mousedrag):(this._document.removeEventListener("mousemove",$.mousedrag),$.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(N,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return W(Q),$.mouseup&&this._document.addEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.addEventListener("mousemove",$.mousedrag),this.cancel(Q)})),this.register((0,y.addDisposableDomListener)(N,"wheel",Q=>{if(!$.wheel){if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(Q);if(ie===0)return;const pe=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let ge="";for(let Ut=0;Ut<Math.abs(ie);Ut++)ge+=pe;return this.coreService.triggerDataEvent(ge,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,y.addDisposableDomListener)(N,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,y.addDisposableDomListener)(N,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(T,N){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(T,N)}updateCursorStyle(T){var N;!((N=this._selectionService)===null||N===void 0)&&N.shouldColumnSelect(T)?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(T,N,W=0){var $;W===1?(super.scrollLines(T,N,W),this.refresh(0,this.rows-1)):($=this.viewport)===null||$===void 0||$.scrollLines(T)}paste(T){(0,f.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}registerLinkProvider(T){return this.linkifier2.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,N,W){this._selectionService.setSelection(T,N,W)}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 T;(T=this._selectionService)===null||T===void 0||T.clearSelection()}selectAll(){var T;(T=this._selectionService)===null||T===void 0||T.selectAll()}selectLines(T,N){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(T,N)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!N&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,j.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),W.type===3||W.type===2){const $=this.rows-1;return this.scrollLines(W.type===2?-$:$),this.cancel(T,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(W.cancel&&this.cancel(T,!0),!W.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==U.C0.ETX&&W.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,N){const W=T.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||T.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||T.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?W:W&&(!N.keyCode||N.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||(function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18}(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)N=T.charCode;else if(T.which===null||T.which===void 0)N=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;N=T.which}return!(!N||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=T.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(T),!0}return!1}resize(T,N){T!==this.cols||N!==this.rows?super.resize(T,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,N){var W,$;(W=this._charSizeService)===null||W===void 0||W.measure(),($=this.viewport)===null||$===void 0||$.syncScrollArea(!0)}clear(){var T;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(J.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)===null||T===void 0||T.reset(),this.refresh(0,this.rows-1)}}reset(){var T,N;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(T=this._selectionService)===null||T===void 0||T.reset(),this._decorationService.reset(),(N=this.viewport)===null||N===void 0||N.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)===null||T===void 0||T.clearTextureAtlas()}_reportFocus(){var T;!((T=this.element)===null||T===void 0)&&T.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${W};${N}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const $=this._renderService.dimensions.css.cell.width.toFixed(0),ne=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${ne};${$}t`)}}cancel(T,N){if(this.options.cancelEvents||N)return T.preventDefault(),T.stopPropagation(),!1}}o.Terminal=X},9924:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(a,f=1e3){this._renderCallback=a,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,f,y){this._rowCount=y,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=p-this._lastRefreshMs,_=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f)}}},1680:function(g,o,a){var f=this&&this.__decorate||function(u,c,h,m){var w,C=arguments.length,E=C<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,c,h,m);else for(var b=u.length-1;b>=0;b--)(w=u[b])&&(E=(C<3?w(E):C>3?w(c,h,E):w(c,h))||E);return C>3&&E&&Object.defineProperty(c,h,E),E},y=this&&this.__param||function(u,c){return function(h,m){c(h,m,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const p=a(3656),v=a(4725),_=a(8460),S=a(844),x=a(2585);let d=o.Viewport=class extends S.Disposable{constructor(u,c,h,m,w,C,E,b){super(),this._viewportElement=u,this._scrollArea=c,this._bufferService=h,this._optionsService=m,this._charSizeService=w,this._renderService=C,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(b.colors),this.register(b.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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 c=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==c&&(this._lastRecordedBufferHeight=c,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 c=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,c){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(c<0&&this._viewportElement.scrollTop!==0||c>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const c=this._getPixelsScrolled(u);return c!==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+c:this._smoothScrollState.target+=c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=c,this._bubbleScroll(u,c))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const c=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let c=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?c*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._currentRowHeight*this._bufferService.rows),c}getBufferElements(u,c){var h;let m,w="";const C=[],E=c??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let k=u;k<E;k++){const R=b.get(k);if(!R)continue;const L=(h=b.get(k+1))===null||h===void 0?void 0:h.isWrapped;if(w+=R.translateToString(!L),!L||k===b.length-1){const P=document.createElement("div");P.textContent=w,C.push(P),w.length>0&&(m=P),w=""}}return{bufferElements:C,cursorElement:m}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let c=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(c/=this._currentRowHeight+0,this._wheelPartialScroll+=c,c=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._bufferService.rows),c}_applyScrollModifier(u,c){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&c.altKey||h==="ctrl"&&c.ctrlKey||h==="shift"&&c.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const c=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(u,c))}};o.Viewport=d=f([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,v.ICharSizeService),y(5,v.IRenderService),y(6,v.ICoreBrowserService),y(7,v.IThemeService)],d)},3107:function(g,o,a){var f=this&&this.__decorate||function(d,u,c,h){var m,w=arguments.length,C=w<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,c,h);else for(var E=d.length-1;E>=0;E--)(m=d[E])&&(C=(w<3?m(C):w>3?m(u,c,C):m(u,c))||C);return w>3&&C&&Object.defineProperty(u,c,C),C},y=this&&this.__param||function(d,u){return function(c,h){u(c,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const p=a(3656),v=a(4725),_=a(844),S=a(2585);let x=o.BufferDecorationRenderer=class extends _.Disposable{constructor(d,u,c,h){super(),this._screenElement=d,this._bufferService=u,this._decorationService=c,this._renderService=h,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,p.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(m=>this._removeDecoration(m))),this.register((0,_.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 d of this._decorationService.decorations)this._renderDecoration(d);this._dimensionsChanged=!1}_renderDecoration(d){this._refreshStyle(d),this._dimensionsChanged&&this._refreshXPosition(d)}_createElement(d){var u,c;const h=document.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((u=d==null?void 0:d.options)===null||u===void 0?void 0:u.layer)==="top"),h.style.width=`${Math.round((d.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(d.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(d.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=(c=d.options.x)!==null&&c!==void 0?c:0;return m&&m>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(d,h),h}_refreshStyle(d){const u=d.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)d.element&&(d.element.style.display="none",d.onRenderEmitter.fire(d.element));else{let c=this._decorationElements.get(d);c||(c=this._createElement(d),d.element=c,this._decorationElements.set(d,c),this._container.appendChild(c),d.onDispose(()=>{this._decorationElements.delete(d),c.remove()})),c.style.top=u*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",d.onRenderEmitter.fire(c)}}_refreshXPosition(d,u=d.element){var c;if(!u)return;const h=(c=d.options.x)!==null&&c!==void 0?c:0;(d.options.anchor||"left")==="right"?u.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(d){var u;(u=this._decorationElements.get(d))===null||u===void 0||u.remove(),this._decorationElements.delete(d),d.dispose()}};o.BufferDecorationRenderer=x=f([y(1,S.IBufferService),y(2,S.IDecorationService),y(3,v.IRenderService)],x)},5871:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(a){if(a.options.overviewRulerOptions){for(const f of this._zones)if(f.color===a.options.overviewRulerOptions.color&&f.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,a.marker.line))return;if(this._lineAdjacentToZone(f,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(f,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,f){return f>=a.startBufferLine&&f<=a.endBufferLine}_lineAdjacentToZone(a,f,y){return f>=a.startBufferLine-this._linePadding[y||"full"]&&f<=a.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(a,f){a.startBufferLine=Math.min(a.startBufferLine,f),a.endBufferLine=Math.max(a.endBufferLine,f)}}},5744:function(g,o,a){var f=this&&this.__decorate||function(m,w,C,E){var b,k=arguments.length,R=k<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,w,C,E);else for(var L=m.length-1;L>=0;L--)(b=m[L])&&(R=(k<3?b(R):k>3?b(w,C,R):b(w,C))||R);return k>3&&R&&Object.defineProperty(w,C,R),R},y=this&&this.__param||function(m,w){return function(C,E){w(C,E,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const p=a(5871),v=a(3656),_=a(4725),S=a(844),x=a(2585),d={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let h=o.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,w,C,E,b,k,R){var L;super(),this._viewportElement=m,this._screenElement=w,this._bufferService=C,this._decorationService=E,this._renderService=b,this._optionsService=k,this._coreBrowseService=R,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)===null||L===void 0||L.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var B;(B=this._canvas)===null||B===void 0||B.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,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const m=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=m,u.center=w,u.right=m,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=u.left,c.right=u.left+u.center}_refreshDrawHeightConstants(){d.full=Math.round(2*this._coreBrowseService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowseService.dpr);d.left=w,d.center=w,d.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.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 m=this._colorZoneStore.zones;for(const w of m)w.position!=="full"&&this._renderColorZone(w);for(const w of m)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(c[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-d[m.position||"full"]/2),u[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+d[m.position||"full"]))}_queueRefresh(m,w){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=h=f([y(2,x.IBufferService),y(3,x.IDecorationService),y(4,_.IRenderService),y(5,x.IOptionsService),y(6,_.ICoreBrowserService)],h)},2950:function(g,o,a){var f=this&&this.__decorate||function(x,d,u,c){var h,m=arguments.length,w=m<3?d:c===null?c=Object.getOwnPropertyDescriptor(d,u):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,d,u,c);else for(var C=x.length-1;C>=0;C--)(h=x[C])&&(w=(m<3?h(w):m>3?h(d,u,w):h(d,u))||w);return m>3&&w&&Object.defineProperty(d,u,w),w},y=this&&this.__param||function(x,d){return function(u,c){d(u,c,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const p=a(4725),v=a(2585),_=a(2584);let S=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,d,u,c,h,m){this._textarea=x,this._compositionView=d,this._bufferService=u,this._optionsService=c,this._coreService=h,this._renderService=m,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}},0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const d=this._textarea.value,u=d.replace(x,"");this._dataAlreadySent=u,d.length>x.length?this._coreService.triggerDataEvent(u,!0):d.length<x.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):d.length===x.length&&d!==x&&this._coreService.triggerDataEvent(d,!0)}},0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,c=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const m=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}x||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=S=f([y(2,v.IBufferService),y(3,v.IOptionsService),y(4,v.ICoreService),y(5,p.IRenderService)],S)},9806:(g,o)=>{function a(f,y,p){const v=p.getBoundingClientRect(),_=f.getComputedStyle(p),S=parseInt(_.getPropertyValue("padding-left")),x=parseInt(_.getPropertyValue("padding-top"));return[y.clientX-v.left-S,y.clientY-v.top-x]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=a,o.getCoords=function(f,y,p,v,_,S,x,d,u){if(!S)return;const c=a(f,y,p);return c?(c[0]=Math.ceil((c[0]+(u?x/2:0))/x),c[1]=Math.ceil(c[1]/d),c[0]=Math.min(Math.max(c[0],1),v+(u?1:0)),c[1]=Math.min(Math.max(c[1],1),_),c):void 0}},9504:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=a(2584);function y(d,u,c,h){const m=d-p(d,c),w=u-p(u,c),C=Math.abs(m-w)-function(E,b,k){let R=0;const L=E-p(E,k),P=b-p(b,k);for(let B=0;B<Math.abs(L-P);B++){const H=v(E,b)==="A"?-1:1,z=k.buffer.lines.get(L+H*B);z!=null&&z.isWrapped&&R++}return R}(d,u,c);return x(C,S(v(d,u),h))}function p(d,u){let c=0,h=u.buffer.lines.get(d),m=h==null?void 0:h.isWrapped;for(;m&&d>=0&&d<u.rows;)c++,h=u.buffer.lines.get(--d),m=h==null?void 0:h.isWrapped;return c}function v(d,u){return d>u?"A":"B"}function _(d,u,c,h,m,w){let C=d,E=u,b="";for(;C!==c||E!==h;)C+=m?1:-1,m&&C>w.cols-1?(b+=w.buffer.translateBufferLineToString(E,!1,d,C),C=0,d=0,E++):!m&&C<0&&(b+=w.buffer.translateBufferLineToString(E,!1,0,d+1),C=w.cols-1,d=C,E--);return b+w.buffer.translateBufferLineToString(E,!1,d,C)}function S(d,u){const c=u?"O":"[";return f.C0.ESC+c+d}function x(d,u){d=Math.floor(d);let c="";for(let h=0;h<d;h++)c+=u;return c}o.moveToCellSequence=function(d,u,c,h){const m=c.buffer.x,w=c.buffer.y;if(!c.buffer.hasScrollback)return function(b,k,R,L,P,B){return y(k,L,P,B).length===0?"":x(_(b,k,b,k-p(k,P),!1,P).length,S("D",B))}(m,w,0,u,c,h)+y(w,u,c,h)+function(b,k,R,L,P,B){let H;H=y(k,L,P,B).length>0?L-p(L,P):k;const z=L,J=function(U,j,D,M,A,F){let q;return q=y(D,M,A,F).length>0?M-p(M,A):j,U<D&&q<=M||U>=D&&q<M?"C":"D"}(b,k,R,L,P,B);return x(_(b,H,R,z,J==="C",P).length,S(J,B))}(m,w,d,u,c,h);let C;if(w===u)return C=m>d?"D":"C",x(Math.abs(m-d),S(C,h));C=w>u?"D":"C";const E=Math.abs(w-u);return x(function(b,k){return k.cols-b}(w>u?d:m,c)+(E-1)*c.cols+1+((w>u?m:d)-1),S(C,h))}},1296:function(g,o,a){var f=this&&this.__decorate||function(P,B,H,z){var J,U=arguments.length,j=U<3?B:z===null?z=Object.getOwnPropertyDescriptor(B,H):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(P,B,H,z);else for(var D=P.length-1;D>=0;D--)(J=P[D])&&(j=(U<3?J(j):U>3?J(B,H,j):J(B,H))||j);return U>3&&j&&Object.defineProperty(B,H,j),j},y=this&&this.__param||function(P,B){return function(H,z){B(H,z,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const p=a(3787),v=a(2550),_=a(2223),S=a(6171),x=a(4725),d=a(8055),u=a(8460),c=a(844),h=a(2585),m="xterm-dom-renderer-owner-",w="xterm-rows",C="xterm-fg-",E="xterm-bg-",b="xterm-focus",k="xterm-selection";let R=1,L=o.DomRenderer=class extends c.Disposable{constructor(P,B,H,z,J,U,j,D,M,A){super(),this._element=P,this._screenElement=B,this._viewportElement=H,this._linkifier2=z,this._charSizeService=U,this._optionsService=j,this._bufferService=D,this._coreBrowserService=M,this._themeService=A,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new u.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(k),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(F=>this._injectCss(F))),this._injectCss(this._themeService.colors),this._rowFactory=J.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(F=>this._handleLinkHover(F))),this.register(this._linkifier2.onHideLinkUnderline(F=>this._handleLinkLeave(F))),this.register((0,c.toDisposable)(()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 H of this._rowElements)H.style.width=`${this.dimensions.css.canvas.width}px`,H.style.height=`${this.dimensions.css.cell.height}px`,H.style.lineHeight=`${this.dimensions.css.cell.height}px`,H.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,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(P){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${w} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${w} .xterm-dim { color: ${d.color.multiplyOpacity(P.foreground,.5).css};}`,B+=`${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;}`,B+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",B+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,B+=`${this._terminalSelector} .${w}.${b} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w}.${b} .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: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[H,z]of P.ansi.entries())B+=`${this._terminalSelector} .${C}${H} { color: ${z.css}; }${this._terminalSelector} .${C}${H}.xterm-dim { color: ${d.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${H} { background-color: ${z.css}; }`;B+=`${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(P.background).css}; }${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,B){for(let H=this._rowElements.length;H<=B;H++){const z=document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,B){this._refreshRowElements(P,B),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(b)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,B,H){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,B,H),this.renderRows(0,this._bufferService.rows-1),!P||!B)return;const z=P[1]-this._bufferService.buffer.ydisp,J=B[1]-this._bufferService.buffer.ydisp,U=Math.max(z,0),j=Math.min(J,this._bufferService.rows-1);if(U>=this._bufferService.rows||j<0)return;const D=document.createDocumentFragment();if(H){const M=P[0]>B[0];D.appendChild(this._createSelectionElement(U,M?B[0]:P[0],M?P[0]:B[0],j-U+1))}else{const M=z===U?P[0]:0,A=U===J?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(U,M,A));const F=j-U-1;if(D.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,F)),U!==j){const q=J===j?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,0,q))}}this._selectionContainer.appendChild(D)}_createSelectionElement(P,B,H,z=1){const J=document.createElement("div");return J.style.height=z*this.dimensions.css.cell.height+"px",J.style.top=P*this.dimensions.css.cell.height+"px",J.style.left=B*this.dimensions.css.cell.width+"px",J.style.width=this.dimensions.css.cell.width*(H-B)+"px",J}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 P of this._rowElements)P.replaceChildren()}renderRows(P,B){const H=this._bufferService.buffer,z=H.ybase+H.y,J=Math.min(H.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=P;M<=B;M++){const A=M+H.ydisp,F=this._rowElements[M],q=H.lines.get(A);if(!F||!q)break;F.replaceChildren(...this._rowFactory.createRow(q,A,A===z,j,D,J,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,B,H,z,J,U){H<0&&(P=0),z<0&&(B=0);const j=this._bufferService.rows-1;H=Math.max(Math.min(H,j),0),z=Math.max(Math.min(z,j),0),J=Math.min(J,this._bufferService.cols);const D=this._bufferService.buffer,M=D.ybase+D.y,A=Math.min(D.x,J-1),F=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=H;X<=z;++X){const K=X+D.ydisp,T=this._rowElements[X],N=D.lines.get(K);if(!T||!N)break;T.replaceChildren(...this._rowFactory.createRow(N,K,K===M,q,G,A,F,this.dimensions.css.cell.width,this._widthCache,U?X===H?P:0:-1,U?(X===z?B:J)-1:-1))}}};o.DomRenderer=L=f([y(4,h.IInstantiationService),y(5,x.ICharSizeService),y(6,h.IOptionsService),y(7,h.IBufferService),y(8,x.ICoreBrowserService),y(9,x.IThemeService)],L)},3787:function(g,o,a){var f=this&&this.__decorate||function(C,E,b,k){var R,L=arguments.length,P=L<3?E:k===null?k=Object.getOwnPropertyDescriptor(E,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(C,E,b,k);else for(var B=C.length-1;B>=0;B--)(R=C[B])&&(P=(L<3?R(P):L>3?R(E,b,P):R(E,b))||P);return L>3&&P&&Object.defineProperty(E,b,P),P},y=this&&this.__param||function(C,E){return function(b,k){E(b,k,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const p=a(2223),v=a(643),_=a(511),S=a(2585),x=a(8055),d=a(4725),u=a(4269),c=a(6171),h=a(3734);let m=o.DomRendererRowFactory=class{constructor(C,E,b,k,R,L,P){this._document=C,this._characterJoinerService=E,this._optionsService=b,this._coreBrowserService=k,this._coreService=R,this._decorationService=L,this._themeService=P,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,E,b){this._selectionStart=C,this._selectionEnd=E,this._columnSelectMode=b}createRow(C,E,b,k,R,L,P,B,H,z,J){const U=[],j=this._characterJoinerService.getJoinedCharacters(E),D=this._themeService.colors;let M,A=C.getNoBgTrimmedLength();b&&A<L+1&&(A=L+1);let F=0,q="",G=0,X=0,K=0,T=!1,N=0,W=!1,$=0;const ne=[],Q=z!==-1&&J!==-1;for(let ie=0;ie<A;ie++){C.loadCell(ie,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let ge=!1,Ut=ie,oe=this._workCell;if(j.length>0&&ie===j[0][0]){ge=!0;const _e=j.shift();oe=new u.JoinedCellData(this._workCell,C.translateToString(!0,_e[0],_e[1]),_e[1]-_e[0]),Ut=_e[1]-1,pe=oe.getWidth()}const js=this._isCellInSelection(ie,E),Ca=b&&ie===L,ka=Q&&ie>=z&&ie<=J;let Ea=!1;this._decorationService.forEachDecorationAtCell(ie,E,void 0,_e=>{Ea=!0});let Hi=oe.getChars()||v.WHITESPACE_CELL_CHAR;if(Hi===" "&&(oe.isUnderline()||oe.isOverline())&&(Hi=" "),$=pe*B-H.get(Hi,oe.isBold(),oe.isItalic()),M){if(F&&(js&&W||!js&&!W&&oe.bg===G)&&(js&&W&&D.selectionForeground||oe.fg===X)&&oe.extended.ext===K&&ka===T&&$===N&&!Ca&&!ge&&!Ea){q+=Hi,F++;continue}F&&(M.textContent=q),M=this._document.createElement("span"),F=0,q=""}else M=this._document.createElement("span");if(G=oe.bg,X=oe.fg,K=oe.extended.ext,T=ka,N=$,W=js,ge&&L>=ie&&L<=Ut&&(L=ie),!this._coreService.isCursorHidden&&Ca){if(ne.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&ne.push("xterm-cursor-blink"),ne.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":ne.push("xterm-cursor-outline");break;case"block":ne.push("xterm-cursor-block");break;case"bar":ne.push("xterm-cursor-bar");break;case"underline":ne.push("xterm-cursor-underline")}}if(oe.isBold()&&ne.push("xterm-bold"),oe.isItalic()&&ne.push("xterm-italic"),oe.isDim()&&ne.push("xterm-dim"),q=oe.isInvisible()?v.WHITESPACE_CELL_CHAR:oe.getChars()||v.WHITESPACE_CELL_CHAR,oe.isUnderline()&&(ne.push(`xterm-underline-${oe.extended.underlineStyle}`),q===" "&&(q=" "),!oe.isUnderlineColorDefault()))if(oe.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(oe.getUnderlineColor()).join(",")})`;else{let _e=oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&oe.isBold()&&_e<8&&(_e+=8),M.style.textDecorationColor=D.ansi[_e].css}oe.isOverline()&&(ne.push("xterm-overline"),q===" "&&(q=" ")),oe.isStrikethrough()&&ne.push("xterm-strikethrough"),ka&&(M.style.textDecoration="underline");let ft=oe.getFgColor(),Rs=oe.getFgColorMode(),Bt=oe.getBgColor(),Ts=oe.getBgColorMode();const ja=!!oe.isInverse();if(ja){const _e=ft;ft=Bt,Bt=_e;const Ov=Rs;Rs=Ts,Ts=Ov}let ur,Ra,dr,Ds=!1;switch(this._decorationService.forEachDecorationAtCell(ie,E,void 0,_e=>{_e.options.layer!=="top"&&Ds||(_e.backgroundColorRGB&&(Ts=50331648,Bt=_e.backgroundColorRGB.rgba>>8&16777215,ur=_e.backgroundColorRGB),_e.foregroundColorRGB&&(Rs=50331648,ft=_e.foregroundColorRGB.rgba>>8&16777215,Ra=_e.foregroundColorRGB),Ds=_e.options.layer==="top")}),!Ds&&js&&(ur=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Bt=ur.rgba>>8&16777215,Ts=50331648,Ds=!0,D.selectionForeground&&(Rs=50331648,ft=D.selectionForeground.rgba>>8&16777215,Ra=D.selectionForeground)),Ds&&ne.push("xterm-decoration-top"),Ts){case 16777216:case 33554432:dr=D.ansi[Bt],ne.push(`xterm-bg-${Bt}`);break;case 50331648:dr=x.rgba.toColor(Bt>>16,Bt>>8&255,255&Bt),this._addStyle(M,`background-color:#${w((Bt>>>0).toString(16),"0",6)}`);break;default:ja?(dr=D.foreground,ne.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):dr=D.background}switch(ur||oe.isDim()&&(ur=x.color.multiplyOpacity(dr,.5)),Rs){case 16777216:case 33554432:oe.isBold()&&ft<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ft+=8),this._applyMinimumContrast(M,dr,D.ansi[ft],oe,ur,void 0)||ne.push(`xterm-fg-${ft}`);break;case 50331648:const _e=x.rgba.toColor(ft>>16&255,ft>>8&255,255&ft);this._applyMinimumContrast(M,dr,_e,oe,ur,Ra)||this._addStyle(M,`color:#${w(ft.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,dr,D.foreground,oe,ur,void 0)||ja&&ne.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ne.length&&(M.className=ne.join(" "),ne.length=0),Ca||ge||Ea?M.textContent=q:F++,$!==this.defaultSpacing&&(M.style.letterSpacing=`${$}px`),U.push(M),ie=Ut}return M&&F&&(M.textContent=q),U}_applyMinimumContrast(C,E,b,k,R,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.excludeFromContrastRatioDemands)(k.getCode()))return!1;const P=this._getContrastCache(k);let B;if(R||L||(B=P.getColor(E.rgba,b.rgba)),B===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);B=x.color.ensureContrastRatio(R||E,L||b,H),P.setColor((R||E).rgba,(L||b).rgba,B??null)}return!!B&&(this._addStyle(C,`color:${B.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,E){C.setAttribute("style",`${C.getAttribute("style")||""}${E};`)}_isCellInSelection(C,E){const b=this._selectionStart,k=this._selectionEnd;return!(!b||!k)&&(this._columnSelectMode?b[0]<=k[0]?C>=b[0]&&E>=b[1]&&C<k[0]&&E<=k[1]:C<b[0]&&E>=b[1]&&C>=k[0]&&E<=k[1]:E>b[1]&&E<k[1]||b[1]===k[1]&&E===b[1]&&C>=b[0]&&C<k[0]||b[1]<k[1]&&E===k[1]&&C<k[0]||b[1]<k[1]&&E===b[1]&&C>=b[0])}};function w(C,E,b){for(;C.length<b;)C=E+C;return C}o.DomRendererRowFactory=m=f([y(1,d.ICharacterJoinerService),y(2,S.IOptionsService),y(3,d.ICoreBrowserService),y(4,S.ICoreService),y(5,S.IDecorationService),y(6,d.IThemeService)],m)},2550:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.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 f=a.createElement("span"),y=a.createElement("span");y.style.fontWeight="bold";const p=a.createElement("span");p.style.fontStyle="italic";const v=a.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[f,y,p,v],this._container.appendChild(f),this._container.appendChild(y),this._container.appendChild(p),this._container.appendChild(v),a.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(a,f,y,p){a===this._font&&f===this._fontSize&&y===this._weight&&p===this._weightBold||(this._font=a,this._fontSize=f,this._weight=y,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(a,f,y){let p=0;if(!f&&!y&&a.length===1&&(p=a.charCodeAt(0))<256)return this._flat[p]!==-9999?this._flat[p]:this._flat[p]=this._measure(a,0);let v=a;f&&(v+="B"),y&&(v+="I");let _=this._holey.get(v);if(_===void 0){let S=0;f&&(S|=1),y&&(S|=2),_=this._measure(a,S),this._holey.set(v,_)}return _}_measure(a,f){const y=this._measureElements[f];return y.textContent=a.repeat(32),y.offsetWidth/32}}},2223:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=a(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(g,o)=>{function a(f){return 57508<=f&&f<=57558}Object.defineProperty(o,"__esModule",{value:!0}),o.createRenderDimensions=o.excludeFromContrastRatioDemands=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},o.isPowerlineGlyph=a,o.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},o.excludeFromContrastRatioDemands=function(f){return a(f)||function(y){return 9472<=y&&y<=9631}(f)},o.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:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,f=this.selectionEnd;return!(!a||!f)&&(a[1]>f[1]||a[1]===f[1]&&a[0]>f[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,o,a){var f=this&&this.__decorate||function(d,u,c,h){var m,w=arguments.length,C=w<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,c,h);else for(var E=d.length-1;E>=0;E--)(m=d[E])&&(C=(w<3?m(C):w>3?m(u,c,C):m(u,c))||C);return w>3&&C&&Object.defineProperty(u,c,C),C},y=this&&this.__param||function(d,u){return function(c,h){u(c,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const p=a(2585),v=a(8460),_=a(844);let S=o.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,u,c){super(),this._optionsService=c,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new x(d,u,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};o.CharSizeService=S=f([y(2,p.IOptionsService)],S);class x{constructor(u,c,h){this._document=u,this._parentElement=c,this._optionsService=h,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 u={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return u.width!==0&&u.height!==0&&(this._result.width=u.width/32,this._result.height=Math.ceil(u.height)),this._result}}},4269:function(g,o,a){var f=this&&this.__decorate||function(u,c,h,m){var w,C=arguments.length,E=C<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,c,h,m);else for(var b=u.length-1;b>=0;b--)(w=u[b])&&(E=(C<3?w(E):C>3?w(c,h,E):w(c,h))||E);return C>3&&E&&Object.defineProperty(c,h,E),E},y=this&&this.__param||function(u,c){return function(h,m){c(h,m,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const p=a(3734),v=a(643),_=a(511),S=a(2585);class x extends p.AttributeData{constructor(c,h,m){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=h,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=x;let d=o.CharacterJoinerService=class ov{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(c){const h={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(h),h.id}deregister(c){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===c)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(c);if(!h||h.length===0)return[];const m=[],w=h.translateToString(!0);let C=0,E=0,b=0,k=h.getFg(0),R=h.getBg(0);for(let L=0;L<h.getTrimmedLength();L++)if(h.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==R){if(L-C>1){const P=this._getJoinedRanges(w,b,E,h,C);for(let B=0;B<P.length;B++)m.push(P[B])}C=L,b=E,k=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const L=this._getJoinedRanges(w,b,E,h,C);for(let P=0;P<L.length;P++)m.push(L[P])}return m}_getJoinedRanges(c,h,m,w,C){const E=c.substring(h,m);let b=[];try{b=this._characterJoiners[0].handler(E)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const R=this._characterJoiners[k].handler(E);for(let L=0;L<R.length;L++)ov._mergeRanges(b,R[L])}catch(R){console.error(R)}return this._stringRangesToCellRanges(b,w,C),b}_stringRangesToCellRanges(c,h,m){let w=0,C=!1,E=0,b=c[w];if(b){for(let k=m;k<this._bufferService.cols;k++){const R=h.getWidth(k),L=h.getString(k).length||v.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!C&&b[0]<=E&&(b[0]=k,C=!0),b[1]<=E){if(b[1]=k,b=c[++w],!b)break;b[0]<=E?(b[0]=k,C=!0):C=!1}E+=L}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(c,h){let m=!1;for(let w=0;w<c.length;w++){const C=c[w];if(m){if(h[1]<=C[0])return c[w-1][1]=h[1],c;if(h[1]<=C[1])return c[w-1][1]=Math.max(h[1],C[1]),c.splice(w,1),c;c.splice(w,1),w--}else{if(h[1]<=C[0])return c.splice(w,0,h),c;if(h[1]<=C[1])return C[0]=Math.min(h[0],C[0]),c;h[0]<C[1]&&(C[0]=Math.min(h[0],C[0]),m=!0)}}return m?c[c.length-1][1]=h[1]:c.push(h),c}};o.CharacterJoinerService=d=f([y(0,S.IBufferService)],d)},5114:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0,o.CoreBrowserService=class{constructor(a,f){this._textarea=a,this.window=f,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(g,o,a){var f=this&&this.__decorate||function(S,x,d,u){var c,h=arguments.length,m=h<3?x:u===null?u=Object.getOwnPropertyDescriptor(x,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,x,d,u);else for(var w=S.length-1;w>=0;w--)(c=S[w])&&(m=(h<3?c(m):h>3?c(x,d,m):c(x,d))||m);return h>3&&m&&Object.defineProperty(x,d,m),m},y=this&&this.__param||function(S,x){return function(d,u){x(d,u,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const p=a(4725),v=a(9806);let _=o.MouseService=class{constructor(S,x){this._renderService=S,this._charSizeService=x}getCoords(S,x,d,u,c){return(0,v.getCoords)(window,S,x,d,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,c)}getMouseReportCoords(S,x){const d=(0,v.getCoordsRelativeToElement)(window,S,x);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};o.MouseService=_=f([y(0,p.IRenderService),y(1,p.ICharSizeService)],_)},3230:function(g,o,a){var f=this&&this.__decorate||function(m,w,C,E){var b,k=arguments.length,R=k<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,w,C,E);else for(var L=m.length-1;L>=0;L--)(b=m[L])&&(R=(k<3?b(R):k>3?b(w,C,R):b(w,C))||R);return k>3&&R&&Object.defineProperty(w,C,R),R},y=this&&this.__param||function(m,w){return function(C,E){w(C,E,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const p=a(3656),v=a(6193),_=a(5596),S=a(4725),x=a(8460),d=a(844),u=a(7226),c=a(2585);let h=o.RenderService=class extends d.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,w,C,E,b,k,R,L){if(super(),this._rowCount=m,this._charSizeService=E,this._renderer=this.register(new d.MutableDisposable),this._pausedResizeTask=new u.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(R.window,(P,B)=>this._renderRows(P,B)),this.register(this._renderDebouncer),this._screenDprMonitor=new _.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var P;return(P=this._renderer.value)===null||P===void 0?void 0:P.clear()})),this.register(C.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register((0,p.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(L.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const P=new R.window.IntersectionObserver(B=>this._handleIntersectionChange(B[B.length-1]),{threshold:0});P.observe(w),this.register({dispose:()=>P.disconnect()})}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,w,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,w,this._rowCount))}_renderRows(m,w){this._renderer.value&&(m=Math.min(m,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(m,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:m,end:w}),this._onRender.fire({start:m,end:w}),this._isNextRenderRedrawOnly=!0)}resize(m,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(m){this._renderer.value=m,this._renderer.value.onRequestRedraw(w=>this.refreshRows(w.start,w.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,w;this._renderer.value&&((w=(m=this._renderer.value).clearTextureAtlas)===null||w===void 0||w.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(m,w)):this._renderer.value.handleResize(m,w),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)===null||m===void 0||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)===null||m===void 0||m.handleFocus()}handleSelectionChanged(m,w,C){var E;this._selectionState.start=m,this._selectionState.end=w,this._selectionState.columnSelectMode=C,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(m,w,C)}handleCursorMove(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)===null||m===void 0||m.clear()}};o.RenderService=h=f([y(2,c.IOptionsService),y(3,S.ICharSizeService),y(4,c.IDecorationService),y(5,c.IBufferService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],h)},9312:function(g,o,a){var f=this&&this.__decorate||function(b,k,R,L){var P,B=arguments.length,H=B<3?k:L===null?L=Object.getOwnPropertyDescriptor(k,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(b,k,R,L);else for(var z=b.length-1;z>=0;z--)(P=b[z])&&(H=(B<3?P(H):B>3?P(k,R,H):P(k,R))||H);return B>3&&H&&Object.defineProperty(k,R,H),H},y=this&&this.__param||function(b,k){return function(R,L){k(R,L,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const p=a(9806),v=a(9504),_=a(456),S=a(4725),x=a(8460),d=a(844),u=a(6114),c=a(4841),h=a(511),m=a(2585),w=" ",C=new RegExp(w,"g");let E=o.SelectionService=class extends d.Disposable{constructor(b,k,R,L,P,B,H,z,J){super(),this._element=b,this._screenElement=k,this._linkifier=R,this._bufferService=L,this._coreService=P,this._mouseService=B,this._optionsService=H,this._renderService=z,this._coreBrowserService=J,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!b||!k||b[0]===k[0]&&b[1]===k[1])}get selectionText(){const b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!b||!k)return"";const R=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(b[0]===k[0])return"";const P=b[0]<k[0]?b[0]:k[0],B=b[0]<k[0]?k[0]:b[0];for(let H=b[1];H<=k[1];H++){const z=R.translateBufferLineToString(H,!0,P,B);L.push(z)}}else{const P=b[1]===k[1]?k[0]:void 0;L.push(R.translateBufferLineToString(b[1],!0,b[0],P));for(let B=b[1]+1;B<=k[1]-1;B++){const H=R.lines.get(B),z=R.translateBufferLineToString(B,!0);H!=null&&H.isWrapped?L[L.length-1]+=z:L.push(z)}if(b[1]!==k[1]){const B=R.lines.get(k[1]),H=R.translateBufferLineToString(k[1],!0,0,k[0]);B&&B.isWrapped?L[L.length-1]+=H:L.push(H)}}return L.map(P=>P.replace(C," ")).join(u.isWindows?`\r
|
|
53
|
+
`:`
|
|
54
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),u.isLinux&&b&&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(b){const k=this._getMouseBufferCoords(b),R=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(R&&L&&k)&&this._areCoordsInSelection(k,R,L)}isCellInSelection(b,k){const R=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!R||!L)&&this._areCoordsInSelection([b,k],R,L)}_areCoordsInSelection(b,k,R){return b[1]>k[1]&&b[1]<R[1]||k[1]===R[1]&&b[1]===k[1]&&b[0]>=k[0]&&b[0]<R[0]||k[1]<R[1]&&b[1]===R[1]&&b[0]<R[0]||k[1]<R[1]&&b[1]===k[1]&&b[0]>=k[0]}_selectWordAtCursor(b,k){var R,L;const P=(L=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||L===void 0?void 0:L.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,c.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(b);return!!B&&(this._selectWordAt(B,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,k){this._model.clearSelection(),b=Math.max(b,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const k=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(b){let k=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(b){return u.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const k=this._getMouseBufferCoords(b);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(b){return b.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),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 L=R.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const k=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const L=(0,v.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!b||!k||b[0]===k[0]&&b[1]===k[1]);R?b&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(b,k,R)}_fireOnSelectionChange(b,k,R){this._oldSelectionStart=b,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(b,k){let R=k;for(let L=0;k>=L;L++){const P=b.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:P>1&&k!==L&&(R+=P-1)}return R}setSelection(b,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,k,R=!0,L=!0){if(b[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,B=P.lines.get(b[1]);if(!B)return;const H=P.translateBufferLineToString(b[1],!1);let z=this._convertViewportColToCharacterIndex(B,b[0]),J=z;const U=b[0]-z;let j=0,D=0,M=0,A=0;if(H.charAt(z)===" "){for(;z>0&&H.charAt(z-1)===" ";)z--;for(;J<H.length&&H.charAt(J+1)===" ";)J++}else{let G=b[0],X=b[0];B.getWidth(G)===0&&(j++,G--),B.getWidth(X)===2&&(D++,X++);const K=B.getString(X).length;for(K>1&&(A+=K-1,J+=K-1);G>0&&z>0&&!this._isCharWordSeparator(B.loadCell(G-1,this._workCell));){B.loadCell(G-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,G--):T>1&&(M+=T-1,z-=T-1),z--,G--}for(;X<B.length&&J+1<H.length&&!this._isCharWordSeparator(B.loadCell(X+1,this._workCell));){B.loadCell(X+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,X++):T>1&&(A+=T-1,J+=T-1),J++,X++}}J++;let F=z+U-j+M,q=Math.min(this._bufferService.cols,J-z+j+D-M-A);if(k||H.slice(z,J).trim()!==""){if(R&&F===0&&B.getCodePoint(0)!==32){const G=P.lines.get(b[1]-1);if(G&&B.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(X){const K=this._bufferService.cols-X.start;F-=K,q+=K}}}if(L&&F+q===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const G=P.lines.get(b[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const X=this._getWordAt([0,b[1]+1],!1,!1,!0);X&&(q+=X.length)}}return{start:F,length:q}}}_selectWordAt(b,k){const R=this._getWordAt(b,k);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[R.start,b[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(b){const k=this._getWordAt(b,!0);if(k){let R=b[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const k=this._bufferService.buffer.getWrappedRangeForLine(b),R={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,c.getRangeLength)(R,this._bufferService.cols)}};o.SelectionService=E=f([y(3,m.IBufferService),y(4,m.ICoreService),y(5,S.IMouseService),y(6,m.IOptionsService),y(7,S.IRenderService),y(8,S.ICoreBrowserService)],E)},4725:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=a(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(g,o,a){var f=this&&this.__decorate||function(E,b,k,R){var L,P=arguments.length,B=P<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(E,b,k,R);else for(var H=E.length-1;H>=0;H--)(L=E[H])&&(B=(P<3?L(B):P>3?L(b,k,B):L(b,k))||B);return P>3&&B&&Object.defineProperty(b,k,B),B},y=this&&this.__param||function(E,b){return function(k,R){b(k,R,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const p=a(7239),v=a(8055),_=a(8460),S=a(844),x=a(2585),d=v.css.toColor("#ffffff"),u=v.css.toColor("#000000"),c=v.css.toColor("#ffffff"),h=v.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=b[k/36%6|0],L=b[k/6%6|0],P=b[k%6];E.push({css:v.channels.toCss(R,L,P),rgba:v.channels.toRgba(R,L,P)})}for(let k=0;k<24;k++){const R=8+10*k;E.push({css:v.channels.toCss(R,R,R),rgba:v.channels.toRgba(R,R,R)})}return E})());let w=o.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:u,cursor:c,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:v.color.blend(u,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:v.color.blend(u,m),ansi:o.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 b=this._colors;if(b.foreground=C(E.foreground,d),b.background=C(E.background,u),b.cursor=C(E.cursor,c),b.cursorAccent=C(E.cursorAccent,h),b.selectionBackgroundTransparent=C(E.selectionBackground,m),b.selectionBackgroundOpaque=v.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=C(E.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=v.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=E.selectionForeground?C(E.selectionForeground,v.NULL_COLOR):void 0,b.selectionForeground===v.NULL_COLOR&&(b.selectionForeground=void 0),v.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=v.color.opacity(b.selectionBackgroundTransparent,.3)),v.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=v.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=o.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=C(E.black,o.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=C(E.red,o.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=C(E.green,o.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=C(E.yellow,o.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=C(E.blue,o.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=C(E.magenta,o.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=C(E.cyan,o.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=C(E.white,o.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=C(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=C(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=C(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=C(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=C(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=C(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=C(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=C(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const k=Math.min(b.ansi.length-16,E.extendedAnsi.length);for(let R=0;R<k;R++)b.ansi[R+16]=C(E.extendedAnsi[R],o.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 b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}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 C(E,b){if(E!==void 0)try{return v.css.toColor(E)}catch{}return b}o.ThemeService=w=f([y(0,x.IOptionsService)],w)},6349:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=a(8460),y=a(844);class p extends y.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(_){if(this._maxLength===_)return;const S=new Array(_);for(let x=0;x<Math.min(_,this.length);x++)S[x]=this._array[this._getCyclicIndex(x)];this._array=S,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let S=this._length;S<_;S++)this._array[S]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,S){this._array[this._getCyclicIndex(_)]=S}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,S,...x){if(S){for(let d=_;d<this._length-S;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+S)];this._length-=S,this.onDeleteEmitter.fire({index:_,amount:S})}for(let d=this._length-1;d>=_;d--)this._array[this._getCyclicIndex(d+x.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<x.length;d++)this._array[this._getCyclicIndex(_+d)]=x[d];if(x.length&&this.onInsertEmitter.fire({index:_,amount:x.length}),this._length+x.length>this._maxLength){const d=this._length+x.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=x.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,S,x){if(!(S<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let u=S-1;u>=0;u--)this.set(_+u+x,this.get(_+u));const d=_+S+x-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<S;d++)this.set(_+d+x,this.get(_+d))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}o.CircularList=p},1439:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function a(f,y=5){if(typeof f!="object")return f;const p=Array.isArray(f)?[]:{};for(const v in f)p[v]=y<=1?f[v]:f[v]&&a(f[v],y-1);return p}},8055:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;const f=a(6114);let y=0,p=0,v=0,_=0;var S,x,d,u,c;function h(w){const C=w.toString(16);return C.length<2?"0"+C:C}function m(w,C){return w<C?(C+.05)/(w+.05):(w+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(w){w.toCss=function(C,E,b,k){return k!==void 0?`#${h(C)}${h(E)}${h(b)}${h(k)}`:`#${h(C)}${h(E)}${h(b)}`},w.toRgba=function(C,E,b,k=255){return(C<<24|E<<16|b<<8|k)>>>0}}(S||(o.channels=S={})),function(w){function C(E,b){return _=Math.round(255*b),[y,p,v]=c.toChannels(E.rgba),{css:S.toCss(y,p,v,_),rgba:S.toRgba(y,p,v,_)}}w.blend=function(E,b){if(_=(255&b.rgba)/255,_===1)return{css:b.css,rgba:b.rgba};const k=b.rgba>>24&255,R=b.rgba>>16&255,L=b.rgba>>8&255,P=E.rgba>>24&255,B=E.rgba>>16&255,H=E.rgba>>8&255;return y=P+Math.round((k-P)*_),p=B+Math.round((R-B)*_),v=H+Math.round((L-H)*_),{css:S.toCss(y,p,v),rgba:S.toRgba(y,p,v)}},w.isOpaque=function(E){return(255&E.rgba)==255},w.ensureContrastRatio=function(E,b,k){const R=c.ensureContrastRatio(E.rgba,b.rgba,k);if(R)return c.toColor(R>>24&255,R>>16&255,R>>8&255)},w.opaque=function(E){const b=(255|E.rgba)>>>0;return[y,p,v]=c.toChannels(b),{css:S.toCss(y,p,v),rgba:b}},w.opacity=C,w.multiplyOpacity=function(E,b){return _=255&E.rgba,C(E,_*b/255)},w.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(x||(o.color=x={})),function(w){let C,E;if(!f.isNode){const b=document.createElement("canvas");b.width=1,b.height=1;const k=b.getContext("2d",{willReadFrequently:!0});k&&(C=k,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}w.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return y=parseInt(b.slice(1,2).repeat(2),16),p=parseInt(b.slice(2,3).repeat(2),16),v=parseInt(b.slice(3,4).repeat(2),16),c.toColor(y,p,v);case 5:return y=parseInt(b.slice(1,2).repeat(2),16),p=parseInt(b.slice(2,3).repeat(2),16),v=parseInt(b.slice(3,4).repeat(2),16),_=parseInt(b.slice(4,5).repeat(2),16),c.toColor(y,p,v,_);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const k=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return y=parseInt(k[1]),p=parseInt(k[2]),v=parseInt(k[3]),_=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),c.toColor(y,p,v,_);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=b,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[y,p,v,_]=C.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(y,p,v,_),css:b}}}(d||(o.css=d={})),function(w){function C(E,b,k){const R=E/255,L=b/255,P=k/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}w.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},w.relativeLuminance2=C}(u||(o.rgb=u={})),function(w){function C(b,k,R){const L=b>>24&255,P=b>>16&255,B=b>>8&255;let H=k>>24&255,z=k>>16&255,J=k>>8&255,U=m(u.relativeLuminance2(H,z,J),u.relativeLuminance2(L,P,B));for(;U<R&&(H>0||z>0||J>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),J-=Math.max(0,Math.ceil(.1*J)),U=m(u.relativeLuminance2(H,z,J),u.relativeLuminance2(L,P,B));return(H<<24|z<<16|J<<8|255)>>>0}function E(b,k,R){const L=b>>24&255,P=b>>16&255,B=b>>8&255;let H=k>>24&255,z=k>>16&255,J=k>>8&255,U=m(u.relativeLuminance2(H,z,J),u.relativeLuminance2(L,P,B));for(;U<R&&(H<255||z<255||J<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),J=Math.min(255,J+Math.ceil(.1*(255-J))),U=m(u.relativeLuminance2(H,z,J),u.relativeLuminance2(L,P,B));return(H<<24|z<<16|J<<8|255)>>>0}w.ensureContrastRatio=function(b,k,R){const L=u.relativeLuminance(b>>8),P=u.relativeLuminance(k>>8);if(m(L,P)<R){if(P<L){const z=C(b,k,R),J=m(L,u.relativeLuminance(z>>8));if(J<R){const U=E(b,k,R);return J>m(L,u.relativeLuminance(U>>8))?z:U}return z}const B=E(b,k,R),H=m(L,u.relativeLuminance(B>>8));if(H<R){const z=C(b,k,R);return H>m(L,u.relativeLuminance(z>>8))?B:z}return B}},w.reduceLuminance=C,w.increaseLuminance=E,w.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]},w.toColor=function(b,k,R,L){return{css:S.toCss(b,k,R,L),rgba:S.toRgba(b,k,R,L)}}}(c||(o.rgba=c={})),o.toPaddedHex=h,o.contrastRatio=m},8969:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=a(844),y=a(2585),p=a(4348),v=a(7866),_=a(744),S=a(7302),x=a(6975),d=a(8460),u=a(1753),c=a(1480),h=a(7994),m=a(9282),w=a(5435),C=a(5981),E=a(2660);let b=!1;class k extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event(L=>{var P;(P=this._onScrollApi)===null||P===void 0||P.fire(L.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(L){for(const P in L)this.optionsService.options[P]=L[P]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new S.OptionsService(L)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(c.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(y.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,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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(P=>{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(P=>{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 C.WriteBuffer((P,B)=>this._inputHandler.parse(P,B))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,P){this._writeBuffer.write(L,P)}writeSync(L,P){this._logService.logLevel<=y.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(L,P)}resize(L,P){isNaN(L)||isNaN(P)||(L=Math.max(L,_.MINIMUM_COLS),P=Math.max(P,_.MINIMUM_ROWS),this._bufferService.resize(L,P))}scroll(L,P=!1){this._bufferService.scroll(L,P)}scrollLines(L,P,B){this._bufferService.scrollLines(L,P,B)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const P=L-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(L,P){return this._inputHandler.registerEscHandler(L,P)}registerDcsHandler(L,P){return this._inputHandler.registerDcsHandler(L,P)}registerCsiHandler(L,P){return this._inputHandler.registerCsiHandler(L,P)}registerOscHandler(L,P){return this._inputHandler.registerOscHandler(L,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?L=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const P of L)P.dispose()})}}}o.CoreTerminal=k},8460:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===a)return void this._listeners.splice(f,1)}}})),this._event}fire(a,f){const y=[];for(let p=0;p<this._listeners.length;p++)y.push(this._listeners[p]);for(let p=0;p<y.length;p++)y[p].call(void 0,a,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(a,f){return a(y=>f.fire(y))}},5435:function(g,o,a){var f=this&&this.__decorate||function(U,j,D,M){var A,F=arguments.length,q=F<3?j:M===null?M=Object.getOwnPropertyDescriptor(j,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(U,j,D,M);else for(var G=U.length-1;G>=0;G--)(A=U[G])&&(q=(F<3?A(q):F>3?A(j,D,q):A(j,D))||q);return F>3&&q&&Object.defineProperty(j,D,q),q},y=this&&this.__param||function(U,j){return function(D,M){j(D,M,U)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const p=a(2584),v=a(7116),_=a(2015),S=a(844),x=a(482),d=a(8437),u=a(8460),c=a(643),h=a(511),m=a(3734),w=a(2585),C=a(6242),E=a(6351),b=a(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function L(U,j){if(U>24)return j.setWinLines||!1;switch(U){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var P;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let B=0;class H extends S.Disposable{getAttrData(){return this._curAttrData}constructor(j,D,M,A,F,q,G,X,K=new _.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=D,this._coreService=M,this._logService=A,this._optionsService=F,this._oscLinkService=q,this._coreMouseService=G,this._unicodeService=X,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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(T=>this._activeBuffer=T.activeBuffer)),this._parser.setCsiHandlerFallback((T,N)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(T),params:N.toArray()})}),this._parser.setEscHandlerFallback(T=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(T)})}),this._parser.setExecuteHandlerFallback(T=>{this._logService.debug("Unknown EXECUTE code: ",{code:T})}),this._parser.setOscHandlerFallback((T,N,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:T,action:N,data:W})}),this._parser.setDcsHandlerFallback((T,N,W)=>{N==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(T),action:N,payload:W})}),this._parser.setPrintHandler((T,N,W)=>this.print(T,N,W)),this._parser.registerCsiHandler({final:"@"},T=>this.insertChars(T)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},T=>this.scrollLeft(T)),this._parser.registerCsiHandler({final:"A"},T=>this.cursorUp(T)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},T=>this.scrollRight(T)),this._parser.registerCsiHandler({final:"B"},T=>this.cursorDown(T)),this._parser.registerCsiHandler({final:"C"},T=>this.cursorForward(T)),this._parser.registerCsiHandler({final:"D"},T=>this.cursorBackward(T)),this._parser.registerCsiHandler({final:"E"},T=>this.cursorNextLine(T)),this._parser.registerCsiHandler({final:"F"},T=>this.cursorPrecedingLine(T)),this._parser.registerCsiHandler({final:"G"},T=>this.cursorCharAbsolute(T)),this._parser.registerCsiHandler({final:"H"},T=>this.cursorPosition(T)),this._parser.registerCsiHandler({final:"I"},T=>this.cursorForwardTab(T)),this._parser.registerCsiHandler({final:"J"},T=>this.eraseInDisplay(T,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},T=>this.eraseInDisplay(T,!0)),this._parser.registerCsiHandler({final:"K"},T=>this.eraseInLine(T,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},T=>this.eraseInLine(T,!0)),this._parser.registerCsiHandler({final:"L"},T=>this.insertLines(T)),this._parser.registerCsiHandler({final:"M"},T=>this.deleteLines(T)),this._parser.registerCsiHandler({final:"P"},T=>this.deleteChars(T)),this._parser.registerCsiHandler({final:"S"},T=>this.scrollUp(T)),this._parser.registerCsiHandler({final:"T"},T=>this.scrollDown(T)),this._parser.registerCsiHandler({final:"X"},T=>this.eraseChars(T)),this._parser.registerCsiHandler({final:"Z"},T=>this.cursorBackwardTab(T)),this._parser.registerCsiHandler({final:"`"},T=>this.charPosAbsolute(T)),this._parser.registerCsiHandler({final:"a"},T=>this.hPositionRelative(T)),this._parser.registerCsiHandler({final:"b"},T=>this.repeatPrecedingCharacter(T)),this._parser.registerCsiHandler({final:"c"},T=>this.sendDeviceAttributesPrimary(T)),this._parser.registerCsiHandler({prefix:">",final:"c"},T=>this.sendDeviceAttributesSecondary(T)),this._parser.registerCsiHandler({final:"d"},T=>this.linePosAbsolute(T)),this._parser.registerCsiHandler({final:"e"},T=>this.vPositionRelative(T)),this._parser.registerCsiHandler({final:"f"},T=>this.hVPosition(T)),this._parser.registerCsiHandler({final:"g"},T=>this.tabClear(T)),this._parser.registerCsiHandler({final:"h"},T=>this.setMode(T)),this._parser.registerCsiHandler({prefix:"?",final:"h"},T=>this.setModePrivate(T)),this._parser.registerCsiHandler({final:"l"},T=>this.resetMode(T)),this._parser.registerCsiHandler({prefix:"?",final:"l"},T=>this.resetModePrivate(T)),this._parser.registerCsiHandler({final:"m"},T=>this.charAttributes(T)),this._parser.registerCsiHandler({final:"n"},T=>this.deviceStatus(T)),this._parser.registerCsiHandler({prefix:"?",final:"n"},T=>this.deviceStatusPrivate(T)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},T=>this.softReset(T)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},T=>this.setCursorStyle(T)),this._parser.registerCsiHandler({final:"r"},T=>this.setScrollRegion(T)),this._parser.registerCsiHandler({final:"s"},T=>this.saveCursor(T)),this._parser.registerCsiHandler({final:"t"},T=>this.windowOptions(T)),this._parser.registerCsiHandler({final:"u"},T=>this.restoreCursor(T)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},T=>this.insertColumns(T)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},T=>this.deleteColumns(T)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},T=>this.selectProtected(T)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},T=>this.requestMode(T,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},T=>this.requestMode(T,!1)),this._parser.setExecuteHandler(p.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(p.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(p.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(p.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(p.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(p.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(p.C1.IND,()=>this.index()),this._parser.setExecuteHandler(p.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(p.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(T=>(this.setTitle(T),this.setIconName(T),!0))),this._parser.registerOscHandler(1,new C.OscHandler(T=>this.setIconName(T))),this._parser.registerOscHandler(2,new C.OscHandler(T=>this.setTitle(T))),this._parser.registerOscHandler(4,new C.OscHandler(T=>this.setOrReportIndexedColor(T))),this._parser.registerOscHandler(8,new C.OscHandler(T=>this.setHyperlink(T))),this._parser.registerOscHandler(10,new C.OscHandler(T=>this.setOrReportFgColor(T))),this._parser.registerOscHandler(11,new C.OscHandler(T=>this.setOrReportBgColor(T))),this._parser.registerOscHandler(12,new C.OscHandler(T=>this.setOrReportCursorColor(T))),this._parser.registerOscHandler(104,new C.OscHandler(T=>this.restoreIndexedColor(T))),this._parser.registerOscHandler(110,new C.OscHandler(T=>this.restoreFgColor(T))),this._parser.registerOscHandler(111,new C.OscHandler(T=>this.restoreBgColor(T))),this._parser.registerOscHandler(112,new C.OscHandler(T=>this.restoreCursorColor(T))),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 T in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:T},()=>this.selectCharset("("+T)),this._parser.registerEscHandler({intermediates:")",final:T},()=>this.selectCharset(")"+T)),this._parser.registerEscHandler({intermediates:"*",final:T},()=>this.selectCharset("*"+T)),this._parser.registerEscHandler({intermediates:"+",final:T},()=>this.selectCharset("+"+T)),this._parser.registerEscHandler({intermediates:"-",final:T},()=>this.selectCharset("-"+T)),this._parser.registerEscHandler({intermediates:".",final:T},()=>this.selectCharset("."+T)),this._parser.registerEscHandler({intermediates:"/",final:T},()=>this.selectCharset("/"+T));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(T=>(this._logService.error("Parsing error: ",T),T)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((T,N)=>this.requestStatusString(T,N)))}_preserveStack(j,D,M,A){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=M,this._parseStack.position=A}_logSlowResolvingAsync(j){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([j,new Promise((D,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,D){let M,A=this._activeBuffer.x,F=this._activeBuffer.y,q=0;const G=this._parseStack.paused;if(G){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(M),M;A=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>R&&(q=this._parseStack.position+R)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,X=>String.fromCharCode(X)).join("")}"`),typeof j=="string"?j.split("").map(X=>X.charCodeAt(0)):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(j.length,R))),G||this._dirtyRowTracker.clearRange(),j.length>R)for(let X=q;X<j.length;X+=R){const K=X+R<j.length?X+R:j.length,T=typeof j=="string"?this._stringDecoder.decode(j.substring(X,K),this._parseBuffer):this._utf8Decoder.decode(j.subarray(X,K),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,T))return this._preserveStack(A,F,T,X),this._logSlowResolvingAsync(M),M}else if(!G){const X=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,X))return this._preserveStack(A,F,X,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===A&&this._activeBuffer.y===F||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(j,D,M){let A,F;const q=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,T=this._coreService.modes.insertMode,N=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-D>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,N.fg,N.bg,N.extended);for(let $=D;$<M;++$){if(A=j[$],F=this._unicodeService.wcwidth(A),A<127&&q){const ne=q[String.fromCharCode(A)];ne&&(A=ne.charCodeAt(0))}if(G&&this._onA11yChar.fire((0,x.stringFromCodePoint)(A)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),F||!this._activeBuffer.x){if(this._activeBuffer.x+F-1>=X){if(K){for(;this._activeBuffer.x<X;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,N.fg,N.bg,N.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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,F===2)continue}if(T&&(W.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(N),N),W.getWidth(X-1)===2&&W.setCellFromCodePoint(X-1,c.NULL_CELL_CODE,c.NULL_CELL_WIDTH,N.fg,N.bg,N.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,A,F,N.fg,N.bg,N.extended),F>0)for(;--F;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,N.fg,N.bg,N.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,A):W.addCodepointToCell(this._activeBuffer.x-2,A)}M-D>0&&(W.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<X&&M-D>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,N.fg,N.bg,N.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,D){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,D):this._parser.registerCsiHandler(j,M=>!L(M.params[0],this._optionsService.rawOptions.windowOptions)||D(M))}registerDcsHandler(j,D){return this._parser.registerDcsHandler(j,new E.DcsHandler(D))}registerEscHandler(j,D){return this._parser.registerEscHandler(j,D)}registerOscHandler(j,D){return this._parser.registerOscHandler(j,new C.OscHandler(D))}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 j;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&&(!((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||j===void 0)&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=j,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+D)}cursorUp(j){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const D=j.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=j.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=j.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const D=j.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,D,M,A=!1,F=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);q.replaceCells(D,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),F),A&&(q.isWrapped=!1)}_resetBufferLine(j,D=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),M.isWrapped=!1)}eraseInDisplay(j,D=!1){let M;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);M<this._bufferService.rows;M++)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 3:const A=this._activeBuffer.lines.length-this._bufferService.rows;A>0&&(this._activeBuffer.lines.trimStart(A),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-A,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-A,0),this._onScroll.fire(0))}return!0}eraseInLine(j,D=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let D=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-A+1;for(;D--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let D=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let A;for(A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,A=this._bufferService.rows-1+this._activeBuffer.ybase-A;D--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let D=j.params[0]||1;for(;D--;)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(j){let D=j.params[0]||1;for(;D--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);A.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);A.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);A.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);A.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){if(!this._parser.precedingCodepoint)return!0;const D=j.params[0]||1,M=new Uint32Array(D);for(let A=0;A<D;++A)M[A]=this._parser.precedingCodepoint;return this.print(M,0,M.length),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let D=0;D<j.length;D++)switch(j.params[D]){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(),j.params[D]===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(j,D){const M=this._coreService.decPrivateModes,{activeProtocol:A,activeEncoding:F}=this._coreMouseService,q=this._coreService,{buffers:G,cols:X}=this._bufferService,{active:K,alt:T}=G,N=this._optionsService.rawOptions,W=ie=>ie?1:2,$=j.params[0];return ne=$,Q=D?$===2?4:$===4?W(q.modes.insertMode):$===12?3:$===20?W(N.convertEol):0:$===1?W(M.applicationCursorKeys):$===3?N.windowOptions.setWinLines?X===80?2:X===132?1:0:0:$===6?W(M.origin):$===7?W(M.wraparound):$===8?3:$===9?W(A==="X10"):$===12?W(N.cursorBlink):$===25?W(!q.isCursorHidden):$===45?W(M.reverseWraparound):$===66?W(M.applicationKeypad):$===67?4:$===1e3?W(A==="VT200"):$===1002?W(A==="DRAG"):$===1003?W(A==="ANY"):$===1004?W(M.sendFocus):$===1005?4:$===1006?W(F==="SGR"):$===1015?4:$===1016?W(F==="SGR_PIXELS"):$===1048?1:$===47||$===1047||$===1049?W(K===T):$===2004?W(M.bracketedPasteMode):0,q.triggerDataEvent(`${p.C0.ESC}[${D?"":"?"}${ne};${Q}$y`),!0;var ne,Q}_updateAttrColor(j,D,M,A,F){return D===2?(j|=50331648,j&=-16777216,j|=m.AttributeData.fromColorRGB([M,A,F])):D===5&&(j&=-50331904,j|=33554432|255&M),j}_extractColor(j,D,M){const A=[0,0,-1,0,0,0];let F=0,q=0;do{if(A[q+F]=j.params[D+q],j.hasSubParams(D+q)){const G=j.getSubParams(D+q);let X=0;do A[1]===5&&(F=1),A[q+X+1+F]=G[X];while(++X<G.length&&X+q+1+F<A.length);break}if(A[1]===5&&q+F>=2||A[1]===2&&q+F>=5)break;A[1]&&(F=1)}while(++q+D<j.length&&q+F<A.length);for(let G=2;G<A.length;++G)A[G]===-1&&(A[G]=0);switch(A[0]){case 38:M.fg=this._updateAttrColor(M.fg,A[1],A[3],A[4],A[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,A[1],A[3],A[4],A[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,A[1],A[3],A[4],A[5])}return q}_processUnderline(j,D){D.extended=D.extended.clone(),(!~j||j>5)&&(j=1),D.extended.underlineStyle=j,D.fg|=268435456,j===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(j){j.fg=d.DEFAULT_ATTR_DATA.fg,j.bg=d.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=j.length;let M;const A=this._curAttrData;for(let F=0;F<D;F++)M=j.params[F],M>=30&&M<=37?(A.fg&=-50331904,A.fg|=16777216|M-30):M>=40&&M<=47?(A.bg&=-50331904,A.bg|=16777216|M-40):M>=90&&M<=97?(A.fg&=-50331904,A.fg|=16777224|M-90):M>=100&&M<=107?(A.bg&=-50331904,A.bg|=16777224|M-100):M===0?this._processSGR0(A):M===1?A.fg|=134217728:M===3?A.bg|=67108864:M===4?(A.fg|=268435456,this._processUnderline(j.hasSubParams(F)?j.getSubParams(F)[0]:1,A)):M===5?A.fg|=536870912:M===7?A.fg|=67108864:M===8?A.fg|=1073741824:M===9?A.fg|=2147483648:M===2?A.bg|=134217728:M===21?this._processUnderline(2,A):M===22?(A.fg&=-134217729,A.bg&=-134217729):M===23?A.bg&=-67108865:M===24?(A.fg&=-268435457,this._processUnderline(0,A)):M===25?A.fg&=-536870913:M===27?A.fg&=-67108865:M===28?A.fg&=-1073741825:M===29?A.fg&=2147483647:M===39?(A.fg&=-67108864,A.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):M===49?(A.bg&=-67108864,A.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?F+=this._extractColor(j,F,A):M===53?A.bg|=1073741824:M===55?A.bg&=-1073741825:M===59?(A.extended=A.extended.clone(),A.extended.underlineColor=-1,A.updateExtended()):M===100?(A.fg&=-67108864,A.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,A.bg&=-67108864,A.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${D};${M}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${D};${M}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(j){const D=j.params[0]||1;switch(D){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 M=D%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(j){const D=j.params[0]||1;let M;return(j.length<2||(M=j.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(j){if(!L(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const D=[],M=j.split(";");for(;M.length>1;){const A=M.shift(),F=M.shift();if(/^\d+$/.exec(A)){const q=parseInt(A);if(J(q))if(F==="?")D.push({type:0,index:q});else{const G=(0,b.parseColor)(F);G&&D.push({type:1,index:q,color:G})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(j){const D=j.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(j,D){this._getCurrentLinkId()&&this._finishHyperlink();const M=j.split(":");let A;const F=M.findIndex(q=>q.startsWith("id="));return F!==-1&&(A=M[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:A,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,D){const M=j.split(";");for(let A=0;A<M.length&&!(D>=this._specialColors.length);++A,++D)if(M[A]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const F=(0,b.parseColor)(M[A]);F&&this._onColor.fire([{type:1,index:this._specialColors[D],color:F}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const D=[],M=j.split(";");for(let A=0;A<M.length;++A)if(/^\d+$/.exec(M[A])){const F=parseInt(M[A]);J(F)&&D.push({type:2,index:F})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,v.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(k[j[0]],v.CHARSETS[j[1]]||v.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new h.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const M=this._activeBuffer.ybase+this._activeBuffer.y+D,A=this._activeBuffer.lines.get(M);A&&(A.fill(j),A.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,D){const M=this._bufferService.buffer,A=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${F}${p.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[A.cursorStyle]-(A.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,D){this._dirtyRowTracker.markRangeDirty(j,D)}}o.InputHandler=H;let z=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,j){U>j&&(B=U,U=j,j=B),U<this.start&&(this.start=U),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(U){return 0<=U&&U<256}z=f([y(0,w.IBufferService)],z)},844:(g,o)=>{function a(f){for(const y of f)y.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const y=this._disposables.indexOf(f);y!==-1&&this._disposables.splice(y,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var y;this._isDisposed||f===this._value||((y=this._value)===null||y===void 0||y.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=a,o.getDisposeArrayDisposable=function(f){return{dispose:()=>a(f)}}},1505:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(y,p,v){this._data[y]||(this._data[y]={}),this._data[y][p]=v}get(y,p){return this._data[y]?this._data[y][p]:void 0}clear(){this._data={}}}o.TwoKeyMap=a,o.FourKeyMap=class{constructor(){this._data=new a}set(f,y,p,v,_){this._data.get(f,y)||this._data.set(f,y,new a),this._data.get(f,y).set(p,v,_)}get(f,y,p,v){var _;return(_=this._data.get(f,y))===null||_===void 0?void 0:_.get(p,v)}clear(){this._data.clear()}}},6114:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof navigator>"u";const a=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=a.includes("Firefox"),o.isLegacyEdge=a.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(a),o.getSafariVersion=function(){if(!o.isSafari)return 0;const y=a.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(a)},6106:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let a=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(a=this._search(this._getKey(f)),this._array.splice(a,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const y=this._getKey(f);if(y===void 0||(a=this._search(y),a===-1)||this._getKey(this._array[a])!==y)return!1;do if(this._array[a]===f)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===y);return!1}*getKeyIterator(f){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===f)}forEachByKey(f,y){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do y(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===f)}values(){return[...this._array].values()}_search(f){let y=0,p=this._array.length-1;for(;p>=y;){let v=y+p>>1;const _=this._getKey(this._array[v]);if(_>f)p=v-1;else{if(!(_<f)){for(;v>0&&this._getKey(this._array[v-1])===f;)v--;return v}y=v+1}}return y}}},7226:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=a(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let S=0,x=0,d=_.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),x=Math.max(S,x),u=_.timeRemaining(),1.5*x>u)return d-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-S))}ms`),void this._start();d=u}this.clear()}}class p extends y{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const S=Date.now()+_;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}o.PriorityTaskQueue=p,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:p,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=a(643);o.updateWindowsModeWrappedState=function(y){const p=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),v=p==null?void 0:p.get(y.cols-1),_=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);_&&v&&(_.isWrapped=v[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&v[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new a;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}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}}o.AttributeData=a;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}constructor(p=0,v=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=v}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=a(6349),y=a(7226),p=a(3734),v=a(8437),_=a(4634),S=a(511),x=a(643),d=a(4863),u=a(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(c,h,m){this._hasScrollback=c,this._optionsService=h,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(c){return c?(this._nullCell.fg=c.fg,this._nullCell.bg=c.bg,this._nullCell.extended=c.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(c){return c?(this._whitespaceCell.fg=c.fg,this._whitespaceCell.bg=c.bg,this._whitespaceCell.extended=c.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(c,h){return new v.BufferLine(this._bufferService.cols,this.getNullCell(c),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const c=this.ybase+this.y-this.ydisp;return c>=0&&c<this._rows}_getCorrectBufferLength(c){if(!this._hasScrollback)return c;const h=c+this._optionsService.rawOptions.scrollback;return h>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:h}fillViewportRows(c){if(this.lines.length===0){c===void 0&&(c=v.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(c))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(c,h){const m=this.getNullCell(v.DEFAULT_ATTR_DATA);let w=0;const C=this._getCorrectBufferLength(h);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<c)for(let b=0;b<this.lines.length;b++)w+=+this.lines.get(b).resize(c,m);let E=0;if(this._rows<h)for(let b=this._rows;b<h;b++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(c,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(c,m)));else for(let b=this._rows;b>h;b--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const b=this.lines.length-C;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=C}this.x=Math.min(this.x,c-1),this.y=Math.min(this.y,h-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,c-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(c,h),this._cols>c))for(let E=0;E<this.lines.length;E++)w+=+this.lines.get(E).resize(c,m);this._cols=c,this._rows=h,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let c=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,c=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return c}get _isReflowEnabled(){const c=this._optionsService.rawOptions.windowsPty;return c&&c.buildNumber?this._hasScrollback&&c.backend==="conpty"&&c.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(c,h){this._cols!==c&&(c>this._cols?this._reflowLarger(c,h):this._reflowSmaller(c,h))}_reflowLarger(c,h){const m=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,c,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(m.length>0){const w=(0,_.reflowLargerCreateNewLayout)(this.lines,m);(0,_.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(c,h,w.countRemoved)}}_reflowLargerAdjustViewport(c,h,m){const w=this.getNullCell(v.DEFAULT_ATTR_DATA);let C=m;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new v.BufferLine(c,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(c,h){const m=this.getNullCell(v.DEFAULT_ATTR_DATA),w=[];let C=0;for(let E=this.lines.length-1;E>=0;E--){let b=this.lines.get(E);if(!b||!b.isWrapped&&b.getTrimmedLength()<=c)continue;const k=[b];for(;b.isWrapped&&E>0;)b=this.lines.get(--E),k.unshift(b);const R=this.ybase+this.y;if(R>=E&&R<E+k.length)continue;const L=k[k.length-1].getTrimmedLength(),P=(0,_.reflowSmallerGetNewLineLengths)(k,this._cols,c),B=P.length-k.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const z=[];for(let A=0;A<B;A++){const F=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);z.push(F)}z.length>0&&(w.push({start:E+k.length+C,newLines:z}),C+=z.length),k.push(...z);let J=P.length-1,U=P[J];U===0&&(J--,U=P[J]);let j=k.length-B-1,D=L;for(;j>=0;){const A=Math.min(D,U);if(k[J]===void 0)break;if(k[J].copyCellsFrom(k[j],D-A,U-A,A,!0),U-=A,U===0&&(J--,U=P[J]),D-=A,D===0){j--;const F=Math.max(j,0);D=(0,_.getWrappedLineTrimmedLength)(k,F,this._cols)}}for(let A=0;A<k.length;A++)P[A]<c&&k[A].setCell(P[A],m);let M=B-H;for(;M-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+h-1)}if(w.length>0){const E=[],b=[];for(let J=0;J<this.lines.length;J++)b.push(this.lines.get(J));const k=this.lines.length;let R=k-1,L=0,P=w[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let B=0;for(let J=Math.min(this.lines.maxLength-1,k+C-1);J>=0;J--)if(P&&P.start>R+B){for(let U=P.newLines.length-1;U>=0;U--)this.lines.set(J--,P.newLines[U]);J++,E.push({index:R+1,amount:P.newLines.length}),B+=P.newLines.length,P=w[++L]}else this.lines.set(J,b[R--]);let H=0;for(let J=E.length-1;J>=0;J--)E[J].index+=H,this.lines.onInsertEmitter.fire(E[J]),H+=E[J].amount;const z=Math.max(0,k+C-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(c,h,m=0,w){const C=this.lines.get(c);return C?C.translateToString(h,m,w):""}getWrappedRangeForLine(c){let h=c,m=c;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:h,last:m}}setupTabStops(c){for(c!=null?this.tabs[c]||(c=this.prevStop(c)):(this.tabs={},c=0);c<this._cols;c+=this._optionsService.rawOptions.tabStopWidth)this.tabs[c]=!0}prevStop(c){for(c==null&&(c=this.x);!this.tabs[--c]&&c>0;);return c>=this._cols?this._cols-1:c<0?0:c}nextStop(c){for(c==null&&(c=this.x);!this.tabs[++c]&&c<this._cols;);return c>=this._cols?this._cols-1:c<0?0:c}clearMarkers(c){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===c&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].dispose(),this.markers.splice(c--,1);this._isClearing=!1}addMarker(c){const h=new d.Marker(c);return this.markers.push(h),h.register(this.lines.onTrim(m=>{h.line-=m,h.line<0&&h.dispose()})),h.register(this.lines.onInsert(m=>{h.line>=m.index&&(h.line+=m.amount)})),h.register(this.lines.onDelete(m=>{h.line>=m.index&&h.line<m.index+m.amount&&h.dispose(),h.line>m.index&&(h.line-=m.amount)})),h.register(h.onDispose(()=>this._removeMarker(h))),h}_removeMarker(c){this._isClearing||this.markers.splice(this.markers.indexOf(c),1)}}},8437:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=a(3734),y=a(511),p=a(643),v=a(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let _=0;class S{constructor(d,u,c=!1){this.isWrapped=c,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const h=u||y.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let m=0;m<d;++m)this.setCell(m,h);this.length=d}get(d){const u=this._data[3*d+0],c=2097151&u;return[this._data[3*d+1],2097152&u?this._combined[d]:c?(0,v.stringFromCodePoint)(c):"",u>>22,2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):c]}set(d,u){this._data[3*d+1]=u[p.CHAR_DATA_ATTR_INDEX],u[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=u[1],this._data[3*d+0]=2097152|d|u[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=u[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&u}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d]:2097151&u?(0,v.stringFromCodePoint)(2097151&u):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,u){return _=3*d,u.content=this._data[_+0],u.fg=this._data[_+1],u.bg=this._data[_+2],2097152&u.content&&(u.combinedData=this._combined[d]),268435456&u.bg&&(u.extended=this._extendedAttrs[d]),u}setCell(d,u){2097152&u.content&&(this._combined[d]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[d]=u.extended),this._data[3*d+0]=u.content,this._data[3*d+1]=u.fg,this._data[3*d+2]=u.bg}setCellFromCodePoint(d,u,c,h,m,w){268435456&m&&(this._extendedAttrs[d]=w),this._data[3*d+0]=u|c<<22,this._data[3*d+1]=h,this._data[3*d+2]=m}addCodepointToCell(d,u){let c=this._data[3*d+0];2097152&c?this._combined[d]+=(0,v.stringFromCodePoint)(u):(2097151&c?(this._combined[d]=(0,v.stringFromCodePoint)(2097151&c)+(0,v.stringFromCodePoint)(u),c&=-2097152,c|=2097152):c=u|4194304,this._data[3*d+0]=c)}insertCells(d,u,c,h){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length-d){const m=new y.CellData;for(let w=this.length-d-u-1;w>=0;--w)this.setCell(d+u+w,this.loadCell(d+w,m));for(let w=0;w<u;++w)this.setCell(d+w,c)}else for(let m=d;m<this.length;++m)this.setCell(m,c);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs)}deleteCells(d,u,c,h){if(d%=this.length,u<this.length-d){const m=new y.CellData;for(let w=0;w<this.length-d-u;++w)this.setCell(d+w,this.loadCell(d+u+w,m));for(let w=this.length-u;w<this.length;++w)this.setCell(w,c)}else for(let m=d;m<this.length;++m)this.setCell(m,c);d&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodePoint(d,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs)}replaceCells(d,u,c,h,m=!1){if(m)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodePoint(u,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs);d<u&&d<this.length;)this.isProtected(d)||this.setCell(d,c),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs);d<u&&d<this.length;)this.setCell(d++,c)}resize(d,u){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const c=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*c)this._data=new Uint32Array(this._data.buffer,0,c);else{const h=new Uint32Array(c);h.set(this._data),this._data=h}for(let h=this.length;h<d;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,c);const h=Object.keys(this._combined);for(let w=0;w<h.length;w++){const C=parseInt(h[w],10);C>=d&&delete this._combined[C]}const m=Object.keys(this._extendedAttrs);for(let w=0;w<m.length;w++){const C=parseInt(m[w],10);C>=d&&delete this._extendedAttrs[C]}}return this.length=d,4*c*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,u=!1){if(u)for(let c=0;c<this.length;++c)this.isProtected(c)||this.setCell(c,d);else{this._combined={},this._extendedAttrs={};for(let c=0;c<this.length;++c)this.setCell(c,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const u in d._combined)this._combined[u]=d._combined[u];this._extendedAttrs={};for(const u in d._extendedAttrs)this._extendedAttrs[u]=d._extendedAttrs[u];this.isWrapped=d.isWrapped}clone(){const d=new S(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const u in this._combined)d._combined[u]=this._combined[u];for(const u in this._extendedAttrs)d._extendedAttrs[u]=this._extendedAttrs[u];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,u,c,h,m){const w=d._data;if(m)for(let E=h-1;E>=0;E--){for(let b=0;b<3;b++)this._data[3*(c+E)+b]=w[3*(u+E)+b];268435456&w[3*(u+E)+2]&&(this._extendedAttrs[c+E]=d._extendedAttrs[u+E])}else for(let E=0;E<h;E++){for(let b=0;b<3;b++)this._data[3*(c+E)+b]=w[3*(u+E)+b];268435456&w[3*(u+E)+2]&&(this._extendedAttrs[c+E]=d._extendedAttrs[u+E])}const C=Object.keys(d._combined);for(let E=0;E<C.length;E++){const b=parseInt(C[E],10);b>=u&&(this._combined[b-u+c]=d._combined[b])}}translateToString(d=!1,u=0,c=this.length){d&&(c=Math.min(c,this.getTrimmedLength()));let h="";for(;u<c;){const m=this._data[3*u+0],w=2097151&m;h+=2097152&m?this._combined[u]:w?(0,v.stringFromCodePoint)(w):p.WHITESPACE_CELL_CHAR,u+=m>>22||1}return h}}o.BufferLine=S},4841:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(a,f){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return f*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(g,o)=>{function a(f,y,p){if(y===f.length-1)return f[y].getTrimmedLength();const v=!f[y].hasContent(p-1)&&f[y].getWidth(p-1)===1,_=f[y+1].getWidth(0)===2;return v&&_?p-1:p}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,y,p,v,_){const S=[];for(let x=0;x<f.length-1;x++){let d=x,u=f.get(++d);if(!u.isWrapped)continue;const c=[f.get(x)];for(;d<f.length&&u.isWrapped;)c.push(u),u=f.get(++d);if(v>=x&&v<d){x+=c.length-1;continue}let h=0,m=a(c,h,y),w=1,C=0;for(;w<c.length;){const b=a(c,w,y),k=b-C,R=p-m,L=Math.min(k,R);c[h].copyCellsFrom(c[w],C,m,L,!1),m+=L,m===p&&(h++,m=0),C+=L,C===b&&(w++,C=0),m===0&&h!==0&&c[h-1].getWidth(p-1)===2&&(c[h].copyCellsFrom(c[h-1],p-1,m++,1,!1),c[h-1].setCell(p-1,_))}c[h].replaceCells(m,p,_);let E=0;for(let b=c.length-1;b>0&&(b>h||c[b].getTrimmedLength()===0);b--)E++;E>0&&(S.push(x+c.length-E),S.push(E)),x+=c.length-1}return S},o.reflowLargerCreateNewLayout=function(f,y){const p=[];let v=0,_=y[v],S=0;for(let x=0;x<f.length;x++)if(_===x){const d=y[++v];f.onDeleteEmitter.fire({index:x-S,amount:d}),x+=d-1,S+=d,_=y[++v]}else p.push(x);return{layout:p,countRemoved:S}},o.reflowLargerApplyNewLayout=function(f,y){const p=[];for(let v=0;v<y.length;v++)p.push(f.get(y[v]));for(let v=0;v<p.length;v++)f.set(v,p[v]);f.length=y.length},o.reflowSmallerGetNewLineLengths=function(f,y,p){const v=[],_=f.map((u,c)=>a(f,c,y)).reduce((u,c)=>u+c);let S=0,x=0,d=0;for(;d<_;){if(_-d<p){v.push(_-d);break}S+=p;const u=a(f,x,y);S>u&&(S-=u,x++);const c=f[x].getWidth(S-1)===2;c&&S--;const h=c?p-1:p;v.push(h),d+=h}return v},o.getWrappedLineTrimmedLength=a},5295:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=a(8460),y=a(844),p=a(9092);class v extends y.Disposable{constructor(S,x){super(),this._optionsService=S,this._bufferService=x,this._onBufferActivate=this.register(new f.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 p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,x){this._normal.resize(S,x),this._alt.resize(S,x),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}o.BufferSet=v},511:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=a(482),y=a(643),p=a(3734);class v extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const x=new v;return x.setFromCharData(S),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(S[y.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(S[y.CHAR_DATA_CHAR_INDEX].length===2){const d=S[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const u=S[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(d-55296)+u-56320+65536|S[y.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=S[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[y.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=S[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=a(8460),y=a(844);class p{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}o.Marker=p,p._nextId=1},7116:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(g,o)=>{var a,f,y;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
|
55
|
+
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""}(a||(o.C0=a={})),function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""}(f||(o.C1=f={})),function(p){p.ST=`${a.ESC}\\`}(y||(o.C1_ESCAPED=y={}))},7399:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=a(2584),y={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:["'",'"']};o.evaluateKeyboardEvent=function(p,v,_,S){const x={type:0,cancel:!1,key:void 0},d=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?x.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?x.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?x.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(x.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(p.altKey){x.key=f.C0.ESC+f.C0.DEL;break}x.key=f.C0.DEL;break;case 9:if(p.shiftKey){x.key=f.C0.ESC+"[Z";break}x.key=f.C0.HT,x.cancel=!0;break;case 13:x.key=p.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,x.cancel=!0;break;case 27:x.key=f.C0.ESC,p.altKey&&(x.key=f.C0.ESC+f.C0.ESC),x.cancel=!0;break;case 37:if(p.metaKey)break;d?(x.key=f.C0.ESC+"[1;"+(d+1)+"D",x.key===f.C0.ESC+"[1;3D"&&(x.key=f.C0.ESC+(_?"b":"[1;5D"))):x.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(p.metaKey)break;d?(x.key=f.C0.ESC+"[1;"+(d+1)+"C",x.key===f.C0.ESC+"[1;3C"&&(x.key=f.C0.ESC+(_?"f":"[1;5C"))):x.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(p.metaKey)break;d?(x.key=f.C0.ESC+"[1;"+(d+1)+"A",_||x.key!==f.C0.ESC+"[1;3A"||(x.key=f.C0.ESC+"[1;5A")):x.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(p.metaKey)break;d?(x.key=f.C0.ESC+"[1;"+(d+1)+"B",_||x.key!==f.C0.ESC+"[1;3B"||(x.key=f.C0.ESC+"[1;5B")):x.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(x.key=f.C0.ESC+"[2~");break;case 46:x.key=d?f.C0.ESC+"[3;"+(d+1)+"~":f.C0.ESC+"[3~";break;case 36:x.key=d?f.C0.ESC+"[1;"+(d+1)+"H":v?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:x.key=d?f.C0.ESC+"[1;"+(d+1)+"F":v?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:p.shiftKey?x.type=2:p.ctrlKey?x.key=f.C0.ESC+"[5;"+(d+1)+"~":x.key=f.C0.ESC+"[5~";break;case 34:p.shiftKey?x.type=3:p.ctrlKey?x.key=f.C0.ESC+"[6;"+(d+1)+"~":x.key=f.C0.ESC+"[6~";break;case 112:x.key=d?f.C0.ESC+"[1;"+(d+1)+"P":f.C0.ESC+"OP";break;case 113:x.key=d?f.C0.ESC+"[1;"+(d+1)+"Q":f.C0.ESC+"OQ";break;case 114:x.key=d?f.C0.ESC+"[1;"+(d+1)+"R":f.C0.ESC+"OR";break;case 115:x.key=d?f.C0.ESC+"[1;"+(d+1)+"S":f.C0.ESC+"OS";break;case 116:x.key=d?f.C0.ESC+"[15;"+(d+1)+"~":f.C0.ESC+"[15~";break;case 117:x.key=d?f.C0.ESC+"[17;"+(d+1)+"~":f.C0.ESC+"[17~";break;case 118:x.key=d?f.C0.ESC+"[18;"+(d+1)+"~":f.C0.ESC+"[18~";break;case 119:x.key=d?f.C0.ESC+"[19;"+(d+1)+"~":f.C0.ESC+"[19~";break;case 120:x.key=d?f.C0.ESC+"[20;"+(d+1)+"~":f.C0.ESC+"[20~";break;case 121:x.key=d?f.C0.ESC+"[21;"+(d+1)+"~":f.C0.ESC+"[21~";break;case 122:x.key=d?f.C0.ESC+"[23;"+(d+1)+"~":f.C0.ESC+"[23~";break;case 123:x.key=d?f.C0.ESC+"[24;"+(d+1)+"~":f.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(_&&!S||!p.altKey||p.metaKey)!_||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?x.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(x.key=f.C0.US),p.key==="@"&&(x.key=f.C0.NUL)):p.keyCode===65&&(x.type=1);else{const u=y[p.keyCode],c=u==null?void 0:u[p.shiftKey?1:0];if(c)x.key=f.C0.ESC+c;else if(p.keyCode>=65&&p.keyCode<=90){const h=p.ctrlKey?p.keyCode-64:p.keyCode+32;let m=String.fromCharCode(h);p.shiftKey&&(m=m.toUpperCase()),x.key=f.C0.ESC+m}else if(p.keyCode===32)x.key=f.C0.ESC+(p.ctrlKey?f.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let h=p.code.slice(3,4);p.shiftKey||(h=h.toLowerCase()),x.key=f.C0.ESC+h,x.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?x.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?x.key=f.C0.NUL:p.keyCode>=51&&p.keyCode<=55?x.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?x.key=f.C0.DEL:p.keyCode===219?x.key=f.C0.ESC:p.keyCode===220?x.key=f.C0.FS:p.keyCode===221&&(x.key=f.C0.GS)}return x}},482:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},o.utf32ToString=function(a,f=0,y=a.length){let p="";for(let v=f;v<y;++v){let _=a[v];_>65535?(_-=65536,p+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):p+=String.fromCharCode(_)}return p},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,f){const y=a.length;if(!y)return 0;let p=0,v=0;if(this._interim){const _=a.charCodeAt(v++);56320<=_&&_<=57343?f[p++]=1024*(this._interim-55296)+_-56320+65536:(f[p++]=this._interim,f[p++]=_),this._interim=0}for(let _=v;_<y;++_){const S=a.charCodeAt(_);if(55296<=S&&S<=56319){if(++_>=y)return this._interim=S,p;const x=a.charCodeAt(_);56320<=x&&x<=57343?f[p++]=1024*(S-55296)+x-56320+65536:(f[p++]=S,f[p++]=x)}else S!==65279&&(f[p++]=S)}return p}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,f){const y=a.length;if(!y)return 0;let p,v,_,S,x=0,d=0,u=0;if(this.interim[0]){let m=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)w<<=6,w|=C;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=b-E;for(;u<k;){if(u>=y)return 0;if(C=a[u++],(192&C)!=128){u--,m=!0;break}this.interim[E++]=C,w<<=6,w|=63&C}m||(b===2?w<128?u--:f[x++]=w:b===3?w<2048||w>=55296&&w<=57343||w===65279||(f[x++]=w):w<65536||w>1114111||(f[x++]=w)),this.interim.fill(0)}const c=y-4;let h=u;for(;h<y;){for(;!(!(h<c)||128&(p=a[h])||128&(v=a[h+1])||128&(_=a[h+2])||128&(S=a[h+3]));)f[x++]=p,f[x++]=v,f[x++]=_,f[x++]=S,h+=4;if(p=a[h++],p<128)f[x++]=p;else if((224&p)==192){if(h>=y)return this.interim[0]=p,x;if(v=a[h++],(192&v)!=128){h--;continue}if(d=(31&p)<<6|63&v,d<128){h--;continue}f[x++]=d}else if((240&p)==224){if(h>=y)return this.interim[0]=p,x;if(v=a[h++],(192&v)!=128){h--;continue}if(h>=y)return this.interim[0]=p,this.interim[1]=v,x;if(_=a[h++],(192&_)!=128){h--;continue}if(d=(15&p)<<12|(63&v)<<6|63&_,d<2048||d>=55296&&d<=57343||d===65279)continue;f[x++]=d}else if((248&p)==240){if(h>=y)return this.interim[0]=p,x;if(v=a[h++],(192&v)!=128){h--;continue}if(h>=y)return this.interim[0]=p,this.interim[1]=v,x;if(_=a[h++],(192&_)!=128){h--;continue}if(h>=y)return this.interim[0]=p,this.interim[1]=v,this.interim[2]=_,x;if(S=a[h++],(192&S)!=128){h--;continue}if(d=(7&p)<<18|(63&v)<<12|(63&_)<<6|63&S,d<65536||d>1114111)continue;f[x++]=d}}return x}}},225:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const a=[[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]],f=[[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 y;o.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let p=0;p<a.length;++p)y.fill(0,a[p][0],a[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?y[p]:function(v,_){let S,x=0,d=_.length-1;if(v<_[0][0]||v>_[d][1])return!1;for(;d>=x;)if(S=x+d>>1,v>_[S][1])x=S+1;else{if(!(v<_[S][0]))return!0;d=S-1}return!1}(p,f)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}}},5981:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=a(8460),y=a(844);class p extends y.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,S){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(S)}_innerWrite(_=0,S=!0){const x=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],u=this._action(d,S);if(u){const h=m=>Date.now()-x>=12?setTimeout(()=>this._innerWrite(0,m)):this._innerWrite(x,m);return void u.catch(m=>(queueMicrotask(()=>{throw m}),Promise.resolve(!1))).then(h)}const c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-x>=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()}}o.WriteBuffer=p},5941:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const a=/^([\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})$/,f=/^[\da-f]+$/;function y(p,v){const _=p.toString(16),S=_.length<2?"0"+_:_;switch(v){case 4:return _[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}o.parseColor=function(p){if(!p)return;let v=p.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const _=a.exec(v);if(_){const S=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/S*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/S*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/S*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),f.exec(v)&&[3,6,9,12].includes(v.length))){const _=v.length/3,S=[0,0,0];for(let x=0;x<3;++x){const d=parseInt(v.slice(_*x,_*x+_),16);S[x]=_===1?d<<4:_===2?d:_===3?d>>4:d>>8}return S}},o.toRgbString=function(p,v=16){const[_,S,x]=p;return`rgb:${y(_,v)}/${y(S,v)}/${y(x,v)}`}},5770:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=a(482),y=a(8742),p=a(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(S,x){this._handlers[S]===void 0&&(this._handlers[S]=[]);const d=this._handlers[S];return d.push(x),{dispose:()=>{const u=d.indexOf(x);u!==-1&&d.splice(u,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(S,x){if(this.reset(),this._ident=S,this._active=this._handlers[S]||v,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(S,x,d){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(S,x,d);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(S,x,d))}unhook(S,x=!0){if(this._active.length){let d=!1,u=this._active.length-1,c=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,d=x,c=this._stack.fallThrough,this._stack.paused=!1),!c&&d===!1){for(;u>=0&&(d=this._active[u].unhook(S),d!==!0);u--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,d;u--}for(;u>=0;u--)if(d=this._active[u].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",S);this._active=v,this._ident=0}};const _=new y.Params;_.addParam(0),o.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=_,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():_,this._data="",this._hitLimit=!1}put(S,x,d){this._hitLimit||(this._data+=(0,f.utf32ToString)(S,x,d),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let x=!1;if(this._hitLimit)x=!1;else if(S&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then(d=>(this._params=_,this._data="",this._hitLimit=!1,d));return this._params=_,this._data="",this._hitLimit=!1,x}}},2015:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=a(844),y=a(8742),p=a(6242),v=a(6351);class _{constructor(u){this.table=new Uint8Array(u)}setDefault(u,c){this.table.fill(u<<4|c)}add(u,c,h,m){this.table[c<<8|u]=h<<4|m}addMany(u,c,h,m){for(let w=0;w<u.length;w++)this.table[c<<8|u[w]]=h<<4|m}}o.TransitionTable=_;const S=160;o.VT500_TRANSITION_TABLE=function(){const d=new _(4095),u=Array.apply(null,Array(256)).map((E,b)=>b),c=(E,b)=>u.slice(E,b),h=c(32,127),m=c(0,24);m.push(25),m.push.apply(m,c(28,32));const w=c(0,14);let C;for(C in d.setDefault(1,0),d.addMany(h,0,2,0),w)d.addMany([24,26,153,154],C,3,0),d.addMany(c(128,144),C,3,0),d.addMany(c(144,152),C,3,0),d.add(156,C,0,0),d.add(27,C,11,1),d.add(157,C,4,8),d.addMany([152,158,159],C,0,7),d.add(155,C,11,3),d.add(144,C,11,9);return d.addMany(m,0,3,0),d.addMany(m,1,3,1),d.add(127,1,0,1),d.addMany(m,8,0,8),d.addMany(m,3,3,3),d.add(127,3,0,3),d.addMany(m,4,3,4),d.add(127,4,0,4),d.addMany(m,6,3,6),d.addMany(m,5,3,5),d.add(127,5,0,5),d.addMany(m,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(h,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(c(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(h,7,0,7),d.addMany(m,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(c(64,127),3,7,0),d.addMany(c(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(c(48,60),4,8,4),d.addMany(c(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(c(32,64),6,0,6),d.add(127,6,0,6),d.addMany(c(64,127),6,0,0),d.addMany(c(32,48),3,9,5),d.addMany(c(32,48),5,9,5),d.addMany(c(48,64),5,0,6),d.addMany(c(64,127),5,7,0),d.addMany(c(32,48),4,9,5),d.addMany(c(32,48),1,9,2),d.addMany(c(32,48),2,9,2),d.addMany(c(48,127),2,10,0),d.addMany(c(48,80),1,10,0),d.addMany(c(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(c(96,127),1,10,0),d.add(80,1,11,9),d.addMany(m,9,0,9),d.add(127,9,0,9),d.addMany(c(28,32),9,0,9),d.addMany(c(32,48),9,9,12),d.addMany(c(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(m,11,0,11),d.addMany(c(32,128),11,0,11),d.addMany(c(28,32),11,0,11),d.addMany(m,10,0,10),d.add(127,10,0,10),d.addMany(c(28,32),10,0,10),d.addMany(c(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(c(32,48),10,9,12),d.addMany(m,12,0,12),d.add(127,12,0,12),d.addMany(c(28,32),12,0,12),d.addMany(c(32,48),12,9,12),d.addMany(c(48,64),12,0,11),d.addMany(c(64,127),12,12,13),d.addMany(c(64,127),10,12,13),d.addMany(c(64,127),9,12,13),d.addMany(m,13,13,13),d.addMany(h,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(S,0,2,0),d.add(S,8,5,8),d.add(S,6,0,6),d.add(S,11,0,11),d.add(S,13,13,13),d}();class x extends f.Disposable{constructor(u=o.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(c,h,m)=>{},this._executeHandlerFb=c=>{},this._csiHandlerFb=(c,h)=>{},this._escHandlerFb=c=>{},this._errorHandlerFb=c=>c,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(u,c=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<u.intermediates.length;++w){const C=u.intermediates.charCodeAt(w);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=C}}if(u.final.length!==1)throw new Error("final must be a single byte");const m=u.final.charCodeAt(0);if(c[0]>m||m>c[1])throw new Error(`final must be in range ${c[0]} .. ${c[1]}`);return h<<=8,h|=m,h}identToString(u){const c=[];for(;u;)c.push(String.fromCharCode(255&u)),u>>=8;return c.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,c){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const m=this._escHandlers[h];return m.push(c),{dispose:()=>{const w=m.indexOf(c);w!==-1&&m.splice(w,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,c){this._executeHandlers[u.charCodeAt(0)]=c}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,c){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const m=this._csiHandlers[h];return m.push(c),{dispose:()=>{const w=m.indexOf(c);w!==-1&&m.splice(w,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,c){return this._dcsParser.registerHandler(this._identifier(u),c)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,c){return this._oscParser.registerHandler(u,c)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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(u,c,h,m,w){this._parseStack.state=u,this._parseStack.handlers=c,this._parseStack.handlerPos=h,this._parseStack.transition=m,this._parseStack.chunkPos=w}parse(u,c,h){let m,w=0,C=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&k>-1){for(;k>=0&&(m=b[k](this._params),m!==!0);k--)if(m instanceof Promise)return this._parseStack.handlerPos=k,m}this._parseStack.handlers=[];break;case 4:if(h===!1&&k>-1){for(;k>=0&&(m=b[k](),m!==!0);k--)if(m instanceof Promise)return this._parseStack.handlerPos=k,m}this._parseStack.handlers=[];break;case 6:if(w=u[this._parseStack.chunkPos],m=this._dcsParser.unhook(w!==24&&w!==26,h),m)return m;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=u[this._parseStack.chunkPos],m=this._oscParser.end(w!==24&&w!==26,h),m)return m;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 b=E;b<c;++b){switch(w=u[b],C=this._transitions.table[this.currentState<<8|(w<160?w:S)],C>>4){case 2:for(let B=b+1;;++B){if(B>=c||(w=u[B])<32||w>126&&w<S){this._printHandler(u,b,B),b=B-1;break}if(++B>=c||(w=u[B])<32||w>126&&w<S){this._printHandler(u,b,B),b=B-1;break}if(++B>=c||(w=u[B])<32||w>126&&w<S){this._printHandler(u,b,B),b=B-1;break}if(++B>=c||(w=u[B])<32||w>126&&w<S){this._printHandler(u,b,B),b=B-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:b,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|w];let R=k?k.length-1:-1;for(;R>=0&&(m=k[R](this._params),m!==!0);R--)if(m instanceof Promise)return this._preserveStack(3,k,R,C,b),m;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(++b<c&&(w=u[b])>47&&w<60);b--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const L=this._escHandlers[this._collect<<8|w];let P=L?L.length-1:-1;for(;P>=0&&(m=L[P](),m!==!0);P--)if(m instanceof Promise)return this._preserveStack(4,L,P,C,b),m;P<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 B=b+1;;++B)if(B>=c||(w=u[B])===24||w===26||w===27||w>127&&w<S){this._dcsParser.put(u,b,B),b=B-1;break}break;case 14:if(m=this._dcsParser.unhook(w!==24&&w!==26),m)return this._preserveStack(6,[],0,C,b),m;w===27&&(C|=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 B=b+1;;B++)if(B>=c||(w=u[B])<32||w>127&&w<S){this._oscParser.put(u,b,B),b=B-1;break}break;case 6:if(m=this._oscParser.end(w!==24&&w!==26),m)return this._preserveStack(5,[],0,C,b),m;w===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}o.EscapeSequenceParser=x},6242:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=a(5770),y=a(482),p=[];o.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,_){this._handlers[v]===void 0&&(this._handlers[v]=[]);const S=this._handlers[v];return S.push(_),{dispose:()=>{const x=S.indexOf(_);x!==-1&&S.splice(x,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,_,S){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(v,_,S);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(v,_,S))}start(){this.reset(),this._state=1}put(v,_,S){if(this._state!==3){if(this._state===1)for(;_<S;){const x=v[_++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&S-_>0&&this._put(v,_,S)}}end(v,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,x=this._active.length-1,d=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,S=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&S===!1){for(;x>=0&&(S=this._active[x].end(v),S!==!0);x--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,S;x--}for(;x>=0;x--)if(S=this._active[x].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",v);this._active=p,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,_,S){this._hitLimit||(this._data+=(0,y.utf32ToString)(v,_,S),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let _=!1;if(this._hitLimit)_=!1;else if(v&&(_=this._handler(this._data),_ instanceof Promise))return _.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,_}}},8742:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const a=2147483647;class f{static fromArray(p){const v=new f;if(!p.length)return v;for(let _=Array.isArray(p[0])?1:0;_<p.length;++_){const S=p[_];if(Array.isArray(S))for(let x=0;x<S.length;++x)v.addSubParam(S[x]);else v.addParam(S)}return v}constructor(p=32,v=32){if(this.maxLength=p,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new f(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let v=0;v<this.length;++v){p.push(this.params[v]);const _=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-_>0&&p.push(Array.prototype.slice.call(this._subParams,_,S))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>a?a:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>a?a:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const v=this._subParamsIdx[p]>>8,_=255&this._subParamsIdx[p];return _-v>0?this._subParams.subarray(v,_):null}getSubParamsAll(){const p={};for(let v=0;v<this.length;++v){const _=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-_>0&&(p[v]=this._subParams.slice(_,S))}return p}addDigit(p){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,S=_[v-1];_[v-1]=~S?Math.min(10*S+p,a):p}}o.Params=f},5741:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,f){const y={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(y),f.dispose=()=>this._wrappedAddonDispose(y),f.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let f=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===a){f=y;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(f,1)}}},8771:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=a(3785),y=a(511);o.BufferApiView=class{constructor(p,v){this._buffer=p,this.type=v}init(p){return this._buffer=p,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(p){const v=this._buffer.lines.get(p);if(v)return new f.BufferLineApiView(v)}getNullCell(){return new y.CellData}}},3785:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=a(511);o.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,p){if(!(y<0||y>=this._line.length))return p?(this._line.loadCell(y,p),p):this._line.loadCell(y,new f.CellData)}translateToString(y,p,v){return this._line.translateToString(y,p,v)}}},8285:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=a(8771),y=a(8460),p=a(844);class v extends p.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}o.BufferNamespaceApi=v},7975:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,f){return this._core.registerCsiHandler(a,y=>f(y.toArray()))}addCsiHandler(a,f){return this.registerCsiHandler(a,f)}registerDcsHandler(a,f){return this._core.registerDcsHandler(a,(y,p)=>f(y,p.toArray()))}addDcsHandler(a,f){return this.registerDcsHandler(a,f)}registerEscHandler(a,f){return this._core.registerEscHandler(a,f)}addEscHandler(a,f){return this.registerEscHandler(a,f)}registerOscHandler(a,f){return this._core.registerOscHandler(a,f)}addOscHandler(a,f){return this.registerOscHandler(a,f)}}},7090:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(g,o,a){var f=this&&this.__decorate||function(d,u,c,h){var m,w=arguments.length,C=w<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,c,h);else for(var E=d.length-1;E>=0;E--)(m=d[E])&&(C=(w<3?m(C):w>3?m(u,c,C):m(u,c))||C);return w>3&&C&&Object.defineProperty(u,c,C),C},y=this&&this.__param||function(d,u){return function(c,h){u(c,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const p=a(8460),v=a(844),_=a(5295),S=a(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let x=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(d,this))}resize(d,u){this.cols=d,this.rows=u,this.buffers.resize(d,u),this._onResize.fire({cols:d,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,u=!1){const c=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===d.fg&&h.getBg(0)===d.bg||(h=c.getBlankLine(d,u),this._cachedBlankLine=h),h.isWrapped=u;const m=c.ybase+c.scrollTop,w=c.ybase+c.scrollBottom;if(c.scrollTop===0){const C=c.lines.isFull;w===c.lines.length-1?C?c.lines.recycle().copyFrom(h):c.lines.push(h.clone()):c.lines.splice(w+1,0,h.clone()),C?this.isUserScrolling&&(c.ydisp=Math.max(c.ydisp-1,0)):(c.ybase++,this.isUserScrolling||c.ydisp++)}else{const C=w-m+1;c.lines.shiftElements(m+1,C-1,-1),c.lines.set(w,h.clone())}this.isUserScrolling||(c.ydisp=c.ybase),this._onScroll.fire(c.ydisp)}scrollLines(d,u,c){const h=this.buffer;if(d<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else d+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const m=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+d,h.ybase),0),m!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};o.BufferService=x=f([y(0,S.IOptionsService)],x)},7994:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,f){this._charsets[a]=f,this.glevel===a&&(this.charset=f)}}},1753:function(g,o,a){var f=this&&this.__decorate||function(h,m,w,C){var E,b=arguments.length,k=b<3?m:C===null?C=Object.getOwnPropertyDescriptor(m,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,m,w,C);else for(var R=h.length-1;R>=0;R--)(E=h[R])&&(k=(b<3?E(k):b>3?E(m,w,k):E(m,w))||k);return b>3&&k&&Object.defineProperty(m,w,k),k},y=this&&this.__param||function(h,m){return function(w,C){m(w,C,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const p=a(2585),v=a(8460),_=a(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function x(h,m){let w=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(w|=64,w|=h.action):(w|=3&h.button,4&h.button&&(w|=64),8&h.button&&(w|=128),h.action===32?w|=32:h.action!==0||m||(w|=3)),w}const d=String.fromCharCode,u={DEFAULT:h=>{const m=[x(h,!1)+32,h.col+32,h.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${d(m[0])}${d(m[1])}${d(m[2])}`},SGR:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${x(h,!0)};${h.col};${h.row}${m}`},SGR_PIXELS:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${x(h,!0)};${h.x};${h.y}${m}`}};let c=o.CoreMouseService=class extends _.Disposable{constructor(h,m){super(),this._bufferService=h,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(S))this.addProtocol(w,S[w]);for(const w of Object.keys(u))this.addEncoding(w,u[w]);this.reset()}addProtocol(h,m){this._protocols[h]=m}addEncoding(h,m){this._encodings[h]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const m=this._encodings[this._activeEncoding](h);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,m,w){if(w){if(h.x!==m.x||h.y!==m.y)return!1}else if(h.col!==m.col||h.row!==m.row)return!1;return h.button===m.button&&h.action===m.action&&h.ctrl===m.ctrl&&h.alt===m.alt&&h.shift===m.shift}};o.CoreMouseService=c=f([y(0,p.IBufferService),y(1,p.ICoreService)],c)},6975:function(g,o,a){var f=this&&this.__decorate||function(c,h,m,w){var C,E=arguments.length,b=E<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,m):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,h,m,w);else for(var k=c.length-1;k>=0;k--)(C=c[k])&&(b=(E<3?C(b):E>3?C(h,m,b):C(h,m))||b);return E>3&&b&&Object.defineProperty(h,m,b),b},y=this&&this.__param||function(c,h){return function(m,w){h(m,w,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const p=a(1439),v=a(8460),_=a(844),S=a(2585),x=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=o.CoreService=class extends _.Disposable{constructor(c,h,m){super(),this._bufferService=c,this._logService=h,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(x),this.decPrivateModes=(0,p.clone)(d)}reset(){this.modes=(0,p.clone)(x),this.decPrivateModes=(0,p.clone)(d)}triggerDataEvent(c,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${c}"`,()=>c.split("").map(w=>w.charCodeAt(0))),this._onData.fire(c)}triggerBinaryEvent(c){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${c}"`,()=>c.split("").map(h=>h.charCodeAt(0))),this._onBinary.fire(c))}};o.CoreService=u=f([y(0,S.IBufferService),y(1,S.ILogService),y(2,S.IOptionsService)],u)},9074:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=a(8055),y=a(8460),p=a(844),v=a(6106);let _=0,S=0;class x extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(c=>c==null?void 0:c.marker.line),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)(()=>this.reset()))}registerDecoration(c){if(c.marker.isDisposed)return;const h=new d(c);if(h){const m=h.marker.onDispose(()=>h.dispose());h.onDispose(()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),m.dispose())}),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const c of this._decorations.values())c.dispose();this._decorations.clear()}*getDecorationsAtCell(c,h,m){var w,C,E;let b=0,k=0;for(const R of this._decorations.getKeyIterator(h))b=(w=R.options.x)!==null&&w!==void 0?w:0,k=b+((C=R.options.width)!==null&&C!==void 0?C:1),c>=b&&c<k&&(!m||((E=R.options.layer)!==null&&E!==void 0?E:"bottom")===m)&&(yield R)}forEachDecorationAtCell(c,h,m,w){this._decorations.forEachByKey(h,C=>{var E,b,k;_=(E=C.options.x)!==null&&E!==void 0?E:0,S=_+((b=C.options.width)!==null&&b!==void 0?b:1),c>=_&&c<S&&(!m||((k=C.options.layer)!==null&&k!==void 0?k:"bottom")===m)&&w(C)})}}o.DecorationService=x;class d extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(c){super(),this.options=c,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=c.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=a(2585),y=a(8343);class p{constructor(..._){this._entries=new Map;for(const[S,x]of _)this.set(S,x)}set(_,S){const x=this._entries.get(_);return this._entries.set(_,S),x}forEach(_){for(const[S,x]of this._entries.entries())_(S,x)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=p,o.InstantiationService=class{constructor(){this._services=new p,this._services.set(f.IInstantiationService,this)}setService(v,_){this._services.set(v,_)}getService(v){return this._services.get(v)}createInstance(v,..._){const S=(0,y.getServiceDependencies)(v).sort((u,c)=>u.index-c.index),x=[];for(const u of S){const c=this._services.get(u.id);if(!c)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${u.id}.`);x.push(c)}const d=S.length>0?S[0].index:_.length;if(_.length!==d)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${d+1} conflicts with ${_.length} static arguments`);return new v(..._,...x)}}},7866:function(g,o,a){var f=this&&this.__decorate||function(d,u,c,h){var m,w=arguments.length,C=w<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,c,h);else for(var E=d.length-1;E>=0;E--)(m=d[E])&&(C=(w<3?m(C):w>3?m(u,c,C):m(u,c))||C);return w>3&&C&&Object.defineProperty(u,c,C),C},y=this&&this.__param||function(d,u){return function(c,h){u(c,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const p=a(844),v=a(2585),_={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,x=o.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let u=0;u<d.length;u++)typeof d[u]=="function"&&(d[u]=d[u]())}_log(d,u,c){this._evalLazyOptionalParams(c),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...c)}trace(d,...u){var c,h;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((h=(c=this._optionsService.options.logger)===null||c===void 0?void 0:c.trace.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.log,d,u)}debug(d,...u){var c,h;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((h=(c=this._optionsService.options.logger)===null||c===void 0?void 0:c.debug.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.log,d,u)}info(d,...u){var c,h;this._logLevel<=v.LogLevelEnum.INFO&&this._log((h=(c=this._optionsService.options.logger)===null||c===void 0?void 0:c.info.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.info,d,u)}warn(d,...u){var c,h;this._logLevel<=v.LogLevelEnum.WARN&&this._log((h=(c=this._optionsService.options.logger)===null||c===void 0?void 0:c.warn.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.warn,d,u)}error(d,...u){var c,h;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((h=(c=this._optionsService.options.logger)===null||c===void 0?void 0:c.error.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.error,d,u)}};o.LogService=x=f([y(0,v.IOptionsService)],x),o.setTraceLogger=function(d){S=d},o.traceCall=function(d,u,c){if(typeof c.value!="function")throw new Error("not supported");const h=c.value;c.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return h.apply(this,m);S.trace(`GlyphRenderer#${h.name}(${m.map(C=>JSON.stringify(C)).join(", ")})`);const w=h.apply(this,m);return S.trace(`GlyphRenderer#${h.name} return`,w),w}}},7302:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=a(8460),y=a(844),p=a(6114);o.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:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends y.Disposable{constructor(x){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d=Object.assign({},o.DEFAULT_OPTIONS);for(const u in x)if(u in d)try{const c=x[u];d[u]=this._sanitizeAndValidateOption(u,c)}catch(c){console.error(c)}this.rawOptions=d,this.options=Object.assign({},d),this._setupOptions()}onSpecificOptionChange(x,d){return this.onOptionChange(u=>{u===x&&d(this.rawOptions[x])})}onMultipleOptionChange(x,d){return this.onOptionChange(u=>{x.indexOf(u)!==-1&&d()})}_setupOptions(){const x=u=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},d=(u,c)=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);c=this._sanitizeAndValidateOption(u,c),this.rawOptions[u]!==c&&(this.rawOptions[u]=c,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const c={get:x.bind(this,u),set:d.bind(this,u)};Object.defineProperty(this.options,u,c)}}_sanitizeAndValidateOption(x,d){switch(x){case"cursorStyle":if(d||(d=o.DEFAULT_OPTIONS[x]),!function(u){return u==="block"||u==="underline"||u==="bar"}(d))throw new Error(`"${d}" is not a valid value for ${x}`);break;case"wordSeparator":d||(d=o.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=v.includes(d)?d:o.DEFAULT_OPTIONS[x];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${x} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${x} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}o.OptionsService=_},2660:function(g,o,a){var f=this&&this.__decorate||function(_,S,x,d){var u,c=arguments.length,h=c<3?S:d===null?d=Object.getOwnPropertyDescriptor(S,x):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(_,S,x,d);else for(var m=_.length-1;m>=0;m--)(u=_[m])&&(h=(c<3?u(h):c>3?u(S,x,h):u(S,x))||h);return c>3&&h&&Object.defineProperty(S,x,h),h},y=this&&this.__param||function(_,S){return function(x,d){S(x,d,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const p=a(2585);let v=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const S=this._bufferService.buffer;if(_.id===void 0){const m=S.addMarker(S.ybase+S.y),w={data:_,id:this._nextId++,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(w,m)),this._dataByLinkId.set(w.id,w),w.id}const x=_,d=this._getEntryIdKey(x),u=this._entriesWithId.get(d);if(u)return this.addLineToLink(u.id,S.ybase+S.y),u.id;const c=S.addMarker(S.ybase+S.y),h={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(h,c)),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(_,S){const x=this._dataByLinkId.get(_);if(x&&x.lines.every(d=>d.line!==S)){const d=this._bufferService.buffer.addMarker(S);x.lines.push(d),d.onDispose(()=>this._removeMarkerFromLink(x,d))}}getLinkData(_){var S;return(S=this._dataByLinkId.get(_))===null||S===void 0?void 0:S.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,S){const x=_.lines.indexOf(S);x!==-1&&(_.lines.splice(x,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=v=f([y(0,p.IBufferService)],v)},8343:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const a="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(y){return y[f]||[]},o.createDecorator=function(y){if(o.serviceRegistry.has(y))return o.serviceRegistry.get(y);const p=function(v,_,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,d,u){d[a]===d?d[f].push({id:x,index:u}):(d[f]=[{id:x,index:u}],d[a]=d)})(p,v,S)};return p.toString=()=>y,o.serviceRegistry.set(y,p),p}},2585:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=a(8343);var y;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"}(y||(o.LogLevelEnum=y={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=a(8460),y=a(225);o.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const p=new y.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let v=0;const _=p.length;for(let S=0;S<_;++S){let x=p.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=_)return v+this.wcwidth(x);const d=p.charCodeAt(S);56320<=d&&d<=57343?x=1024*(x-55296)+d-56320+65536:v+=this.wcwidth(d)}v+=this.wcwidth(x)}return v}}}},n={};function i(g){var o=n[g];if(o!==void 0)return o.exports;var a=n[g]={exports:{}};return r[g].call(a.exports,a,a.exports,i),a.exports}var l={};return(()=>{var g=l;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const o=i(9042),a=i(3236),f=i(844),y=i(5741),p=i(8285),v=i(7975),_=i(7090),S=["cols","rows"];class x extends f.Disposable{constructor(u){super(),this._core=this.register(new a.Terminal(u)),this._addonManager=this.register(new y.AddonManager),this._publicOptions=Object.assign({},this._core.options);const c=m=>this._core.options[m],h=(m,w)=>{this._checkReadonlyOptions(m),this._core.options[m]=w};for(const m in this._core.options){const w={get:c.bind(this,m),set:h.bind(this,m)};Object.defineProperty(this._publicOptions,m,w)}}_checkReadonlyOptions(u){if(S.includes(u))throw new Error(`Option "${u}" 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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.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 p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let c="none";switch(this._core.coreMouseService.activeProtocol){case"X10":c="x10";break;case"VT200":c="vt200";break;case"DRAG":c="drag";break;case"ANY":c="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:c,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const c in u)this._publicOptions[c]=u[c]}blur(){this._core.blur()}focus(){this._core.focus()}resize(u,c){this._verifyIntegers(u,c),this._core.resize(u,c)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){var c,h,m;return this._checkProposedApi(),this._verifyPositiveIntegers((c=u.x)!==null&&c!==void 0?c:0,(h=u.width)!==null&&h!==void 0?h:0,(m=u.height)!==null&&m!==void 0?m:0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,c,h){this._verifyIntegers(u,c,h),this._core.select(u,c,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,c){this._verifyIntegers(u,c),this._core.selectLines(u,c)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,c){this._core.write(u,c)}writeln(u,c){this._core.write(u),this._core.write(`\r
|
|
56
|
+
`,c)}paste(u){this._core.paste(u)}refresh(u,c){this._verifyIntegers(u,c),this._core.refresh(u,c)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return o}_verifyIntegers(...u){for(const c of u)if(c===1/0||isNaN(c)||c%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const c of u)if(c&&(c===1/0||isNaN(c)||c%1!=0||c<0))throw new Error("This API only accepts positive integers")}}g.Terminal=x})(),l})())})(iv);var Px=iv.exports,av={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(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const l=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(l._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,l=i._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),p=a-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),v=f-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(v/l.css.cell.width)),rows:Math.max(1,Math.floor(p/l.css.cell.height))}}}})(),r})())})(av);var Mx=av.exports,lv={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(f,y,p,v={}){this._terminal=f,this._regex=y,this._handler=p,this._options=v}provideLinks(f,y){const p=a.computeLink(f,this._regex,this._terminal,this._handler);y(this._addCallbacks(p))}_addCallbacks(f){return f.map(y=>(y.leave=this._options.leave,y.hover=(p,v)=>{if(this._options.hover){const{range:_}=y;this._options.hover(p,v,_)}},y))}};class a{static computeLink(y,p,v,_){const S=new RegExp(p.source,(p.flags||"")+"g"),[x,d]=a._getWindowedLineStrings(y-1,v),u=x.join("");let c;const h=[];for(;c=S.exec(u);){const m=c[0];try{const R=new URL(m),L=decodeURI(R.toString());if(m!==L&&m+"/"!==L)continue}catch{continue}const[w,C]=a._mapStrIdx(v,d,0,c.index),[E,b]=a._mapStrIdx(v,w,C,m.length);if(w===-1||C===-1||E===-1||b===-1)continue;const k={start:{x:C+1,y:w+1},end:{x:b,y:E+1}};h.push({range:k,text:m,activate:_})}return h}static _getWindowedLineStrings(y,p){let v,_=y,S=y,x=0,d="";const u=[];if(v=p.buffer.active.getLine(y)){const c=v.translateToString(!0);if(v.isWrapped&&c[0]!==" "){for(x=0;(v=p.buffer.active.getLine(--_))&&x<2048&&(d=v.translateToString(!0),x+=d.length,u.push(d),v.isWrapped&&d.indexOf(" ")===-1););u.reverse()}for(u.push(c),x=0;(v=p.buffer.active.getLine(++S))&&v.isWrapped&&x<2048&&(d=v.translateToString(!0),x+=d.length,u.push(d),d.indexOf(" ")===-1););}return[u,_]}static _mapStrIdx(y,p,v,_){const S=y.buffer.active,x=S.getNullCell();let d=v;for(;_;){const u=S.getLine(p);if(!u)return[-1,-1];for(let c=d;c<u.length;++c){u.getCell(c,x);const h=x.getChars();if(x.getWidth()&&(_-=h.length||1,c===u.length-1&&h==="")){const m=S.getLine(p+1);m&&m.isWrapped&&(m.getCell(0,x),x.getWidth()===2&&(_+=1))}if(_<0)return[p,c]}p++,d=0}return[p,d]}}o.LinkComputer=a}},n={};function i(g){var o=n[g];if(o!==void 0)return o.exports;var a=n[g]={exports:{}};return r[g](a,a.exports,i),a.exports}var l={};return(()=>{var g=l;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const o=i(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(y,p){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(y=f,p={}){this._handler=y,this._options=p}activate(y){this._terminal=y;const p=this._options,v=p.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,p))}dispose(){var y;(y=this._linkProvider)===null||y===void 0||y.dispose()}}})(),l})())})(lv);var Lx=lv.exports;function cv({agentGated:e=!1}={}){const t=O.useRef(null),[r,n]=O.useState(null),[i,l]=O.useState(!1),[g,o]=O.useState(!1),[a,f]=O.useState(null);return O.useEffect(()=>{if(!t.current)return;let y=!1,p=null,v=null,_=null;const S=window.location.protocol==="https:"?"wss":"ws",x=new WebSocket(`${S}://${window.location.host}/api/agent/ws`),d=()=>{if(v||!t.current)return v;const u=new Px.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}),c=new Mx.FitAddon;u.loadAddon(c),u.loadAddon(new Lx.WebLinksAddon),u.open(t.current);const h=()=>{if(!(y||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{c.fit()}catch{}};return p=window.requestAnimationFrame(h),_=new ResizeObserver(()=>{h()}),_.observe(t.current),u.onData(m=>{x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({kind:"input",data:m}))}),u.onResize(({cols:m,rows:w})=>{x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({kind:"resize",cols:m,rows:w}))}),v=u,u};return x.onopen=()=>{l(!0),d()},x.onclose=()=>l(!1),x.onerror=()=>l(!1),x.onmessage=u=>{try{const c=JSON.parse(u.data);c.kind==="data"&&typeof c.data=="string"?v==null||v.write(c.data):c.kind==="meta"?(n({active:!!c.autoMode,reason:c.reason??""}),typeof c.agentReady=="boolean"&&o(c.agentReady)):c.kind==="auth_url"&&typeof c.url=="string"||(c.kind==="error"?c.recoverable&&c.remediation?f({message:c.message??"agent failed to start",remediation:c.remediation}):v==null||v.write(`\r
|
|
57
|
+
\x1B[31m[error] ${c.message??"unknown error"}\x1B[0m\r
|
|
58
|
+
`):c.kind==="exit"&&(v==null||v.write(`\r
|
|
59
|
+
\x1B[33m[claude session exited]\x1B[0m\r
|
|
60
|
+
`)))}catch{}},()=>{y=!0,p!==null&&window.cancelAnimationFrame(p),x.close(),_==null||_.disconnect(),v==null||v.dispose()}},[]),s.jsxs("div",{className:"h-full w-full flex flex-col",style:{background:"var(--bg-sunken)"},children:[s.jsxs("div",{className:"px-4 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-elevated)"},children:[s.jsx("span",{className:"j-mono text-[11px]",style:{color:i?"var(--vow-green)":"var(--fg-dim)",letterSpacing:"0.05em"},children:i?"● connected":"○ disconnected"}),r&&s.jsx("span",{className:"j-label",style:{color:r.active?"var(--accent-gold)":"var(--fg-dim)",fontSize:"10px"},title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),a&&s.jsxs("div",{className:"px-5 py-4 m-3 flex flex-col gap-2",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[s.jsx("span",{className:"j-label",style:{color:"var(--break-red)"},children:"Agent panel unavailable"}),s.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:a.message}),a.remediation&&s.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-dim)"},children:[s.jsx("span",{style:{color:"var(--fg-muted)"},children:"Fix · "}),a.remediation]})]}),s.jsx("div",{ref:t,className:"flex-1 w-full",style:{background:"var(--bg-sunken)",padding:"12px",minHeight:"400px",visibility:e&&!g?"hidden":"visible",display:e&&!g?"none":"block"}}),e&&!g&&!a&&s.jsx(Bx,{})]})}function Bx(){return s.jsx("div",{className:"flex-1 w-full flex items-center justify-center px-6",style:{background:"var(--bg-sunken)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-[34ch] text-center",children:[s.jsx("span",{"aria-hidden":"true",style:{width:"8px",height:"8px",borderRadius:"50%",background:"var(--seer-violet)",boxShadow:"0 0 0 0 rgba(122, 109, 176, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),s.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"The agent will come online once harness setup is complete."})]})})}const Ix={pluginBuilderUi:!1,embeddedAgent:!1};function Ou(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?Ix:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}const Ax={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"}},Ox={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function Fx(e){return Ax[e]??{phase:1,subState:null}}function Nx(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}function Hx(){var y;const{data:e,isLoading:t}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:2e3});if(t||!e)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg)"},children:s.jsx("span",{className:"j-label",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:i,subState:l}=Fx(e.currentStep),g=e.error,o=e.services.find(p=>p.step===e.currentStep)??e.services[0],a=(y=e.funding)==null?void 0:y.targetMet,f=Ou().embeddedAgent;return s.jsxs("div",{className:"min-h-screen w-full",style:{background:"var(--bg)",color:"var(--fg)"},children:[s.jsx("style",{children:Gx}),s.jsxs("div",{className:"max-w-[1280px] mx-auto px-10 py-10 grid grid-cols-12 gap-10",children:[s.jsxs("section",{className:`col-span-12 ${f?"lg:col-span-7":""} flex flex-col gap-8`,children:[s.jsxs("header",{className:"flex items-baseline justify-between",children:[s.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · Onboarding"}),s.jsx(zx,{chain:e.chain})]}),s.jsx("h1",{className:"j-display",style:{fontSize:"76px",color:"var(--fg)",lineHeight:1.05},children:"Welcome to Jinn."}),s.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(p=>{var S;const v=Nx(p,i,a),_=g&&p===i;return s.jsxs($x,{phase:p,status:_?"error":v,children:[_&&s.jsx(Jx,{envelope:g,chainExplorerBase:r}),!_&&p===2&&v==="active"&&n&&s.jsx(Tx,{address:n,minimumWei:((S=e.funding)==null?void 0:S.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!_&&p===3&&v==="active"&&s.jsx(Vx,{label:l??"Working",step:e.currentStep,serviceIndex:o==null?void 0:o.index,serviceId:o==null?void 0:o.service_id,safeAddress:o==null?void 0:o.safe_address,explorer:r,contractRevertReason:(o==null?void 0:o.error_revert_reason)??null})]},p)})})]}),f&&s.jsxs("aside",{className:"col-span-12 lg:col-span-5 flex flex-col gap-3",children:[s.jsx("span",{className:"j-label",children:"Ask Claude"}),s.jsx("div",{className:"j-card overflow-hidden",style:{height:"calc(100vh - 220px)",minHeight:"520px"},children:s.jsx(cv,{agentGated:!1})})]})]})]})}function zx({chain:e}){const t=e==="base";return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"j-label",style:{color:t?"var(--fg-dim)":"var(--accent-sky)",padding:"4px 10px",border:t?"1px solid var(--border)":"1px solid var(--accent-sky)",borderRadius:"var(--radius-1)"},children:"Testnet"}),s.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",padding:"4px 10px",border:"1px dashed var(--border)",borderRadius:"var(--radius-1)",opacity:.6},title:"Mainnet support is coming. v1 supports testnet only.",children:"Mainnet · soon"})]})}function $x({phase:e,status:t,children:r}){const n=t==="active",i=t==="error",l=t==="done",g=n||i,o=i?"var(--break-red)":n?"var(--accent-gold)":l?"var(--accent-sky)":"var(--fg-dim)",a=i||n?"var(--fg)":l?"var(--fg-muted)":"var(--fg-dim)";return s.jsxs("li",{className:"phase-row","data-status":t,style:{borderTop:"1px solid var(--border)"},children:[s.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[s.jsx("span",{className:"j-mono text-xs tabular-nums",style:{color:o,letterSpacing:"0.05em",transition:"color 240ms ease"},children:String(e).padStart(2,"0")}),s.jsx("span",{className:g?"j-display":"j-mono",style:{fontSize:g?"28px":"14px",color:a,lineHeight:1.2,transition:"color 240ms ease"},children:Ox[e]}),s.jsx(Wx,{status:t})]}),g&&r&&s.jsx("div",{className:"ml-12 pb-5 pr-2",style:{animation:"jinnFadeSlide 320ms ease-out both"},children:r})]})}function Wx({status:e}){return e==="done"?s.jsx("span",{className:"j-label",style:{color:"var(--vow-green)",fontSize:"10px"},children:"✓ Done"}):e==="error"?s.jsx("span",{className:"j-label",style:{color:"var(--break-red)",fontSize:"10px"},children:"! Failed"}):e==="active"?s.jsxs("span",{className:"j-label flex items-center gap-2",style:{color:"var(--accent-gold)",fontSize:"10px"},children:[s.jsx(Ux,{}),"Active"]}):s.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",fontSize:"10px"},children:"Queued"})}function Ux(){return s.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--accent-gold)",boxShadow:"0 0 0 0 rgba(220, 184, 102, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}})}function Jx({envelope:e,chainExplorerBase:t}){const r=qx(e),n=Kx(e.generatedAt),[i,l]=O.useState("idle"),[g,o]=O.useState(null),a=e.details,y=(typeof(a==null?void 0:a.category)=="string"?a.category:void 0)==="insufficient_funds",p=typeof(a==null?void 0:a.address)=="string"?a.address:null,v=typeof(a==null?void 0:a.requiredWei)=="string"?a.requiredWei:typeof(a==null?void 0:a.needWei)=="string"?a.needWei:null,_=typeof(a==null?void 0:a.haveWei)=="string"?a.haveWei:null,x=(typeof(a==null?void 0:a.txHash)=="string"?a.txHash:null)??r,d=O.useCallback(async()=>{l("retrying"),o(null);try{await ee.retryBootstrap(),l("success")}catch(u){l("error"),o(u instanceof Error?u.message:String(u))}},[]);return s.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsxs("span",{className:"j-label",style:{color:"var(--break-red)"},children:["Bootstrap halted · ",e.code]}),n&&s.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:n})]}),s.jsx("p",{className:"j-mono text-xs break-words",style:{color:"var(--fg)"},children:e.message}),y&&p&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(oo,{label:"Send ETH to",children:p}),v&&s.jsx(oo,{label:"Required",children:nl(v)}),_&&s.jsx(oo,{label:"Currently have",children:nl(_)}),v&&_&&s.jsx(oo,{label:"Shortfall",children:nl((BigInt(v)-BigInt(_)).toString())})]}),!y&&e.hint&&s.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:"Fix · "}),e.hint]}),x&&s.jsx("a",{href:`${t}/tx/${x}`,target:"_blank",rel:"noopener noreferrer",className:"j-mono text-[11px] hover:underline self-start",style:{color:"var(--accent-sky)"},children:"view failed tx ↗"}),s.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[s.jsx("button",{type:"button",onClick:()=>{d()},disabled:i==="retrying",className:"j-label",style:{padding:"5px 12px",borderRadius:"var(--radius-2)",border:"1px solid var(--break-red)",background:i==="retrying"?"rgba(168, 90, 90, 0.15)":"transparent",color:i==="retrying"?"var(--fg-dim)":"var(--break-red)",cursor:i==="retrying"?"default":"pointer",fontSize:"11px"},children:i==="retrying"?"Retrying…":i==="success"?"Resuming…":"Retry"}),i==="success"&&s.jsx("span",{className:"j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:"Daemon resumed — waiting for bootstrap to complete"}),i==="error"&&g&&s.jsx("span",{className:"j-mono text-[11px]",style:{color:"var(--break-red)"},children:g})]}),i==="idle"&&s.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:["Once you've addressed the cause above, click Retry or"," ",s.jsx("code",{style:{color:"var(--fg-muted)"},children:"jinn run"})," to resume from the persisted state."]})]})}function oo({label:e,children:t}){return s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("span",{className:"j-mono text-[11px] shrink-0",style:{color:"var(--fg-dim)",minWidth:"100px"},children:e}),s.jsx("span",{className:"j-mono text-[11px] break-all",style:{color:"var(--fg)"},children:t})]})}function nl(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 qx(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 i of t){if(typeof i!="string")continue;const l=/(0x[a-fA-F0-9]{64})/.exec(i);if(l)return l[1]}return null}function Kx(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 Vx({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:i,explorer:l,contractRevertReason:g}){const o=!!g;return s.jsxs("div",{className:"px-4 py-3 flex flex-col gap-3",style:{border:o?"1px solid var(--break-red)":"1px solid var(--border)",borderRadius:"var(--radius-2)",background:"var(--bg-elevated)"},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:o?"var(--break-red)":"var(--accent-sky)",boxShadow:o?"0 0 0 0 rgba(168, 90, 90, 0.6)":"0 0 0 0 rgba(122, 167, 220, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),s.jsx("span",{className:"j-mono text-sm",style:{color:"var(--fg)"},children:e}),s.jsx("span",{className:"j-mono text-[10px] ml-auto",style:{color:o?"var(--break-red)":"var(--fg-dim)"},children:o?"binding failed · will retry":"running · no action needed"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[120px_1fr] gap-x-4 gap-y-1 j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:"Current step"}),s.jsx("span",{children:Qx(t)}),r!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:"Service"}),s.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:"Safe"}),s.jsx("a",{href:`${l}/address/${i}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline break-all",style:{color:"var(--accent-sky)"},children:i})]}),g&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{color:"var(--fg-dim)"},children:"Contract revert reason"}),s.jsx("code",{className:"text-xs break-words",style:{color:"var(--break-red)"},children:g})]})]})]})}function Qx(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const Gx=`
|
|
61
|
+
@keyframes jinnPulse {
|
|
62
|
+
0% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0.55); }
|
|
63
|
+
70% { box-shadow: 0 0 0 10px rgba(220, 184, 102, 0); }
|
|
64
|
+
100% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0); }
|
|
65
|
+
}
|
|
66
|
+
@keyframes jinnFadeSlide {
|
|
67
|
+
0% { opacity: 0; transform: translateY(-4px); }
|
|
68
|
+
100% { opacity: 1; transform: translateY(0); }
|
|
69
|
+
}
|
|
70
|
+
/* Smooth title scaling when a row activates */
|
|
71
|
+
.phase-row[data-status="active"] {
|
|
72
|
+
background:
|
|
73
|
+
linear-gradient(90deg, rgba(220, 184, 102, 0.04) 0%, transparent 60%);
|
|
74
|
+
transition: background 320ms ease;
|
|
75
|
+
}
|
|
76
|
+
`;function Yx({notice:e}){return s.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,style:{display:"flex",gap:12,alignItems:"baseline"},children:[s.jsx("span",{"aria-hidden":"true",style:{textTransform:"uppercase",fontSize:"11px"},children:e.severity}),s.jsx("span",{style:{flex:1},children:e.message}),e.jumpTo?s.jsx(Ct,{href:e.jumpTo,children:"resolve →"}):null]})}function Xx({notices:e}){return e.length===0?null:s.jsx("section",{"aria-label":"Notifications",role:"region",children:s.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,r)=>s.jsx(Yx,{notice:t},`${t.kind}-${r}`))})})}async function Zx(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const i=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json"},cache:"no-store",signal:r.signal});return i.status===502||i.status===503||i.status===504?{ok:!1,error:`daemon unavailable (HTTP ${i.status})`}:{ok:!0,error:null}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}finally{clearTimeout(n)}}function e0(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:i=3500,probeUrl:l="/v1/status"}=e,[g,o]=O.useState({status:"connected",lastConnectedAt:Date.now()}),a=O.useRef(0),f=O.useRef(t),y=O.useRef(!1);return O.useEffect(()=>{y.current=!1;let p=null;const v=S=>{y.current||(p=setTimeout(_,S))},_=async()=>{const S=await Zx(l,i);if(y.current)return;if(S.ok){a.current=0,f.current=t,o(d=>d.status==="connected"?d:{status:"connected",lastConnectedAt:Date.now()}),v(t);return}a.current+=1,a.current>=r?(o(d=>d.status==="disconnected"?{...d,attempts:d.attempts+1,lastError:S.error}:{status:"disconnected",since:Date.now(),lastError:S.error,attempts:1}),f.current=Math.min(Math.max(f.current*2,t*2),n),v(f.current)):v(t)};return _(),()=>{y.current=!0,p!==null&&clearTimeout(p)}},[t,r,n,i,l]),g}const uv=O.createContext({restartPending:!1,setRestartPending:()=>{}});function dv(){return O.useContext(uv)}const t0=3,r0=1e3*60*60*24*90;function n0(e){if(!e)return 0n;try{return BigInt(e)}catch{return 0n}}function s0(e){const t=[],r=e.status;return e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<t0&&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||t.push({kind:"harness_not_ready",severity:"blocking",message:`Harness ${r.harness.name} is not ready${r.harness.reason?`: ${r.harness.reason}`:""}.`,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"}),r.services.some(n=>n.evicted)&&t.push({kind:"service_evicted",severity:"blocking",message:"A service has been evicted from staking. Re-stake to resume.",jumpTo:"/overview"}),r.services.some(n=>!n.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()>r0&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),n0(r.rewards.claimableWei)>0n&&t.push({kind:"claim_available",severity:"info",message:"JINN rewards are claimable.",jumpTo:"/overview"}),t}const vh={blocking:0,warning:1,info:2};function i0(e,t,r){var y,p,v;const n=e??{},i=t??{},l=String(((y=n.masterGas)==null?void 0:y.balanceWei)??"0");let g="0",o=Number.POSITIVE_INFINITY;try{const _=BigInt(l);g=_.toString(),o=_>0n?Number.POSITIVE_INFINITY:0}catch{}const a=Array.isArray((p=n.fleet)==null?void 0:p.services)?n.fleet.services:[],f=i.joinedSolverNets&&typeof i.joinedSolverNets=="object"?i.joinedSolverNets:{};return{funds:{eth:g,runwayDays:o},rewards:{claimableWei:String(((v=n.rewards)==null?void 0:v.pendingStakingRewardsWei)??"0")},harness:{ready:!0,name:"unknown"},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:a.map(_=>({evicted:!!(_!=null&&_.evicted),safeBound:(_==null?void 0:_.safeBoundToAgent)!==!1})),joinedSolverNets:f,passwordRotatedAt:void 0}}function o0(){const e=e0(),{restartPending:t}=dv(),r=ue({queryKey:["status"],queryFn:()=>ee.getStatus()}),n=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap()});return O.useMemo(()=>e.status==="disconnected"?[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}]:!r.data||!n.data?[]:[...s0({bootstrap:n.data,status:i0(r.data,n.data,t)})].sort((l,g)=>vh[l.severity]-vh[g.severity]),[e.status,t,r.data,n.data])}function a0({header:e,tabs:t,rail:r,children:n}){const i=r!=null,l=o0();return s.jsxs("div",{className:"w-full",style:{background:"var(--bg)",color:"var(--fg)",display:"grid",gridTemplateRows:l.length>0?"auto auto auto minmax(0, 1fr)":"auto auto minmax(0, 1fr)",gridTemplateColumns:i?"1fr 320px":"1fr",height:"100vh",overflow:"hidden"},children:[s.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:e}),s.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:t}),l.length>0&&s.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:s.jsx(Xx,{notices:l})}),s.jsx("main",{style:{overflowY:"auto",minHeight:0},children:n}),i&&s.jsx("aside",{style:{borderLeft:"1px solid var(--border)",overflowY:"auto",minHeight:0,height:"100%"},children:r})]})}function l0(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function c0({network:e,rpcHealthy:t,masterAddress:r}){return s.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 24px"},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:s.jsx(Ct,{href:"/overview",style:{textDecoration:"none",color:"var(--fg)"},children:s.jsx("span",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"26px",color:"var(--fg)"},children:"jinn operator"})})}),s.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[s.jsx("span",{style:{border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 8px"},children:e}),s.jsxs("span",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[s.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:t?"var(--vow-green)":"var(--break-red)"}}),t?"rpc healthy":"rpc unreachable"]}),s.jsxs("span",{style:{color:"var(--fg-dim)"},children:["master ",l0(r)]})]})]})}const mh=[{path:"/overview",label:"Dashboard"},{path:"/operator",label:"Settings"}];function u0(){const[e]=wn(),t=e==="/launcher"||e.startsWith("/launcher/"),{data:r}=ue({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>ee.solvernets.listLaunched(),refetchInterval:3e4,enabled:!t}),n=Ou().pluginBuilderUi?[...mh,{path:"/build",label:"Build"}]:mh,l=t||((r==null?void 0:r.records.length)??0)>0?[...n,{path:"/launcher",label:"Launcher"}]:n;return s.jsx("nav",{style:{display:"flex",padding:"0 24px"},children:l.map(g=>{const o=e===g.path||e.startsWith(`${g.path}/`);return s.jsx(Ct,{href:g.path,"data-active":o?"true":"false",style:{padding:"14px 18px",fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:o?"var(--fg)":"var(--fg-muted)",borderBottom:`1px solid ${o?"var(--accent-sky)":"transparent"}`,marginBottom:"-1px",textDecoration:"none"},children:g.label},g.path)})})}function d0({agentGated:e}){return s.jsxs("div",{className:"agent-rail",style:{padding:"16px",display:"flex",flexDirection:"column",gap:"12px",height:"100%",minWidth:0,overflow:"hidden"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",overflowWrap:"anywhere"},children:"Claude"}),s.jsx(cv,{agentGated:e})]})}function h0({totalEth:e,runwayDays:t,perRole:r,lastPasswordRotationAt:n,onTopUp:i,onChangePassword:l,actionsDisabled:g=!1}){const[o,a]=O.useState(!1);return s.jsxs("article",{role:"region","aria-label":"Funds",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Funds"}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:"28px",fontWeight:500,color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"-0.02em"},children:e}),s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)",fontWeight:500},children:"ETH"}),s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-dim)"},children:"·"}),s.jsxs("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:[t,"d runway"]})]}),s.jsx("button",{type:"button","aria-expanded":o,onClick:()=>a(f=>!f),style:{alignSelf:"flex-start",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--border)",color:"var(--fg-muted)",background:"transparent",borderRadius:"999px",padding:"2px 8px",cursor:"pointer"},children:o?"hide":"per role"}),o&&s.jsx("dl",{style:{margin:0,padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"6px",background:"var(--bg-sunken, rgba(0,0,0,0.15))",display:"flex",flexDirection:"column",gap:"8px"},children:[{key:"master",label:"Master",value:r.master},{key:"agent",label:"Agent",value:r.agent},{key:"safe",label:"Safe",value:r.safe}].map(({key:f,label:y,value:p})=>s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"12px"},children:[s.jsx("dt",{style:{fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",margin:0},children:y}),s.jsx("dd",{style:{fontSize:"13px",color:"var(--fg)",margin:0,fontFamily:"'JetBrains Mono', monospace"},children:p})]},f))}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:"4px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[s.jsxs("span",{style:{fontSize:"11px",color:"var(--fg-dim)"},children:["last password cycle:"," ",n?s.jsx("time",{dateTime:n,style:{color:"var(--fg-muted)"},children:n}):s.jsx("span",{style:{color:"var(--fg-muted)"},children:"never"})]}),s.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[s.jsx("button",{type:"button","aria-label":"Top up",onClick:i,disabled:g,style:{border:`1px solid ${g?"var(--border)":"var(--accent-sky)"}`,color:g?"var(--fg-dim)":"var(--accent-sky)",background:"transparent",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.1em",textTransform:"uppercase",cursor:g?"not-allowed":"pointer",opacity:g?.55:1},children:"Top up"}),s.jsx("button",{type:"button","aria-label":"Change password",onClick:l,style:{border:"1px solid var(--border)",color:"var(--fg-muted)",background:"transparent",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.1em",textTransform:"uppercase",cursor:"pointer"},children:"Change password"})]})]})]})}function f0({children:e,action:t,activeAction:r,onClick:n,forceDisabled:i}){const l=r===t,g=r!==null||(i??!1);return s.jsx("button",{type:"button",onClick:n,disabled:g,style:{alignSelf:"flex-start",marginTop:"14px",background:"transparent",border:"1px solid var(--accent-sky)",borderRadius:"6px",color:"var(--accent-sky)",cursor:l?"wait":g?"not-allowed":"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",opacity:g&&!l?.55:1,padding:"8px 10px",textTransform:"uppercase"},children:l?"Working...":e})}function p0({serviceId:e,onRestake:t}){const[r,n]=O.useState(!1);function i(){!e||!t||r||(n(!0),Promise.resolve(t(e)).finally(()=>n(!1)))}return s.jsxs("div",{style:{marginTop:"10px"},children:[s.jsx("span",{style:{display:"block",color:"var(--fg-warning, #e8a028)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.1em"},children:"Service evicted — restoring liveness"}),e!=null&&t&&s.jsx("button",{type:"button","data-testid":"restake-button",onClick:i,disabled:r,style:{marginTop:"8px",background:"transparent",border:"1px solid var(--fg-warning, #e8a028)",borderRadius:"6px",color:"var(--fg-warning, #e8a028)",cursor:r?"wait":"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",opacity:r?.55:1,padding:"6px 10px",textTransform:"uppercase"},children:r?"Working...":"Re-stake now"})]})}function g0({label:e,value:t,unit:r,sub:n,action:i}){return s.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",minWidth:0},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"block",marginBottom:"12px"},children:e}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"24px",fontWeight:500,color:"var(--fg)",letterSpacing:0,display:"block"},children:t}),r&&s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"14px",marginTop:"4px",display:"block",fontFamily:"'JetBrains Mono', monospace"},children:r}),n&&s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px",marginTop:"6px",display:"block",fontFamily:"'JetBrains Mono', monospace"},children:n}),i]})}function v0({label:e,state:t,dot:r,reason:n,action:i,evicted:l,evictedServiceId:g,onRestake:o}){return s.jsxs("div",{"data-testid":"overview-status-stat","data-state":t,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",minWidth:0},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"block",marginBottom:"12px"},children:"Status"}),s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)",letterSpacing:0,display:"flex",alignItems:"center",gap:"10px",minHeight:"29px"},children:[s.jsx("span",{"aria-hidden":"true",style:{color:r,fontSize:"16px",lineHeight:1},children:"●"}),e]}),n&&s.jsx("span",{"data-testid":"overview-status-reason",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1.4,marginTop:"6px",display:"block",wordBreak:"break-word"},children:n}),l?s.jsx(p0,{serviceId:g,onRestake:o}):null,i]})}function m0({tasksDelivered:e,statusLabel:t,statusState:r,statusDot:n,statusReason:i,activeAction:l,evicted:g=!1,evictedServiceId:o,onRestart:a,onRestake:f}){return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"16px"},children:[s.jsx(g0,{label:"Solutions delivered",value:e}),s.jsx(v0,{label:t,state:r,dot:n,reason:i,evicted:g,evictedServiceId:o,onRestake:f,action:s.jsx(f0,{action:"Restart node",activeAction:l,onClick:a,children:"Restart"})})]})}function y0({claimableJinn:e,claimedJinnLifetime:t,lastClaimAt:r,onClaim:n}){const i=parseFloat(e)>0;return s.jsxs("article",{role:"region","aria-label":"Rewards",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Rewards"}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:"28px",fontWeight:500,color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"-0.02em"},children:e}),s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)",fontWeight:500},children:"JINN"}),s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-dim)"},children:"claimable"})]}),s.jsx("dl",{style:{margin:0,padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"6px",background:"var(--bg-sunken, rgba(0,0,0,0.15))",display:"flex",flexDirection:"column",gap:"8px"},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"12px"},children:[s.jsx("dt",{style:{fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",margin:0},children:"claimed"}),s.jsxs("dd",{style:{fontSize:"13px",color:"var(--fg)",margin:0,fontFamily:"'JetBrains Mono', monospace",display:"flex",gap:"4px",alignItems:"baseline"},children:[s.jsx("span",{children:t}),s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)"},children:"JINN"})]})]})}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:"4px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[s.jsxs("span",{style:{fontSize:"11px",color:"var(--fg-dim)"},children:["last claim:"," ",r?s.jsx("time",{dateTime:r,style:{color:"var(--fg-muted)"},children:r}):s.jsx("span",{style:{color:"var(--fg-muted)"},children:"never"})]}),s.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:s.jsx("button",{type:"button","aria-label":"Claim",onClick:n,disabled:!i,style:{border:`1px solid ${i?"var(--accent-sky)":"var(--border)"}`,color:i?"var(--accent-sky)":"var(--fg-dim)",background:"transparent",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.1em",textTransform:"uppercase",cursor:i?"pointer":"not-allowed",opacity:i?1:.5},children:"Claim"})})]})]})}const _0=new Set(["COMPLETE","FAILED"]),x0={href:"/overview/activity",label:"View activity"},yh=new Set(["complete","safe_binding_pending"]);function S0(e){return e.code.includes("harness")||e.configField,"/operator#solvernets"}function b0(e){return e.code.includes("harness"),"Configure SolverNet"}function w0(e){if(!Number.isFinite(e)||e<0)return"—";if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){const t=Math.floor(e/6e4),r=Math.round(e%6e4/1e3);return r>0?`${t}m ${r}s`:`${t}m`}return`${Math.round(e/36e5)}h`}function C0(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,16)}function k0(e){const t=(e??[]).filter(o=>!_0.has(o.state)),r=t.filter(o=>o.taskRole==="restoration").length,n=t.filter(o=>o.taskRole==="evaluation").length,i=t.length,l=t.length===0?0:Date.now()-Math.min(...t.map(o=>o.stateUpdatedAt));let g;return r>0&&n>0?g=`${r} restoring · ${n} evaluating`:r>0?g=`${r} ${r===1?"task":"tasks"} restoring`:n>0?g=`${n} ${n===1?"task":"tasks"} evaluating`:g=`${i} ${i===1?"task":"tasks"} in flight`,{line:g,longestMs:l}}function E0(e){return!!e&&Object.keys(e).length>0}function j0(e,t,r=x0){var y,p,v,_,S,x,d,u,c;const n=r,i=((y=e==null?void 0:e.fleet)==null?void 0:y.services)??[];if(i.length>0){const h=i.filter(m=>yh.has(m.step)).length;if(h<i.length){const m=((p=i.find(w=>!yh.has(w.step)))==null?void 0:p.step)??"—";return{state:"bootstrapping",line:`${h}/${i.length} services complete`,meta:`next: ${m}`,cta:n}}}const l=E0(t),g=(((_=(v=e==null?void 0:e.predictionV1)==null?void 0:v.operator)==null?void 0:_.diagnostics)??[]).filter(h=>h.severity==="error"&&h.code!=="prediction_solvernet_disabled"&&!(h.code==="prediction_solvernet_missing"&&l));if(g.length>0){const h=g[0],m=g.length-1;return{state:"attention",line:h.message,meta:"",cta:{label:b0(h),href:S0(h)},...m>0?{attentionMore:m}:{}}}const o=e==null?void 0:e.taskRuns;if((((S=o==null?void 0:o.totals)==null?void 0:S.activeTaskRuns)??((d=(x=e==null?void 0:e.predictionV1)==null?void 0:x.totals)==null?void 0:d.activeTaskRuns)??0)>0){const h=(o==null?void 0:o.inFlight)??(o==null?void 0:o.recentTasks),m=k0(h??((u=e==null?void 0:e.predictionV1)==null?void 0:u.recentTasks));return{state:"working",line:m.line,meta:m.longestMs>0?`longest in flight ${w0(m.longestMs)}`:"",cta:n}}const f=(((c=e==null?void 0:e.activity)==null?void 0:c.recent)??[]).map(h=>h.ts).filter(h=>!!h).sort().at(-1);return{state:"idle",line:"waiting for next task",meta:f?`idle since ${C0(f)}`:"",cta:n}}const R0={bootstrapping:{dot:"var(--accent-sky)",eyebrow:"Now · Bootstrapping",border:"var(--border)"},attention:{dot:"var(--break-red)",eyebrow:"Now · Needs attention",border:"var(--border-accent)"},working:{dot:"var(--vow-green)",eyebrow:"Now · Live",border:"var(--border)"},idle:{dot:"var(--fg-muted)",eyebrow:"Now · Live",border:"var(--border)"}},T0={bootstrapping:"BOOTSTRAPPING",attention:"ATTENTION",working:"WORKING",idle:"IDLE"};function jn({label:e,value:t,tone:r}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:r==="warn"?"var(--wane)":"var(--fg)"},children:t})]})}function D0({name:e,totals:t}){return s.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Network · ",e]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(72px, 1fr))",gap:"16px 24px"},children:[s.jsx(jn,{label:"tasks",value:t.tasks}),s.jsx(jn,{label:"active",value:t.active}),s.jsx(jn,{label:"solutions",value:t.solutions}),s.jsx(jn,{label:"verdicts",value:t.verdicts}),s.jsx(jn,{label:"settled fail",value:t.settledFailed,tone:t.settledFailed>0?"warn":void 0}),s.jsx(jn,{label:"local err",value:t.localErrors,tone:t.localErrors>0?"warn":void 0})]})]})}function P0(e){return e==="solving"?"Solver":"Evaluator"}function M0({name:e,roles:t,state:r,waitingMessage:n}){const i=r==="live"?"var(--vow-green)":r==="available"?"var(--fg-muted)":"var(--fg-dim)";return s.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Solving on"}),s.jsx("span",{style:{fontSize:"11px",color:i,textTransform:"uppercase",letterSpacing:"0.14em"},children:r.replace("_"," ")})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px",color:"var(--fg)",fontSize:"14px",flexWrap:"wrap"},children:[s.jsx("span",{children:e}),s.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"}),s.jsx("span",{style:{color:"var(--fg-muted)"},children:t.length>1?"Roles":"Role"}),s.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"}),t.length===0?s.jsx("span",{style:{color:"var(--fg-dim)"},children:"none"}):t.map((l,g)=>s.jsx("span",{"data-role":l,style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"999px",padding:"2px 10px",marginLeft:g===0?0:"4px"},children:P0(l)},l))]}),s.jsx(Ct,{href:"/operator#solvernets",style:{color:"var(--accent-sky)",fontSize:"11px",textDecoration:"none",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Change →"})]}),n&&s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:n})]})}function L0(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function B0({agentId:e,chain:t,safeAddress:r,services:n=[],bindingError:i}){const l=n.find(x=>x.agentId!==null&&!x.safeBoundToAgent),[g,o]=O.useState(!1),[a,f]=O.useState(!1),[y,p]=O.useState(null),[v,_]=O.useState(i??null),S=async()=>{if(l){f(!0),p(null),_(null);try{const d=(await ee.retryAgentBinding({serviceIndex:l.index})).attempts[0];(d==null?void 0:d.status)==="success"?(p("success"),o(!1)):(p("reverted"),_((d==null?void 0:d.detail)??"Bind reverted on chain."))}catch(x){p("reverted"),_(x instanceof Error?x.message:String(x))}finally{f(!1)}}};return s.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Identity"}),s.jsxs("div",{style:{display:"flex",gap:"32px",fontSize:"13px",flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Agent"}),s.jsxs("span",{style:{color:"var(--fg)",display:"flex",gap:"8px",alignItems:"center"},children:[e!==null?`#${e}`:"—",l&&s.jsx("button",{type:"button",onClick:()=>o(x=>!x),style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",color:"var(--wane)",background:"transparent",borderRadius:"999px",padding:"1px 6px",cursor:"pointer"},children:"binding pending"}),y==="success"&&s.jsx("span",{style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",border:"1px solid var(--vow-green)",color:"var(--vow-green)",borderRadius:"999px",padding:"1px 6px"},children:"bound"})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Chain"}),s.jsx("span",{style:{color:"var(--fg)"},children:t})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Safe"}),s.jsx("span",{style:{color:"var(--fg)"},children:L0(r)})]})]}),g&&l&&s.jsxs("div",{style:{marginTop:"8px",padding:"12px 14px",border:"1px solid var(--wane)",borderRadius:"6px",background:"rgba(184, 128, 47, 0.07)",display:"flex",flexDirection:"column",gap:"8px"},children:[s.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},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."]}),v&&s.jsx("span",{style:{fontSize:"11px",color:"var(--break-red)"},children:v}),s.jsx("button",{type:"button",onClick:()=>{S()},disabled:a,style:{alignSelf:"flex-start",border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"8px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:a?"wait":"pointer"},children:a?"Retrying…":"Retry binding"})]})]})}function I0({children:e}){const[t,r]=O.useState(!1);return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[s.jsxs("button",{type:"button",onClick:()=>r(n=>!n),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",cursor:"pointer",padding:0},children:[t?"▾":"▸"," Advanced details"]}),t&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:e??s.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",background:"var(--bg-elevated)",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"No additional details available."})})]})}function A0(){const[e,t]=O.useState(null),[r,n]=O.useState(!0);if(O.useEffect(()=>{(async()=>{try{const a=await fetch("/api/harness/status",{credentials:"same-origin"});if(a.ok){const f=await a.json();t(f)}}catch{}finally{n(!1)}})()},[]),r||!e)return s.jsx("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:"Harness status unavailable"})});const i=e.mode==="train"?"var(--vow-green)":"var(--wane)",l=e.mode==="train"?"var(--vow-green)":"var(--wane)",g=e.lastModeSwitchAt?new Date(e.lastModeSwitchAt).toLocaleString():"Never";return s.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"4px"},children:[s.jsx("span",{style:{fontSize:"13px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--fg)"},children:"Harness Status"}),s.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:i}})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[s.jsxs("div",{children:[s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Mode"}),s.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:l,marginTop:"4px"},children:e.mode.toUpperCase()}),s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",marginTop:"6px",display:"block"},children:e.mode==="train"?"Contributing to substrate":"Benchmarking only"})]}),s.jsxs("div",{children:[s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Code Digest"}),s.jsxs("div",{style:{fontSize:"12px",fontFamily:"'JetBrains Mono', monospace",color:"var(--fg)",marginTop:"4px",wordBreak:"break-all"},children:[e.codeDigest.slice(0,16),"…"]})]})]}),e.lastModeSwitchAt&&s.jsxs("div",{style:{fontSize:"11px",color:"var(--fg-muted)",paddingTop:"8px",borderTop:"1px solid var(--border)",marginTop:"8px"},children:["Mode switched: ",g]})]})}function sl(e){if(e==="prediction-v1-baseline")return"predictionV1"}function ao(e){const t=[];for(const r of e)r==="solving"||r==="solver"?t.includes("solving")||t.push("solving"):(r==="evaluating"||r==="evaluator")&&(t.includes("evaluating")||t.push("evaluating"));return t}function O0(e,t,r,n){if(e)for(const[l,g]of Object.entries(e)){if(!g||typeof g!="object")continue;const o=Array.isArray(g.roles)?g.roles:[];if(o.length===0)continue;const a=ao(o),f=sl(g.harness);return{name:g.name??g.manifestCid??l,configId:g.manifestCid??l,roles:a.length>0?a:["solving"],...f?{scopedStatusKey:f}:{}}}if(t){for(const[l,g]of Object.entries(t)){if(!g||typeof g!="object"||!(g.manifestCid!==void 0||l.startsWith("baf")||l.startsWith("Qm")))continue;const a=Array.isArray(g.roles)?g.roles:[];if(a.length===0)continue;const f=ao(a),y=sl(g.harness);return{name:g.name??l,configId:g.manifestCid??l,roles:f.length>0?f:["solving"],...y?{scopedStatusKey:y}:{}}}for(const[l,g]of Object.entries(t)){if(!g||typeof g!="object")continue;const o=Array.isArray(g.roles)?g.roles:[],a=ao(o);if(g.enabled!==!0&&a.length===0)continue;const f=sl(g.harness)??(l==="prediction"?"predictionV1":void 0);return{name:g.name??l,configId:g.manifestCid??l,roles:a.length>0?a:["solving"],...f?{scopedStatusKey:f}:{}}}}const i=ao(n??[]);return r||i.length>0?{name:"prediction",configId:"prediction",roles:i.length>0?i:["solving"],scopedStatusKey:"predictionV1"}:null}function F0(e,t,r){if(((t==null?void 0:t.observedTasks)??0)>0||((t==null?void 0:t.activeTaskRuns)??0)>0||((t==null?void 0:t.completed)??0)>0||((t==null?void 0:t.failed)??0)>0)return((t==null?void 0:t.activeTaskRuns)??0)>0?"Working on current run.":"Waiting for the next available run.";if((e==null?void 0:e.scopedStatusKey)==="predictionV1")return r}function N0({events:e,filterKind:t}){const n=[...t?e.filter(i=>i.kind===t):e].sort((i,l)=>i.ts<l.ts?1:i.ts>l.ts?-1:0);return n.length===0?s.jsx("p",{children:"No events."}):s.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:n.map(i=>s.jsxs("li",{"data-kind":i.kind,style:{display:"flex",gap:12,alignItems:"baseline",padding:"6px 0"},children:[s.jsx("time",{dateTime:i.ts,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",minWidth:180},children:i.ts}),s.jsx("code",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",textTransform:"uppercase",minWidth:80},children:i.kind}),s.jsx("span",{style:{flex:1},children:i.message})]},i.id))})}const H0=new Set(["COMPLETE","FAILED"]);function z0(e){if(!Number.isFinite(e)||e<0)return"—";if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){const t=Math.floor(e/6e4),r=Math.round(e%6e4/1e3);return r>0?`${t}m ${r}s`:`${t}m`}return`${Math.round(e/36e5)}h`}function $0(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function hv({pollIntervalMs:e=5e3}={}){var f,y;const{data:t,isLoading:r,isError:n,error:i,refetch:l}=ue({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:e}),g=((f=t==null?void 0:t.taskRuns)==null?void 0:f.inFlight)??(((y=t==null?void 0:t.predictionV1)==null?void 0:y.recentTasks)??[]).filter(p=>!H0.has(p.state)),{events:o,connected:a}=sv();return s.jsxs(s.Fragment,{children:[s.jsxs("section",{"data-testid":"overview-activity-in-flight",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:s.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["In flight · ",g.length]})}),r&&s.jsx("p",{"data-testid":"overview-activity-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"12px"},children:"Loading…"}),n&&s.jsxs("div",{role:"alert","data-testid":"overview-activity-error",style:{border:"1px solid var(--break-red)",borderRadius:"6px",padding:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:i instanceof Error?i.message:"Failed to load activity."}),s.jsx("button",{type:"button",onClick:()=>{l()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",background:"transparent",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--fg)",padding:"6px 10px",cursor:"pointer"},children:"Retry"})]}),!r&&!n&&g.length===0&&s.jsx("p",{"data-testid":"overview-activity-in-flight-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No tasks in flight."}),g.length>0&&s.jsx("ul",{"data-testid":"overview-activity-in-flight-list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"0"},children:g.map(p=>s.jsxs("li",{"data-testid":"overview-activity-in-flight-row",style:{display:"grid",gridTemplateColumns:"110px 110px 1fr 80px",gap:"12px",padding:"10px 0",borderTop:"1px solid var(--border)",fontSize:"12px"},children:[s.jsx("span",{style:{color:"var(--accent-sky)",textTransform:"uppercase",letterSpacing:"0.12em",fontSize:"11px"},children:p.state}),s.jsx("span",{style:{color:"var(--fg-muted)"},children:p.taskRole??"—"}),s.jsxs("span",{style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:[p.solverType?`${p.solverType} · `:"",$0(p.requestId)]}),s.jsx("span",{style:{color:"var(--fg-muted)",textAlign:"right"},children:z0(Date.now()-p.stateUpdatedAt)})]},p.requestId))})]}),s.jsxs("section",{"data-testid":"overview-activity-recent",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Recent · ",o.length]}),s.jsxs("span",{style:{fontSize:"11px",color:a?"var(--vow-green)":"var(--fg-dim)",display:"flex",gap:"5px",alignItems:"center"},children:[s.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:a?"var(--vow-green)":"var(--fg-dim)"}}),a?"live":"disconnected"]})]}),o.length===0&&s.jsx("p",{"data-testid":"overview-activity-recent-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No recent activity yet."}),o.length>0&&s.jsx("div",{"data-testid":"overview-activity-recent-list",children:s.jsx(N0,{events:o})})]})]})}function _h(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function W0(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function U0(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function J0(){var J,U,j,D,M,A,F,q,G,X,K,T,N,W,$,ne;const[e,t]=O.useState(null),[r,n]=O.useState(null),[,i]=wn(),l=Jr(),{setRestartPending:g}=dv(),{data:o}=ue({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:5e3}),{data:a}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:3e4}),f=(J=o==null?void 0:o.predictionV1)==null?void 0:J.operator,y=O0(a==null?void 0:a.joinedSolverNets,a==null?void 0:a.solverNets,((U=f==null?void 0:f.solverNet)==null?void 0:U.enabled)===!0,(j=f==null?void 0:f.solverNet)==null?void 0:j.roles),p=(D=o==null?void 0:o.taskRuns)==null?void 0:D.totals,v=(M=o==null?void 0:o.predictionV1)==null?void 0:M.totals,_=(y==null?void 0:y.scopedStatusKey)==="predictionV1"&&v!==void 0,S=_?v:p,x=_?p:v,d=(S==null?void 0:S.failed)??(x==null?void 0:x.failed)??0,u=(S==null?void 0:S.settledFailed)??(x==null?void 0:x.settledFailed),c=(S==null?void 0:S.localErrors)??(x==null?void 0:x.localErrors),h={tasks:(S==null?void 0:S.observedTasks)??(x==null?void 0:x.observedTasks)??0,active:(S==null?void 0:S.activeTaskRuns)??(x==null?void 0:x.activeTaskRuns)??0,solutions:(S==null?void 0:S.solutions)??(x==null?void 0:x.solutions)??0,verdicts:(S==null?void 0:S.verdicts)??(x==null?void 0:x.verdicts)??0,settledFailed:u??0,localErrors:c??(u===void 0?d:0)},m=(((A=o==null?void 0:o.fleet)==null?void 0:A.services)??[]).map(Q=>({index:Q.index,safeAddress:Q.safeAddress??"",agentId:Q.agentId??null,safeBoundToAgent:Q.safeBoundToAgent??!1})),w=(((F=o==null?void 0:o.fleet)==null?void 0:F.services)??[]).find(Q=>Q.evicted===!0),C=w!=null,E=(w==null?void 0:w.serviceId)??null,b=h.solutions,k=_h((q=o==null?void 0:o.rewards)==null?void 0:q.pendingStakingRewardsWei),R=_h((G=o==null?void 0:o.masterGas)==null?void 0:G.balanceWei),L=((X=o==null?void 0:o.masterGas)==null?void 0:X.runwayDaysExcess)??"—",P=j0(o,a==null?void 0:a.joinedSolverNets),B=F0(y,p,(K=f==null?void 0:f.nextAction)==null?void 0:K.description),H=O.useRef(null);O.useEffect(()=>()=>{H.current&&clearTimeout(H.current)},[]);const z=(Q,ie,pe)=>{t(Q),n(null),H.current&&(clearTimeout(H.current),H.current=null),Promise.resolve().then(ie).then(ge=>{n({tone:"success",text:(ge==null?void 0:ge.message)??`${Q} requested.`}),pe!=null&&pe.autoClearMs&&(H.current=setTimeout(()=>{n(null),H.current=null},pe.autoClearMs))}).catch(ge=>{n({tone:"error",text:ge instanceof Error?ge.message:String(ge)})}).finally(()=>t(null))};return s.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"24px"},children:[s.jsx(m0,{tasksDelivered:b,statusLabel:T0[P.state],statusState:P.state,statusDot:R0[P.state].dot,statusReason:P.line,activeAction:e,evicted:C,evictedServiceId:E,onRestart:()=>z("Restart node",async()=>{if(!(await ee.restartDaemon()).ok)throw new Error("Restart request failed.");return g(!1),{message:"Restart requested. The dashboard will reconnect when the daemon is back."}},{autoClearMs:1e4}),onRestake:async Q=>{const ie=await ee.restake(Q);if(!ie.ok)throw new Error(ie.error??"Re-stake failed.");await l.invalidateQueries({queryKey:["status"]})}}),s.jsx(h0,{totalEth:R,runwayDays:L,actionsDisabled:e!==null,perRole:{master:R,agent:"—",safe:"—"},lastPasswordRotationAt:((T=o==null?void 0:o.security)==null?void 0:T.lastPasswordRotationAt)??null,onTopUp:()=>z("Top up gas",async()=>{var Ut;const Q=await ee.triggerDrip({singleDrip:!0});if(!Q.ok)throw new Error(Q.reason??"Gas top-up failed.");const ie=Q.txHash??((Ut=Q.txHashes)==null?void 0:Ut.at(-1));if(!ie)return{message:"Gas top-up checked; the faucet sent no funds."};const pe=W0(Q.deltaWei),ge=U0(ie);return{message:pe?`Gas topped up: +${pe} · tx ${ge}`:`Gas top-up sent · tx ${ge}`}},{autoClearMs:5e3}),onChangePassword:()=>{i("/operator/security")}}),s.jsx(y0,{claimableJinn:k,claimedJinnLifetime:((N=o==null?void 0:o.rewards)==null?void 0:N.claimedJinnLifetime)??"0",lastClaimAt:((W=o==null?void 0:o.rewards)==null?void 0:W.lastClaimAt)??null,onClaim:()=>z("Claim JINN",async()=>{const Q=await ee.claimRewards();if(!Q.ok)throw new Error(Q.error??"Reward claim failed.");return{message:"JINN claim command completed."}})}),r&&s.jsx("div",{role:r.tone==="error"?"alert":"status","data-testid":"dashboard-action-notice",style:{border:`1px solid ${r.tone==="error"?"var(--break-red)":"var(--vow-green)"}`,color:r.tone==="error"?"var(--break-red)":"var(--vow-green)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:r.text}),s.jsx(D0,{name:(y==null?void 0:y.name)??"SolverNet",totals:h}),y&&s.jsx(M0,{name:y.name,configId:y.configId,roles:y.roles,state:"live",waitingMessage:B}),s.jsx(hv,{}),s.jsx(B0,{agentId:(($=m[0])==null?void 0:$.agentId)??null,chain:"Base Sepolia",safeAddress:((ne=m[0])==null?void 0:ne.safeAddress)??null,services:m}),s.jsx(A0,{}),s.jsx(I0,{})]})}function q0({pollIntervalMs:e=5e3}={}){return s.jsxs("main",{"data-testid":"overview-activity",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"960px",margin:"0 auto"},children:[s.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"16px"},children:[s.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",fontWeight:400,margin:0,color:"var(--fg)"},children:"Activity"}),s.jsx(Ct,{href:"/overview","data-testid":"overview-activity-back",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",textDecoration:"none"},children:"← Overview"})]}),s.jsx(hv,{pollIntervalMs:e})]})}function ks(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function en(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,i=1000000000n;return t>=n?`${xh(t,18,t>=r?4:6)} ETH`:t>=i?`${xh(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function xh(e,t,r){const n=10n**BigInt(t),i=e/n,l=e%n;if(l===0n||r===0)return i.toString();const o=l.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${i}.${o}`:i.toString()}function Sh(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 bh={launching:{fg:"var(--accent-sky)",border:"var(--accent-sky)",label:"Launching"},launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"},failed:{fg:"var(--break-red)",border:"var(--break-red)",label:"Failed"}};function K0(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function V0(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 Q0({status:e}){const t=bh[e]??bh.launching;return s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:t.fg,border:`1px solid ${t.border}`,borderRadius:"var(--radius-1)",padding:"2px 8px",whiteSpace:"nowrap"},children:t.label})}function G0({label:e}){return s.jsx("span",{"data-testid":"launcher-owned-row-role",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.12em",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"},children:e})}function Y0({record:e}){const[,t]=wn(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,i=(n==null?void 0:n.name)??e.solverNetId,l=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return s.jsxs("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:g=>{g.preventDefault(),t(r)},style:{display:"grid",gridTemplateColumns:"1fr auto",alignItems:"center",gap:"16px",padding:"16px 20px",background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",textDecoration:"none",color:"inherit",cursor:"pointer"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[s.jsx("div",{"data-testid":"launcher-owned-row-primary",style:{fontFamily:n!==void 0?"'Instrument Serif', 'Times New Roman', serif":"'JetBrains Mono', monospace",fontSize:n!==void 0?"18px":"14px",fontWeight:n!==void 0?400:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",letterSpacing:n!==void 0?"-0.01em":void 0},children:i}),l!==null&&s.jsx("div",{"data-testid":"launcher-owned-row-contract",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:l}),n!==void 0&&s.jsxs("div",{"data-testid":"launcher-owned-row-prices",style:{display:"flex",gap:"14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[s.jsxs("span",{children:["solution ",en(n.solutionPriceWei)]}),s.jsxs("span",{children:["verdict ",en(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&s.jsx("div",{"data-testid":"launcher-owned-row-roles",style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:n.openRoles.map(g=>s.jsx(G0,{label:g},g))}),s.jsxs("div",{style:{display:"flex",gap:"14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[s.jsxs("span",{children:["cid ",K0(e.manifestCid)]}),s.jsxs("span",{children:["launched ",V0(e.launchedAt)]})]})]}),s.jsx(Q0,{status:e.status})]})}function X0(){return s.jsxs("div",{"data-testid":"launcher-empty-state",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"32px 24px",display:"flex",flexDirection:"column",gap:"14px"},children:[s.jsx("h2",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)",margin:0,letterSpacing:"-0.01em"},children:"No SolverNets created yet."}),s.jsx("p",{style:{color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.5,margin:0},children:"Create a SolverNet to direct operators toward a specific kind of knowledge work."}),s.jsx("div",{children:s.jsx(Ct,{href:"/launcher/create",style:{display:"inline-block",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",padding:"12px 20px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",textDecoration:"none",cursor:"pointer"},children:"Create SolverNet"})})]})}function Z0(){const{data:e,isLoading:t,isError:r,error:n,refetch:i}=ue({queryKey:["solvernets","launched","owned"],queryFn:()=>ee.solvernets.listLaunched(),refetchInterval:3e4});return s.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[s.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400},children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&s.jsx(Ct,{href:"/launcher/create","data-testid":"launcher-create-cta",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",textDecoration:"none",cursor:"pointer"},children:"Create SolverNet"})]}),t&&s.jsx("p",{"data-testid":"launcher-loading",style:{color:"var(--fg-muted)",fontSize:"13px",margin:0},children:"Loading…"}),r&&s.jsxs("div",{"data-testid":"launcher-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Failed to load your SolverNets."}),s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:n instanceof Error?n.message:"Unknown error"})]}),s.jsx("button",{type:"button",onClick:()=>{i()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&s.jsx(X0,{}),!t&&!r&&e&&e.records.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.records.map(l=>s.jsx(Y0,{record:l},l.solverNetId))})]})}function e1({current:e,total:t=5}){return s.jsxs("div",{"data-testid":"launcher-create-progress",style:{display:"flex",alignItems:"center",gap:"12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[s.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),s.jsx("div",{style:{display:"flex",gap:"4px",flex:1,maxWidth:"320px"},children:Array.from({length:t}).map((r,n)=>{const i=n+1,l=i<=e;return s.jsx("span",{"data-testid":`launcher-create-progress-pip-${i}`,"data-filled":l?"true":"false",style:{flex:1,height:"3px",background:l?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},i)})})]})}function Cn({step:e,total:t=5,title:r,blurb:n,children:i,footer:l,error:g}){return s.jsxs("main",{"data-testid":`launcher-create-step-${e}`,style:{padding:"24px",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"720px",margin:"0 auto"},children:[s.jsx(e1,{current:e,total:t}),s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400,letterSpacing:"-0.01em"},children:r}),n&&s.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.5},children:n})]}),g&&s.jsx("div",{"data-testid":"launcher-create-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 16px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:g}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:i}),s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:l})]})}function kn({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:i=!1,right:l}){return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:e&&s.jsx("button",{type:"button","data-testid":"launcher-create-back",onClick:e,disabled:i,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:i?"wait":"pointer"},children:"Back"})}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[l,t&&s.jsx("button",{type:"button","data-testid":"launcher-create-next",onClick:t,disabled:n||i,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 22px",background:n||i?"var(--bg-elevated)":"var(--accent-sky)",color:n||i?"var(--fg-dim)":"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:n||i?"not-allowed":"pointer",opacity:n||i?.6:1},children:r})]})]})}function Be({label:e,helperText:t,error:r,children:n}){return s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),n,r?s.jsx("span",{style:{fontSize:"12px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:r}):t&&s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:t})]})}const fv={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",width:"100%",boxSizing:"border-box"},qe=fv,at={...fv,border:"1px solid var(--break-red)"};function wh({draft:e,onAdvance:t,busy:r,error:n}){const[i,l]=O.useState(e.name??""),[g,o]=O.useState(e.description??""),[a,f]=O.useState(!1),y=a&&i.trim().length===0?"Name is required.":null,p=a&&g.trim().length===0?"Description is required.":null,v=async _=>{_==null||_.preventDefault(),f(!0),!(i.trim().length===0||g.trim().length===0)&&await t({name:i.trim(),description:g.trim(),completedSteps:ks(e.completedSteps,"define")})};return s.jsx(Cn,{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:s.jsx(kn,{onNext:()=>{v()},nextDisabled:i.trim().length===0||g.trim().length===0,busy:r}),children:s.jsxs("form",{onSubmit:_=>{v(_)},style:{display:"flex",flexDirection:"column",gap:"16px"},children:[s.jsx(Be,{label:"Name",error:y,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:s.jsx("input",{"data-testid":"launcher-create-name",type:"text",value:i,onChange:_=>l(_.target.value),placeholder:"e.g. Polymarket forecasts",style:y?at:qe,disabled:r})}),s.jsx(Be,{label:"Description",error:p,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:s.jsx("textarea",{"data-testid":"launcher-create-description",value:g,onChange:_=>o(_.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",style:{...p?at:qe,resize:"vertical",minHeight:"96px",fontFamily:"'JetBrains Mono', monospace"},disabled:r})}),s.jsx("button",{type:"submit",hidden:!0,"aria-hidden":!0,tabIndex:-1})]})})}const Es={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}},pv={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:50,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:3,N_max_postings_per_task:10,cooldown_ms:24*60*60*1e3}},wc={"prediction.v1":Es,"swe-rebench-v2.v1":pv},t1="prediction.v1";function r1({draft:e,template:t=Es,onAdvance:r,onBack:n,busy:i,error:l}){const g=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:ks(e.completedSteps,"reviewContract")})};return s.jsx(Cn,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:l,footer:s.jsx(kn,{onBack:n,onNext:g,busy:i}),children:s.jsxs("article",{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"16px"},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[t.id,".",t.version]}),s.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",fontWeight:400,color:"var(--fg)"},children:t.name}),s.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:t.description})]}),s.jsxs(Ns,{title:"Schemas",children:[s.jsx(Ge,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),s.jsx(Ge,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),s.jsx(Ge,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),s.jsxs(Ns,{title:"Evaluation function",children:[s.jsx(Ge,{label:"Id",value:t.evaluationFunction.id,mono:!0}),s.jsx(Ge,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),s.jsx(Ge,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),s.jsx(Ge,{label:"Output",value:t.evaluationFunction.output})]}),s.jsxs(Ns,{title:"Aggregation function",children:[s.jsx(Ge,{label:"Id",value:t.aggregationFunction.id,mono:!0}),s.jsx(Ge,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),s.jsx(Ge,{label:"Output",value:t.aggregationFunction.output})]}),s.jsxs(Ns,{title:"Claim policy defaults",children:[s.jsx(Ge,{label:"Mode",value:t.claimPolicyDefaults.mode}),s.jsx(Ge,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),s.jsx(Ge,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),s.jsx(Ge,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),s.jsxs(Ns,{title:"Credential requirements",children:[s.jsx(il,{role:"creator",creds:t.credentialRequirements.creator}),s.jsx(il,{role:"solver",creds:t.credentialRequirements.solver}),s.jsx(il,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})}function Ns({title:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"8px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[s.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:t})]})}function Ge({label:e,value:t,hint:r,mono:n}){return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"12px",alignItems:"baseline"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),s.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[s.jsx("span",{style:{fontFamily:n?"'JetBrains Mono', monospace":"inherit",fontSize:"13px",color:"var(--fg)"},children:t}),r&&s.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:r})]})]})}function il({role:e,creds:t}){return s.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em",textTransform:"capitalize"},children:e}),t.length===0?s.jsx("div",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"None."}):t.map(r=>s.jsxs("div",{style:{fontSize:"12px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:[s.jsx("span",{style:{color:"var(--accent-sky)"},children:r.id}),s.jsxs("span",{style:{color:"var(--fg-dim)"},children:[" · ",r.kind]}),r.required&&s.jsx("span",{style:{color:"var(--wane)"},children:" · required"}),s.jsx("div",{style:{color:"var(--fg-muted)"},children:r.description})]},r.id))]})}function n1(e){const t=e.template??Es;switch(t.id){case"prediction":return s.jsx(i1,{...e,template:t});case"swe-rebench-v2":return s.jsx(a1,{...e,template:t});default:return s.jsx(Cn,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:s.jsx(kn,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:s.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const Ch=6e4;function Vt(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function kh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function s1(e){const t=Es.generatorDefaults,r=60*60*1e3;return{cadenceMs:Vt(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:Vt((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:Vt(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:Vt(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Vt(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:Vt(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:kh(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:kh(e==null?void 0:e.blocklistConditionIds)}}function Eh(e){const t={},r=Qt(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<Ch&&(t.cadenceMs=`Cadence must be at least ${Ch/1e3}s.`);const n=Qt(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const i=Qt(e.resolveGapMs);i===null&&(t.resolveGapMs="Must be a positive integer (ms).");const l=Qt(e.maxNewRoundsPerPoll);l===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const g=Qt(e.maxNewRoundsPerDay);g===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const o=Qt(e.maxOpenRounds);return o===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:i,submissionWindowMs:n,maxNewRoundsPerPoll:l,maxNewRoundsPerDay:g,maxOpenRounds:o,allowlistConditionIds:jh(e.allowlistConditionIds),blocklistConditionIds:jh(e.blocklistConditionIds)}}}function Qt(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 jh(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function i1({draft:e,onAdvance:t,onBack:r,busy:n,error:i}){const l=O.useMemo(()=>s1(e.generatorConfig),[e.generatorConfig]),[g,o]=O.useState(l),[a,f]=O.useState(!1),y=a?Eh(g):{ok:!0,errors:{}},p=a?y.errors:{},v=()=>{f(!0);const S=Eh(g);!S.ok||!S.generatorConfig||t({generatorConfig:S.generatorConfig,completedSteps:ks(e.completedSteps,"configureGenerator")})},_=(S,x)=>{o(d=>({...d,[S]:x}))};return s.jsxs(Cn,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:i,footer:s.jsx(kn,{onBack:r,onNext:v,busy:n,nextDisabled:a&&!y.ok}),children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[s.jsx(Be,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:p.cadenceMs??null,children:s.jsx("input",{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:g.cadenceMs,onChange:S=>_("cadenceMs",S.target.value),style:p.cadenceMs?at:qe,disabled:n})}),s.jsx(Be,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:p.windowMs??null,children:s.jsx("input",{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:g.windowMs,onChange:S=>_("windowMs",S.target.value),style:p.windowMs?at:qe,disabled:n})}),s.jsx(Be,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:p.resolveGapMs??null,children:s.jsx("input",{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:g.resolveGapMs,onChange:S=>_("resolveGapMs",S.target.value),style:p.resolveGapMs?at:qe,disabled:n})}),s.jsx(Be,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:p.maxNewRoundsPerPoll??null,children:s.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerPoll,onChange:S=>_("maxNewRoundsPerPoll",S.target.value),style:p.maxNewRoundsPerPoll?at:qe,disabled:n})}),s.jsx(Be,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:p.maxNewRoundsPerDay??null,children:s.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerDay,onChange:S=>_("maxNewRoundsPerDay",S.target.value),style:p.maxNewRoundsPerDay?at:qe,disabled:n})}),s.jsx(Be,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:p.maxOpenRounds??null,children:s.jsx("input",{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:g.maxOpenRounds,onChange:S=>_("maxOpenRounds",S.target.value),style:p.maxOpenRounds?at:qe,disabled:n})})]}),s.jsx(Be,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:s.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:g.allowlistConditionIds,onChange:S=>_("allowlistConditionIds",S.target.value),rows:2,placeholder:"0xabc…, 0xdef…",style:{...qe,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:n})}),s.jsx(Be,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:s.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:g.blocklistConditionIds,onChange:S=>_("blocklistConditionIds",S.target.value),rows:2,placeholder:"0xabc…",style:{...qe,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:n})})]})}const Rh=6e4;function o1(e){const t=pv.generatorDefaults;return{N_target_successes:Vt(e==null?void 0:e.N_target_successes,t.N_target_successes),N_max_postings_per_task:Vt(e==null?void 0:e.N_max_postings_per_task,t.N_max_postings_per_task),cooldown_ms:Vt(e==null?void 0:e.cooldown_ms,t.cooldown_ms)}}function Th(e){const t={},r=Qt(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=Qt(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 i=Qt(e.cooldown_ms);return i===null?t.cooldown_ms="Must be a positive integer (ms).":i<Rh&&(t.cooldown_ms=`Cooldown must be at least ${Rh/1e3}s.`),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,N_max_postings_per_task:n,cooldown_ms:i}}}function a1({draft:e,onAdvance:t,onBack:r,busy:n,error:i}){const l=O.useMemo(()=>o1(e.generatorConfig),[e.generatorConfig]),[g,o]=O.useState(l),[a,f]=O.useState(!1),y=a?Th(g):{ok:!0,errors:{}},p=a?y.errors:{},v=()=>{f(!0);const S=Th(g);!S.ok||!S.generatorConfig||t({generatorConfig:S.generatorConfig,completedSteps:ks(e.completedSteps,"configureGenerator")})},_=(S,x)=>{o(d=>({...d,[S]:x}))};return s.jsx(Cn,{step:3,title:"Configure generator",blurb:"The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.",error:i,footer:s.jsx(kn,{onBack:r,onNext:v,busy:n,nextDisabled:a&&!y.ok}),children:s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[s.jsx(Be,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:p.N_target_successes??null,children:s.jsx("input",{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:g.N_target_successes,onChange:S=>_("N_target_successes",S.target.value),style:p.N_target_successes?at:qe,disabled:n})}),s.jsx(Be,{label:"Max Task postings per instance",helperText:"Hard ceiling on Task postings to bound spend on impossible SWE instances.",error:p.N_max_postings_per_task??null,children:s.jsx("input",{"data-testid":"launcher-create-N_max_postings_per_task",type:"text",inputMode:"numeric",value:g.N_max_postings_per_task,onChange:S=>_("N_max_postings_per_task",S.target.value),style:p.N_max_postings_per_task?at:qe,disabled:n})}),s.jsx(Be,{label:"Cooldown between task postings (ms)",helperText:"Minimum gap before posting another Task for the same SWE instance. Minimum 60s.",error:p.cooldown_ms??null,children:s.jsx("input",{"data-testid":"launcher-create-cooldown_ms",type:"text",inputMode:"numeric",value:g.cooldown_ms,onChange:S=>_("cooldown_ms",S.target.value),style:p.cooldown_ms?at:qe,disabled:n})})]})})}function l1(e,t){const r={};let n,i;try{n=Sh(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{i=Sh(t),i===null?r.verdictPriceWei="Required.":i<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",i=null}return n!==null&&i!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&i===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:i??void 0}}function c1(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let i;try{i=BigInt(e)}catch{return null}const l=t+r*BigInt(n);return l<=0n?null:{tasks:Number(i/l),perTaskWei:l}}function u1({draft:e,template:t=Es,onAdvance:r,onBack:n,fundingSafeAddress:i,fundingSafeBalanceWei:l,busy:g,error:o}){var h,m;const[a,f]=O.useState(e.solutionPriceWei??""),[y,p]=O.useState(e.verdictPriceWei??""),[v,_]=O.useState(!1),S=O.useMemo(()=>l1(a,y),[a,y]),x=t.claimPolicyDefaults.maxClaimsPerOperator,d=O.useMemo(()=>c1(l??null,S.solutionWei,S.verdictWei,x),[l,S.solutionWei,S.verdictWei,x]),u=()=>{_(!0),S.ok&&r({solutionPriceWei:a,verdictPriceWei:y,completedSteps:ks(e.completedSteps,"configurePricing")})},c=v?S.errors:{};return s.jsxs(Cn,{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:o,footer:s.jsx(kn,{onBack:n,onNext:u,busy:g,nextDisabled:v&&!S.ok}),children:[s.jsx(Be,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",children:s.jsx("div",{"data-testid":"launcher-create-fundingSafe",style:{background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",wordBreak:"break-all"},children:i??"— (master Safe will be picked at launch)"})}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[s.jsx(Be,{label:"Solution price (wei)",helperText:`≈ ${en((h=S.solutionWei)==null?void 0:h.toString())}`,error:c.solutionPriceWei??null,children:s.jsx("input",{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:a,onChange:w=>f(w.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",style:c.solutionPriceWei?at:qe,disabled:g})}),s.jsx(Be,{label:"Verdict price (wei)",helperText:`≈ ${en((m=S.verdictWei)==null?void 0:m.toString())}`,error:c.verdictPriceWei??null,children:s.jsx("input",{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:y,onChange:w=>p(w.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",style:c.verdictPriceWei?at:qe,disabled:g})})]}),c.combined&&s.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:c.combined}),s.jsxs("section",{"data-testid":"launcher-create-projection",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"16px 18px",display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Runway projection"}),s.jsx(ol,{label:"Safe balance",value:l?`${en(l)} (${l} wei)`:"—"}),s.jsx(ol,{label:"Per-Task cost",value:d?`${en(d.perTaskWei.toString())} (${d.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${x})`}),s.jsx(ol,{label:"Projected Tasks",value:d?`~${d.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})]})}function ol({label:e,value:t,hint:r,testId:n}){return s.jsxs("div",{"data-testid":n,style:{display:"grid",gridTemplateColumns:"160px 1fr",alignItems:"baseline",gap:"12px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),s.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t}),r&&s.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:r})]})]})}const d1=1500,Dh=["pinning","recording","broadcasting","confirming","spawning"],h1={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function f1({draft:e,template:t=Es,onUpdateDraft:r,onBack:n,onLaunchFailure:i,navigateTo:l,pollIntervalMs:g=d1}){const[,o]=wn(),a=l??o,f=O.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[y,p]=O.useState(f),[v,_]=O.useState({kind:"idle"}),S=O.useRef(!1);O.useEffect(()=>()=>{S.current=!0},[]);const x=h=>{p(m=>m.includes(h)?m.filter(w=>w!==h):[...m,h])},d=async()=>{var h,m,w;if(y.length!==0){_(C=>C.kind==="failed"?{kind:"idle"}:C),S.current=!1;try{await r({openRoles:y,completedSteps:ks(e.completedSteps,"configurePricing")});const C=await ee.solvernets.launch(e.draftId);if(S.current)return;let E="pinning";for(_({kind:"launching",phase:E,solverNetId:C.solverNetId});;){if(S.current)return;let b;try{b=await ee.solvernets.get(C.solverNetId)}catch{if(S.current)return;await Bh(g);continue}if((h=b.launchProgress)!=null&&h.phase&&(E=b.launchProgress.phase),b.status==="launched"){_({kind:"launching",phase:"spawning",solverNetId:C.solverNetId}),a(`/launcher/launched/${encodeURIComponent(C.solverNetId)}`);return}if(b.status==="failed"){const k=((w=(m=b.launchProgress)==null?void 0:m.txError)==null?void 0:w.message)??`Launch failed during ${E}.`;_({kind:"failed",message:k,solverNetId:C.solverNetId}),i==null||i();return}_({kind:"launching",phase:E,solverNetId:C.solverNetId}),await Bh(g)}}catch(C){if(S.current)return;_({kind:"failed",message:C instanceof Error?C.message:String(C)}),i==null||i()}}},u=v.kind==="launching",c=y.length===0||u;return s.jsxs(Cn,{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:s.jsx(kn,{onBack:n,onNext:()=>{d()},nextLabel:u?"Launching…":"Launch",nextDisabled:c,busy:u,right:u&&s.jsx(p1,{current:v.kind==="launching"?v.phase:"pinning"})}),children:[s.jsx(g1,{draft:e,template:t}),s.jsxs(Be,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",children:[s.jsxs("div",{"data-testid":"launcher-create-openRoles",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx(Lh,{role:"solver",checked:y.includes("solver"),onChange:()=>x("solver"),disabled:u}),s.jsx(Lh,{role:"evaluator",checked:y.includes("evaluator"),onChange:()=>x("evaluator"),disabled:u})]}),y.length===0&&s.jsx("span",{"data-testid":"launcher-create-openRoles-error",style:{fontSize:"12px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:"At least one role must be open."})]}),v.kind==="failed"&&s.jsxs("div",{"data-testid":"launcher-create-launch-failure",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Launch failed."}),s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px",fontFamily:"'JetBrains Mono', monospace"},children:v.message}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":"launcher-create-launch-retry",onClick:()=>{d()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"}),s.jsx("button",{type:"button","data-testid":"launcher-create-launch-abandon",onClick:()=>{a("/launcher")},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Abandon"})]})]})]})}function p1({current:e}){const t=Dh.indexOf(e);return s.jsxs("div",{"data-testid":"launcher-create-launch-progress","data-phase":e,style:{display:"flex",alignItems:"center",gap:"6px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",letterSpacing:"0.06em"},children:[s.jsx("span",{"data-testid":"launcher-create-launch-phase",children:h1[e]}),s.jsx("div",{style:{display:"flex",gap:"3px"},children:Dh.map((r,n)=>s.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",style:{width:"8px",height:"3px",background:n<=t?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},r))})]})}function g1({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,i=e.templateContractVersion??t.version;return s.jsxs("article",{"data-testid":"launcher-create-manifest-summary",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[n,".",i]}),s.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",fontWeight:400,color:"var(--fg)"},children:e.name??"— unnamed"}),e.description&&s.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:e.description})]}),s.jsxs(y1,{children:[s.jsx(zt,{label:"Solution price",value:Ph(e.solutionPriceWei)}),s.jsx(zt,{label:"Verdict price",value:Ph(e.verdictPriceWei)}),t.id==="prediction"?s.jsx(v1,{generator:r}):s.jsx(m1,{generator:r})]})]})}function v1({generator:e}){const t=Xn(e.cadenceMs),r=Xn(e.windowMs??e.submissionWindowMs),n=Xn(e.maxOpenRounds);return s.jsxs(s.Fragment,{children:[s.jsx(zt,{label:"Cadence",value:t?`${t} ms`:"—"}),s.jsx(zt,{label:"Window",value:r?`${r} ms`:"—"}),s.jsx(zt,{label:"Max open rounds",value:n??"—"}),s.jsx(zt,{label:"Allowlist",value:Mh(e.allowlistConditionIds)}),s.jsx(zt,{label:"Blocklist",value:Mh(e.blocklistConditionIds)})]})}function m1({generator:e}){const t=Xn(e.N_target_successes),r=Xn(e.N_max_postings_per_task),n=Xn(e.cooldown_ms);return s.jsxs(s.Fragment,{children:[s.jsx(zt,{label:"Target successes",value:t??"—"}),s.jsx(zt,{label:"Max postings / Task",value:r??"—"}),s.jsx(zt,{label:"Cooldown",value:n?`${n} ms`:"—"})]})}function Ph(e){return e?`${e} wei (${en(e)})`:"—"}function Xn(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function Mh(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function y1({children:e}){return s.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px 16px",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:e})}function zt({label:e,value:t}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}function Lh({role:e,checked:t,onChange:r,disabled:n}){return s.jsxs("label",{style:{display:"flex",gap:"10px",alignItems:"center",cursor:n?"not-allowed":"pointer",opacity:n?.6:1},children:[s.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:e})]})}function Bh(e){return new Promise(t=>setTimeout(t,e))}const Cc="jinn.launcher-create.draftId.v1";function _1(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Cc)}catch{return null}}function Ih(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(Cc):window.localStorage.setItem(Cc,e)}catch{}}function x1(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function S1({templateKey:e}={}){var C;const t=e??x1()??t1,r=O.useMemo(()=>wc[t]??null,[t]),[n,i]=O.useState(null),[l,g]=O.useState(null),[o,a]=O.useState(1),[f,y]=O.useState(!1),[p,v]=O.useState(null),_=O.useRef(!1),{data:S}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:3e4}),{data:x}=ue({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:3e4}),d=(S==null?void 0:S.master_address)??(x==null?void 0:x.master_address)??null,u=((C=x==null?void 0:x.masterGas)==null?void 0:C.balanceWei)??null;O.useEffect(()=>{if(_.current)return;_.current=!0;let E=!1;return(async()=>{const k=_1();if(k)try{const R=await ee.solvernets.getDraft(k);if(E)return;i(R);return}catch{Ih(null)}try{const R=await ee.solvernets.createDraft();if(E)return;Ih(R.draftId),i(R)}catch(R){if(E)return;g(R instanceof Error?R.message:"Failed to create draft.")}})(),()=>{E=!0}},[]);const c=async E=>{if(n){y(!0),v(null);try{const b=await ee.solvernets.updateDraft(n.draftId,E);i(b),a(k=>k<5?k+1:k)}catch(b){v(b instanceof Error?b.message:String(b))}finally{y(!1)}}},h=async E=>{if(n){y(!0),v(null);try{const b=await ee.solvernets.updateDraft(n.draftId,E);i(b)}catch(b){v(b instanceof Error?b.message:String(b))}finally{y(!1)}}},m=()=>{v(null),a(E=>E>1?E-1:E)},w=()=>{v(null)};if(r===null)return s.jsxs("main",{"data-testid":"launcher-create-unknown-template","data-template-key":t,style:{padding:"24px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"28px",margin:0,color:"var(--fg)",fontWeight:400},children:"Unknown SolverNet template"}),s.jsxs("p",{style:{marginTop:"12px",color:"var(--break-red)",fontSize:"13px"},children:["No template registered for ",s.jsx("code",{children:t}),". Available keys:"," ",Object.keys(wc).map(E=>`?template=${E}`).join(", "),"."]})]});if(l)return s.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",style:{padding:"24px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"28px",margin:0,color:"var(--fg)",fontWeight:400},children:"Couldn't start a new draft"}),s.jsx("p",{style:{marginTop:"12px",color:"var(--break-red)",fontSize:"13px"},children:l})]});if(!n)return s.jsx("main",{"data-testid":"launcher-create-loading",style:{padding:"24px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:"Loading draft…"});switch(o){case 1:return s.jsx(wh,{draft:n,onAdvance:c,busy:f,error:p});case 2:return s.jsx(r1,{draft:n,template:r,onAdvance:c,onBack:m,busy:f,error:p});case 3:return s.jsx(n1,{draft:n,template:r,onAdvance:c,onBack:m,busy:f,error:p});case 4:return s.jsx(u1,{draft:n,template:r,onAdvance:c,onBack:m,fundingSafeAddress:d,fundingSafeBalanceWei:u??null,busy:f,error:p});case 5:return s.jsx(f1,{draft:n,template:r,onUpdateDraft:h,onBack:m,onLaunchFailure:w});default:return s.jsx(wh,{draft:n,onAdvance:c,busy:f,error:p})}}const Ah={launching:{fg:"var(--accent-sky)",border:"var(--accent-sky)",label:"Launching"},launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"},failed:{fg:"var(--break-red)",border:"var(--break-red)",label:"Failed"}};function gv(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function vv(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function ji(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 b1={launched:["paused","retired"],paused:["launched","retired"]};function Oh(e,t,r){const n=10n**BigInt(t),i=e/n,l=e%n;if(l===0n||r===0)return i.toString();const o=l.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${i}.${o}`:i.toString()}function Dr(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,i=1000000000n;return t>=n?`${Oh(t,18,t>=r?4:6)} ETH`:t>=i?`${Oh(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function w1(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 i=BigInt(t)+BigInt(r);return i<=0n?null:{tasks:Number(n/i),perTaskWei:i}}const Fh=6e4,Nh=6e4;function C1(e){const t=e??{};return{cadenceMs:mt(t.cadenceMs),windowMs:mt(t.windowMs??t.submissionWindowMs),resolveGapMs:mt(t.resolveGapMs),maxNewRoundsPerPoll:mt(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:mt(t.maxNewRoundsPerDay),maxOpenRounds:mt(t.maxOpenRounds),allowlistConditionIds:Hh(t.allowlistConditionIds),blocklistConditionIds:Hh(t.blocklistConditionIds)}}function k1(e,t){const r=e??{},n=E1(r.claimPolicy),i=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaims:50,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:mt(r.N_target_successes),N_max_postings_per_task:mt(r.N_max_postings_per_task),cooldown_ms:mt(r.cooldown_ms),maxClaims:mt(n.maxClaims??i.maxClaims),maxClaimsPerOperator:mt(n.maxClaimsPerOperator??i.maxClaimsPerOperator),claimLeaseTtlSeconds:mt(n.claimLeaseTtlSeconds??i.claimLeaseTtlSeconds)}}function E1(e){return typeof e=="object"&&e!==null?e:{}}function mt(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function Hh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function Qr(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 j1(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function R1(e,t){const r={},n={};for(const i of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[i]===t[i]||e[i].trim().length===0)continue;const l=Qr(e[i]);if(l===null){r[i]="Must be a positive integer.";continue}if(i==="cadenceMs"&&l<Fh){r[i]=`Cadence must be at least ${Fh/1e3}s.`;continue}i==="windowMs"?n.submissionWindowMs=l:n[i]=l}for(const i of["allowlistConditionIds","blocklistConditionIds"])e[i]!==t[i]&&(n[i]=j1(e[i]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function T1(e,t){const r={},n={},i=Qr(e.N_target_successes),l=Qr(e.N_max_postings_per_task),g=Qr(e.maxClaims),o=Qr(e.maxClaimsPerOperator);for(const f of["N_target_successes","N_max_postings_per_task","cooldown_ms"]){if(e[f]===t[f]||e[f].trim().length===0)continue;const y=Qr(e[f]);if(y===null){r[f]=f==="cooldown_ms"?"Must be a positive integer (ms).":"Must be a positive integer.";continue}if(f==="cooldown_ms"&&y<Nh){r[f]=`Cooldown must be at least ${Nh/1e3}s.`;continue}n[f]=y}const a={};for(const f of["maxClaims","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[f]===t[f]||e[f].trim().length===0)continue;const y=Qr(e[f]);if(y===null){r[f]=f==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}a[f]=y}return Object.keys(a).length>0&&(n.claimPolicy=a),i!==null&&l!==null&&l<i&&(r.N_max_postings_per_task="Max postings must be >= target successes."),g!==null&&o!==null&&o>g&&(r.maxClaimsPerOperator="Claims per operator must be <= max claims."),{ok:Object.keys(r).length===0,patch:n,errors:r}}function D1(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,"cooldown_ms")}function P1({record:e,manifest:t,template:r,onSave:n}){return D1(e,r)?s.jsx(L1,{record:e,manifest:t,onSave:n}):s.jsx(M1,{record:e,onSave:n})}function M1({record:e,onSave:t}){var S,x;const r=O.useMemo(()=>C1(e.generatorConfig),[e.generatorConfig]),[n,i]=O.useState(r),[l,g]=O.useState({kind:"idle"}),[o,a]=O.useState(!1);O.useEffect(()=>{i(u=>JSON.stringify(u)!==JSON.stringify(d())?u:r);function d(){return r}},[JSON.stringify(e.generatorConfig)]);const f=(d,u)=>{i(c=>({...c,[d]:u}))},y=O.useMemo(()=>R1(n,r),[n,r]),p=Object.keys(y.patch).length>0,v=l.kind==="saving",_=async()=>{if(!(!y.ok||!p||v)){g({kind:"saving"});try{await t(y.patch),g({kind:"saved",at:new Date})}catch(d){g({kind:"error",message:d instanceof Error?d.message:String(d)})}}};return s.jsxs("section",{"data-testid":"launcher-launched-generator-panel",style:_v,children:[s.jsxs("header",{style:xv,children:[s.jsxs("div",{style:Sv,children:[s.jsx("h2",{style:bv,children:"Generator"}),s.jsx(yv,{record:e})]}),s.jsx("button",{type:"button","data-testid":"launcher-launched-generator-toggle","aria-expanded":o,"aria-controls":"launcher-launched-generator-config",onClick:()=>a(d=>!d),style:wv,children:o?"Hide config":"Edit config"})]}),s.jsxs("dl",{style:Ev,children:[s.jsx(sa,{label:"Last poll",value:ji((S=e.generatorState)==null?void 0:S.lastPollAt),testid:"launcher-launched-generator-last-poll"}),s.jsx(sa,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),((x=e.generatorState)==null?void 0:x.lastError)&&s.jsxs("div",{"data-testid":"launcher-launched-generator-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 14px",display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsxs("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:500},children:["Last error · ",ji(e.generatorState.lastError.at)]}),s.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:e.generatorState.lastError.message})]}),o&&s.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",style:Cv,children:[s.jsx("h3",{style:kc,children:"Hot-apply config"}),s.jsxs("div",{style:kv,children:[s.jsx(yt,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:d=>f("cadenceMs",d),error:y.errors.cadenceMs,disabled:v}),s.jsx(yt,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:d=>f("windowMs",d),error:y.errors.windowMs,disabled:v}),s.jsx(yt,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:d=>f("resolveGapMs",d),error:y.errors.resolveGapMs,disabled:v}),s.jsx(yt,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:d=>f("maxNewRoundsPerPoll",d),error:y.errors.maxNewRoundsPerPoll,disabled:v}),s.jsx(yt,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:d=>f("maxNewRoundsPerDay",d),error:y.errors.maxNewRoundsPerDay,disabled:v}),s.jsx(yt,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:d=>f("maxOpenRounds",d),error:y.errors.maxOpenRounds,disabled:v})]}),s.jsx(zh,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:d=>f("allowlistConditionIds",d),disabled:v}),s.jsx(zh,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:d=>f("blocklistConditionIds",d),disabled:v}),s.jsx(mv,{dirty:p,saving:v,validationOk:y.ok,saveStatus:l,onSubmit:_})]})]})}function L1({record:e,manifest:t,onSave:r}){var x,d;const n=O.useMemo(()=>k1(e.generatorConfig,t),[e.generatorConfig,t]),[i,l]=O.useState(n),[g,o]=O.useState({kind:"idle"}),[a,f]=O.useState(!1);O.useEffect(()=>{l(u=>JSON.stringify(u)!==JSON.stringify(n)?u:n)},[JSON.stringify(e.generatorConfig)]);const y=(u,c)=>{l(h=>({...h,[u]:c}))},p=O.useMemo(()=>T1(i,n),[i,n]),v=Object.keys(p.patch).length>0,_=g.kind==="saving",S=async()=>{if(!(!p.ok||!v||_)){o({kind:"saving"});try{await r(p.patch),o({kind:"saved",at:new Date})}catch(u){o({kind:"error",message:u instanceof Error?u.message:String(u)})}}};return s.jsxs("section",{"data-testid":"launcher-launched-generator-panel",style:_v,children:[s.jsxs("header",{style:xv,children:[s.jsxs("div",{style:Sv,children:[s.jsx("h2",{style:bv,children:"Generator"}),s.jsx(yv,{record:e})]}),s.jsx("button",{type:"button","data-testid":"launcher-launched-generator-toggle","aria-expanded":a,"aria-controls":"launcher-launched-generator-config",onClick:()=>f(u=>!u),style:wv,children:a?"Hide config":"Edit config"})]}),s.jsxs("dl",{style:Ev,children:[s.jsx(sa,{label:"Last poll",value:ji((x=e.generatorState)==null?void 0:x.lastPollAt),testid:"launcher-launched-generator-last-poll"}),s.jsx(sa,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),((d=e.generatorState)==null?void 0:d.lastError)&&s.jsx(B1,{record:e}),a&&s.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",style:Cv,children:[s.jsx("h3",{style:kc,children:"Hot-apply config"}),s.jsxs("div",{style:kv,children:[s.jsx(yt,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:i.N_target_successes,onChange:u=>y("N_target_successes",u),error:p.errors.N_target_successes,disabled:_}),s.jsx(yt,{label:"Max Task postings per instance",testid:"launcher-launched-generator-N_max_postings_per_task",value:i.N_max_postings_per_task,onChange:u=>y("N_max_postings_per_task",u),error:p.errors.N_max_postings_per_task,disabled:_}),s.jsx(yt,{label:"Cooldown between task postings (ms)",testid:"launcher-launched-generator-cooldown_ms",value:i.cooldown_ms,onChange:u=>y("cooldown_ms",u),error:p.errors.cooldown_ms,disabled:_})]}),s.jsx("h3",{style:kc,children:"Claim policy"}),s.jsxs("div",{style:A1,children:[s.jsx(yt,{label:"Max claims per Task",testid:"launcher-launched-generator-claimPolicy-maxClaims",value:i.maxClaims,onChange:u=>y("maxClaims",u),error:p.errors.maxClaims,disabled:_}),s.jsx(yt,{label:"Max claims per operator",testid:"launcher-launched-generator-claimPolicy-maxClaimsPerOperator",value:i.maxClaimsPerOperator,onChange:u=>y("maxClaimsPerOperator",u),error:p.errors.maxClaimsPerOperator,disabled:_}),s.jsx(yt,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimPolicy-claimLeaseTtlSeconds",value:i.claimLeaseTtlSeconds,onChange:u=>y("claimLeaseTtlSeconds",u),error:p.errors.claimLeaseTtlSeconds,disabled:_})]}),s.jsx(mv,{dirty:v,saving:_,validationOk:p.ok,saveStatus:g,onSubmit:S})]})]})}function mv({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:i}){const l=e&&r&&!t;return s.jsxs("div",{style:O1,children:[s.jsx(I1,{status:n}),s.jsx("button",{type:"button","data-testid":"launcher-launched-generator-save",onClick:()=>{i()},disabled:!l,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:l?"var(--accent-sky)":"var(--bg-elevated)",color:l?"var(--bg-sunken)":"var(--fg-dim)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:l?"pointer":"not-allowed",opacity:l?1:.7},children:t?"Saving…":"Save"})]})}function B1({record:e}){var t,r,n,i;return s.jsxs("div",{"data-testid":"launcher-launched-generator-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 14px",display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsxs("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:500},children:["Last error · ",ji((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),s.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:(i=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:i.message})]})}function yv({record:e}){var i;const t=e.generatorEnabled,n=!!((i=e.generatorState)!=null&&i.lastError)?{fg:"var(--break-red)",label:"Errored"}:t?{fg:"var(--vow-green)",label:"Enabled"}:{fg:"var(--fg-dim)",label:"Disabled"};return s.jsx("span",{"data-testid":"launcher-launched-generator-state-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:n.fg,border:`1px solid ${n.fg}`,borderRadius:"var(--radius-1)",padding:"2px 8px"},children:n.label})}function I1({status:e}){if(e.kind==="saving")return s.jsx("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return s.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--vow-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Saved at ",t," UTC"]})}return e.kind==="error"?s.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Save failed: ",e.message]}):s.jsx("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px"},children:"Edits hot-apply without restart."})}function yt({label:e,testid:t,value:r,onChange:n,error:i,disabled:l}){return s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:Fu,children:e}),s.jsx("input",{"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:g=>n(g.target.value),disabled:l,style:i?F1:Nu}),i&&s.jsx("span",{"data-testid":`${t}-error`,style:{fontSize:"11px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:i})]})}function zh({label:e,testid:t,value:r,onChange:n,disabled:i}){return s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:Fu,children:e}),s.jsx("textarea",{"data-testid":t,value:r,onChange:l=>n(l.target.value),disabled:i,rows:2,placeholder:"0xabc…, 0xdef…",style:{...Nu,resize:"vertical"}})]})}function sa({label:e,value:t,testid:r}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[s.jsx("dt",{style:Fu,children:e}),s.jsx("dd",{"data-testid":r,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}const _v={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"14px"},xv={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},Sv={display:"flex",alignItems:"center",gap:"10px",minWidth:0},bv={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},wv={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",color:"var(--fg)",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"8px 12px"},Cv={borderTop:"1px solid var(--border)",display:"flex",flexDirection:"column",gap:"14px",paddingTop:"14px"},kc={margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},kv={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"14px"},A1={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"14px"},O1={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",paddingTop:"8px",borderTop:"1px solid var(--border)"},Fu={fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},Ev={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"8px 16px",margin:0},Nu={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",width:"100%",boxSizing:"border-box"},F1={...Nu,border:"1px solid var(--break-red)"},N1={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 H1({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:i,pending:l=!1,errorMessage:g}){const[o,a]=O.useState("");if(O.useEffect(()=>{e||a("")},[e,t]),!e)return null;const f=N1[t],y=t==="retired",p=!y||o.trim()===r.trim(),v=l||!p;return s.jsx("div",{"data-testid":"launcher-launched-dialog","data-target":t,role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",zIndex:100},onClick:_=>{_.target===_.currentTarget&&!l&&i()},children:s.jsxs("div",{style:{background:"var(--bg-elevated)",border:`1px solid ${f.danger?"var(--break-red)":"var(--border)"}`,borderRadius:"var(--radius-3)",padding:"24px 26px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"480px",width:"100%"},children:[s.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",color:f.danger?"var(--break-red)":"var(--fg)",fontWeight:400},children:f.title}),s.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:f.body}),y&&s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Type ",s.jsx("span",{style:{color:"var(--fg)"},children:r})," to confirm"]}),s.jsx("input",{"data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:o,onChange:_=>a(_.target.value),disabled:l,style:{background:"var(--bg)",border:`1px solid ${p?"var(--vow-green)":"var(--border)"}`,borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}})]}),g&&s.jsx("span",{"data-testid":"launcher-launched-dialog-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:g}),s.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[s.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-cancel",onClick:i,disabled:l,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:l?"wait":"pointer"},children:"Cancel"}),s.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-confirm",onClick:n,disabled:v,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:f.danger?v?"var(--bg-elevated)":"var(--break-red)":v?"var(--bg-elevated)":"var(--accent-sky)",color:v?"var(--fg-dim)":(f.danger,"var(--bg-sunken)"),border:`1px solid ${f.danger?"var(--break-red)":"var(--accent-sky)"}`,borderRadius:"var(--radius-2)",cursor:v?"not-allowed":"pointer",opacity:v?.6:1},children:l?`${f.confirmLabel}…`:f.confirmLabel})]})]})})}function z1({record:e,manifest:t,fetchLauncherStatus:r}){var S,x;const n=r??(()=>ee.fetchLauncherStatus()),{data:i,isLoading:l,isError:g}=ue({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),o=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,a=o?i==null?void 0:i.nets.find(d=>{var u;return d.solverType===o||d.name===((t==null?void 0:t.name)??((u=e.summary)==null?void 0:u.name))}):void 0,f=a==null?void 0:a.budget.safeBalanceWei,y=(a==null?void 0:a.budget.safeAddress)??e.launcherSafeAddress,p=(t==null?void 0:t.solutionPriceWei)??((S=e.summary)==null?void 0:S.solutionPriceWei),v=(t==null?void 0:t.verdictPriceWei)??((x=e.summary)==null?void 0:x.verdictPriceWei),_=w1(f,p,v);return s.jsxs("section",{"data-testid":"launcher-launched-spend-panel",style:$1,children:[s.jsx("header",{style:W1,children:s.jsx("h2",{style:U1,children:"Spend & runway"})}),s.jsxs("dl",{style:J1,children:[s.jsx(Rn,{label:"Safe address",value:vv(y),title:y,testid:"launcher-launched-spend-safe-address"}),s.jsx(Rn,{label:"Safe balance",value:l?"—":f?Dr(f):"unavailable",title:f?`${f} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),s.jsx(Rn,{label:"Solution price",value:p?Dr(p):"—",title:p?`${p} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),s.jsx(Rn,{label:"Verdict price",value:v?Dr(v):"—",title:v?`${v} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),s.jsx(Rn,{label:"Per-Task cost",value:_?Dr(_.perTaskWei.toString()):"—",title:_?`${_.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),s.jsx(Rn,{label:"Projected runway",value:_?`${_.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),g&&s.jsx("span",{"data-testid":"launcher-launched-spend-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"Failed to load Safe balance."}),s.jsx("p",{style:{margin:0,color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",lineHeight:1.5},children:"Runway projects how many Tasks the Safe can fund at the current manifest prices, before any operator participation cost adjustments."})]})}function Rn({label:e,value:t,testid:r,title:n}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[s.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),s.jsx("dd",{"data-testid":r,title:n,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const $1={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},W1={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},U1={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},J1={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"8px 16px",margin:0},q1={paused:"Pause",launched:"Resume",retired:"Retire"};function K1({record:e,manifest:t,onAction:r,pending:n}){var o;const i=Ah[e.status]??Ah.launching,l=b1[e.status]??[],g=(t==null?void 0:t.name)??((o=e.summary)==null?void 0:o.name)??e.solverNetId;return s.jsxs("header",{"data-testid":"launcher-launched-status-header","data-status":e.status,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"24px 26px",display:"flex",flexDirection:"column",gap:"14px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[s.jsx("h1",{"data-testid":"launcher-launched-name",style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400,letterSpacing:"-0.01em"},children:g}),s.jsx("span",{"data-testid":"launcher-launched-status-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:i.fg,border:`1px solid ${i.border}`,borderRadius:"var(--radius-1)",padding:"3px 10px",whiteSpace:"nowrap"},children:i.label})]}),(t==null?void 0:t.description)&&s.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5,maxWidth:"720px"},children:t.description})]}),s.jsx(V1,{allowed:l,onAction:r,pending:n??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),s.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"8px 18px",margin:0,paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[s.jsx(lo,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id",mono:!0}),s.jsx(lo,{label:"Manifest cid",value:gv(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],mono:!0,title:e.manifestCid}),s.jsx(lo,{label:"Launcher Safe",value:vv(e.launcherSafeAddress),testid:"launcher-launched-safe",mono:!0,title:e.launcherSafeAddress}),s.jsx(lo,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent",mono:!0})]})]})}function lo({label:e,value:t,testid:r,additionalTestIds:n,mono:i=!1,title:l}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[s.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),s.jsxs("dd",{"data-testid":r,title:l,style:{margin:0,fontFamily:i?"'JetBrains Mono', monospace":void 0,fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,n==null?void 0:n.map(g=>s.jsx("span",{"data-testid":g,style:{display:"none"},"aria-hidden":"true",children:t},g))]})]})}function V1({allowed:e,onAction:t,pending:r,terminal:n,launching:i}){return n?s.jsx("span",{"data-testid":"launcher-launched-terminal-pill",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"6px 12px",alignSelf:"flex-start",whiteSpace:"nowrap"},children:"Retired — no further actions"}):i?s.jsx("span",{"data-testid":"launcher-launched-launching-pill",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-1)",padding:"6px 12px",alignSelf:"flex-start",whiteSpace:"nowrap"},children:"Launching…"}):e.length===0?null:s.jsx("div",{"data-testid":"launcher-launched-actions",style:{display:"flex",gap:"8px",alignSelf:"flex-start",flexWrap:"wrap"},children:e.map(l=>{const g=q1[l],o=r===l,a=l==="retired";return s.jsx("button",{type:"button","data-testid":`launcher-launched-action-${l}`,onClick:()=>t(l),disabled:r!==null,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:a?"transparent":"var(--accent-sky)",color:a?"var(--break-red)":"var(--bg-sunken)",border:`1px solid ${a?"var(--break-red)":"var(--accent-sky)"}`,borderRadius:"var(--radius-2)",cursor:r!==null?"not-allowed":"pointer",opacity:r!==null&&!o?.6:1,whiteSpace:"nowrap"},children:o?`${g}…`:g},l)})})}const $h=5,Q1={open:{fg:"var(--accent-sky)",label:"Open"},"claims-in-flight":{fg:"var(--accent-sky)",label:"In flight"},"fully-claimed":{fg:"var(--vow-green)",label:"Claimed"},settled:{fg:"var(--vow-green)",label:"Settled"},failed:{fg:"var(--break-red)",label:"Failed"}};function G1({record:e,fetchTasks:t}){var _,S,x;const[r,n]=O.useState([void 0]),i=r[r.length-1],l=t??(d=>ee.fetchLauncherTasks(d)),{data:g,isLoading:o,isError:a,error:f,refetch:y}=ue({queryKey:["launcher-tasks",e.solverNetId,i??null],queryFn:()=>l({cursor:i,limit:$h}),refetchInterval:15e3}),p=()=>{var d;(d=g==null?void 0:g.cursor)!=null&&d.before&&n(u=>[...u,g.cursor.before])},v=()=>{n(d=>d.length>1?d.slice(0,-1):d)};return s.jsxs("section",{"data-testid":"launcher-launched-tasks-panel",style:Z1,children:[s.jsxs("header",{style:eS,children:[s.jsx("h2",{style:tS,children:"Recent posted Tasks"}),s.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{y()},style:al,children:"Refresh"})]}),o&&s.jsx("p",{"data-testid":"launcher-launched-tasks-loading",style:Wh,children:"Loading…"}),a&&s.jsxs("div",{"data-testid":"launcher-launched-tasks-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Failed to load tasks: ",f instanceof Error?f.message:"unknown error"]}),!o&&!a&&g&&g.tasks.length===0&&s.jsx(X1,{}),!o&&!a&&g&&g.tasks.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-testid":"launcher-launched-tasks-list",role:"table",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",overflow:"hidden"},children:[s.jsxs("div",{role:"row",style:rS,children:[s.jsx("span",{children:"Task"}),s.jsx("span",{children:"SolverType"}),s.jsx("span",{children:"Posted"}),s.jsx("span",{children:"State"}),s.jsx("span",{style:{textAlign:"right"},children:"Claims"})]}),g.tasks.map(d=>s.jsx(Y1,{task:d},d.taskId))]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[s.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-prev",onClick:v,disabled:r.length<=1,style:{...al,opacity:r.length<=1?.5:1,cursor:r.length<=1?"not-allowed":"pointer"},children:"← Newer"}),s.jsxs("span",{style:Wh,children:["Page ",r.length,g.tasks.length<$h&&g.cursor===void 0?" · end":""]}),s.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-next",onClick:p,disabled:!((_=g.cursor)!=null&&_.before),style:{...al,opacity:(S=g.cursor)!=null&&S.before?1:.5,cursor:(x=g.cursor)!=null&&x.before?"pointer":"not-allowed"},children:"Older →"})]})]})]})}function Y1({task:e}){var r;const t=Q1[e.state]??{fg:"var(--fg-muted)",label:e.state};return s.jsxs("div",{role:"row","data-testid":"launcher-launched-task-row","data-task-id":e.taskId,style:nS,children:[s.jsx("span",{title:e.taskCid,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((r=e.summary)==null?void 0:r.title)??gv(e.taskCid)}),s.jsx("span",{title:e.solverType??e.solverNet,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.solverType??e.solverNet}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:ji(e.postedAt)}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:t.fg,textTransform:"uppercase",letterSpacing:"0.1em"},children:t.label}),s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",textAlign:"right"},children:[e.claims.current," / ",e.claims.max]})]})}function X1(){return s.jsx("div",{"data-testid":"launcher-launched-tasks-empty",style:{padding:"24px",textAlign:"center",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",border:"1px dashed var(--border)",borderRadius:"var(--radius-2)"},children:"Tasks will appear here after the first generator poll posts a Task."})}const Z1={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},eS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},tS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},rS={display:"grid",gridTemplateColumns:"2fr minmax(130px, 0.9fr) 1.4fr 1fr 0.8fr",gap:"12px",padding:"8px 14px",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",borderBottom:"1px solid var(--border)"},nS={display:"grid",gridTemplateColumns:"2fr minmax(130px, 0.9fr) 1.4fr 1fr 0.8fr",gap:"12px",alignItems:"center",padding:"10px 14px",borderBottom:"1px solid var(--border)"},al={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"6px 12px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},Wh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},sS=2500;function iS({pollIntervalMs:e=sS,navigateTo:t,solverNetId:r}={}){var w,C,E,b;const n=Iu(),[,i]=wn(),l=t??i,g=Jr(),o=r??n.solverNetId,a=ue({queryKey:["solvernets","launched",o],queryFn:()=>ee.solvernets.get(o),refetchInterval:e,enabled:!!o}),f=(w=a.data)==null?void 0:w.manifestCid,y=ue({queryKey:["solvernets","manifest",f],queryFn:()=>ee.solvernets.getManifest(f),enabled:!!f,staleTime:1/0}),[p,v]=O.useState(null),[_,S]=O.useState(null),x=nr({mutationFn:({target:k})=>ee.solvernets.transitionLifecycle(o,k),onSuccess:async k=>{await g.cancelQueries({queryKey:["solvernets","launched",o]}),g.setQueryData(["solvernets","launched",o],k),v(null),S(null)},onError:k=>{S(k instanceof Error?k.message:String(k))}}),d=nr({mutationFn:k=>ee.solvernets.updateGeneratorConfig(o,k),onSuccess:()=>{g.invalidateQueries({queryKey:["solvernets","launched",o]})}});if(!o)return s.jsx("main",{"data-testid":"launcher-launched-missing-id",style:co,children:s.jsx(Uh,{message:"No solverNetId supplied.",onBack:()=>l("/launcher")})});if(a.isLoading)return s.jsx("main",{"data-testid":"launcher-launched-loading",style:co,children:s.jsx("p",{style:lS,children:"Loading…"})});if(a.isError||!a.data){const k=a.error instanceof Error?a.error.message:"Unknown error";return s.jsx("main",{"data-testid":"launcher-launched-error",style:co,children:s.jsx(Uh,{message:`Failed to load SolverNet: ${k}`,onBack:()=>l("/launcher"),onRetry:()=>{a.refetch()}})})}const u=a.data,c=(C=y.data)==null?void 0:C.manifest,h=aS(u,c),m=(c==null?void 0:c.name)??((E=u.summary)==null?void 0:E.name)??u.solverNetId;return s.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":o,style:co,children:[s.jsx(K1,{record:u,manifest:c,onAction:k=>{S(null),v(k)},pending:x.isPending?((b=x.variables)==null?void 0:b.target)??null:null}),s.jsx(P1,{record:u,manifest:c,template:h,onSave:async k=>{await d.mutateAsync(k)}}),s.jsx(z1,{record:u,manifest:c}),s.jsx(G1,{record:u}),y.isError&&s.jsxs("p",{"data-testid":"launcher-launched-manifest-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",margin:0},children:["Failed to load manifest:"," ",oS(y.error)]}),s.jsx(H1,{open:p!==null,target:p??"paused",solverNetName:m,pending:x.isPending,errorMessage:_??void 0,onCancel:()=>{x.isPending||(v(null),S(null))},onConfirm:()=>{p&&x.mutate({target:p})}})]})}function oS(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 aS(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 wc[`${r.id}.${r.version}`]}function Uh({message:e,onBack:t,onRetry:r}){return s.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&s.jsx("button",{type:"button","data-testid":"launcher-launched-error-retry",onClick:r,style:Jh,children:"Retry"}),s.jsx("button",{type:"button","data-testid":"launcher-launched-error-back",onClick:t,style:Jh,children:"Back to launcher"})]})]})}const co={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"960px",margin:"0 auto"},lS={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},Jh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},qh="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",uo={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},ll={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},Kh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},cl={background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},qr={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},ho={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"};function cS({onSuccess:e,onCancel:t}){const[r,n]=O.useState("checking"),[i,l]=O.useState(""),[g,o]=O.useState(""),a=()=>{n("checking"),ee.hermesDoctor().then(y=>{if(!y.installed){n("not-installed");return}if(y.exitCode!==0){n("config-issue"),l(y.stderr);return}n("ok"),e()}).catch(y=>{o(y instanceof Error?y.message:String(y)),n("network-error")})},f=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(qh).catch(()=>{})};return O.useEffect(()=>{a()},[]),r==="checking"?s.jsxs("div",{"data-testid":"hermes-precheck-checking",style:uo,children:[s.jsx("span",{style:ho,children:"Hermes install check"}),s.jsx("p",{style:Kh,children:"Checking hermes install…"})]}):r==="not-installed"?s.jsxs("div",{"data-testid":"hermes-precheck-not-installed",style:uo,children:[s.jsx("span",{style:ho,children:"Hermes Agent not installed"}),s.jsx("p",{style:ll,children:"Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:"}),s.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[s.jsx("pre",{style:{...cl,flex:1},children:qh}),s.jsx("button",{type:"button","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:f,style:{...qr,padding:"6px 10px",fontSize:"11px"},children:"Copy"})]}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...qr,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"I've installed Hermes — retry precheck"}),s.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:qr,children:"Cancel"})]})]}):r==="network-error"?s.jsxs("div",{"data-testid":"hermes-precheck-network-error",style:uo,children:[s.jsx("span",{style:ho,children:"Hermes precheck failed"}),s.jsxs("p",{style:ll,children:["Could not reach the daemon API to run ",s.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),g?s.jsx("pre",{style:cl,children:g}):null,s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...qr,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"Retry precheck"}),s.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:qr,children:"Cancel"})]})]}):r==="config-issue"?s.jsxs("div",{"data-testid":"hermes-precheck-config-issue",style:uo,children:[s.jsx("span",{style:ho,children:"Hermes Agent configuration issue"}),s.jsx("p",{style:ll,children:"Hermes is installed but reports configuration issues:"}),s.jsx("pre",{style:cl,children:i||"(no diagnostic output)"}),s.jsxs("p",{style:Kh,children:["Run ",s.jsx("code",{children:"hermes model"})," or ",s.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...qr,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"Retry precheck"}),s.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:qr,children:"Cancel"})]})]}):s.jsx(s.Fragment,{})}const Hu="claude-code",zu="codex",Ri="hermes-agent",uS={"claude-code-learner":Hu,"codex-code-learner":zu},dS={[Hu]:"Claude Code",[zu]:"Codex",[Ri]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function St(e){return e?uS[e]??e:""}function yr(e){const t=St(e);return dS[t]??t}function jv(e,t){const r=yr(e);return t?`${r} ${t}`:r}function hS(e,t){return St(e)===St(t)}const Rv=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],Tv=[{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"}],Dv=[{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 fS(e){return St(e)===zu}function pS(e){return St(e)===Ri}function wa(e){return pS(e)?Dv:fS(e)?Tv:Rv}function Zn(e){return wa(e)[0].id}function Po(e,t){const n=wa(t).find(i=>i.id===e)??null??Rv.find(i=>i.id===e)??Tv.find(i=>i.id===e)??Dv.find(i=>i.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}const Vh=[{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 gS(e){return St(e)===Ri?Vh.filter(t=>t.name!=="claude-code-learner"):Vh}const vS=new Set(["swe-rebench-v2-runtime"]),mS={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},ia="bundled:";function Hs(e){return mS[e]??e}function Jn(e){return e.startsWith(ia)?e.slice(ia.length):e}function yS(e){return e.source==="bundled"?`${ia}${e.name}`:e.name}function Qh(e){const t=new Set,r=[];for(const n of e){const i=Jn(n);t.has(i)||(t.add(i),r.push(n))}return r}function _S(e,t,r){const n=new Set,i=[];for(const l of gS(r))n.add(l.name),i.push(l);for(const l of e){if(n.has(l.name))continue;n.add(l.name);const g=vS.has(l.name);i.push({...l,...g?{defaultIncluded:!0}:{recommended:!0},description:l.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const l of t){const g=Jn(l);n.has(g)||(n.add(g),i.push({name:g,version:"configured",source:l.startsWith(ia)?"bundled":"custom",description:"Already configured"}))}return i}function xS(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function Ec({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:i,searchTestId:l,harness:g}){const[o,a]=O.useState(""),[f,y]=O.useState(!1),[p,v]=O.useState(null),_=O.useMemo(()=>_S(e,t,g),[e,t,g]),S=new Set(t.map(Jn)),x=new Set(r.map(Jn)),d=new Set(S);for(const R of _)R.defaultIncluded&&!x.has(R.name)&&d.add(R.name);const u=_.filter(R=>d.has(R.name)),c=u.filter(R=>R.defaultIncluded).length,h=u.length-c,m=_.filter(R=>!d.has(R.name)),w=o.trim().toLowerCase(),C=w?m.filter(R=>`${R.name} ${Hs(R.name)} ${R.source} ${R.description??""}`.toLowerCase().includes(w)):m,E=R=>{const L=R.defaultIncluded?r.filter(B=>Jn(B)!==R.name):r,P=R.defaultIncluded?t:Qh([...t,yS(R)]);n(P,L),y(!1),a("")},b=R=>{if(R.defaultIncluded){v(R),y(!1),a("");return}n(t.filter(L=>Jn(L)!==R.name),r)},k=()=>{p&&(n(t,Qh([...r,p.name])),v(null))};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",position:"relative"},children:[s.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:u.map(R=>s.jsxs("span",{"data-testid":`${i}-chip`,"data-plugin":R.name,style:{border:"1px solid var(--border)",borderRadius:"999px",padding:"5px 7px 5px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg)",background:R.defaultIncluded?"var(--bg-sunken)":"transparent",display:"inline-flex",alignItems:"center",gap:"6px"},children:[s.jsxs("span",{children:[Hs(R.name),s.jsx("span",{style:{color:"var(--fg-dim)"},children:R.defaultIncluded?" · default":" · selected"})]}),s.jsx("button",{type:"button","aria-label":`Remove ${Hs(R.name)}`,"data-testid":`${i}-remove`,"data-plugin":R.name,onClick:()=>b(R),style:{border:"none",background:"transparent",color:"var(--fg-muted)",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1,padding:"1px 3px"},children:"x"})]},R.name))}),p&&s.jsxs("div",{role:"alertdialog","data-testid":`${i}-default-warning`,style:{border:"1px solid var(--wane)",borderRadius:"8px",background:"var(--bg-elevated)",padding:"10px 12px",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},children:[Hs(p.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),s.jsxs("span",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":`${i}-default-warning-cancel`,onClick:()=>v(null),style:{border:"1px solid var(--border)",borderRadius:"6px",background:"transparent",color:"var(--fg-muted)",padding:"6px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer"},children:"Keep"}),s.jsx("button",{type:"button","data-testid":`${i}-default-warning-confirm`,onClick:k,style:{border:"1px solid var(--wane)",borderRadius:"6px",background:"transparent",color:"var(--wane)",padding:"6px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer"},children:"Remove"})]})]}),s.jsxs("button",{type:"button","data-testid":`${i}-trigger`,"aria-haspopup":"listbox","aria-expanded":f,onClick:()=>y(R=>!R),onKeyDown:R=>{R.key==="Escape"&&(y(!1),a(""))},style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"9px 11px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",alignItems:"center",textAlign:"left",cursor:"pointer"},children:[s.jsxs("span",{style:{minWidth:0},children:["Add plugin",s.jsxs("span",{style:{color:"var(--fg-dim)"},children:[" ","· ",c," default",h>0?` · ${h} selected`:""]})]}),s.jsx("span",{style:{color:"var(--fg-muted)"},children:f?"^":"v"})]}),f&&s.jsxs("div",{style:{position:"absolute",top:"calc(100% + 6px)",left:0,right:0,zIndex:30,border:"1px solid var(--border)",borderRadius:"8px",background:"var(--bg-elevated)",boxShadow:"0 14px 34px rgba(0, 0, 0, 0.35)",overflow:"hidden"},children:[s.jsx("input",{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":l,value:o,onChange:R=>a(R.target.value),onKeyDown:R=>{R.key==="Escape"&&(y(!1),a(""))},placeholder:"Search plugins",style:{width:"100%",boxSizing:"border-box",background:"var(--bg)",border:"none",borderBottom:"1px solid var(--border)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",outline:"none"}}),s.jsx("div",{role:"listbox","aria-label":"Plugins",style:{maxHeight:"240px",overflowY:"auto",display:"flex",flexDirection:"column"},children:C.length===0?s.jsx("span",{style:{padding:"12px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:m.length===0?"No plugins available to add.":"No matching plugins."}):C.map((R,L)=>{const P=d.has(R.name);return s.jsxs("button",{type:"button",role:"option","aria-selected":P,"data-testid":i,"data-plugin":R.name,"data-plugin-active":P?"true":"false","data-plugin-default":R.defaultIncluded?"true":"false",onClick:()=>E(R),style:{border:"none",borderTop:L===0?"none":"1px solid var(--border)",background:P?"var(--bg-sunken)":"transparent",color:"var(--fg)",padding:"10px 12px",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",textAlign:"left",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("span",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{fontSize:"13px",color:"var(--fg)"},children:Hs(R.name)}),s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)"},children:xS(R)})]}),s.jsx("span",{style:{color:R.defaultIncluded?"var(--fg-dim)":R.recommended?"var(--accent-sky)":"var(--fg-muted)",fontSize:"11px",alignSelf:"center",textTransform:"uppercase",letterSpacing:0},children:R.defaultIncluded?"Default":R.recommended?"Recommended":"Add"})]},R.name)})})]})]})}const Pv="claude-code",Mv="codex",SS="hermes-agent",bS={"claude-code-learner":Pv,"codex-code-learner":Mv};function wS(e){return bS[e]??e}const CS={"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}},kS={[Pv]:{subscriptionPath:!0},[Mv]:{subscriptionPath:!0},[SS]:{subscriptionPath:!1}},$u=1;function ES(e){const t=CS[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 jS(e){if(!e)return!1;const t=wS(e),r=kS[t];return r?!r.subscriptionPath:!0}function Lv(e,t,r=$u){if(!jS(e))return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?ES(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 RS(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 Bv(e,t,r=$u){return Lv(e,t,r)}function Iv({harness:e,modelId:t,thresholdUsd:r=$u,variant:n="card",testIdPrefix:i="cost-estimate"}){const l=Lv(e,t,r);if(!l.showEstimate)return s.jsxs("div",{"data-testid":`${i}-subscription`,"data-cost-mode":"subscription",style:n==="card"?MS:LS,children:[s.jsx("span",{style:DS,"aria-hidden":"true",children:"◆"}),s.jsx("span",{style:PS,children:l.suppressedReason??"Included in subscription, no per-task API cost."})]});const g=l.estimate,o=(g==null?void 0:g.usd)??null,a=l.requiresConfirmation;return s.jsxs("div",{"data-testid":`${i}-panel`,"data-cost-mode":"paid-api","data-cost-usd":o!==null?o.toFixed(4):"unknown","data-cost-high-cost":a?"true":"false",style:n==="card"?BS(a):IS(a),children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"12px"},children:[s.jsx("span",{style:TS,children:"Estimated cost per task"}),s.jsx("span",{"data-testid":`${i}-amount`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:n==="card"?"18px":"14px",fontWeight:500,color:a?"var(--break-red)":"var(--fg)"},children:o!==null?`~${RS(o)}`:"unavailable"})]}),g&&s.jsx("span",{"data-testid":`${i}-heuristic`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)"},children:"Rough estimate — actual cost varies."}),o===null&&s.jsx("span",{"data-testid":`${i}-unknown`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)"},children:"No pricing entry for this model id — confirm rates with your provider before joining."}),a&&s.jsxs("span",{"data-testid":`${i}-warning`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--break-red)"},children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}const TS={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},DS={color:"var(--accent-sky)",fontSize:"12px"},PS={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},MS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 14px",display:"flex",alignItems:"center",gap:"10px"},LS={display:"flex",alignItems:"center",gap:"8px",padding:"6px 0"};function BS(e){return{background:"var(--bg-elevated)",border:`1px solid ${e?"var(--break-red)":"var(--border)"}`,borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"8px"}}function IS(e){return{border:`1px solid ${e?"var(--break-red)":"var(--border)"}`,borderRadius:"var(--radius-2)",padding:"8px 10px",display:"flex",flexDirection:"column",gap:"4px"}}function Tn({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[i,l]=O.useState(!1);return s.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:"6px"},children:[s.jsx("button",{type:"button","data-testid":"inline-help-trigger","aria-label":e,"aria-expanded":i,onClick:()=>l(g=>!g),style:{width:"14px",height:"14px",lineHeight:"12px",padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:600,fontStyle:"italic",color:"var(--fg-muted)",background:"var(--bg-elevated)",border:"1px solid var(--fg-muted)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"i"}),i&&s.jsxs("span",{"data-testid":"inline-help-panel",role:"note",style:{display:"block",background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",lineHeight:1.6,fontWeight:400,letterSpacing:"normal",textTransform:"none",whiteSpace:"pre-line",color:"var(--fg-muted)",maxWidth:"420px"},children:[t,r&&s.jsxs(s.Fragment,{children:[" ",s.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",style:{color:"var(--accent-sky)"},children:n})]})]})]})}const AS="Self-improving agent by Nous Research. Built-in learning loop.",Dn="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",OS=Hu;function FS(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function NS(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function HS(e){const t=[...new Set(e)].sort();return{readiness:ue({queryKey:["harness-readiness",t.join(",")],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{const n=await Promise.all(t.map(async i=>{try{return[i,await ee.harnessReadiness(i)]}catch(l){if(l.code==="harness_not_found")return[i,void 0];throw l}}));return new Map(n)}}).data??new Map}}function zS({manifestCid:e,navigateTo:t}={}){var q,G,X;const r=Iu(),[,n]=wn(),i=t??n,l=Jr(),g=e??r.cid,o=ue({queryKey:["solvernets","manifest",g],queryFn:()=>ee.solvernets.getManifest(g),enabled:!!g,retry:!1}),a=ue({queryKey:["solvernets","catalog"],queryFn:()=>ee.getSolverNets()}),f=(q=o.data)==null?void 0:q.manifest,y=f?FS(a.data,f.contract):void 0,p=((y==null?void 0:y.compatibleHarnesses)??[]).filter(K=>K.supportsRoles.includes("solving")).map(K=>({...K,name:St(K.name)})).filter((K,T,N)=>N.findIndex(W=>W.name===K.name)===T),v=((G=p[0])==null?void 0:G.name)??OS,_=Zn(v),[S,x]=O.useState({roles:[],harness:v,plugins:[],disabledDefaultPlugins:[],model:_}),[d,u]=O.useState(null),[c,h]=O.useState(null),[m,w]=O.useState(!1),C=O.useRef(!1),[E,b]=O.useState(!1),k=(X=p[0])==null?void 0:X.name;O.useEffect(()=>{C.current||k&&k!==S.harness&&x(K=>({...K,harness:k,model:Zn(k)}))},[k]);const R=wa(S.harness),{readiness:L}=HS(p.map(K=>K.name)),P=L.get(S.harness),B=nr({mutationFn:()=>ee.operator.join(g,{...(f==null?void 0:f.name)!==void 0?{name:f.name}:{},...(f==null?void 0:f.contract)!==void 0?{contract:{id:f.contract.id,version:f.contract.version}}:{},roles:S.roles,...S.roles.includes("solver")?{harness:S.harness,plugins:S.plugins,disabledDefaultPlugins:S.disabledDefaultPlugins,model:S.model}:{}}),onSuccess:K=>{l.invalidateQueries({queryKey:["operator","joined"]}),l.invalidateQueries({queryKey:["bootstrap"]}),h({manifestCid:K.manifestCid,name:K.config.name??(f==null?void 0:f.name)??K.manifestCid,roles:K.config.roles,restartRequired:K.restartRequired})},onError:K=>{u(K instanceof Error?K.message:String(K))}});if(!g)return s.jsx("main",{"data-testid":"join-flow-missing-cid",style:zs,children:s.jsx(Gh,{message:"No manifest cid supplied.",onBack:()=>i("/operator#solvernets")})});if(o.isLoading)return s.jsx("main",{"data-testid":"join-flow-loading",style:zs,children:s.jsx("p",{style:WS,children:"Loading manifest…"})});if(o.isError||!f){const K=o.error instanceof Error?o.error.message:"Unknown error";return s.jsx("main",{"data-testid":"join-flow-error",style:zs,children:s.jsx(Gh,{message:`Failed to load manifest: ${K}`,onBack:()=>i("/operator#solvernets"),onRetry:()=>{o.refetch()}})})}if(c)return s.jsx("main",{"data-testid":"join-flow-success",style:zs,children:s.jsx($S,{success:c,navigate:i})});const{openRoles:H}=f,z=K=>{H.includes(K)&&x(T=>{const W=T.roles.includes(K)?T.roles.filter($=>$!==K):H.filter($=>$===K||T.roles.includes($));return{...T,roles:W}})},J=S.roles.includes("solver"),U=S.roles.includes("evaluator"),j=Bv(J?S.harness:void 0,J?S.model:void 0),D=J&&j.requiresConfirmation,M=D&&!E,A=J&&(P==null?void 0:P.ready)===!1,F=S.roles.length>0&&!B.isPending&&!M&&!A;return s.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":g,style:zs,children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsxs("span",{"data-testid":"join-flow-title",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:"var(--fg)"},children:["Join ",f.name]}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:f.description})]}),s.jsxs("section",{"data-testid":"join-flow-summary",style:$s,children:[s.jsx("span",{style:Ws,children:"Manifest"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[s.jsx("span",{children:"Contract"}),s.jsxs("span",{style:{color:"var(--fg)"},children:[f.contract.id," · ",f.contract.version]}),s.jsx("span",{children:"Solution price"}),s.jsx("span",{style:{color:"var(--fg)"},children:Dr(f.solutionPriceWei)}),s.jsx("span",{children:"Verdict price"}),s.jsx("span",{style:{color:"var(--fg)"},children:Dr(f.verdictPriceWei)}),s.jsx("span",{children:"Open roles"}),s.jsx("span",{"data-testid":"join-flow-open-roles",style:{color:"var(--fg)"},children:H.join(", ")||"none"}),s.jsx("span",{children:"Launcher"}),s.jsxs("span",{style:{color:"var(--fg)"},children:[NS(f.launcher.safeAddress)," · agentId"," ",f.launcher.agentId]}),s.jsx("span",{children:"Manifest CID"}),s.jsx("span",{"data-testid":"join-flow-manifest-cid",style:{color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g})]})]}),s.jsxs("section",{style:$s,children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:Ws,children:"Roles"}),s.jsxs(Tn,{label:"Roles help",docHref:`${Dn}#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.",`
|
|
77
|
+
|
|
78
|
+
`,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
|
|
79
|
+
|
|
80
|
+
`,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${H.length||1}, 1fr)`,border:"1px solid var(--border)",borderRadius:"var(--radius-2)",overflow:"hidden"},children:H.map((K,T)=>{const N=S.roles.includes(K),W=`join-role-${K}`;return s.jsxs("label",{htmlFor:W,"data-testid":"join-role-option","data-role":K,"data-role-active":N?"true":"false",style:{padding:"12px 16px",display:"flex",flexDirection:"column",gap:"6px",background:N?"var(--bg)":"transparent",color:N?"var(--fg)":"var(--fg-muted)",borderRight:T<H.length-1?"1px solid var(--border)":"none",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s.jsx("input",{id:W,type:"checkbox",checked:N,onChange:()=>z(K),"aria-label":K==="solver"?"Solver":"Evaluator",style:{accentColor:"var(--accent-sky)",width:"14px",height:"14px"}}),s.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:K==="solver"?"Solver":"Evaluator"})]}),s.jsx("span",{style:{fontSize:"11px",color:N?"var(--fg-muted)":"var(--fg-dim)",paddingLeft:"22px"},children:K==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},K)})})]}),J&&s.jsxs("section",{"data-testid":"join-flow-solver-fields",style:$s,children:[s.jsx("span",{style:Ws,children:"Solver configuration"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:ul,children:"Harness"}),s.jsxs(Tn,{label:"Harness help",docHref:`${Dn}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
|
|
81
|
+
|
|
82
|
+
`,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
|
|
83
|
+
|
|
84
|
+
`,"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.",`
|
|
85
|
+
|
|
86
|
+
`,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),s.jsxs("select",{"aria-label":"Harness","data-testid":"join-harness-select",value:S.harness,onChange:K=>{const T=K.target.value;C.current=!0,x({...S,harness:T,model:Zn(T)}),b(!1)},style:Yh,children:[p.map(K=>{const T=L.get(K.name),N=(T==null?void 0:T.ready)===!1;return s.jsxs("option",{value:K.name,disabled:N,"data-testid":"join-harness-option","data-harness":K.name,"data-harness-ready":T===void 0?"unknown":T.ready?"true":"false",children:[jv(K.name,K.version),N?" — setup required":""]},K.name)}),(!y||p.length===0)&&s.jsx("option",{value:S.harness,children:yr(S.harness)})]}),S.harness===Ri&&s.jsx("span",{"data-testid":"join-harness-hermes-description",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)"},children:AS}),(P==null?void 0:P.ready)===!1&&s.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":S.harness,role:"status",style:{display:"flex",flexDirection:"column",gap:"4px",padding:"10px 12px",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg)"},children:[s.jsxs("span",{style:{color:"var(--break-red)"},children:[yr(S.harness)," is not ready",P.reason?`: ${P.reason}`:""]}),P.nextStep&&s.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",style:{color:"var(--fg-muted)"},children:[P.nextStep.description,P.nextStep.cli?` (${P.nextStep.cli})`:""]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:ul,children:"Model"}),s.jsxs(Tn,{label:"Model help",docHref:`${Dn}#harness-and-model`,children:["The model is the LLM the harness runs.",`
|
|
87
|
+
|
|
88
|
+
`,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
|
|
89
|
+
|
|
90
|
+
`,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
|
|
91
|
+
|
|
92
|
+
`,"Check the cost estimate below before you join."]})]}),s.jsxs("select",{"aria-label":"Model","data-testid":"join-model-select",value:S.model,onChange:K=>{x({...S,model:K.target.value}),b(!1)},style:Yh,children:[R.map(K=>s.jsx("option",{value:K.id,children:K.label},K.id)),(()=>{const K=Po(S.model,S.harness);return K.isCustom?s.jsx("option",{value:S.model,children:K.label},S.model):null})()]})]})]}),s.jsx(Iv,{harness:S.harness,modelId:S.model,testIdPrefix:"join-flow-cost"}),D&&s.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":E?"true":"false",style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 14px",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",cursor:"pointer"},children:[s.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:E,onChange:K=>b(K.target.checked),style:{accentColor:"var(--break-red)",marginTop:"2px",width:"14px",height:"14px"},"aria-label":"I understand the per-task cost and have a budget for this"}),s.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."})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:ul,children:"Plugins"}),s.jsxs(Tn,{label:"Plugins help",docHref:`${Dn}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
|
|
93
|
+
|
|
94
|
+
`,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
|
|
95
|
+
|
|
96
|
+
`,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
|
|
97
|
+
|
|
98
|
+
`,"You can re-join later with more plug-ins."]})]}),s.jsx(Ec,{available:(y==null?void 0:y.compatiblePlugins)??[],selected:S.plugins,disabledDefaultPlugins:S.disabledDefaultPlugins,onChange:(K,T)=>x({...S,plugins:K,disabledDefaultPlugins:T}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:S.harness})]})]}),U&&!J&&s.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:$s,children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:Ws,children:"Evaluator configuration"}),s.jsxs(Tn,{label:"Evaluator configuration help",docHref:`${Dn}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
|
|
99
|
+
|
|
100
|
+
`,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
|
|
101
|
+
|
|
102
|
+
`,"For many SolverNets that function is deterministic and uses no model at all."]})]}),s.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["The evaluator harness is bound to"," ",s.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]})]}),U&&J&&s.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:$s,children:[s.jsxs("span",{style:Pn,children:[s.jsx("span",{style:Ws,children:"Evaluator binding"}),s.jsxs(Tn,{label:"Evaluator binding help",docHref:`${Dn}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
|
|
103
|
+
|
|
104
|
+
`,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
|
|
105
|
+
|
|
106
|
+
`,"The harness and model fields above apply only to the solver role."]})]}),s.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["Evaluator harness is bound to"," ",s.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]})]}),m&&s.jsx(cS,{onSuccess:()=>{w(!1),B.mutate()},onCancel:()=>{w(!1)}}),d&&s.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:d}),s.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[s.jsx("button",{type:"button","data-testid":"join-flow-cancel",onClick:()=>i("/operator#solvernets"),style:fn,children:"Cancel"}),s.jsx("button",{type:"button","data-testid":"join-flow-submit",disabled:!F,onClick:()=>{if(u(null),S.roles.includes("solver")&&S.harness===Ri){w(!0);return}B.mutate()},style:{...fn,background:F?"var(--accent-sky)":"transparent",color:F?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${F?"var(--accent-sky)":"var(--border)"}`,cursor:F?"pointer":"not-allowed"},children:B.isPending?"Joining…":"Join SolverNet"})]})]})}function Gh({message:e,onBack:t,onRetry:r}){return s.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&s.jsx("button",{type:"button","data-testid":"join-flow-retry",onClick:r,style:fn,children:"Retry"}),s.jsx("button",{type:"button","data-testid":"join-flow-back",onClick:t,style:fn,children:"Back"})]})]})}function $S({success:e,navigate:t}){const r=e.roles.map(a=>a==="solver"?"Solver":"Evaluator").join(" + "),[n,i]=O.useState(!1),[l,g]=O.useState(null),o=async()=>{i(!0),g(null);try{if(!(await ee.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(a){g(a instanceof Error?a.message:"Restart request failed."),i(!1)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-testid":"join-flow-success-card",role:"status",style:{background:"var(--bg-elevated)",border:"1px solid var(--vow-green)",borderRadius:"var(--radius-3)",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--vow-green)"},children:"Joined"}),s.jsxs("span",{"data-testid":"join-flow-success-name",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)"},children:["You joined ",e.name]}),s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:["You're in as ",r||"an operator",". This SolverNet now shows in your joined list."]}),e.restartRequired&&s.jsx("span",{"data-testid":"join-flow-success-restart",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--accent-gold)",lineHeight:1.5},children:"Restart the node to start participating — the daemon picks up SolverNet config on restart."})]}),l&&s.jsx("div",{role:"alert","data-testid":"join-flow-success-restart-error",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--break-red)",lineHeight:1.5},children:l}),s.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[s.jsx("button",{type:"button","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),style:fn,children:"Browse SolverNets"}),s.jsx("button",{type:"button","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),style:fn,children:"View joined SolverNet"}),s.jsx("button",{type:"button","data-testid":"join-flow-success-restart-button",onClick:o,disabled:n,style:{...fn,background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",cursor:n?"wait":"pointer",opacity:n?.7:1},children:n?"Restarting…":"Restart node now"})]})]})}const zs={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"880px",margin:"0 auto"},WS={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},$s={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},Ws={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},ul={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},Pn={display:"flex",alignItems:"flex-start",gap:"8px"},Yh={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"},fn={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"};function US({capture:e}){var t;return s.jsxs("section",{style:{display:"grid",gap:6},children:[s.jsx("h2",{style:{margin:0,fontSize:14},children:"Executor"}),s.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"120px 1fr",gap:"6px 12px",margin:0},children:[s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Tool"}),s.jsx("dd",{style:{margin:0},children:e.originatingTool.name}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Version"}),s.jsx("dd",{style:{margin:0},children:e.originatingTool.version??"unknown"}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Repo"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.repoRemoteUrl??"none"}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Commit"}),s.jsx("dd",{style:{margin:0,fontFamily:"monospace"},children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function JS({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return s.jsxs("section",{style:{display:"grid",gap:8},children:[s.jsx("h2",{style:{margin:0,fontSize:14},children:"Redactions"}),t.length===0?s.jsx("div",{style:{color:"var(--fg-muted)"},children:"No redacted attributes."}):s.jsx("div",{style:{display:"grid",gap:6},children:t.map((r,n)=>s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, 180px) 1fr",gap:12,fontFamily:"monospace",fontSize:12},children:[s.jsx("span",{children:r.span}),s.jsx("span",{children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function qS({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:i,onTrustRepo:l}){const{capture:g,spans:o}=e;return s.jsxs("div",{style:{display:"grid",gap:18},children:[s.jsxs("header",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[s.jsxs("div",{children:[s.jsx("h1",{style:{margin:0,fontSize:22},children:g.sessionId}),s.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)"},children:[new Date(g.capturedAt).toLocaleString()," · ",o.length," spans"]})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"start"},children:[g.repoRemoteUrl?s.jsx("button",{type:"button",onClick:()=>l(!0),children:"Trust repo"}):null,s.jsx("button",{type:"button",disabled:r,onClick:i,children:r?"Skipping":"Skip"}),s.jsx("button",{type:"button",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),s.jsx(US,{capture:g}),s.jsx(JS,{spans:o}),s.jsxs("section",{style:{display:"grid",gap:8},children:[s.jsx("h2",{style:{margin:0,fontSize:14},children:"Trajectory"}),s.jsx("div",{style:{display:"grid",gap:6},children:o.map(a=>s.jsx("div",{style:{padding:"10px 12px",border:"1px solid var(--border)",borderRadius:8,background:"var(--panel)"},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[s.jsx("strong",{children:a.name}),s.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"monospace",fontSize:12},children:a.spanId})]})},a.spanId))})]})]})}const KS={default:{color:"var(--fg-dim)",border:"var(--border)"},live:{color:"var(--vow-green)",border:"var(--vow-green)"},attention:{color:"var(--wane)",border:"var(--wane)"},danger:{color:"var(--break-red)",border:"var(--break-red)"}};function Wu({title:e,summary:t,metaChip:r,defaultExpanded:n=!1,variant:i="default",dirty:l,children:g}){const[o,a]=O.useState(n);O.useEffect(()=>{n&&a(!0)},[n]);const f=KS[(r==null?void 0:r.tone)??"default"],y=i==="danger"?"var(--break-red)":"var(--border)";return s.jsxs("section",{style:{background:"var(--bg-elevated)",border:`1px solid ${y}`,borderRadius:"10px",overflow:"hidden"},children:[s.jsxs("button",{type:"button",onClick:()=>a(p=>!p),style:{display:"grid",gridTemplateColumns:"1fr auto auto",gap:"16px",alignItems:"center",padding:"20px 24px",width:"100%",background:"transparent",border:"none",color:"inherit",textAlign:"left",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{display:"block",fontSize:"17px",fontWeight:500,color:i==="danger"?"var(--break-red)":"var(--fg)",letterSpacing:"-0.01em",marginBottom:"4px"},children:e}),s.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:t})]}),r&&s.jsx("span",{style:{fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:f.color,border:`1px solid ${f.border}`,borderRadius:"4px",padding:"2px 8px"},children:r.label}),s.jsx("span",{style:{color:o?"var(--fg)":"var(--fg-dim)",fontSize:"14px",width:"16px",textAlign:"right"},children:o?"▾":"▸"})]}),o&&s.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"24px",display:"flex",flexDirection:"column",gap:"14px"},children:[g,l&&s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"14px",marginTop:"4px",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace"},children:[s.jsx("span",{style:{fontSize:"12px",color:l.error?"var(--break-red)":"var(--accent-sky)"},children:l.error??(l.saving?"Saving…":l.pendingSummary)}),s.jsxs("span",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button",onClick:l.onCancel,disabled:l.saving,style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 20px",background:"transparent",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:l.saving?"wait":"pointer"},children:"Cancel"}),s.jsx("button",{type:"button",onClick:l.onSave,disabled:l.saving,style:{border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:l.saving?"wait":"pointer"},children:"Save changes"})]})]})]})]})}function jc(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function VS(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(jc(e.perArtifactTypePrice))===JSON.stringify(jc(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function Xh({label:e,value:t,meta:r}){return s.jsxs("div",{"data-testid":"operator-donation-fact",style:{border:"1px solid var(--border)",borderRadius:"8px",padding:"12px 14px",minWidth:0,display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{className:"j-label",children:e}),s.jsx("strong",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:"var(--fg)",fontWeight:500},children:t}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})]})}function QS({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,error:i,onSave:l,registerRevert:g}){const[o,a]=O.useState(e.donation.enabled),[f,y]=O.useState(!1),p=O.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:o}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,o]),v=!VS(e,p),_=x=>{if(x&&!o&&!e.donation.enabled){y(!0);return}a(x)},S=()=>{const x={...p,donation:{enabled:!0}};a(!0),y(!1),g(()=>a(!1)),l(x)};return s.jsxs("div",{"data-testid":"operator-donation-status",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"18px",display:"flex",flexDirection:"column",gap:"14px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"7px",minWidth:"260px",flex:"1 1 360px"},children:[s.jsx("span",{className:"j-label",children:"Donate execution data"}),s.jsx("strong",{"data-testid":"operator-donation-mode",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:o?"var(--vow-green)":"var(--fg)",fontWeight:500},children:o?"Donation is on":"Donation is off"}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",lineHeight:1.45},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."})]}),s.jsxs("label",{"data-testid":"operator-donation-toggle",style:{border:"1px solid var(--border)",borderRadius:"999px",padding:"5px",display:"inline-grid",gridTemplateColumns:"minmax(72px, auto) 42px",alignItems:"center",gap:"8px",cursor:"pointer",background:"var(--bg-sunken)",position:"relative"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:o?"var(--vow-green)":"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.12em",paddingLeft:"8px",whiteSpace:"nowrap"},children:o?"On":"Off"}),s.jsx("span",{"aria-hidden":"true",style:{width:"38px",height:"22px",borderRadius:"999px",background:o?"var(--vow-green)":"var(--border)",position:"relative",display:"inline-block"},children:s.jsx("span",{style:{position:"absolute",top:"3px",left:o?"19px":"3px",width:"16px",height:"16px",borderRadius:"999px",background:"var(--bg)",transition:"left 120ms ease"}})}),s.jsx("input",{"aria-label":"Donate produced data",type:"checkbox",checked:o,onChange:x=>_(x.target.checked),style:{position:"absolute",opacity:0,pointerEvents:"none"}})]})]}),s.jsxs("div",{"data-testid":"operator-donation-facts",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"10px"},children:[s.jsx(Xh,{label:"Eligible runs",value:String(t),meta:"local history"}),s.jsx(Xh,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),s.jsx("div",{"data-testid":"operator-donation-caveat",style:{border:"1px solid var(--border)",borderRadius:"8px",padding:"11px 13px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1.45},children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."}),s.jsxs("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[s.jsx(Ct,{href:"/operator/execution-data",style:{color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",textDecoration:"none"},children:"Review execution data →"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginLeft:"auto"},children:[s.jsx("span",{"data-testid":"operator-donation-settings-state",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:i?"var(--break-red)":v?"var(--accent-sky)":"var(--fg-dim)"},children:i??(v?"Donation changed":"Current")}),s.jsx("button",{type:"button",disabled:!v||n,onClick:()=>{const x=e.donation.enabled;o!==x&&g(()=>a(x)),l(p)},style:{border:"1px solid var(--accent-sky)",background:v?"var(--accent-sky)":"transparent",color:v?"var(--bg-sunken)":"var(--fg-dim)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:!v||n?"not-allowed":"pointer"},children:n?"Saving…":"Save"})]})]}),f&&s.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"operator-donation-confirm-title","data-testid":"operator-donation-confirm",style:{position:"fixed",inset:0,zIndex:40,background:"rgba(0, 0, 0, 0.55)",display:"grid",placeItems:"center",padding:"24px"},children:s.jsxs("div",{style:{width:"min(460px, 100%)",border:"1px solid var(--border)",borderRadius:"10px",background:"var(--bg-elevated)",padding:"20px",display:"flex",flexDirection:"column",gap:"14px",boxShadow:"0 22px 70px rgba(0, 0, 0, 0.36)"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"7px"},children:[s.jsx("span",{className:"j-label",children:"Enable donation"}),s.jsx("strong",{id:"operator-donation-confirm-title",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:"var(--fg)",fontWeight:500},children:"Share future execution data"}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",lineHeight:1.5},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."}),s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:"Turning donation off later stops future publishing, but data already published to IPFS may remain available."})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px",flexWrap:"wrap"},children:[s.jsx("button",{type:"button",onClick:()=>y(!1),style:{border:"1px solid var(--border)",background:"transparent",color:"var(--fg)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:"pointer"},children:"Cancel"}),s.jsx("button",{type:"button",onClick:S,style:{border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:"pointer"},children:"Enable donation"})]})]})})]})}function GS({defaultExpanded:e=!1,onRestartPending:t=()=>{}}){const r=Jr(),{data:n,isLoading:i,isError:l,error:g,refetch:o}=ue({queryKey:["operator-artifacts","served"],queryFn:()=>ee.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=O.useRef(null),f=_=>{a.current=_},y=nr({mutationFn:_=>ee.operator.updatePricing(_),onSuccess:async()=>{a.current=null,t(),await r.invalidateQueries({queryKey:["operator-artifacts"]})},onError:()=>{const _=a.current;a.current=null,_==null||_()}}),p=n==null?void 0:n.summary,v=p?`${p.served.totalCount} eligible runs · donation ${n!=null&&n.pricing.donation.enabled?"on":"off"} · ${p.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return s.jsxs(Wu,{title:"Data donation",summary:v,defaultExpanded:e,metaChip:{label:n!=null&&n.pricing.donation.enabled?"IPFS donation on":"Donation off",tone:n!=null&&n.pricing.donation.enabled?"live":"default"},children:[i&&s.jsx("p",{"data-testid":"operator-data-market-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"Loading execution data…"}),l&&s.jsxs("div",{role:"alert","data-testid":"operator-data-market-error",style:{border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"center"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontSize:"13px"},children:g instanceof Error?g.message:"Failed to load execution data."}),s.jsx("button",{type:"button",onClick:()=>{o()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",background:"transparent",color:"var(--fg)",padding:"7px 10px",cursor:"pointer"},children:"Retry"})]}),n&&s.jsx(s.Fragment,{children:s.jsx(QS,{pricing:n.pricing,eligibleRuns:n.summary.served.totalCount,peerDatasetsUsed:n.summary.network.totalCount,saving:y.isPending,error:y.error instanceof Error?y.error.message:null,onSave:_=>y.mutate(_),registerRevert:f},`${n.pricing.publicEndpoint}|${n.pricing.defaultPriceUsdc}|${n.pricing.donation.enabled}|${JSON.stringify(jc(n.pricing.perArtifactTypePrice))}`)})]})}function Av(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 Rc(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function YS(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function oa(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Tc(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function Zh(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 Dc(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function dl(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(Dc(e))}function ef({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 s.jsx("div",{role:"alert","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",style:{marginBottom:12,padding:"12px 14px",border:"1px solid var(--border)",borderRadius:8,background:"var(--panel)",color:e==="permission"?"var(--accent-warn)":"var(--accent-danger)"},children:r})}function XS(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 ZS(e){const t=Tc(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"} · ${Av(e.contentSize)} · ${YS(e.sha256)}`,at:oa(e)}}function eb({artifact:e}){const t=oa(e);return s.jsxs("div",{style:{display:"grid",gap:18},children:[s.jsx("header",{style:{display:"flex",justifyContent:"space-between",gap:16},children:s.jsxs("div",{children:[s.jsx("h1",{style:{margin:0,fontSize:22},children:e.artifactType}),s.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)"},children:[Tc(e)," · ",Av(e.contentSize)," · ",Rc(t)]})]})}),s.jsxs("dl",{style:{margin:0,padding:"14px 16px",border:"1px solid var(--border)",borderRadius:8,display:"grid",gridTemplateColumns:"140px minmax(0, 1fr)",gap:"10px 14px"},children:[s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"type"}),s.jsx("dd",{style:{margin:0},children:e.artifactType}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"state"}),s.jsx("dd",{style:{margin:0},children:Tc(e)}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"sha256"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sha256}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"envelope"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.envelopeCid??"—"}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"recorded"}),s.jsx("dd",{style:{margin:0},children:Rc(t)}),e.source==="served"?s.jsxs(s.Fragment,{children:[s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"request"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.requestId??"—"}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"accesses"}),s.jsxs("dd",{style:{margin:0},children:[e.access.accessCount," total · ",e.access.failedPaymentCount," failed"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"operator"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sourceOperator??"—"}),s.jsx("dt",{style:{color:"var(--fg-muted)"},children:"source"}),s.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sourceEndpoint??"—"})]})]})]})}function tb(){var h,m,w;const e=Jr(),[t,r]=O.useState(),n=ue({queryKey:["captures","pending"],queryFn:()=>ee.captures.listPending(),refetchInterval:2500}),i=ue({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>ee.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),l=ue({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>ee.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),g=((h=n.data)==null?void 0:h.captures)??[],o=[...((m=i.data)==null?void 0:m.artifacts)??[],...((w=l.data)==null?void 0:w.artifacts)??[]].sort((C,E)=>oa(E).localeCompare(oa(C))),a=[...g.map(XS),...o.map(ZS)].sort((C,E)=>E.at.localeCompare(C.at)),f=(t==null?void 0:t.kind)==="capture"?t.id:void 0,y=(t==null?void 0:t.kind)==="artifact"?o.find(C=>C.source===t.source&&C.sha256===t.sha256):void 0,p=n.isLoading||i.isLoading||l.isLoading,v=[n.isError?n.error:n.failureReason,i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason].filter(Boolean),_=v.find(dl),S=_??v[0];O.useEffect(()=>{if(a.length===0){t&&r(void 0);return}(!t||!a.some(C=>Zh(t,C.selection)))&&r(a[0].selection)},[a,t]);const x=ue({queryKey:["captures",f],queryFn:()=>ee.captures.get(f),enabled:!!f}),d=nr({mutationFn:C=>ee.captures.approve(C),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),u=nr({mutationFn:C=>ee.captures.skip(C),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),c=nr({mutationFn:C=>ee.captures.trustRepo(C,!0)});return s.jsxs("div",{style:{padding:24,display:"flex",flexDirection:"column",gap:24},children:[s.jsx(GS,{defaultExpanded:!0}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"360px 1fr",gap:24},children:[s.jsxs("aside",{children:[s.jsx("h1",{style:{margin:"0 0 12px",fontSize:24},children:"Execution data"}),S?s.jsx(ef,{kind:_?"permission":"error",message:_?void 0:Dc(S)}):null,p&&a.length===0?s.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:"Loading execution data."}):a.length===0?s.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:"No execution data yet."}):s.jsx("div",{style:{display:"grid",gap:8},children:a.map(C=>{const E=Zh(t,C.selection);return s.jsxs("button",{type:"button","data-testid":"execution-data-row",onClick:()=>r(C.selection),style:{textAlign:"left",padding:"14px 16px",border:`1px solid ${E?"var(--accent-sky)":"var(--border)"}`,borderRadius:8,background:E?"rgba(56, 189, 248, 0.08)":"var(--panel)",color:"var(--fg)",cursor:"pointer"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[s.jsx("strong",{children:C.title}),s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:12},children:C.state})]}),s.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)",fontSize:12},children:[C.meta," · ",Rc(C.at)]})]},C.id)})})]}),s.jsx("main",{children:x.error?s.jsx(ef,{kind:dl(x.error)?"permission":"error",message:dl(x.error)?void 0:Dc(x.error)}):(t==null?void 0:t.kind)==="capture"&&x.data?s.jsx(qS,{detail:x.data,approving:d.isPending,skipping:u.isPending,onApprove:()=>f&&d.mutate(f),onSkip:()=>f&&u.mutate(f),onTrustRepo:()=>{const C=x.data.capture.repoRemoteUrl;C&&c.mutate(C)}}):(t==null?void 0:t.kind)==="artifact"&&y?s.jsx(eb,{artifact:y}):s.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:p?"Loading execution data.":"Select execution data."})})]})]})}const rb=[{to:"/operator/memberships",label:"Memberships"},{to:"/operator/registry",label:"Registry"},{to:"/operator/network",label:"Network"},{to:"/operator/security",label:"Security"}];function nb({to:e,label:t}){const[r]=Sx(e);return s.jsx("li",{children:s.jsx(Ct,{href:e,"aria-current":r?"page":void 0,style:{display:"block",padding:"8px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",letterSpacing:"0.08em",textDecoration:"none",borderRadius:"var(--radius-1, 4px)",color:r?"var(--fg)":"var(--fg-muted)",background:r?"var(--bg-elevated)":"transparent",fontWeight:r?500:400,transition:"color 100ms, background 100ms"},children:t})})}function sb(){return s.jsx("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",style:{display:"flex",flexDirection:"column",minWidth:"160px",paddingTop:"4px"},children:s.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"2px"},children:rb.map(e=>s.jsx(nb,{to:e.to,label:e.label},e.to))})})}function fo({children:e}){return s.jsxs("div",{"data-testid":"operator-shell",style:{display:"flex",gap:"24px",padding:"24px",alignItems:"flex-start"},children:[s.jsx(sb,{}),s.jsx("div",{style:{flex:"1 1 0",minWidth:0},children:e})]})}function hl(e){const t=St(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Zn(t)}}function tf(e,t){const r=St(t.harness);if(e.harness!==r||e.model!==(t.model??Zn(r)))return!0;const n=[...e.plugins].sort(),i=[...t.plugins??[]].sort();if(n.length!==i.length)return!0;for(let o=0;o<n.length;o+=1)if(n[o]!==i[o])return!0;const l=[...e.disabledDefaultPlugins].sort(),g=[...t.disabledDefaultPlugins??[]].sort();if(l.length!==g.length)return!0;for(let o=0;o<l.length;o+=1)if(l[o]!==g[o])return!0;return!1}function ib({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:i}){const[l,g]=O.useState(r),[o,a]=O.useState(()=>hl(e)),f=O.useRef(null),y=O.useRef(null),p=Jr(),v=t!==void 0,_=ue({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>ee.solvernets.getManifest(e.manifestCid),enabled:!v&&!!e.manifestCid,staleTime:1/0,retry:!1}),S=ue({queryKey:["solvernets","catalog"],queryFn:()=>ee.getSolverNets(),enabled:!v}),d=(()=>{var q;if(v)return t;const F=(q=_.data)==null?void 0:q.manifest;if(!(!F||!S.data))return S.data.nets.find(G=>G.contract.id===F.contract.id&&G.contract.version===F.contract.version)})(),u=e.contract??(d==null?void 0:d.contract),c=!v&&(_.isLoading||S.isLoading),h=!v&&_.isError&&!_.isLoading;O.useEffect(()=>{tf(o,e)||a(hl(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),O.useEffect(()=>{r&&(g(!0),n==="harness"&&setTimeout(()=>{var F,q;(F=f.current)==null||F.scrollIntoView({block:"center",behavior:"smooth"}),(q=y.current)==null||q.focus()},50))},[r,n]);const m=((d==null?void 0:d.compatibleHarnesses)??[]).filter(F=>F.supportsRoles.includes("solving")).map(F=>({...F,name:St(F.name)})).filter((F,q,G)=>G.findIndex(X=>X.name===F.name)===q),w=new Set(m.map(F=>F.name)),C=o.harness!==""&&m.length>0&&![...w].some(F=>hS(F,o.harness)),E=d?`${d.contract.id}@${d.contract.version}`:"",b=wa(o.harness),k=nr({mutationFn:()=>ee.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...u!==void 0?{contract:{id:u.id,version:u.version}}:{},roles:e.roles,...o.harness?{harness:o.harness}:{},plugins:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,...o.model?{model:o.model}:{}}),onSuccess:F=>{p.invalidateQueries({queryKey:["operator","joined"]}),F.restartRequired&&(i==null||i())}}),[R,L]=O.useState(!1),P=e.roles.includes("solver"),B=Bv(P?o.harness:void 0,P?o.model:void 0),H=P&&B.requiresConfirmation,z=H&&!R,[J,U]=O.useState(!1),j=nr({mutationFn:()=>ee.operator.leave(e.manifestCid),onSuccess:F=>{p.invalidateQueries({queryKey:["operator","joined"]}),F.restartRequired&&(i==null||i()),U(!1)}}),D=tf(o,e),M=e.name??e.manifestCid,A=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return s.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":l?"true":"false",style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"flex-start",gap:"12px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0},children:[s.jsx("span",{"data-testid":"joined-net-card-name",style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"20px",color:"var(--fg)",letterSpacing:"-0.01em",lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis"},children:M}),s.jsxs("div",{style:{display:"flex",gap:"8px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[e.roles.map(F=>s.jsx(ob,{label:F},F)),s.jsxs("span",{style:{color:"var(--fg-dim)"},children:["cid ",A]})]})]}),h?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"},children:J?s.jsxs("div",{style:{display:"flex",gap:"6px"},children:[s.jsx("button",{type:"button","data-testid":"joined-net-card-leave-cancel",disabled:j.isPending,onClick:()=>U(!1),style:pl(!j.isPending),children:"Cancel"}),s.jsx("button",{type:"button","data-testid":"joined-net-card-leave-confirm",disabled:j.isPending,onClick:()=>j.mutate(),style:po(!j.isPending,!0),children:j.isPending?"Leaving…":"Confirm leave"})]}):s.jsx("button",{type:"button","data-testid":"joined-net-card-leave",onClick:()=>U(!0),style:po(!0),children:"✕ Leave"})}):s.jsx("button",{type:"button","data-testid":"joined-net-card-toggle",onClick:()=>g(F=>!F),style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"6px 10px",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)"},children:l?"▾ Close":"▸ Edit"})]}),h&&s.jsxs("div",{"data-testid":"joined-net-card-orphaned",style:{border:"1px solid var(--wane)",borderRadius:"var(--radius-1)",padding:"10px 14px",background:"transparent",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:[s.jsx("span",{style:{color:"var(--wane)",textTransform:"uppercase",letterSpacing:"0.14em",fontSize:"10px",marginRight:"8px"},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.",j.isError&&s.jsx("div",{role:"alert",style:{marginTop:"6px",color:"var(--break-red)",fontSize:"11px"},children:j.error instanceof Error?j.error.message:"Leave failed."})]}),!l&&!h&&s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"90px 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[s.jsx("span",{children:"harness"}),s.jsxs("span",{style:{color:"var(--fg)"},children:[e.harness?yr(e.harness):s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}),C&&s.jsxs("span",{"data-testid":"joined-net-card-warn-collapsed",style:{marginLeft:"10px",color:"var(--break-red)"},children:["⚠ does not support ",E]})]}),s.jsx("span",{children:"plugins"}),s.jsx("span",{style:{color:"var(--fg)"},children:(e.plugins??[]).length===0?s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}):`${e.plugins.length} active`}),s.jsx("span",{children:"model"}),s.jsx("span",{style:{color:"var(--fg)"},children:e.model?Po(e.model,St(e.harness)).label:s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})})]}),h&&s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"90px 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[s.jsx("span",{children:"harness"}),s.jsx("span",{style:{color:"var(--fg)"},children:e.harness?yr(e.harness):s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})}),s.jsx("span",{children:"plugins"}),s.jsx("span",{style:{color:"var(--fg)"},children:(e.plugins??[]).length===0?s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}):`${e.plugins.length} active`}),s.jsx("span",{children:"model"}),s.jsx("span",{style:{color:"var(--fg)"},children:e.model?Po(e.model,St(e.harness)).label:s.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})})]}),l&&!h&&s.jsxs("div",{"data-testid":"joined-net-card-form",style:{display:"flex",flexDirection:"column",gap:"14px",borderTop:"1px solid var(--border)",paddingTop:"12px"},children:[s.jsxs("div",{ref:f,style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:fl,children:"Harness"}),s.jsxs("select",{ref:y,"aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:o.harness,onChange:F=>{const q=F.target.value;a(G=>({...G,harness:q,model:Zn(q)})),L(!1)},style:{...rf,borderColor:C?"var(--break-red)":"var(--border)"},children:[o.harness===""&&s.jsx("option",{value:"",children:"—"}),m.map(F=>s.jsx("option",{value:F.name,children:jv(F.name,F.version)},F.name)),o.harness&&m.length>0&&!w.has(o.harness)&&s.jsxs("option",{value:o.harness,children:[yr(o.harness)," (incompatible)"]}),o.harness&&m.length===0&&s.jsx("option",{value:o.harness,children:yr(o.harness)})]}),C&&s.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--break-red)",lineHeight:1.5},children:["⚠ This harness does not support ",s.jsx("span",{style:{color:"var(--fg)"},children:E}),".",m.length>0&&s.jsxs(s.Fragment,{children:[" Compatible: ",m.map((F,q)=>s.jsxs("span",{style:{color:"var(--accent-sky)"},children:[yr(F.name),q<m.length-1?" · ":""]},F.name))]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:fl,children:"Plugins"}),c?s.jsx("span",{"data-testid":"joined-net-card-catalog-loading",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:"Loading registry catalog…"}):d?(d.compatiblePlugins??[]).length===0?s.jsx(Ec,{available:[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(F,q)=>a(G=>({...G,plugins:F,disabledDefaultPlugins:q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:o.harness}):s.jsx(Ec,{available:(d==null?void 0:d.compatiblePlugins)??[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(F,q)=>a(G=>({...G,plugins:F,disabledDefaultPlugins:q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:o.harness}):s.jsx("span",{"data-testid":"joined-net-card-catalog-missing",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",fontStyle:"italic"},children:"Registry catalog has no template for this SolverNet's contract — plugins can't be verified."})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:fl,children:"Model"}),s.jsxs("select",{"aria-label":"Model","data-testid":"joined-net-card-model-select",value:o.model,onChange:F=>{a({...o,model:F.target.value}),L(!1)},style:rf,children:[b.map(F=>s.jsx("option",{value:F.id,children:F.label},F.id)),(()=>{const F=Po(o.model,o.harness);return F.isCustom?s.jsx("option",{value:o.model,children:F.label},o.model):null})()]})]}),P&&s.jsx(Iv,{harness:o.harness,modelId:o.model,variant:"inline",testIdPrefix:"joined-net-card-cost"}),H&&s.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":R?"true":"false",style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"10px 12px",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",cursor:"pointer"},children:[s.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:R,onChange:F=>L(F.target.checked),style:{accentColor:"var(--break-red)",marginTop:"2px",width:"14px",height:"14px"},"aria-label":"I understand the per-task cost and have a budget for this"}),s.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),k.isError&&s.jsx("span",{role:"alert","data-testid":"joined-net-card-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:k.error instanceof Error?k.error.message:"Save failed."}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid var(--border)",paddingTop:"10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)"},children:[s.jsx("span",{children:D?"Restart required to apply.":"No unsaved changes."}),s.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s.jsx("button",{type:"button","data-testid":"joined-net-card-cancel",disabled:!D||k.isPending,onClick:()=>a(hl(e)),style:pl(D&&!k.isPending),children:"Cancel"}),s.jsx("button",{type:"button","data-testid":"joined-net-card-save",disabled:!D||k.isPending||z,onClick:()=>k.mutate(),style:ab(D&&!k.isPending&&!z),children:k.isPending?"Saving…":"Save"})]})]}),s.jsxs("div",{"data-testid":"joined-net-card-leave-zone",style:{marginTop:"4px",paddingTop:"12px",borderTop:"1px dashed var(--border)",display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px",flexWrap:"wrap"},children:[s.jsx("span",{"data-testid":"joined-net-card-leave-explainer",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",lineHeight:1.5,maxWidth:"440px"},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."}),J?s.jsxs("div",{style:{display:"flex",gap:"6px"},children:[s.jsx("button",{type:"button","data-testid":"joined-net-card-leave-cancel",disabled:j.isPending,onClick:()=>U(!1),style:pl(!j.isPending),children:"Cancel"}),s.jsx("button",{type:"button","data-testid":"joined-net-card-leave-confirm",disabled:j.isPending,onClick:()=>j.mutate(),style:po(!j.isPending,!0),children:j.isPending?"Leaving…":"Confirm leave"})]}):s.jsx("button",{type:"button","data-testid":"joined-net-card-leave",onClick:()=>U(!0),style:po(!0),children:"✕ Leave SolverNet"})]})]})]})}function ob({label:e}){return s.jsx("span",{"data-testid":"joined-net-card-role",style:{fontSize:"10px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"},children:e})}const fl={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},rf={background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"8px 10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"};function pl(e){return{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",letterSpacing:"0.12em",textTransform:"uppercase",padding:"7px 12px",background:"transparent",color:e?"var(--fg)":"var(--fg-dim)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function ab(e){return{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",letterSpacing:"0.12em",textTransform:"uppercase",padding:"7px 14px",background:e?"var(--accent-sky)":"transparent",color:e?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${e?"var(--accent-sky)":"var(--border)"}`,borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function po(e,t=!1){const r=e?"var(--break-red)":"var(--fg-dim)";return{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",padding:"7px 12px",background:t&&e?"var(--break-red)":"transparent",color:t&&e?"var(--bg-sunken)":r,border:`1px solid ${r}`,borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function lb({onRestartPending:e}={}){const t=ue({queryKey:["operator","joined"],queryFn:()=>ee.operator.listJoined(),refetchInterval:3e4}),r=O.useMemo(()=>{var i;const n=((i=t.data)==null?void 0:i.joinedSolverNets)??{};return Object.values(n)},[t.data]);return s.jsxs("div",{"data-testid":"memberships-tab",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Joined · ",r.length]}),t.isError&&s.jsx("span",{role:"alert",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--break-red)"},children:"Failed to load joined SolverNets."})]}),t.isLoading&&s.jsx("p",{"data-testid":"memberships-tab-loading",style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:"Loading…"}),!t.isLoading&&r.length===0&&s.jsxs("p",{"data-testid":"memberships-tab-empty",style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:["You haven't joined any SolverNets yet. Browse the"," ",s.jsx("a",{href:"/operator/registry",style:{color:"var(--accent-sky)",textDecoration:"none"},children:"Registry"})," ","to participate."]}),r.map(n=>s.jsx(ib,{joined:n,onRestartPending:e},n.manifestCid))]})}const nf={launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"}};function cb(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function ub(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 db(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 hb={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 fb(e){switch(db(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 hb;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function pb({code:e,message:t}){return e==="rpc_rate_limited"?s.jsxs("span",{"data-testid":"registry-catalog-warn","data-error-code":"rpc_rate_limited",style:{color:"var(--wane)",display:"inline-flex",gap:"8px"},children:[s.jsx("span",{children:"RPC rate-limited — add your own key"}),s.jsx(Ct,{href:"/operator#network","data-testid":"registry-catalog-warn-action",style:{color:"var(--accent-sky)",textDecoration:"none"},children:"Network settings →"})]}):s.jsxs("span",{"data-testid":"registry-catalog-warn",style:{color:"var(--wane)"},children:["stale (",t,")"]})}function gb({status:e}){const t=nf[e]??nf.launched;return s.jsx("span",{"data-testid":"registry-status-badge","data-status":e,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:t.fg,border:`1px solid ${t.border}`,borderRadius:"var(--radius-1)",padding:"2px 8px",whiteSpace:"nowrap"},children:t.label})}function vb({openRoles:e}){return e.length===0?s.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:"no open roles"}):s.jsx("span",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:e.map(t=>s.jsx("span",{"data-testid":"registry-open-role","data-role":t,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"999px",padding:"2px 10px"},children:t},t))})}function mb({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0;return s.jsxs("article",{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},children:[s.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"15px",fontWeight:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:["Launcher: ",cb(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),s.jsx(gb,{status:e.status})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[s.jsx("span",{children:"Open roles"}),s.jsx(vb,{openRoles:e.openRoles}),s.jsx("span",{children:"Solution price"}),s.jsx("span",{style:{color:"var(--fg)"},children:Dr(e.solutionPriceWei)}),s.jsx("span",{children:"Verdict price"}),s.jsx("span",{style:{color:"var(--fg)"},children:Dr(e.verdictPriceWei)})]}),s.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[n&&s.jsxs("span",{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--vow-green)",border:"1px solid var(--vow-green)",borderRadius:"var(--radius-pill)",padding:"4px 10px"},children:["JOINED · ",(t??[]).join(", ")]}),s.jsx(Ct,{href:r,"data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,style:{display:"inline-block",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:e.status==="launched"&&!n?"var(--accent-sky)":"transparent",color:e.status==="launched"&&!n?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${e.status==="launched"&&!n?"var(--accent-sky)":"var(--border)"}`,borderRadius:"var(--radius-2)",textDecoration:"none",cursor:e.status==="launched"?"pointer":"not-allowed",pointerEvents:e.status==="launched"?"auto":"none"},children:n?"Edit":"Join"})]})]})}function yb({refetchIntervalMs:e=3e4}={}){var v;const{data:t,isLoading:r,isError:n,error:i,refetch:l}=ue({queryKey:["solvernets","registry"],queryFn:()=>ee.solvernets.listRegistry(),refetchInterval:e}),g=ue({queryKey:["operator","joined"],queryFn:()=>ee.operator.listJoined(),refetchInterval:e}),o=((v=g.data)==null?void 0:v.joinedSolverNets)??{};if(r||g.isLoading)return s.jsx("p",{"data-testid":"registry-catalog-loading",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:"Loading catalog…"});if(n||g.isError){const _=n?i:g.error,S=fb(_);return s.jsxs("div",{"data-testid":"registry-catalog-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[s.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:S.title}),s.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:S.detail}),S.actionHref&&S.actionLabel&&s.jsx(Ct,{href:S.actionHref,"data-testid":"registry-catalog-error-action",style:{color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",textDecoration:"none",marginTop:"2px"},children:S.actionLabel})]}),s.jsx("button",{type:"button",onClick:()=>{l()},"data-testid":"registry-catalog-retry",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"})]})}const a=(t==null?void 0:t.summaries)??[],f=a.filter(_=>o[_.manifestCid]===void 0),y=ub((t==null?void 0:t.lastRefreshedAt)??null),p=(t==null?void 0:t.lastError)??null;return s.jsxs("div",{"data-testid":"registry-catalog",style:{display:"flex",flexDirection:"column",gap:"12px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",letterSpacing:"0.14em",textTransform:"uppercase"},children:[s.jsxs("span",{"data-testid":"registry-catalog-meta",children:[f.length," discoverable · last refreshed"," ",y??"never"]}),p&&s.jsx(pb,{code:p.code,message:p.message})]}),f.length===0?s.jsx("div",{"data-testid":"registry-catalog-empty",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"24px 20px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:a.length===0?"No launched SolverNets available.":"No unjoined SolverNets available."}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:f.map(_=>{var S;return s.jsx(mb,{summary:_,joinedRoles:(S=o[_.manifestCid])==null?void 0:S.roles},_.manifestCid)})})]})}function _b(){return s.jsxs("div",{"data-testid":"registry-tab",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Discover"}),s.jsx(yb,{})]})}function xb(){return s.jsx("span",{style:{color:"var(--wane)",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",borderRadius:"999px",padding:"1px 6px"},children:"restart"})}function sf({label:e,restartRequired:t,helperText:r,children:n}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"flex",gap:"6px",alignItems:"center"},children:[e,t&&s.jsx(xb,{})]}),n,r&&s.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:r})]})}function Sb({onRestartPending:e=()=>{}}={}){const{data:t}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:1500}),r=(t==null?void 0:t.chain)??"base-sepolia",n=(t==null?void 0:t.rpcUrl)??"",i=(t==null?void 0:t.defaultRpcUrl)??(r==="base"?"https://mainnet.base.org":"https://base-sepolia.gateway.tenderly.co/75tyLMQuD8EHpXxMwINIKu");return s.jsx("div",{"data-testid":"network-tab",children:s.jsx(bb,{chain:r,rpcUrl:n,defaultRpcUrl:i,rpcHealthy:!0,onRestartPending:e})})}function bb({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:i}){const[l,g]=O.useState(t),[o,a]=O.useState(!1),[f,y]=O.useState(null),p=l!==t,v=t===r,_=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",S=async()=>{a(!0),y(null);try{const x=l.length===0?null:l;(await ee.updateNetwork({rpcUrl:x})).restartRequired&&i()}catch(x){y(x instanceof Error?x.message:String(x))}finally{a(!1)}};return s.jsx(Wu,{title:"Network",summary:`${_.split(" (")[0]} · ${t}`,metaChip:{label:n?"Healthy":"Unreachable",tone:n?"live":"danger"},defaultExpanded:!0,dirty:p?{pendingSummary:"RPC URL changed · save to apply",saving:o,error:f??void 0,onSave:()=>{S()},onCancel:()=>{g(t),y(null)}}:void 0,children:s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[s.jsxs(sf,{label:"Chain",helperText:"Switching chains resets fleet state — that's a separate flow.",children:[s.jsx("div",{style:{background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)"},children:_}),s.jsx("span",{style:{alignSelf:"flex-start",fontFamily:"'JetBrains Mono', monospace",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",border:"1px solid var(--border)",borderRadius:"999px",padding:"1px 6px",marginTop:"6px"},children:"locked"})]}),s.jsxs(sf,{label:"RPC URL",restartRequired:!0,helperText:`Default: ${r}`,children:[s.jsx("input",{type:"text",value:l,onChange:x=>g(x.target.value),placeholder:r,style:{background:"var(--bg)",border:`1px solid ${p?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}}),s.jsx("button",{type:"button",onClick:()=>g(""),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer",marginTop:"4px",padding:0},children:"Use default"}),v&&s.jsxs("div",{style:{marginTop:"12px",padding:"10px 12px",border:"1px solid var(--wane)",borderRadius:"6px",background:"transparent",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1.55,color:"var(--fg)",display:"flex",flexDirection:"column",gap:"4px"},"data-testid":"network-shared-rpc-warning",children:[s.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--wane)"},children:"Shared RPC"}),s.jsxs("span",{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"," ",s.jsx("a",{href:"https://dashboard.tenderly.co/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-sky)"},children:"Tenderly"}),","," ",s.jsx("a",{href:"https://www.alchemy.com/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-sky)"},children:"Alchemy"}),", or"," ",s.jsx("a",{href:"https://www.quicknode.com/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-sky)"},children:"QuickNode"})," ","and paste it above."]})]})]})]})})}function wb(){const[e,t]=O.useState(""),[r,n]=O.useState(""),[i,l]=O.useState("idle"),[g,o]=O.useState(null),a=async()=>{l("rotating"),o(null);try{await ee.changeKeystorePassword(e,r),l("rotated"),t(""),n("")}catch(f){o(f instanceof Error?f.message:String(f)),l("failed")}};return s.jsx("div",{"data-testid":"security-tab",children:s.jsxs(Wu,{title:"Security",summary:"Rotate keystore password · last rotated never",metaChip:{label:"Danger zone",tone:"danger"},variant:"danger",defaultExpanded:!0,children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Current password"}),s.jsx("input",{type:"password",value:e,onChange:f=>t(f.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]}),s.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[s.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"New password"}),s.jsx("input",{type:"password",value:r,onChange:f=>n(f.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]})]}),s.jsx("button",{type:"button",onClick:()=>{a()},disabled:i==="rotating"||e.length===0||r.length<8,style:{alignSelf:"flex-start",background:"var(--break-red)",border:"1px solid var(--break-red)",color:"var(--fg)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:i==="rotating"?"wait":"pointer"},children:i==="rotating"?"Rotating…":"Rotate password"}),i==="rotated"&&s.jsx("span",{style:{color:"var(--vow-green)",fontSize:"12px"},children:"Password rotated. Re-run jinn run with the new password."}),i==="failed"&&s.jsxs("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:["Rotation failed: ",g]})]})})}function Cb(e){const t=[],r=e.split(`
|
|
107
|
+
`);let n=0;for(;n<r.length;){const i=r[n]??"";if(/^```/.test(i)){const o=i.slice(3).trim(),a=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)a.push(r[n]??""),n++;n++,t.push({kind:"code",lang:o,text:a.join(`
|
|
108
|
+
`)});continue}const l=/^(#{1,3})\s+(.*)$/.exec(i);if(l){t.push({kind:"heading",level:l[1].length,text:l[2]}),n++;continue}if(/^-\s+/.test(i)){const o=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)o.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:o});continue}if(i.trim()===""){n++;continue}const g=[i];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)g.push(r[n]??""),n++;t.push({kind:"paragraph",text:g.join(" ")})}return t}function of(e){const t=[],r=/`([^`]+)`/g;let n=0,i,l=0;for(;(i=r.exec(e))!==null;)i.index>n&&t.push(e.slice(n,i.index)),t.push(O.createElement("code",{key:`c-${l++}`},i[1])),n=i.index+i[0].length;return n<e.length&&t.push(e.slice(n)),t}function kb(e){const t=Cb(e);return O.createElement(O.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?O.createElement("h1",{key:n},r.text):r.level===2?O.createElement("h2",{key:n},r.text):O.createElement("h3",{key:n},r.text):r.kind==="code"?O.createElement("pre",{key:n},O.createElement("code",null,r.text??"")):r.kind==="list"?O.createElement("ul",{key:n},...(r.items??[]).map((i,l)=>O.createElement("li",{key:l},...of(i)))):O.createElement("p",{key:n},...of(r.text??""))))}const Eb=`# Build a plug-in
|
|
109
|
+
|
|
110
|
+
Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
|
|
111
|
+
|
|
112
|
+
## 1. Scaffold
|
|
113
|
+
|
|
114
|
+
\`\`\`bash
|
|
115
|
+
jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
|
|
116
|
+
cd @you/my-swe-skill
|
|
117
|
+
yarn install
|
|
118
|
+
yarn test
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
|
|
122
|
+
|
|
123
|
+
\`\`\`
|
|
124
|
+
@you/my-swe-skill/
|
|
125
|
+
├── jinn.plugin.json # the canonical manifest
|
|
126
|
+
├── skills/example/SKILL.md
|
|
127
|
+
├── test/plugin.test.ts # passes immediately
|
|
128
|
+
├── package.json
|
|
129
|
+
├── tsconfig.json
|
|
130
|
+
└── README.md
|
|
131
|
+
\`\`\`
|
|
132
|
+
|
|
133
|
+
## 2. Edit your skill
|
|
134
|
+
|
|
135
|
+
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\`.
|
|
136
|
+
|
|
137
|
+
## 3. Publish to npm + chain
|
|
138
|
+
|
|
139
|
+
\`\`\`bash
|
|
140
|
+
npm publish --access public
|
|
141
|
+
jinn solver-plugins publish npm:@you/my-swe-skill
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
\`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.
|
|
145
|
+
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
## 4. Confirm it published
|
|
149
|
+
|
|
150
|
+
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.
|
|
151
|
+
|
|
152
|
+
## 5. Run it
|
|
153
|
+
|
|
154
|
+
An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
|
|
155
|
+
|
|
156
|
+
\`\`\`bash
|
|
157
|
+
jinn solver-plugins show npm:@you/my-swe-skill
|
|
158
|
+
jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
|
|
159
|
+
\`\`\`
|
|
160
|
+
|
|
161
|
+
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.
|
|
162
|
+
|
|
163
|
+
## Next
|
|
164
|
+
|
|
165
|
+
- \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
|
|
166
|
+
- \`examples.md\` — annotated reference plug-ins.
|
|
167
|
+
- \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
|
|
168
|
+
- \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
|
|
169
|
+
- \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
|
|
170
|
+
`,jb={border:"1px solid var(--border)",borderRadius:"var(--radius-3, 10px)",padding:"24px",background:"var(--surface)"};function Dt({title:e,children:t,className:r,style:n}){return s.jsxs("section",{style:{...jb,...n},className:r,children:[e&&s.jsx("h3",{style:{marginTop:0},children:e}),t]})}const Rb="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md";function Tb(){return s.jsxs(Dt,{children:[s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"20px"},children:s.jsx("span",{className:"j-label",children:"Quickstart · 60 seconds"})}),s.jsx("div",{className:"hfmf-intro-markdown",children:kb(Eb)}),s.jsxs("div",{style:{marginTop:"24px",paddingTop:"20px",borderTop:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[s.jsx("span",{className:"j-label",children:"Next"}),s.jsx("a",{href:Rb,target:"_blank",rel:"noreferrer",className:"j-mono",style:{fontSize:"12px",color:"var(--accent-sky)",textDecoration:"none",borderBottom:"1px solid var(--border)",paddingBottom:"1px"},children:"Read the full quickstart on GitHub →"})]})]})}const Db=[{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."}],Pb=[{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"] } }'}],go={textAlign:"left",padding:"10px 12px",borderBottom:"1px solid var(--border)",fontFamily:"var(--mono)",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--fg-dim)"},Pc={padding:"12px",borderBottom:"1px solid var(--border)",fontFamily:"var(--mono)",fontSize:"13px",lineHeight:1.6,color:"var(--fg)",verticalAlign:"top"},af={...Pc,color:"var(--fg-muted)"},Mb=e=>({display:"inline-block",fontFamily:"var(--mono)",fontSize:"10px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",padding:"2px 8px",borderRadius:"var(--radius-1)",border:`1px solid ${e?"var(--accent-sky)":"var(--border)"}`,color:e?"var(--accent-sky)":"var(--fg-dim)"});function Lb(){return s.jsxs(Dt,{children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"20px"},children:[s.jsx("span",{className:"j-label",children:"Reference"}),s.jsx("h2",{className:"j-display",style:{fontSize:"28px",lineHeight:1.2,color:"var(--fg)",margin:0},children:"Plug-in shape"})]}),s.jsx("div",{style:{overflowX:"auto",marginBottom:"32px"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",borderTop:"1px solid var(--border)"},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:go,children:"Field"}),s.jsx("th",{style:go,children:"Type"}),s.jsx("th",{style:go,children:"Required"}),s.jsx("th",{style:go,children:"Description"})]})}),s.jsx("tbody",{children:Db.map(e=>s.jsxs("tr",{"data-field-required":e.required?"true":"false",children:[s.jsx("td",{style:{...Pc,color:"var(--accent-sky)"},children:e.name}),s.jsx("td",{style:af,children:e.type}),s.jsx("td",{style:Pc,children:s.jsx("span",{style:Mb(e.required),children:e.required?"yes":"no"})}),s.jsx("td",{style:af,children:e.description})]},e.name))})]})}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"16px"},children:[s.jsx("span",{className:"j-label",children:"Modes"}),s.jsx("h3",{className:"j-display",style:{fontSize:"22px",lineHeight:1.25,color:"var(--fg)",margin:0},children:"Two modes"}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.7,margin:"4px 0 0",maxWidth:"72ch"},children:"The validator enforces exactly two exclusive modes. Mixing is rejected."})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:Pb.map(e=>s.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px",background:"var(--bg-sunken)",display:"flex",flexDirection:"column",gap:"10px"},children:[s.jsx("span",{className:"j-label",children:e.id==="runtime"?"Mode · 01":"Mode · 02"}),s.jsx("h4",{className:"j-mono",style:{fontSize:"15px",fontWeight:500,color:"var(--fg)",margin:0,letterSpacing:"-0.01em"},children:e.label}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"12px",lineHeight:1.6,margin:0},children:e.requires}),s.jsx("pre",{style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"10px 12px",fontFamily:"var(--mono)",fontSize:"12px",lineHeight:1.5,color:"var(--accent-sky)",margin:0,overflowX:"auto"},children:s.jsx("code",{children:e.example})})]},e.id))})]})}const Mn={padding:"12px",borderBottom:"1px solid var(--border)",fontFamily:"var(--mono)",fontSize:"12px",lineHeight:1.6,color:"var(--fg)",verticalAlign:"top"},Us={...Mn,color:"var(--fg-dim)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",fontSize:"11px",textAlign:"left"},lf=e=>({display:"inline-block",fontFamily:"var(--mono)",fontSize:"10px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",padding:"2px 10px",borderRadius:"var(--radius-pill)",border:`1px solid ${e}`,color:e});function Bb(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function vo({solverType:e}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"20px"},children:[s.jsx("span",{className:"j-label",children:"Registry"}),s.jsxs("h3",{className:"j-display",style:{fontSize:"22px",lineHeight:1.25,color:"var(--fg)",margin:0},children:["Published plug-ins for ",e]})]})}function Ib({solverType:e}){const{data:t,isLoading:r,error:n}=ue({queryKey:["discovery","plugin-publications",e],queryFn:()=>ee.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return s.jsxs(Dt,{children:[s.jsx(vo,{solverType:e}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",margin:0},children:"Loading published plug-ins…"})]});if(n)return s.jsxs(Dt,{children:[s.jsx(vo,{solverType:e}),s.jsxs("p",{className:"j-mono",style:{color:"var(--break-red)",fontSize:"13px",margin:0,lineHeight:1.7},children:["Discovery unavailable. ",n.message]})]});const i=(t==null?void 0:t.publications)??[];return i.length===0?s.jsxs(Dt,{children:[s.jsx(vo,{solverType:e}),s.jsxs("div",{style:{border:"1px dashed var(--border)",borderRadius:"var(--radius-2)",padding:"24px",background:"var(--bg-sunken)",display:"flex",flexDirection:"column",gap:"8px"},children:[s.jsx("span",{className:"j-label",children:"Empty registry"}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg)",fontSize:"13px",lineHeight:1.7,margin:0,maxWidth:"64ch"},children:"No plug-ins published yet. Be the first."}),s.jsxs("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.7,margin:0,maxWidth:"64ch"},children:["Run"," ",s.jsx("code",{style:{fontFamily:"var(--mono)",fontSize:"12px",color:"var(--accent-sky)",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"},children:"jinn solver-plugins publish"})," ","and your plug-in appears here under your builder agentId."]})]})]}):s.jsxs(Dt,{children:[s.jsx(vo,{solverType:e}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",borderTop:"1px solid var(--border)"},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:Us,children:"Plug-in"}),s.jsx("th",{style:Us,children:"Version"}),s.jsx("th",{style:Us,children:"Builder agentId"}),s.jsx("th",{style:Us,children:"CID"}),s.jsx("th",{style:Us,children:"Status"})]})}),s.jsx("tbody",{children:i.map(l=>s.jsxs("tr",{children:[s.jsx("td",{style:Mn,children:l.name}),s.jsx("td",{style:{...Mn,color:"var(--fg-muted)"},children:l.version}),s.jsx("td",{style:{...Mn,color:"var(--fg-muted)"},children:l.builderAgentId}),s.jsx("td",{style:{...Mn,color:"var(--fg-muted)"},children:Bb(l.cid)}),s.jsx("td",{style:Mn,children:l.revoked?s.jsxs("span",{style:lf("var(--wane)"),children:["Revoked",l.revokedReason?` · ${l.revokedReason}`:""]}):s.jsx("span",{style:lf("var(--vow-green)"),children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}const Xs={padding:"12px",borderBottom:"1px solid var(--border)",fontFamily:"var(--mono)",fontSize:"12px",lineHeight:1.6,color:"var(--fg)"},mo={...Xs,color:"var(--fg-dim)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",fontSize:"11px",textAlign:"left"},cf=e=>({display:"inline-block",fontFamily:"var(--mono)",fontSize:"10px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",padding:"2px 10px",borderRadius:"var(--radius-pill)",border:`1px solid ${e}`,color:e});function Js(){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"20px"},children:[s.jsx("span",{className:"j-label",children:"Builder"}),s.jsx("h3",{className:"j-display",style:{fontSize:"22px",lineHeight:1.25,color:"var(--fg)",margin:0},children:"Your published plug-ins"})]})}const gl={fontFamily:"var(--mono)",fontSize:"12px",color:"var(--accent-sky)",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"};function Ab({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:i}=ue({queryKey:["discovery","builder-artifacts",e],queryFn:()=>ee.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return s.jsxs(Dt,{style:{background:"var(--bg-sunken)"},children:[s.jsx(Js,{}),s.jsxs("div",{style:{border:"1px dashed var(--border)",borderRadius:"var(--radius-2)",padding:"24px",display:"flex",flexDirection:"column",gap:"8px"},children:[s.jsx("span",{className:"j-label",children:"Identity pending"}),s.jsxs("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.7,margin:0,maxWidth:"64ch"},children:["Complete identity bootstrap to see your published plug-ins. Run"," ",s.jsx("code",{style:gl,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})]});if(n)return s.jsxs(Dt,{children:[s.jsx(Js,{}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",margin:0},children:"Loading your plug-ins…"})]});if(i)return s.jsxs(Dt,{children:[s.jsx(Js,{}),s.jsx("p",{className:"j-mono",style:{color:"var(--break-red)",fontSize:"13px",margin:0},children:"Discovery unavailable."})]});const l=((r==null?void 0:r.artifacts)??[]).filter(g=>g.artifactType==="plugin");return l.length===0?s.jsxs(Dt,{children:[s.jsx(Js,{}),s.jsxs("div",{style:{border:"1px dashed var(--border)",borderRadius:"var(--radius-2)",padding:"24px",background:"var(--bg-sunken)",display:"flex",flexDirection:"column",gap:"8px"},children:[s.jsx("span",{className:"j-label",children:"Nothing yet"}),s.jsxs("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.7,margin:0,maxWidth:"64ch"},children:["You have not published any plug-ins yet. Scaffold one with"," ",s.jsx("code",{style:gl,children:"jinn create plugin"}),", then publish with ",s.jsx("code",{style:gl,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})]}):s.jsxs(Dt,{children:[s.jsx(Js,{}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",borderTop:"1px solid var(--border)"},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:mo,children:"Plug-in"}),s.jsx("th",{style:mo,children:"Version"}),s.jsx("th",{style:mo,children:"Supports"}),s.jsx("th",{style:mo,children:"Status"})]})}),s.jsx("tbody",{children:l.map(g=>s.jsxs("tr",{children:[s.jsx("td",{style:Xs,children:g.name}),s.jsx("td",{style:{...Xs,color:"var(--fg-muted)"},children:g.version}),s.jsx("td",{style:{...Xs,color:"var(--fg-muted)"},children:g.supports.join(", ")}),s.jsx("td",{style:Xs,children:g.revoked?s.jsx("span",{style:cf("var(--wane)"),children:"Revoked"}):s.jsx("span",{style:cf("var(--vow-green)"),children:"Active"})})]},`${g.builderAgentId}:${g.cid}`))})]})})]})}const uf=(e,t)=>({padding:"6px 14px",borderRadius:"var(--radius-pill)",border:`1px solid ${e?"var(--accent-sky)":"var(--border)"}`,background:"transparent",fontFamily:"var(--mono)",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:t?"var(--fg-dim)":e?"var(--accent-sky)":"var(--fg-muted)",cursor:t?"not-allowed":"pointer",opacity:t?.6:1,display:"inline-flex",alignItems:"center",gap:"8px"}),Ob={fontSize:"9px",letterSpacing:"0.14em",color:"var(--fg-dim)",paddingLeft:"6px",borderLeft:"1px solid var(--border)",marginLeft:"2px"};function Fb({value:e,onChange:t}){return s.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[s.jsx("button",{type:"button","aria-pressed":e==="plugin"?"true":"false",style:uf(e==="plugin",!1),onClick:()=>{e!=="plugin"&&t("plugin")},children:"Plug-ins"}),s.jsxs("button",{type:"button",disabled:!0,"aria-pressed":"false",style:uf(!1,!0),children:["Harnesses",s.jsx("span",{style:Ob,children:"Coming soon"})]})]})}const Nb="swe-rebench-v2.v1";function Hb(){const{data:e}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:5e3}),[t,r]=O.useState("plugin");return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px",padding:"32px 24px 48px",maxWidth:1100,margin:"0 auto"},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"8px",paddingBottom:"8px"},children:[s.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Build · Plug-ins"}),s.jsx("p",{className:"j-mono",style:{color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.7,margin:0,maxWidth:"64ch"},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."})]}),s.jsx(Tb,{}),s.jsx(Lb,{}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:[s.jsx("span",{className:"j-label",children:"Registry"}),s.jsx(Fb,{value:t,onChange:r})]}),t==="plugin"?s.jsxs(s.Fragment,{children:[s.jsx(Ib,{solverType:Nb}),s.jsx(Ab,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}function zb(){const{data:e,isLoading:t}=ue({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:1500}),[r,n]=O.useState(!1),i={restartPending:r,setRestartPending:n};if(t||!e||e.mode==="uninitialized"){const f=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return s.jsx(Ex,{headline:f})}if(e.mode!=="running")return s.jsx(Hx,{});const l=e.chain==="base"?"mainnet":"testnet",g=e.master_address??"",{pluginBuilderUi:o,embeddedAgent:a}=Ou();return s.jsx(uv.Provider,{value:i,children:s.jsx(rv,{children:s.jsx(a0,{header:s.jsx(c0,{network:l,rpcHealthy:!0,masterAddress:g}),tabs:s.jsx(u0,{}),rail:a?s.jsx(d0,{}):void 0,children:s.jsxs(wx,{children:[s.jsx(Ne,{path:"/overview/activity",children:s.jsx(q0,{})}),s.jsx(Ne,{path:"/overview",component:J0}),s.jsx(Ne,{path:"/operator/join/:cid",children:s.jsx(zS,{})}),s.jsx(Ne,{path:"/operator/execution-data",children:s.jsx(tb,{})}),s.jsx(Ne,{path:"/operator/memberships",children:s.jsx(fo,{children:s.jsx(lb,{onRestartPending:()=>n(!0)})})}),s.jsx(Ne,{path:"/operator/registry",children:s.jsx(fo,{children:s.jsx(_b,{})})}),s.jsx(Ne,{path:"/operator/network",children:s.jsx(fo,{children:s.jsx(Sb,{onRestartPending:()=>n(!0)})})}),s.jsx(Ne,{path:"/operator/security",children:s.jsx(fo,{children:s.jsx(wb,{})})}),s.jsx(Ne,{path:"/operator",children:s.jsx(Ys,{to:"/operator/memberships"})}),s.jsx(Ne,{path:"/captures",children:s.jsx(Ys,{to:"/operator/execution-data"})}),s.jsx(Ne,{path:"/configuration",children:s.jsx($b,{})}),s.jsx(Ne,{path:"/launcher/create",children:s.jsx(S1,{})}),s.jsx(Ne,{path:"/launcher/launched/:solverNetId",children:s.jsx(iS,{})}),s.jsx(Ne,{path:"/launcher",children:s.jsx(Z0,{})}),s.jsx(Ne,{path:"/build",children:o?s.jsx(Hb,{}):s.jsx(Ys,{to:"/overview"})}),s.jsx(Ne,{children:s.jsx(Ys,{to:"/overview"})})]})})})})}function $b(){const e=typeof window>"u"?"":window.location.hash;return s.jsx(Ys,{to:`/operator${e}`})}const Wb=new F_({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});kx().finally(()=>{vl.createRoot(document.getElementById("root")).render(s.jsx(Mf.StrictMode,{children:s.jsx(N_,{client:Wb,children:s.jsx(zb,{})})}))});
|