@jinn-network/client 0.1.2 → 0.1.3-canary.12cf8b76
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 +20 -0
- package/CONTRIBUTING.md +8 -2
- package/README.md +67 -47
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +36 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +36 -0
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +12 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +1 -1
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +38 -0
- package/dist/adapters/adapter.d.ts +19 -8
- package/dist/adapters/local/adapter.d.ts +10 -9
- package/dist/adapters/local/adapter.js +52 -79
- package/dist/adapters/local/adapter.js.map +1 -1
- package/dist/adapters/mech/adapter.d.ts +33 -15
- package/dist/adapters/mech/adapter.js +471 -353
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +68 -20
- package/dist/adapters/mech/contracts.js +338 -100
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs.d.ts +66 -12
- package/dist/adapters/mech/ipfs.js +165 -30
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +39 -0
- package/dist/adapters/mech/safe-revert.js +124 -0
- package/dist/adapters/mech/safe-revert.js.map +1 -0
- package/dist/adapters/mech/safe.js +48 -22
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +245 -84
- package/dist/adapters/mech/types.js +125 -50
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/agent-ws.d.ts +57 -0
- package/dist/agent/agent-ws.js +301 -0
- package/dist/agent/agent-ws.js.map +1 -0
- package/dist/agent/auto-mode-detect.d.ts +6 -0
- package/dist/agent/auto-mode-detect.js +44 -0
- package/dist/agent/auto-mode-detect.js.map +1 -0
- package/dist/agent/operator-claude.d.ts +22 -0
- package/dist/agent/operator-claude.js +134 -0
- package/dist/agent/operator-claude.js.map +1 -0
- package/dist/api/admin-endpoint.d.ts +12 -0
- package/dist/api/admin-endpoint.js +71 -0
- package/dist/api/admin-endpoint.js.map +1 -0
- package/dist/api/agent-binding-endpoint.d.ts +26 -0
- package/dist/api/agent-binding-endpoint.js +28 -0
- package/dist/api/agent-binding-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +24 -0
- package/dist/api/bootstrap-endpoint.js +103 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -0
- package/dist/api/events-endpoint.d.ts +9 -0
- package/dist/api/events-endpoint.js +46 -0
- package/dist/api/events-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +1 -1
- package/dist/api/fleet-build.js +17 -8
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +16 -1
- package/dist/api/gather-status.js +163 -3
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/handshake.d.ts +17 -0
- package/dist/api/handshake.js +28 -0
- package/dist/api/handshake.js.map +1 -0
- package/dist/api/harness-status-endpoint.d.ts +20 -0
- package/dist/api/harness-status-endpoint.js +13 -0
- package/dist/api/harness-status-endpoint.js.map +1 -0
- package/dist/api/history-build.d.ts +2 -2
- package/dist/api/history-build.js +3 -3
- package/dist/api/history-build.js.map +1 -1
- package/dist/api/launcher-endpoints.d.ts +43 -0
- package/dist/api/launcher-endpoints.js +50 -0
- package/dist/api/launcher-endpoints.js.map +1 -0
- package/dist/api/launcher-status.d.ts +92 -0
- package/dist/api/launcher-status.js +82 -0
- package/dist/api/launcher-status.js.map +1 -0
- package/dist/api/launcher-tasks.d.ts +104 -0
- package/dist/api/launcher-tasks.js +83 -0
- package/dist/api/launcher-tasks.js.map +1 -0
- package/dist/api/leaderboard-api.d.ts +20 -0
- package/dist/api/leaderboard-api.js +18 -0
- package/dist/api/leaderboard-api.js.map +1 -0
- package/dist/api/peers.js +21 -6
- package/dist/api/peers.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +16 -10
- package/dist/api/portfolio-v0-build.js +36 -31
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/portfolio-v0-doctor.js +1 -1
- package/dist/api/portfolio-v0-doctor.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +65 -0
- package/dist/api/prediction-v1-build.js +73 -0
- package/dist/api/prediction-v1-build.js.map +1 -0
- package/dist/api/rewards-build.js +3 -8
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/server.d.ts +97 -1
- package/dist/api/server.js +334 -16
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +62 -0
- package/dist/api/setup-endpoints.js +705 -0
- package/dist/api/setup-endpoints.js.map +1 -0
- package/dist/api/solvernets-catalog-build.d.ts +37 -0
- package/dist/api/solvernets-catalog-build.js +19 -0
- package/dist/api/solvernets-catalog-build.js.map +1 -0
- package/dist/api/solvernets-endpoint.d.ts +15 -0
- package/dist/api/solvernets-endpoint.js +5 -0
- package/dist/api/solvernets-endpoint.js.map +1 -0
- package/dist/api/solvernets-endpoints.d.ts +104 -0
- package/dist/api/solvernets-endpoints.js +1023 -0
- package/dist/api/solvernets-endpoints.js.map +1 -0
- package/dist/api/status-build.d.ts +15 -2
- package/dist/api/status-build.js +45 -9
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-rollup-build.d.ts +46 -1
- package/dist/api/status-rollup-build.js +168 -5
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/ui-token.d.ts +5 -0
- package/dist/api/ui-token.js +36 -0
- package/dist/api/ui-token.js.map +1 -0
- package/dist/build-info.d.ts +32 -0
- package/dist/build-info.js +69 -0
- package/dist/build-info.js.map +1 -0
- package/dist/build-info.json +6 -0
- package/dist/build-meta.json +1 -1
- package/dist/cli/command.d.ts +9 -0
- package/dist/cli/commands/auth.js +6 -3
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/balance.d.ts +7 -0
- package/dist/cli/commands/balance.js +38 -32
- package/dist/cli/commands/balance.js.map +1 -1
- package/dist/cli/commands/bootstrap.d.ts +13 -1
- package/dist/cli/commands/bootstrap.js +150 -133
- package/dist/cli/commands/bootstrap.js.map +1 -1
- package/dist/cli/commands/checkpoint.d.ts +85 -0
- package/dist/cli/commands/checkpoint.js +75 -0
- package/dist/cli/commands/checkpoint.js.map +1 -0
- package/dist/cli/commands/claim-rewards.js +14 -2
- package/dist/cli/commands/claim-rewards.js.map +1 -1
- package/dist/cli/commands/conformance.d.ts +12 -0
- package/dist/cli/commands/conformance.js +140 -0
- package/dist/cli/commands/conformance.js.map +1 -0
- package/dist/cli/commands/create.d.ts +22 -0
- package/dist/cli/commands/create.js +226 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +49 -1
- package/dist/cli/commands/doctor.js +162 -134
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/fleet-scale.d.ts +19 -1
- package/dist/cli/commands/fleet-scale.js +378 -361
- package/dist/cli/commands/fleet-scale.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +7 -0
- package/dist/cli/commands/fleet.js +39 -33
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/fund-requirements.d.ts +14 -1
- package/dist/cli/commands/fund-requirements.js +182 -174
- package/dist/cli/commands/fund-requirements.js.map +1 -1
- package/dist/cli/commands/harnesses.d.ts +38 -0
- package/dist/cli/commands/harnesses.js +305 -0
- package/dist/cli/commands/harnesses.js.map +1 -0
- package/dist/cli/commands/history.d.ts +10 -1
- package/dist/cli/commands/history.js +68 -59
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/init.js +4 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/integrations.d.ts +13 -0
- package/dist/cli/commands/integrations.js +1010 -0
- package/dist/cli/commands/integrations.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +6 -1
- package/dist/cli/commands/logs.js +77 -70
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/migrate-agent-id.d.ts +26 -0
- package/dist/cli/commands/migrate-agent-id.js +164 -0
- package/dist/cli/commands/migrate-agent-id.js.map +1 -0
- package/dist/cli/commands/prediction-scoreboard.d.ts +10 -0
- package/dist/cli/commands/prediction-scoreboard.js +136 -0
- package/dist/cli/commands/prediction-scoreboard.js.map +1 -0
- package/dist/cli/commands/quickstart.d.ts +51 -1
- package/dist/cli/commands/quickstart.js +514 -296
- package/dist/cli/commands/quickstart.js.map +1 -1
- package/dist/cli/commands/rewards.d.ts +7 -0
- package/dist/cli/commands/rewards.js +46 -40
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/run.d.ts +14 -1
- package/dist/cli/commands/run.js +243 -91
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/solver-nets.js +229 -0
- package/dist/cli/commands/solver-nets.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +9 -0
- package/dist/cli/commands/solver-plugins.js +186 -0
- package/dist/cli/commands/solver-plugins.js.map +1 -0
- package/dist/cli/commands/status.d.ts +13 -0
- package/dist/cli/commands/status.js +105 -34
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +405 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/commands/ui.d.ts +3 -0
- package/dist/cli/commands/ui.js +45 -0
- package/dist/cli/commands/ui.js.map +1 -0
- package/dist/cli/commands/update.d.ts +12 -0
- package/dist/cli/commands/update.js +321 -91
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +3 -2
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/commands/withdraw.d.ts +21 -1
- package/dist/cli/commands/withdraw.js +175 -159
- package/dist/cli/commands/withdraw.js.map +1 -1
- package/dist/cli/deployment-digest.js +0 -5
- package/dist/cli/deployment-digest.js.map +1 -1
- package/dist/cli/execution-context.d.ts +1 -1
- package/dist/cli/execution-context.js +4 -4
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/help.js +8 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +26 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -1
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/cli/open-browser.d.ts +1 -0
- package/dist/cli/open-browser.js +18 -0
- package/dist/cli/open-browser.js.map +1 -0
- package/dist/cli/password.d.ts +3 -3
- package/dist/cli/password.js +6 -6
- package/dist/cli/password.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +27 -0
- package/dist/cli/task-native-readiness.js +170 -0
- package/dist/cli/task-native-readiness.js.map +1 -0
- package/dist/config.d.ts +1771 -57
- package/dist/config.js +527 -31
- package/dist/config.js.map +1 -1
- package/dist/conformance/checks/artifacts.d.ts +37 -0
- package/dist/conformance/checks/artifacts.js +110 -0
- package/dist/conformance/checks/artifacts.js.map +1 -0
- package/dist/conformance/checks/envelope-schema.d.ts +17 -0
- package/dist/conformance/checks/envelope-schema.js +36 -0
- package/dist/conformance/checks/envelope-schema.js.map +1 -0
- package/dist/conformance/checks/hash-signature.d.ts +26 -0
- package/dist/conformance/checks/hash-signature.js +70 -0
- package/dist/conformance/checks/hash-signature.js.map +1 -0
- package/dist/conformance/checks/payload.d.ts +19 -0
- package/dist/conformance/checks/payload.js +52 -0
- package/dist/conformance/checks/payload.js.map +1 -0
- package/dist/conformance/checks/secret-scrub.d.ts +33 -0
- package/dist/conformance/checks/secret-scrub.js +118 -0
- package/dist/conformance/checks/secret-scrub.js.map +1 -0
- package/dist/conformance/checks/source-runtime.d.ts +43 -0
- package/dist/conformance/checks/source-runtime.js +68 -0
- package/dist/conformance/checks/source-runtime.js.map +1 -0
- package/dist/conformance/checks/source-static.d.ts +61 -0
- package/dist/conformance/checks/source-static.js +311 -0
- package/dist/conformance/checks/source-static.js.map +1 -0
- package/dist/conformance/checks/trajectory-chain.d.ts +18 -0
- package/dist/conformance/checks/trajectory-chain.js +51 -0
- package/dist/conformance/checks/trajectory-chain.js.map +1 -0
- package/dist/conformance/checks/trajectory-profile.d.ts +17 -0
- package/dist/conformance/checks/trajectory-profile.js +51 -0
- package/dist/conformance/checks/trajectory-profile.js.map +1 -0
- package/dist/conformance/checks/trajectory-schema.d.ts +20 -0
- package/dist/conformance/checks/trajectory-schema.js +40 -0
- package/dist/conformance/checks/trajectory-schema.js.map +1 -0
- package/dist/conformance/checks/verdict.d.ts +44 -0
- package/dist/conformance/checks/verdict.js +122 -0
- package/dist/conformance/checks/verdict.js.map +1 -0
- package/dist/conformance/harness.d.ts +32 -0
- package/dist/conformance/harness.js +227 -0
- package/dist/conformance/harness.js.map +1 -0
- package/dist/conformance/types.d.ts +88 -0
- package/dist/conformance/types.js +31 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/corpus/acquire.d.ts +37 -0
- package/dist/corpus/acquire.js +155 -0
- package/dist/corpus/acquire.js.map +1 -0
- package/dist/corpus/cache.d.ts +14 -0
- package/dist/corpus/cache.js +18 -0
- package/dist/corpus/cache.js.map +1 -0
- package/dist/corpus/envelope-projection.d.ts +12 -0
- package/dist/corpus/envelope-projection.js +110 -0
- package/dist/corpus/envelope-projection.js.map +1 -0
- package/dist/corpus/fetch.d.ts +9 -0
- package/dist/corpus/fetch.js +24 -0
- package/dist/corpus/fetch.js.map +1 -0
- package/dist/corpus/index.d.ts +19 -0
- package/dist/corpus/index.js +81 -0
- package/dist/corpus/index.js.map +1 -0
- package/dist/corpus/prediction-brier-scoreboard-report.d.ts +17 -0
- package/dist/corpus/prediction-brier-scoreboard-report.js +148 -0
- package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -0
- package/dist/corpus/prediction-brier-scoreboard.d.ts +56 -0
- package/dist/corpus/prediction-brier-scoreboard.js +269 -0
- package/dist/corpus/prediction-brier-scoreboard.js.map +1 -0
- package/dist/corpus/prediction-scoreable-verdicts.d.ts +4 -0
- package/dist/corpus/prediction-scoreable-verdicts.js +23 -0
- package/dist/corpus/prediction-scoreable-verdicts.js.map +1 -0
- package/dist/corpus/query.d.ts +17 -0
- package/dist/corpus/query.js +108 -0
- package/dist/corpus/query.js.map +1 -0
- package/dist/corpus/route-resolver.d.ts +16 -0
- package/dist/corpus/route-resolver.js +20 -0
- package/dist/corpus/route-resolver.js.map +1 -0
- package/dist/corpus/types.d.ts +150 -0
- package/dist/corpus/types.js +50 -0
- package/dist/corpus/types.js.map +1 -0
- package/dist/daemon/balance-topup-loop.js +2 -1
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/creator.d.ts +7 -7
- package/dist/daemon/creator.js +11 -14
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +83 -31
- package/dist/daemon/daemon.js +206 -67
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.js +50 -4
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/freeze-fence.d.ts +42 -0
- package/dist/daemon/freeze-fence.js +71 -0
- package/dist/daemon/freeze-fence.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +207 -0
- package/dist/daemon/jinn-claim-loop-canonical.js +296 -0
- package/dist/daemon/jinn-claim-loop-canonical.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-mock.d.ts +61 -0
- package/dist/daemon/jinn-claim-loop-mock.js +122 -0
- package/dist/daemon/jinn-claim-loop-mock.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +123 -0
- package/dist/daemon/jinn-claim-loop.js +256 -0
- package/dist/daemon/jinn-claim-loop.js.map +1 -0
- package/dist/daemon/reward-claim-loop.d.ts +2 -0
- package/dist/daemon/reward-claim-loop.js +32 -27
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/dashboard/assets/index-C4Vp0vkW.js +76 -0
- package/dist/dashboard/assets/index-a0yafmyT.css +32 -0
- package/dist/dashboard/index.html +18 -74
- package/dist/earning/agent-wallet-binding.d.ts +133 -0
- package/dist/earning/agent-wallet-binding.js +202 -0
- package/dist/earning/agent-wallet-binding.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +88 -1
- package/dist/earning/bootstrap.js +409 -56
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +328 -6
- package/dist/earning/contracts.js +295 -14
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/evidence-simhash.d.ts +1 -1
- package/dist/earning/faucet.d.ts +31 -0
- package/dist/earning/faucet.js +37 -0
- package/dist/earning/faucet.js.map +1 -1
- package/dist/earning/funding-plan.d.ts +89 -0
- package/dist/earning/funding-plan.js +202 -0
- package/dist/earning/funding-plan.js.map +1 -0
- package/dist/earning/migrate-agent-id.d.ts +129 -0
- package/dist/earning/migrate-agent-id.js +256 -0
- package/dist/earning/migrate-agent-id.js.map +1 -0
- package/dist/earning/orphan-sweep.d.ts +14 -0
- package/dist/earning/orphan-sweep.js +63 -2
- package/dist/earning/orphan-sweep.js.map +1 -1
- package/dist/earning/reconcile.d.ts +2 -0
- package/dist/earning/reconcile.js +30 -0
- package/dist/earning/reconcile.js.map +1 -1
- package/dist/earning/safe-adapter.js +45 -3
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/stolas-claim.d.ts +86 -6
- package/dist/earning/stolas-claim.js +123 -9
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/store.d.ts +47 -0
- package/dist/earning/store.js +113 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +32 -0
- package/dist/earning/testnet-setup-migration.js +214 -0
- package/dist/earning/testnet-setup-migration.js.map +1 -0
- package/dist/earning/types.d.ts +57 -9
- package/dist/earning/types.js +51 -2
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +20 -0
- package/dist/earning/viem-clients.js +32 -1
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/abis.d.ts +423 -0
- package/dist/erc8004/abis.js +265 -0
- package/dist/erc8004/abis.js.map +1 -0
- package/dist/erc8004/addresses.d.ts +40 -0
- package/dist/erc8004/addresses.js +64 -0
- package/dist/erc8004/addresses.js.map +1 -0
- package/dist/erc8004/identity.d.ts +273 -0
- package/dist/erc8004/identity.js +405 -0
- package/dist/erc8004/identity.js.map +1 -0
- package/dist/erc8004/index.d.ts +13 -0
- package/dist/erc8004/index.js +20 -0
- package/dist/erc8004/index.js.map +1 -0
- package/dist/erc8004/reputation.d.ts +349 -0
- package/dist/erc8004/reputation.js +464 -0
- package/dist/erc8004/reputation.js.map +1 -0
- package/dist/erc8004/subgraph.d.ts +46 -0
- package/dist/erc8004/subgraph.js +37 -0
- package/dist/erc8004/subgraph.js.map +1 -0
- package/dist/erc8004/validation.d.ts +145 -0
- package/dist/erc8004/validation.js +219 -0
- package/dist/erc8004/validation.js.map +1 -0
- package/dist/errors/persisted-bootstrap-error.d.ts +4 -0
- package/dist/errors/persisted-bootstrap-error.js +50 -0
- package/dist/errors/persisted-bootstrap-error.js.map +1 -0
- package/dist/events/emitter.d.ts +12 -0
- package/dist/events/emitter.js +23 -0
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/ring-buffer.d.ts +25 -0
- package/dist/events/ring-buffer.js +46 -0
- package/dist/events/ring-buffer.js.map +1 -0
- package/dist/events/types.d.ts +42 -0
- package/dist/events/types.js +28 -0
- package/dist/events/types.js.map +1 -0
- package/dist/harnesses/capability/index.d.ts +82 -0
- package/dist/harnesses/capability/index.js +12 -0
- package/dist/harnesses/capability/index.js.map +1 -0
- package/dist/harnesses/capability/scoped-rpc.d.ts +12 -0
- package/dist/harnesses/capability/scoped-rpc.js +34 -0
- package/dist/harnesses/capability/scoped-rpc.js.map +1 -0
- package/dist/harnesses/capability/scoped-secrets.d.ts +8 -0
- package/dist/harnesses/capability/scoped-secrets.js +10 -0
- package/dist/harnesses/capability/scoped-secrets.js.map +1 -0
- package/dist/harnesses/capability/scoped-signer.d.ts +46 -0
- package/dist/harnesses/capability/scoped-signer.js +73 -0
- package/dist/harnesses/capability/scoped-signer.js.map +1 -0
- package/dist/harnesses/engine/canonical-json.d.ts +1 -0
- package/dist/harnesses/engine/canonical-json.js +66 -0
- package/dist/harnesses/engine/canonical-json.js.map +1 -0
- package/dist/harnesses/engine/delivery.d.ts +58 -0
- package/dist/harnesses/engine/delivery.js +67 -0
- package/dist/harnesses/engine/delivery.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +516 -0
- package/dist/harnesses/engine/engine.js +1544 -0
- package/dist/harnesses/engine/engine.js.map +1 -0
- package/dist/harnesses/engine/envelope-assembly.d.ts +73 -0
- package/dist/harnesses/engine/envelope-assembly.js +60 -0
- package/dist/harnesses/engine/envelope-assembly.js.map +1 -0
- package/dist/harnesses/engine/packaging.d.ts +87 -0
- package/dist/harnesses/engine/packaging.js +376 -0
- package/dist/harnesses/engine/packaging.js.map +1 -0
- package/dist/harnesses/engine/persistence.d.ts +193 -0
- package/dist/harnesses/engine/persistence.js +421 -0
- package/dist/harnesses/engine/persistence.js.map +1 -0
- package/dist/harnesses/engine/recovery.d.ts +22 -0
- package/dist/harnesses/engine/recovery.js +24 -0
- package/dist/harnesses/engine/recovery.js.map +1 -0
- package/dist/harnesses/engine/registry.d.ts +55 -0
- package/dist/harnesses/engine/registry.js +65 -0
- package/dist/harnesses/engine/registry.js.map +1 -0
- package/dist/harnesses/engine/signing.d.ts +30 -0
- package/dist/harnesses/engine/signing.js +39 -0
- package/dist/harnesses/engine/signing.js.map +1 -0
- package/dist/harnesses/engine/state.d.ts +42 -0
- package/dist/harnesses/engine/state.js +87 -0
- package/dist/harnesses/engine/state.js.map +1 -0
- package/dist/harnesses/engine/validate-manifest.d.ts +23 -0
- package/dist/harnesses/engine/validate-manifest.js +49 -0
- package/dist/harnesses/engine/validate-manifest.js.map +1 -0
- package/dist/harnesses/engine/verification-stub.d.ts +18 -0
- package/dist/harnesses/engine/verification-stub.js +18 -0
- package/dist/harnesses/engine/verification-stub.js.map +1 -0
- package/dist/harnesses/external-impls/index.d.ts +3 -0
- package/dist/harnesses/external-impls/index.js +2 -0
- package/dist/harnesses/external-impls/index.js.map +1 -0
- package/dist/harnesses/external-impls/loader.d.ts +50 -0
- package/dist/harnesses/external-impls/loader.js +139 -0
- package/dist/harnesses/external-impls/loader.js.map +1 -0
- package/dist/harnesses/external-impls/package-hash.d.ts +26 -0
- package/dist/harnesses/external-impls/package-hash.js +102 -0
- package/dist/harnesses/external-impls/package-hash.js.map +1 -0
- package/dist/harnesses/external-impls/types.d.ts +42 -0
- package/dist/harnesses/external-impls/types.js +10 -0
- package/dist/harnesses/external-impls/types.js.map +1 -0
- package/dist/harnesses/freeze.d.ts +34 -0
- package/dist/harnesses/freeze.js +60 -0
- package/dist/harnesses/freeze.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.d.ts +57 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js +235 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/harness.d.ts +22 -0
- package/dist/harnesses/impls/claude-code-learner/harness.js +56 -0
- package/dist/harnesses/impls/claude-code-learner/harness.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.d.ts +20 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.js +426 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/index.d.ts +14 -0
- package/dist/harnesses/impls/claude-code-learner/index.js +13 -0
- package/dist/harnesses/impls/claude-code-learner/index.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.d.ts +14 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js +30 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.d.ts +50 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js +192 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.d.ts +22 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js +35 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/types.d.ts +112 -0
- package/dist/harnesses/impls/claude-code-learner/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/api-wallet.d.ts +64 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/api-wallet.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.d.ts +106 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js +723 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/safety-rails.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +104 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.js +264 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +44 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +250 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +135 -0
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.d.ts +8 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.js +54 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +43 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +21 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.d.ts +84 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.js +6 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.d.ts +36 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +241 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +136 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.d.ts +7 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.js +46 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +37 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +19 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.d.ts +64 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.js +6 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.d.ts +84 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.js +206 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/evaluation-context.d.ts +23 -0
- package/dist/harnesses/impls/evaluation-context.js +25 -0
- package/dist/harnesses/impls/evaluation-context.js.map +1 -0
- package/dist/harnesses/impls/index.d.ts +74 -0
- package/dist/harnesses/impls/index.js +112 -0
- package/dist/harnesses/impls/index.js.map +1 -0
- package/dist/harnesses/impls/legacy-claude/index.d.ts +66 -0
- package/dist/harnesses/impls/legacy-claude/index.js +168 -0
- package/dist/harnesses/impls/legacy-claude/index.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +68 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.js +117 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/availability.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.d.ts +78 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.js +274 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +23 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.js +49 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.d.ts +25 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.js +44 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.d.ts +17 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.js +43 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +44 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +569 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/types.d.ts +34 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.d.ts +42 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.js +114 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/strategy.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +6 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.js +11 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +42 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +346 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +16 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js +22 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.d.ts +33 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.js +109 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.d.ts +8 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.js +41 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/types.d.ts +7 -0
- package/dist/harnesses/impls/prediction-v0-baseline/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/canonical-metrics.d.ts +20 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/availability.d.ts +9 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/availability.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/eligibility.d.ts +3 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/eligibility.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.d.ts +15 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js +111 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/spec.d.ts +5 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/spec.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +36 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +342 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/types.js +2 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.d.ts +31 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.js +79 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.d.ts +32 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js +219 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +20 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +88 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +56 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +40 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -0
- package/dist/harnesses/manifest/index.d.ts +3 -0
- package/dist/harnesses/manifest/index.js +3 -0
- package/dist/harnesses/manifest/index.js.map +1 -0
- package/dist/harnesses/manifest/load.d.ts +7 -0
- package/dist/harnesses/manifest/load.js +49 -0
- package/dist/harnesses/manifest/load.js.map +1 -0
- package/dist/harnesses/manifest/types.d.ts +75 -0
- package/dist/harnesses/manifest/types.js +8 -0
- package/dist/harnesses/manifest/types.js.map +1 -0
- package/dist/harnesses/manifest/verify.d.ts +15 -0
- package/dist/harnesses/manifest/verify.js +53 -0
- package/dist/harnesses/manifest/verify.js.map +1 -0
- package/dist/harnesses/mode-state.d.ts +7 -0
- package/dist/harnesses/mode-state.js +43 -0
- package/dist/harnesses/mode-state.js.map +1 -0
- package/dist/harnesses/types.d.ts +274 -0
- package/dist/harnesses/types.js +28 -0
- package/dist/harnesses/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/main.d.ts +17 -2
- package/dist/main.js +1257 -127
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +39 -0
- package/dist/mcp/acquire-artifact.js +163 -0
- package/dist/mcp/acquire-artifact.js.map +1 -0
- package/dist/mcp/operator-server.d.ts +21 -4
- package/dist/mcp/operator-server.js +505 -30
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/search-records.d.ts +92 -0
- package/dist/mcp/search-records.js +393 -0
- package/dist/mcp/search-records.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -4
- package/dist/mcp/server.js +148 -61
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/emit-event.d.ts +2 -2
- package/dist/observability/emit-event.js +2 -2
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/operator-errors.d.ts +14 -0
- package/dist/operator-errors.js +39 -10
- package/dist/operator-errors.js.map +1 -1
- package/dist/plugins/digest.d.ts +1 -0
- package/dist/plugins/digest.js +28 -0
- package/dist/plugins/digest.js.map +1 -0
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.js +6 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/manifest.d.ts +7 -0
- package/dist/plugins/manifest.js +22 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/registry.d.ts +9 -0
- package/dist/plugins/registry.js +24 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/resolvers.d.ts +2 -0
- package/dist/plugins/resolvers.js +126 -0
- package/dist/plugins/resolvers.js.map +1 -0
- package/dist/plugins/types.d.ts +35 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/validator.d.ts +3 -0
- package/dist/plugins/validator.js +50 -0
- package/dist/plugins/validator.js.map +1 -0
- package/dist/preflight/claude-auth.d.ts +14 -12
- package/dist/preflight/claude-auth.js +23 -37
- package/dist/preflight/claude-auth.js.map +1 -1
- package/dist/runner/claude.d.ts +3 -3
- package/dist/runner/claude.js +62 -26
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/runner.d.ts +29 -2
- package/dist/runner/simple.d.ts +2 -2
- package/dist/runner/simple.js +2 -2
- package/dist/runner/simple.js.map +1 -1
- package/dist/scripts/fix-node-pty.mjs +62 -0
- package/dist/setup/claude-code-install.d.ts +19 -0
- package/dist/setup/claude-code-install.js +51 -0
- package/dist/setup/claude-code-install.js.map +1 -0
- package/dist/setup-mode.d.ts +34 -0
- package/dist/setup-mode.js +49 -0
- package/dist/setup-mode.js.map +1 -0
- package/dist/solver-nets/contracts.d.ts +2 -0
- package/dist/solver-nets/contracts.js +2 -0
- package/dist/solver-nets/contracts.js.map +1 -0
- package/dist/solver-nets/prediction-operator-ux.d.ts +112 -0
- package/dist/solver-nets/prediction-operator-ux.js +456 -0
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -0
- package/dist/solver-nets/registry.d.ts +50 -0
- package/dist/solver-nets/registry.js +150 -0
- package/dist/solver-nets/registry.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.d.ts +31 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.js +49 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.d.ts +27 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js +26 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool.d.ts +39 -0
- package/dist/solver-types/_swe-rebench-v2-pool.js +66 -0
- package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +24 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +54 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -0
- package/dist/solver-types/constants.d.ts +5 -0
- package/dist/solver-types/constants.js +6 -0
- package/dist/solver-types/constants.js.map +1 -0
- package/dist/solver-types/index.d.ts +10 -0
- package/dist/solver-types/index.js +30 -0
- package/dist/solver-types/index.js.map +1 -0
- package/dist/solver-types/learner-loop-test.d.ts +2 -0
- package/dist/solver-types/learner-loop-test.js +39 -0
- package/dist/solver-types/learner-loop-test.js.map +1 -0
- package/dist/solver-types/portfolio-v0.d.ts +2 -0
- package/dist/solver-types/portfolio-v0.js +13 -0
- package/dist/solver-types/portfolio-v0.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0-auto.d.ts +27 -0
- package/dist/solver-types/prediction-apy-v0-auto.js +109 -0
- package/dist/solver-types/prediction-apy-v0-auto.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0-template.d.ts +8 -0
- package/dist/solver-types/prediction-apy-v0-template.js +22 -0
- package/dist/solver-types/prediction-apy-v0-template.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0.d.ts +3 -0
- package/dist/solver-types/prediction-apy-v0.js +25 -0
- package/dist/solver-types/prediction-apy-v0.js.map +1 -0
- package/dist/solver-types/prediction-v0-auto.d.ts +69 -0
- package/dist/solver-types/prediction-v0-auto.js +146 -0
- package/dist/solver-types/prediction-v0-auto.js.map +1 -0
- package/dist/solver-types/prediction-v0-template.d.ts +70 -0
- package/dist/solver-types/prediction-v0-template.js +145 -0
- package/dist/solver-types/prediction-v0-template.js.map +1 -0
- package/dist/solver-types/prediction-v0.d.ts +13 -0
- package/dist/solver-types/prediction-v0.js +31 -0
- package/dist/solver-types/prediction-v0.js.map +1 -0
- package/dist/solver-types/prediction-v1-auto.d.ts +122 -0
- package/dist/solver-types/prediction-v1-auto.js +366 -0
- package/dist/solver-types/prediction-v1-auto.js.map +1 -0
- package/dist/solver-types/prediction-v1.d.ts +11 -0
- package/dist/solver-types/prediction-v1.js +27 -0
- package/dist/solver-types/prediction-v1.js.map +1 -0
- package/dist/solver-types/solver-type.d.ts +53 -0
- package/dist/solver-types/solver-type.js +6 -0
- package/dist/solver-types/solver-type.js.map +1 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +38 -0
- package/dist/solver-types/swe-rebench-v2-auto.js +56 -0
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -0
- package/dist/solver-types/swe-rebench-v2.d.ts +24 -0
- package/dist/solver-types/swe-rebench-v2.js +146 -0
- package/dist/solver-types/swe-rebench-v2.js.map +1 -0
- package/dist/solvernets/daemon-init.d.ts +291 -0
- package/dist/solvernets/daemon-init.js +431 -0
- package/dist/solvernets/daemon-init.js.map +1 -0
- package/dist/solvernets/launch-state-machine.d.ts +165 -0
- package/dist/solvernets/launch-state-machine.js +406 -0
- package/dist/solvernets/launch-state-machine.js.map +1 -0
- package/dist/solvernets/lifecycle-transitions.d.ts +183 -0
- package/dist/solvernets/lifecycle-transitions.js +386 -0
- package/dist/solvernets/lifecycle-transitions.js.map +1 -0
- package/dist/solvernets/manifest.d.ts +120 -0
- package/dist/solvernets/manifest.js +166 -0
- package/dist/solvernets/manifest.js.map +1 -0
- package/dist/solvernets/most-recent-wins.d.ts +77 -0
- package/dist/solvernets/most-recent-wins.js +82 -0
- package/dist/solvernets/most-recent-wins.js.map +1 -0
- package/dist/solvernets/registry-client-erc8004.d.ts +239 -0
- package/dist/solvernets/registry-client-erc8004.js +382 -0
- package/dist/solvernets/registry-client-erc8004.js.map +1 -0
- package/dist/solvernets/registry-client.d.ts +121 -0
- package/dist/solvernets/registry-client.js +19 -0
- package/dist/solvernets/registry-client.js.map +1 -0
- package/dist/solvernets/store.d.ts +298 -0
- package/dist/solvernets/store.js +271 -0
- package/dist/solvernets/store.js.map +1 -0
- package/dist/store/store.d.ts +175 -21
- package/dist/store/store.js +711 -46
- package/dist/store/store.js.map +1 -1
- package/dist/tasks/posting-service.d.ts +25 -0
- package/dist/tasks/posting-service.js +149 -0
- package/dist/tasks/posting-service.js.map +1 -0
- package/dist/tasks/signing.d.ts +4 -0
- package/dist/tasks/signing.js +18 -0
- package/dist/tasks/signing.js.map +1 -0
- package/dist/tasks/sources.d.ts +46 -0
- package/dist/tasks/sources.js +45 -0
- package/dist/tasks/sources.js.map +1 -0
- package/dist/templates/harnesses/alternative-harness/README.md.tmpl +44 -0
- package/dist/templates/harnesses/alternative-harness/gitignore.tmpl +3 -0
- package/dist/templates/harnesses/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/alternative-harness/package.json.tmpl +26 -0
- package/dist/templates/harnesses/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/dist/templates/harnesses/alternative-harness/src/harness.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/index.ts.tmpl +44 -0
- package/dist/templates/harnesses/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/dist/templates/harnesses/alternative-harness/test/coordinator.test.ts.tmpl +53 -0
- package/dist/templates/harnesses/alternative-harness/test/unit.test.ts.tmpl +55 -0
- package/dist/templates/harnesses/alternative-harness/tsconfig.json.tmpl +16 -0
- package/dist/templates/harnesses/evaluator/README.md.tmpl +36 -0
- package/dist/templates/harnesses/evaluator/gitignore.tmpl +3 -0
- package/dist/templates/harnesses/evaluator/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/evaluator/package.json.tmpl +26 -0
- package/dist/templates/harnesses/evaluator/src/index.ts.tmpl +35 -0
- package/dist/templates/harnesses/evaluator/test/unit.test.ts.tmpl +49 -0
- package/dist/templates/harnesses/evaluator/tsconfig.json.tmpl +16 -0
- package/dist/templates/harnesses/forecaster/README.md.tmpl +25 -0
- package/dist/templates/harnesses/forecaster/gitignore.tmpl +5 -0
- package/dist/templates/harnesses/forecaster/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/forecaster/package.json.tmpl +26 -0
- package/dist/templates/harnesses/forecaster/src/index.ts.tmpl +33 -0
- package/dist/templates/harnesses/forecaster/test/unit.test.ts.tmpl +42 -0
- package/dist/templates/harnesses/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/trajectory/collector.d.ts +49 -0
- package/dist/trajectory/collector.js +86 -0
- package/dist/trajectory/collector.js.map +1 -0
- package/dist/trajectory/emit.d.ts +27 -0
- package/dist/trajectory/emit.js +40 -0
- package/dist/trajectory/emit.js.map +1 -0
- package/dist/trajectory/hash-chain.d.ts +18 -0
- package/dist/trajectory/hash-chain.js +23 -0
- package/dist/trajectory/hash-chain.js.map +1 -0
- package/dist/trajectory/index.d.ts +22 -0
- package/dist/trajectory/index.js +23 -0
- package/dist/trajectory/index.js.map +1 -0
- package/dist/trajectory/schema.d.ts +14 -14
- package/dist/trajectory/secret-scrub.d.ts +32 -0
- package/dist/trajectory/secret-scrub.js +51 -0
- package/dist/trajectory/secret-scrub.js.map +1 -0
- package/dist/trajectory/span-profile.d.ts +27 -0
- package/dist/trajectory/span-profile.js +51 -0
- package/dist/trajectory/span-profile.js.map +1 -0
- package/dist/trajectory/wrappers/http.d.ts +37 -0
- package/dist/trajectory/wrappers/http.js +85 -0
- package/dist/trajectory/wrappers/http.js.map +1 -0
- package/dist/trajectory/wrappers/mcp.d.ts +17 -0
- package/dist/trajectory/wrappers/mcp.js +58 -0
- package/dist/trajectory/wrappers/mcp.js.map +1 -0
- package/dist/trajectory/wrappers/subprocess.d.ts +32 -0
- package/dist/trajectory/wrappers/subprocess.js +70 -0
- package/dist/trajectory/wrappers/subprocess.js.map +1 -0
- package/dist/tx-retry.js +34 -9
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +1659 -0
- package/dist/types/envelope.js +133 -0
- package/dist/types/envelope.js.map +1 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +4 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/payloads/index.d.ts +12 -0
- package/dist/types/payloads/index.js +60 -0
- package/dist/types/payloads/index.js.map +1 -0
- package/dist/types/payloads/portfolio-v0.d.ts +481 -0
- package/dist/types/payloads/portfolio-v0.js +94 -0
- package/dist/types/payloads/portfolio-v0.js.map +1 -0
- package/dist/types/payloads/prediction-apy-v0.d.ts +231 -0
- package/dist/types/payloads/prediction-apy-v0.js +63 -0
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -0
- package/dist/types/payloads/prediction-v0.d.ts +262 -0
- package/dist/types/payloads/prediction-v0.js +73 -0
- package/dist/types/payloads/prediction-v0.js.map +1 -0
- package/dist/types/payloads/prediction-v1.d.ts +2 -0
- package/dist/types/payloads/prediction-v1.js +2 -0
- package/dist/types/payloads/prediction-v1.js.map +1 -0
- package/dist/types/portfolio.d.ts +31 -698
- package/dist/types/portfolio.js +20 -110
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +26 -366
- package/dist/types/prediction-apy.js +12 -68
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction-v1.d.ts +2 -0
- package/dist/types/prediction-v1.js +2 -0
- package/dist/types/prediction-v1.js.map +1 -0
- package/dist/types/prediction.d.ts +546 -382
- package/dist/types/prediction.js +16 -87
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/task-document.d.ts +1121 -0
- package/dist/types/task-document.js +99 -0
- package/dist/types/task-document.js.map +1 -0
- package/dist/types/task.d.ts +805 -0
- package/dist/types/task.js +88 -0
- package/dist/types/task.js.map +1 -0
- package/dist/types/window.d.ts +12 -0
- package/dist/types/window.js +6 -0
- package/dist/types/window.js.map +1 -0
- package/dist/util/path-safety.d.ts +21 -0
- package/dist/util/path-safety.js +28 -0
- package/dist/util/path-safety.js.map +1 -0
- package/dist/util/redact-rpc-urls.d.ts +5 -0
- package/dist/util/redact-rpc-urls.js +9 -0
- package/dist/util/redact-rpc-urls.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/README.md +89 -0
- package/dist/vendor/@jinn-network/sdk/dist/capabilities.d.ts +52 -0
- package/dist/vendor/@jinn-network/sdk/dist/capabilities.js +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +120 -0
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +39 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +144 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +248 -0
- package/dist/vendor/@jinn-network/sdk/dist/harness.d.ts +120 -0
- package/dist/vendor/@jinn-network/sdk/dist/harness.js +31 -0
- package/dist/vendor/@jinn-network/sdk/dist/index.d.ts +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/index.js +5 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +32 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +131 -0
- package/dist/vendor/@jinn-network/sdk/dist/manifest.d.ts +69 -0
- package/dist/vendor/@jinn-network/sdk/dist/manifest.js +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +223 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +64 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +107 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +51 -0
- package/dist/vendor/@jinn-network/sdk/dist/plugins.d.ts +36 -0
- package/dist/vendor/@jinn-network/sdk/dist/plugins.js +54 -0
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +870 -0
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +80 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/index.d.ts +6 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/index.js +8 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +559 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +126 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/prediction-v1.d.ts +6 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/prediction-v1.js +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +66 -0
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +44 -0
- package/dist/vendor/@jinn-network/sdk/dist/types.d.ts +116 -0
- package/dist/vendor/@jinn-network/sdk/dist/types.js +21 -0
- package/dist/vendor/@jinn-network/sdk/package.json +43 -0
- package/dist/venues/hyperliquid/account-value.d.ts +1 -1
- package/dist/venues/hyperliquid/account-value.js +1 -1
- package/dist/venues/polymarket/client.d.ts +77 -0
- package/dist/venues/polymarket/client.js +309 -0
- package/dist/venues/polymarket/client.js.map +1 -0
- package/dist/withdraw/run-withdraw-plan.js +0 -2
- package/dist/withdraw/run-withdraw-plan.js.map +1 -1
- package/dist/x402/acquire.d.ts +14 -3
- package/dist/x402/acquire.js +28 -11
- package/dist/x402/acquire.js.map +1 -1
- package/dist/x402/handler.d.ts +15 -3
- package/dist/x402/handler.js +67 -24
- package/dist/x402/handler.js.map +1 -1
- package/package.json +46 -15
- package/plugins/claude-code-learner/.claude-plugin/plugin.json +9 -0
- package/plugins/claude-code-learner/AGENTS.md +31 -0
- package/plugins/claude-code-learner/CLAUDE.md +33 -0
- package/plugins/claude-code-learner/README.md +57 -0
- package/plugins/claude-code-learner/hooks/hooks.json +16 -0
- package/plugins/claude-code-learner/hooks/session-start +38 -0
- package/plugins/claude-code-learner/skills/learn/SKILL.md +405 -0
- package/plugins/claude-code-learner/skills/learn/analyst-prompt.md +68 -0
- package/plugins/claude-code-learner/skills/learn/consolidator-prompt.md +94 -0
- package/plugins/claude-code-learner/skills/learn/explorer-prompt.md +53 -0
- package/plugins/claude-code-learner/skills/learn/planner-prompt.md +87 -0
- package/plugins/claude-code-learner/skills/learn/promoter-prompt.md +113 -0
- package/plugins/claude-code-learner/skills/learn/step-worker-prompt.md +47 -0
- package/plugins/claude-code-learner/skills/learn/strategist-prompt.md +85 -0
- package/plugins/jinn-prediction-plugin/.claude-plugin/plugin.json +19 -0
- package/plugins/jinn-prediction-plugin/.mcp.json +8 -0
- package/plugins/jinn-prediction-plugin/GEMINI.md +7 -0
- package/plugins/jinn-prediction-plugin/gemini-extension.json +13 -0
- package/plugins/jinn-prediction-plugin/jinn.plugin.json +26 -0
- package/plugins/jinn-prediction-plugin/mcp/polymarket-server.mjs +322 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-solution.schema.json +12 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-task.schema.json +25 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-verdict.schema.json +11 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-solution.schema.json +34 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-task.schema.json +118 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-verdict.schema.json +84 -0
- package/plugins/jinn-prediction-plugin/skills/base-rate-forecasting/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/calibration/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/common-biases/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/polymarket-task-handling/SKILL.md +5 -0
- package/plugins/jinn-prediction-plugin/skills/prediction-corpus-retrieval/SKILL.md +35 -0
- package/plugins/network-tools/.claude-plugin/plugin.json +12 -0
- package/plugins/network-tools/jinn.plugin.json +29 -0
- package/plugins/network-tools/mcp/jinn-client-server.mjs +110 -0
- package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +9 -0
- package/plugins/swe-rebench-v2-runtime/README.md +11 -0
- package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +12 -0
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +25 -0
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +24 -0
- package/skills/jinn-operator/SKILL.md +120 -101
- package/templates/harnesses/alternative-harness/README.md.tmpl +44 -0
- package/templates/harnesses/alternative-harness/gitignore.tmpl +3 -0
- package/templates/harnesses/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/alternative-harness/package.json.tmpl +26 -0
- package/templates/harnesses/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/templates/harnesses/alternative-harness/src/harness.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/index.ts.tmpl +44 -0
- package/templates/harnesses/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/templates/harnesses/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/templates/harnesses/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/templates/harnesses/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/templates/harnesses/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/templates/harnesses/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/templates/harnesses/alternative-harness/test/coordinator.test.ts.tmpl +53 -0
- package/templates/harnesses/alternative-harness/test/unit.test.ts.tmpl +55 -0
- package/templates/harnesses/alternative-harness/tsconfig.json.tmpl +16 -0
- package/templates/harnesses/evaluator/README.md.tmpl +36 -0
- package/templates/harnesses/evaluator/gitignore.tmpl +3 -0
- package/templates/harnesses/evaluator/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/evaluator/package.json.tmpl +26 -0
- package/templates/harnesses/evaluator/src/index.ts.tmpl +35 -0
- package/templates/harnesses/evaluator/test/unit.test.ts.tmpl +49 -0
- package/templates/harnesses/evaluator/tsconfig.json.tmpl +16 -0
- package/templates/harnesses/forecaster/README.md.tmpl +25 -0
- package/templates/harnesses/forecaster/gitignore.tmpl +5 -0
- package/templates/harnesses/forecaster/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/forecaster/package.json.tmpl +26 -0
- package/templates/harnesses/forecaster/src/index.ts.tmpl +33 -0
- package/templates/harnesses/forecaster/test/unit.test.ts.tmpl +42 -0
- package/templates/harnesses/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/adapters/claim-registry/abi.d.ts +0 -127
- package/dist/adapters/claim-registry/abi.js +0 -93
- package/dist/adapters/claim-registry/abi.js.map +0 -1
- package/dist/adapters/claim-registry/client.d.ts +0 -89
- package/dist/adapters/claim-registry/client.js +0 -205
- package/dist/adapters/claim-registry/client.js.map +0 -1
- package/dist/adapters/mech/claim-policy.d.ts +0 -40
- package/dist/adapters/mech/claim-policy.js +0 -104
- package/dist/adapters/mech/claim-policy.js.map +0 -1
- package/dist/bin/jinn-mcp.d.ts +0 -2
- package/dist/bin/jinn-mcp.js +0 -10
- package/dist/bin/jinn-mcp.js.map +0 -1
- package/dist/cli/commands/intents.d.ts +0 -17
- package/dist/cli/commands/intents.js +0 -489
- package/dist/cli/commands/intents.js.map +0 -1
- package/dist/cli/commands/plugin-install.js +0 -803
- package/dist/cli/commands/plugin-install.js.map +0 -1
- package/dist/cli/commands/submit-intent.js +0 -245
- package/dist/cli/commands/submit-intent.js.map +0 -1
- package/dist/cli/intent-registry-access.d.ts +0 -62
- package/dist/cli/intent-registry-access.js +0 -165
- package/dist/cli/intent-registry-access.js.map +0 -1
- package/dist/discovery/registry.d.ts +0 -97
- package/dist/discovery/registry.js +0 -177
- package/dist/discovery/registry.js.map +0 -1
- package/dist/discovery/subgraph.d.ts +0 -37
- package/dist/discovery/subgraph.js +0 -87
- package/dist/discovery/subgraph.js.map +0 -1
- package/dist/intents/kinds/constants.d.ts +0 -5
- package/dist/intents/kinds/constants.js +0 -6
- package/dist/intents/kinds/constants.js.map +0 -1
- package/dist/intents/kinds/index.d.ts +0 -28
- package/dist/intents/kinds/index.js +0 -50
- package/dist/intents/kinds/index.js.map +0 -1
- package/dist/intents/kinds/portfolio-v0.d.ts +0 -2
- package/dist/intents/kinds/portfolio-v0.js +0 -13
- package/dist/intents/kinds/portfolio-v0.js.map +0 -1
- package/dist/intents/kinds/prediction-apy-v0.d.ts +0 -3
- package/dist/intents/kinds/prediction-apy-v0.js +0 -21
- package/dist/intents/kinds/prediction-apy-v0.js.map +0 -1
- package/dist/intents/kinds/prediction-v0.d.ts +0 -3
- package/dist/intents/kinds/prediction-v0.js +0 -32
- package/dist/intents/kinds/prediction-v0.js.map +0 -1
- package/dist/intents/kinds/spec-kind.d.ts +0 -38
- package/dist/intents/kinds/spec-kind.js +0 -6
- package/dist/intents/kinds/spec-kind.js.map +0 -1
- package/dist/intents/posting-service.d.ts +0 -26
- package/dist/intents/posting-service.js +0 -218
- package/dist/intents/posting-service.js.map +0 -1
- package/dist/intents/prediction-apy-v0-auto.d.ts +0 -11
- package/dist/intents/prediction-apy-v0-auto.js +0 -46
- package/dist/intents/prediction-apy-v0-auto.js.map +0 -1
- package/dist/intents/prediction-apy-v0-template.d.ts +0 -8
- package/dist/intents/prediction-apy-v0-template.js +0 -22
- package/dist/intents/prediction-apy-v0-template.js.map +0 -1
- package/dist/intents/prediction-v0-auto.d.ts +0 -53
- package/dist/intents/prediction-v0-auto.js +0 -84
- package/dist/intents/prediction-v0-auto.js.map +0 -1
- package/dist/intents/prediction-v0-template.d.ts +0 -70
- package/dist/intents/prediction-v0-template.js +0 -145
- package/dist/intents/prediction-v0-template.js.map +0 -1
- package/dist/intents/sources.d.ts +0 -39
- package/dist/intents/sources.js +0 -42
- package/dist/intents/sources.js.map +0 -1
- package/dist/restorer/engine/canonical-json.d.ts +0 -18
- package/dist/restorer/engine/canonical-json.js +0 -59
- package/dist/restorer/engine/canonical-json.js.map +0 -1
- package/dist/restorer/engine/claim.d.ts +0 -69
- package/dist/restorer/engine/claim.js +0 -104
- package/dist/restorer/engine/claim.js.map +0 -1
- package/dist/restorer/engine/delivery.d.ts +0 -52
- package/dist/restorer/engine/delivery.js +0 -63
- package/dist/restorer/engine/delivery.js.map +0 -1
- package/dist/restorer/engine/engine.d.ts +0 -213
- package/dist/restorer/engine/engine.js +0 -769
- package/dist/restorer/engine/engine.js.map +0 -1
- package/dist/restorer/engine/manifest-assembly.d.ts +0 -67
- package/dist/restorer/engine/manifest-assembly.js +0 -79
- package/dist/restorer/engine/manifest-assembly.js.map +0 -1
- package/dist/restorer/engine/packaging.d.ts +0 -87
- package/dist/restorer/engine/packaging.js +0 -350
- package/dist/restorer/engine/packaging.js.map +0 -1
- package/dist/restorer/engine/persistence.d.ts +0 -170
- package/dist/restorer/engine/persistence.js +0 -381
- package/dist/restorer/engine/persistence.js.map +0 -1
- package/dist/restorer/engine/recovery.d.ts +0 -22
- package/dist/restorer/engine/recovery.js +0 -24
- package/dist/restorer/engine/recovery.js.map +0 -1
- package/dist/restorer/engine/registry.d.ts +0 -62
- package/dist/restorer/engine/registry.js +0 -73
- package/dist/restorer/engine/registry.js.map +0 -1
- package/dist/restorer/engine/signing.d.ts +0 -30
- package/dist/restorer/engine/signing.js +0 -39
- package/dist/restorer/engine/signing.js.map +0 -1
- package/dist/restorer/engine/state.d.ts +0 -42
- package/dist/restorer/engine/state.js +0 -87
- package/dist/restorer/engine/state.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.d.ts +0 -64
- package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +0 -104
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +0 -721
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +0 -97
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +0 -226
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +0 -44
- package/dist/restorer/impls/claude-mcp-prediction/index.js +0 -239
- package/dist/restorer/impls/claude-mcp-prediction/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js +0 -135
- package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/prompt.d.ts +0 -8
- package/dist/restorer/impls/claude-mcp-prediction/prompt.js +0 -54
- package/dist/restorer/impls/claude-mcp-prediction/prompt.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +0 -36
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +0 -137
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/types.d.ts +0 -84
- package/dist/restorer/impls/claude-mcp-prediction/types.js +0 -6
- package/dist/restorer/impls/claude-mcp-prediction/types.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.d.ts +0 -34
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js +0 -233
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js +0 -136
- package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.d.ts +0 -7
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js +0 -46
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +0 -27
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js +0 -128
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.d.ts +0 -64
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.js +0 -6
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.js.map +0 -1
- package/dist/restorer/impls/evaluation-context.d.ts +0 -16
- package/dist/restorer/impls/evaluation-context.js +0 -18
- package/dist/restorer/impls/evaluation-context.js.map +0 -1
- package/dist/restorer/impls/index.d.ts +0 -46
- package/dist/restorer/impls/index.js +0 -88
- package/dist/restorer/impls/index.js.map +0 -1
- package/dist/restorer/impls/legacy-claude/index.d.ts +0 -52
- package/dist/restorer/impls/legacy-claude/index.js +0 -140
- package/dist/restorer/impls/legacy-claude/index.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +0 -68
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js +0 -117
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.d.ts +0 -78
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js +0 -274
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +0 -23
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js +0 -49
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.d.ts +0 -25
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js +0 -44
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.d.ts +0 -17
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js +0 -43
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +0 -44
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js +0 -440
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/types.d.ts +0 -34
- package/dist/restorer/impls/portfolio-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +0 -40
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +0 -107
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/types.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +0 -6
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js +0 -11
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +0 -42
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +0 -208
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +0 -7
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js +0 -29
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +0 -31
- package/dist/restorer/impls/prediction-v0-baseline/index.js +0 -100
- package/dist/restorer/impls/prediction-v0-baseline/index.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/strategy.d.ts +0 -8
- package/dist/restorer/impls/prediction-v0-baseline/strategy.js +0 -41
- package/dist/restorer/impls/prediction-v0-baseline/strategy.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/types.d.ts +0 -7
- package/dist/restorer/impls/prediction-v0-baseline/types.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.d.ts +0 -20
- package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.d.ts +0 -9
- package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.d.ts +0 -3
- package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +0 -13
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js +0 -111
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.d.ts +0 -5
- package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +0 -36
- package/dist/restorer/impls/prediction-v0-evaluator/index.js +0 -234
- package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/types.d.ts +0 -194
- package/dist/restorer/types.js +0 -28
- package/dist/restorer/types.js.map +0 -1
- package/dist/types/desired-state.d.ts +0 -94
- package/dist/types/desired-state.js +0 -36
- package/dist/types/desired-state.js.map +0 -1
- /package/dist/cli/commands/{plugin-install.d.ts → solver-nets.d.ts} +0 -0
- /package/dist/cli/commands/{submit-intent.d.ts → tasks.d.ts} +0 -0
- /package/dist/{restorer/impls/prediction-apy-v0-baseline → harnesses/impls/claude-code-learner}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/api-wallet.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/mcp-tools.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/safety-rails.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/safety-rails.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-prediction/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-prediction-apy/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/checks/availability.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/checks/availability.js +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/strategy.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/strategy.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/types.d.ts +0 -0
- /package/dist/{restorer/impls/prediction-apy-v0-evaluator → harnesses/impls/prediction-apy-v0-baseline}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/types.d.ts +0 -0
- /package/dist/{restorer/impls/prediction-v0-baseline → harnesses/impls/prediction-apy-v0-evaluator}/types.js +0 -0
- /package/dist/{restorer/impls/prediction-v0-evaluator → harnesses/impls/prediction-v0-baseline}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/canonical-metrics.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/availability.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/eligibility.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/spec.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/types.d.ts +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var cu=e=>{throw TypeError(e)};var la=(e,t,r)=>t.has(e)||cu("Cannot "+r);var A=(e,t,r)=>(la(e,t,"read from private field"),r?r.call(e):t.get(e)),Z=(e,t,r)=>t.has(e)?cu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),V=(e,t,r,i)=>(la(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),te=(e,t,r)=>(la(e,t,"access private method"),r);var bn=(e,t,r,i)=>({set _(s){V(e,t,s,r)},get _(){return A(e,t,i)}});function gv(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const c=Object.getOwnPropertyDescriptor(i,s);c&&Object.defineProperty(e,s,c.get?c:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const g of c.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&i(g)}).observe(document,{childList:!0,subtree:!0});function r(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(s){if(s.ep)return;s.ep=!0;const c=r(s);fetch(s.href,c)}})();function mv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bh={exports:{}},No={},Ch={exports:{}},se={};/**
|
|
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 hn=Symbol.for("react.element"),_v=Symbol.for("react.portal"),yv=Symbol.for("react.fragment"),Sv=Symbol.for("react.strict_mode"),xv=Symbol.for("react.profiler"),wv=Symbol.for("react.provider"),bv=Symbol.for("react.context"),Cv=Symbol.for("react.forward_ref"),kv=Symbol.for("react.suspense"),Ev=Symbol.for("react.memo"),Rv=Symbol.for("react.lazy"),uu=Symbol.iterator;function jv(e){return e===null||typeof e!="object"?null:(e=uu&&e[uu]||e["@@iterator"],typeof e=="function"?e:null)}var kh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Eh=Object.assign,Rh={};function ss(e,t,r){this.props=e,this.context=t,this.refs=Rh,this.updater=r||kh}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 jh(){}jh.prototype=ss.prototype;function sc(e,t,r){this.props=e,this.context=t,this.refs=Rh,this.updater=r||kh}var nc=sc.prototype=new jh;nc.constructor=sc;Eh(nc,ss.prototype);nc.isPureReactComponent=!0;var du=Array.isArray,Dh=Object.prototype.hasOwnProperty,oc={current:null},Th={key:!0,ref:!0,__self:!0,__source:!0};function Lh(e,t,r){var i,s={},c=null,g=null;if(t!=null)for(i in t.ref!==void 0&&(g=t.ref),t.key!==void 0&&(c=""+t.key),t)Dh.call(t,i)&&!Th.hasOwnProperty(i)&&(s[i]=t[i]);var n=arguments.length-2;if(n===1)s.children=r;else if(1<n){for(var a=Array(n),f=0;f<n;f++)a[f]=arguments[f+2];s.children=a}if(e&&e.defaultProps)for(i in n=e.defaultProps,n)s[i]===void 0&&(s[i]=n[i]);return{$$typeof:hn,type:e,key:c,ref:g,props:s,_owner:oc.current}}function Dv(e,t){return{$$typeof:hn,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===hn}function Tv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var hu=/\/+/g;function ca(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Tv(""+e.key):t.toString(36)}function Yn(e,t,r,i,s){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var g=!1;if(e===null)g=!0;else switch(c){case"string":case"number":g=!0;break;case"object":switch(e.$$typeof){case hn:case _v:g=!0}}if(g)return g=e,s=s(g),e=i===""?"."+ca(g,0):i,du(s)?(r="",e!=null&&(r=e.replace(hu,"$&/")+"/"),Yn(s,t,r,"",function(f){return f})):s!=null&&(ac(s)&&(s=Dv(s,r+(!s.key||g&&g.key===s.key?"":(""+s.key).replace(hu,"$&/")+"/")+e)),t.push(s)),1;if(g=0,i=i===""?".":i+":",du(e))for(var n=0;n<e.length;n++){c=e[n];var a=i+ca(c,n);g+=Yn(c,t,r,a,s)}else if(a=jv(e),typeof a=="function")for(e=a.call(e),n=0;!(c=e.next()).done;)c=c.value,a=i+ca(c,n++),g+=Yn(c,t,r,a,s);else if(c==="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 Cn(e,t,r){if(e==null)return e;var i=[],s=0;return Yn(e,i,"","",function(c){return t.call(r,c,s++)}),i}function Lv(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 Ke={current:null},Zn={transition:null},Mv={ReactCurrentDispatcher:Ke,ReactCurrentBatchConfig:Zn,ReactCurrentOwner:oc};function Mh(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:Cn,forEach:function(e,t,r){Cn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Cn(e,function(){t++}),t},toArray:function(e){return Cn(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}};se.Component=ss;se.Fragment=yv;se.Profiler=xv;se.PureComponent=sc;se.StrictMode=Sv;se.Suspense=kv;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mv;se.act=Mh;se.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=Eh({},e.props),s=e.key,c=e.ref,g=e._owner;if(t!=null){if(t.ref!==void 0&&(c=t.ref,g=oc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(a in t)Dh.call(t,a)&&!Th.hasOwnProperty(a)&&(i[a]=t[a]===void 0&&n!==void 0?n[a]:t[a])}var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){n=Array(a);for(var f=0;f<a;f++)n[f]=arguments[f+2];i.children=n}return{$$typeof:hn,type:e.type,key:s,ref:c,props:i,_owner:g}};se.createContext=function(e){return e={$$typeof:bv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:wv,_context:e},e.Consumer=e};se.createElement=Lh;se.createFactory=function(e){var t=Lh.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:Cv,render:e}};se.isValidElement=ac;se.lazy=function(e){return{$$typeof:Rv,_payload:{_status:-1,_result:e},_init:Lv}};se.memo=function(e,t){return{$$typeof:Ev,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Zn.transition;Zn.transition={};try{e()}finally{Zn.transition=t}};se.unstable_act=Mh;se.useCallback=function(e,t){return Ke.current.useCallback(e,t)};se.useContext=function(e){return Ke.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Ke.current.useDeferredValue(e)};se.useEffect=function(e,t){return Ke.current.useEffect(e,t)};se.useId=function(){return Ke.current.useId()};se.useImperativeHandle=function(e,t,r){return Ke.current.useImperativeHandle(e,t,r)};se.useInsertionEffect=function(e,t){return Ke.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Ke.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Ke.current.useMemo(e,t)};se.useReducer=function(e,t,r){return Ke.current.useReducer(e,t,r)};se.useRef=function(e){return Ke.current.useRef(e)};se.useState=function(e){return Ke.current.useState(e)};se.useSyncExternalStore=function(e,t,r){return Ke.current.useSyncExternalStore(e,t,r)};se.useTransition=function(){return Ke.current.useTransition()};se.version="18.3.1";Ch.exports=se;var H=Ch.exports;const Ph=mv(H),Pv=gv({__proto__:null,default:Ph},[H]);/**
|
|
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 Bv=H,Av=Symbol.for("react.element"),Ov=Symbol.for("react.fragment"),Iv=Object.prototype.hasOwnProperty,Fv=Bv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nv={key:!0,ref:!0,__self:!0,__source:!0};function Bh(e,t,r){var i,s={},c=null,g=null;r!==void 0&&(c=""+r),t.key!==void 0&&(c=""+t.key),t.ref!==void 0&&(g=t.ref);for(i in t)Iv.call(t,i)&&!Nv.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:Av,type:e,key:c,ref:g,props:s,_owner:Fv.current}}No.Fragment=Ov;No.jsx=Bh;No.jsxs=Bh;bh.exports=No;var h=bh.exports,$a={},Ah={exports:{}},ct={},Oh={exports:{}},Ih={};/**
|
|
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(R,L){var M=R.length;R.push(L);e:for(;0<M;){var O=M-1>>>1,z=R[O];if(0<s(z,L))R[O]=L,R[M]=z,M=O;else break e}}function r(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var L=R[0],M=R.pop();if(M!==L){R[0]=M;e:for(var O=0,z=R.length,q=z>>>1;O<q;){var Y=2*(O+1)-1,X=R[Y],le=Y+1,j=R[le];if(0>s(X,M))le<z&&0>s(j,X)?(R[O]=j,R[le]=M,O=le):(R[O]=X,R[Y]=M,O=Y);else if(le<z&&0>s(j,M))R[O]=j,R[le]=M,O=le;else break e}}return L}function s(R,L){var M=R.sortIndex-L.sortIndex;return M!==0?M:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var g=Date,n=g.now();e.unstable_now=function(){return g.now()-n}}var a=[],f=[],_=1,p=null,m=3,S=!1,b=!1,w=!1,u=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(R){for(var L=r(f);L!==null;){if(L.callback===null)i(f);else if(L.startTime<=R)i(f),L.sortIndex=L.expirationTime,t(a,L);else break;L=r(f)}}function v(R){if(w=!1,d(R),!b)if(r(a)!==null)b=!0,$(y);else{var L=r(f);L!==null&&U(v,L.startTime-R)}}function y(R,L){b=!1,w&&(w=!1,l(x),x=-1),S=!0;var M=m;try{for(d(L),p=r(a);p!==null&&(!(p.expirationTime>L)||R&&!B());){var O=p.callback;if(typeof O=="function"){p.callback=null,m=p.priorityLevel;var z=O(p.expirationTime<=L);L=e.unstable_now(),typeof z=="function"?p.callback=z:p===r(a)&&i(a),d(L)}else i(a);p=r(a)}if(p!==null)var q=!0;else{var Y=r(f);Y!==null&&U(v,Y.startTime-L),q=!1}return q}finally{p=null,m=M,S=!1}}var C=!1,k=null,x=-1,E=5,T=-1;function B(){return!(e.unstable_now()-T<E)}function D(){if(k!==null){var R=e.unstable_now();T=R;var L=!0;try{L=k(!0,R)}finally{L?P():(C=!1,k=null)}}else C=!1}var P;if(typeof o=="function")P=function(){o(D)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,N=F.port2;F.port1.onmessage=D,P=function(){N.postMessage(null)}}else P=function(){u(D,0)};function $(R){k=R,C||(C=!0,P())}function U(R,L){x=u(function(){R(e.unstable_now())},L)}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(R){R.callback=null},e.unstable_continueExecution=function(){b||S||(b=!0,$(y))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(R){switch(m){case 1:case 2:case 3:var L=3;break;default:L=m}var M=m;m=L;try{return R()}finally{m=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var M=m;m=R;try{return L()}finally{m=M}},e.unstable_scheduleCallback=function(R,L,M){var O=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?O+M:O):M=O,R){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=M+z,R={id:_++,callback:L,priorityLevel:R,startTime:M,expirationTime:z,sortIndex:-1},M>O?(R.sortIndex=M,t(f,R),r(a)===null&&R===r(f)&&(w?(l(x),x=-1):w=!0,U(v,M-O))):(R.sortIndex=z,t(a,R),b||S||(b=!0,$(y))),R},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(R){var L=m;return function(){var M=m;m=L;try{return R.apply(this,arguments)}finally{m=M}}}})(Ih);Oh.exports=Ih;var Hv=Oh.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 zv=H,lt=Hv;function J(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 Fh=new Set,zs={};function ai(e,t){Qi(e,t),Qi(e+"Capture",t)}function Qi(e,t){for(zs[e]=t,e=0;e<t.length;e++)Fh.add(t[e])}var Gt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ua=Object.prototype.hasOwnProperty,Wv=/^[: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]*$/,fu={},pu={};function $v(e){return Ua.call(pu,e)?!0:Ua.call(fu,e)?!1:Wv.test(e)?pu[e]=!0:(fu[e]=!0,!1)}function Uv(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kv(e,t,r,i){if(t===null||typeof t>"u"||Uv(e,t,r,i))return!0;if(i)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 Je(e,t,r,i,s,c,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=g}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Je(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 Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Je(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 Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var lc=/[\-:]([a-z])/g;function cc(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(lc,cc);Ae[t]=new Je(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(lc,cc);Ae[t]=new Je(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(lc,cc);Ae[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function uc(e,t,r,i){var s=Ae.hasOwnProperty(t)?Ae[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kv(t,r,s,i)&&(r=null),i||s===null?$v(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,i=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var er=zv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,kn=Symbol.for("react.element"),_i=Symbol.for("react.portal"),yi=Symbol.for("react.fragment"),dc=Symbol.for("react.strict_mode"),Ka=Symbol.for("react.profiler"),Nh=Symbol.for("react.provider"),Hh=Symbol.for("react.context"),hc=Symbol.for("react.forward_ref"),Ja=Symbol.for("react.suspense"),qa=Symbol.for("react.suspense_list"),fc=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),zh=Symbol.for("react.offscreen"),vu=Symbol.iterator;function fs(e){return e===null||typeof e!="object"?null:(e=vu&&e[vu]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,ua;function Rs(e){if(ua===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ua=t&&t[1]||""}return`
|
|
34
|
+
`+ua+e}var da=!1;function ha(e,t){if(!e||da)return"";da=!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 i=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){i=f}e.call(t.prototype)}else{try{throw Error()}catch(f){i=f}e()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var s=f.stack.split(`
|
|
35
|
+
`),c=i.stack.split(`
|
|
36
|
+
`),g=s.length-1,n=c.length-1;1<=g&&0<=n&&s[g]!==c[n];)n--;for(;1<=g&&0<=n;g--,n--)if(s[g]!==c[n]){if(g!==1||n!==1)do if(g--,n--,0>n||s[g]!==c[n]){var a=`
|
|
37
|
+
`+s[g].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=g&&0<=n);break}}}finally{da=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Rs(e):""}function Jv(e){switch(e.tag){case 5:return Rs(e.type);case 16:return Rs("Lazy");case 13:return Rs("Suspense");case 19:return Rs("SuspenseList");case 0:case 2:case 15:return e=ha(e.type,!1),e;case 11:return e=ha(e.type.render,!1),e;case 1:return e=ha(e.type,!0),e;default:return""}}function Va(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 yi:return"Fragment";case _i:return"Portal";case Ka:return"Profiler";case dc:return"StrictMode";case Ja:return"Suspense";case qa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hh:return(e.displayName||"Context")+".Consumer";case Nh:return(e._context.displayName||"Context")+".Provider";case hc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fc:return t=e.displayName||null,t!==null?t:Va(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return Va(e(t))}catch{}}return null}function qv(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 Va(t);case 8:return t===dc?"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 Dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vv(e){var t=Wh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(g){i=""+g,c.call(this,g)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function En(e){e._valueTracker||(e._valueTracker=Vv(e))}function $h(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Wh(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ho(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 Qa(e,t){var r=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function gu(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Dr(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Uh(e,t){t=t.checked,t!=null&&uc(e,"checked",t,!1)}function Ga(e,t){Uh(e,t);var r=Dr(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xa(e,t.type,r):t.hasOwnProperty("defaultValue")&&Xa(e,t.type,Dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mu(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="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 Xa(e,t,r){(t!=="number"||ho(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var js=Array.isArray;function Ti(e,t,r,i){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Dr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ya(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _u(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(J(92));if(js(r)){if(1<r.length)throw Error(J(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Dr(r)}}function Kh(e,t){var r=Dr(t.value),i=Dr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function yu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jh(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 Za(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Rn,qh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Rn=Rn||document.createElement("div"),Rn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Rn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ws(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ms={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},Qv=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(e){Qv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ms[t]=Ms[e]})});function Vh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ms.hasOwnProperty(e)&&Ms[e]?(""+t).trim():t+"px"}function Qh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=Vh(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var Gv=Se({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 el(e,t){if(t){if(Gv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function tl(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 rl=null;function pc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var il=null,Li=null,Mi=null;function Su(e){if(e=vn(e)){if(typeof il!="function")throw Error(J(280));var t=e.stateNode;t&&(t=Uo(t),il(e.stateNode,e.type,t))}}function Gh(e){Li?Mi?Mi.push(e):Mi=[e]:Li=e}function Xh(){if(Li){var e=Li,t=Mi;if(Mi=Li=null,Su(e),t)for(e=0;e<t.length;e++)Su(t[e])}}function Yh(e,t){return e(t)}function Zh(){}var fa=!1;function ef(e,t,r){if(fa)return e(t,r);fa=!0;try{return Yh(e,t,r)}finally{fa=!1,(Li!==null||Mi!==null)&&(Zh(),Xh())}}function $s(e,t){var r=e.stateNode;if(r===null)return null;var i=Uo(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(J(231,t,typeof r));return r}var sl=!1;if(Gt)try{var ps={};Object.defineProperty(ps,"passive",{get:function(){sl=!0}}),window.addEventListener("test",ps,ps),window.removeEventListener("test",ps,ps)}catch{sl=!1}function Xv(e,t,r,i,s,c,g,n,a){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(_){this.onError(_)}}var Ps=!1,fo=null,po=!1,nl=null,Yv={onError:function(e){Ps=!0,fo=e}};function Zv(e,t,r,i,s,c,g,n,a){Ps=!1,fo=null,Xv.apply(Yv,arguments)}function eg(e,t,r,i,s,c,g,n,a){if(Zv.apply(this,arguments),Ps){if(Ps){var f=fo;Ps=!1,fo=null}else throw Error(J(198));po||(po=!0,nl=f)}}function li(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 tf(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 xu(e){if(li(e)!==e)throw Error(J(188))}function tg(e){var t=e.alternate;if(!t){if(t=li(e),t===null)throw Error(J(188));return t!==e?null:e}for(var r=e,i=t;;){var s=r.return;if(s===null)break;var c=s.alternate;if(c===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===r)return xu(s),e;if(c===i)return xu(s),t;c=c.sibling}throw Error(J(188))}if(r.return!==i.return)r=s,i=c;else{for(var g=!1,n=s.child;n;){if(n===r){g=!0,r=s,i=c;break}if(n===i){g=!0,i=s,r=c;break}n=n.sibling}if(!g){for(n=c.child;n;){if(n===r){g=!0,r=c,i=s;break}if(n===i){g=!0,i=c,r=s;break}n=n.sibling}if(!g)throw Error(J(189))}}if(r.alternate!==i)throw Error(J(190))}if(r.tag!==3)throw Error(J(188));return r.stateNode.current===r?e:t}function rf(e){return e=tg(e),e!==null?sf(e):null}function sf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sf(e);if(t!==null)return t;e=e.sibling}return null}var nf=lt.unstable_scheduleCallback,wu=lt.unstable_cancelCallback,rg=lt.unstable_shouldYield,ig=lt.unstable_requestPaint,Ce=lt.unstable_now,sg=lt.unstable_getCurrentPriorityLevel,vc=lt.unstable_ImmediatePriority,of=lt.unstable_UserBlockingPriority,vo=lt.unstable_NormalPriority,ng=lt.unstable_LowPriority,af=lt.unstable_IdlePriority,Ho=null,It=null;function og(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(Ho,e,void 0,(e.current.flags&128)===128)}catch{}}var kt=Math.clz32?Math.clz32:cg,ag=Math.log,lg=Math.LN2;function cg(e){return e>>>=0,e===0?32:31-(ag(e)/lg|0)|0}var jn=64,Dn=4194304;function Ds(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 go(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,c=e.pingedLanes,g=r&268435455;if(g!==0){var n=g&~s;n!==0?i=Ds(n):(c&=g,c!==0&&(i=Ds(c)))}else g=r&~s,g!==0?i=Ds(g):c!==0&&(i=Ds(c));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,c=t&-t,s>=c||s===16&&(c&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-kt(t),s=1<<r,i|=e[r],t&=~s;return i}function ug(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 dg(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes;0<c;){var g=31-kt(c),n=1<<g,a=s[g];a===-1?(!(n&r)||n&i)&&(s[g]=ug(n,t)):a<=t&&(e.expiredLanes|=n),c&=~n}}function ol(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function lf(){var e=jn;return jn<<=1,!(jn&4194240)&&(jn=64),e}function pa(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function fn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=r}function hg(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 i=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-kt(r),c=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~c}}function gc(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-kt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var de=0;function cf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var uf,mc,df,hf,ff,al=!1,Tn=[],Sr=null,xr=null,wr=null,Us=new Map,Ks=new Map,ar=[],fg="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 bu(e,t){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":wr=null;break;case"pointerover":case"pointerout":Us.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function vs(e,t,r,i,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:c,targetContainers:[s]},t!==null&&(t=vn(t),t!==null&&mc(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function pg(e,t,r,i,s){switch(t){case"focusin":return Sr=vs(Sr,e,t,r,i,s),!0;case"dragenter":return xr=vs(xr,e,t,r,i,s),!0;case"mouseover":return wr=vs(wr,e,t,r,i,s),!0;case"pointerover":var c=s.pointerId;return Us.set(c,vs(Us.get(c)||null,e,t,r,i,s)),!0;case"gotpointercapture":return c=s.pointerId,Ks.set(c,vs(Ks.get(c)||null,e,t,r,i,s)),!0}return!1}function pf(e){var t=Nr(e.target);if(t!==null){var r=li(t);if(r!==null){if(t=r.tag,t===13){if(t=tf(r),t!==null){e.blockedOn=t,ff(e.priority,function(){df(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 eo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ll(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);rl=i,r.target.dispatchEvent(i),rl=null}else return t=vn(r),t!==null&&mc(t),e.blockedOn=r,!1;t.shift()}return!0}function Cu(e,t,r){eo(e)&&r.delete(t)}function vg(){al=!1,Sr!==null&&eo(Sr)&&(Sr=null),xr!==null&&eo(xr)&&(xr=null),wr!==null&&eo(wr)&&(wr=null),Us.forEach(Cu),Ks.forEach(Cu)}function gs(e,t){e.blockedOn===t&&(e.blockedOn=null,al||(al=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,vg)))}function Js(e){function t(s){return gs(s,e)}if(0<Tn.length){gs(Tn[0],e);for(var r=1;r<Tn.length;r++){var i=Tn[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Sr!==null&&gs(Sr,e),xr!==null&&gs(xr,e),wr!==null&&gs(wr,e),Us.forEach(t),Ks.forEach(t),r=0;r<ar.length;r++)i=ar[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<ar.length&&(r=ar[0],r.blockedOn===null);)pf(r),r.blockedOn===null&&ar.shift()}var Pi=er.ReactCurrentBatchConfig,mo=!0;function gg(e,t,r,i){var s=de,c=Pi.transition;Pi.transition=null;try{de=1,_c(e,t,r,i)}finally{de=s,Pi.transition=c}}function mg(e,t,r,i){var s=de,c=Pi.transition;Pi.transition=null;try{de=4,_c(e,t,r,i)}finally{de=s,Pi.transition=c}}function _c(e,t,r,i){if(mo){var s=ll(e,t,r,i);if(s===null)Ca(e,t,i,_o,r),bu(e,i);else if(pg(s,e,t,r,i))i.stopPropagation();else if(bu(e,i),t&4&&-1<fg.indexOf(e)){for(;s!==null;){var c=vn(s);if(c!==null&&uf(c),c=ll(e,t,r,i),c===null&&Ca(e,t,i,_o,r),c===s)break;s=c}s!==null&&i.stopPropagation()}else Ca(e,t,i,null,r)}}var _o=null;function ll(e,t,r,i){if(_o=null,e=pc(i),e=Nr(e),e!==null)if(t=li(e),t===null)e=null;else if(r=t.tag,r===13){if(e=tf(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 _o=e,null}function vf(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(sg()){case vc:return 1;case of:return 4;case vo:case ng:return 16;case af:return 536870912;default:return 16}default:return 16}}var _r=null,yc=null,to=null;function gf(){if(to)return to;var e,t=yc,r=t.length,i,s="value"in _r?_r.value:_r.textContent,c=s.length;for(e=0;e<r&&t[e]===s[e];e++);var g=r-e;for(i=1;i<=g&&t[r-i]===s[c-i];i++);return to=s.slice(e,1<i?1-i:void 0)}function ro(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 Ln(){return!0}function ku(){return!1}function ut(e){function t(r,i,s,c,g){this._reactName=r,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=g,this.currentTarget=null;for(var n in e)e.hasOwnProperty(n)&&(r=e[n],this[n]=r?r(c):c[n]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ln:ku,this.isPropagationStopped=ku,this}return Se(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=Ln)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sc=ut(ns),pn=Se({},ns,{view:0,detail:0}),_g=ut(pn),va,ga,ms,zo=Se({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xc,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!==ms&&(ms&&e.type==="mousemove"?(va=e.screenX-ms.screenX,ga=e.screenY-ms.screenY):ga=va=0,ms=e),va)},movementY:function(e){return"movementY"in e?e.movementY:ga}}),Eu=ut(zo),yg=Se({},zo,{dataTransfer:0}),Sg=ut(yg),xg=Se({},pn,{relatedTarget:0}),ma=ut(xg),wg=Se({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),bg=ut(wg),Cg=Se({},ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kg=ut(Cg),Eg=Se({},ns,{data:0}),Ru=ut(Eg),Rg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jg={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"},Dg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dg[e])?!!t[e]:!1}function xc(){return Tg}var Lg=Se({},pn,{key:function(e){if(e.key){var t=Rg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ro(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xc,charCode:function(e){return e.type==="keypress"?ro(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ro(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mg=ut(Lg),Pg=Se({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ju=ut(Pg),Bg=Se({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xc}),Ag=ut(Bg),Og=Se({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ig=ut(Og),Fg=Se({},zo,{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}),Ng=ut(Fg),Hg=[9,13,27,32],wc=Gt&&"CompositionEvent"in window,Bs=null;Gt&&"documentMode"in document&&(Bs=document.documentMode);var zg=Gt&&"TextEvent"in window&&!Bs,mf=Gt&&(!wc||Bs&&8<Bs&&11>=Bs),Du=" ",Tu=!1;function _f(e,t){switch(e){case"keyup":return Hg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Si=!1;function Wg(e,t){switch(e){case"compositionend":return yf(t);case"keypress":return t.which!==32?null:(Tu=!0,Du);case"textInput":return e=t.data,e===Du&&Tu?null:e;default:return null}}function $g(e,t){if(Si)return e==="compositionend"||!wc&&_f(e,t)?(e=gf(),to=yc=_r=null,Si=!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 mf&&t.locale!=="ko"?null:t.data;default:return null}}var Ug={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 Lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ug[e.type]:t==="textarea"}function Sf(e,t,r,i){Gh(i),t=yo(t,"onChange"),0<t.length&&(r=new Sc("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var As=null,qs=null;function Kg(e){Lf(e,0)}function Wo(e){var t=bi(e);if($h(t))return e}function Jg(e,t){if(e==="change")return t}var xf=!1;if(Gt){var _a;if(Gt){var ya="oninput"in document;if(!ya){var Mu=document.createElement("div");Mu.setAttribute("oninput","return;"),ya=typeof Mu.oninput=="function"}_a=ya}else _a=!1;xf=_a&&(!document.documentMode||9<document.documentMode)}function Pu(){As&&(As.detachEvent("onpropertychange",wf),qs=As=null)}function wf(e){if(e.propertyName==="value"&&Wo(qs)){var t=[];Sf(t,qs,e,pc(e)),ef(Kg,t)}}function qg(e,t,r){e==="focusin"?(Pu(),As=t,qs=r,As.attachEvent("onpropertychange",wf)):e==="focusout"&&Pu()}function Vg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wo(qs)}function Qg(e,t){if(e==="click")return Wo(t)}function Gg(e,t){if(e==="input"||e==="change")return Wo(t)}function Xg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rt=typeof Object.is=="function"?Object.is:Xg;function Vs(e,t){if(Rt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var s=r[i];if(!Ua.call(t,s)||!Rt(e[s],t[s]))return!1}return!0}function Bu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Au(e,t){var r=Bu(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Bu(r)}}function bf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cf(){for(var e=window,t=ho();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ho(e.document)}return t}function bc(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 Yg(e){var t=Cf(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&bf(r.ownerDocument.documentElement,r)){if(i!==null&&bc(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,c=Math.min(i.start,s);i=i.end===void 0?c:Math.min(i.end,s),!e.extend&&c>i&&(s=i,i=c,c=s),s=Au(r,c);var g=Au(r,i);s&&g&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),c>i?(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 Zg=Gt&&"documentMode"in document&&11>=document.documentMode,xi=null,cl=null,Os=null,ul=!1;function Ou(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ul||xi==null||xi!==ho(i)||(i=xi,"selectionStart"in i&&bc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Os&&Vs(Os,i)||(Os=i,i=yo(cl,"onSelect"),0<i.length&&(t=new Sc("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=xi)))}function Mn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var wi={animationend:Mn("Animation","AnimationEnd"),animationiteration:Mn("Animation","AnimationIteration"),animationstart:Mn("Animation","AnimationStart"),transitionend:Mn("Transition","TransitionEnd")},Sa={},kf={};Gt&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete wi.animationend.animation,delete wi.animationiteration.animation,delete wi.animationstart.animation),"TransitionEvent"in window||delete wi.transitionend.transition);function $o(e){if(Sa[e])return Sa[e];if(!wi[e])return e;var t=wi[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in kf)return Sa[e]=t[r];return e}var Ef=$o("animationend"),Rf=$o("animationiteration"),jf=$o("animationstart"),Df=$o("transitionend"),Tf=new Map,Iu="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 Lr(e,t){Tf.set(e,t),ai(t,[e])}for(var xa=0;xa<Iu.length;xa++){var wa=Iu[xa],em=wa.toLowerCase(),tm=wa[0].toUpperCase()+wa.slice(1);Lr(em,"on"+tm)}Lr(Ef,"onAnimationEnd");Lr(Rf,"onAnimationIteration");Lr(jf,"onAnimationStart");Lr("dblclick","onDoubleClick");Lr("focusin","onFocus");Lr("focusout","onBlur");Lr(Df,"onTransitionEnd");Qi("onMouseEnter",["mouseout","mouseover"]);Qi("onMouseLeave",["mouseout","mouseover"]);Qi("onPointerEnter",["pointerout","pointerover"]);Qi("onPointerLeave",["pointerout","pointerover"]);ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ai("onBeforeInput",["compositionend","keypress","textInput","paste"]);ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ts="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(" "),rm=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ts));function Fu(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,eg(i,t,void 0,e),e.currentTarget=null}function Lf(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],s=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var g=i.length-1;0<=g;g--){var n=i[g],a=n.instance,f=n.currentTarget;if(n=n.listener,a!==c&&s.isPropagationStopped())break e;Fu(s,n,f),c=a}else for(g=0;g<i.length;g++){if(n=i[g],a=n.instance,f=n.currentTarget,n=n.listener,a!==c&&s.isPropagationStopped())break e;Fu(s,n,f),c=a}}}if(po)throw e=nl,po=!1,nl=null,e}function pe(e,t){var r=t[vl];r===void 0&&(r=t[vl]=new Set);var i=e+"__bubble";r.has(i)||(Mf(t,e,2,!1),r.add(i))}function ba(e,t,r){var i=0;t&&(i|=4),Mf(r,e,i,t)}var Pn="_reactListening"+Math.random().toString(36).slice(2);function Qs(e){if(!e[Pn]){e[Pn]=!0,Fh.forEach(function(r){r!=="selectionchange"&&(rm.has(r)||ba(r,!1,e),ba(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pn]||(t[Pn]=!0,ba("selectionchange",!1,t))}}function Mf(e,t,r,i){switch(vf(t)){case 1:var s=gg;break;case 4:s=mg;break;default:s=_c}r=s.bind(null,t,r,e),s=void 0,!sl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Ca(e,t,r,i,s){var c=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var g=i.tag;if(g===3||g===4){var n=i.stateNode.containerInfo;if(n===s||n.nodeType===8&&n.parentNode===s)break;if(g===4)for(g=i.return;g!==null;){var a=g.tag;if((a===3||a===4)&&(a=g.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;g=g.return}for(;n!==null;){if(g=Nr(n),g===null)return;if(a=g.tag,a===5||a===6){i=c=g;continue e}n=n.parentNode}}i=i.return}ef(function(){var f=c,_=pc(r),p=[];e:{var m=Tf.get(e);if(m!==void 0){var S=Sc,b=e;switch(e){case"keypress":if(ro(r)===0)break e;case"keydown":case"keyup":S=Mg;break;case"focusin":b="focus",S=ma;break;case"focusout":b="blur",S=ma;break;case"beforeblur":case"afterblur":S=ma;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":S=Eu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Sg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Ag;break;case Ef:case Rf:case jf:S=bg;break;case Df:S=Ig;break;case"scroll":S=_g;break;case"wheel":S=Ng;break;case"copy":case"cut":case"paste":S=kg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=ju}var w=(t&4)!==0,u=!w&&e==="scroll",l=w?m!==null?m+"Capture":null:m;w=[];for(var o=f,d;o!==null;){d=o;var v=d.stateNode;if(d.tag===5&&v!==null&&(d=v,l!==null&&(v=$s(o,l),v!=null&&w.push(Gs(o,v,d)))),u)break;o=o.return}0<w.length&&(m=new S(m,b,null,r,_),p.push({event:m,listeners:w}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",m&&r!==rl&&(b=r.relatedTarget||r.fromElement)&&(Nr(b)||b[Xt]))break e;if((S||m)&&(m=_.window===_?_:(m=_.ownerDocument)?m.defaultView||m.parentWindow:window,S?(b=r.relatedTarget||r.toElement,S=f,b=b?Nr(b):null,b!==null&&(u=li(b),b!==u||b.tag!==5&&b.tag!==6)&&(b=null)):(S=null,b=f),S!==b)){if(w=Eu,v="onMouseLeave",l="onMouseEnter",o="mouse",(e==="pointerout"||e==="pointerover")&&(w=ju,v="onPointerLeave",l="onPointerEnter",o="pointer"),u=S==null?m:bi(S),d=b==null?m:bi(b),m=new w(v,o+"leave",S,r,_),m.target=u,m.relatedTarget=d,v=null,Nr(_)===f&&(w=new w(l,o+"enter",b,r,_),w.target=d,w.relatedTarget=u,v=w),u=v,S&&b)t:{for(w=S,l=b,o=0,d=w;d;d=ui(d))o++;for(d=0,v=l;v;v=ui(v))d++;for(;0<o-d;)w=ui(w),o--;for(;0<d-o;)l=ui(l),d--;for(;o--;){if(w===l||l!==null&&w===l.alternate)break t;w=ui(w),l=ui(l)}w=null}else w=null;S!==null&&Nu(p,m,S,w,!1),b!==null&&u!==null&&Nu(p,u,b,w,!0)}}e:{if(m=f?bi(f):window,S=m.nodeName&&m.nodeName.toLowerCase(),S==="select"||S==="input"&&m.type==="file")var y=Jg;else if(Lu(m))if(xf)y=Gg;else{y=Vg;var C=qg}else(S=m.nodeName)&&S.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(y=Qg);if(y&&(y=y(e,f))){Sf(p,y,r,_);break e}C&&C(e,m,f),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&Xa(m,"number",m.value)}switch(C=f?bi(f):window,e){case"focusin":(Lu(C)||C.contentEditable==="true")&&(xi=C,cl=f,Os=null);break;case"focusout":Os=cl=xi=null;break;case"mousedown":ul=!0;break;case"contextmenu":case"mouseup":case"dragend":ul=!1,Ou(p,r,_);break;case"selectionchange":if(Zg)break;case"keydown":case"keyup":Ou(p,r,_)}var k;if(wc)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Si?_f(e,r)&&(x="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(x="onCompositionStart");x&&(mf&&r.locale!=="ko"&&(Si||x!=="onCompositionStart"?x==="onCompositionEnd"&&Si&&(k=gf()):(_r=_,yc="value"in _r?_r.value:_r.textContent,Si=!0)),C=yo(f,x),0<C.length&&(x=new Ru(x,e,null,r,_),p.push({event:x,listeners:C}),k?x.data=k:(k=yf(r),k!==null&&(x.data=k)))),(k=zg?Wg(e,r):$g(e,r))&&(f=yo(f,"onBeforeInput"),0<f.length&&(_=new Ru("onBeforeInput","beforeinput",null,r,_),p.push({event:_,listeners:f}),_.data=k))}Lf(p,t)})}function Gs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function yo(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,c=s.stateNode;s.tag===5&&c!==null&&(s=c,c=$s(e,r),c!=null&&i.unshift(Gs(e,c,s)),c=$s(e,t),c!=null&&i.push(Gs(e,c,s))),e=e.return}return i}function ui(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Nu(e,t,r,i,s){for(var c=t._reactName,g=[];r!==null&&r!==i;){var n=r,a=n.alternate,f=n.stateNode;if(a!==null&&a===i)break;n.tag===5&&f!==null&&(n=f,s?(a=$s(r,c),a!=null&&g.unshift(Gs(r,a,n))):s||(a=$s(r,c),a!=null&&g.push(Gs(r,a,n)))),r=r.return}g.length!==0&&e.push({event:t,listeners:g})}var im=/\r\n?/g,sm=/\u0000|\uFFFD/g;function Hu(e){return(typeof e=="string"?e:""+e).replace(im,`
|
|
38
|
+
`).replace(sm,"")}function Bn(e,t,r){if(t=Hu(t),Hu(e)!==t&&r)throw Error(J(425))}function So(){}var dl=null,hl=null;function fl(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 pl=typeof setTimeout=="function"?setTimeout:void 0,nm=typeof clearTimeout=="function"?clearTimeout:void 0,zu=typeof Promise=="function"?Promise:void 0,om=typeof queueMicrotask=="function"?queueMicrotask:typeof zu<"u"?function(e){return zu.resolve(null).then(e).catch(am)}:pl;function am(e){setTimeout(function(){throw e})}function ka(e,t){var r=t,i=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(i===0){e.removeChild(s),Js(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);Js(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 Wu(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 os=Math.random().toString(36).slice(2),Ot="__reactFiber$"+os,Xs="__reactProps$"+os,Xt="__reactContainer$"+os,vl="__reactEvents$"+os,lm="__reactListeners$"+os,cm="__reactHandles$"+os;function Nr(e){var t=e[Ot];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xt]||r[Ot]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Wu(e);e!==null;){if(r=e[Ot])return r;e=Wu(e)}return t}e=r,r=e.parentNode}return null}function vn(e){return e=e[Ot]||e[Xt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function bi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function Uo(e){return e[Xs]||null}var gl=[],Ci=-1;function Mr(e){return{current:e}}function ve(e){0>Ci||(e.current=gl[Ci],gl[Ci]=null,Ci--)}function fe(e,t){Ci++,gl[Ci]=e.current,e.current=t}var Tr={},He=Mr(Tr),et=Mr(!1),ti=Tr;function Gi(e,t){var r=e.type.contextTypes;if(!r)return Tr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},c;for(c in r)s[c]=t[c];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function tt(e){return e=e.childContextTypes,e!=null}function xo(){ve(et),ve(He)}function $u(e,t,r){if(He.current!==Tr)throw Error(J(168));fe(He,t),fe(et,r)}function Pf(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(J(108,qv(e)||"Unknown",s));return Se({},r,i)}function wo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tr,ti=He.current,fe(He,e),fe(et,et.current),!0}function Uu(e,t,r){var i=e.stateNode;if(!i)throw Error(J(169));r?(e=Pf(e,t,ti),i.__reactInternalMemoizedMergedChildContext=e,ve(et),ve(He),fe(He,e)):ve(et),fe(et,r)}var zt=null,Ko=!1,Ea=!1;function Bf(e){zt===null?zt=[e]:zt.push(e)}function um(e){Ko=!0,Bf(e)}function Pr(){if(!Ea&&zt!==null){Ea=!0;var e=0,t=de;try{var r=zt;for(de=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}zt=null,Ko=!1}catch(s){throw zt!==null&&(zt=zt.slice(e+1)),nf(vc,Pr),s}finally{de=t,Ea=!1}}return null}var ki=[],Ei=0,bo=null,Co=0,pt=[],vt=0,ri=null,Jt=1,qt="";function Or(e,t){ki[Ei++]=Co,ki[Ei++]=bo,bo=e,Co=t}function Af(e,t,r){pt[vt++]=Jt,pt[vt++]=qt,pt[vt++]=ri,ri=e;var i=Jt;e=qt;var s=32-kt(i)-1;i&=~(1<<s),r+=1;var c=32-kt(t)+s;if(30<c){var g=s-s%5;c=(i&(1<<g)-1).toString(32),i>>=g,s-=g,Jt=1<<32-kt(t)+s|r<<s|i,qt=c+e}else Jt=1<<c|r<<s|i,qt=e}function Cc(e){e.return!==null&&(Or(e,1),Af(e,1,0))}function kc(e){for(;e===bo;)bo=ki[--Ei],ki[Ei]=null,Co=ki[--Ei],ki[Ei]=null;for(;e===ri;)ri=pt[--vt],pt[vt]=null,qt=pt[--vt],pt[vt]=null,Jt=pt[--vt],pt[vt]=null}var at=null,ot=null,ge=!1,Ct=null;function Of(e,t){var r=gt(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 Ku(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,at=e,ot=br(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ri!==null?{id:Jt,overflow:qt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=gt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,at=e,ot=null,!0):!1;default:return!1}}function ml(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _l(e){if(ge){var t=ot;if(t){var r=t;if(!Ku(e,t)){if(ml(e))throw Error(J(418));t=br(r.nextSibling);var i=at;t&&Ku(e,t)?Of(i,r):(e.flags=e.flags&-4097|2,ge=!1,at=e)}}else{if(ml(e))throw Error(J(418));e.flags=e.flags&-4097|2,ge=!1,at=e}}}function Ju(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function An(e){if(e!==at)return!1;if(!ge)return Ju(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fl(e.type,e.memoizedProps)),t&&(t=ot)){if(ml(e))throw If(),Error(J(418));for(;t;)Of(e,t),t=br(t.nextSibling)}if(Ju(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ot=br(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ot=null}}else ot=at?br(e.stateNode.nextSibling):null;return!0}function If(){for(var e=ot;e;)e=br(e.nextSibling)}function Xi(){ot=at=null,ge=!1}function Ec(e){Ct===null?Ct=[e]:Ct.push(e)}var dm=er.ReactCurrentBatchConfig;function _s(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(J(309));var i=r.stateNode}if(!i)throw Error(J(147,e));var s=i,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(g){var n=s.refs;g===null?delete n[c]:n[c]=g},t._stringRef=c,t)}if(typeof e!="string")throw Error(J(284));if(!r._owner)throw Error(J(290,e))}return e}function On(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function qu(e){var t=e._init;return t(e._payload)}function Ff(e){function t(l,o){if(e){var d=l.deletions;d===null?(l.deletions=[o],l.flags|=16):d.push(o)}}function r(l,o){if(!e)return null;for(;o!==null;)t(l,o),o=o.sibling;return null}function i(l,o){for(l=new Map;o!==null;)o.key!==null?l.set(o.key,o):l.set(o.index,o),o=o.sibling;return l}function s(l,o){return l=Rr(l,o),l.index=0,l.sibling=null,l}function c(l,o,d){return l.index=d,e?(d=l.alternate,d!==null?(d=d.index,d<o?(l.flags|=2,o):d):(l.flags|=2,o)):(l.flags|=1048576,o)}function g(l){return e&&l.alternate===null&&(l.flags|=2),l}function n(l,o,d,v){return o===null||o.tag!==6?(o=Pa(d,l.mode,v),o.return=l,o):(o=s(o,d),o.return=l,o)}function a(l,o,d,v){var y=d.type;return y===yi?_(l,o,d.props.children,v,d.key):o!==null&&(o.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===nr&&qu(y)===o.type)?(v=s(o,d.props),v.ref=_s(l,o,d),v.return=l,v):(v=co(d.type,d.key,d.props,null,l.mode,v),v.ref=_s(l,o,d),v.return=l,v)}function f(l,o,d,v){return o===null||o.tag!==4||o.stateNode.containerInfo!==d.containerInfo||o.stateNode.implementation!==d.implementation?(o=Ba(d,l.mode,v),o.return=l,o):(o=s(o,d.children||[]),o.return=l,o)}function _(l,o,d,v,y){return o===null||o.tag!==7?(o=ei(d,l.mode,v,y),o.return=l,o):(o=s(o,d),o.return=l,o)}function p(l,o,d){if(typeof o=="string"&&o!==""||typeof o=="number")return o=Pa(""+o,l.mode,d),o.return=l,o;if(typeof o=="object"&&o!==null){switch(o.$$typeof){case kn:return d=co(o.type,o.key,o.props,null,l.mode,d),d.ref=_s(l,null,o),d.return=l,d;case _i:return o=Ba(o,l.mode,d),o.return=l,o;case nr:var v=o._init;return p(l,v(o._payload),d)}if(js(o)||fs(o))return o=ei(o,l.mode,d,null),o.return=l,o;On(l,o)}return null}function m(l,o,d,v){var y=o!==null?o.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return y!==null?null:n(l,o,""+d,v);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case kn:return d.key===y?a(l,o,d,v):null;case _i:return d.key===y?f(l,o,d,v):null;case nr:return y=d._init,m(l,o,y(d._payload),v)}if(js(d)||fs(d))return y!==null?null:_(l,o,d,v,null);On(l,d)}return null}function S(l,o,d,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return l=l.get(d)||null,n(o,l,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case kn:return l=l.get(v.key===null?d:v.key)||null,a(o,l,v,y);case _i:return l=l.get(v.key===null?d:v.key)||null,f(o,l,v,y);case nr:var C=v._init;return S(l,o,d,C(v._payload),y)}if(js(v)||fs(v))return l=l.get(d)||null,_(o,l,v,y,null);On(o,v)}return null}function b(l,o,d,v){for(var y=null,C=null,k=o,x=o=0,E=null;k!==null&&x<d.length;x++){k.index>x?(E=k,k=null):E=k.sibling;var T=m(l,k,d[x],v);if(T===null){k===null&&(k=E);break}e&&k&&T.alternate===null&&t(l,k),o=c(T,o,x),C===null?y=T:C.sibling=T,C=T,k=E}if(x===d.length)return r(l,k),ge&&Or(l,x),y;if(k===null){for(;x<d.length;x++)k=p(l,d[x],v),k!==null&&(o=c(k,o,x),C===null?y=k:C.sibling=k,C=k);return ge&&Or(l,x),y}for(k=i(l,k);x<d.length;x++)E=S(k,l,x,d[x],v),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?x:E.key),o=c(E,o,x),C===null?y=E:C.sibling=E,C=E);return e&&k.forEach(function(B){return t(l,B)}),ge&&Or(l,x),y}function w(l,o,d,v){var y=fs(d);if(typeof y!="function")throw Error(J(150));if(d=y.call(d),d==null)throw Error(J(151));for(var C=y=null,k=o,x=o=0,E=null,T=d.next();k!==null&&!T.done;x++,T=d.next()){k.index>x?(E=k,k=null):E=k.sibling;var B=m(l,k,T.value,v);if(B===null){k===null&&(k=E);break}e&&k&&B.alternate===null&&t(l,k),o=c(B,o,x),C===null?y=B:C.sibling=B,C=B,k=E}if(T.done)return r(l,k),ge&&Or(l,x),y;if(k===null){for(;!T.done;x++,T=d.next())T=p(l,T.value,v),T!==null&&(o=c(T,o,x),C===null?y=T:C.sibling=T,C=T);return ge&&Or(l,x),y}for(k=i(l,k);!T.done;x++,T=d.next())T=S(k,l,x,T.value,v),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?x:T.key),o=c(T,o,x),C===null?y=T:C.sibling=T,C=T);return e&&k.forEach(function(D){return t(l,D)}),ge&&Or(l,x),y}function u(l,o,d,v){if(typeof d=="object"&&d!==null&&d.type===yi&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case kn:e:{for(var y=d.key,C=o;C!==null;){if(C.key===y){if(y=d.type,y===yi){if(C.tag===7){r(l,C.sibling),o=s(C,d.props.children),o.return=l,l=o;break e}}else if(C.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===nr&&qu(y)===C.type){r(l,C.sibling),o=s(C,d.props),o.ref=_s(l,C,d),o.return=l,l=o;break e}r(l,C);break}else t(l,C);C=C.sibling}d.type===yi?(o=ei(d.props.children,l.mode,v,d.key),o.return=l,l=o):(v=co(d.type,d.key,d.props,null,l.mode,v),v.ref=_s(l,o,d),v.return=l,l=v)}return g(l);case _i:e:{for(C=d.key;o!==null;){if(o.key===C)if(o.tag===4&&o.stateNode.containerInfo===d.containerInfo&&o.stateNode.implementation===d.implementation){r(l,o.sibling),o=s(o,d.children||[]),o.return=l,l=o;break e}else{r(l,o);break}else t(l,o);o=o.sibling}o=Ba(d,l.mode,v),o.return=l,l=o}return g(l);case nr:return C=d._init,u(l,o,C(d._payload),v)}if(js(d))return b(l,o,d,v);if(fs(d))return w(l,o,d,v);On(l,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,o!==null&&o.tag===6?(r(l,o.sibling),o=s(o,d),o.return=l,l=o):(r(l,o),o=Pa(d,l.mode,v),o.return=l,l=o),g(l)):r(l,o)}return u}var Yi=Ff(!0),Nf=Ff(!1),ko=Mr(null),Eo=null,Ri=null,Rc=null;function jc(){Rc=Ri=Eo=null}function Dc(e){var t=ko.current;ve(ko),e._currentValue=t}function yl(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Bi(e,t){Eo=e,Rc=Ri=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ze=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(Rc!==e)if(e={context:e,memoizedValue:t,next:null},Ri===null){if(Eo===null)throw Error(J(308));Ri=e,Eo.dependencies={lanes:0,firstContext:e}}else Ri=Ri.next=e;return t}var Hr=null;function Tc(e){Hr===null?Hr=[e]:Hr.push(e)}function Hf(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,Tc(t)):(r.next=s.next,s.next=r),t.interleaved=r,Yt(e,i)}function Yt(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 or=!1;function Lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zf(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 Vt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Cr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ae&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,Yt(e,r)}return s=i.interleaved,s===null?(t.next=t,Tc(i)):(t.next=s.next,s.next=t),i.interleaved=t,Yt(e,r)}function io(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,gc(e,r)}}function Vu(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var s=null,c=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};c===null?s=c=g:c=c.next=g,r=r.next}while(r!==null);c===null?s=c=t:c=c.next=t}else s=c=t;r={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ro(e,t,r,i){var s=e.updateQueue;or=!1;var c=s.firstBaseUpdate,g=s.lastBaseUpdate,n=s.shared.pending;if(n!==null){s.shared.pending=null;var a=n,f=a.next;a.next=null,g===null?c=f:g.next=f,g=a;var _=e.alternate;_!==null&&(_=_.updateQueue,n=_.lastBaseUpdate,n!==g&&(n===null?_.firstBaseUpdate=f:n.next=f,_.lastBaseUpdate=a))}if(c!==null){var p=s.baseState;g=0,_=f=a=null,n=c;do{var m=n.lane,S=n.eventTime;if((i&m)===m){_!==null&&(_=_.next={eventTime:S,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var b=e,w=n;switch(m=t,S=r,w.tag){case 1:if(b=w.payload,typeof b=="function"){p=b.call(S,p,m);break e}p=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=w.payload,m=typeof b=="function"?b.call(S,p,m):b,m==null)break e;p=Se({},p,m);break e;case 2:or=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[n]:m.push(n))}else S={eventTime:S,lane:m,tag:n.tag,payload:n.payload,callback:n.callback,next:null},_===null?(f=_=S,a=p):_=_.next=S,g|=m;if(n=n.next,n===null){if(n=s.shared.pending,n===null)break;m=n,n=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(_===null&&(a=p),s.baseState=a,s.firstBaseUpdate=f,s.lastBaseUpdate=_,t=s.shared.interleaved,t!==null){s=t;do g|=s.lane,s=s.next;while(s!==t)}else c===null&&(s.shared.lanes=0);si|=g,e.lanes=g,e.memoizedState=p}}function Qu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=r,typeof s!="function")throw Error(J(191,s));s.call(i)}}}var gn={},Ft=Mr(gn),Ys=Mr(gn),Zs=Mr(gn);function zr(e){if(e===gn)throw Error(J(174));return e}function Mc(e,t){switch(fe(Zs,t),fe(Ys,e),fe(Ft,gn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Za(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Za(t,e)}ve(Ft),fe(Ft,t)}function Zi(){ve(Ft),ve(Ys),ve(Zs)}function Wf(e){zr(Zs.current);var t=zr(Ft.current),r=Za(t,e.type);t!==r&&(fe(Ys,e),fe(Ft,r))}function Pc(e){Ys.current===e&&(ve(Ft),ve(Ys))}var _e=Mr(0);function jo(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 Ra=[];function Bc(){for(var e=0;e<Ra.length;e++)Ra[e]._workInProgressVersionPrimary=null;Ra.length=0}var so=er.ReactCurrentDispatcher,ja=er.ReactCurrentBatchConfig,ii=0,ye=null,Ee=null,Te=null,Do=!1,Is=!1,en=0,hm=0;function Oe(){throw Error(J(321))}function Ac(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Rt(e[r],t[r]))return!1;return!0}function Oc(e,t,r,i,s,c){if(ii=c,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,so.current=e===null||e.memoizedState===null?gm:mm,e=r(i,s),Is){c=0;do{if(Is=!1,en=0,25<=c)throw Error(J(301));c+=1,Te=Ee=null,t.updateQueue=null,so.current=_m,e=r(i,s)}while(Is)}if(so.current=To,t=Ee!==null&&Ee.next!==null,ii=0,Te=Ee=ye=null,Do=!1,t)throw Error(J(300));return e}function Ic(){var e=en!==0;return en=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ye.memoizedState=Te=e:Te=Te.next=e,Te}function yt(){if(Ee===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Te===null?ye.memoizedState:Te.next;if(t!==null)Te=t,Ee=e;else{if(e===null)throw Error(J(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Te===null?ye.memoizedState=Te=e:Te=Te.next=e}return Te}function tn(e,t){return typeof t=="function"?t(e):t}function Da(e){var t=yt(),r=t.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=e;var i=Ee,s=i.baseQueue,c=r.pending;if(c!==null){if(s!==null){var g=s.next;s.next=c.next,c.next=g}i.baseQueue=s=c,r.pending=null}if(s!==null){c=s.next,i=i.baseState;var n=g=null,a=null,f=c;do{var _=f.lane;if((ii&_)===_)a!==null&&(a=a.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:e(i,f.action);else{var p={lane:_,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};a===null?(n=a=p,g=i):a=a.next=p,ye.lanes|=_,si|=_}f=f.next}while(f!==null&&f!==c);a===null?g=i:a.next=n,Rt(i,t.memoizedState)||(Ze=!0),t.memoizedState=i,t.baseState=g,t.baseQueue=a,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do c=s.lane,ye.lanes|=c,si|=c,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ta(e){var t=yt(),r=t.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=e;var i=r.dispatch,s=r.pending,c=t.memoizedState;if(s!==null){r.pending=null;var g=s=s.next;do c=e(c,g.action),g=g.next;while(g!==s);Rt(c,t.memoizedState)||(Ze=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),r.lastRenderedState=c}return[c,i]}function $f(){}function Uf(e,t){var r=ye,i=yt(),s=t(),c=!Rt(i.memoizedState,s);if(c&&(i.memoizedState=s,Ze=!0),i=i.queue,Fc(qf.bind(null,r,i,e),[e]),i.getSnapshot!==t||c||Te!==null&&Te.memoizedState.tag&1){if(r.flags|=2048,rn(9,Jf.bind(null,r,i,s,t),void 0,null),Le===null)throw Error(J(349));ii&30||Kf(r,t,s)}return s}function Kf(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Jf(e,t,r,i){t.value=r,t.getSnapshot=i,Vf(t)&&Qf(e)}function qf(e,t,r){return r(function(){Vf(t)&&Qf(e)})}function Vf(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Rt(e,r)}catch{return!0}}function Qf(e){var t=Yt(e,1);t!==null&&Et(t,e,1,-1)}function Gu(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:e},t.queue=e,e=e.dispatch=vm.bind(null,ye,e),[t.memoizedState,e]}function rn(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Gf(){return yt().memoizedState}function no(e,t,r,i){var s=Lt();ye.flags|=e,s.memoizedState=rn(1|t,r,void 0,i===void 0?null:i)}function Jo(e,t,r,i){var s=yt();i=i===void 0?null:i;var c=void 0;if(Ee!==null){var g=Ee.memoizedState;if(c=g.destroy,i!==null&&Ac(i,g.deps)){s.memoizedState=rn(t,r,c,i);return}}ye.flags|=e,s.memoizedState=rn(1|t,r,c,i)}function Xu(e,t){return no(8390656,8,e,t)}function Fc(e,t){return Jo(2048,8,e,t)}function Xf(e,t){return Jo(4,2,e,t)}function Yf(e,t){return Jo(4,4,e,t)}function Zf(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 ep(e,t,r){return r=r!=null?r.concat([e]):null,Jo(4,4,Zf.bind(null,t,e),r)}function Nc(){}function tp(e,t){var r=yt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ac(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function rp(e,t){var r=yt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ac(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function ip(e,t,r){return ii&21?(Rt(r,t)||(r=lf(),ye.lanes|=r,si|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ze=!0),e.memoizedState=r)}function fm(e,t){var r=de;de=r!==0&&4>r?r:4,e(!0);var i=ja.transition;ja.transition={};try{e(!1),t()}finally{de=r,ja.transition=i}}function sp(){return yt().memoizedState}function pm(e,t,r){var i=Er(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},np(e))op(t,r);else if(r=Hf(e,t,r,i),r!==null){var s=Ue();Et(r,e,i,s),ap(r,t,i)}}function vm(e,t,r){var i=Er(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(np(e))op(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var g=t.lastRenderedState,n=c(g,r);if(s.hasEagerState=!0,s.eagerState=n,Rt(n,g)){var a=t.interleaved;a===null?(s.next=s,Tc(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}r=Hf(e,t,s,i),r!==null&&(s=Ue(),Et(r,e,i,s),ap(r,t,i))}}function np(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function op(e,t){Is=Do=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ap(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,gc(e,r)}}var To={readContext:_t,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},gm={readContext:_t,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Xu,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,no(4194308,4,Zf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var r=Lt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Lt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=pm.bind(null,ye,e),[i.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Gu,useDebugValue:Nc,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Gu(!1),t=e[0];return e=fm.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ye,s=Lt();if(ge){if(r===void 0)throw Error(J(407));r=r()}else{if(r=t(),Le===null)throw Error(J(349));ii&30||Kf(i,t,r)}s.memoizedState=r;var c={value:r,getSnapshot:t};return s.queue=c,Xu(qf.bind(null,i,c,e),[e]),i.flags|=2048,rn(9,Jf.bind(null,i,c,r,t),void 0,null),r},useId:function(){var e=Lt(),t=Le.identifierPrefix;if(ge){var r=qt,i=Jt;r=(i&~(1<<32-kt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=en++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=hm++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mm={readContext:_t,useCallback:tp,useContext:_t,useEffect:Fc,useImperativeHandle:ep,useInsertionEffect:Xf,useLayoutEffect:Yf,useMemo:rp,useReducer:Da,useRef:Gf,useState:function(){return Da(tn)},useDebugValue:Nc,useDeferredValue:function(e){var t=yt();return ip(t,Ee.memoizedState,e)},useTransition:function(){var e=Da(tn)[0],t=yt().memoizedState;return[e,t]},useMutableSource:$f,useSyncExternalStore:Uf,useId:sp,unstable_isNewReconciler:!1},_m={readContext:_t,useCallback:tp,useContext:_t,useEffect:Fc,useImperativeHandle:ep,useInsertionEffect:Xf,useLayoutEffect:Yf,useMemo:rp,useReducer:Ta,useRef:Gf,useState:function(){return Ta(tn)},useDebugValue:Nc,useDeferredValue:function(e){var t=yt();return Ee===null?t.memoizedState=e:ip(t,Ee.memoizedState,e)},useTransition:function(){var e=Ta(tn)[0],t=yt().memoizedState;return[e,t]},useMutableSource:$f,useSyncExternalStore:Uf,useId:sp,unstable_isNewReconciler:!1};function xt(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Sl(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Se({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var qo={isMounted:function(e){return(e=e._reactInternals)?li(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Ue(),s=Er(e),c=Vt(i,s);c.payload=t,r!=null&&(c.callback=r),t=Cr(e,c,s),t!==null&&(Et(t,e,s,i),io(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Ue(),s=Er(e),c=Vt(i,s);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Cr(e,c,s),t!==null&&(Et(t,e,s,i),io(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ue(),i=Er(e),s=Vt(r,i);s.tag=2,t!=null&&(s.callback=t),t=Cr(e,s,i),t!==null&&(Et(t,e,i,r),io(t,e,i))}};function Yu(e,t,r,i,s,c,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,g):t.prototype&&t.prototype.isPureReactComponent?!Vs(r,i)||!Vs(s,c):!0}function lp(e,t,r){var i=!1,s=Tr,c=t.contextType;return typeof c=="object"&&c!==null?c=_t(c):(s=tt(t)?ti:He.current,i=t.contextTypes,c=(i=i!=null)?Gi(e,s):Tr),t=new t(r,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qo,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=c),t}function Zu(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&qo.enqueueReplaceState(t,t.state,null)}function xl(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Lc(e);var c=t.contextType;typeof c=="object"&&c!==null?s.context=_t(c):(c=tt(t)?ti:He.current,s.context=Gi(e,c)),s.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Sl(e,t,c,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&qo.enqueueReplaceState(s,s.state,null),Ro(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function es(e,t){try{var r="",i=t;do r+=Jv(i),i=i.return;while(i);var s=r}catch(c){s=`
|
|
39
|
+
Error generating stack: `+c.message+`
|
|
40
|
+
`+c.stack}return{value:e,source:t,stack:s,digest:null}}function La(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function wl(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var ym=typeof WeakMap=="function"?WeakMap:Map;function cp(e,t,r){r=Vt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Mo||(Mo=!0,Ml=i),wl(e,t)},r}function up(e,t,r){r=Vt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;r.payload=function(){return i(s)},r.callback=function(){wl(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(r.callback=function(){wl(e,t),typeof i!="function"&&(kr===null?kr=new Set([this]):kr.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function ed(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new ym;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(r)||(s.add(r),e=Pm.bind(null,e,t,r),t.then(e,e))}function td(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 rd(e,t,r,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Vt(-1,1),t.tag=2,Cr(r,t,1))),r.lanes|=1),e)}var Sm=er.ReactCurrentOwner,Ze=!1;function We(e,t,r,i){t.child=e===null?Nf(t,null,r,i):Yi(t,e.child,r,i)}function id(e,t,r,i,s){r=r.render;var c=t.ref;return Bi(t,s),i=Oc(e,t,r,i,c,s),r=Ic(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zt(e,t,s)):(ge&&r&&Cc(t),t.flags|=1,We(e,t,i,s),t.child)}function sd(e,t,r,i,s){if(e===null){var c=r.type;return typeof c=="function"&&!qc(c)&&c.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=c,dp(e,t,c,i,s)):(e=co(r.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!(e.lanes&s)){var g=c.memoizedProps;if(r=r.compare,r=r!==null?r:Vs,r(g,i)&&e.ref===t.ref)return Zt(e,t,s)}return t.flags|=1,e=Rr(c,i),e.ref=t.ref,e.return=t,t.child=e}function dp(e,t,r,i,s){if(e!==null){var c=e.memoizedProps;if(Vs(c,i)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=i=c,(e.lanes&s)!==0)e.flags&131072&&(Ze=!0);else return t.lanes=e.lanes,Zt(e,t,s)}return bl(e,t,r,i,s)}function hp(e,t,r){var i=t.pendingProps,s=i.children,c=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Di,it),it|=r;else{if(!(r&1073741824))return e=c!==null?c.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Di,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=c!==null?c.baseLanes:r,fe(Di,it),it|=i}else c!==null?(i=c.baseLanes|r,t.memoizedState=null):i=r,fe(Di,it),it|=i;return We(e,t,s,r),t.child}function fp(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function bl(e,t,r,i,s){var c=tt(r)?ti:He.current;return c=Gi(t,c),Bi(t,s),r=Oc(e,t,r,i,c,s),i=Ic(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zt(e,t,s)):(ge&&i&&Cc(t),t.flags|=1,We(e,t,r,s),t.child)}function nd(e,t,r,i,s){if(tt(r)){var c=!0;wo(t)}else c=!1;if(Bi(t,s),t.stateNode===null)oo(e,t),lp(t,r,i),xl(t,r,i,s),i=!0;else if(e===null){var g=t.stateNode,n=t.memoizedProps;g.props=n;var a=g.context,f=r.contextType;typeof f=="object"&&f!==null?f=_t(f):(f=tt(r)?ti:He.current,f=Gi(t,f));var _=r.getDerivedStateFromProps,p=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function";p||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(n!==i||a!==f)&&Zu(t,g,i,f),or=!1;var m=t.memoizedState;g.state=m,Ro(t,i,g,s),a=t.memoizedState,n!==i||m!==a||et.current||or?(typeof _=="function"&&(Sl(t,r,_,i),a=t.memoizedState),(n=or||Yu(t,r,n,i,m,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=i,t.memoizedState=a),g.props=i,g.state=a,g.context=f,i=n):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{g=t.stateNode,zf(e,t),n=t.memoizedProps,f=t.type===t.elementType?n:xt(t.type,n),g.props=f,p=t.pendingProps,m=g.context,a=r.contextType,typeof a=="object"&&a!==null?a=_t(a):(a=tt(r)?ti:He.current,a=Gi(t,a));var S=r.getDerivedStateFromProps;(_=typeof S=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(n!==p||m!==a)&&Zu(t,g,i,a),or=!1,m=t.memoizedState,g.state=m,Ro(t,i,g,s);var b=t.memoizedState;n!==p||m!==b||et.current||or?(typeof S=="function"&&(Sl(t,r,S,i),b=t.memoizedState),(f=or||Yu(t,r,f,i,m,b,a)||!1)?(_||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(i,b,a),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(i,b,a)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=b),g.props=i,g.state=b,g.context=a,i=f):(typeof g.componentDidUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),i=!1)}return Cl(e,t,r,i,c,s)}function Cl(e,t,r,i,s,c){fp(e,t);var g=(t.flags&128)!==0;if(!i&&!g)return s&&Uu(t,r,!1),Zt(e,t,c);i=t.stateNode,Sm.current=t;var n=g&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&g?(t.child=Yi(t,e.child,null,c),t.child=Yi(t,null,n,c)):We(e,t,n,c),t.memoizedState=i.state,s&&Uu(t,r,!0),t.child}function pp(e){var t=e.stateNode;t.pendingContext?$u(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$u(e,t.context,!1),Mc(e,t.containerInfo)}function od(e,t,r,i,s){return Xi(),Ec(s),t.flags|=256,We(e,t,r,i),t.child}var kl={dehydrated:null,treeContext:null,retryLane:0};function El(e){return{baseLanes:e,cachePool:null,transitions:null}}function vp(e,t,r){var i=t.pendingProps,s=_e.current,c=!1,g=(t.flags&128)!==0,n;if((n=g)||(n=e!==null&&e.memoizedState===null?!1:(s&2)!==0),n?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(_e,s&1),e===null)return _l(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=i.children,e=i.fallback,c?(i=t.mode,c=t.child,g={mode:"hidden",children:g},!(i&1)&&c!==null?(c.childLanes=0,c.pendingProps=g):c=Go(g,i,0,null),e=ei(e,i,r,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=El(r),t.memoizedState=kl,e):Hc(t,g));if(s=e.memoizedState,s!==null&&(n=s.dehydrated,n!==null))return xm(e,t,g,i,n,s,r);if(c){c=i.fallback,g=t.mode,s=e.child,n=s.sibling;var a={mode:"hidden",children:i.children};return!(g&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=a,t.deletions=null):(i=Rr(s,a),i.subtreeFlags=s.subtreeFlags&14680064),n!==null?c=Rr(n,c):(c=ei(c,g,r,null),c.flags|=2),c.return=t,i.return=t,i.sibling=c,t.child=i,i=c,c=t.child,g=e.child.memoizedState,g=g===null?El(r):{baseLanes:g.baseLanes|r,cachePool:null,transitions:g.transitions},c.memoizedState=g,c.childLanes=e.childLanes&~r,t.memoizedState=kl,i}return c=e.child,e=c.sibling,i=Rr(c,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Hc(e,t){return t=Go({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function In(e,t,r,i){return i!==null&&Ec(i),Yi(t,e.child,null,r),e=Hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xm(e,t,r,i,s,c,g){if(r)return t.flags&256?(t.flags&=-257,i=La(Error(J(422))),In(e,t,g,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=i.fallback,s=t.mode,i=Go({mode:"visible",children:i.children},s,0,null),c=ei(c,s,g,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,t.mode&1&&Yi(t,e.child,null,g),t.child.memoizedState=El(g),t.memoizedState=kl,c);if(!(t.mode&1))return In(e,t,g,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var n=i.dgst;return i=n,c=Error(J(419)),i=La(c,i,void 0),In(e,t,g,i)}if(n=(g&e.childLanes)!==0,Ze||n){if(i=Le,i!==null){switch(g&-g){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|g)?0:s,s!==0&&s!==c.retryLane&&(c.retryLane=s,Yt(e,s),Et(i,e,s,-1))}return Jc(),i=La(Error(J(421))),In(e,t,g,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Bm.bind(null,e),s._reactRetry=t,null):(e=c.treeContext,ot=br(s.nextSibling),at=t,ge=!0,Ct=null,e!==null&&(pt[vt++]=Jt,pt[vt++]=qt,pt[vt++]=ri,Jt=e.id,qt=e.overflow,ri=t),t=Hc(t,i.children),t.flags|=4096,t)}function ad(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),yl(e.return,t,r)}function Ma(e,t,r,i,s){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:s}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=i,c.tail=r,c.tailMode=s)}function gp(e,t,r){var i=t.pendingProps,s=i.revealOrder,c=i.tail;if(We(e,t,i.children,r),i=_e.current,i&2)i=i&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&&ad(e,r,t);else if(e.tag===19)ad(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}i&=1}if(fe(_e,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&jo(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Ma(t,!1,s,r,c);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&jo(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Ma(t,!0,r,null,c);break;case"together":Ma(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),si|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,r=Rr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Rr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wm(e,t,r){switch(t.tag){case 3:pp(t),Xi();break;case 5:Wf(t);break;case 1:tt(t.type)&&wo(t);break;case 4:Mc(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;fe(ko,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(fe(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?vp(e,t,r):(fe(_e,_e.current&1),e=Zt(e,t,r),e!==null?e.sibling:null);fe(_e,_e.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return gp(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(_e,_e.current),i)break;return null;case 22:case 23:return t.lanes=0,hp(e,t,r)}return Zt(e,t,r)}var mp,Rl,_p,yp;mp=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}};Rl=function(){};_p=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,zr(Ft.current);var c=null;switch(r){case"input":s=Qa(e,s),i=Qa(e,i),c=[];break;case"select":s=Se({},s,{value:void 0}),i=Se({},i,{value:void 0}),c=[];break;case"textarea":s=Ya(e,s),i=Ya(e,i),c=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=So)}el(r,i);var g;r=null;for(f in s)if(!i.hasOwnProperty(f)&&s.hasOwnProperty(f)&&s[f]!=null)if(f==="style"){var n=s[f];for(g in n)n.hasOwnProperty(g)&&(r||(r={}),r[g]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(zs.hasOwnProperty(f)?c||(c=[]):(c=c||[]).push(f,null));for(f in i){var a=i[f];if(n=s!=null?s[f]:void 0,i.hasOwnProperty(f)&&a!==n&&(a!=null||n!=null))if(f==="style")if(n){for(g in n)!n.hasOwnProperty(g)||a&&a.hasOwnProperty(g)||(r||(r={}),r[g]="");for(g in a)a.hasOwnProperty(g)&&n[g]!==a[g]&&(r||(r={}),r[g]=a[g])}else r||(c||(c=[]),c.push(f,r)),r=a;else f==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,n=n?n.__html:void 0,a!=null&&n!==a&&(c=c||[]).push(f,a)):f==="children"?typeof a!="string"&&typeof a!="number"||(c=c||[]).push(f,""+a):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(zs.hasOwnProperty(f)?(a!=null&&f==="onScroll"&&pe("scroll",e),c||n===a||(c=[])):(c=c||[]).push(f,a))}r&&(c=c||[]).push("style",r);var f=c;(t.updateQueue=f)&&(t.flags|=4)}};yp=function(e,t,r,i){r!==i&&(t.flags|=4)};function ys(e,t){if(!ge)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 i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function bm(e,t,r){var i=t.pendingProps;switch(kc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return tt(t.type)&&xo(),Ie(t),null;case 3:return i=t.stateNode,Zi(),ve(et),ve(He),Bc(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(An(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ct!==null&&(Al(Ct),Ct=null))),Rl(e,t),Ie(t),null;case 5:Pc(t);var s=zr(Zs.current);if(r=t.type,e!==null&&t.stateNode!=null)_p(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(J(166));return Ie(t),null}if(e=zr(Ft.current),An(t)){i=t.stateNode,r=t.type;var c=t.memoizedProps;switch(i[Ot]=t,i[Xs]=c,e=(t.mode&1)!==0,r){case"dialog":pe("cancel",i),pe("close",i);break;case"iframe":case"object":case"embed":pe("load",i);break;case"video":case"audio":for(s=0;s<Ts.length;s++)pe(Ts[s],i);break;case"source":pe("error",i);break;case"img":case"image":case"link":pe("error",i),pe("load",i);break;case"details":pe("toggle",i);break;case"input":gu(i,c),pe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!c.multiple},pe("invalid",i);break;case"textarea":_u(i,c),pe("invalid",i)}el(r,c),s=null;for(var g in c)if(c.hasOwnProperty(g)){var n=c[g];g==="children"?typeof n=="string"?i.textContent!==n&&(c.suppressHydrationWarning!==!0&&Bn(i.textContent,n,e),s=["children",n]):typeof n=="number"&&i.textContent!==""+n&&(c.suppressHydrationWarning!==!0&&Bn(i.textContent,n,e),s=["children",""+n]):zs.hasOwnProperty(g)&&n!=null&&g==="onScroll"&&pe("scroll",i)}switch(r){case"input":En(i),mu(i,c,!0);break;case"textarea":En(i),yu(i);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(i.onclick=So)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{g=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=g.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=g.createElement(r,{is:i.is}):(e=g.createElement(r),r==="select"&&(g=e,i.multiple?g.multiple=!0:i.size&&(g.size=i.size))):e=g.createElementNS(e,r),e[Ot]=t,e[Xs]=i,mp(e,t,!1,!1),t.stateNode=e;e:{switch(g=tl(r,i),r){case"dialog":pe("cancel",e),pe("close",e),s=i;break;case"iframe":case"object":case"embed":pe("load",e),s=i;break;case"video":case"audio":for(s=0;s<Ts.length;s++)pe(Ts[s],e);s=i;break;case"source":pe("error",e),s=i;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=i;break;case"details":pe("toggle",e),s=i;break;case"input":gu(e,i),s=Qa(e,i),pe("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=Se({},i,{value:void 0}),pe("invalid",e);break;case"textarea":_u(e,i),s=Ya(e,i),pe("invalid",e);break;default:s=i}el(r,s),n=s;for(c in n)if(n.hasOwnProperty(c)){var a=n[c];c==="style"?Qh(e,a):c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&qh(e,a)):c==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Ws(e,a):typeof a=="number"&&Ws(e,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(zs.hasOwnProperty(c)?a!=null&&c==="onScroll"&&pe("scroll",e):a!=null&&uc(e,c,a,g))}switch(r){case"input":En(e),mu(e,i,!1);break;case"textarea":En(e),yu(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Dr(i.value));break;case"select":e.multiple=!!i.multiple,c=i.value,c!=null?Ti(e,!!i.multiple,c,!1):i.defaultValue!=null&&Ti(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=So)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ie(t),null;case 6:if(e&&t.stateNode!=null)yp(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(J(166));if(r=zr(Zs.current),zr(Ft.current),An(t)){if(i=t.stateNode,r=t.memoizedProps,i[Ot]=t,(c=i.nodeValue!==r)&&(e=at,e!==null))switch(e.tag){case 3:Bn(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bn(i.nodeValue,r,(e.mode&1)!==0)}c&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Ot]=t,t.stateNode=i}return Ie(t),null;case 13:if(ve(_e),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&ot!==null&&t.mode&1&&!(t.flags&128))If(),Xi(),t.flags|=98560,c=!1;else if(c=An(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(J(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(J(317));c[Ot]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ie(t),c=!1}else Ct!==null&&(Al(Ct),Ct=null),c=!0;if(!c)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?je===0&&(je=3):Jc())),t.updateQueue!==null&&(t.flags|=4),Ie(t),null);case 4:return Zi(),Rl(e,t),e===null&&Qs(t.stateNode.containerInfo),Ie(t),null;case 10:return Dc(t.type._context),Ie(t),null;case 17:return tt(t.type)&&xo(),Ie(t),null;case 19:if(ve(_e),c=t.memoizedState,c===null)return Ie(t),null;if(i=(t.flags&128)!==0,g=c.rendering,g===null)if(i)ys(c,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(g=jo(e),g!==null){for(t.flags|=128,ys(c,!1),i=g.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)c=r,e=i,c.flags&=14680066,g=c.alternate,g===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,e=g.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return fe(_e,_e.current&1|2),t.child}e=e.sibling}c.tail!==null&&Ce()>ts&&(t.flags|=128,i=!0,ys(c,!1),t.lanes=4194304)}else{if(!i)if(e=jo(g),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ys(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!ge)return Ie(t),null}else 2*Ce()-c.renderingStartTime>ts&&r!==1073741824&&(t.flags|=128,i=!0,ys(c,!1),t.lanes=4194304);c.isBackwards?(g.sibling=t.child,t.child=g):(r=c.last,r!==null?r.sibling=g:t.child=g,c.last=g)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ce(),t.sibling=null,r=_e.current,fe(_e,i?r&1|2:r&1),t):(Ie(t),null);case 22:case 23:return Kc(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?it&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function Cm(e,t){switch(kc(t),t.tag){case 1:return tt(t.type)&&xo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(),ve(et),ve(He),Bc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pc(t),null;case 13:if(ve(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(_e),null;case 4:return Zi(),null;case 10:return Dc(t.type._context),null;case 22:case 23:return Kc(),null;case 24:return null;default:return null}}var Fn=!1,Ne=!1,km=typeof WeakSet=="function"?WeakSet:Set,G=null;function ji(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){we(e,t,i)}else r.current=null}function jl(e,t,r){try{r()}catch(i){we(e,t,i)}}var ld=!1;function Em(e,t){if(dl=mo,e=Cf(),bc(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var s=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var g=0,n=-1,a=-1,f=0,_=0,p=e,m=null;t:for(;;){for(var S;p!==r||s!==0&&p.nodeType!==3||(n=g+s),p!==c||i!==0&&p.nodeType!==3||(a=g+i),p.nodeType===3&&(g+=p.nodeValue.length),(S=p.firstChild)!==null;)m=p,p=S;for(;;){if(p===e)break t;if(m===r&&++f===s&&(n=g),m===c&&++_===i&&(a=g),(S=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=S}r=n===-1||a===-1?null:{start:n,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(hl={focusedElem:e,selectionRange:r},mo=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,u=b.memoizedState,l=t.stateNode,o=l.getSnapshotBeforeUpdate(t.elementType===t.type?w:xt(t.type,w),u);l.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(v){we(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return b=ld,ld=!1,b}function Fs(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var c=s.destroy;s.destroy=void 0,c!==void 0&&jl(t,r,c)}s=s.next}while(s!==i)}}function Vo(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 i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Dl(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 Sp(e){var t=e.alternate;t!==null&&(e.alternate=null,Sp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ot],delete t[Xs],delete t[vl],delete t[lm],delete t[cm])),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 xp(e){return e.tag===5||e.tag===3||e.tag===4}function cd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(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 Tl(e,t,r){var i=e.tag;if(i===5||i===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=So));else if(i!==4&&(e=e.child,e!==null))for(Tl(e,t,r),e=e.sibling;e!==null;)Tl(e,t,r),e=e.sibling}function Ll(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ll(e,t,r),e=e.sibling;e!==null;)Ll(e,t,r),e=e.sibling}var Pe=null,bt=!1;function ir(e,t,r){for(r=r.child;r!==null;)wp(e,t,r),r=r.sibling}function wp(e,t,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Ho,r)}catch{}switch(r.tag){case 5:Ne||ji(r,t);case 6:var i=Pe,s=bt;Pe=null,ir(e,t,r),Pe=i,bt=s,Pe!==null&&(bt?(e=Pe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Pe.removeChild(r.stateNode));break;case 18:Pe!==null&&(bt?(e=Pe,r=r.stateNode,e.nodeType===8?ka(e.parentNode,r):e.nodeType===1&&ka(e,r),Js(e)):ka(Pe,r.stateNode));break;case 4:i=Pe,s=bt,Pe=r.stateNode.containerInfo,bt=!0,ir(e,t,r),Pe=i,bt=s;break;case 0:case 11:case 14:case 15:if(!Ne&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var c=s,g=c.destroy;c=c.tag,g!==void 0&&(c&2||c&4)&&jl(r,t,g),s=s.next}while(s!==i)}ir(e,t,r);break;case 1:if(!Ne&&(ji(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(n){we(r,t,n)}ir(e,t,r);break;case 21:ir(e,t,r);break;case 22:r.mode&1?(Ne=(i=Ne)||r.memoizedState!==null,ir(e,t,r),Ne=i):ir(e,t,r);break;default:ir(e,t,r)}}function ud(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new km),t.forEach(function(i){var s=Am.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function St(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];try{var c=e,g=t,n=g;e:for(;n!==null;){switch(n.tag){case 5:Pe=n.stateNode,bt=!1;break e;case 3:Pe=n.stateNode.containerInfo,bt=!0;break e;case 4:Pe=n.stateNode.containerInfo,bt=!0;break e}n=n.return}if(Pe===null)throw Error(J(160));wp(c,g,s),Pe=null,bt=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(f){we(s,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bp(t,e),t=t.sibling}function bp(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(St(t,e),Dt(e),i&4){try{Fs(3,e,e.return),Vo(3,e)}catch(w){we(e,e.return,w)}try{Fs(5,e,e.return)}catch(w){we(e,e.return,w)}}break;case 1:St(t,e),Dt(e),i&512&&r!==null&&ji(r,r.return);break;case 5:if(St(t,e),Dt(e),i&512&&r!==null&&ji(r,r.return),e.flags&32){var s=e.stateNode;try{Ws(s,"")}catch(w){we(e,e.return,w)}}if(i&4&&(s=e.stateNode,s!=null)){var c=e.memoizedProps,g=r!==null?r.memoizedProps:c,n=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{n==="input"&&c.type==="radio"&&c.name!=null&&Uh(s,c),tl(n,g);var f=tl(n,c);for(g=0;g<a.length;g+=2){var _=a[g],p=a[g+1];_==="style"?Qh(s,p):_==="dangerouslySetInnerHTML"?qh(s,p):_==="children"?Ws(s,p):uc(s,_,p,f)}switch(n){case"input":Ga(s,c);break;case"textarea":Kh(s,c);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!c.multiple;var S=c.value;S!=null?Ti(s,!!c.multiple,S,!1):m!==!!c.multiple&&(c.defaultValue!=null?Ti(s,!!c.multiple,c.defaultValue,!0):Ti(s,!!c.multiple,c.multiple?[]:"",!1))}s[Xs]=c}catch(w){we(e,e.return,w)}}break;case 6:if(St(t,e),Dt(e),i&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,c=e.memoizedProps;try{s.nodeValue=c}catch(w){we(e,e.return,w)}}break;case 3:if(St(t,e),Dt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(w){we(e,e.return,w)}break;case 4:St(t,e),Dt(e);break;case 13:St(t,e),Dt(e),s=e.child,s.flags&8192&&(c=s.memoizedState!==null,s.stateNode.isHidden=c,!c||s.alternate!==null&&s.alternate.memoizedState!==null||($c=Ce())),i&4&&ud(e);break;case 22:if(_=r!==null&&r.memoizedState!==null,e.mode&1?(Ne=(f=Ne)||_,St(t,e),Ne=f):St(t,e),Dt(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!_&&e.mode&1)for(G=e,_=e.child;_!==null;){for(p=G=_;G!==null;){switch(m=G,S=m.child,m.tag){case 0:case 11:case 14:case 15:Fs(4,m,m.return);break;case 1:ji(m,m.return);var b=m.stateNode;if(typeof b.componentWillUnmount=="function"){i=m,r=m.return;try{t=i,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(w){we(i,r,w)}}break;case 5:ji(m,m.return);break;case 22:if(m.memoizedState!==null){hd(p);continue}}S!==null?(S.return=m,G=S):hd(p)}_=_.sibling}e:for(_=null,p=e;;){if(p.tag===5){if(_===null){_=p;try{s=p.stateNode,f?(c=s.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(n=p.stateNode,a=p.memoizedProps.style,g=a!=null&&a.hasOwnProperty("display")?a.display:null,n.style.display=Vh("display",g))}catch(w){we(e,e.return,w)}}}else if(p.tag===6){if(_===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(w){we(e,e.return,w)}}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;_===p&&(_=null),p=p.return}_===p&&(_=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:St(t,e),Dt(e),i&4&&ud(e);break;case 21:break;default:St(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(xp(r)){var i=r;break e}r=r.return}throw Error(J(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(Ws(s,""),i.flags&=-33);var c=cd(e);Ll(e,c,s);break;case 3:case 4:var g=i.stateNode.containerInfo,n=cd(e);Tl(e,n,g);break;default:throw Error(J(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rm(e,t,r){G=e,Cp(e)}function Cp(e,t,r){for(var i=(e.mode&1)!==0;G!==null;){var s=G,c=s.child;if(s.tag===22&&i){var g=s.memoizedState!==null||Fn;if(!g){var n=s.alternate,a=n!==null&&n.memoizedState!==null||Ne;n=Fn;var f=Ne;if(Fn=g,(Ne=a)&&!f)for(G=s;G!==null;)g=G,a=g.child,g.tag===22&&g.memoizedState!==null?fd(s):a!==null?(a.return=g,G=a):fd(s);for(;c!==null;)G=c,Cp(c),c=c.sibling;G=s,Fn=n,Ne=f}dd(e)}else s.subtreeFlags&8772&&c!==null?(c.return=s,G=c):dd(e)}}function dd(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ne||Vo(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ne)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:xt(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Qu(t,c,i);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}Qu(t,g,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;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 _=f.memoizedState;if(_!==null){var p=_.dehydrated;p!==null&&Js(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Ne||t.flags&512&&Dl(t)}catch(m){we(t,t.return,m)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function hd(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function fd(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vo(4,t)}catch(a){we(t,r,a)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(a){we(t,s,a)}}var c=t.return;try{Dl(t)}catch(a){we(t,c,a)}break;case 5:var g=t.return;try{Dl(t)}catch(a){we(t,g,a)}}}catch(a){we(t,t.return,a)}if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}var jm=Math.ceil,Lo=er.ReactCurrentDispatcher,zc=er.ReactCurrentOwner,mt=er.ReactCurrentBatchConfig,ae=0,Le=null,ke=null,Be=0,it=0,Di=Mr(0),je=0,sn=null,si=0,Qo=0,Wc=0,Ns=null,Ye=null,$c=0,ts=1/0,Ht=null,Mo=!1,Ml=null,kr=null,Nn=!1,yr=null,Po=0,Hs=0,Pl=null,ao=-1,lo=0;function Ue(){return ae&6?Ce():ao!==-1?ao:ao=Ce()}function Er(e){return e.mode&1?ae&2&&Be!==0?Be&-Be:dm.transition!==null?(lo===0&&(lo=lf()),lo):(e=de,e!==0||(e=window.event,e=e===void 0?16:vf(e.type)),e):1}function Et(e,t,r,i){if(50<Hs)throw Hs=0,Pl=null,Error(J(185));fn(e,r,i),(!(ae&2)||e!==Le)&&(e===Le&&(!(ae&2)&&(Qo|=r),je===4&&lr(e,Be)),rt(e,i),r===1&&ae===0&&!(t.mode&1)&&(ts=Ce()+500,Ko&&Pr()))}function rt(e,t){var r=e.callbackNode;dg(e,t);var i=go(e,e===Le?Be:0);if(i===0)r!==null&&wu(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&wu(r),t===1)e.tag===0?um(pd.bind(null,e)):Bf(pd.bind(null,e)),om(function(){!(ae&6)&&Pr()}),r=null;else{switch(cf(i)){case 1:r=vc;break;case 4:r=of;break;case 16:r=vo;break;case 536870912:r=af;break;default:r=vo}r=Mp(r,kp.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function kp(e,t){if(ao=-1,lo=0,ae&6)throw Error(J(327));var r=e.callbackNode;if(Ai()&&e.callbackNode!==r)return null;var i=go(e,e===Le?Be:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Bo(e,i);else{t=i;var s=ae;ae|=2;var c=Rp();(Le!==e||Be!==t)&&(Ht=null,ts=Ce()+500,Zr(e,t));do try{Lm();break}catch(n){Ep(e,n)}while(!0);jc(),Lo.current=c,ae=s,ke!==null?t=0:(Le=null,Be=0,t=je)}if(t!==0){if(t===2&&(s=ol(e),s!==0&&(i=s,t=Bl(e,s))),t===1)throw r=sn,Zr(e,0),lr(e,i),rt(e,Ce()),r;if(t===6)lr(e,i);else{if(s=e.current.alternate,!(i&30)&&!Dm(s)&&(t=Bo(e,i),t===2&&(c=ol(e),c!==0&&(i=c,t=Bl(e,c))),t===1))throw r=sn,Zr(e,0),lr(e,i),rt(e,Ce()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(J(345));case 2:Ir(e,Ye,Ht);break;case 3:if(lr(e,i),(i&130023424)===i&&(t=$c+500-Ce(),10<t)){if(go(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){Ue(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=pl(Ir.bind(null,e,Ye,Ht),t);break}Ir(e,Ye,Ht);break;case 4:if(lr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var g=31-kt(i);c=1<<g,g=t[g],g>s&&(s=g),i&=~c}if(i=s,i=Ce()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*jm(i/1960))-i,10<i){e.timeoutHandle=pl(Ir.bind(null,e,Ye,Ht),i);break}Ir(e,Ye,Ht);break;case 5:Ir(e,Ye,Ht);break;default:throw Error(J(329))}}}return rt(e,Ce()),e.callbackNode===r?kp.bind(null,e):null}function Bl(e,t){var r=Ns;return e.current.memoizedState.isDehydrated&&(Zr(e,t).flags|=256),e=Bo(e,t),e!==2&&(t=Ye,Ye=r,t!==null&&Al(t)),e}function Al(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function Dm(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var s=r[i],c=s.getSnapshot;s=s.value;try{if(!Rt(c(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function lr(e,t){for(t&=~Wc,t&=~Qo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-kt(t),i=1<<r;e[r]=-1,t&=~i}}function pd(e){if(ae&6)throw Error(J(327));Ai();var t=go(e,0);if(!(t&1))return rt(e,Ce()),null;var r=Bo(e,t);if(e.tag!==0&&r===2){var i=ol(e);i!==0&&(t=i,r=Bl(e,i))}if(r===1)throw r=sn,Zr(e,0),lr(e,t),rt(e,Ce()),r;if(r===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ir(e,Ye,Ht),rt(e,Ce()),null}function Uc(e,t){var r=ae;ae|=1;try{return e(t)}finally{ae=r,ae===0&&(ts=Ce()+500,Ko&&Pr())}}function ni(e){yr!==null&&yr.tag===0&&!(ae&6)&&Ai();var t=ae;ae|=1;var r=mt.transition,i=de;try{if(mt.transition=null,de=1,e)return e()}finally{de=i,mt.transition=r,ae=t,!(ae&6)&&Pr()}}function Kc(){it=Di.current,ve(Di)}function Zr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,nm(r)),ke!==null)for(r=ke.return;r!==null;){var i=r;switch(kc(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&xo();break;case 3:Zi(),ve(et),ve(He),Bc();break;case 5:Pc(i);break;case 4:Zi();break;case 13:ve(_e);break;case 19:ve(_e);break;case 10:Dc(i.type._context);break;case 22:case 23:Kc()}r=r.return}if(Le=e,ke=e=Rr(e.current,null),Be=it=t,je=0,sn=null,Wc=Qo=si=0,Ye=Ns=null,Hr!==null){for(t=0;t<Hr.length;t++)if(r=Hr[t],i=r.interleaved,i!==null){r.interleaved=null;var s=i.next,c=r.pending;if(c!==null){var g=c.next;c.next=s,i.next=g}r.pending=i}Hr=null}return e}function Ep(e,t){do{var r=ke;try{if(jc(),so.current=To,Do){for(var i=ye.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Do=!1}if(ii=0,Te=Ee=ye=null,Is=!1,en=0,zc.current=null,r===null||r.return===null){je=1,sn=t,ke=null;break}e:{var c=e,g=r.return,n=r,a=t;if(t=Be,n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var f=a,_=n,p=_.tag;if(!(_.mode&1)&&(p===0||p===11||p===15)){var m=_.alternate;m?(_.updateQueue=m.updateQueue,_.memoizedState=m.memoizedState,_.lanes=m.lanes):(_.updateQueue=null,_.memoizedState=null)}var S=td(g);if(S!==null){S.flags&=-257,rd(S,g,n,c,t),S.mode&1&&ed(c,f,t),t=S,a=f;var b=t.updateQueue;if(b===null){var w=new Set;w.add(a),t.updateQueue=w}else b.add(a);break e}else{if(!(t&1)){ed(c,f,t),Jc();break e}a=Error(J(426))}}else if(ge&&n.mode&1){var u=td(g);if(u!==null){!(u.flags&65536)&&(u.flags|=256),rd(u,g,n,c,t),Ec(es(a,n));break e}}c=a=es(a,n),je!==4&&(je=2),Ns===null?Ns=[c]:Ns.push(c),c=g;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var l=cp(c,a,t);Vu(c,l);break e;case 1:n=a;var o=c.type,d=c.stateNode;if(!(c.flags&128)&&(typeof o.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(kr===null||!kr.has(d)))){c.flags|=65536,t&=-t,c.lanes|=t;var v=up(c,n,t);Vu(c,v);break e}}c=c.return}while(c!==null)}Dp(r)}catch(y){t=y,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function Rp(){var e=Lo.current;return Lo.current=To,e===null?To:e}function Jc(){(je===0||je===3||je===2)&&(je=4),Le===null||!(si&268435455)&&!(Qo&268435455)||lr(Le,Be)}function Bo(e,t){var r=ae;ae|=2;var i=Rp();(Le!==e||Be!==t)&&(Ht=null,Zr(e,t));do try{Tm();break}catch(s){Ep(e,s)}while(!0);if(jc(),ae=r,Lo.current=i,ke!==null)throw Error(J(261));return Le=null,Be=0,je}function Tm(){for(;ke!==null;)jp(ke)}function Lm(){for(;ke!==null&&!rg();)jp(ke)}function jp(e){var t=Lp(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?Dp(e):ke=t,zc.current=null}function Dp(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Cm(r,t),r!==null){r.flags&=32767,ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,ke=null;return}}else if(r=bm(r,t,it),r!==null){ke=r;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);je===0&&(je=5)}function Ir(e,t,r){var i=de,s=mt.transition;try{mt.transition=null,de=1,Mm(e,t,r,i)}finally{mt.transition=s,de=i}return null}function Mm(e,t,r,i){do Ai();while(yr!==null);if(ae&6)throw Error(J(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var c=r.lanes|r.childLanes;if(hg(e,c),e===Le&&(ke=Le=null,Be=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Nn||(Nn=!0,Mp(vo,function(){return Ai(),null})),c=(r.flags&15990)!==0,r.subtreeFlags&15990||c){c=mt.transition,mt.transition=null;var g=de;de=1;var n=ae;ae|=4,zc.current=null,Em(e,r),bp(r,e),Yg(hl),mo=!!dl,hl=dl=null,e.current=r,Rm(r),ig(),ae=n,de=g,mt.transition=c}else e.current=r;if(Nn&&(Nn=!1,yr=e,Po=s),c=e.pendingLanes,c===0&&(kr=null),og(r.stateNode),rt(e,Ce()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],i(s.value,{componentStack:s.stack,digest:s.digest});if(Mo)throw Mo=!1,e=Ml,Ml=null,e;return Po&1&&e.tag!==0&&Ai(),c=e.pendingLanes,c&1?e===Pl?Hs++:(Hs=0,Pl=e):Hs=0,Pr(),null}function Ai(){if(yr!==null){var e=cf(Po),t=mt.transition,r=de;try{if(mt.transition=null,de=16>e?16:e,yr===null)var i=!1;else{if(e=yr,yr=null,Po=0,ae&6)throw Error(J(331));var s=ae;for(ae|=4,G=e.current;G!==null;){var c=G,g=c.child;if(G.flags&16){var n=c.deletions;if(n!==null){for(var a=0;a<n.length;a++){var f=n[a];for(G=f;G!==null;){var _=G;switch(_.tag){case 0:case 11:case 15:Fs(8,_,c)}var p=_.child;if(p!==null)p.return=_,G=p;else for(;G!==null;){_=G;var m=_.sibling,S=_.return;if(Sp(_),_===f){G=null;break}if(m!==null){m.return=S,G=m;break}G=S}}}var b=c.alternate;if(b!==null){var w=b.child;if(w!==null){b.child=null;do{var u=w.sibling;w.sibling=null,w=u}while(w!==null)}}G=c}}if(c.subtreeFlags&2064&&g!==null)g.return=c,G=g;else e:for(;G!==null;){if(c=G,c.flags&2048)switch(c.tag){case 0:case 11:case 15:Fs(9,c,c.return)}var l=c.sibling;if(l!==null){l.return=c.return,G=l;break e}G=c.return}}var o=e.current;for(G=o;G!==null;){g=G;var d=g.child;if(g.subtreeFlags&2064&&d!==null)d.return=g,G=d;else e:for(g=o;G!==null;){if(n=G,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:Vo(9,n)}}catch(y){we(n,n.return,y)}if(n===g){G=null;break e}var v=n.sibling;if(v!==null){v.return=n.return,G=v;break e}G=n.return}}if(ae=s,Pr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(Ho,e)}catch{}i=!0}return i}finally{de=r,mt.transition=t}}return!1}function vd(e,t,r){t=es(r,t),t=cp(e,t,1),e=Cr(e,t,1),t=Ue(),e!==null&&(fn(e,1,t),rt(e,t))}function we(e,t,r){if(e.tag===3)vd(e,e,r);else for(;t!==null;){if(t.tag===3){vd(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(kr===null||!kr.has(i))){e=es(r,e),e=up(t,e,1),t=Cr(t,e,1),e=Ue(),t!==null&&(fn(t,1,e),rt(t,e));break}}t=t.return}}function Pm(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Ue(),e.pingedLanes|=e.suspendedLanes&r,Le===e&&(Be&r)===r&&(je===4||je===3&&(Be&130023424)===Be&&500>Ce()-$c?Zr(e,0):Wc|=r),rt(e,t)}function Tp(e,t){t===0&&(e.mode&1?(t=Dn,Dn<<=1,!(Dn&130023424)&&(Dn=4194304)):t=1);var r=Ue();e=Yt(e,t),e!==null&&(fn(e,t,r),rt(e,r))}function Bm(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Tp(e,r)}function Am(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(J(314))}i!==null&&i.delete(t),Tp(e,r)}var Lp;Lp=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Ze=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ze=!1,wm(e,t,r);Ze=!!(e.flags&131072)}else Ze=!1,ge&&t.flags&1048576&&Af(t,Co,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;oo(e,t),e=t.pendingProps;var s=Gi(t,He.current);Bi(t,r),s=Oc(null,t,i,e,s,r);var c=Ic();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tt(i)?(c=!0,wo(t)):c=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Lc(t),s.updater=qo,t.stateNode=s,s._reactInternals=t,xl(t,i,e,r),t=Cl(null,t,i,!0,c,r)):(t.tag=0,ge&&c&&Cc(t),We(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(oo(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=Im(i),e=xt(i,e),s){case 0:t=bl(null,t,i,e,r);break e;case 1:t=nd(null,t,i,e,r);break e;case 11:t=id(null,t,i,e,r);break e;case 14:t=sd(null,t,i,xt(i.type,e),r);break e}throw Error(J(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:xt(i,s),bl(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:xt(i,s),nd(e,t,i,s,r);case 3:e:{if(pp(t),e===null)throw Error(J(387));i=t.pendingProps,c=t.memoizedState,s=c.element,zf(e,t),Ro(t,i,null,r);var g=t.memoizedState;if(i=g.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){s=es(Error(J(423)),t),t=od(e,t,i,r,s);break e}else if(i!==s){s=es(Error(J(424)),t),t=od(e,t,i,r,s);break e}else for(ot=br(t.stateNode.containerInfo.firstChild),at=t,ge=!0,Ct=null,r=Nf(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Xi(),i===s){t=Zt(e,t,r);break e}We(e,t,i,r)}t=t.child}return t;case 5:return Wf(t),e===null&&_l(t),i=t.type,s=t.pendingProps,c=e!==null?e.memoizedProps:null,g=s.children,fl(i,s)?g=null:c!==null&&fl(i,c)&&(t.flags|=32),fp(e,t),We(e,t,g,r),t.child;case 6:return e===null&&_l(t),null;case 13:return vp(e,t,r);case 4:return Mc(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Yi(t,null,i,r):We(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:xt(i,s),id(e,t,i,s,r);case 7:return We(e,t,t.pendingProps,r),t.child;case 8:return We(e,t,t.pendingProps.children,r),t.child;case 12:return We(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,c=t.memoizedProps,g=s.value,fe(ko,i._currentValue),i._currentValue=g,c!==null)if(Rt(c.value,g)){if(c.children===s.children&&!et.current){t=Zt(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var n=c.dependencies;if(n!==null){g=c.child;for(var a=n.firstContext;a!==null;){if(a.context===i){if(c.tag===1){a=Vt(-1,r&-r),a.tag=2;var f=c.updateQueue;if(f!==null){f=f.shared;var _=f.pending;_===null?a.next=a:(a.next=_.next,_.next=a),f.pending=a}}c.lanes|=r,a=c.alternate,a!==null&&(a.lanes|=r),yl(c.return,r,t),n.lanes|=r;break}a=a.next}}else if(c.tag===10)g=c.type===t.type?null:c.child;else if(c.tag===18){if(g=c.return,g===null)throw Error(J(341));g.lanes|=r,n=g.alternate,n!==null&&(n.lanes|=r),yl(g,r,t),g=c.sibling}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===t){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}We(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Bi(t,r),s=_t(s),i=i(s),t.flags|=1,We(e,t,i,r),t.child;case 14:return i=t.type,s=xt(i,t.pendingProps),s=xt(i.type,s),sd(e,t,i,s,r);case 15:return dp(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:xt(i,s),oo(e,t),t.tag=1,tt(i)?(e=!0,wo(t)):e=!1,Bi(t,r),lp(t,i,s),xl(t,i,s,r),Cl(null,t,i,!0,e,r);case 19:return gp(e,t,r);case 22:return hp(e,t,r)}throw Error(J(156,t.tag))};function Mp(e,t){return nf(e,t)}function Om(e,t,r,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(e,t,r,i){return new Om(e,t,r,i)}function qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Im(e){if(typeof e=="function")return qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hc)return 11;if(e===fc)return 14}return 2}function Rr(e,t){var r=e.alternate;return r===null?(r=gt(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 co(e,t,r,i,s,c){var g=2;if(i=e,typeof e=="function")qc(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case yi:return ei(r.children,s,c,t);case dc:g=8,s|=8;break;case Ka:return e=gt(12,r,t,s|2),e.elementType=Ka,e.lanes=c,e;case Ja:return e=gt(13,r,t,s),e.elementType=Ja,e.lanes=c,e;case qa:return e=gt(19,r,t,s),e.elementType=qa,e.lanes=c,e;case zh:return Go(r,s,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nh:g=10;break e;case Hh:g=9;break e;case hc:g=11;break e;case fc:g=14;break e;case nr:g=16,i=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=gt(g,r,t,s),t.elementType=e,t.type=i,t.lanes=c,t}function ei(e,t,r,i){return e=gt(7,e,i,t),e.lanes=r,e}function Go(e,t,r,i){return e=gt(22,e,i,t),e.elementType=zh,e.lanes=r,e.stateNode={isHidden:!1},e}function Pa(e,t,r){return e=gt(6,e,null,t),e.lanes=r,e}function Ba(e,t,r){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fm(e,t,r,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pa(0),this.expirationTimes=pa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pa(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Vc(e,t,r,i,s,c,g,n,a){return e=new Fm(e,t,r,n,a),t===1?(t=1,c===!0&&(t|=8)):t=0,c=gt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lc(c),e}function Nm(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_i,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Pp(e){if(!e)return Tr;e=e._reactInternals;e:{if(li(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var r=e.type;if(tt(r))return Pf(e,r,t)}return t}function Bp(e,t,r,i,s,c,g,n,a){return e=Vc(r,i,!0,e,s,c,g,n,a),e.context=Pp(null),r=e.current,i=Ue(),s=Er(r),c=Vt(i,s),c.callback=t??null,Cr(r,c,s),e.current.lanes=s,fn(e,s,i),rt(e,i),e}function Xo(e,t,r,i){var s=t.current,c=Ue(),g=Er(s);return r=Pp(r),t.context===null?t.context=r:t.pendingContext=r,t=Vt(c,g),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Cr(s,t,g),e!==null&&(Et(e,s,g,c),io(e,s,g)),g}function Ao(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 gd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Qc(e,t){gd(e,t),(e=e.alternate)&&gd(e,t)}function Hm(){return null}var Ap=typeof reportError=="function"?reportError:function(e){console.error(e)};function Gc(e){this._internalRoot=e}Yo.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));Xo(e,t,null,null)};Yo.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ni(function(){Xo(null,e,null,null)}),t[Xt]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=hf();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ar.length&&t!==0&&t<ar[r].priority;r++);ar.splice(r,0,e),r===0&&pf(e)}};function Xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function md(){}function zm(e,t,r,i,s){if(s){if(typeof i=="function"){var c=i;i=function(){var f=Ao(g);c.call(f)}}var g=Bp(t,i,e,0,null,!1,!1,"",md);return e._reactRootContainer=g,e[Xt]=g.current,Qs(e.nodeType===8?e.parentNode:e),ni(),g}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var n=i;i=function(){var f=Ao(a);n.call(f)}}var a=Vc(e,0,!1,null,null,!1,!1,"",md);return e._reactRootContainer=a,e[Xt]=a.current,Qs(e.nodeType===8?e.parentNode:e),ni(function(){Xo(t,a,r,i)}),a}function ea(e,t,r,i,s){var c=r._reactRootContainer;if(c){var g=c;if(typeof s=="function"){var n=s;s=function(){var a=Ao(g);n.call(a)}}Xo(t,g,e,s)}else g=zm(r,t,e,s,i);return Ao(g)}uf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ds(t.pendingLanes);r!==0&&(gc(t,r|1),rt(t,Ce()),!(ae&6)&&(ts=Ce()+500,Pr()))}break;case 13:ni(function(){var i=Yt(e,1);if(i!==null){var s=Ue();Et(i,e,1,s)}}),Qc(e,1)}};mc=function(e){if(e.tag===13){var t=Yt(e,134217728);if(t!==null){var r=Ue();Et(t,e,134217728,r)}Qc(e,134217728)}};df=function(e){if(e.tag===13){var t=Er(e),r=Yt(e,t);if(r!==null){var i=Ue();Et(r,e,t,i)}Qc(e,t)}};hf=function(){return de};ff=function(e,t){var r=de;try{return de=e,t()}finally{de=r}};il=function(e,t,r){switch(t){case"input":if(Ga(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 i=r[t];if(i!==e&&i.form===e.form){var s=Uo(i);if(!s)throw Error(J(90));$h(i),Ga(i,s)}}}break;case"textarea":Kh(e,r);break;case"select":t=r.value,t!=null&&Ti(e,!!r.multiple,t,!1)}};Yh=Uc;Zh=ni;var Wm={usingClientEntryPoint:!1,Events:[vn,bi,Uo,Gh,Xh,Uc]},Ss={findFiberByHostInstance:Nr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$m={bundleType:Ss.bundleType,version:Ss.version,rendererPackageName:Ss.rendererPackageName,rendererConfig:Ss.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:er.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ss.findFiberByHostInstance||Hm,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 Hn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hn.isDisabled&&Hn.supportsFiber)try{Ho=Hn.inject($m),It=Hn}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wm;ct.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xc(t))throw Error(J(200));return Nm(e,t,null,r)};ct.createRoot=function(e,t){if(!Xc(e))throw Error(J(299));var r=!1,i="",s=Ap;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Vc(e,1,!1,null,null,r,!1,i,s),e[Xt]=t.current,Qs(e.nodeType===8?e.parentNode:e),new Gc(t)};ct.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(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=rf(t),e=e===null?null:e.stateNode,e};ct.flushSync=function(e){return ni(e)};ct.hydrate=function(e,t,r){if(!Zo(t))throw Error(J(200));return ea(null,e,t,!0,r)};ct.hydrateRoot=function(e,t,r){if(!Xc(e))throw Error(J(405));var i=r!=null&&r.hydratedSources||null,s=!1,c="",g=Ap;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),t=Bp(t,null,e,1,r??null,s,!1,c,g),e[Xt]=t.current,Qs(e),i)for(e=0;e<i.length;e++)r=i[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Yo(t)};ct.render=function(e,t,r){if(!Zo(t))throw Error(J(200));return ea(null,e,t,!1,r)};ct.unmountComponentAtNode=function(e){if(!Zo(e))throw Error(J(40));return e._reactRootContainer?(ni(function(){ea(null,null,e,!1,function(){e._reactRootContainer=null,e[Xt]=null})}),!0):!1};ct.unstable_batchedUpdates=Uc;ct.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Zo(r))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return ea(e,t,r,!1,i)};ct.version="18.3.1-next-f1338f8080-20240426";function Op(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Op)}catch(e){console.error(e)}}Op(),Ah.exports=ct;var Um=Ah.exports,_d=Um;$a.createRoot=_d.createRoot,$a.hydrateRoot=_d.hydrateRoot;var as=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(){}},Ur,cr,Oi,hh,Km=(hh=class extends as{constructor(){super();Z(this,Ur);Z(this,cr);Z(this,Oi);V(this,Oi,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,cr)||this.setEventListener(A(this,Oi))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,cr))==null||t.call(this),V(this,cr,void 0))}setEventListener(t){var r;V(this,Oi,t),(r=A(this,cr))==null||r.call(this),V(this,cr,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){A(this,Ur)!==t&&(V(this,Ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof A(this,Ur)=="boolean"?A(this,Ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ur=new WeakMap,cr=new WeakMap,Oi=new WeakMap,hh),Yc=new Km,Jm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ur,ic,fh,qm=(fh=class{constructor(){Z(this,ur,Jm);Z(this,ic,!1)}setTimeoutProvider(e){V(this,ur,e)}setTimeout(e,t){return A(this,ur).setTimeout(e,t)}clearTimeout(e){A(this,ur).clearTimeout(e)}setInterval(e,t){return A(this,ur).setInterval(e,t)}clearInterval(e){A(this,ur).clearInterval(e)}},ur=new WeakMap,ic=new WeakMap,fh),Wr=new qm;function Vm(e){setTimeout(e,0)}var Qm=typeof window>"u"||"Deno"in globalThis;function $e(){}function Gm(e,t){return typeof e=="function"?e(t):e}function Ol(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ip(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jr(e,t){return typeof e=="function"?e(t):e}function nt(e,t){return typeof e=="function"?e(t):e}function yd(e,t){const{type:r="all",exact:i,fetchStatus:s,predicate:c,queryKey:g,stale:n}=e;if(g){if(i){if(t.queryHash!==Zc(g,t.options))return!1}else if(!nn(t.queryKey,g))return!1}if(r!=="all"){const a=t.isActive();if(r==="active"&&!a||r==="inactive"&&a)return!1}return!(typeof n=="boolean"&&t.isStale()!==n||s&&s!==t.state.fetchStatus||c&&!c(t))}function Sd(e,t){const{exact:r,status:i,predicate:s,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(r){if(oi(t.options.mutationKey)!==oi(c))return!1}else if(!nn(t.options.mutationKey,c))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function Zc(e,t){return((t==null?void 0:t.queryKeyHashFn)||oi)(e)}function oi(e){return JSON.stringify(e,(t,r)=>Il(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function nn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>nn(e[r],t[r])):!1}var Xm=Object.prototype.hasOwnProperty;function Fp(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=xd(e)&&xd(t);if(!i&&!(Il(e)&&Il(t)))return t;const c=(i?e:Object.keys(e)).length,g=i?t:Object.keys(t),n=g.length,a=i?new Array(n):{};let f=0;for(let _=0;_<n;_++){const p=i?_:g[_],m=e[p],S=t[p];if(m===S){a[p]=m,(i?_<c:Xm.call(e,p))&&f++;continue}if(m===null||S===null||typeof m!="object"||typeof S!="object"){a[p]=S;continue}const b=Fp(m,S,r+1);a[p]=b,b===m&&f++}return c===n&&f===c?e:a}function Oo(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 xd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Il(e){if(!wd(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!wd(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ym(e){return new Promise(t=>{Wr.setTimeout(t,e)})}function Fl(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Fp(e,t):t}function Zm(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function e_(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var eu=Symbol();function Np(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===eu?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tu(e,t){return typeof e=="function"?e(...t):!!e}function t_(e,t,r){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var on=(()=>{let e=()=>Qm;return{isServer(){return e()},setIsServer(t){e=t}}})();function Nl(){let e,t;const r=new Promise((s,c)=>{e=s,t=c});r.status="pending",r.catch(()=>{});function i(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},r.reject=s=>{i({status:"rejected",reason:s}),t(s)},r}var r_=Vm;function i_(){let e=[],t=0,r=n=>{n()},i=n=>{n()},s=r_;const c=n=>{t?e.push(n):s(()=>{r(n)})},g=()=>{const n=e;e=[],n.length&&s(()=>{i(()=>{n.forEach(a=>{r(a)})})})};return{batch:n=>{let a;t++;try{a=n()}finally{t--,t||g()}return a},batchCalls:n=>(...a)=>{c(()=>{n(...a)})},schedule:c,setNotifyFunction:n=>{r=n},setBatchNotifyFunction:n=>{i=n},setScheduler:n=>{s=n}}}var Re=i_(),Ii,dr,Fi,ph,s_=(ph=class extends as{constructor(){super();Z(this,Ii,!0);Z(this,dr);Z(this,Fi);V(this,Fi,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){A(this,dr)||this.setEventListener(A(this,Fi))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,dr))==null||t.call(this),V(this,dr,void 0))}setEventListener(t){var r;V(this,Fi,t),(r=A(this,dr))==null||r.call(this),V(this,dr,t(this.setOnline.bind(this)))}setOnline(t){A(this,Ii)!==t&&(V(this,Ii,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return A(this,Ii)}},Ii=new WeakMap,dr=new WeakMap,Fi=new WeakMap,ph),Io=new s_;function n_(e){return Math.min(1e3*2**e,3e4)}function Hp(e){return(e??"online")==="online"?Io.isOnline():!0}var Hl=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zp(e){let t=!1,r=0,i;const s=Nl(),c=()=>s.status!=="pending",g=w=>{var u;if(!c()){const l=new Hl(w);m(l),(u=e.onCancel)==null||u.call(e,l)}},n=()=>{t=!0},a=()=>{t=!1},f=()=>Yc.isFocused()&&(e.networkMode==="always"||Io.isOnline())&&e.canRun(),_=()=>Hp(e.networkMode)&&e.canRun(),p=w=>{c()||(i==null||i(),s.resolve(w))},m=w=>{c()||(i==null||i(),s.reject(w))},S=()=>new Promise(w=>{var u;i=l=>{(c()||f())&&w(l)},(u=e.onPause)==null||u.call(e)}).then(()=>{var w;i=void 0,c()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(c())return;let w;const u=r===0?e.initialPromise:void 0;try{w=u??e.fn()}catch(l){w=Promise.reject(l)}Promise.resolve(w).then(p).catch(l=>{var C;if(c())return;const o=e.retry??(on.isServer()?0:3),d=e.retryDelay??n_,v=typeof d=="function"?d(r,l):d,y=o===!0||typeof o=="number"&&r<o||typeof o=="function"&&o(r,l);if(t||!y){m(l);return}r++,(C=e.onFail)==null||C.call(e,r,l),Ym(v).then(()=>f()?void 0:S()).then(()=>{t?m(l):b()})})};return{promise:s,status:()=>s.status,cancel:g,continue:()=>(i==null||i(),s),cancelRetry:n,continueRetry:a,canStart:_,start:()=>(_()?b():S().then(b),s)}}var Kr,vh,Wp=(vh=class{constructor(){Z(this,Kr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ol(this.gcTime)&&V(this,Kr,Wr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(on.isServer()?1/0:5*60*1e3))}clearGcTimeout(){A(this,Kr)!==void 0&&(Wr.clearTimeout(A(this,Kr)),V(this,Kr,void 0))}},Kr=new WeakMap,vh);function o_(e){return{onFetch:(t,r)=>{var _,p,m,S,b;const i=t.options,s=(m=(p=(_=t.fetchOptions)==null?void 0:_.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,c=((S=t.state.data)==null?void 0:S.pages)||[],g=((b=t.state.data)==null?void 0:b.pageParams)||[];let n={pages:[],pageParams:[]},a=0;const f=async()=>{let w=!1;const u=d=>{t_(d,()=>t.signal,()=>w=!0)},l=Np(t.options,t.fetchOptions),o=async(d,v,y)=>{if(w)return Promise.reject(t.signal.reason);if(v==null&&d.pages.length)return Promise.resolve(d);const k=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:v,direction:y?"backward":"forward",meta:t.options.meta};return u(B),B})(),x=await l(k),{maxPages:E}=t.options,T=y?e_:Zm;return{pages:T(d.pages,x,E),pageParams:T(d.pageParams,v,E)}};if(s&&c.length){const d=s==="backward",v=d?a_:bd,y={pages:c,pageParams:g},C=v(i,y);n=await o(y,C,d)}else{const d=e??c.length;do{const v=a===0?g[0]??i.initialPageParam:bd(i,n);if(a>0&&v==null)break;n=await o(n,v),a++}while(a<d)}return n};t.options.persister?t.fetchFn=()=>{var w,u;return(u=(w=t.options).persister)==null?void 0:u.call(w,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=f}}}function bd(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function a_(e,{pages:t,pageParams:r}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,r[0],r):void 0}var Ni,Jr,Hi,ht,qr,De,an,Vr,st,$p,Nt,gh,l_=(gh=class extends Wp{constructor(t){super();Z(this,st);Z(this,Ni);Z(this,Jr);Z(this,Hi);Z(this,ht);Z(this,qr);Z(this,De);Z(this,an);Z(this,Vr);V(this,Vr,!1),V(this,an,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,qr,t.client),V(this,ht,A(this,qr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,Jr,kd(this.options)),this.state=t.state??A(this,Jr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,Ni)}get promise(){var t;return(t=A(this,De))==null?void 0:t.promise}setOptions(t){if(this.options={...A(this,an),...t},t!=null&&t._type&&V(this,Ni,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=kd(this.options);r.data!==void 0&&(this.setState(Cd(r.data,r.dataUpdatedAt)),V(this,Jr,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,ht).remove(this)}setData(t,r){const i=Fl(this.state.data,t,this.options);return te(this,st,Nt).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(t){te(this,st,Nt).call(this,{type:"setState",state:t})}cancel(t){var i,s;const r=(i=A(this,De))==null?void 0:i.promise;return(s=A(this,De))==null||s.cancel(t),r?r.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,Jr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>nt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>jr(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:!Ip(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,De))==null||r.continue()}onOnline(){var r;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,De))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,ht).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(A(this,De)&&(A(this,Vr)||te(this,st,$p).call(this)?A(this,De).cancel({revert:!0}):A(this,De).cancelRetry()),this.scheduleGc()),A(this,ht).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,st,Nt).call(this,{type:"invalidate"})}async fetch(t,r){var f,_,p,m,S,b,w,u,l,o,d;if(this.state.fetchStatus!=="idle"&&((f=A(this,De))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,De))return A(this,De).continueRetry(),A(this,De).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(y=>y.options.queryFn);v&&this.setOptions(v.options)}const i=new AbortController,s=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(V(this,Vr,!0),i.signal)})},c=()=>{const v=Np(this.options,r),C=(()=>{const k={client:A(this,qr),queryKey:this.queryKey,meta:this.meta};return s(k),k})();return V(this,Vr,!1),this.options.persister?this.options.persister(v,C,this):v(C)},n=(()=>{const v={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,qr),state:this.state,fetchFn:c};return s(v),v})(),a=A(this,Ni)==="infinite"?o_(this.options.pages):this.options.behavior;a==null||a.onFetch(n,this),V(this,Hi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=n.fetchOptions)==null?void 0:_.meta))&&te(this,st,Nt).call(this,{type:"fetch",meta:(p=n.fetchOptions)==null?void 0:p.meta}),V(this,De,zp({initialPromise:r==null?void 0:r.initialPromise,fn:n.fetchFn,onCancel:v=>{v instanceof Hl&&v.revert&&this.setState({...A(this,Hi),fetchStatus:"idle"}),i.abort()},onFail:(v,y)=>{te(this,st,Nt).call(this,{type:"failed",failureCount:v,error:y})},onPause:()=>{te(this,st,Nt).call(this,{type:"pause"})},onContinue:()=>{te(this,st,Nt).call(this,{type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0}));try{const v=await A(this,De).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(S=(m=A(this,ht).config).onSuccess)==null||S.call(m,v,this),(w=(b=A(this,ht).config).onSettled)==null||w.call(b,v,this.state.error,this),v}catch(v){if(v instanceof Hl){if(v.silent)return A(this,De).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw te(this,st,Nt).call(this,{type:"error",error:v}),(l=(u=A(this,ht).config).onError)==null||l.call(u,v,this),(d=(o=A(this,ht).config).onSettled)==null||d.call(o,this.state.data,v,this),v}finally{this.scheduleGc()}}},Ni=new WeakMap,Jr=new WeakMap,Hi=new WeakMap,ht=new WeakMap,qr=new WeakMap,De=new WeakMap,an=new WeakMap,Vr=new WeakMap,st=new WeakSet,$p=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Nt=function(t){const r=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Up(i.data,this.options),fetchMeta:t.meta??null};case"success":const s={...i,...Cd(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return V(this,Hi,t.manual?s:void 0),s;case"error":const c=t.error;return{...i,error:c,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=r(this.state),Re.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),A(this,ht).notify({query:this,type:"updated",action:t})})},gh);function Up(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cd(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kd(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Qe,ne,ln,ze,Qr,zi,Wt,hr,cn,Wi,$i,Gr,Xr,fr,Ui,ce,Ls,zl,Wl,$l,Ul,Kl,Jl,ql,Kp,mh,c_=(mh=class extends as{constructor(t,r){super();Z(this,ce);Z(this,Qe);Z(this,ne);Z(this,ln);Z(this,ze);Z(this,Qr);Z(this,zi);Z(this,Wt);Z(this,hr);Z(this,cn);Z(this,Wi);Z(this,$i);Z(this,Gr);Z(this,Xr);Z(this,fr);Z(this,Ui,new Set);this.options=r,V(this,Qe,t),V(this,hr,null),V(this,Wt,Nl()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,ne).addObserver(this),Ed(A(this,ne),this.options)?te(this,ce,Ls).call(this):this.updateResult(),te(this,ce,Ul).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vl(A(this,ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vl(A(this,ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,ce,Kl).call(this),te(this,ce,Jl).call(this),A(this,ne).removeObserver(this)}setOptions(t){const r=this.options,i=A(this,ne);if(this.options=A(this,Qe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nt(this.options.enabled,A(this,ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,ce,ql).call(this),A(this,ne).setOptions(this.options),r._defaulted&&!Oo(this.options,r)&&A(this,Qe).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,ne),observer:this});const s=this.hasListeners();s&&Rd(A(this,ne),i,this.options,r)&&te(this,ce,Ls).call(this),this.updateResult(),s&&(A(this,ne)!==i||nt(this.options.enabled,A(this,ne))!==nt(r.enabled,A(this,ne))||jr(this.options.staleTime,A(this,ne))!==jr(r.staleTime,A(this,ne)))&&te(this,ce,zl).call(this);const c=te(this,ce,Wl).call(this);s&&(A(this,ne)!==i||nt(this.options.enabled,A(this,ne))!==nt(r.enabled,A(this,ne))||c!==A(this,fr))&&te(this,ce,$l).call(this,c)}getOptimisticResult(t){const r=A(this,Qe).getQueryCache().build(A(this,Qe),t),i=this.createResult(r,t);return d_(this,i)&&(V(this,ze,i),V(this,zi,this.options),V(this,Qr,A(this,ne).state)),i}getCurrentResult(){return A(this,ze)}trackResult(t,r){return new Proxy(t,{get:(i,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&A(this,Wt).status==="pending"&&A(this,Wt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(t){A(this,Ui).add(t)}getCurrentQuery(){return A(this,ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=A(this,Qe).defaultQueryOptions(t),i=A(this,Qe).getQueryCache().build(A(this,Qe),r);return i.fetch().then(()=>this.createResult(i,r))}fetch(t){return te(this,ce,Ls).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,ze)))}createResult(t,r){var E;const i=A(this,ne),s=this.options,c=A(this,ze),g=A(this,Qr),n=A(this,zi),f=t!==i?t.state:A(this,ln),{state:_}=t;let p={..._},m=!1,S;if(r._optimisticResults){const T=this.hasListeners(),B=!T&&Ed(t,r),D=T&&Rd(t,i,r,s);(B||D)&&(p={...p,...Up(_.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:u}=p;S=p.data;let l=!1;if(r.placeholderData!==void 0&&S===void 0&&u==="pending"){let T;c!=null&&c.isPlaceholderData&&r.placeholderData===(n==null?void 0:n.placeholderData)?(T=c.data,l=!0):T=typeof r.placeholderData=="function"?r.placeholderData((E=A(this,$i))==null?void 0:E.state.data,A(this,$i)):r.placeholderData,T!==void 0&&(u="success",S=Fl(c==null?void 0:c.data,T,r),m=!0)}if(r.select&&S!==void 0&&!l)if(c&&S===(g==null?void 0:g.data)&&r.select===A(this,cn))S=A(this,Wi);else try{V(this,cn,r.select),S=r.select(S),S=Fl(c==null?void 0:c.data,S,r),V(this,Wi,S),V(this,hr,null)}catch(T){V(this,hr,T)}A(this,hr)&&(b=A(this,hr),S=A(this,Wi),w=Date.now(),u="error");const o=p.fetchStatus==="fetching",d=u==="pending",v=u==="error",y=d&&o,C=S!==void 0,x={status:u,fetchStatus:p.fetchStatus,isPending:d,isSuccess:u==="success",isError:v,isInitialLoading:y,isLoading:y,data:S,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:o,isRefetching:o&&!d,isLoadingError:v&&!C,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:v&&C,isStale:ru(t,r),refetch:this.refetch,promise:A(this,Wt),isEnabled:nt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=x.data!==void 0,B=x.status==="error"&&!T,D=N=>{B?N.reject(x.error):T&&N.resolve(x.data)},P=()=>{const N=V(this,Wt,x.promise=Nl());D(N)},F=A(this,Wt);switch(F.status){case"pending":t.queryHash===i.queryHash&&D(F);break;case"fulfilled":(B||x.data!==F.value)&&P();break;case"rejected":(!B||x.error!==F.reason)&&P();break}}return x}updateResult(){const t=A(this,ze),r=this.createResult(A(this,ne),this.options);if(V(this,Qr,A(this,ne).state),V(this,zi,this.options),A(this,Qr).data!==void 0&&V(this,$i,A(this,ne)),Oo(r,t))return;V(this,ze,r);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!A(this,Ui).size)return!0;const g=new Set(c??A(this,Ui));return this.options.throwOnError&&g.add("error"),Object.keys(A(this,ze)).some(n=>{const a=n;return A(this,ze)[a]!==t[a]&&g.has(a)})};te(this,ce,Kp).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,ce,Ul).call(this)}},Qe=new WeakMap,ne=new WeakMap,ln=new WeakMap,ze=new WeakMap,Qr=new WeakMap,zi=new WeakMap,Wt=new WeakMap,hr=new WeakMap,cn=new WeakMap,Wi=new WeakMap,$i=new WeakMap,Gr=new WeakMap,Xr=new WeakMap,fr=new WeakMap,Ui=new WeakMap,ce=new WeakSet,Ls=function(t){te(this,ce,ql).call(this);let r=A(this,ne).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch($e)),r},zl=function(){te(this,ce,Kl).call(this);const t=jr(this.options.staleTime,A(this,ne));if(on.isServer()||A(this,ze).isStale||!Ol(t))return;const i=Ip(A(this,ze).dataUpdatedAt,t)+1;V(this,Gr,Wr.setTimeout(()=>{A(this,ze).isStale||this.updateResult()},i))},Wl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,ne)):this.options.refetchInterval)??!1},$l=function(t){te(this,ce,Jl).call(this),V(this,fr,t),!(on.isServer()||nt(this.options.enabled,A(this,ne))===!1||!Ol(A(this,fr))||A(this,fr)===0)&&V(this,Xr,Wr.setInterval(()=>{(this.options.refetchIntervalInBackground||Yc.isFocused())&&te(this,ce,Ls).call(this)},A(this,fr)))},Ul=function(){te(this,ce,zl).call(this),te(this,ce,$l).call(this,te(this,ce,Wl).call(this))},Kl=function(){A(this,Gr)!==void 0&&(Wr.clearTimeout(A(this,Gr)),V(this,Gr,void 0))},Jl=function(){A(this,Xr)!==void 0&&(Wr.clearInterval(A(this,Xr)),V(this,Xr,void 0))},ql=function(){const t=A(this,Qe).getQueryCache().build(A(this,Qe),this.options);if(t===A(this,ne))return;const r=A(this,ne);V(this,ne,t),V(this,ln,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Kp=function(t){Re.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(A(this,ze))}),A(this,Qe).getQueryCache().notify({query:A(this,ne),type:"observerResultsUpdated"})})},mh);function u_(e,t){return nt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&nt(t.retryOnMount,e)===!1)}function Ed(e,t){return u_(e,t)||e.state.data!==void 0&&Vl(e,t,t.refetchOnMount)}function Vl(e,t,r){if(nt(t.enabled,e)!==!1&&jr(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&ru(e,t)}return!1}function Rd(e,t,r,i){return(e!==t||nt(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ru(e,r)}function ru(e,t){return nt(t.enabled,e)!==!1&&e.isStaleByTime(jr(t.staleTime,e))}function d_(e,t){return!Oo(e.getCurrentResult(),t)}var un,Mt,Fe,Yr,Pt,sr,_h,h_=(_h=class extends Wp{constructor(t){super();Z(this,Pt);Z(this,un);Z(this,Mt);Z(this,Fe);Z(this,Yr);V(this,un,t.client),this.mutationId=t.mutationId,V(this,Fe,t.mutationCache),V(this,Mt,[]),this.state=t.state||Jp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,Mt).includes(t)||(A(this,Mt).push(t),this.clearGcTimeout(),A(this,Fe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,Mt,A(this,Mt).filter(r=>r!==t)),this.scheduleGc(),A(this,Fe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,Mt).length||(this.state.status==="pending"?this.scheduleGc():A(this,Fe).remove(this))}continue(){var t;return((t=A(this,Yr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var g,n,a,f,_,p,m,S,b,w,u,l,o,d,v,y,C,k;const r=()=>{te(this,Pt,sr).call(this,{type:"continue"})},i={client:A(this,un),meta:this.options.meta,mutationKey:this.options.mutationKey};V(this,Yr,zp({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(x,E)=>{te(this,Pt,sr).call(this,{type:"failed",failureCount:x,error:E})},onPause:()=>{te(this,Pt,sr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Fe).canRun(this)}));const s=this.state.status==="pending",c=!A(this,Yr).canStart();try{if(s)r();else{te(this,Pt,sr).call(this,{type:"pending",variables:t,isPaused:c}),A(this,Fe).config.onMutate&&await A(this,Fe).config.onMutate(t,this,i);const E=await((n=(g=this.options).onMutate)==null?void 0:n.call(g,t,i));E!==this.state.context&&te(this,Pt,sr).call(this,{type:"pending",context:E,variables:t,isPaused:c})}const x=await A(this,Yr).start();return await((f=(a=A(this,Fe).config).onSuccess)==null?void 0:f.call(a,x,t,this.state.context,this,i)),await((p=(_=this.options).onSuccess)==null?void 0:p.call(_,x,t,this.state.context,i)),await((S=(m=A(this,Fe).config).onSettled)==null?void 0:S.call(m,x,null,this.state.variables,this.state.context,this,i)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,x,null,t,this.state.context,i)),te(this,Pt,sr).call(this,{type:"success",data:x}),x}catch(x){try{await((l=(u=A(this,Fe).config).onError)==null?void 0:l.call(u,x,t,this.state.context,this,i))}catch(E){Promise.reject(E)}try{await((d=(o=this.options).onError)==null?void 0:d.call(o,x,t,this.state.context,i))}catch(E){Promise.reject(E)}try{await((y=(v=A(this,Fe).config).onSettled)==null?void 0:y.call(v,void 0,x,this.state.variables,this.state.context,this,i))}catch(E){Promise.reject(E)}try{await((k=(C=this.options).onSettled)==null?void 0:k.call(C,void 0,x,t,this.state.context,i))}catch(E){Promise.reject(E)}throw te(this,Pt,sr).call(this,{type:"error",error:x}),x}finally{A(this,Fe).runNext(this)}}},un=new WeakMap,Mt=new WeakMap,Fe=new WeakMap,Yr=new WeakMap,Pt=new WeakSet,sr=function(t){const r=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Re.batch(()=>{A(this,Mt).forEach(i=>{i.onMutationUpdate(t)}),A(this,Fe).notify({mutation:this,type:"updated",action:t})})},_h);function Jp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $t,wt,dn,yh,f_=(yh=class extends as{constructor(t={}){super();Z(this,$t);Z(this,wt);Z(this,dn);this.config=t,V(this,$t,new Set),V(this,wt,new Map),V(this,dn,0)}build(t,r,i){const s=new h_({client:t,mutationCache:this,mutationId:++bn(this,dn)._,options:t.defaultMutationOptions(r),state:i});return this.add(s),s}add(t){A(this,$t).add(t);const r=zn(t);if(typeof r=="string"){const i=A(this,wt).get(r);i?i.push(t):A(this,wt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,$t).delete(t)){const r=zn(t);if(typeof r=="string"){const i=A(this,wt).get(r);if(i)if(i.length>1){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}else i[0]===t&&A(this,wt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=zn(t);if(typeof r=="string"){const i=A(this,wt).get(r),s=i==null?void 0:i.find(c=>c.state.status==="pending");return!s||s===t}else return!0}runNext(t){var i;const r=zn(t);if(typeof r=="string"){const s=(i=A(this,wt).get(r))==null?void 0:i.find(c=>c!==t&&c.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Re.batch(()=>{A(this,$t).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,$t).clear(),A(this,wt).clear()})}getAll(){return Array.from(A(this,$t))}find(t){const r={exact:!0,...t};return this.getAll().find(i=>Sd(r,i))}findAll(t={}){return this.getAll().filter(r=>Sd(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($e))))}},$t=new WeakMap,wt=new WeakMap,dn=new WeakMap,yh);function zn(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ut,pr,Ge,Kt,Qt,uo,Ql,Sh,p_=(Sh=class extends as{constructor(r,i){super();Z(this,Qt);Z(this,Ut);Z(this,pr);Z(this,Ge);Z(this,Kt);V(this,Ut,r),this.setOptions(i),this.bindMethods(),te(this,Qt,uo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const i=this.options;this.options=A(this,Ut).defaultMutationOptions(r),Oo(this.options,i)||A(this,Ut).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,Ge),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&oi(i.mutationKey)!==oi(this.options.mutationKey)?this.reset():((s=A(this,Ge))==null?void 0:s.state.status)==="pending"&&A(this,Ge).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=A(this,Ge))==null||r.removeObserver(this)}onMutationUpdate(r){te(this,Qt,uo).call(this),te(this,Qt,Ql).call(this,r)}getCurrentResult(){return A(this,pr)}reset(){var r;(r=A(this,Ge))==null||r.removeObserver(this),V(this,Ge,void 0),te(this,Qt,uo).call(this),te(this,Qt,Ql).call(this)}mutate(r,i){var s;return V(this,Kt,i),(s=A(this,Ge))==null||s.removeObserver(this),V(this,Ge,A(this,Ut).getMutationCache().build(A(this,Ut),this.options)),A(this,Ge).addObserver(this),A(this,Ge).execute(r)}},Ut=new WeakMap,pr=new WeakMap,Ge=new WeakMap,Kt=new WeakMap,Qt=new WeakSet,uo=function(){var i;const r=((i=A(this,Ge))==null?void 0:i.state)??Jp();V(this,pr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Ql=function(r){Re.batch(()=>{var i,s,c,g,n,a,f,_;if(A(this,Kt)&&this.hasListeners()){const p=A(this,pr).variables,m=A(this,pr).context,S={client:A(this,Ut),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(i=A(this,Kt)).onSuccess)==null||s.call(i,r.data,p,m,S)}catch(b){Promise.reject(b)}try{(g=(c=A(this,Kt)).onSettled)==null||g.call(c,r.data,null,p,m,S)}catch(b){Promise.reject(b)}}else if((r==null?void 0:r.type)==="error"){try{(a=(n=A(this,Kt)).onError)==null||a.call(n,r.error,p,m,S)}catch(b){Promise.reject(b)}try{(_=(f=A(this,Kt)).onSettled)==null||_.call(f,void 0,r.error,p,m,S)}catch(b){Promise.reject(b)}}}this.listeners.forEach(p=>{p(A(this,pr))})})},Sh),Bt,xh,v_=(xh=class extends as{constructor(t={}){super();Z(this,Bt);this.config=t,V(this,Bt,new Map)}build(t,r,i){const s=r.queryKey,c=r.queryHash??Zc(s,r);let g=this.get(c);return g||(g=new l_({client:t,queryKey:s,queryHash:c,options:t.defaultQueryOptions(r),state:i,defaultOptions:t.getQueryDefaults(s)}),this.add(g)),g}add(t){A(this,Bt).has(t.queryHash)||(A(this,Bt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=A(this,Bt).get(t.queryHash);r&&(t.destroy(),r===t&&A(this,Bt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Re.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,Bt).get(t)}getAll(){return[...A(this,Bt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(i=>yd(r,i))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(i=>yd(t,i)):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()})})}},Bt=new WeakMap,xh),xe,vr,gr,Ki,Ji,mr,qi,Vi,wh,g_=(wh=class{constructor(e={}){Z(this,xe);Z(this,vr);Z(this,gr);Z(this,Ki);Z(this,Ji);Z(this,mr);Z(this,qi);Z(this,Vi);V(this,xe,e.queryCache||new v_),V(this,vr,e.mutationCache||new f_),V(this,gr,e.defaultOptions||{}),V(this,Ki,new Map),V(this,Ji,new Map),V(this,mr,0)}mount(){bn(this,mr)._++,A(this,mr)===1&&(V(this,qi,Yc.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,xe).onFocus())})),V(this,Vi,Io.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,xe).onOnline())})))}unmount(){var e,t;bn(this,mr)._--,A(this,mr)===0&&((e=A(this,qi))==null||e.call(this),V(this,qi,void 0),(t=A(this,Vi))==null||t.call(this),V(this,Vi,void 0))}isFetching(e){return A(this,xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,vr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=A(this,xe).build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(jr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return A(this,xe).findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),s=A(this,xe).get(i.queryHash),c=s==null?void 0:s.state.data,g=Gm(t,c);if(g!==void 0)return A(this,xe).build(this,i).setData(g,{...r,manual:!0})}setQueriesData(e,t,r){return Re.batch(()=>A(this,xe).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=A(this,xe);Re.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=A(this,xe);return Re.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=Re.batch(()=>A(this,xe).findAll(e).map(s=>s.cancel(r)));return Promise.all(i).then($e).catch($e)}invalidateQueries(e,t={}){return Re.batch(()=>(A(this,xe).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},i=Re.batch(()=>A(this,xe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let c=s.fetch(void 0,r);return r.throwOnError||(c=c.catch($e)),s.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(i).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=A(this,xe).build(this,t);return r.isStaleByTime(jr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Io.isOnline()?A(this,vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,xe)}getMutationCache(){return A(this,vr)}getDefaultOptions(){return A(this,gr)}setDefaultOptions(e){V(this,gr,e)}setQueryDefaults(e,t){A(this,Ki).set(oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,Ki).values()],r={};return t.forEach(i=>{nn(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){A(this,Ji).set(oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,Ji).values()],r={};return t.forEach(i=>{nn(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,gr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zc(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===eu&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,gr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,xe).clear(),A(this,vr).clear()}},xe=new WeakMap,vr=new WeakMap,gr=new WeakMap,Ki=new WeakMap,Ji=new WeakMap,mr=new WeakMap,qi=new WeakMap,Vi=new WeakMap,wh),qp=H.createContext(void 0),ta=e=>{const t=H.useContext(qp);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},m_=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(qp.Provider,{value:e,children:t})),Vp=H.createContext(!1),__=()=>H.useContext(Vp);Vp.Provider;function y_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var S_=H.createContext(y_()),x_=()=>H.useContext(S_),w_=(e,t,r)=>{const i=r!=null&&r.state.error&&typeof e.throwOnError=="function"?tu(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},b_=e=>{H.useEffect(()=>{e.clearReset()},[e])},C_=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||tu(r,[e.error,i])),k_=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>r(i(...s)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},E_=(e,t)=>e.isLoading&&e.isFetching&&!t,R_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,jd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function j_(e,t,r){var m,S,b,w;const i=__(),s=x_(),c=ta(),g=c.defaultQueryOptions(e);(S=(m=c.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||S.call(m,g);const n=c.getQueryCache().get(g.queryHash);g._optimisticResults=i?"isRestoring":"optimistic",k_(g),w_(g,s,n),b_(s);const a=!c.getQueryCache().get(g.queryHash),[f]=H.useState(()=>new t(c,g)),_=f.getOptimisticResult(g),p=!i&&e.subscribed!==!1;if(H.useSyncExternalStore(H.useCallback(u=>{const l=p?f.subscribe(Re.batchCalls(u)):$e;return f.updateResult(),l},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),H.useEffect(()=>{f.setOptions(g)},[g,f]),R_(g,_))throw jd(g,f,s);if(C_({result:_,errorResetBoundary:s,throwOnError:g.throwOnError,query:n,suspense:g.suspense}))throw _.error;if((w=(b=c.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,g,_),g.experimental_prefetchInRender&&!on.isServer()&&E_(_,i)){const u=a?jd(g,f,s):n==null?void 0:n.promise;u==null||u.catch($e).finally(()=>{f.updateResult()})}return g.notifyOnChangeProps?_:f.trackResult(_)}function be(e,t){return j_(e,c_)}function Gl(e,t){const r=ta(),[i]=H.useState(()=>new p_(r,e));H.useEffect(()=>{i.setOptions(e)},[i,e]);const s=H.useSyncExternalStore(H.useCallback(g=>i.subscribe(Re.batchCalls(g)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=H.useCallback((g,n)=>{i.mutate(g,n).catch($e)},[i]);if(s.error&&tu(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}function D_(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,i,s,c,g=[],n="",a=e.split("/");for(a[0]||a.shift();s=a.shift();)r=s[0],r==="*"?(g.push(r),n+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(i=s.indexOf("?",1),c=s.indexOf(".",1),g.push(s.substring(1,~i?i:~c?c:s.length)),n+=~i&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(n+=(~i?"?":"")+"\\"+s.substring(c))):n+="/"+s;return{keys:g,pattern:new RegExp("^"+n+(t?"(?=$|/)":"/?$"),"i")}}var Qp={exports:{}},Gp={};/**
|
|
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 rs=H;function T_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L_=typeof Object.is=="function"?Object.is:T_,M_=rs.useState,P_=rs.useEffect,B_=rs.useLayoutEffect,A_=rs.useDebugValue;function O_(e,t){var r=t(),i=M_({inst:{value:r,getSnapshot:t}}),s=i[0].inst,c=i[1];return B_(function(){s.value=r,s.getSnapshot=t,Aa(s)&&c({inst:s})},[e,r,t]),P_(function(){return Aa(s)&&c({inst:s}),e(function(){Aa(s)&&c({inst:s})})},[e]),A_(r),r}function Aa(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!L_(e,r)}catch{return!0}}function I_(e,t){return t()}var F_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I_:O_;Gp.useSyncExternalStore=rs.useSyncExternalStore!==void 0?rs.useSyncExternalStore:F_;Qp.exports=Gp;var N_=Qp.exports;const H_=Pv.useInsertionEffect,z_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Xp=z_?H.useLayoutEffect:H.useEffect,W_=H_||Xp,iu=e=>{const t=H.useRef([e,(...r)=>t[0](...r)]).current;return W_(()=>{t[0]=e}),t[1]},$_="popstate",su="pushState",nu="replaceState",U_="hashchange",Dd=[$_,su,nu,U_],K_=e=>{for(const t of Dd)addEventListener(t,e);return()=>{for(const t of Dd)removeEventListener(t,e)}},Yp=(e,t)=>N_.useSyncExternalStore(K_,e,t),Td=()=>location.search,J_=({ssrSearch:e}={})=>Yp(Td,e!=null?()=>e:Td),Ld=()=>location.pathname,q_=({ssrPath:e}={})=>Yp(Ld,e!=null?()=>e:Ld),V_=(e,{replace:t=!1,state:r=null}={})=>history[t?nu:su](r,"",e),Q_=(e={})=>[q_(e),V_],Md=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Md]>"u"){for(const e of[su,nu]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),i=new Event(e);return i.arguments=arguments,dispatchEvent(i),r}}Object.defineProperty(window,Md,{value:!0})}const G_=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Zp=(e="")=>e==="/"?"":e,X_=(e,t)=>e[0]==="~"?e.slice(1):Zp(t)+e,Y_=(e="",t)=>G_(Pd(Zp(e)),Pd(t)),Pd=e=>{try{return decodeURI(e)}catch{return e}},ev={hook:Q_,searchHook:J_,parser:D_,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},tv=H.createContext(ev),ls=()=>H.useContext(tv),rv={},iv=H.createContext(rv),ou=()=>H.useContext(iv),mn=e=>{const[t,r]=e.hook(e);return[Y_(e.base,t),iu((i,s)=>e.aroundNav(r,X_(i,e.base),s))]},_n=()=>mn(ls()),sv=(e,t,r,i)=>{const{pattern:s,keys:c}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",i),g=s.exec(r)||[],[n,...a]=g;return n!==void 0?[!0,(()=>{const f=c!==!1?Object.fromEntries(c.map((p,m)=>[p,a[m]])):g.groups;let _={...a};return f&&Object.assign(_,f),_})(),...i?[n]:[]]:[!1,null]},nv=({children:e,...t})=>{var _,p,m;const r=ls(),i=t.hook?ev:r;let s=i;const[c,g=t.ssrSearch??""]=((_=t.ssrPath)==null?void 0:_.split("?"))??[];c&&(t.ssrSearch=g,t.ssrPath=c),t.hrefs=t.hrefs??((p=t.hook)==null?void 0:p.hrefs),t.searchHook=t.searchHook??((m=t.hook)==null?void 0:m.searchHook);let n=H.useRef({}),a=n.current,f=a;for(let S in i){const b=S==="base"?i[S]+(t[S]??""):t[S]??i[S];a===f&&b!==f[S]&&(n.current=f={...f}),f[S]=b,(b!==i[S]||b!==s[S])&&(s=f)}return H.createElement(tv.Provider,{value:s,children:e})},Bd=({children:e,component:t},r)=>t?H.createElement(t,{params:r}):typeof e=="function"?e(r):e,Z_=e=>{let t=H.useRef(rv);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([i,s])=>s!==r[i])?e:r},Tt=({path:e,nest:t,match:r,...i})=>{const s=ls(),[c]=mn(s),[g,n,a]=r??sv(s.parser,e,c,t),f=Z_({...ou(),...n});if(!g)return null;const _=a?H.createElement(nv,{base:a},Bd(i,f)):Bd(i,f);return H.createElement(iv.Provider,{value:f,children:_})},Br=H.forwardRef((e,t)=>{const r=ls(),[i,s]=mn(r),{to:c="",href:g=c,onClick:n,asChild:a,children:f,className:_,replace:p,state:m,transition:S,...b}=e,w=iu(l=>{l.ctrlKey||l.metaKey||l.altKey||l.shiftKey||l.button!==0||(n==null||n(l),l.defaultPrevented||(l.preventDefault(),s(g,e)))}),u=r.hrefs(g[0]==="~"?g.slice(1):r.base+g,r);return a&&H.isValidElement(f)?H.cloneElement(f,{onClick:w,href:u}):H.createElement("a",{...b,onClick:w,href:u,className:_!=null&&_.call?_(i===g):_,children:f,ref:t})}),ov=e=>Array.isArray(e)?e.flatMap(t=>ov(t&&t.type===H.Fragment?t.props.children:t)):[e],ey=({children:e,location:t})=>{const r=ls(),[i]=mn(r);for(const s of ov(e)){let c=0;if(H.isValidElement(s)&&(c=sv(r.parser,s.props.path,t||i,s.props.nest))[0])return H.cloneElement(s,{match:c})}return null},Xl=e=>{const{to:t,href:r=t}=e,i=ls(),[,s]=mn(i),c=iu(()=>s(t||r,e)),{ssrContext:g}=i;return Xp(()=>{c()},[]),g&&(g.redirectTo=t),null};async function oe(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok)throw new Error(`${r.status} ${r.statusText} on ${e}`);return r.json()}const re={getStatus:()=>oe("/v1/status"),getBootstrap:()=>oe("/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)),oe(`/v1/events/recent?${r.toString()}`)},getClaudeAuth:()=>oe("/v1/auth/claude"),installClaudeCode:()=>oe("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>oe("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:()=>oe("/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>oe("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),claimRewards:()=>oe("/api/admin/claim-rewards",{method:"POST"}),restartDaemon:()=>oe("/api/admin/restart",{method:"POST"}),getSolverNets:()=>oe("/v1/solvernets"),updateSolverNet:(e,t)=>oe(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>oe("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),retryAgentBinding:e=>oe("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateHarnessMode:e=>oe("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),fetchLauncherStatus:()=>oe("/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 oe(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>oe(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>oe("/v1/solvernets/drafts"),getDraft:e=>oe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>oe("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>oe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>oe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>oe(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>oe(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>oe(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>oe(`/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 oe(`/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 oe(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>oe(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{join:(e,t)=>oe(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>oe(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>oe("/v1/operator/joined")}};async function ty(){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 ry(e){const[t,r]=H.useState([]),[i,s]=H.useState(!1);return H.useEffect(()=>{const c="",g=new EventSource(`/v1/events${c}`,{withCredentials:!0});return g.onopen=()=>s(!0),g.onerror=()=>s(!1),g.onmessage=n=>{try{const a=JSON.parse(n.data);r(f=>[...f.slice(-499),a])}catch{}},()=>{g.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:i}}function iy({headline:e}){const[t,r]=H.useState(!1),{events:i}=ry(),s=i.length>0?i[i.length-1]:null;return h.jsx("div",{className:"min-h-screen flex items-center justify-center px-10 py-16",style:{background:"var(--bg)",color:"var(--fg)"},children:h.jsxs("div",{className:"max-w-xl w-full flex flex-col gap-6",children:[h.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · starting up"}),h.jsxs("h1",{className:"j-display",style:{fontSize:"64px",lineHeight:1.05},children:[e,"."]}),h.jsx("p",{className:"j-mono text-sm",style:{color:"var(--fg-muted)",minHeight:"1.5em"},children:s?sy(s):"The daemon is booting. This usually takes a second."}),h.jsx("button",{type:"button",onClick:()=>r(c=>!c),className:"j-label hover:opacity-80 self-start",style:{color:"var(--fg-dim)"},children:t?"Hide details":"Show details"}),t&&h.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:[i.length===0&&h.jsx("div",{style:{color:"var(--fg-dim)"},children:"no events yet"}),i.slice().reverse().map(c=>h.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:c.ts.slice(11,19)}),h.jsx("span",{style:{color:c.kind==="error"?"var(--break-red)":c.kind==="system"?"var(--accent-sky)":"var(--fg-dim)"},children:c.kind}),h.jsx("span",{style:{color:"var(--fg)"},children:c.message})]},c.id))]})]})})}function sy(e){return e.kind==="error"?`Error: ${e.message}`:e.message}function ny({address:e,minimumWei:t,chainExplorerBase:r}){var d;const[i,s]=H.useState(!1),[c,g]=H.useState(null),[n,a]=H.useState(0),[f,_]=H.useState({state:"idle"});H.useEffect(()=>{if(c===null)return;a(Math.max(0,Math.floor((Date.now()-c)/1e3)));const v=window.setInterval(()=>{a(Math.max(0,Math.floor((Date.now()-c)/1e3)))},1e3);return()=>window.clearInterval(v)},[c]);const p=async()=>{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)},m=async()=>{var v;g(Date.now()),a(0),_({state:"requesting"});try{const y=await re.triggerDrip();g(null),y.ok?_({state:"sent",txHash:y.txHash??((v=y.txHashes)==null?void 0:v.at(-1)),txHashes:y.txHashes,attempts:y.attempts,balanceWei:y.balanceWei,targetWei:y.targetWei}):y.rateLimited||y.reason&&/rate|claimed|429/i.test(y.reason)?_({state:"rate_limited",reason:y.reason??"faucet rate-limited"}):_({state:"failed",reason:y.reason??"faucet funding failed"})}catch(y){g(null),_({state:"failed",reason:y instanceof Error?y.message:"drip failed"})}},S=v=>{if(!v)return"unknown";try{const y=Number(BigInt(v))/1e18;return`${y.toFixed(y<.001?4:3)} ETH`}catch{return`${v} wei`}},b=S(t),w=H.useMemo(()=>f.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(n/60*92))),[f.state,n]),u=f.state==="sent"?((d=f.txHashes)==null?void 0:d.length)??f.attempts??(f.txHash?1:0):0,l=f.state==="sent"&&f.balanceWei!==void 0&&f.targetWei!==void 0&&(()=>{try{return BigInt(f.balanceWei)>=BigInt(f.targetWei)}catch{return!1}})(),o=f.state==="sent"&&!l;return h.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:[h.jsxs("div",{className:"flex items-baseline justify-between",children:[h.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Action needed · fund the master EOA"}),h.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:"auto-detected on chain"})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"j-mono text-xs break-all",style:{color:"var(--fg)"},children:e}),h.jsxs("span",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:["send at least ",b," so the daemon can pay gas for setup, or use the testnet faucet."]})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("button",{onClick:m,type:"button",disabled:f.state==="requesting"||l,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:f.state==="requesting"?"Funding...":l?"Faucet funded":o?"Fund more":"Fund from faucet"}),h.jsx("button",{onClick:p,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:i?"Copied":"Copy address"}),h.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"})]}),f.state==="sent"&&h.jsxs("p",{className:"j-mono text-[11px]",style:{color:l?"var(--vow-green)":"var(--accent-gold)"},children:[l?"Faucet funding complete":"Faucet funding partial",u>0?` (${u} drip${u===1?"":"s"})`:"",".",f.balanceWei&&f.targetWei?` Balance ${S(f.balanceWei)} / target ${S(f.targetWei)}.`:"",o?' Click "Fund more" to top up.':"",f.txHash&&h.jsxs(h.Fragment,{children:[" ",h.jsx("a",{href:`${r}/tx/${f.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--accent-sky)"},children:"view latest tx"})]})]}),f.state==="requesting"&&h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("div",{className:"h-1.5 overflow-hidden",style:{background:"var(--bg-sunken)",borderRadius:"999px"},children:h.jsx("div",{className:"h-full transition-all",style:{width:`${w}%`,background:"var(--accent-gold)",borderRadius:"999px"}})}),h.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:["Requesting faucet drips for ",oy(e),". Elapsed ",n,"s; this can take about a minute on a fresh wallet."]})]}),f.state==="rate_limited"&&h.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--wane)"},children:"Faucet rate-limited. Send manually or wait before trying again."}),f.state==="failed"&&h.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--break-red)"},children:f.reason})]})}const oy=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var av={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(g,n,a){var f=this&&this.__decorate||function(d,v,y,C){var k,x=arguments.length,E=x<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,v,y,C);else for(var T=d.length-1;T>=0;T--)(k=d[T])&&(E=(x<3?k(E):x>3?k(v,y,E):k(v,y))||E);return x>3&&E&&Object.defineProperty(v,y,E),E},_=this&&this.__param||function(d,v){return function(y,C){v(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const p=a(9042),m=a(6114),S=a(9924),b=a(844),w=a(5596),u=a(4725),l=a(3656);let o=n.AccessibilityManager=class extends b.Disposable{constructor(d,v){super(),this._terminal=d,this._renderService=v,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
49
|
+
`))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new w.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,l.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,b.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let v=0;v<d;v++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
50
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),m.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,m.isMac&&this._liveRegion.remove()}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,v){this._liveRegionDebouncer.refresh(d,v,this._terminal.rows)}_renderRows(d,v){const y=this._terminal.buffer,C=y.lines.length.toString();for(let k=d;k<=v;k++){const x=y.translateBufferLineToString(y.ydisp+k,!0),E=(y.ydisp+k+1).toString(),T=this._rowElements[k];T&&(x.length===0?T.innerText=" ":T.textContent=x,T.setAttribute("aria-posinset",E),T.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const y=d.target,C=this._rowElements[v===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==C)return;let k,x;if(v===0?(k=y,x=this._rowElements.pop(),this._rowContainer.removeChild(x)):(k=this._rowElements.shift(),x=y,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),x.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=document.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_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 d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=o=f([_(1,u.IRenderService)],o)},3614:(g,n)=>{function a(m){return m.replace(/\r?\n/g,"\r")}function f(m,S){return S?"\x1B[200~"+m+"\x1B[201~":m}function _(m,S,b,w){m=f(m=a(m),b.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(m,!0),S.value=""}function p(m,S,b){const w=b.getBoundingClientRect(),u=m.clientX-w.left-10,l=m.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${u}px`,S.style.top=`${l}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=f,n.copyHandler=function(m,S){m.clipboardData&&m.clipboardData.setData("text/plain",S.selectionText),m.preventDefault()},n.handlePasteEvent=function(m,S,b,w){m.stopPropagation(),m.clipboardData&&_(m.clipboardData.getData("text/plain"),S,b,w)},n.paste=_,n.moveTextAreaUnderMouseCursor=p,n.rightClickHandler=function(m,S,b,w,u){p(m,S,b),u&&w.rightClickSelect(m),S.value=w.selectionText,S.select()}},7239:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const f=a(1505);n.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(_,p,m){this._css.set(_,p,m)}getCss(_,p){return this._css.get(_,p)}setColor(_,p,m){this._color.set(_,p,m)}getColor(_,p){return this._color.get(_,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,f,_,p){a.addEventListener(f,_,p);let m=!1;return{dispose:()=>{m||(m=!0,a.removeEventListener(f,_,p))}}}},6465:function(g,n,a){var f=this&&this.__decorate||function(u,l,o,d){var v,y=arguments.length,C=y<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,d);else for(var k=u.length-1;k>=0;k--)(v=u[k])&&(C=(y<3?v(C):y>3?v(l,o,C):v(l,o))||C);return y>3&&C&&Object.defineProperty(l,o,C),C},_=this&&this.__param||function(u,l){return function(o,d){l(o,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier2=void 0;const p=a(3656),m=a(8460),S=a(844),b=a(2585);let w=n.Linkifier2=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(u){super(),this._bufferService=u,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(u){return this._linkProviders.push(u),{dispose:()=>{const l=this._linkProviders.indexOf(u);l!==-1&&this._linkProviders.splice(l,1)}}}attachToDom(u,l,o){this._element=u,this._mouseService=l,this._renderService=o,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(u){if(this._lastMouseEvent=u,!this._element||!this._mouseService)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=u.composedPath();for(let d=0;d<o.length;d++){const v=o[d];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,l){var o,d;this._activeProviderReplies&&l||((o=this._activeProviderReplies)===null||o===void 0||o.forEach(y=>{y==null||y.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=u.y);let v=!1;for(const[y,C]of this._linkProviders.entries())l?!((d=this._activeProviderReplies)===null||d===void 0)&&d.get(y)&&(v=this._checkLinkProviderResult(y,u,v)):C.provideLinks(u.y,k=>{var x,E;if(this._isMouseOut)return;const T=k==null?void 0:k.map(B=>({link:B}));(x=this._activeProviderReplies)===null||x===void 0||x.set(y,T),v=this._checkLinkProviderResult(y,u,v),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)})}_removeIntersectingLinks(u,l){const o=new Set;for(let d=0;d<l.size;d++){const v=l.get(d);if(v)for(let y=0;y<v.length;y++){const C=v[y],k=C.link.range.start.y<u?0:C.link.range.start.x,x=C.link.range.end.y>u?this._bufferService.cols:C.link.range.end.x;for(let E=k;E<=x;E++){if(o.has(E)){v.splice(y--,1);break}o.add(E)}}}}_checkLinkProviderResult(u,l,o){var d;if(!this._activeProviderReplies)return o;const v=this._activeProviderReplies.get(u);let y=!1;for(let C=0;C<u;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(y=!0);if(!y&&v){const C=v.find(k=>this._linkAtPosition(k.link,l));C&&(o=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let C=0;C<this._activeProviderReplies.size;C++){const k=(d=this._activeProviderReplies.get(C))===null||d===void 0?void 0:d.find(x=>this._linkAtPosition(x.link,l));if(k){o=!0,this._handleNewLink(k);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._element||!this._mouseService||!this._currentLink)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,l){this._element&&this._currentLink&&this._lastMouseEvent&&(!u||!l||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(u.link,l)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var o,d;return(d=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||d===void 0?void 0:d.decorations.pointerCursor},set:o=>{var d,v;!((d=this._currentLink)===null||d===void 0)&&d.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&((v=this._element)===null||v===void 0||v.classList.toggle("xterm-cursor-pointer",o)))}},underline:{get:()=>{var o,d;return(d=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||d===void 0?void 0:d.decorations.underline},set:o=>{var d,v,y;!((d=this._currentLink)===null||d===void 0)&&d.state&&((y=(v=this._currentLink)===null||v===void 0?void 0:v.state)===null||y===void 0?void 0:y.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,o))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const d=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(d,v),this._lastMouseEvent&&this._element)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(u,l,o){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(o,l.text)}_fireUnderlineEvent(u,l){const o=u.range,d=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-d-1,o.end.x,o.end.y-d-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(u,l,o){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(o,l.text)}_linkAtPosition(u,l){const o=u.range.start.y*this._bufferService.cols+u.range.start.x,d=u.range.end.y*this._bufferService.cols+u.range.end.x,v=l.y*this._bufferService.cols+l.x;return o<=v&&v<=d}_positionFromMouseEvent(u,l,o){const d=o.getCoords(u,l,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,l,o,d,v){return{x1:u,y1:l,x2:o,y2:d,cols:this._bufferService.cols,fg:v}}};n.Linkifier2=w=f([_(0,b.IBufferService)],w)},9042:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(g,n,a){var f=this&&this.__decorate||function(w,u,l,o){var d,v=arguments.length,y=v<3?u:o===null?o=Object.getOwnPropertyDescriptor(u,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,u,l,o);else for(var C=w.length-1;C>=0;C--)(d=w[C])&&(y=(v<3?d(y):v>3?d(u,l,y):d(u,l))||y);return v>3&&y&&Object.defineProperty(u,l,y),y},_=this&&this.__param||function(w,u){return function(l,o){u(l,o,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const p=a(511),m=a(2585);let S=n.OscLinkProvider=class{constructor(w,u,l){this._bufferService=w,this._optionsService=u,this._oscLinkService=l}provideLinks(w,u){var l;const o=this._bufferService.buffer.lines.get(w-1);if(!o)return void u(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,y=new p.CellData,C=o.getTrimmedLength();let k=-1,x=-1,E=!1;for(let T=0;T<C;T++)if(x!==-1||o.hasContent(T)){if(o.loadCell(T,y),y.hasExtendedAttrs()&&y.extended.urlId){if(x===-1){x=T,k=y.extended.urlId;continue}E=y.extended.urlId!==k}else x!==-1&&(E=!0);if(E||x!==-1&&T===C-1){const B=(l=this._oscLinkService.getLinkData(k))===null||l===void 0?void 0:l.uri;if(B){const D={start:{x:x+1,y:w},end:{x:T+(E||T!==C-1?0:1),y:w}};let P=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const F=new URL(B);["http:","https:"].includes(F.protocol)||(P=!0)}catch{P=!0}P||d.push({text:B,range:D,activate:(F,N)=>v?v.activate(F,N,D):b(0,N),hover:(F,N)=>{var $;return($=v==null?void 0:v.hover)===null||$===void 0?void 0:$.call(v,F,N,D)},leave:(F,N)=>{var $;return($=v==null?void 0:v.leave)===null||$===void 0?void 0:$.call(v,F,N,D)}})}E=!1,y.hasExtendedAttrs()&&y.extended.urlId?(x=T,k=y.extended.urlId):(x=-1,k=-1)}}u(d)}};function b(w,u){if(confirm(`Do you want to navigate to ${u}?
|
|
51
|
+
|
|
52
|
+
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=S=f([_(0,m.IBufferService),_(1,m.IOptionsService),_(2,m.IOscLinkService)],S)},6193:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.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,_){this._rowCount=_,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,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ScreenDprMonitor=void 0;const f=a(844);class _ extends f.Disposable{constructor(m){super(),this._parentWindow=m,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(m){this._listener&&this.clearListener(),this._listener=m,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)===null||m===void 0||m.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)}}n.ScreenDprMonitor=_},3236:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const f=a(3614),_=a(3656),p=a(6465),m=a(9042),S=a(3730),b=a(1680),w=a(3107),u=a(5744),l=a(2950),o=a(1296),d=a(428),v=a(4269),y=a(5114),C=a(8934),k=a(3230),x=a(9312),E=a(4725),T=a(6731),B=a(8055),D=a(8969),P=a(8460),F=a(844),N=a(6114),$=a(8437),U=a(2584),R=a(7399),L=a(5941),M=a(9074),O=a(2585),z=a(5435),q=a(4567),Y=typeof window<"u"?window.document:null;class X extends D.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(j={}){super(j),this.browser=N,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(p.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((I,K)=>this.refresh(I,K))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(I=>this._reportWindowsOptions(I))),this.register(this._inputHandler.onColor(I=>this._handleColorEvent(I))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(I=>this._afterResize(I.cols,I.rows))),this.register((0,F.toDisposable)(()=>{var I,K;this._customKeyEventHandler=void 0,(K=(I=this.element)===null||I===void 0?void 0:I.parentNode)===null||K===void 0||K.removeChild(this.element)}))}_handleColorEvent(j){if(this._themeService)for(const I of j){let K,W="";switch(I.index){case 256:K="foreground",W="10";break;case 257:K="background",W="11";break;case 258:K="cursor",W="12";break;default:K="ansi",W="4;"+I.index}switch(I.type){case 0:const ee=B.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[I.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${W};${(0,L.toRgbString)(ee)}${U.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(Q=>Q.ansi[I.index]=B.rgba.toColor(...I.color));else{const Q=K;this._themeService.modifyColors(ue=>ue[Q]=B.rgba.toColor(...I.color))}break;case 2:this._themeService.restoreColor(I.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(j){j?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(j){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.updateCursorStyle(j),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var j;return(j=this.textarea)===null||j===void 0?void 0:j.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 j=this.buffer.ybase+this.buffer.y,I=this.buffer.lines.get(j);if(!I)return;const K=Math.min(this.buffer.x,this.cols-1),W=this._renderService.dimensions.css.cell.height,ee=I.getWidth(K),Q=this._renderService.dimensions.css.cell.width*ee,ue=this.buffer.y*this._renderService.dimensions.css.cell.height,Me=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Me+"px",this.textarea.style.top=ue+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=W+"px",this.textarea.style.lineHeight=W+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",I=>{this.hasSelection()&&(0,f.copyHandler)(I,this._selectionService)}));const j=I=>(0,f.handlePasteEvent)(I,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",j)),this.register((0,_.addDisposableDomListener)(this.element,"paste",j)),N.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",I=>{I.button===2&&(0,f.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",I=>{(0,f.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),N.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",I=>{I.button===1&&(0,f.moveTextAreaUnderMouseCursor)(I,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",j=>this._keyUp(j),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",j=>this._keyDown(j),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",j=>this._keyPress(j),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",j=>this._compositionHelper.compositionupdate(j))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",j=>this._inputEvent(j),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(j){var I;if(!j)throw new Error("Terminal requires a parent element.");j.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=j.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),j.appendChild(this.element);const K=Y.createDocumentFragment();this._viewportElement=Y.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),K.appendChild(this._viewportElement),this._viewportScrollArea=Y.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=Y.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=Y.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),K.appendChild(this.screenElement),this.textarea=Y.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),N.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(y.CoreBrowserService,this.textarea,(I=this._document.defaultView)!==null&&I!==void 0?I:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",W=>this._handleTextAreaFocus(W))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(W=>this._onRender.fire(W))),this.onResize(W=>this._renderService.resize(W.cols,W.rows)),this._compositionView=Y.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(K);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(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(W=>this.scrollLines(W.amount,W.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(x.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(W=>this.scrollLines(W.amount,W.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(W=>this._renderService.handleSelectionChanged(W.start,W.end,W.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(W=>{this.textarea.value=W,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(W=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",W=>this._selectionService.handleMouseDown(W))),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",W=>this._handleScreenReaderModeOptionChange(W))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",W=>{!this._overviewRulerRenderer&&W&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const j=this,I=this.element;function K(Q){const ue=j._mouseService.getMouseReportCoords(Q,j.screenElement);if(!ue)return!1;let Me,qe;switch(Q.overrideType||Q.type){case"mousemove":qe=32,Q.buttons===void 0?(Me=3,Q.button!==void 0&&(Me=Q.button<3?Q.button:3)):Me=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":qe=0,Me=Q.button<3?Q.button:3;break;case"mousedown":qe=1,Me=Q.button<3?Q.button:3;break;case"wheel":if(j.viewport.getLinesScrolled(Q)===0)return!1;qe=Q.deltaY<0?0:1,Me=4;break;default:return!1}return!(qe===void 0||Me===void 0||Me>4)&&j.coreMouseService.triggerMouseEvent({col:ue.col,row:ue.row,x:ue.x,y:ue.y,button:Me,action:qe,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const W={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ee={mouseup:Q=>(K(Q),Q.buttons||(this._document.removeEventListener("mouseup",W.mouseup),W.mousedrag&&this._document.removeEventListener("mousemove",W.mousedrag)),this.cancel(Q)),wheel:Q=>(K(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&K(Q)},mousemove:Q=>{Q.buttons||K(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?W.mousemove||(I.addEventListener("mousemove",ee.mousemove),W.mousemove=ee.mousemove):(I.removeEventListener("mousemove",W.mousemove),W.mousemove=null),16&Q?W.wheel||(I.addEventListener("wheel",ee.wheel,{passive:!1}),W.wheel=ee.wheel):(I.removeEventListener("wheel",W.wheel),W.wheel=null),2&Q?W.mouseup||(I.addEventListener("mouseup",ee.mouseup),W.mouseup=ee.mouseup):(this._document.removeEventListener("mouseup",W.mouseup),I.removeEventListener("mouseup",W.mouseup),W.mouseup=null),4&Q?W.mousedrag||(W.mousedrag=ee.mousedrag):(this._document.removeEventListener("mousemove",W.mousedrag),W.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(I,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return K(Q),W.mouseup&&this._document.addEventListener("mouseup",W.mouseup),W.mousedrag&&this._document.addEventListener("mousemove",W.mousedrag),this.cancel(Q)})),this.register((0,_.addDisposableDomListener)(I,"wheel",Q=>{if(!W.wheel){if(!this.buffer.hasScrollback){const ue=this.viewport.getLinesScrolled(Q);if(ue===0)return;const Me=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let qe="";for(let ci=0;ci<Math.abs(ue);ci++)qe+=Me;return this.coreService.triggerDataEvent(qe,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(I,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,_.addDisposableDomListener)(I,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(j,I){var K;(K=this._renderService)===null||K===void 0||K.refreshRows(j,I)}updateCursorStyle(j){var I;!((I=this._selectionService)===null||I===void 0)&&I.shouldColumnSelect(j)?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(j,I,K=0){var W;K===1?(super.scrollLines(j,I,K),this.refresh(0,this.rows-1)):(W=this.viewport)===null||W===void 0||W.scrollLines(j)}paste(j){(0,f.paste)(j,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(j){this._customKeyEventHandler=j}registerLinkProvider(j){return this.linkifier2.registerLinkProvider(j)}registerCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const I=this._characterJoinerService.register(j);return this.refresh(0,this.rows-1),I}deregisterCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(j)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(j){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+j)}registerDecoration(j){return this._decorationService.registerDecoration(j)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(j,I,K){this._selectionService.setSelection(j,I,K)}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 j;(j=this._selectionService)===null||j===void 0||j.clearSelection()}selectAll(){var j;(j=this._selectionService)===null||j===void 0||j.selectAll()}selectLines(j,I){var K;(K=this._selectionService)===null||K===void 0||K.selectLines(j,I)}_keyDown(j){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;const I=this.browser.isMac&&this.options.macOptionIsMeta&&j.altKey;if(!I&&!this._compositionHelper.keydown(j))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;I||j.key!=="Dead"&&j.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,R.evaluateKeyboardEvent)(j,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(j),K.type===3||K.type===2){const W=this.rows-1;return this.scrollLines(K.type===2?-W:W),this.cancel(j,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,j)||(K.cancel&&this.cancel(j,!0),!K.key||!!(j.key&&!j.ctrlKey&&!j.altKey&&!j.metaKey&&j.key.length===1&&j.key.charCodeAt(0)>=65&&j.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==U.C0.ETX&&K.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||j.altKey||j.ctrlKey?this.cancel(j,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(j,I){const K=j.isMac&&!this.options.macOptionIsMeta&&I.altKey&&!I.ctrlKey&&!I.metaKey||j.isWindows&&I.altKey&&I.ctrlKey&&!I.metaKey||j.isWindows&&I.getModifierState("AltGraph");return I.type==="keypress"?K:K&&(!I.keyCode||I.keyCode>47)}_keyUp(j){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1||(function(I){return I.keyCode===16||I.keyCode===17||I.keyCode===18}(j)||this.focus(),this.updateCursorStyle(j),this._keyPressHandled=!1)}_keyPress(j){let I;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;if(this.cancel(j),j.charCode)I=j.charCode;else if(j.which===null||j.which===void 0)I=j.keyCode;else{if(j.which===0||j.charCode===0)return!1;I=j.which}return!(!I||(j.altKey||j.ctrlKey||j.metaKey)&&!this._isThirdLevelShift(this.browser,j)||(I=String.fromCharCode(I),this._onKey.fire({key:I,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(I,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(j){if(j.data&&j.inputType==="insertText"&&(!j.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const I=j.data;return this.coreService.triggerDataEvent(I,!0),this.cancel(j),!0}return!1}resize(j,I){j!==this.cols||I!==this.rows?super.resize(j,I):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(j,I){var K,W;(K=this._charSizeService)===null||K===void 0||K.measure(),(W=this.viewport)===null||W===void 0||W.syncScrollArea(!0)}clear(){var j;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 I=1;I<this.rows;I++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(j=this.viewport)===null||j===void 0||j.reset(),this.refresh(0,this.rows-1)}}reset(){var j,I;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)===null||j===void 0||j.reset(),this._decorationService.reset(),(I=this.viewport)===null||I===void 0||I.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var j;(j=this._renderService)===null||j===void 0||j.clearTextureAtlas()}_reportFocus(){var j;!((j=this.element)===null||j===void 0)&&j.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(j){if(this._renderService)switch(j){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const I=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${K};${I}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const W=this._renderService.dimensions.css.cell.width.toFixed(0),ee=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${ee};${W}t`)}}cancel(j,I){if(this.options.cancelEvents||I)return j.preventDefault(),j.stopPropagation(),!1}}n.Terminal=X},9924:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.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,_){this._rowCount=_,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 m=p-this._lastRefreshMs,S=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},S)}}_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,n,a){var f=this&&this.__decorate||function(l,o,d,v){var y,C=arguments.length,k=C<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,o,d,v);else for(var x=l.length-1;x>=0;x--)(y=l[x])&&(k=(C<3?y(k):C>3?y(o,d,k):y(o,d))||k);return C>3&&k&&Object.defineProperty(o,d,k),k},_=this&&this.__param||function(l,o){return function(d,v){o(d,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const p=a(3656),m=a(4725),S=a(8460),b=a(844),w=a(2585);let u=n.Viewport=class extends b.Disposable{constructor(l,o,d,v,y,C,k,x){super(),this._viewportElement=l,this._scrollArea=o,this._bufferService=d,this._optionsService=v,this._charSizeService=y,this._renderService=C,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(x.colors),this.register(x.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.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(l){if(l)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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<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(l,o){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&d<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const o=this._getPixelsScrolled(l);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(l,o){var d;let v,y="";const C=[],k=o??this._bufferService.buffer.lines.length,x=this._bufferService.buffer.lines;for(let E=l;E<k;E++){const T=x.get(E);if(!T)continue;const B=(d=x.get(E+1))===null||d===void 0?void 0:d.isWrapped;if(y+=T.translateToString(!B),!B||E===x.length-1){const D=document.createElement("div");D.textContent=y,C.push(D),y.length>0&&(v=D),y=""}}return{bufferElements:C,cursorElement:v}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(l,o){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&o.altKey||d==="ctrl"&&o.ctrlKey||d==="shift"&&o.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const o=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}};n.Viewport=u=f([_(2,w.IBufferService),_(3,w.IOptionsService),_(4,m.ICharSizeService),_(5,m.IRenderService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],u)},3107:function(g,n,a){var f=this&&this.__decorate||function(u,l,o,d){var v,y=arguments.length,C=y<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,d);else for(var k=u.length-1;k>=0;k--)(v=u[k])&&(C=(y<3?v(C):y>3?v(l,o,C):v(l,o))||C);return y>3&&C&&Object.defineProperty(l,o,C),C},_=this&&this.__param||function(u,l){return function(o,d){l(o,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const p=a(3656),m=a(4725),S=a(844),b=a(2585);let w=n.BufferDecorationRenderer=class extends S.Disposable{constructor(u,l,o,d){super(),this._screenElement=u,this._bufferService=l,this._decorationService=o,this._renderService=d,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(v=>this._removeDecoration(v))),this.register((0,S.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var l,o;const d=document.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",((l=u==null?void 0:u.options)===null||l===void 0?void 0:l.layer)==="top"),d.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=(o=u.options.x)!==null&&o!==void 0?o:0;return v&&v>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(u,d),d}_refreshStyle(u){const l=u.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let o=this._decorationElements.get(u);o||(o=this._createElement(u),u.element=o,this._decorationElements.set(u,o),this._container.appendChild(o),u.onDispose(()=>{this._decorationElements.delete(u),o.remove()})),o.style.top=l*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(o)}}_refreshXPosition(u,l=u.element){var o;if(!l)return;const d=(o=u.options.x)!==null&&o!==void 0?o:0;(u.options.anchor||"left")==="right"?l.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":l.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var l;(l=this._decorationElements.get(u))===null||l===void 0||l.remove(),this._decorationElements.delete(u),u.dispose()}};n.BufferDecorationRenderer=w=f([_(1,b.IBufferService),_(2,b.IDecorationService),_(3,m.IRenderService)],w)},5871:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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,_){return f>=a.startBufferLine-this._linePadding[_||"full"]&&f<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,f){a.startBufferLine=Math.min(a.startBufferLine,f),a.endBufferLine=Math.max(a.endBufferLine,f)}}},5744:function(g,n,a){var f=this&&this.__decorate||function(v,y,C,k){var x,E=arguments.length,T=E<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,C,k);else for(var B=v.length-1;B>=0;B--)(x=v[B])&&(T=(E<3?x(T):E>3?x(y,C,T):x(y,C))||T);return E>3&&T&&Object.defineProperty(y,C,T),T},_=this&&this.__param||function(v,y){return function(C,k){y(C,k,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const p=a(5871),m=a(3656),S=a(4725),b=a(844),w=a(2585),u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let d=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,y,C,k,x,E,T){var B;super(),this._viewportElement=v,this._screenElement=y,this._bufferService=C,this._decorationService=k,this._renderService=x,this._optionsService=E,this._coreBrowseService=T,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(),(B=this._viewportElement.parentElement)===null||B===void 0||B.insertBefore(this._canvas,this._viewportElement);const D=this._canvas.getContext("2d");if(!D)throw new Error("Ctx cannot be null");this._ctx=D,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)(()=>{var P;(P=this._canvas)===null||P===void 0||P.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,m.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=v,l.center=y,l.right=v,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=l.left,o.right=l.left+l.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowseService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowseService.dpr);u.left=y,u.center=y,u.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const y of v)y.position!=="full"&&this._renderColorZone(y);for(const y of v)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(o[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-u[v.position||"full"]/2),l[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[v.position||"full"]))}_queueRefresh(v,y){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=d=f([_(2,w.IBufferService),_(3,w.IDecorationService),_(4,S.IRenderService),_(5,w.IOptionsService),_(6,S.ICoreBrowserService)],d)},2950:function(g,n,a){var f=this&&this.__decorate||function(w,u,l,o){var d,v=arguments.length,y=v<3?u:o===null?o=Object.getOwnPropertyDescriptor(u,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,u,l,o);else for(var C=w.length-1;C>=0;C--)(d=w[C])&&(y=(v<3?d(y):v>3?d(u,l,y):d(u,l))||y);return v>3&&y&&Object.defineProperty(u,l,y),y},_=this&&this.__param||function(w,u){return function(l,o){u(l,o,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const p=a(4725),m=a(2585),S=a(2584);let b=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,u,l,o,d,v){this._textarea=w,this._compositionView=u,this._bufferService=l,this._optionsService=o,this._coreService=d,this._renderService=v,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(w,"");this._dataAlreadySent=l,u.length>w.length?this._coreService.triggerDataEvent(l,!0):u.length<w.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):u.length===w.length&&u!==w&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}w||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=b=f([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,m.ICoreService),_(5,p.IRenderService)],b)},9806:(g,n)=>{function a(f,_,p){const m=p.getBoundingClientRect(),S=f.getComputedStyle(p),b=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[_.clientX-m.left-b,_.clientY-m.top-w]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(f,_,p,m,S,b,w,u,l){if(!b)return;const o=a(f,_,p);return o?(o[0]=Math.ceil((o[0]+(l?w/2:0))/w),o[1]=Math.ceil(o[1]/u),o[0]=Math.min(Math.max(o[0],1),m+(l?1:0)),o[1]=Math.min(Math.max(o[1],1),S),o):void 0}},9504:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const f=a(2584);function _(u,l,o,d){const v=u-p(u,o),y=l-p(l,o),C=Math.abs(v-y)-function(k,x,E){let T=0;const B=k-p(k,E),D=x-p(x,E);for(let P=0;P<Math.abs(B-D);P++){const F=m(k,x)==="A"?-1:1,N=E.buffer.lines.get(B+F*P);N!=null&&N.isWrapped&&T++}return T}(u,l,o);return w(C,b(m(u,l),d))}function p(u,l){let o=0,d=l.buffer.lines.get(u),v=d==null?void 0:d.isWrapped;for(;v&&u>=0&&u<l.rows;)o++,d=l.buffer.lines.get(--u),v=d==null?void 0:d.isWrapped;return o}function m(u,l){return u>l?"A":"B"}function S(u,l,o,d,v,y){let C=u,k=l,x="";for(;C!==o||k!==d;)C+=v?1:-1,v&&C>y.cols-1?(x+=y.buffer.translateBufferLineToString(k,!1,u,C),C=0,u=0,k++):!v&&C<0&&(x+=y.buffer.translateBufferLineToString(k,!1,0,u+1),C=y.cols-1,u=C,k--);return x+y.buffer.translateBufferLineToString(k,!1,u,C)}function b(u,l){const o=l?"O":"[";return f.C0.ESC+o+u}function w(u,l){u=Math.floor(u);let o="";for(let d=0;d<u;d++)o+=l;return o}n.moveToCellSequence=function(u,l,o,d){const v=o.buffer.x,y=o.buffer.y;if(!o.buffer.hasScrollback)return function(x,E,T,B,D,P){return _(E,B,D,P).length===0?"":w(S(x,E,x,E-p(E,D),!1,D).length,b("D",P))}(v,y,0,l,o,d)+_(y,l,o,d)+function(x,E,T,B,D,P){let F;F=_(E,B,D,P).length>0?B-p(B,D):E;const N=B,$=function(U,R,L,M,O,z){let q;return q=_(L,M,O,z).length>0?M-p(M,O):R,U<L&&q<=M||U>=L&&q<M?"C":"D"}(x,E,T,B,D,P);return w(S(x,F,T,N,$==="C",D).length,b($,P))}(v,y,u,l,o,d);let C;if(y===l)return C=v>u?"D":"C",w(Math.abs(v-u),b(C,d));C=y>l?"D":"C";const k=Math.abs(y-l);return w(function(x,E){return E.cols-x}(y>l?u:v,o)+(k-1)*o.cols+1+((y>l?v:u)-1),b(C,d))}},1296:function(g,n,a){var f=this&&this.__decorate||function(D,P,F,N){var $,U=arguments.length,R=U<3?P:N===null?N=Object.getOwnPropertyDescriptor(P,F):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(D,P,F,N);else for(var L=D.length-1;L>=0;L--)($=D[L])&&(R=(U<3?$(R):U>3?$(P,F,R):$(P,F))||R);return U>3&&R&&Object.defineProperty(P,F,R),R},_=this&&this.__param||function(D,P){return function(F,N){P(F,N,D)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const p=a(3787),m=a(2550),S=a(2223),b=a(6171),w=a(4725),u=a(8055),l=a(8460),o=a(844),d=a(2585),v="xterm-dom-renderer-owner-",y="xterm-rows",C="xterm-fg-",k="xterm-bg-",x="xterm-focus",E="xterm-selection";let T=1,B=n.DomRenderer=class extends o.Disposable{constructor(D,P,F,N,$,U,R,L,M,O){super(),this._element=D,this._screenElement=P,this._viewportElement=F,this._linkifier2=N,this._charSizeService=U,this._optionsService=R,this._bufferService=L,this._coreBrowserService=M,this._themeService=O,this._terminalClass=T++,this._rowElements=[],this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(y),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(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(z=>this._injectCss(z))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(z=>this._handleLinkHover(z))),this.register(this._linkifier2.onHideLinkUnderline(z=>this._handleLinkLeave(z))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,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(D){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let P=`${this._terminalSelector} .${y} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${y} .xterm-dim { color: ${u.color.multiplyOpacity(D.foreground,.5).css};}`,P+=`${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;}`,P+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",P+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,P+=`${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[F,N]of D.ansi.entries())P+=`${this._terminalSelector} .${C}${F} { color: ${N.css}; }${this._terminalSelector} .${C}${F}.xterm-dim { color: ${u.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${k}${F} { background-color: ${N.css}; }`;P+=`${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(D.background).css}; }${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=P}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,P){for(let F=this._rowElements.length;F<=P;F++){const N=document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,P){this._refreshRowElements(D,P),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(x)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,P,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,P,F),this.renderRows(0,this._bufferService.rows-1),!D||!P)return;const N=D[1]-this._bufferService.buffer.ydisp,$=P[1]-this._bufferService.buffer.ydisp,U=Math.max(N,0),R=Math.min($,this._bufferService.rows-1);if(U>=this._bufferService.rows||R<0)return;const L=document.createDocumentFragment();if(F){const M=D[0]>P[0];L.appendChild(this._createSelectionElement(U,M?P[0]:D[0],M?D[0]:P[0],R-U+1))}else{const M=N===U?D[0]:0,O=U===$?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(U,M,O));const z=R-U-1;if(L.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,z)),U!==R){const q=$===R?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(R,0,q))}}this._selectionContainer.appendChild(L)}_createSelectionElement(D,P,F,N=1){const $=document.createElement("div");return $.style.height=N*this.dimensions.css.cell.height+"px",$.style.top=D*this.dimensions.css.cell.height+"px",$.style.left=P*this.dimensions.css.cell.width+"px",$.style.width=this.dimensions.css.cell.width*(F-P)+"px",$}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 D of this._rowElements)D.replaceChildren()}renderRows(D,P){const F=this._bufferService.buffer,N=F.ybase+F.y,$=Math.min(F.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=D;M<=P;M++){const O=M+F.ydisp,z=this._rowElements[M],q=F.lines.get(O);if(!z||!q)break;z.replaceChildren(...this._rowFactory.createRow(q,O,O===N,R,L,$,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,P,F,N,$,U){F<0&&(D=0),N<0&&(P=0);const R=this._bufferService.rows-1;F=Math.max(Math.min(F,R),0),N=Math.max(Math.min(N,R),0),$=Math.min($,this._bufferService.cols);const L=this._bufferService.buffer,M=L.ybase+L.y,O=Math.min(L.x,$-1),z=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=F;X<=N;++X){const le=X+L.ydisp,j=this._rowElements[X],I=L.lines.get(le);if(!j||!I)break;j.replaceChildren(...this._rowFactory.createRow(I,le,le===M,q,Y,O,z,this.dimensions.css.cell.width,this._widthCache,U?X===F?D:0:-1,U?(X===N?P:$)-1:-1))}}};n.DomRenderer=B=f([_(4,d.IInstantiationService),_(5,w.ICharSizeService),_(6,d.IOptionsService),_(7,d.IBufferService),_(8,w.ICoreBrowserService),_(9,w.IThemeService)],B)},3787:function(g,n,a){var f=this&&this.__decorate||function(C,k,x,E){var T,B=arguments.length,D=B<3?k:E===null?E=Object.getOwnPropertyDescriptor(k,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,k,x,E);else for(var P=C.length-1;P>=0;P--)(T=C[P])&&(D=(B<3?T(D):B>3?T(k,x,D):T(k,x))||D);return B>3&&D&&Object.defineProperty(k,x,D),D},_=this&&this.__param||function(C,k){return function(x,E){k(x,E,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const p=a(2223),m=a(643),S=a(511),b=a(2585),w=a(8055),u=a(4725),l=a(4269),o=a(6171),d=a(3734);let v=n.DomRendererRowFactory=class{constructor(C,k,x,E,T,B,D){this._document=C,this._characterJoinerService=k,this._optionsService=x,this._coreBrowserService=E,this._coreService=T,this._decorationService=B,this._themeService=D,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,k,x){this._selectionStart=C,this._selectionEnd=k,this._columnSelectMode=x}createRow(C,k,x,E,T,B,D,P,F,N,$){const U=[],R=this._characterJoinerService.getJoinedCharacters(k),L=this._themeService.colors;let M,O=C.getNoBgTrimmedLength();x&&O<B+1&&(O=B+1);let z=0,q="",Y=0,X=0,le=0,j=!1,I=0,K=!1,W=0;const ee=[],Q=N!==-1&&$!==-1;for(let ue=0;ue<O;ue++){C.loadCell(ue,this._workCell);let Me=this._workCell.getWidth();if(Me===0)continue;let qe=!1,ci=ue,ie=this._workCell;if(R.length>0&&ue===R[0][0]){qe=!0;const me=R.shift();ie=new l.JoinedCellData(this._workCell,C.translateToString(!0,me[0],me[1]),me[1]-me[0]),ci=me[1]-1,Me=ie.getWidth()}const cs=this._isCellInSelection(ue,k),ia=x&&ue===B,sa=Q&&ue>=N&&ue<=$;let na=!1;this._decorationService.forEachDecorationAtCell(ue,k,void 0,me=>{na=!0});let wn=ie.getChars()||m.WHITESPACE_CELL_CHAR;if(wn===" "&&(ie.isUnderline()||ie.isOverline())&&(wn=" "),W=Me*P-F.get(wn,ie.isBold(),ie.isItalic()),M){if(z&&(cs&&K||!cs&&!K&&ie.bg===Y)&&(cs&&K&&L.selectionForeground||ie.fg===X)&&ie.extended.ext===le&&sa===j&&W===I&&!ia&&!qe&&!na){q+=wn,z++;continue}z&&(M.textContent=q),M=this._document.createElement("span"),z=0,q=""}else M=this._document.createElement("span");if(Y=ie.bg,X=ie.fg,le=ie.extended.ext,j=sa,I=W,K=cs,qe&&B>=ue&&B<=ci&&(B=ue),!this._coreService.isCursorHidden&&ia){if(ee.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&ee.push("xterm-cursor-blink"),ee.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":ee.push("xterm-cursor-outline");break;case"block":ee.push("xterm-cursor-block");break;case"bar":ee.push("xterm-cursor-bar");break;case"underline":ee.push("xterm-cursor-underline")}}if(ie.isBold()&&ee.push("xterm-bold"),ie.isItalic()&&ee.push("xterm-italic"),ie.isDim()&&ee.push("xterm-dim"),q=ie.isInvisible()?m.WHITESPACE_CELL_CHAR:ie.getChars()||m.WHITESPACE_CELL_CHAR,ie.isUnderline()&&(ee.push(`xterm-underline-${ie.extended.underlineStyle}`),q===" "&&(q=" "),!ie.isUnderlineColorDefault()))if(ie.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(ie.getUnderlineColor()).join(",")})`;else{let me=ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ie.isBold()&&me<8&&(me+=8),M.style.textDecorationColor=L.ansi[me].css}ie.isOverline()&&(ee.push("xterm-overline"),q===" "&&(q=" ")),ie.isStrikethrough()&&ee.push("xterm-strikethrough"),sa&&(M.style.textDecoration="underline");let dt=ie.getFgColor(),us=ie.getFgColorMode(),jt=ie.getBgColor(),ds=ie.getBgColorMode();const oa=!!ie.isInverse();if(oa){const me=dt;dt=jt,jt=me;const vv=us;us=ds,ds=vv}let tr,aa,rr,hs=!1;switch(this._decorationService.forEachDecorationAtCell(ue,k,void 0,me=>{me.options.layer!=="top"&&hs||(me.backgroundColorRGB&&(ds=50331648,jt=me.backgroundColorRGB.rgba>>8&16777215,tr=me.backgroundColorRGB),me.foregroundColorRGB&&(us=50331648,dt=me.foregroundColorRGB.rgba>>8&16777215,aa=me.foregroundColorRGB),hs=me.options.layer==="top")}),!hs&&cs&&(tr=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,jt=tr.rgba>>8&16777215,ds=50331648,hs=!0,L.selectionForeground&&(us=50331648,dt=L.selectionForeground.rgba>>8&16777215,aa=L.selectionForeground)),hs&&ee.push("xterm-decoration-top"),ds){case 16777216:case 33554432:rr=L.ansi[jt],ee.push(`xterm-bg-${jt}`);break;case 50331648:rr=w.rgba.toColor(jt>>16,jt>>8&255,255&jt),this._addStyle(M,`background-color:#${y((jt>>>0).toString(16),"0",6)}`);break;default:oa?(rr=L.foreground,ee.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):rr=L.background}switch(tr||ie.isDim()&&(tr=w.color.multiplyOpacity(rr,.5)),us){case 16777216:case 33554432:ie.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(M,rr,L.ansi[dt],ie,tr,void 0)||ee.push(`xterm-fg-${dt}`);break;case 50331648:const me=w.rgba.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(M,rr,me,ie,tr,aa)||this._addStyle(M,`color:#${y(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,rr,L.foreground,ie,tr,void 0)||oa&&ee.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ee.length&&(M.className=ee.join(" "),ee.length=0),ia||qe||na?M.textContent=q:z++,W!==this.defaultSpacing&&(M.style.letterSpacing=`${W}px`),U.push(M),ue=ci}return M&&z&&(M.textContent=q),U}_applyMinimumContrast(C,k,x,E,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(E.getCode()))return!1;const D=this._getContrastCache(E);let P;if(T||B||(P=D.getColor(k.rgba,x.rgba)),P===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);P=w.color.ensureContrastRatio(T||k,B||x,F),D.setColor((T||k).rgba,(B||x).rgba,P??null)}return!!P&&(this._addStyle(C,`color:${P.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,k){C.setAttribute("style",`${C.getAttribute("style")||""}${k};`)}_isCellInSelection(C,k){const x=this._selectionStart,E=this._selectionEnd;return!(!x||!E)&&(this._columnSelectMode?x[0]<=E[0]?C>=x[0]&&k>=x[1]&&C<E[0]&&k<=E[1]:C<x[0]&&k>=x[1]&&C>=E[0]&&k<=E[1]:k>x[1]&&k<E[1]||x[1]===E[1]&&k===x[1]&&C>=x[0]&&C<E[0]||x[1]<E[1]&&k===E[1]&&C<E[0]||x[1]<E[1]&&k===x[1]&&C>=x[0])}};function y(C,k,x){for(;C.length<x;)C=k+C;return C}n.DomRendererRowFactory=v=f([_(1,u.ICharacterJoinerService),_(2,b.IOptionsService),_(3,u.ICoreBrowserService),_(4,b.ICoreService),_(5,b.IDecorationService),_(6,u.IThemeService)],v)},2550:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.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"),_=a.createElement("span");_.style.fontWeight="bold";const p=a.createElement("span");p.style.fontStyle="italic";const m=a.createElement("span");m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[f,_,p,m],this._container.appendChild(f),this._container.appendChild(_),this._container.appendChild(p),this._container.appendChild(m),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,_,p){a===this._font&&f===this._fontSize&&_===this._weight&&p===this._weightBold||(this._font=a,this._fontSize=f,this._weight=_,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(a,f,_){let p=0;if(!f&&!_&&a.length===1&&(p=a.charCodeAt(0))<256)return this._flat[p]!==-9999?this._flat[p]:this._flat[p]=this._measure(a,0);let m=a;f&&(m+="B"),_&&(m+="I");let S=this._holey.get(m);if(S===void 0){let b=0;f&&(b|=1),_&&(b|=2),S=this._measure(a,b),this._holey.set(m,S)}return S}_measure(a,f){const _=this._measureElements[f];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const f=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(g,n)=>{function a(f){return 57508<=f&&f<=57558}Object.defineProperty(n,"__esModule",{value:!0}),n.createRenderDimensions=n.excludeFromContrastRatioDemands=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},n.excludeFromContrastRatioDemands=function(f){return a(f)||function(_){return 9472<=_&&_<=9631}(f)},n.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,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.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,n,a){var f=this&&this.__decorate||function(u,l,o,d){var v,y=arguments.length,C=y<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,d);else for(var k=u.length-1;k>=0;k--)(v=u[k])&&(C=(y<3?v(C):y>3?v(l,o,C):v(l,o))||C);return y>3&&C&&Object.defineProperty(l,o,C),C},_=this&&this.__param||function(u,l){return function(o,d){l(o,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const p=a(2585),m=a(8460),S=a(844);let b=n.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,l,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new w(u,l,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const u=this._measureStrategy.measure();u.width===this.width&&u.height===this.height||(this.width=u.width,this.height=u.height,this._onCharSizeChange.fire())}};n.CharSizeService=b=f([_(2,p.IOptionsService)],b);class w{constructor(l,o,d){this._document=l,this._parentElement=o,this._optionsService=d,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 l={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return l.width!==0&&l.height!==0&&(this._result.width=l.width/32,this._result.height=Math.ceil(l.height)),this._result}}},4269:function(g,n,a){var f=this&&this.__decorate||function(l,o,d,v){var y,C=arguments.length,k=C<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,o,d,v);else for(var x=l.length-1;x>=0;x--)(y=l[x])&&(k=(C<3?y(k):C>3?y(o,d,k):y(o,d))||k);return C>3&&k&&Object.defineProperty(o,d,k),k},_=this&&this.__param||function(l,o){return function(d,v){o(d,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const p=a(3734),m=a(643),S=a(511),b=a(2585);class w extends p.AttributeData{constructor(o,d,v){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=d,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=w;let u=n.CharacterJoinerService=class lv{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(o){const d={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(d),d.id}deregister(o){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===o)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(o);if(!d||d.length===0)return[];const v=[],y=d.translateToString(!0);let C=0,k=0,x=0,E=d.getFg(0),T=d.getBg(0);for(let B=0;B<d.getTrimmedLength();B++)if(d.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==T){if(B-C>1){const D=this._getJoinedRanges(y,x,k,d,C);for(let P=0;P<D.length;P++)v.push(D[P])}C=B,x=k,E=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const B=this._getJoinedRanges(y,x,k,d,C);for(let D=0;D<B.length;D++)v.push(B[D])}return v}_getJoinedRanges(o,d,v,y,C){const k=o.substring(d,v);let x=[];try{x=this._characterJoiners[0].handler(k)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const T=this._characterJoiners[E].handler(k);for(let B=0;B<T.length;B++)lv._mergeRanges(x,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(x,y,C),x}_stringRangesToCellRanges(o,d,v){let y=0,C=!1,k=0,x=o[y];if(x){for(let E=v;E<this._bufferService.cols;E++){const T=d.getWidth(E),B=d.getString(E).length||m.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!C&&x[0]<=k&&(x[0]=E,C=!0),x[1]<=k){if(x[1]=E,x=o[++y],!x)break;x[0]<=k?(x[0]=E,C=!0):C=!1}k+=B}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(o,d){let v=!1;for(let y=0;y<o.length;y++){const C=o[y];if(v){if(d[1]<=C[0])return o[y-1][1]=d[1],o;if(d[1]<=C[1])return o[y-1][1]=Math.max(d[1],C[1]),o.splice(y,1),o;o.splice(y,1),y--}else{if(d[1]<=C[0])return o.splice(y,0,d),o;if(d[1]<=C[1])return C[0]=Math.min(d[0],C[0]),o;d[0]<C[1]&&(C[0]=Math.min(d[0],C[0]),v=!0)}}return v?o[o.length-1][1]=d[1]:o.push(d),o}};n.CharacterJoinerService=u=f([_(0,b.IBufferService)],u)},5114:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0,n.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,n,a){var f=this&&this.__decorate||function(b,w,u,l){var o,d=arguments.length,v=d<3?w:l===null?l=Object.getOwnPropertyDescriptor(w,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(b,w,u,l);else for(var y=b.length-1;y>=0;y--)(o=b[y])&&(v=(d<3?o(v):d>3?o(w,u,v):o(w,u))||v);return d>3&&v&&Object.defineProperty(w,u,v),v},_=this&&this.__param||function(b,w){return function(u,l){w(u,l,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const p=a(4725),m=a(9806);let S=n.MouseService=class{constructor(b,w){this._renderService=b,this._charSizeService=w}getCoords(b,w,u,l,o){return(0,m.getCoords)(window,b,w,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(b,w){const u=(0,m.getCoordsRelativeToElement)(window,b,w);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};n.MouseService=S=f([_(0,p.IRenderService),_(1,p.ICharSizeService)],S)},3230:function(g,n,a){var f=this&&this.__decorate||function(v,y,C,k){var x,E=arguments.length,T=E<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,C,k);else for(var B=v.length-1;B>=0;B--)(x=v[B])&&(T=(E<3?x(T):E>3?x(y,C,T):x(y,C))||T);return E>3&&T&&Object.defineProperty(y,C,T),T},_=this&&this.__param||function(v,y){return function(C,k){y(C,k,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const p=a(3656),m=a(6193),S=a(5596),b=a(4725),w=a(8460),u=a(844),l=a(7226),o=a(2585);let d=n.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,y,C,k,x,E,T,B){if(super(),this._rowCount=v,this._charSizeService=k,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new l.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 w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(T.window,(D,P)=>this._renderRows(D,P)),this.register(this._renderDebouncer),this._screenDprMonitor=new S.ScreenDprMonitor(T.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var D;return(D=this._renderer.value)===null||D===void 0?void 0:D.clear()})),this.register(C.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.onDecorationRemoved(()=>this._fullRefresh())),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register((0,p.addDisposableDomListener)(T.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(B.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in T.window){const D=new T.window.IntersectionObserver(P=>this._handleIntersectionChange(P[P.length-1]),{threshold:0});D.observe(y),this.register({dispose:()=>D.disconnect()})}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.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(v,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,y,this._rowCount))}_renderRows(v,y){this._renderer.value&&(v=Math.min(v,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(v,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:y}),this._onRender.fire({start:v,end:y}),this._isNextRenderRedrawOnly=!0)}resize(v,y){this._rowCount=y,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(v){this._renderer.value=v,this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var v,y;this._renderer.value&&((y=(v=this._renderer.value).clearTextureAtlas)===null||y===void 0||y.call(v),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(v,y)):this._renderer.value.handleResize(v,y),this._fullRefresh())}handleCharSizeChanged(){var v;(v=this._renderer.value)===null||v===void 0||v.handleCharSizeChanged()}handleBlur(){var v;(v=this._renderer.value)===null||v===void 0||v.handleBlur()}handleFocus(){var v;(v=this._renderer.value)===null||v===void 0||v.handleFocus()}handleSelectionChanged(v,y,C){var k;this._selectionState.start=v,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(k=this._renderer.value)===null||k===void 0||k.handleSelectionChanged(v,y,C)}handleCursorMove(){var v;(v=this._renderer.value)===null||v===void 0||v.handleCursorMove()}clear(){var v;(v=this._renderer.value)===null||v===void 0||v.clear()}};n.RenderService=d=f([_(2,o.IOptionsService),_(3,b.ICharSizeService),_(4,o.IDecorationService),_(5,o.IBufferService),_(6,b.ICoreBrowserService),_(7,b.IThemeService)],d)},9312:function(g,n,a){var f=this&&this.__decorate||function(x,E,T,B){var D,P=arguments.length,F=P<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(x,E,T,B);else for(var N=x.length-1;N>=0;N--)(D=x[N])&&(F=(P<3?D(F):P>3?D(E,T,F):D(E,T))||F);return P>3&&F&&Object.defineProperty(E,T,F),F},_=this&&this.__param||function(x,E){return function(T,B){E(T,B,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const p=a(9806),m=a(9504),S=a(456),b=a(4725),w=a(8460),u=a(844),l=a(6114),o=a(4841),d=a(511),v=a(2585),y=" ",C=new RegExp(y,"g");let k=n.SelectionService=class extends u.Disposable{constructor(x,E,T,B,D,P,F,N,$){super(),this._element=x,this._screenElement=E,this._linkifier=T,this._bufferService=B,this._coreService=D,this._mouseService=P,this._optionsService=F,this._renderService=N,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.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 S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!x||!E||x[0]===E[0]&&x[1]===E[1])}get selectionText(){const x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!x||!E)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(x[0]===E[0])return"";const D=x[0]<E[0]?x[0]:E[0],P=x[0]<E[0]?E[0]:x[0];for(let F=x[1];F<=E[1];F++){const N=T.translateBufferLineToString(F,!0,D,P);B.push(N)}}else{const D=x[1]===E[1]?E[0]:void 0;B.push(T.translateBufferLineToString(x[1],!0,x[0],D));for(let P=x[1]+1;P<=E[1]-1;P++){const F=T.lines.get(P),N=T.translateBufferLineToString(P,!0);F!=null&&F.isWrapped?B[B.length-1]+=N:B.push(N)}if(x[1]!==E[1]){const P=T.lines.get(E[1]),F=T.translateBufferLineToString(E[1],!0,0,E[0]);P&&P.isWrapped?B[B.length-1]+=F:B.push(F)}}return B.map(D=>D.replace(C," ")).join(l.isWindows?`\r
|
|
53
|
+
`:`
|
|
54
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.isLinux&&x&&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(x){const E=this._getMouseBufferCoords(x),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&E)&&this._areCoordsInSelection(E,T,B)}isCellInSelection(x,E){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([x,E],T,B)}_areCoordsInSelection(x,E,T){return x[1]>E[1]&&x[1]<T[1]||E[1]===T[1]&&x[1]===E[1]&&x[0]>=E[0]&&x[0]<T[0]||E[1]<T[1]&&x[1]===T[1]&&x[0]<T[0]||E[1]<T[1]&&x[1]===E[1]&&x[0]>=E[0]}_selectWordAtCursor(x,E){var T,B;const D=(B=(T=this._linkifier.currentLink)===null||T===void 0?void 0:T.link)===null||B===void 0?void 0:B.range;if(D)return this._model.selectionStart=[D.start.x-1,D.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(D,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(x);return!!P&&(this._selectWordAt(P,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,E){this._model.clearSelection(),x=Math.max(x,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const E=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(x){let E=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=T?0:(E>T&&(E-=T),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(x){return l.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),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(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const E=this._getMouseBufferCoords(x);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(x){return x.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!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(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const B=T.lines.get(this._model.selectionEnd[1]);B&&B.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const E=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const B=(0,m.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,T=!(!x||!E||x[0]===E[0]&&x[1]===E[1]);T?x&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,E,T)):this._oldHasSelection&&this._fireOnSelectionChange(x,E,T)}_fireOnSelectionChange(x,E,T){this._oldSelectionStart=x,this._oldSelectionEnd=E,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(x,E){let T=E;for(let B=0;E>=B;B++){const D=x.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:D>1&&E!==B&&(T+=D-1)}return T}setSelection(x,E,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,E],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,E,T=!0,B=!0){if(x[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,P=D.lines.get(x[1]);if(!P)return;const F=D.translateBufferLineToString(x[1],!1);let N=this._convertViewportColToCharacterIndex(P,x[0]),$=N;const U=x[0]-N;let R=0,L=0,M=0,O=0;if(F.charAt(N)===" "){for(;N>0&&F.charAt(N-1)===" ";)N--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let Y=x[0],X=x[0];P.getWidth(Y)===0&&(R++,Y--),P.getWidth(X)===2&&(L++,X++);const le=P.getString(X).length;for(le>1&&(O+=le-1,$+=le-1);Y>0&&N>0&&!this._isCharWordSeparator(P.loadCell(Y-1,this._workCell));){P.loadCell(Y-1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,Y--):j>1&&(M+=j-1,N-=j-1),N--,Y--}for(;X<P.length&&$+1<F.length&&!this._isCharWordSeparator(P.loadCell(X+1,this._workCell));){P.loadCell(X+1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,X++):j>1&&(O+=j-1,$+=j-1),$++,X++}}$++;let z=N+U-R+M,q=Math.min(this._bufferService.cols,$-N+R+L-M-O);if(E||F.slice(N,$).trim()!==""){if(T&&z===0&&P.getCodePoint(0)!==32){const Y=D.lines.get(x[1]-1);if(Y&&P.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(X){const le=this._bufferService.cols-X.start;z-=le,q+=le}}}if(B&&z+q===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const Y=D.lines.get(x[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const X=this._getWordAt([0,x[1]+1],!1,!1,!0);X&&(q+=X.length)}}return{start:z,length:q}}}_selectWordAt(x,E){const T=this._getWordAt(x,E);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[T.start,x[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(x){const E=this._getWordAt(x,!0);if(E){let T=x[1];for(;E.start<0;)E.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,T]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const E=this._bufferService.buffer.getWrappedRangeForLine(x),T={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(T,this._bufferService.cols)}};n.SelectionService=k=f([_(3,v.IBufferService),_(4,v.ICoreService),_(5,b.IMouseService),_(6,v.IOptionsService),_(7,b.IRenderService),_(8,b.ICoreBrowserService)],k)},4725:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const f=a(8343);n.ICharSizeService=(0,f.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),n.IMouseService=(0,f.createDecorator)("MouseService"),n.IRenderService=(0,f.createDecorator)("RenderService"),n.ISelectionService=(0,f.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(g,n,a){var f=this&&this.__decorate||function(k,x,E,T){var B,D=arguments.length,P=D<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(k,x,E,T);else for(var F=k.length-1;F>=0;F--)(B=k[F])&&(P=(D<3?B(P):D>3?B(x,E,P):B(x,E))||P);return D>3&&P&&Object.defineProperty(x,E,P),P},_=this&&this.__param||function(k,x){return function(E,T){x(E,T,k)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const p=a(7239),m=a(8055),S=a(8460),b=a(844),w=a(2585),u=m.css.toColor("#ffffff"),l=m.css.toColor("#000000"),o=m.css.toColor("#ffffff"),d=m.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let E=0;E<216;E++){const T=x[E/36%6|0],B=x[E/6%6|0],D=x[E%6];k.push({css:m.channels.toCss(T,B,D),rgba:m.channels.toRgba(T,B,D)})}for(let E=0;E<24;E++){const T=8+10*E;k.push({css:m.channels.toCss(T,T,T),rgba:m.channels.toRgba(T,T,T)})}return k})());let y=n.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:l,cursor:o,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:m.color.blend(l,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:m.color.blend(l,v),ansi:n.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(k={}){const x=this._colors;if(x.foreground=C(k.foreground,u),x.background=C(k.background,l),x.cursor=C(k.cursor,o),x.cursorAccent=C(k.cursorAccent,d),x.selectionBackgroundTransparent=C(k.selectionBackground,v),x.selectionBackgroundOpaque=m.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=C(k.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=m.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=k.selectionForeground?C(k.selectionForeground,m.NULL_COLOR):void 0,x.selectionForeground===m.NULL_COLOR&&(x.selectionForeground=void 0),m.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=m.color.opacity(x.selectionBackgroundTransparent,.3)),m.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=m.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=n.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=C(k.black,n.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=C(k.red,n.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=C(k.green,n.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=C(k.yellow,n.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=C(k.blue,n.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=C(k.magenta,n.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=C(k.cyan,n.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=C(k.white,n.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=C(k.brightBlack,n.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=C(k.brightRed,n.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=C(k.brightGreen,n.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=C(k.brightYellow,n.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=C(k.brightBlue,n.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=C(k.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=C(k.brightCyan,n.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=C(k.brightWhite,n.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const E=Math.min(x.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<E;T++)x.ansi[T+16]=C(k.extendedAnsi[T],n.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(k){k(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(k,x){if(k!==void 0)try{return m.css.toColor(k)}catch{}return x}n.ThemeService=y=f([_(0,w.IOptionsService)],y)},6349:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const f=a(8460),_=a(844);class p extends _.Disposable{constructor(S){super(),this._maxLength=S,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(S){if(this._maxLength===S)return;const b=new Array(S);for(let w=0;w<Math.min(S,this.length);w++)b[w]=this._array[this._getCyclicIndex(w)];this._array=b,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let b=this._length;b<S;b++)this._array[b]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,b){this._array[this._getCyclicIndex(S)]=b}push(S){this._array[this._getCyclicIndex(this._length)]=S,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,b,...w){if(b){for(let u=S;u<this._length-b;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+b)];this._length-=b,this.onDeleteEmitter.fire({index:S,amount:b})}for(let u=this._length-1;u>=S;u--)this._array[this._getCyclicIndex(u+w.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<w.length;u++)this._array[this._getCyclicIndex(S+u)]=w[u];if(w.length&&this.onInsertEmitter.fire({index:S,amount:w.length}),this._length+w.length>this._maxLength){const u=this._length+w.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=w.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,b,w){if(!(b<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let l=b-1;l>=0;l--)this.set(S+l+w,this.get(S+l));const u=S+b+w-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<b;u++)this.set(S+u+w,this.get(S+u))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}n.CircularList=p},1439:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(f,_=5){if(typeof f!="object")return f;const p=Array.isArray(f)?[]:{};for(const m in f)p[m]=_<=1?f[m]:f[m]&&a(f[m],_-1);return p}},8055:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;const f=a(6114);let _=0,p=0,m=0,S=0;var b,w,u,l,o;function d(y){const C=y.toString(16);return C.length<2?"0"+C:C}function v(y,C){return y<C?(C+.05)/(y+.05):(y+.05)/(C+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(C,k,x,E){return E!==void 0?`#${d(C)}${d(k)}${d(x)}${d(E)}`:`#${d(C)}${d(k)}${d(x)}`},y.toRgba=function(C,k,x,E=255){return(C<<24|k<<16|x<<8|E)>>>0}}(b||(n.channels=b={})),function(y){function C(k,x){return S=Math.round(255*x),[_,p,m]=o.toChannels(k.rgba),{css:b.toCss(_,p,m,S),rgba:b.toRgba(_,p,m,S)}}y.blend=function(k,x){if(S=(255&x.rgba)/255,S===1)return{css:x.css,rgba:x.rgba};const E=x.rgba>>24&255,T=x.rgba>>16&255,B=x.rgba>>8&255,D=k.rgba>>24&255,P=k.rgba>>16&255,F=k.rgba>>8&255;return _=D+Math.round((E-D)*S),p=P+Math.round((T-P)*S),m=F+Math.round((B-F)*S),{css:b.toCss(_,p,m),rgba:b.toRgba(_,p,m)}},y.isOpaque=function(k){return(255&k.rgba)==255},y.ensureContrastRatio=function(k,x,E){const T=o.ensureContrastRatio(k.rgba,x.rgba,E);if(T)return o.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(k){const x=(255|k.rgba)>>>0;return[_,p,m]=o.toChannels(x),{css:b.toCss(_,p,m),rgba:x}},y.opacity=C,y.multiplyOpacity=function(k,x){return S=255&k.rgba,C(k,S*x/255)},y.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}}(w||(n.color=w={})),function(y){let C,k;if(!f.isNode){const x=document.createElement("canvas");x.width=1,x.height=1;const E=x.getContext("2d",{willReadFrequently:!0});E&&(C=E,C.globalCompositeOperation="copy",k=C.createLinearGradient(0,0,1,1))}y.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return _=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),m=parseInt(x.slice(3,4).repeat(2),16),o.toColor(_,p,m);case 5:return _=parseInt(x.slice(1,2).repeat(2),16),p=parseInt(x.slice(2,3).repeat(2),16),m=parseInt(x.slice(3,4).repeat(2),16),S=parseInt(x.slice(4,5).repeat(2),16),o.toColor(_,p,m,S);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const E=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return _=parseInt(E[1]),p=parseInt(E[2]),m=parseInt(E[3]),S=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),o.toColor(_,p,m,S);if(!C||!k)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=k,C.fillStyle=x,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[_,p,m,S]=C.getImageData(0,0,1,1).data,S!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(_,p,m,S),css:x}}}(u||(n.css=u={})),function(y){function C(k,x,E){const T=k/255,B=x/255,D=E/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}y.relativeLuminance=function(k){return C(k>>16&255,k>>8&255,255&k)},y.relativeLuminance2=C}(l||(n.rgb=l={})),function(y){function C(x,E,T){const B=x>>24&255,D=x>>16&255,P=x>>8&255;let F=E>>24&255,N=E>>16&255,$=E>>8&255,U=v(l.relativeLuminance2(F,N,$),l.relativeLuminance2(B,D,P));for(;U<T&&(F>0||N>0||$>0);)F-=Math.max(0,Math.ceil(.1*F)),N-=Math.max(0,Math.ceil(.1*N)),$-=Math.max(0,Math.ceil(.1*$)),U=v(l.relativeLuminance2(F,N,$),l.relativeLuminance2(B,D,P));return(F<<24|N<<16|$<<8|255)>>>0}function k(x,E,T){const B=x>>24&255,D=x>>16&255,P=x>>8&255;let F=E>>24&255,N=E>>16&255,$=E>>8&255,U=v(l.relativeLuminance2(F,N,$),l.relativeLuminance2(B,D,P));for(;U<T&&(F<255||N<255||$<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),N=Math.min(255,N+Math.ceil(.1*(255-N))),$=Math.min(255,$+Math.ceil(.1*(255-$))),U=v(l.relativeLuminance2(F,N,$),l.relativeLuminance2(B,D,P));return(F<<24|N<<16|$<<8|255)>>>0}y.ensureContrastRatio=function(x,E,T){const B=l.relativeLuminance(x>>8),D=l.relativeLuminance(E>>8);if(v(B,D)<T){if(D<B){const N=C(x,E,T),$=v(B,l.relativeLuminance(N>>8));if($<T){const U=k(x,E,T);return $>v(B,l.relativeLuminance(U>>8))?N:U}return N}const P=k(x,E,T),F=v(B,l.relativeLuminance(P>>8));if(F<T){const N=C(x,E,T);return F>v(B,l.relativeLuminance(N>>8))?P:N}return P}},y.reduceLuminance=C,y.increaseLuminance=k,y.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]},y.toColor=function(x,E,T,B){return{css:b.toCss(x,E,T,B),rgba:b.toRgba(x,E,T,B)}}}(o||(n.rgba=o={})),n.toPaddedHex=d,n.contrastRatio=v},8969:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const f=a(844),_=a(2585),p=a(4348),m=a(7866),S=a(744),b=a(7302),w=a(6975),u=a(8460),l=a(1753),o=a(1480),d=a(7994),v=a(9282),y=a(5435),C=a(5981),k=a(2660);let x=!1;class E extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(B=>{var D;(D=this._onScrollApi)===null||D===void 0||D.fire(B.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(B){for(const D in B)this.optionsService.options[D]=B[D]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new b.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(D=>{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(D=>{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((D,P)=>this._inputHandler.parse(D,P))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,D){this._writeBuffer.write(B,D)}writeSync(B,D){this._logService.logLevel<=_.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(B,D)}resize(B,D){isNaN(B)||isNaN(D)||(B=Math.max(B,S.MINIMUM_COLS),D=Math.max(D,S.MINIMUM_ROWS),this._bufferService.resize(B,D))}scroll(B,D=!1){this._bufferService.scroll(B,D)}scrollLines(B,D,P){this._bufferService.scrollLines(B,D,P)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const D=B-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(B,D){return this._inputHandler.registerEscHandler(B,D)}registerDcsHandler(B,D){return this._inputHandler.registerDcsHandler(B,D)}registerCsiHandler(B,D){return this._inputHandler.registerCsiHandler(B,D)}registerOscHandler(B,D){return this._inputHandler.registerOscHandler(B,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?B=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const D of B)D.dispose()})}}}n.CoreTerminal=E},8460:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.forwardEvent=n.EventEmitter=void 0,n.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 _=[];for(let p=0;p<this._listeners.length;p++)_.push(this._listeners[p]);for(let p=0;p<_.length;p++)_[p].call(void 0,a,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,f){return a(_=>f.fire(_))}},5435:function(g,n,a){var f=this&&this.__decorate||function(U,R,L,M){var O,z=arguments.length,q=z<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(U,R,L,M);else for(var Y=U.length-1;Y>=0;Y--)(O=U[Y])&&(q=(z<3?O(q):z>3?O(R,L,q):O(R,L))||q);return z>3&&q&&Object.defineProperty(R,L,q),q},_=this&&this.__param||function(U,R){return function(L,M){R(L,M,U)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const p=a(2584),m=a(7116),S=a(2015),b=a(844),w=a(482),u=a(8437),l=a(8460),o=a(643),d=a(511),v=a(3734),y=a(2585),C=a(6242),k=a(6351),x=a(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},T=131072;function B(U,R){if(U>24)return R.setWinLines||!1;switch(U){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var D;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(n.WindowsOptionsReportType=D={}));let P=0;class F extends b.Disposable{getAttrData(){return this._curAttrData}constructor(R,L,M,O,z,q,Y,X,le=new S.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=L,this._coreService=M,this._logService=O,this._optionsService=z,this._oscLinkService=q,this._coreMouseService=Y,this._unicodeService=X,this._parser=le,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(j=>this._activeBuffer=j.activeBuffer)),this._parser.setCsiHandlerFallback((j,I)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:I.toArray()})}),this._parser.setEscHandlerFallback(j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})}),this._parser.setExecuteHandlerFallback(j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})}),this._parser.setOscHandlerFallback((j,I,K)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:I,data:K})}),this._parser.setDcsHandlerFallback((j,I,K)=>{I==="HOOK"&&(K=K.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:I,payload:K})}),this._parser.setPrintHandler((j,I,K)=>this.print(j,I,K)),this._parser.registerCsiHandler({final:"@"},j=>this.insertChars(j)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},j=>this.scrollLeft(j)),this._parser.registerCsiHandler({final:"A"},j=>this.cursorUp(j)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},j=>this.scrollRight(j)),this._parser.registerCsiHandler({final:"B"},j=>this.cursorDown(j)),this._parser.registerCsiHandler({final:"C"},j=>this.cursorForward(j)),this._parser.registerCsiHandler({final:"D"},j=>this.cursorBackward(j)),this._parser.registerCsiHandler({final:"E"},j=>this.cursorNextLine(j)),this._parser.registerCsiHandler({final:"F"},j=>this.cursorPrecedingLine(j)),this._parser.registerCsiHandler({final:"G"},j=>this.cursorCharAbsolute(j)),this._parser.registerCsiHandler({final:"H"},j=>this.cursorPosition(j)),this._parser.registerCsiHandler({final:"I"},j=>this.cursorForwardTab(j)),this._parser.registerCsiHandler({final:"J"},j=>this.eraseInDisplay(j,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},j=>this.eraseInDisplay(j,!0)),this._parser.registerCsiHandler({final:"K"},j=>this.eraseInLine(j,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},j=>this.eraseInLine(j,!0)),this._parser.registerCsiHandler({final:"L"},j=>this.insertLines(j)),this._parser.registerCsiHandler({final:"M"},j=>this.deleteLines(j)),this._parser.registerCsiHandler({final:"P"},j=>this.deleteChars(j)),this._parser.registerCsiHandler({final:"S"},j=>this.scrollUp(j)),this._parser.registerCsiHandler({final:"T"},j=>this.scrollDown(j)),this._parser.registerCsiHandler({final:"X"},j=>this.eraseChars(j)),this._parser.registerCsiHandler({final:"Z"},j=>this.cursorBackwardTab(j)),this._parser.registerCsiHandler({final:"`"},j=>this.charPosAbsolute(j)),this._parser.registerCsiHandler({final:"a"},j=>this.hPositionRelative(j)),this._parser.registerCsiHandler({final:"b"},j=>this.repeatPrecedingCharacter(j)),this._parser.registerCsiHandler({final:"c"},j=>this.sendDeviceAttributesPrimary(j)),this._parser.registerCsiHandler({prefix:">",final:"c"},j=>this.sendDeviceAttributesSecondary(j)),this._parser.registerCsiHandler({final:"d"},j=>this.linePosAbsolute(j)),this._parser.registerCsiHandler({final:"e"},j=>this.vPositionRelative(j)),this._parser.registerCsiHandler({final:"f"},j=>this.hVPosition(j)),this._parser.registerCsiHandler({final:"g"},j=>this.tabClear(j)),this._parser.registerCsiHandler({final:"h"},j=>this.setMode(j)),this._parser.registerCsiHandler({prefix:"?",final:"h"},j=>this.setModePrivate(j)),this._parser.registerCsiHandler({final:"l"},j=>this.resetMode(j)),this._parser.registerCsiHandler({prefix:"?",final:"l"},j=>this.resetModePrivate(j)),this._parser.registerCsiHandler({final:"m"},j=>this.charAttributes(j)),this._parser.registerCsiHandler({final:"n"},j=>this.deviceStatus(j)),this._parser.registerCsiHandler({prefix:"?",final:"n"},j=>this.deviceStatusPrivate(j)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},j=>this.softReset(j)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},j=>this.setCursorStyle(j)),this._parser.registerCsiHandler({final:"r"},j=>this.setScrollRegion(j)),this._parser.registerCsiHandler({final:"s"},j=>this.saveCursor(j)),this._parser.registerCsiHandler({final:"t"},j=>this.windowOptions(j)),this._parser.registerCsiHandler({final:"u"},j=>this.restoreCursor(j)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},j=>this.insertColumns(j)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},j=>this.deleteColumns(j)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},j=>this.selectProtected(j)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},j=>this.requestMode(j,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},j=>this.requestMode(j,!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(j=>(this.setTitle(j),this.setIconName(j),!0))),this._parser.registerOscHandler(1,new C.OscHandler(j=>this.setIconName(j))),this._parser.registerOscHandler(2,new C.OscHandler(j=>this.setTitle(j))),this._parser.registerOscHandler(4,new C.OscHandler(j=>this.setOrReportIndexedColor(j))),this._parser.registerOscHandler(8,new C.OscHandler(j=>this.setHyperlink(j))),this._parser.registerOscHandler(10,new C.OscHandler(j=>this.setOrReportFgColor(j))),this._parser.registerOscHandler(11,new C.OscHandler(j=>this.setOrReportBgColor(j))),this._parser.registerOscHandler(12,new C.OscHandler(j=>this.setOrReportCursorColor(j))),this._parser.registerOscHandler(104,new C.OscHandler(j=>this.restoreIndexedColor(j))),this._parser.registerOscHandler(110,new C.OscHandler(j=>this.restoreFgColor(j))),this._parser.registerOscHandler(111,new C.OscHandler(j=>this.restoreBgColor(j))),this._parser.registerOscHandler(112,new C.OscHandler(j=>this.restoreCursorColor(j))),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 j in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},()=>this.selectCharset("("+j)),this._parser.registerEscHandler({intermediates:")",final:j},()=>this.selectCharset(")"+j)),this._parser.registerEscHandler({intermediates:"*",final:j},()=>this.selectCharset("*"+j)),this._parser.registerEscHandler({intermediates:"+",final:j},()=>this.selectCharset("+"+j)),this._parser.registerEscHandler({intermediates:"-",final:j},()=>this.selectCharset("-"+j)),this._parser.registerEscHandler({intermediates:".",final:j},()=>this.selectCharset("."+j)),this._parser.registerEscHandler({intermediates:"/",final:j},()=>this.selectCharset("/"+j));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(j=>(this._logService.error("Parsing error: ",j),j)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((j,I)=>this.requestStatusString(j,I)))}_preserveStack(R,L,M,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=M,this._parseStack.position=O}_logSlowResolvingAsync(R){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([R,new Promise((L,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,L){let M,O=this._activeBuffer.x,z=this._activeBuffer.y,q=0;const Y=this._parseStack.paused;if(Y){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(M),M;O=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>T&&(q=this._parseStack.position+T)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,X=>String.fromCharCode(X)).join("")}"`),typeof R=="string"?R.split("").map(X=>X.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<T&&(this._parseBuffer=new Uint32Array(Math.min(R.length,T))),Y||this._dirtyRowTracker.clearRange(),R.length>T)for(let X=q;X<R.length;X+=T){const le=X+T<R.length?X+T:R.length,j=typeof R=="string"?this._stringDecoder.decode(R.substring(X,le),this._parseBuffer):this._utf8Decoder.decode(R.subarray(X,le),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,j))return this._preserveStack(O,z,j,X),this._logSlowResolvingAsync(M),M}else if(!Y){const X=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,X))return this._preserveStack(O,z,X,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===O&&this._activeBuffer.y===z||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,L,M){let O,z;const q=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,le=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,I=this._curAttrData;let K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-L>0&&K.getWidth(this._activeBuffer.x-1)===2&&K.setCellFromCodePoint(this._activeBuffer.x-1,0,1,I.fg,I.bg,I.extended);for(let W=L;W<M;++W){if(O=R[W],z=this._unicodeService.wcwidth(O),O<127&&q){const ee=q[String.fromCharCode(O)];ee&&(O=ee.charCodeAt(0))}if(Y&&this._onA11yChar.fire((0,w.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),z||!this._activeBuffer.x){if(this._activeBuffer.x+z-1>=X){if(le){for(;this._activeBuffer.x<X;)K.setCellFromCodePoint(this._activeBuffer.x++,0,1,I.fg,I.bg,I.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),K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,z===2)continue}if(j&&(K.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(I),I),K.getWidth(X-1)===2&&K.setCellFromCodePoint(X-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,I.fg,I.bg,I.extended)),K.setCellFromCodePoint(this._activeBuffer.x++,O,z,I.fg,I.bg,I.extended),z>0)for(;--z;)K.setCellFromCodePoint(this._activeBuffer.x++,0,0,I.fg,I.bg,I.extended)}else K.getWidth(this._activeBuffer.x-1)?K.addCodepointToCell(this._activeBuffer.x-1,O):K.addCodepointToCell(this._activeBuffer.x-2,O)}M-L>0&&(K.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-L>0&&K.getWidth(this._activeBuffer.x)===0&&!K.hasContent(this._activeBuffer.x)&&K.setCellFromCodePoint(this._activeBuffer.x,0,1,I.fg,I.bg,I.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,L){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,L):this._parser.registerCsiHandler(R,M=>!B(M.params[0],this._optionsService.rawOptions.windowOptions)||L(M))}registerDcsHandler(R,L){return this._parser.registerDcsHandler(R,new k.DcsHandler(L))}registerEscHandler(R,L){return this._parser.registerEscHandler(R,L)}registerOscHandler(R,L){return this._parser.registerOscHandler(R,new C.OscHandler(L))}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 R;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&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=R,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+L)}cursorUp(R){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const L=R.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=R.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=R.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const L=R.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,L,M,O=!1,z=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);q.replaceCells(L,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),z),O&&(q.isWrapped=!1)}_resetBufferLine(R,L=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),M.isWrapped=!1)}eraseInDisplay(R,L=!1){let M;switch(this._restrictCursor(this._bufferService.cols),R.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,L);M<this._bufferService.rows;M++)this._resetBufferLine(M,L);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,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,L);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(R,L=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let L=R.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,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;L--;)this._activeBuffer.lines.splice(z-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(R){this._restrictCursor();let L=R.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 O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;L--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let L=R.params[0]||1;for(;L--;)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(R){let L=R.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);O.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);O.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);O.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);O.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const L=R.params[0]||1,M=new Uint32Array(L);for(let O=0;O<L;++O)M[O]=this._parser.precedingCodepoint;return this.print(M,0,M.length),!0}sendDeviceAttributesPrimary(R){return R.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(R){return R.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(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let L=0;L<R.length;L++)switch(R.params[L]){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(),R.params[L]===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(R,L){const M=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:z}=this._coreMouseService,q=this._coreService,{buffers:Y,cols:X}=this._bufferService,{active:le,alt:j}=Y,I=this._optionsService.rawOptions,K=ue=>ue?1:2,W=R.params[0];return ee=W,Q=L?W===2?4:W===4?K(q.modes.insertMode):W===12?3:W===20?K(I.convertEol):0:W===1?K(M.applicationCursorKeys):W===3?I.windowOptions.setWinLines?X===80?2:X===132?1:0:0:W===6?K(M.origin):W===7?K(M.wraparound):W===8?3:W===9?K(O==="X10"):W===12?K(I.cursorBlink):W===25?K(!q.isCursorHidden):W===45?K(M.reverseWraparound):W===66?K(M.applicationKeypad):W===67?4:W===1e3?K(O==="VT200"):W===1002?K(O==="DRAG"):W===1003?K(O==="ANY"):W===1004?K(M.sendFocus):W===1005?4:W===1006?K(z==="SGR"):W===1015?4:W===1016?K(z==="SGR_PIXELS"):W===1048?1:W===47||W===1047||W===1049?K(le===j):W===2004?K(M.bracketedPasteMode):0,q.triggerDataEvent(`${p.C0.ESC}[${L?"":"?"}${ee};${Q}$y`),!0;var ee,Q}_updateAttrColor(R,L,M,O,z){return L===2?(R|=50331648,R&=-16777216,R|=v.AttributeData.fromColorRGB([M,O,z])):L===5&&(R&=-50331904,R|=33554432|255&M),R}_extractColor(R,L,M){const O=[0,0,-1,0,0,0];let z=0,q=0;do{if(O[q+z]=R.params[L+q],R.hasSubParams(L+q)){const Y=R.getSubParams(L+q);let X=0;do O[1]===5&&(z=1),O[q+X+1+z]=Y[X];while(++X<Y.length&&X+q+1+z<O.length);break}if(O[1]===5&&q+z>=2||O[1]===2&&q+z>=5)break;O[1]&&(z=1)}while(++q+L<R.length&&q+z<O.length);for(let Y=2;Y<O.length;++Y)O[Y]===-1&&(O[Y]=0);switch(O[0]){case 38:M.fg=this._updateAttrColor(M.fg,O[1],O[3],O[4],O[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,O[1],O[3],O[4],O[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,O[1],O[3],O[4],O[5])}return q}_processUnderline(R,L){L.extended=L.extended.clone(),(!~R||R>5)&&(R=1),L.extended.underlineStyle=R,L.fg|=268435456,R===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(R){R.fg=u.DEFAULT_ATTR_DATA.fg,R.bg=u.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=R.length;let M;const O=this._curAttrData;for(let z=0;z<L;z++)M=R.params[z],M>=30&&M<=37?(O.fg&=-50331904,O.fg|=16777216|M-30):M>=40&&M<=47?(O.bg&=-50331904,O.bg|=16777216|M-40):M>=90&&M<=97?(O.fg&=-50331904,O.fg|=16777224|M-90):M>=100&&M<=107?(O.bg&=-50331904,O.bg|=16777224|M-100):M===0?this._processSGR0(O):M===1?O.fg|=134217728:M===3?O.bg|=67108864:M===4?(O.fg|=268435456,this._processUnderline(R.hasSubParams(z)?R.getSubParams(z)[0]:1,O)):M===5?O.fg|=536870912:M===7?O.fg|=67108864:M===8?O.fg|=1073741824:M===9?O.fg|=2147483648:M===2?O.bg|=134217728:M===21?this._processUnderline(2,O):M===22?(O.fg&=-134217729,O.bg&=-134217729):M===23?O.bg&=-67108865:M===24?(O.fg&=-268435457,this._processUnderline(0,O)):M===25?O.fg&=-536870913:M===27?O.fg&=-67108865:M===28?O.fg&=-1073741825:M===29?O.fg&=2147483647:M===39?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):M===49?(O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?z+=this._extractColor(R,z,O):M===53?O.bg|=1073741824:M===55?O.bg&=-1073741825:M===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):M===100?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${L};${M}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const L=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${L};${M}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const L=R.params[0]||1;switch(L){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=L%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(R){const L=R.params[0]||1;let M;return(R.length<2||(M=R.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(R){if(!B(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.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:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const L=[],M=R.split(";");for(;M.length>1;){const O=M.shift(),z=M.shift();if(/^\d+$/.exec(O)){const q=parseInt(O);if($(q))if(z==="?")L.push({type:0,index:q});else{const Y=(0,x.parseColor)(z);Y&&L.push({type:1,index:q,color:Y})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(R){const L=R.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(R,L){this._getCurrentLinkId()&&this._finishHyperlink();const M=R.split(":");let O;const z=M.findIndex(q=>q.startsWith("id="));return z!==-1&&(O=M[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,L){const M=R.split(";");for(let O=0;O<M.length&&!(L>=this._specialColors.length);++O,++L)if(M[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const z=(0,x.parseColor)(M[O]);z&&this._onColor.fire([{type:1,index:this._specialColors[L],color:z}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const L=[],M=R.split(";");for(let O=0;O<M.length;++O)if(/^\d+$/.exec(M[O])){const z=parseInt(M[O]);$(z)&&L.push({type:2,index:z})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,m.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(E[R[0]],m.CHARSETS[R[1]]||m.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 R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new d.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const M=this._activeBuffer.ybase+this._activeBuffer.y+L,O=this._activeBuffer.lines.get(M);O&&(O.fill(R),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,L){const M=this._bufferService.buffer,O=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${z}${p.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,L){this._dirtyRowTracker.markRangeDirty(R,L)}}n.InputHandler=F;let N=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,R){U>R&&(P=U,U=R,R=P),U<this.start&&(this.start=U),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(U){return 0<=U&&U<256}N=f([_(0,y.IBufferService)],N)},844:(g,n)=>{function a(f){for(const _ of f)_.dispose();f.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.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 _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)===null||_===void 0||_.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}},n.toDisposable=function(f){return{dispose:f}},n.disposeArray=a,n.getDisposeArrayDisposable=function(f){return{dispose:()=>a(f)}}},1505:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,p,m){this._data[_]||(this._data[_]={}),this._data[_][p]=m}get(_,p){return this._data[_]?this._data[_][p]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(f,_,p,m,S){this._data.get(f,_)||this._data.set(f,_,new a),this._data.get(f,_).set(p,m,S)}get(f,_,p,m){var S;return(S=this._data.get(f,_))===null||S===void 0?void 0:S.get(p,m)}clear(){this._data.clear()}}},6114:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof navigator>"u";const a=n.isNode?"node":navigator.userAgent,f=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),n.isIpad=f==="iPad",n.isIphone=f==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),n.isLinux=f.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.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 _=this._getKey(f);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)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])===_);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,_){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===f)}values(){return[...this._array].values()}_search(f){let _=0,p=this._array.length-1;for(;p>=_;){let m=_+p>>1;const S=this._getKey(this._array[m]);if(S>f)p=m-1;else{if(!(S<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}_=m+1}}return _}}},7226:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const f=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let b=0,w=0,u=S.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),w=Math.max(b,w),l=S.timeRemaining(),1.5*w>l)return u-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-b))}ms`),void this._start();u=l}this.clear()}}class p extends _{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const b=Date.now()+S;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=p,n.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:p,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const f=a(643);n.updateWindowsModeWrappedState=function(_){const p=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),m=p==null?void 0:p.get(_.cols-1),S=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);S&&m&&(S.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.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}}n.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,m=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=f},9092:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const f=a(6349),_=a(7226),p=a(3734),m=a(8437),S=a(4634),b=a(511),w=a(643),u=a(4863),l=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(o,d,v){this._hasScrollback=o,this._optionsService=d,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.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(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,d){return new m.BufferLine(this._bufferService.cols,this.getNullCell(o),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const d=o+this._optionsService.rawOptions.scrollback;return d>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:d}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=m.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(o))}}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(o,d){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let y=0;const C=this._getCorrectBufferLength(d);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<o)for(let x=0;x<this.lines.length;x++)y+=+this.lines.get(x).resize(o,v);let k=0;if(this._rows<d)for(let x=this._rows;x<d;x++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(o,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(o,v)));else for(let x=this._rows;x>d;x--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const x=this.lines.length-C;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=C}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,d-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(o,d),this._cols>o))for(let k=0;k<this.lines.length;k++)y+=+this.lines.get(k).resize(o,v);this._cols=o,this._rows=d,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,d){this._cols!==o&&(o>this._cols?this._reflowLarger(o,d):this._reflowSmaller(o,d))}_reflowLarger(o,d){const v=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(v.length>0){const y=(0,S.reflowLargerCreateNewLayout)(this.lines,v);(0,S.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(o,d,y.countRemoved)}}_reflowLargerAdjustViewport(o,d,v){const y=this.getNullCell(m.DEFAULT_ATTR_DATA);let C=v;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new m.BufferLine(o,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(o,d){const v=this.getNullCell(m.DEFAULT_ATTR_DATA),y=[];let C=0;for(let k=this.lines.length-1;k>=0;k--){let x=this.lines.get(k);if(!x||!x.isWrapped&&x.getTrimmedLength()<=o)continue;const E=[x];for(;x.isWrapped&&k>0;)x=this.lines.get(--k),E.unshift(x);const T=this.ybase+this.y;if(T>=k&&T<k+E.length)continue;const B=E[E.length-1].getTrimmedLength(),D=(0,S.reflowSmallerGetNewLineLengths)(E,this._cols,o),P=D.length-E.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const N=[];for(let O=0;O<P;O++){const z=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);N.push(z)}N.length>0&&(y.push({start:k+E.length+C,newLines:N}),C+=N.length),E.push(...N);let $=D.length-1,U=D[$];U===0&&($--,U=D[$]);let R=E.length-P-1,L=B;for(;R>=0;){const O=Math.min(L,U);if(E[$]===void 0)break;if(E[$].copyCellsFrom(E[R],L-O,U-O,O,!0),U-=O,U===0&&($--,U=D[$]),L-=O,L===0){R--;const z=Math.max(R,0);L=(0,S.getWrappedLineTrimmedLength)(E,z,this._cols)}}for(let O=0;O<E.length;O++)D[O]<o&&E[O].setCell(D[O],v);let M=P-F;for(;M-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+d-1)}if(y.length>0){const k=[],x=[];for(let $=0;$<this.lines.length;$++)x.push(this.lines.get($));const E=this.lines.length;let T=E-1,B=0,D=y[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let P=0;for(let $=Math.min(this.lines.maxLength-1,E+C-1);$>=0;$--)if(D&&D.start>T+P){for(let U=D.newLines.length-1;U>=0;U--)this.lines.set($--,D.newLines[U]);$++,k.push({index:T+1,amount:D.newLines.length}),P+=D.newLines.length,D=y[++B]}else this.lines.set($,x[T--]);let F=0;for(let $=k.length-1;$>=0;$--)k[$].index+=F,this.lines.onInsertEmitter.fire(k[$]),F+=k[$].amount;const N=Math.max(0,E+C-this.lines.maxLength);N>0&&this.lines.onTrimEmitter.fire(N)}}translateBufferLineToString(o,d,v=0,y){const C=this.lines.get(o);return C?C.translateToString(d,v,y):""}getWrappedRangeForLine(o){let d=o,v=o;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:d,last:v}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===o&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const d=new u.Marker(o);return this.markers.push(d),d.register(this.lines.onTrim(v=>{d.line-=v,d.line<0&&d.dispose()})),d.register(this.lines.onInsert(v=>{d.line>=v.index&&(d.line+=v.amount)})),d.register(this.lines.onDelete(v=>{d.line>=v.index&&d.line<v.index+v.amount&&d.dispose(),d.line>v.index&&(d.line-=v.amount)})),d.register(d.onDispose(()=>this._removeMarker(d))),d}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const f=a(3734),_=a(511),p=a(643),m=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class b{constructor(u,l,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const d=l||_.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let v=0;v<u;++v)this.setCell(v,d);this.length=u}get(u){const l=this._data[3*u+0],o=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:o?(0,m.stringFromCodePoint)(o):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):o]}set(u,l){this._data[3*u+1]=l[p.CHAR_DATA_ATTR_INDEX],l[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,m.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return S=3*u,l.content=this._data[S+0],l.fg=this._data[S+1],l.bg=this._data[S+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodePoint(u,l,o,d,v,y){268435456&v&&(this._extendedAttrs[u]=y),this._data[3*u+0]=l|o<<22,this._data[3*u+1]=d,this._data[3*u+2]=v}addCodepointToCell(u,l){let o=this._data[3*u+0];2097152&o?this._combined[u]+=(0,m.stringFromCodePoint)(l):(2097151&o?(this._combined[u]=(0,m.stringFromCodePoint)(2097151&o)+(0,m.stringFromCodePoint)(l),o&=-2097152,o|=2097152):o=l|4194304,this._data[3*u+0]=o)}insertCells(u,l,o,d){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),l<this.length-u){const v=new _.CellData;for(let y=this.length-u-l-1;y>=0;--y)this.setCell(u+l+y,this.loadCell(u+y,v));for(let y=0;y<l;++y)this.setCell(u+y,o)}else for(let v=u;v<this.length;++v)this.setCell(v,o);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs)}deleteCells(u,l,o,d){if(u%=this.length,l<this.length-u){const v=new _.CellData;for(let y=0;y<this.length-u-l;++y)this.setCell(u+y,this.loadCell(u+l+y,v));for(let y=this.length-l;y<this.length;++y)this.setCell(y,o)}else for(let v=u;v<this.length;++v)this.setCell(v,o);u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodePoint(u,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs)}replaceCells(u,l,o,d,v=!1){if(v)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodePoint(l,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,o),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs);u<l&&u<this.length;)this.setCell(u++,o)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const d=new Uint32Array(o);d.set(this._data),this._data=d}for(let d=this.length;d<u;++d)this.setCell(d,l)}else{this._data=this._data.subarray(0,o);const d=Object.keys(this._combined);for(let y=0;y<d.length;y++){const C=parseInt(d[y],10);C>=u&&delete this._combined[C]}const v=Object.keys(this._extendedAttrs);for(let y=0;y<v.length;y++){const C=parseInt(v[y],10);C>=u&&delete this._extendedAttrs[C]}}return this.length=u,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,u);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new b(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,o,d,v){const y=u._data;if(v)for(let k=d-1;k>=0;k--){for(let x=0;x<3;x++)this._data[3*(o+k)+x]=y[3*(l+k)+x];268435456&y[3*(l+k)+2]&&(this._extendedAttrs[o+k]=u._extendedAttrs[l+k])}else for(let k=0;k<d;k++){for(let x=0;x<3;x++)this._data[3*(o+k)+x]=y[3*(l+k)+x];268435456&y[3*(l+k)+2]&&(this._extendedAttrs[o+k]=u._extendedAttrs[l+k])}const C=Object.keys(u._combined);for(let k=0;k<C.length;k++){const x=parseInt(C[k],10);x>=l&&(this._combined[x-l+o]=u._combined[x])}}translateToString(u=!1,l=0,o=this.length){u&&(o=Math.min(o,this.getTrimmedLength()));let d="";for(;l<o;){const v=this._data[3*l+0],y=2097151&v;d+=2097152&v?this._combined[l]:y?(0,m.stringFromCodePoint)(y):p.WHITESPACE_CELL_CHAR,l+=v>>22||1}return d}}n.BufferLine=b},4841:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.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,n)=>{function a(f,_,p){if(_===f.length-1)return f[_].getTrimmedLength();const m=!f[_].hasContent(p-1)&&f[_].getWidth(p-1)===1,S=f[_+1].getWidth(0)===2;return m&&S?p-1:p}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(f,_,p,m,S){const b=[];for(let w=0;w<f.length-1;w++){let u=w,l=f.get(++u);if(!l.isWrapped)continue;const o=[f.get(w)];for(;u<f.length&&l.isWrapped;)o.push(l),l=f.get(++u);if(m>=w&&m<u){w+=o.length-1;continue}let d=0,v=a(o,d,_),y=1,C=0;for(;y<o.length;){const x=a(o,y,_),E=x-C,T=p-v,B=Math.min(E,T);o[d].copyCellsFrom(o[y],C,v,B,!1),v+=B,v===p&&(d++,v=0),C+=B,C===x&&(y++,C=0),v===0&&d!==0&&o[d-1].getWidth(p-1)===2&&(o[d].copyCellsFrom(o[d-1],p-1,v++,1,!1),o[d-1].setCell(p-1,S))}o[d].replaceCells(v,p,S);let k=0;for(let x=o.length-1;x>0&&(x>d||o[x].getTrimmedLength()===0);x--)k++;k>0&&(b.push(w+o.length-k),b.push(k)),w+=o.length-1}return b},n.reflowLargerCreateNewLayout=function(f,_){const p=[];let m=0,S=_[m],b=0;for(let w=0;w<f.length;w++)if(S===w){const u=_[++m];f.onDeleteEmitter.fire({index:w-b,amount:u}),w+=u-1,b+=u,S=_[++m]}else p.push(w);return{layout:p,countRemoved:b}},n.reflowLargerApplyNewLayout=function(f,_){const p=[];for(let m=0;m<_.length;m++)p.push(f.get(_[m]));for(let m=0;m<p.length;m++)f.set(m,p[m]);f.length=_.length},n.reflowSmallerGetNewLineLengths=function(f,_,p){const m=[],S=f.map((l,o)=>a(f,o,_)).reduce((l,o)=>l+o);let b=0,w=0,u=0;for(;u<S;){if(S-u<p){m.push(S-u);break}b+=p;const l=a(f,w,_);b>l&&(b-=l,w++);const o=f[w].getWidth(b-1)===2;o&&b--;const d=o?p-1:p;m.push(d),u+=d}return m},n.getWrappedLineTrimmedLength=a},5295:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const f=a(8460),_=a(844),p=a(9092);class m extends _.Disposable{constructor(b,w){super(),this._optionsService=b,this._bufferService=w,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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,w){this._normal.resize(b,w),this._alt.resize(b,w),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}n.BufferSet=m},511:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const f=a(482),_=a(643),p=a(3734);class m extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const w=new m;return w.setFromCharData(b),w}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(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const u=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=m},643:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const f=a(8460),_=a(844);class p{get id(){return this._id}constructor(S){this.line=S,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,_.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}n.Marker=p,p._nextId=1},7116:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(g,n)=>{var a,f,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.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||(n.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||(n.C1=f={})),function(p){p.ST=`${a.ESC}\\`}(_||(n.C1_ESCAPED=_={}))},7399:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const f=a(2584),_={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:["'",'"']};n.evaluateKeyboardEvent=function(p,m,S,b){const w={type:0,cancel:!1,key:void 0},u=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?w.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?w.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?w.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(w.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(p.altKey){w.key=f.C0.ESC+f.C0.DEL;break}w.key=f.C0.DEL;break;case 9:if(p.shiftKey){w.key=f.C0.ESC+"[Z";break}w.key=f.C0.HT,w.cancel=!0;break;case 13:w.key=p.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,w.cancel=!0;break;case 27:w.key=f.C0.ESC,p.altKey&&(w.key=f.C0.ESC+f.C0.ESC),w.cancel=!0;break;case 37:if(p.metaKey)break;u?(w.key=f.C0.ESC+"[1;"+(u+1)+"D",w.key===f.C0.ESC+"[1;3D"&&(w.key=f.C0.ESC+(S?"b":"[1;5D"))):w.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(p.metaKey)break;u?(w.key=f.C0.ESC+"[1;"+(u+1)+"C",w.key===f.C0.ESC+"[1;3C"&&(w.key=f.C0.ESC+(S?"f":"[1;5C"))):w.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(p.metaKey)break;u?(w.key=f.C0.ESC+"[1;"+(u+1)+"A",S||w.key!==f.C0.ESC+"[1;3A"||(w.key=f.C0.ESC+"[1;5A")):w.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(p.metaKey)break;u?(w.key=f.C0.ESC+"[1;"+(u+1)+"B",S||w.key!==f.C0.ESC+"[1;3B"||(w.key=f.C0.ESC+"[1;5B")):w.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(w.key=f.C0.ESC+"[2~");break;case 46:w.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:w.key=u?f.C0.ESC+"[1;"+(u+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:w.key=u?f.C0.ESC+"[1;"+(u+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:p.shiftKey?w.type=2:p.ctrlKey?w.key=f.C0.ESC+"[5;"+(u+1)+"~":w.key=f.C0.ESC+"[5~";break;case 34:p.shiftKey?w.type=3:p.ctrlKey?w.key=f.C0.ESC+"[6;"+(u+1)+"~":w.key=f.C0.ESC+"[6~";break;case 112:w.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:w.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:w.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:w.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:w.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:w.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:w.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:w.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:w.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:w.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:w.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:w.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(S&&!b||!p.altKey||p.metaKey)!S||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?w.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(w.key=f.C0.US),p.key==="@"&&(w.key=f.C0.NUL)):p.keyCode===65&&(w.type=1);else{const l=_[p.keyCode],o=l==null?void 0:l[p.shiftKey?1:0];if(o)w.key=f.C0.ESC+o;else if(p.keyCode>=65&&p.keyCode<=90){const d=p.ctrlKey?p.keyCode-64:p.keyCode+32;let v=String.fromCharCode(d);p.shiftKey&&(v=v.toUpperCase()),w.key=f.C0.ESC+v}else if(p.keyCode===32)w.key=f.C0.ESC+(p.ctrlKey?f.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let d=p.code.slice(3,4);p.shiftKey||(d=d.toLowerCase()),w.key=f.C0.ESC+d,w.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?w.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?w.key=f.C0.NUL:p.keyCode>=51&&p.keyCode<=55?w.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?w.key=f.C0.DEL:p.keyCode===219?w.key=f.C0.ESC:p.keyCode===220?w.key=f.C0.FS:p.keyCode===221&&(w.key=f.C0.GS)}return w}},482:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,f=0,_=a.length){let p="";for(let m=f;m<_;++m){let S=a[m];S>65535?(S-=65536,p+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):p+=String.fromCharCode(S)}return p},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,f){const _=a.length;if(!_)return 0;let p=0,m=0;if(this._interim){const S=a.charCodeAt(m++);56320<=S&&S<=57343?f[p++]=1024*(this._interim-55296)+S-56320+65536:(f[p++]=this._interim,f[p++]=S),this._interim=0}for(let S=m;S<_;++S){const b=a.charCodeAt(S);if(55296<=b&&b<=56319){if(++S>=_)return this._interim=b,p;const w=a.charCodeAt(S);56320<=w&&w<=57343?f[p++]=1024*(b-55296)+w-56320+65536:(f[p++]=b,f[p++]=w)}else b!==65279&&(f[p++]=b)}return p}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,f){const _=a.length;if(!_)return 0;let p,m,S,b,w=0,u=0,l=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let C,k=0;for(;(C=63&this.interim[++k])&&k<4;)y<<=6,y|=C;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=x-k;for(;l<E;){if(l>=_)return 0;if(C=a[l++],(192&C)!=128){l--,v=!0;break}this.interim[k++]=C,y<<=6,y|=63&C}v||(x===2?y<128?l--:f[w++]=y:x===3?y<2048||y>=55296&&y<=57343||y===65279||(f[w++]=y):y<65536||y>1114111||(f[w++]=y)),this.interim.fill(0)}const o=_-4;let d=l;for(;d<_;){for(;!(!(d<o)||128&(p=a[d])||128&(m=a[d+1])||128&(S=a[d+2])||128&(b=a[d+3]));)f[w++]=p,f[w++]=m,f[w++]=S,f[w++]=b,d+=4;if(p=a[d++],p<128)f[w++]=p;else if((224&p)==192){if(d>=_)return this.interim[0]=p,w;if(m=a[d++],(192&m)!=128){d--;continue}if(u=(31&p)<<6|63&m,u<128){d--;continue}f[w++]=u}else if((240&p)==224){if(d>=_)return this.interim[0]=p,w;if(m=a[d++],(192&m)!=128){d--;continue}if(d>=_)return this.interim[0]=p,this.interim[1]=m,w;if(S=a[d++],(192&S)!=128){d--;continue}if(u=(15&p)<<12|(63&m)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[w++]=u}else if((248&p)==240){if(d>=_)return this.interim[0]=p,w;if(m=a[d++],(192&m)!=128){d--;continue}if(d>=_)return this.interim[0]=p,this.interim[1]=m,w;if(S=a[d++],(192&S)!=128){d--;continue}if(d>=_)return this.interim[0]=p,this.interim[1]=m,this.interim[2]=S,w;if(b=a[d++],(192&b)!=128){d--;continue}if(u=(7&p)<<18|(63&m)<<12|(63&S)<<6|63&b,u<65536||u>1114111)continue;f[w++]=u}}return w}}},225:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.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 _;n.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let p=0;p<a.length;++p)_.fill(0,a[p][0],a[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?_[p]:function(m,S){let b,w=0,u=S.length-1;if(m<S[0][0]||m>S[u][1])return!1;for(;u>=w;)if(b=w+u>>1,m>S[b][1])w=b+1;else{if(!(m<S[b][0]))return!0;u=b-1}return!1}(p,f)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}}},5981:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const f=a(8460),_=a(844);class p extends _.Disposable{constructor(S){super(),this._action=S,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,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,b){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(b)}_innerWrite(S=0,b=!0){const w=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,b);if(l){const d=v=>Date.now()-w>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(w,v);return void l.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(d)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-w>=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()}}n.WriteBuffer=p},5941:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.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 _(p,m){const S=p.toString(16),b=S.length<2?"0"+S:S;switch(m){case 4:return S[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}n.parseColor=function(p){if(!p)return;let m=p.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const S=a.exec(m);if(S){const b=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/b*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/b*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/b*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const S=m.length/3,b=[0,0,0];for(let w=0;w<3;++w){const u=parseInt(m.slice(S*w,S*w+S),16);b[w]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return b}},n.toRgbString=function(p,m=16){const[S,b,w]=p;return`rgb:${_(S,m)}/${_(b,m)}/${_(w,m)}`}},5770:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const f=a(482),_=a(8742),p=a(5770),m=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(b,w){this._handlers[b]===void 0&&(this._handlers[b]=[]);const u=this._handlers[b];return u.push(w),{dispose:()=>{const l=u.indexOf(w);l!==-1&&u.splice(l,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(b,w){if(this.reset(),this._ident=b,this._active=this._handlers[b]||m,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(b,w,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(b,w,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(b,w,u))}unhook(b,w=!0){if(this._active.length){let u=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=w,o=this._stack.fallThrough,this._stack.paused=!1),!o&&u===!1){for(;l>=0&&(u=this._active[l].unhook(b),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",b);this._active=m,this._ident=0}};const S=new _.Params;S.addParam(0),n.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=S,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():S,this._data="",this._hitLimit=!1}put(b,w,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(b,w,u),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let w=!1;if(this._hitLimit)w=!1;else if(b&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,w}}},2015:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const f=a(844),_=a(8742),p=a(6242),m=a(6351);class S{constructor(l){this.table=new Uint8Array(l)}setDefault(l,o){this.table.fill(l<<4|o)}add(l,o,d,v){this.table[o<<8|l]=d<<4|v}addMany(l,o,d,v){for(let y=0;y<l.length;y++)this.table[o<<8|l[y]]=d<<4|v}}n.TransitionTable=S;const b=160;n.VT500_TRANSITION_TABLE=function(){const u=new S(4095),l=Array.apply(null,Array(256)).map((k,x)=>x),o=(k,x)=>l.slice(k,x),d=o(32,127),v=o(0,24);v.push(25),v.push.apply(v,o(28,32));const y=o(0,14);let C;for(C in u.setDefault(1,0),u.addMany(d,0,2,0),y)u.addMany([24,26,153,154],C,3,0),u.addMany(o(128,144),C,3,0),u.addMany(o(144,152),C,3,0),u.add(156,C,0,0),u.add(27,C,11,1),u.add(157,C,4,8),u.addMany([152,158,159],C,0,7),u.add(155,C,11,3),u.add(144,C,11,9);return u.addMany(v,0,3,0),u.addMany(v,1,3,1),u.add(127,1,0,1),u.addMany(v,8,0,8),u.addMany(v,3,3,3),u.add(127,3,0,3),u.addMany(v,4,3,4),u.add(127,4,0,4),u.addMany(v,6,3,6),u.addMany(v,5,3,5),u.add(127,5,0,5),u.addMany(v,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(d,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(o(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(d,7,0,7),u.addMany(v,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(o(64,127),3,7,0),u.addMany(o(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(o(48,60),4,8,4),u.addMany(o(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(o(32,64),6,0,6),u.add(127,6,0,6),u.addMany(o(64,127),6,0,0),u.addMany(o(32,48),3,9,5),u.addMany(o(32,48),5,9,5),u.addMany(o(48,64),5,0,6),u.addMany(o(64,127),5,7,0),u.addMany(o(32,48),4,9,5),u.addMany(o(32,48),1,9,2),u.addMany(o(32,48),2,9,2),u.addMany(o(48,127),2,10,0),u.addMany(o(48,80),1,10,0),u.addMany(o(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(o(96,127),1,10,0),u.add(80,1,11,9),u.addMany(v,9,0,9),u.add(127,9,0,9),u.addMany(o(28,32),9,0,9),u.addMany(o(32,48),9,9,12),u.addMany(o(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(v,11,0,11),u.addMany(o(32,128),11,0,11),u.addMany(o(28,32),11,0,11),u.addMany(v,10,0,10),u.add(127,10,0,10),u.addMany(o(28,32),10,0,10),u.addMany(o(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(o(32,48),10,9,12),u.addMany(v,12,0,12),u.add(127,12,0,12),u.addMany(o(28,32),12,0,12),u.addMany(o(32,48),12,9,12),u.addMany(o(48,64),12,0,11),u.addMany(o(64,127),12,12,13),u.addMany(o(64,127),10,12,13),u.addMany(o(64,127),9,12,13),u.addMany(v,13,13,13),u.addMany(d,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(b,0,2,0),u.add(b,8,5,8),u.add(b,6,0,6),u.add(b,11,0,11),u.add(b,13,13,13),u}();class w extends f.Disposable{constructor(l=n.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(o,d,v)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,d)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,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 m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,o=[64,126]){let d=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=l.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<l.intermediates.length;++y){const C=l.intermediates.charCodeAt(y);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=C}}if(l.final.length!==1)throw new Error("final must be a single byte");const v=l.final.charCodeAt(0);if(o[0]>v||v>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return d<<=8,d|=v,d}identToString(l){const o=[];for(;l;)o.push(String.fromCharCode(255&l)),l>>=8;return o.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,o){const d=this._identifier(l,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const v=this._escHandlers[d];return v.push(o),{dispose:()=>{const y=v.indexOf(o);y!==-1&&v.splice(y,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,o){this._executeHandlers[l.charCodeAt(0)]=o}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,o){const d=this._identifier(l);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const v=this._csiHandlers[d];return v.push(o),{dispose:()=>{const y=v.indexOf(o);y!==-1&&v.splice(y,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,o){return this._dcsParser.registerHandler(this._identifier(l),o)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,o){return this._oscParser.registerHandler(l,o)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,o,d,v,y){this._parseStack.state=l,this._parseStack.handlers=o,this._parseStack.handlerPos=d,this._parseStack.transition=v,this._parseStack.chunkPos=y}parse(l,o,d){let v,y=0,C=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&E>-1){for(;E>=0&&(v=x[E](this._params),v!==!0);E--)if(v instanceof Promise)return this._parseStack.handlerPos=E,v}this._parseStack.handlers=[];break;case 4:if(d===!1&&E>-1){for(;E>=0&&(v=x[E](),v!==!0);E--)if(v instanceof Promise)return this._parseStack.handlerPos=E,v}this._parseStack.handlers=[];break;case 6:if(y=l[this._parseStack.chunkPos],v=this._dcsParser.unhook(y!==24&&y!==26,d),v)return v;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=l[this._parseStack.chunkPos],v=this._oscParser.end(y!==24&&y!==26,d),v)return v;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let x=k;x<o;++x){switch(y=l[x],C=this._transitions.table[this.currentState<<8|(y<160?y:b)],C>>4){case 2:for(let P=x+1;;++P){if(P>=o||(y=l[P])<32||y>126&&y<b){this._printHandler(l,x,P),x=P-1;break}if(++P>=o||(y=l[P])<32||y>126&&y<b){this._printHandler(l,x,P),x=P-1;break}if(++P>=o||(y=l[P])<32||y>126&&y<b){this._printHandler(l,x,P),x=P-1;break}if(++P>=o||(y=l[P])<32||y>126&&y<b){this._printHandler(l,x,P),x=P-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|y];let T=E?E.length-1:-1;for(;T>=0&&(v=E[T](this._params),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(3,E,T,C,x),v;T<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingCodepoint=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++x<o&&(y=l[x])>47&&y<60);x--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const B=this._escHandlers[this._collect<<8|y];let D=B?B.length-1:-1;for(;D>=0&&(v=B[D](),v!==!0);D--)if(v instanceof Promise)return this._preserveStack(4,B,D,C,x),v;D<0&&this._escHandlerFb(this._collect<<8|y),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|y,this._params);break;case 13:for(let P=x+1;;++P)if(P>=o||(y=l[P])===24||y===26||y===27||y>127&&y<b){this._dcsParser.put(l,x,P),x=P-1;break}break;case 14:if(v=this._dcsParser.unhook(y!==24&&y!==26),v)return this._preserveStack(6,[],0,C,x),v;y===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 P=x+1;;P++)if(P>=o||(y=l[P])<32||y>127&&y<b){this._oscParser.put(l,x,P),x=P-1;break}break;case 6:if(v=this._oscParser.end(y!==24&&y!==26),v)return this._preserveStack(5,[],0,C,x),v;y===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}n.EscapeSequenceParser=w},6242:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const f=a(5770),_=a(482),p=[];n.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(m,S){this._handlers[m]===void 0&&(this._handlers[m]=[]);const b=this._handlers[m];return b.push(S),{dispose:()=>{const w=b.indexOf(S);w!==-1&&b.splice(w,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].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 m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,S,b){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(m,S,b);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(m,S,b))}start(){this.reset(),this._state=1}put(m,S,b){if(this._state!==3){if(this._state===1)for(;S<b;){const w=m[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&b-S>0&&this._put(m,S,b)}}end(m,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,w=this._active.length-1,u=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,b=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&b===!1){for(;w>=0&&(b=this._active[w].end(m),b!==!0);w--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,b;w--}for(;w>=0;w--)if(b=this._active[w].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",m);this._active=p,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,S,b){this._hitLimit||(this._data+=(0,_.utf32ToString)(m,S,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let S=!1;if(this._hitLimit)S=!1;else if(m&&(S=this._handler(this._data),S instanceof Promise))return S.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,S}}},8742:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class f{static fromArray(p){const m=new f;if(!p.length)return m;for(let S=Array.isArray(p[0])?1:0;S<p.length;++S){const b=p[S];if(Array.isArray(b))for(let w=0;w<b.length;++w)m.addSubParam(b[w]);else m.addParam(b)}return m}constructor(p=32,m=32){if(this.maxLength=p,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(m),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 m=0;m<this.length;++m){p.push(this.params[m]);const S=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-S>0&&p.push(Array.prototype.slice.call(this._subParams,S,b))}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 m=this._subParamsIdx[p]>>8,S=255&this._subParamsIdx[p];return S-m>0?this._subParams.subarray(m,S):null}getSubParamsAll(){const p={};for(let m=0;m<this.length;++m){const S=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-S>0&&(p[m]=this._subParams.slice(S,b))}return p}addDigit(p){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,b=S[m-1];S[m-1]=~b?Math.min(10*b+p,a):p}}n.Params=f},5741:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.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 _={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(_),f.dispose=()=>this._wrappedAddonDispose(_),f.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let f=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){f=_;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,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const f=a(3785),_=a(511);n.BufferApiView=class{constructor(p,m){this._buffer=p,this.type=m}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 m=this._buffer.lines.get(p);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new _.CellData}}},3785:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const f=a(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,p){if(!(_<0||_>=this._line.length))return p?(this._line.loadCell(_,p),p):this._line.loadCell(_,new f.CellData)}translateToString(_,p,m){return this._line.translateToString(_,p,m)}}},8285:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const f=a(8771),_=a(8460),p=a(844);class m extends p.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new _.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)}}n.BufferNamespaceApi=m},7975:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,f){return this._core.registerCsiHandler(a,_=>f(_.toArray()))}addCsiHandler(a,f){return this.registerCsiHandler(a,f)}registerDcsHandler(a,f){return this._core.registerDcsHandler(a,(_,p)=>f(_,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,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.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,n,a){var f=this&&this.__decorate||function(u,l,o,d){var v,y=arguments.length,C=y<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,d);else for(var k=u.length-1;k>=0;k--)(v=u[k])&&(C=(y<3?v(C):y>3?v(l,o,C):v(l,o))||C);return y>3&&C&&Object.defineProperty(l,o,C),C},_=this&&this.__param||function(u,l){return function(o,d){l(o,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const p=a(8460),m=a(844),S=a(5295),b=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let w=n.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(u){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(u.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const o=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===u.fg&&d.getBg(0)===u.bg||(d=o.getBlankLine(u,l),this._cachedBlankLine=d),d.isWrapped=l;const v=o.ybase+o.scrollTop,y=o.ybase+o.scrollBottom;if(o.scrollTop===0){const C=o.lines.isFull;y===o.lines.length-1?C?o.lines.recycle().copyFrom(d):o.lines.push(d.clone()):o.lines.splice(y+1,0,d.clone()),C?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const C=y-v+1;o.lines.shiftElements(v+1,C-1,-1),o.lines.set(y,d.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(u,l,o){const d=this.buffer;if(u<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else u+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const v=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+u,d.ybase),0),v!==d.ydisp&&(l||this._onScroll.fire(d.ydisp))}};n.BufferService=w=f([_(0,b.IOptionsService)],w)},7994:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.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,n,a){var f=this&&this.__decorate||function(d,v,y,C){var k,x=arguments.length,E=x<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,v,y,C);else for(var T=d.length-1;T>=0;T--)(k=d[T])&&(E=(x<3?k(E):x>3?k(v,y,E):k(v,y))||E);return x>3&&E&&Object.defineProperty(v,y,E),E},_=this&&this.__param||function(d,v){return function(y,C){v(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const p=a(2585),m=a(8460),S=a(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function w(d,v){let y=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(y|=64,y|=d.action):(y|=3&d.button,4&d.button&&(y|=64),8&d.button&&(y|=128),d.action===32?y|=32:d.action!==0||v||(y|=3)),y}const u=String.fromCharCode,l={DEFAULT:d=>{const v=[w(d,!1)+32,d.col+32,d.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${u(v[0])}${u(v[1])}${u(v[2])}`},SGR:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${w(d,!0)};${d.col};${d.row}${v}`},SGR_PIXELS:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${w(d,!0)};${d.x};${d.y}${v}`}};let o=n.CoreMouseService=class extends S.Disposable{constructor(d,v){super(),this._bufferService=d,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(b))this.addProtocol(y,b[y]);for(const y of Object.keys(l))this.addEncoding(y,l[y]);this.reset()}addProtocol(d,v){this._protocols[d]=v}addEncoding(d,v){this._encodings[d]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const v=this._encodings[this._activeEncoding](d);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,v,y){if(y){if(d.x!==v.x||d.y!==v.y)return!1}else if(d.col!==v.col||d.row!==v.row)return!1;return d.button===v.button&&d.action===v.action&&d.ctrl===v.ctrl&&d.alt===v.alt&&d.shift===v.shift}};n.CoreMouseService=o=f([_(0,p.IBufferService),_(1,p.ICoreService)],o)},6975:function(g,n,a){var f=this&&this.__decorate||function(o,d,v,y){var C,k=arguments.length,x=k<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,d,v,y);else for(var E=o.length-1;E>=0;E--)(C=o[E])&&(x=(k<3?C(x):k>3?C(d,v,x):C(d,v))||x);return k>3&&x&&Object.defineProperty(d,v,x),x},_=this&&this.__param||function(o,d){return function(v,y){d(v,y,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const p=a(1439),m=a(8460),S=a(844),b=a(2585),w=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=n.CoreService=class extends S.Disposable{constructor(o,d,v){super(),this._bufferService=o,this._logService=d,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(u)}reset(){this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(u)}triggerDataEvent(o,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,()=>o.split("").map(y=>y.charCodeAt(0))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,()=>o.split("").map(d=>d.charCodeAt(0))),this._onBinary.fire(o))}};n.CoreService=l=f([_(0,b.IBufferService),_(1,b.ILogService),_(2,b.IOptionsService)],l)},9074:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const f=a(8055),_=a(8460),p=a(844),m=a(6106);let S=0,b=0;class w extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(o=>o==null?void 0:o.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)(()=>this.reset()))}registerDecoration(o){if(o.marker.isDisposed)return;const d=new u(o);if(d){const v=d.marker.onDispose(()=>d.dispose());d.onDispose(()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),v.dispose())}),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,d,v){var y,C,k;let x=0,E=0;for(const T of this._decorations.getKeyIterator(d))x=(y=T.options.x)!==null&&y!==void 0?y:0,E=x+((C=T.options.width)!==null&&C!==void 0?C:1),o>=x&&o<E&&(!v||((k=T.options.layer)!==null&&k!==void 0?k:"bottom")===v)&&(yield T)}forEachDecorationAtCell(o,d,v,y){this._decorations.forEachByKey(d,C=>{var k,x,E;S=(k=C.options.x)!==null&&k!==void 0?k:0,b=S+((x=C.options.width)!==null&&x!==void 0?x:1),o>=S&&o<b&&(!v||((E=C.options.layer)!==null&&E!==void 0?E:"bottom")===v)&&y(C)})}}n.DecorationService=w;class u 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(o){super(),this.options=o,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const f=a(2585),_=a(8343);class p{constructor(...S){this._entries=new Map;for(const[b,w]of S)this.set(b,w)}set(S,b){const w=this._entries.get(S);return this._entries.set(S,b),w}forEach(S){for(const[b,w]of this._entries.entries())S(b,w)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}n.ServiceCollection=p,n.InstantiationService=class{constructor(){this._services=new p,this._services.set(f.IInstantiationService,this)}setService(m,S){this._services.set(m,S)}getService(m){return this._services.get(m)}createInstance(m,...S){const b=(0,_.getServiceDependencies)(m).sort((l,o)=>l.index-o.index),w=[];for(const l of b){const o=this._services.get(l.id);if(!o)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${l.id}.`);w.push(o)}const u=b.length>0?b[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new m(...S,...w)}}},7866:function(g,n,a){var f=this&&this.__decorate||function(u,l,o,d){var v,y=arguments.length,C=y<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,d);else for(var k=u.length-1;k>=0;k--)(v=u[k])&&(C=(y<3?v(C):y>3?v(l,o,C):v(l,o))||C);return y>3&&C&&Object.defineProperty(l,o,C),C},_=this&&this.__param||function(u,l){return function(o,d){l(o,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const p=a(844),m=a(2585),S={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let b,w=n.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,o){this._evalLazyOptionalParams(o),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(u,...l){var o,d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((d=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.log,u,l)}debug(u,...l){var o,d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((d=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.log,u,l)}info(u,...l){var o,d;this._logLevel<=m.LogLevelEnum.INFO&&this._log((d=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.info,u,l)}warn(u,...l){var o,d;this._logLevel<=m.LogLevelEnum.WARN&&this._log((d=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.warn,u,l)}error(u,...l){var o,d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((d=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.error,u,l)}};n.LogService=w=f([_(0,m.IOptionsService)],w),n.setTraceLogger=function(u){b=u},n.traceCall=function(u,l,o){if(typeof o.value!="function")throw new Error("not supported");const d=o.value;o.value=function(...v){if(b.logLevel!==m.LogLevelEnum.TRACE)return d.apply(this,v);b.trace(`GlyphRenderer#${d.name}(${v.map(C=>JSON.stringify(C)).join(", ")})`);const y=d.apply(this,v);return b.trace(`GlyphRenderer#${d.name} return`,y),y}}},7302:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const f=a(8460),_=a(844),p=a(6114);n.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 m=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends _.Disposable{constructor(w){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u=Object.assign({},n.DEFAULT_OPTIONS);for(const l in w)if(l in u)try{const o=w[l];u[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=u,this.options=Object.assign({},u),this._setupOptions()}onSpecificOptionChange(w,u){return this.onOptionChange(l=>{l===w&&u(this.rawOptions[w])})}onMultipleOptionChange(w,u){return this.onOptionChange(l=>{w.indexOf(l)!==-1&&u()})}_setupOptions(){const w=l=>{if(!(l in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,o)=>{if(!(l in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);o=this._sanitizeAndValidateOption(l,o),this.rawOptions[l]!==o&&(this.rawOptions[l]=o,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const o={get:w.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(w,u){switch(w){case"cursorStyle":if(u||(u=n.DEFAULT_OPTIONS[w]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${w}`);break;case"wordSeparator":u||(u=n.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=m.includes(u)?u:n.DEFAULT_OPTIONS[w];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${w} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${w} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}n.OptionsService=S},2660:function(g,n,a){var f=this&&this.__decorate||function(S,b,w,u){var l,o=arguments.length,d=o<3?b:u===null?u=Object.getOwnPropertyDescriptor(b,w):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(S,b,w,u);else for(var v=S.length-1;v>=0;v--)(l=S[v])&&(d=(o<3?l(d):o>3?l(b,w,d):l(b,w))||d);return o>3&&d&&Object.defineProperty(b,w,d),d},_=this&&this.__param||function(S,b){return function(w,u){b(w,u,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const p=a(2585);let m=n.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const b=this._bufferService.buffer;if(S.id===void 0){const v=b.addMarker(b.ybase+b.y),y={data:S,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(y,v)),this._dataByLinkId.set(y.id,y),y.id}const w=S,u=this._getEntryIdKey(w),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,b.ybase+b.y),l.id;const o=b.addMarker(b.ybase+b.y),d={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(d,o)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(S,b){const w=this._dataByLinkId.get(S);if(w&&w.lines.every(u=>u.line!==b)){const u=this._bufferService.buffer.addMarker(b);w.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(w,u))}}getLinkData(S){var b;return(b=this._dataByLinkId.get(S))===null||b===void 0?void 0:b.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,b){const w=S.lines.indexOf(b);w!==-1&&(S.lines.splice(w,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};n.OscLinkService=m=f([_(0,p.IBufferService)],m)},8343:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",f="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[f]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const p=function(m,S,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,u,l){u[a]===u?u[f].push({id:w,index:l}):(u[f]=[{id:w,index:l}],u[a]=u)})(p,m,b)};return p.toString=()=>_,n.serviceRegistry.set(_,p),p}},2585:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const f=a(8343);var _;n.IBufferService=(0,f.createDecorator)("BufferService"),n.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),n.ICoreService=(0,f.createDecorator)("CoreService"),n.ICharsetService=(0,f.createDecorator)("CharsetService"),n.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"}(_||(n.LogLevelEnum=_={})),n.ILogService=(0,f.createDecorator)("LogService"),n.IOptionsService=(0,f.createDecorator)("OptionsService"),n.IOscLinkService=(0,f.createDecorator)("OscLinkService"),n.IUnicodeService=(0,f.createDecorator)("UnicodeService"),n.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(g,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const f=a(8460),_=a(225);n.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const p=new _.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 m=0;const S=p.length;for(let b=0;b<S;++b){let w=p.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=S)return m+this.wcwidth(w);const u=p.charCodeAt(b);56320<=u&&u<=57343?w=1024*(w-55296)+u-56320+65536:m+=this.wcwidth(u)}m+=this.wcwidth(w)}return m}}}},i={};function s(g){var n=i[g];if(n!==void 0)return n.exports;var a=i[g]={exports:{}};return r[g].call(a.exports,a,a.exports,s),a.exports}var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const n=s(9042),a=s(3236),f=s(844),_=s(5741),p=s(8285),m=s(7975),S=s(7090),b=["cols","rows"];class w extends f.Disposable{constructor(l){super(),this._core=this.register(new a.Terminal(l)),this._addonManager=this.register(new _.AddonManager),this._publicOptions=Object.assign({},this._core.options);const o=v=>this._core.options[v],d=(v,y)=>{this._checkReadonlyOptions(v),this._core.options[v]=y};for(const v in this._core.options){const y={get:o.bind(this,v),set:d.bind(this,v)};Object.defineProperty(this._publicOptions,v,y)}}_checkReadonlyOptions(l){if(b.includes(l))throw new Error(`Option "${l}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.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 l=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const o in l)this._publicOptions[o]=l[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(l,o){this._verifyIntegers(l,o),this._core.resize(l,o)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){var o,d,v;return this._checkProposedApi(),this._verifyPositiveIntegers((o=l.x)!==null&&o!==void 0?o:0,(d=l.width)!==null&&d!==void 0?d:0,(v=l.height)!==null&&v!==void 0?v:0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,o,d){this._verifyIntegers(l,o,d),this._core.select(l,o,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,o){this._verifyIntegers(l,o),this._core.selectLines(l,o)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,o){this._core.write(l,o)}writeln(l,o){this._core.write(l),this._core.write(`\r
|
|
56
|
+
`,o)}paste(l){this._core.paste(l)}refresh(l,o){this._verifyIntegers(l,o),this._core.refresh(l,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return n}_verifyIntegers(...l){for(const o of l)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const o of l)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}g.Terminal=w})(),c})())})(av);var ay=av.exports,cv={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const c=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(c._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,c=s._renderService.dimensions;if(c.css.cell.width===0||c.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),f=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),p=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),m=f-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(m/c.css.cell.width)),rows:Math.max(1,Math.floor(p/c.css.cell.height))}}}})(),r})())})(cv);var ly=cv.exports,uv={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(g,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(f,_,p,m={}){this._terminal=f,this._regex=_,this._handler=p,this._options=m}provideLinks(f,_){const p=a.computeLink(f,this._regex,this._terminal,this._handler);_(this._addCallbacks(p))}_addCallbacks(f){return f.map(_=>(_.leave=this._options.leave,_.hover=(p,m)=>{if(this._options.hover){const{range:S}=_;this._options.hover(p,m,S)}},_))}};class a{static computeLink(_,p,m,S){const b=new RegExp(p.source,(p.flags||"")+"g"),[w,u]=a._getWindowedLineStrings(_-1,m),l=w.join("");let o;const d=[];for(;o=b.exec(l);){const v=o[0];try{const T=new URL(v),B=decodeURI(T.toString());if(v!==B&&v+"/"!==B)continue}catch{continue}const[y,C]=a._mapStrIdx(m,u,0,o.index),[k,x]=a._mapStrIdx(m,y,C,v.length);if(y===-1||C===-1||k===-1||x===-1)continue;const E={start:{x:C+1,y:y+1},end:{x,y:k+1}};d.push({range:E,text:v,activate:S})}return d}static _getWindowedLineStrings(_,p){let m,S=_,b=_,w=0,u="";const l=[];if(m=p.buffer.active.getLine(_)){const o=m.translateToString(!0);if(m.isWrapped&&o[0]!==" "){for(w=0;(m=p.buffer.active.getLine(--S))&&w<2048&&(u=m.translateToString(!0),w+=u.length,l.push(u),m.isWrapped&&u.indexOf(" ")===-1););l.reverse()}for(l.push(o),w=0;(m=p.buffer.active.getLine(++b))&&m.isWrapped&&w<2048&&(u=m.translateToString(!0),w+=u.length,l.push(u),u.indexOf(" ")===-1););}return[l,S]}static _mapStrIdx(_,p,m,S){const b=_.buffer.active,w=b.getNullCell();let u=m;for(;S;){const l=b.getLine(p);if(!l)return[-1,-1];for(let o=u;o<l.length;++o){l.getCell(o,w);const d=w.getChars();if(w.getWidth()&&(S-=d.length||1,o===l.length-1&&d==="")){const v=b.getLine(p+1);v&&v.isWrapped&&(v.getCell(0,w),w.getWidth()===2&&(S+=1))}if(S<0)return[p,o]}p++,u=0}return[p,u]}}n.LinkComputer=a}},i={};function s(g){var n=i[g];if(n!==void 0)return n.exports;var a=i[g]={exports:{}};return r[g](a,a.exports,s),a.exports}var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const n=s(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(_,p){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(_=f,p={}){this._handler=_,this._options=p}activate(_){this._terminal=_;const p=this._options,m=p.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,m,this._handler,p))}dispose(){var _;(_=this._linkProvider)===null||_===void 0||_.dispose()}}})(),c})())})(uv);var cy=uv.exports;function dv({agentGated:e=!1}={}){const t=H.useRef(null),[r,i]=H.useState(null),[s,c]=H.useState(!1),[g,n]=H.useState(!1),[a,f]=H.useState(null);return H.useEffect(()=>{if(!t.current)return;let _=!1,p=null,m=null,S=null;const b=window.location.protocol==="https:"?"wss":"ws",w=new WebSocket(`${b}://${window.location.host}/api/agent/ws`),u=()=>{if(m||!t.current)return m;const l=new ay.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}),o=new ly.FitAddon;l.loadAddon(o),l.loadAddon(new cy.WebLinksAddon),l.open(t.current);const d=()=>{if(!(_||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{o.fit()}catch{}};return p=window.requestAnimationFrame(d),S=new ResizeObserver(()=>{d()}),S.observe(t.current),l.onData(v=>{w.readyState===WebSocket.OPEN&&w.send(JSON.stringify({kind:"input",data:v}))}),l.onResize(({cols:v,rows:y})=>{w.readyState===WebSocket.OPEN&&w.send(JSON.stringify({kind:"resize",cols:v,rows:y}))}),m=l,l};return w.onopen=()=>{c(!0),u()},w.onclose=()=>c(!1),w.onerror=()=>c(!1),w.onmessage=l=>{try{const o=JSON.parse(l.data);o.kind==="data"&&typeof o.data=="string"?m==null||m.write(o.data):o.kind==="meta"?(i({active:!!o.autoMode,reason:o.reason??""}),typeof o.agentReady=="boolean"&&n(o.agentReady)):o.kind==="auth_url"&&typeof o.url=="string"||(o.kind==="error"?o.recoverable&&o.remediation?f({message:o.message??"agent failed to start",remediation:o.remediation}):m==null||m.write(`\r
|
|
57
|
+
\x1B[31m[error] ${o.message??"unknown error"}\x1B[0m\r
|
|
58
|
+
`):o.kind==="exit"&&(m==null||m.write(`\r
|
|
59
|
+
\x1B[33m[claude session exited]\x1B[0m\r
|
|
60
|
+
`)))}catch{}},()=>{_=!0,p!==null&&window.cancelAnimationFrame(p),w.close(),S==null||S.disconnect(),m==null||m.dispose()}},[]),h.jsxs("div",{className:"h-full w-full flex flex-col",style:{background:"var(--bg-sunken)"},children:[h.jsxs("div",{className:"px-4 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-elevated)"},children:[h.jsx("span",{className:"j-mono text-[11px]",style:{color:s?"var(--vow-green)":"var(--fg-dim)",letterSpacing:"0.05em"},children:s?"● connected":"○ disconnected"}),r&&h.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&&h.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:[h.jsx("span",{className:"j-label",style:{color:"var(--break-red)"},children:"Agent panel unavailable"}),h.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:a.message}),a.remediation&&h.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-dim)"},children:[h.jsx("span",{style:{color:"var(--fg-muted)"},children:"Fix · "}),a.remediation]})]}),h.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&&h.jsx(uy,{})]})}function uy(){return h.jsx("div",{className:"flex-1 w-full flex items-center justify-center px-6",style:{background:"var(--bg-sunken)"},children:h.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-[34ch] text-center",children:[h.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"}}),h.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"The agent will come online once you sign in to Claude (Phase 1 on the left)."})]})})}const dy={wallet:{phase:2,subState:null},safe_predicted:{phase:2,subState:null},awaiting_funding:{phase:3,subState:null},safe_deployed:{phase:4,subState:"Deploying"},service_created:{phase:4,subState:"Deploying"},service_activated:{phase:4,subState:"Deploying"},agents_registered:{phase:4,subState:"Deploying"},service_deployed:{phase:4,subState:"Deploying"},service_staked:{phase:4,subState:"Deploying"},staked:{phase:4,subState:"Deploying"},mech_deployed:{phase:4,subState:"Joining the network"},agent_registered:{phase:4,subState:"Joining the network"},safe_binding_pending:{phase:4,subState:"Binding identity"}},hy={1:"Sign in to Claude",2:"Provisioning your wallet",3:"Fund your wallet",4:"Joining Jinn"};function fy(e){return dy[e]??{phase:2,subState:null}}function py(e,t){return e<t?"done":e===t?"active":"queued"}function vy(){const{data:e,isLoading:t}=be({queryKey:["bootstrap"],queryFn:()=>re.getBootstrap(),refetchInterval:2e3}),{data:r,refetch:i}=be({queryKey:["claude-auth"],queryFn:()=>re.getClaudeAuth(),refetchInterval:4e3});if(t||!e)return h.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg)"},children:h.jsx("span",{className:"j-label",children:"Connecting…"})});const s=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",c=e.master_address??"",{phase:g,subState:n}=fy(e.currentStep),a=e.error,f=e.services.find(m=>m.step===e.currentStep)??e.services[0],_=(r==null?void 0:r.authenticated)===!0,p=_?g:1;return h.jsxs("div",{className:"min-h-screen w-full",style:{background:"var(--bg)",color:"var(--fg)"},children:[h.jsx("style",{children:Ey}),h.jsxs("div",{className:"max-w-[1280px] mx-auto px-10 py-10 grid grid-cols-12 gap-10",children:[h.jsxs("section",{className:"col-span-12 lg:col-span-7 flex flex-col gap-8",children:[h.jsxs("header",{className:"flex items-baseline justify-between",children:[h.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · Onboarding"}),h.jsx(gy,{chain:e.chain})]}),h.jsx("h1",{className:"j-display",style:{fontSize:"76px",color:"var(--fg)",lineHeight:1.05},children:"Welcome to Jinn."}),h.jsx("ol",{className:"flex flex-col",children:[1,2,3,4].map(m=>{var w;const S=py(m,p),b=a&&m===p&&m!==1;return h.jsxs(_y,{phase:m,status:b?"error":S,children:[b&&h.jsx(xy,{envelope:a}),!b&&m===1&&S==="active"&&r&&h.jsx(my,{auth:r,onAuthChanged:()=>{i()}}),!b&&m===3&&S==="active"&&c&&h.jsx(ny,{address:c,minimumWei:((w=e.funding)==null?void 0:w.targetWei)??"10000000000000000",chainExplorerBase:s}),!b&&m===4&&S==="active"&&h.jsx(Cy,{label:n??"Working",step:e.currentStep,serviceIndex:f==null?void 0:f.index,serviceId:f==null?void 0:f.service_id,safeAddress:f==null?void 0:f.safe_address,explorer:s})]},m)})})]}),h.jsxs("aside",{className:"col-span-12 lg:col-span-5 flex flex-col gap-3",children:[h.jsx("span",{className:"j-label",children:"Ask Claude"}),h.jsx("div",{className:"j-card overflow-hidden",style:{height:"calc(100vh - 220px)",minHeight:"520px"},children:h.jsx(dv,{agentGated:!_})})]})]})]})}function gy({chain:e}){const t=e==="base";return h.jsxs("div",{className:"flex items-center gap-3",children:[h.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"}),h.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 my({auth:e,onAuthChanged:t}){const[r,i]=H.useState(!1),[s,c]=H.useState(null),g=e.context!=="bare",n=e.binary.ok===!1,a=async()=>{c(null),i(!0);try{const _=await re.signInClaude();_.ok||c(_.reason??"Failed to start sign-in")}catch(_){c(_ instanceof Error?_.message:"Failed to start sign-in")}finally{i(!1)}},f=async()=>{c(null),i(!0);try{const _=await re.installClaudeCode();if(!_.ok){c(_.detail||"Failed to install Claude Code");return}t()}catch(_){c(_ instanceof Error?_.message:"Failed to install Claude Code")}finally{i(!1)}};return h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",style:{border:"1px solid var(--seer-violet)",background:"rgba(122, 109, 176, 0.05)",borderRadius:"var(--radius-2)"},children:[n?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"Jinn needs the Claude Code CLI to run the operator agent and complete work."}),h.jsx("button",{type:"button",onClick:f,disabled:r,className:"self-start px-4 py-2 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--seer-violet)",color:"var(--fg)",borderRadius:"var(--radius-1)"},children:r?"Installing…":"Install Claude Code"})]}):h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"Claude runs the agent panel and the daemon's restorations. One sign-in covers both — this is the only auth step you'll take."}),h.jsx("button",{type:"button",onClick:a,disabled:r,className:"self-start px-4 py-2 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--seer-violet)",color:"var(--fg)",borderRadius:"var(--radius-1)"},children:r?"Opening…":"Sign in with Claude →"}),g&&h.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:"Container mode: after you sign in, copy the OAuth code from the auth page and paste it into the agent terminal where claude is waiting at 'Paste code here'."})]}),s&&h.jsx("p",{className:"j-mono text-xs",style:{color:"var(--break-red)"},children:s})]})}function _y({phase:e,status:t,children:r}){const i=t==="active",s=t==="error",c=t==="done",g=i||s,n=s?"var(--break-red)":i?"var(--accent-gold)":c?"var(--accent-sky)":"var(--fg-dim)",a=s||i?"var(--fg)":c?"var(--fg-muted)":"var(--fg-dim)";return h.jsxs("li",{className:"phase-row","data-status":t,style:{borderTop:"1px solid var(--border)"},children:[h.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[h.jsx("span",{className:"j-mono text-xs tabular-nums",style:{color:n,letterSpacing:"0.05em",transition:"color 240ms ease"},children:String(e).padStart(2,"0")}),h.jsx("span",{className:g?"j-display":"j-mono",style:{fontSize:g?"28px":"14px",color:a,lineHeight:1.2,transition:"color 240ms ease"},children:hy[e]}),h.jsx(yy,{status:t})]}),g&&r&&h.jsx("div",{className:"ml-12 pb-5 pr-2",style:{animation:"jinnFadeSlide 320ms ease-out both"},children:r})]})}function yy({status:e}){return e==="done"?h.jsx("span",{className:"j-label",style:{color:"var(--vow-green)",fontSize:"10px"},children:"✓ Done"}):e==="error"?h.jsx("span",{className:"j-label",style:{color:"var(--break-red)",fontSize:"10px"},children:"! Failed"}):e==="active"?h.jsxs("span",{className:"j-label flex items-center gap-2",style:{color:"var(--accent-gold)",fontSize:"10px"},children:[h.jsx(Sy,{}),"Active"]}):h.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",fontSize:"10px"},children:"Queued"})}function Sy(){return h.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 xy({envelope:e}){const t=wy(e),r=by(e.generatedAt);return h.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:[h.jsxs("div",{className:"flex items-baseline justify-between",children:[h.jsxs("span",{className:"j-label",style:{color:"var(--break-red)"},children:["Bootstrap halted · ",e.code]}),r&&h.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:r})]}),h.jsx("p",{className:"j-mono text-xs break-words",style:{color:"var(--fg)"},children:e.message}),e.hint&&h.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:"Fix · "}),e.hint]}),t&&h.jsx("a",{href:`https://sepolia.basescan.org/tx/${t}`,target:"_blank",rel:"noopener noreferrer",className:"j-mono text-[11px] hover:underline self-start",style:{color:"var(--accent-sky)"},children:"view failed tx ↗"}),h.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:["Setup is paused at this step. Once you've addressed the cause, run"," ",h.jsx("code",{style:{color:"var(--fg-muted)"},children:"jinn run"})," again to retry from the persisted state."]})]})}function wy(e){var r,i;const t=[(r=e.details)==null?void 0:r.txHash,(i=e.details)==null?void 0:i.cause,e.message];for(const s of t){if(typeof s!="string")continue;const c=/(0x[a-fA-F0-9]{64})/.exec(s);if(c)return c[1]}return null}function by(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 i=Math.round(r/60);return i<60?`${i}m ago`:`${Math.round(i/60)}h ago`}catch{return null}}function Cy({label:e,step:t,serviceIndex:r,serviceId:i,safeAddress:s,explorer:c}){return h.jsxs("div",{className:"px-4 py-3 flex flex-col gap-3",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",background:"var(--bg-elevated)"},children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--accent-sky)",boxShadow:"0 0 0 0 rgba(122, 167, 220, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),h.jsx("span",{className:"j-mono text-sm",style:{color:"var(--fg)"},children:e}),h.jsx("span",{className:"j-mono text-[10px] ml-auto",style:{color:"var(--fg-dim)"},children:"running · no action needed"})]}),h.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:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:"Current step"}),h.jsx("span",{children:ky(t)}),r!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:"Service"}),h.jsxs("span",{children:["#",r,i!==void 0?` · id ${i}`:""]})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:"Safe"}),h.jsx("a",{href:`${c}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline break-all",style:{color:"var(--accent-sky)"},children:s})]})]})]})}function ky(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const Ey=`
|
|
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 Ry({header:e,tabs:t,rail:r,children:i}){return h.jsxs("div",{className:"w-full",style:{background:"var(--bg)",color:"var(--fg)",display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",gridTemplateColumns:"1fr 320px",height:"100vh",overflow:"hidden"},children:[h.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:e}),h.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:t}),h.jsx("main",{style:{overflowY:"auto",minHeight:0},children:i}),h.jsx("aside",{style:{borderLeft:"1px solid var(--border)",overflowY:"auto",minHeight:0,height:"100%"},children:r})]})}function jy(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function Dy({network:e,rpcHealthy:t,masterAddress:r}){return h.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 24px"},children:[h.jsx("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:h.jsx(Br,{href:"/overview",style:{textDecoration:"none",color:"var(--fg)"},children:h.jsx("span",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"26px",color:"var(--fg)"},children:"jinn operator"})})}),h.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[h.jsx("span",{style:{border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 8px"},children:e}),h.jsxs("span",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[h.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:t?"var(--vow-green)":"var(--break-red)"}}),t?"rpc healthy":"rpc unreachable"]}),h.jsxs("span",{style:{color:"var(--fg-dim)"},children:["master ",jy(r)]})]})]})}const Ty=[{path:"/overview",label:"Overview"},{path:"/operator",label:"Operator"},{path:"/launcher",label:"Launcher"},{path:"/leaderboard",label:"Leaderboard"}];function Ly(){const[e]=_n();return h.jsx("nav",{style:{display:"flex",padding:"0 24px"},children:Ty.map(t=>{const r=e===t.path||e.startsWith(`${t.path}/`);return h.jsx(Br,{href:t.path,"data-active":r?"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:r?"var(--fg)":"var(--fg-muted)",borderBottom:`1px solid ${r?"var(--accent-sky)":"transparent"}`,marginBottom:"-1px",textDecoration:"none"},children:t.label},t.path)})})}function My({agentGated:e}){return h.jsxs("div",{className:"agent-rail",style:{padding:"16px",display:"flex",flexDirection:"column",gap:"12px",height:"100%",minWidth:0,overflow:"hidden"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",overflowWrap:"anywhere"},children:"Claude"}),h.jsx(dv,{agentGated:e})]})}function Py({restartPending:e,onRestart:t}){return e?h.jsxs("div",{style:{background:"var(--bg-elevated)",borderBottom:"1px solid var(--border-accent)",padding:"10px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:[h.jsx("span",{style:{color:"var(--fg)"},children:"Operator settings saved. Restart the node to apply."}),h.jsx("button",{type:"button",onClick:t,style:{background:"var(--accent-sky)",border:"1px solid var(--accent-sky)",color:"var(--bg-sunken)",padding:"6px 14px",borderRadius:"6px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:"pointer"},children:"Restart node"})]}):null}function Wn({label:e,value:t,unit:r}){return h.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",minWidth:0},children:[h.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}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"24px",fontWeight:500,color:"var(--fg)",letterSpacing:0,display:"block"},children:t}),r&&h.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"14px",marginTop:"4px",display:"block",fontFamily:"'JetBrains Mono', monospace"},children:r})]})}function By({tasksDelivered:e,jinnEarned:t,gasRunwayDays:r,nodeStatus:i}){return h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"16px"},children:[h.jsx(Wn,{label:"Tasks delivered",value:e}),h.jsx(Wn,{label:"JINN earned",value:t,unit:"JINN"}),h.jsx(Wn,{label:"Gas runway",value:r,unit:"days"}),h.jsx(Wn,{label:"Node status",value:i})]})}function Ad({active:e=!0,lead:t,body:r,ctaLabel:i,ctaHref:s}){return e?h.jsxs("div",{style:{border:"1px solid var(--border-accent)",background:"transparent",borderRadius:"10px",padding:"14px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[h.jsxs("span",{style:{color:"var(--fg)"},children:[h.jsx("span",{style:{color:"var(--accent-gold)",marginRight:"6px"},children:t}),r]}),h.jsxs(Br,{href:s,style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",textDecoration:"none"},children:[i," →"]})]}):null}function xs({label:e,value:t,tone:r}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:r==="warn"?"var(--wane)":"var(--fg)"},children:t})]})}function Ay({name:e,totals:t}){return h.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:[h.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Network · ",e]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(72px, 1fr))",gap:"16px 24px"},children:[h.jsx(xs,{label:"tasks",value:t.tasks}),h.jsx(xs,{label:"active",value:t.active}),h.jsx(xs,{label:"solutions",value:t.solutions}),h.jsx(xs,{label:"verdicts",value:t.verdicts}),h.jsx(xs,{label:"failed",value:t.failed,tone:t.failed>0?"warn":void 0})]})]})}function Oy(e){return e==="solving"?"Solver":"Evaluator"}function Iy({name:e,roles:t,state:r,waitingMessage:i}){const s=r==="live"?"var(--vow-green)":r==="available"?"var(--fg-muted)":"var(--fg-dim)";return h.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:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Your ",e]}),h.jsx("span",{style:{fontSize:"11px",color:s,textTransform:"uppercase",letterSpacing:"0.14em"},children:r.replace("_"," ")})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px",color:"var(--fg)",fontSize:"14px"},children:[h.jsx("span",{style:{color:"var(--fg-muted)"},children:t.length>1?"Roles":"Role"}),h.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"}),t.length===0?h.jsx("span",{style:{color:"var(--fg-dim)"},children:"none"}):t.map((c,g)=>h.jsx("span",{"data-role":c,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:Oy(c)},c))]}),h.jsx(Br,{href:`/operator#solvernets/${e}`,style:{color:"var(--accent-sky)",fontSize:"11px",textDecoration:"none",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Configure →"})]}),i&&h.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:i})]})}function Fy({events:e,liveBadge:t=!0}){const[r,i]=H.useState(!1),s=r?e:e.slice(0,10);return h.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:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Recent activity"}),t&&h.jsxs("span",{style:{fontSize:"11px",color:"var(--vow-green)",display:"flex",gap:"6px",alignItems:"center"},children:[h.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--vow-green)"}}),"live"]})]}),s.length===0?h.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"Quiet. Node running; no events to surface yet."}):h.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"8px"},children:s.map(c=>h.jsxs("li",{style:{display:"grid",gridTemplateColumns:"64px 1fr 96px",gap:"16px",fontSize:"13px"},children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:c.ts}),h.jsx("span",{style:{color:"var(--fg)"},children:c.message}),h.jsx("span",{style:{color:c.txHash?"var(--accent-sky)":"var(--fg-dim)",textAlign:"right"},children:c.txHash?`${c.txHash.slice(0,6)}…`:"—"})]},c.id))}),e.length>10&&h.jsxs("button",{type:"button",onClick:()=>i(c=>!c),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",cursor:"pointer",padding:0},children:[r?"Hide":"View all"," →"]})]})}function $n({label:e,sub:t,onClick:r}){return h.jsxs("button",{type:"button",onClick:r,style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"14px 16px",textAlign:"left",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),h.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:t})]})}function Ny({claimableJinn:e,gasEth:t,onClaim:r,onTopUp:i,onManage:s,onRestart:c}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[h.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace"},children:"Quick actions"}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"12px"},children:[h.jsx($n,{label:"Claim JINN",sub:`${e} claimable`,onClick:r}),h.jsx($n,{label:"Top up gas",sub:`${t} ETH`,onClick:i}),h.jsx($n,{label:"Manage wallet",sub:"Change keystore password",onClick:s}),h.jsx($n,{label:"Restart node",sub:"Graceful",onClick:c})]})]})}function Hy(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function zy({agentId:e,chain:t,safeAddress:r,services:i=[],bindingError:s}){const c=i.find(w=>w.agentId!==null&&!w.safeBoundToAgent),[g,n]=H.useState(!1),[a,f]=H.useState(!1),[_,p]=H.useState(null),[m,S]=H.useState(s??null),b=async()=>{if(c){f(!0),p(null),S(null);try{const u=(await re.retryAgentBinding({serviceIndex:c.index})).attempts[0];(u==null?void 0:u.status)==="success"?(p("success"),n(!1)):(p("reverted"),S((u==null?void 0:u.detail)??"Bind reverted on chain."))}catch(w){p("reverted"),S(w instanceof Error?w.message:String(w))}finally{f(!1)}}};return h.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:[h.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Identity"}),h.jsxs("div",{style:{display:"flex",gap:"32px",fontSize:"13px",flexWrap:"wrap"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Agent"}),h.jsxs("span",{style:{color:"var(--fg)",display:"flex",gap:"8px",alignItems:"center"},children:[e!==null?`#${e}`:"—",c&&h.jsx("button",{type:"button",onClick:()=>n(w=>!w),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"}),_==="success"&&h.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"})]})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Chain"}),h.jsx("span",{style:{color:"var(--fg)"},children:t})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Safe"}),h.jsx("span",{style:{color:"var(--fg)"},children:Hy(r)})]})]}),g&&c&&h.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:[h.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},children:["Service #",c.index," Safe is not yet bound to agent #",c.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),m&&h.jsx("span",{style:{fontSize:"11px",color:"var(--break-red)"},children:m}),h.jsx("button",{type:"button",onClick:()=>{b()},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 Wy(){const[e,t]=H.useState(!1);return h.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[h.jsxs("button",{type:"button",onClick:()=>t(r=>!r),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:[e?"▾":"▸"," Advanced details"]}),e&&h.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:"Reserved for future power-user details (raw fleet state, claim history, env provenance)."})]})}function $y(){const[e,t]=H.useState(null),[r,i]=H.useState(!0);if(H.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{i(!1)}})()},[]),r||!e)return h.jsx("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:h.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:"Harness status unavailable"})});const s=e.mode==="train"?"var(--vow-green)":"var(--wane)",c=e.mode==="train"?"var(--vow-green)":"var(--wane)",g=e.lastModeSwitchAt?new Date(e.lastModeSwitchAt).toLocaleString():"Never";return h.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"4px"},children:[h.jsx("span",{style:{fontSize:"13px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--fg)"},children:"Harness Status"}),h.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:s}})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[h.jsxs("div",{children:[h.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Mode"}),h.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:c,marginTop:"4px"},children:e.mode.toUpperCase()}),h.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",marginTop:"6px",display:"block"},children:e.mode==="train"?"Contributing to substrate":"Benchmarking only"})]}),h.jsxs("div",{children:[h.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Code Digest"}),h.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&&h.jsxs("div",{style:{fontSize:"11px",color:"var(--fg-muted)",paddingTop:"8px",borderTop:"1px solid var(--border)",marginTop:"8px"},children:["Mode switched: ",g]})]})}function Uy(e,t,r){if(e){for(const[s,c]of Object.entries(e)){if(!c||typeof c!="object"||!(c.manifestCid!==void 0||s.startsWith("baf")||s.startsWith("Qm")))continue;const n=Array.isArray(c.roles)?c.roles:[];if(n.length===0)continue;const a=Oa(n);return{name:c.name??s,roles:a.length>0?a:["solving"]}}for(const[s,c]of Object.entries(e)){if(!c||typeof c!="object")continue;const g=Array.isArray(c.roles)?c.roles:[],n=Oa(g);if(!(c.enabled!==!0&&n.length===0))return{name:c.name??s,roles:n.length>0?n:["solving"]}}}const i=Oa(r??[]);return t||i.length>0?{name:"prediction",roles:i.length>0?i:["solving"]}:null}function Oa(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 Ia(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function Od(e){return e.replace(/_/g," ")}function Ky(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,16)}function Jy(){var S,b,w,u,l,o,d,v,y,C,k,x,E,T,B,D,P,F,N,$,U,R,L;const{data:e}=be({queryKey:["status"],queryFn:()=>re.getStatus(),refetchInterval:5e3}),{data:t}=be({queryKey:["bootstrap"],queryFn:()=>re.getBootstrap(),refetchInterval:3e4}),r=(S=e==null?void 0:e.predictionV1)==null?void 0:S.operator,i=Uy(t==null?void 0:t.solverNets,((b=r==null?void 0:r.solverNet)==null?void 0:b.enabled)===!0,(w=r==null?void 0:r.solverNet)==null?void 0:w.roles),s={tasks:((l=(u=e==null?void 0:e.predictionV1)==null?void 0:u.totals)==null?void 0:l.observedTasks)??0,active:((d=(o=e==null?void 0:e.predictionV1)==null?void 0:o.totals)==null?void 0:d.activeTaskRuns)??0,solutions:((y=(v=e==null?void 0:e.predictionV1)==null?void 0:v.totals)==null?void 0:y.solutions)??0,verdicts:((k=(C=e==null?void 0:e.predictionV1)==null?void 0:C.totals)==null?void 0:k.verdicts)??0,failed:((E=(x=e==null?void 0:e.predictionV1)==null?void 0:x.totals)==null?void 0:E.failed)??0},c=((r==null?void 0:r.diagnostics)??[]).find(M=>M.severity==="error"&&M.code!=="prediction_solvernet_disabled"),g=(((T=e==null?void 0:e.fleet)==null?void 0:T.services)??[]).map(M=>({index:M.index,safeAddress:M.safeAddress??"",agentId:M.agentId??null,safeBoundToAgent:M.safeBoundToAgent??!1})),n=s.solutions,a=Ia((B=e==null?void 0:e.rewards)==null?void 0:B.pendingStakingRewardsWei),f=((D=e==null?void 0:e.masterGas)==null?void 0:D.runwayDaysExcess)??"—",p=(((P=e==null?void 0:e.fleet)==null?void 0:P.services)??[]).every(M=>M.step==="complete"||M.step==="safe_binding_pending")?"Running":"Resuming",m=(((F=e==null?void 0:e.activity)==null?void 0:F.recent)??[]).map(M=>({id:String(M.id),ts:Ky(M.ts),message:M.requestId?`${Od(M.kind)} · ${M.requestId}`:Od(M.kind),txHash:M.txHash??void 0}));return h.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"24px"},children:[h.jsx(By,{tasksDelivered:n,jinnEarned:a,gasRunwayDays:f,nodeStatus:p}),c&&h.jsx(Ad,{lead:"Needs attention",body:c.message,ctaLabel:"Configure prediction",ctaHref:"/operator#solvernets/prediction"}),h.jsx(Ay,{name:"prediction",totals:s}),i?h.jsx(Iy,{name:i.name,roles:i.roles,state:"live",waitingMessage:(N=r==null?void 0:r.nextAction)==null?void 0:N.description}):h.jsx(Ad,{lead:"Get started",body:"Pick a SolverNet to participate in",ctaLabel:"Configure",ctaHref:"/operator#solvernets"}),h.jsx(Fy,{events:m}),h.jsx($y,{}),h.jsx(Ny,{claimableJinn:Ia(($=e==null?void 0:e.rewards)==null?void 0:$.pendingStakingRewardsWei),gasEth:Ia((U=e==null?void 0:e.masterGas)==null?void 0:U.balanceWei),onClaim:()=>{re.claimRewards()},onTopUp:()=>{},onManage:()=>{},onRestart:()=>{re.restartDaemon()}}),h.jsx(zy,{agentId:((R=g[0])==null?void 0:R.agentId)??null,chain:"Base Sepolia",safeAddress:((L=g[0])==null?void 0:L.safeAddress)??null,services:g}),h.jsx(Wy,{})]})}const mi={padding:"10px 12px",borderBottom:"1px solid var(--border)",fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"12px",color:"var(--fg)"},ws={...mi,color:"var(--fg-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",fontSize:"10px"};function qy({solverNet:e}){const{data:t,isLoading:r}=be({queryKey:["leaderboard",e,"train"],queryFn:async()=>{const s=await fetch(`/api/solvernets/${encodeURIComponent(e)}/leaderboard?mode=train`,{credentials:"same-origin",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()},refetchInterval:15e3}),i=(t==null?void 0:t.rollups)??[];return r?h.jsx("div",{style:{padding:"24px",color:"var(--fg-muted)",fontSize:"13px"},children:"Loading…"}):i.length===0?h.jsx("div",{style:{padding:"24px",color:"var(--fg-dim)",fontSize:"13px"},children:"No train-mode verdicts recorded yet."}):h.jsx("div",{style:{overflowX:"auto"},children:h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{style:ws,children:"Harness"}),h.jsx("th",{style:ws,children:"codeDigest"}),h.jsx("th",{style:{...ws,textAlign:"right"},children:"Mean resolved"}),h.jsx("th",{style:{...ws,textAlign:"right"},children:"n"}),h.jsx("th",{style:{...ws,textAlign:"right"},children:"Operators"})]})}),h.jsx("tbody",{children:i.map(s=>h.jsxs("tr",{children:[h.jsx("td",{style:mi,children:s.implName}),h.jsxs("td",{style:{...mi,color:"var(--fg-muted)"},children:[s.codeDigest.slice(0,16),"…"]}),h.jsxs("td",{style:{...mi,textAlign:"right"},children:[(s.meanResolved*100).toFixed(1),"%"]}),h.jsx("td",{style:{...mi,textAlign:"right"},children:s.verdictCount}),h.jsx("td",{style:{...mi,textAlign:"right"},children:s.uniqueOperators})]},s.codeDigest))})]})})}function Vy({verified:e}){return e===null?null:h.jsx("span",{title:e?"Source bundle + implStateDir CID published; codeDigest independently verifiable":"Operator-claim only; codeDigest not independently verifiable",style:{fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"11px",color:e?"var(--vow-green)":"var(--fg-dim)"},children:e?"✓ verified":"◌ unverified"})}const Fr={padding:"10px 12px",borderBottom:"1px solid var(--border)",fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"12px",color:"var(--fg)"},di={...Fr,color:"var(--fg-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",fontSize:"10px"};function Qy({solverNet:e}){const{data:t,isLoading:r}=be({queryKey:["leaderboard",e,"frozen"],queryFn:async()=>{const s=await fetch(`/api/solvernets/${encodeURIComponent(e)}/leaderboard?mode=frozen`,{credentials:"same-origin",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()},refetchInterval:15e3}),i=(t==null?void 0:t.rollups)??[];return r?h.jsx("div",{style:{padding:"24px",color:"var(--fg-muted)",fontSize:"13px"},children:"Loading…"}):i.length===0?h.jsx("div",{style:{padding:"24px",color:"var(--fg-dim)",fontSize:"13px"},children:"No frozen-mode verdicts recorded yet."}):h.jsx("div",{style:{overflowX:"auto"},children:h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{style:di,children:"Harness"}),h.jsx("th",{style:di,children:"codeDigest"}),h.jsx("th",{style:{...di,textAlign:"right"},children:"Mean resolved"}),h.jsx("th",{style:{...di,textAlign:"right"},children:"n"}),h.jsx("th",{style:{...di,textAlign:"right"},children:"Operators"}),h.jsx("th",{style:di})]})}),h.jsx("tbody",{children:i.map(s=>h.jsxs("tr",{children:[h.jsx("td",{style:Fr,children:s.implName}),h.jsxs("td",{style:{...Fr,color:"var(--fg-muted)"},children:[s.codeDigest.slice(0,16),"…"]}),h.jsxs("td",{style:{...Fr,textAlign:"right"},children:[(s.meanResolved*100).toFixed(1),"%"]}),h.jsx("td",{style:{...Fr,textAlign:"right"},children:s.verdictCount}),h.jsx("td",{style:{...Fr,textAlign:"right"},children:s.uniqueOperators}),h.jsx("td",{style:Fr,children:h.jsx(Vy,{verified:s.verified})})]},s.codeDigest))})]})})}function Id(e){return{padding:"8px 16px",background:"none",border:"none",borderBottom:`2px solid ${e?"var(--accent-sky)":"transparent"}`,fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:e?"var(--fg)":"var(--fg-muted)",cursor:"pointer",marginBottom:"-1px"}}function Gy({solverNet:e}){const[t,r]=H.useState("train");return h.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsxs("div",{role:"tablist",style:{display:"flex",borderBottom:"1px solid var(--border)",gap:"4px"},children:[h.jsx("button",{role:"tab","aria-selected":t==="train",style:Id(t==="train"),onClick:()=>{r("train")},children:"Train"}),h.jsx("button",{role:"tab","aria-selected":t==="frozen",style:Id(t==="frozen"),onClick:()=>{r("frozen")},children:"Frozen"})]}),t==="train"?h.jsx(qy,{solverNet:e}):h.jsx(Qy,{solverNet:e})]})}const Xy={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 ra({title:e,summary:t,metaChip:r,defaultExpanded:i=!1,variant:s="default",dirty:c,children:g}){const[n,a]=H.useState(i),f=Xy[(r==null?void 0:r.tone)??"default"],_=s==="danger"?"var(--break-red)":"var(--border)";return h.jsxs("section",{style:{background:"var(--bg-elevated)",border:`1px solid ${_}`,borderRadius:"10px",overflow:"hidden"},children:[h.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:[h.jsxs("span",{children:[h.jsx("span",{style:{display:"block",fontSize:"17px",fontWeight:500,color:s==="danger"?"var(--break-red)":"var(--fg)",letterSpacing:"-0.01em",marginBottom:"4px"},children:e}),h.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:t})]}),r&&h.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}),h.jsx("span",{style:{color:n?"var(--fg)":"var(--fg-dim)",fontSize:"14px",width:"16px",textAlign:"right"},children:n?"▾":"▸"})]}),n&&h.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"24px",display:"flex",flexDirection:"column",gap:"14px"},children:[g,c&&h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"14px",marginTop:"4px",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace"},children:[h.jsx("span",{style:{fontSize:"12px",color:c.error?"var(--break-red)":"var(--accent-sky)"},children:c.error??(c.saving?"Saving…":c.pendingSummary)}),h.jsxs("span",{style:{display:"flex",gap:"8px"},children:[h.jsx("button",{type:"button",onClick:c.onCancel,disabled:c.saving,style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 20px",background:"transparent",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:c.saving?"wait":"pointer"},children:"Cancel"}),h.jsx("button",{type:"button",onClick:c.onSave,disabled:c.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:c.saving?"wait":"pointer"},children:"Save changes"})]})]})]})]})}const Fd={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 Nd(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-4?`${r.toExponential(3)} ETH`:`${r.toFixed(r<1?6:4)} ETH`}catch{return"—"}}function Yy(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function Zy(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 e0({status:e}){const t=Fd[e]??Fd.launched;return h.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 t0({openRoles:e}){return e.length===0?h.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:"no open roles"}):h.jsx("span",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:e.map(t=>h.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 r0({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,i=(t??[]).length>0;return h.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:[h.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"15px",fontWeight:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:["Launcher: ",Yy(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),h.jsx(e0,{status:e.status})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[h.jsx("span",{children:"Open roles"}),h.jsx(t0,{openRoles:e.openRoles}),h.jsx("span",{children:"Solution price"}),h.jsx("span",{style:{color:"var(--fg)"},children:Nd(e.solutionPriceWei)}),h.jsx("span",{children:"Verdict price"}),h.jsx("span",{style:{color:"var(--fg)"},children:Nd(e.verdictPriceWei)})]}),h.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[i&&h.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(", ")]}),h.jsx(Br,{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"&&!i?"var(--accent-sky)":"transparent",color:e.status==="launched"&&!i?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${e.status==="launched"&&!i?"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:i?"Edit":"Join"})]})]})}function i0({refetchIntervalMs:e=3e4}={}){var p;const{data:t,isLoading:r,isError:i,error:s,refetch:c}=be({queryKey:["solvernets","registry"],queryFn:()=>re.solvernets.listRegistry(),refetchInterval:e}),n=((p=be({queryKey:["operator","joined"],queryFn:()=>re.operator.listJoined(),refetchInterval:e}).data)==null?void 0:p.joinedSolverNets)??{};if(r)return h.jsx("p",{"data-testid":"registry-catalog-loading",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:"Loading catalog…"});if(i)return h.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:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Failed to load registry catalog."}),h.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:s instanceof Error?s.message:"Unknown error"})]}),h.jsx("button",{type:"button",onClick:()=>{c()},"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=Zy((t==null?void 0:t.lastRefreshedAt)??null),_=(t==null?void 0:t.lastError)??null;return h.jsxs("div",{"data-testid":"registry-catalog",style:{display:"flex",flexDirection:"column",gap:"12px"},children:[h.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:[h.jsxs("span",{"data-testid":"registry-catalog-meta",children:[a.length," launched · last refreshed"," ",f??"never"]}),_&&h.jsxs("span",{"data-testid":"registry-catalog-warn",style:{color:"var(--wane)"},children:["stale (",_.message,")"]})]}),a.length===0?h.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:"No launched SolverNets available."}):h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:a.map(m=>{var S;return h.jsx(r0,{summary:m,joinedRoles:(S=n[m.manifestCid])==null?void 0:S.roles},m.manifestCid)})})]})}function s0({defaultExpanded:e=!0}={}){return h.jsx(ra,{title:"SolverNets",summary:"Discover launched SolverNets and join one to participate.",defaultExpanded:e,children:h.jsx(i0,{})})}function n0(){return h.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 Yl({label:e,restartRequired:t,helperText:r,children:i}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.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&&h.jsx(n0,{})]}),i,r&&h.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:r})]})}function o0({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:i,onRestartPending:s,defaultExpanded:c=!1}){const[g,n]=H.useState(t),[a,f]=H.useState(!1),[_,p]=H.useState(null),m=g!==t,S=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",b=async()=>{f(!0),p(null);try{const w=g.length===0?null:g;(await re.updateNetwork({rpcUrl:w})).restartRequired&&s()}catch(w){p(w instanceof Error?w.message:String(w))}finally{f(!1)}};return h.jsx(ra,{title:"Network",summary:`${S.split(" (")[0]} · ${t}`,metaChip:{label:i?"Healthy":"Unreachable",tone:i?"live":"danger"},defaultExpanded:c,dirty:m?{pendingSummary:"RPC URL changed · save to apply",saving:a,error:_??void 0,onSave:()=>{b()},onCancel:()=>{n(t),p(null)}}:void 0,children:h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[h.jsxs(Yl,{label:"Chain",helperText:"Switching chains resets fleet state — that's a separate flow.",children:[h.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}),h.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"})]}),h.jsxs(Yl,{label:"RPC URL",restartRequired:!0,helperText:`Default: ${r}`,children:[h.jsx("input",{type:"text",value:g,onChange:w=>n(w.target.value),placeholder:r,style:{background:"var(--bg)",border:`1px solid ${m?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}}),h.jsx("button",{type:"button",onClick:()=>n(""),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"})]})]})})}function a0({defaultExpanded:e=!1}){const[t,r]=H.useState(""),[i,s]=H.useState(""),[c,g]=H.useState("idle"),[n,a]=H.useState(null),f=async()=>{g("rotating"),a(null);try{await re.changeKeystorePassword(t,i),g("rotated"),r(""),s("")}catch(_){a(_ instanceof Error?_.message:String(_)),g("failed")}};return h.jsxs(ra,{title:"Security",summary:"Rotate keystore password · last rotated never",metaChip:{label:"Danger zone",tone:"danger"},variant:"danger",defaultExpanded:e,children:[h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Current password"}),h.jsx("input",{type:"password",value:t,onChange:_=>r(_.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)"}})]}),h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"New password"}),h.jsx("input",{type:"password",value:i,onChange:_=>s(_.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)"}})]})]}),h.jsx("button",{type:"button",onClick:()=>{f()},disabled:c==="rotating"||t.length===0||i.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:c==="rotating"?"wait":"pointer"},children:c==="rotating"?"Rotating…":"Rotate password"}),c==="rotated"&&h.jsx("span",{style:{color:"var(--vow-green)",fontSize:"12px"},children:"Password rotated. Re-run jinn run with the new password."}),c==="failed"&&h.jsxs("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:["Rotation failed: ",n]})]})}function l0({mode:e,onRestartPending:t,defaultExpanded:r=!1}){const[i,s]=H.useState(e),[c,g]=H.useState(!1),[n,a]=H.useState(null),f=i!==e,_=i==="train"?"Learning mode: harness contributes training signal to the substrate":"Frozen mode: harness produces benchmark snapshots without contributing",p=async()=>{g(!0),a(null);try{(await re.updateHarnessMode(i)).restartRequired&&t()}catch(m){a(m instanceof Error?m.message:String(m))}finally{g(!1)}};return h.jsx(ra,{title:"Harness",summary:`Mode: ${e} · ${_.slice(0,40)}…`,metaChip:{label:e==="train"?"Contributing":"Benchmarking",tone:e==="train"?"live":"attention"},defaultExpanded:r,dirty:f?{pendingSummary:"Mode changed · save to apply",saving:c,error:n??void 0,onSave:()=>{p()},onCancel:()=>{s(e),a(null)}}:void 0,children:h.jsx(Yl,{label:"Execution mode",restartRequired:!0,children:h.jsxs("div",{style:{display:"flex",gap:"16px",flexDirection:"column"},children:[h.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[h.jsx("input",{type:"radio",name:"harness-mode",value:"train",checked:i==="train",onChange:()=>s("train"),style:{cursor:"pointer"}}),h.jsxs("span",{children:[h.jsx("span",{style:{display:"block",fontWeight:500},children:"Train"}),h.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"Contribute learning signal to improve the substrate"})]})]}),h.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[h.jsx("input",{type:"radio",name:"harness-mode",value:"frozen",checked:i==="frozen",onChange:()=>s("frozen"),style:{cursor:"pointer"}}),h.jsxs("span",{children:[h.jsx("span",{style:{display:"block",fontWeight:500},children:"Frozen"}),h.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"Benchmark harness without feeding training signal"})]})]})]})})})}function c0(){const[e,t]=H.useState(null);return H.useEffect(()=>{const r=()=>{const i=window.location.hash.replace(/^#/,"");t(i.length>0?i:null)};return r(),window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),e}const u0={startup:"Startup",shutdown:"Shutdown",created:"Posted",task_posted:"Posted",claimed:"Claimed",request_claimed:"Claimed",delivered:"Delivered",delivery_submitted:"Delivered",evaluated:"Evaluated",evaluation_submitted:"Evaluated",reward_claimed:"Reward",balance_topup:"Top-up",engine_transition:"Engine",tick_error:"Error",error:"Error"};function Hd(e){return u0[e]??e.replace(/_/g," ")}function bs(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function d0(e){const t=[e.requestId?`request ${e.requestId}`:null,e.solverType?`solver ${e.solverType}`:null,e.serviceIndex!==null?`service ${e.serviceIndex}`:null].filter(r=>r!==null);return t.length>0?t.join(" · "):"Daemon lifecycle event"}function h0(e){return e?e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e:"—"}function f0(e){return e==="failed"?"var(--break-red)":e==="warn"?"var(--wane)":"var(--fg-dim)"}function Un(e,t){const r=new Set(t);return e.find(i=>r.has(i.kind))}function p0(e){return!e||!Number.isFinite(e)?"—":e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function Kn(e,t){return t.reduce((r,i)=>r+(e[i]??0),0)}function v0({title:e,status:t,detail:r,meta:i,tone:s="default"}){const c=s==="live"?"var(--vow-green)":s==="attention"?"var(--wane)":s==="danger"?"var(--break-red)":"var(--accent-sky)";return h.jsxs("article",{"data-testid":"operator-process-card",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px",minWidth:0},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px"},children:[h.jsx("span",{className:"j-label",children:e}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",color:c},children:t})]}),h.jsx("p",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",lineHeight:1.45},children:r}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:i})]})}function g0(){var f,_,p,m,S,b,w,u,l,o,d;const{data:e,isLoading:t,isError:r,error:i,refetch:s}=be({queryKey:["status"],queryFn:()=>re.getStatus(),refetchInterval:5e3}),c=((f=e==null?void 0:e.activity)==null?void 0:f.recent)??[],g=((_=e==null?void 0:e.activity)==null?void 0:_.counts)??{},n=H.useMemo(()=>Object.entries(g).sort((v,y)=>y[1]-v[1]).slice(0,4),[g]),a=H.useMemo(()=>{var P,F,N,$,U,R,L,M,O,z,q,Y;const v=Un(c,["claimed","request_claimed"]),y=Un(c,["delivered","delivery_submitted","evaluated","evaluation_submitted"]),C=Un(c,["reward_claimed"]),k=Un(c,["tick_error","intent_registry_failed","error"]),x=((F=(P=e==null?void 0:e.fleet)==null?void 0:P.services)==null?void 0:F.length)??0,E=((N=e==null?void 0:e.fleet)==null?void 0:N.completeCount)??((U=($=e==null?void 0:e.fleet)==null?void 0:$.services)==null?void 0:U.filter(X=>X.step==="complete").length)??0,T=((L=(R=e==null?void 0:e.predictionV1)==null?void 0:R.totals)==null?void 0:L.activeTaskRuns)??0,B=((O=(M=e==null?void 0:e.predictionV1)==null?void 0:M.totals)==null?void 0:O.failed)??0,D=((z=e==null?void 0:e.rewards)==null?void 0:z.lastClaimTickAt)??(C==null?void 0:C.ts)??null;return[{title:"Daemon loops",status:k?"attention":"running",detail:x>0?`${E}/${x} services complete`:"Waiting for service state",meta:(q=e==null?void 0:e.daemon)!=null&&q.startedAt?`started ${bs(e.daemon.startedAt)}`:"startup time unavailable",tone:k?"attention":"live"},{title:"Task intake",status:`${T} active`,detail:`${Kn(g,["claimed","request_claimed"])} claims recorded`,meta:v!=null&&v.ts?`last claim ${bs(v.ts)}`:"no claims yet",tone:T>0?"live":"default"},{title:"Delivery pipeline",status:B>0?"attention":"clear",detail:`${Kn(g,["delivered","delivery_submitted"])} deliveries · ${Kn(g,["evaluated","evaluation_submitted"])} evaluations`,meta:y!=null&&y.ts?`last output ${bs(y.ts)}`:"no outputs yet",tone:B>0?"attention":"default"},{title:"Reward loop",status:`${p0((Y=e==null?void 0:e.rewards)==null?void 0:Y.claimLoopIntervalMs)} cadence`,detail:`${Kn(g,["reward_claimed"])} reward claims submitted`,meta:D?`last tick ${bs(D)}`:"no reward tick yet",tone:C?"live":"default"}]},[g,(p=e==null?void 0:e.daemon)==null?void 0:p.startedAt,(m=e==null?void 0:e.fleet)==null?void 0:m.completeCount,(S=e==null?void 0:e.fleet)==null?void 0:S.services,(w=(b=e==null?void 0:e.predictionV1)==null?void 0:b.totals)==null?void 0:w.activeTaskRuns,(l=(u=e==null?void 0:e.predictionV1)==null?void 0:u.totals)==null?void 0:l.failed,(o=e==null?void 0:e.rewards)==null?void 0:o.claimLoopIntervalMs,(d=e==null?void 0:e.rewards)==null?void 0:d.lastClaimTickAt,c]);return h.jsxs("section",{id:"activity","data-testid":"operator-activity",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px",flexWrap:"wrap"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{className:"j-label",children:"Operator activity"}),h.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"30px",fontWeight:400,margin:0,color:"var(--fg)",letterSpacing:0},children:"Activity"})]}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--vow-green)",border:"1px solid var(--vow-green)",borderRadius:"var(--radius-1)",padding:"3px 8px"},children:"polling live"})]}),n.length>0&&h.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:n.map(([v,y])=>h.jsxs("span",{"data-testid":"operator-activity-count",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"3px 8px",textTransform:"uppercase",letterSpacing:"0.12em"},children:[Hd(v)," ",y]},v))}),!t&&!r&&h.jsx("div",{"data-testid":"operator-process-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",gap:"10px"},children:a.map(v=>h.jsx(v0,{title:v.title,status:v.status,detail:v.detail,meta:v.meta,tone:v.tone},v.title))}),t&&h.jsx("p",{"data-testid":"operator-activity-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"Loading activity…"}),r&&h.jsxs("div",{role:"alert","data-testid":"operator-activity-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:[h.jsx("span",{style:{color:"var(--break-red)",fontSize:"13px"},children:i instanceof Error?i.message:"Failed to load activity."}),h.jsx("button",{type:"button",onClick:()=>{s()},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"})]}),!t&&!r&&c.length===0&&h.jsx("p",{"data-testid":"operator-activity-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No operator activity recorded yet."}),!t&&!r&&c.length>0&&h.jsx("ul",{"data-testid":"operator-activity-list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"8px"},children:c.map(v=>h.jsxs("li",{"data-testid":"operator-activity-row",style:{display:"flex",alignItems:"flex-start",gap:"12px",flexWrap:"wrap",padding:"12px 0",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace"},children:[h.jsx("span",{style:{flex:"0 0 152px",color:"var(--fg-dim)",fontSize:"12px"},children:bs(v.ts)}),h.jsx("span",{style:{flex:"0 0 112px",color:v.kind.includes("error")?"var(--break-red)":"var(--accent-sky)",fontSize:"12px",textTransform:"uppercase",letterSpacing:"0.12em"},children:Hd(v.kind)}),h.jsx("span",{style:{flex:"1 1 260px",minWidth:0,color:"var(--fg)",fontSize:"13px"},children:d0(v)}),h.jsx("span",{style:{flex:"0 1 160px",minWidth:0,color:v.txHash?"var(--accent-gold)":f0(v.outcome),fontSize:"12px",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis"},children:h0(v.txHash)})]},v.id))})]})}function m0({onRestartPending:e=()=>{}}){var a;const{data:t}=be({queryKey:["bootstrap"],queryFn:()=>re.getBootstrap(),refetchInterval:1500}),r=c0(),i=r==null?void 0:r.split("/")[0],s=(t==null?void 0:t.chain)??"base-sepolia",c=(t==null?void 0:t.rpcUrl)??"",g=(t==null?void 0:t.defaultRpcUrl)??(s==="base"?"https://mainnet.base.org":"https://sepolia.base.org"),n=((a=t==null?void 0:t.harness)==null?void 0:a.mode)??"train";return h.jsxs("div",{"data-testid":"operator-page",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsx(g0,{}),h.jsx(s0,{defaultExpanded:i==="solvernets"||i===void 0}),h.jsx(l0,{mode:n,onRestartPending:e,defaultExpanded:i==="harness"}),h.jsx(o0,{chain:s,rpcUrl:c,defaultRpcUrl:g,rpcHealthy:!0,onRestartPending:e,defaultExpanded:i==="network"}),h.jsx(a0,{defaultExpanded:i==="security"})]})}function yn(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function $r(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-4?`${r.toExponential(3)} ETH`:`${r.toFixed(r<1?6:4)} ETH`}catch{return"—"}}function zd(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)}function Zl(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function _0(e){return!e||!Number.isFinite(e)?"—":e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function y0(e){return e.replace(/-/g," ")}function S0(e){return e.generator.state==="errored"||e.generator.stale?"attention":e.generator.state==="paused"?"paused":"live"}function x0(e){return e==="live"?"var(--vow-green)":e==="attention"?"var(--break-red)":"var(--wane)"}function w0({net:e}){var c,g,n;const t=S0(e),r=((c=e.generator.lastPollSummary)==null?void 0:c.posted)??0,i=((g=e.generator.lastPollSummary)==null?void 0:g.evaluated)??0,s=((n=e.generator.lastPollSummary)==null?void 0:n.skipped)??0;return h.jsxs("article",{"data-testid":"launcher-process-card",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px",minWidth:0},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px"},children:[h.jsx("span",{className:"j-label",children:e.name}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",color:x0(t)},children:e.generator.stale?"stale":e.generator.state})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(72px, 1fr))",gap:"8px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:[h.jsx(Jn,{label:"posted",value:r}),h.jsx(Jn,{label:"evaluated",value:i}),h.jsx(Jn,{label:"skipped",value:s}),h.jsx(Jn,{label:"open tasks",value:e.openTasks})]}),h.jsxs("span",{style:{color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["last poll ",Zl(e.generator.lastPollAt)," · cadence ",_0(e.generator.cadenceMs)]}),e.generator.lastError&&h.jsxs("span",{"data-testid":"launcher-process-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:[e.generator.lastError.message," · ",Zl(e.generator.lastError.at)]})]})}function Jn({label:e,value:t}){return h.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[h.jsx("span",{style:{color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.12em"},children:e}),h.jsx("span",{style:{color:"var(--fg)",fontSize:"16px"},children:t})]})}function b0({task:e}){var t;return h.jsxs("li",{"data-testid":"launcher-task-activity-row",style:{display:"grid",gridTemplateColumns:"130px minmax(0, 1fr) 116px 82px",gap:"12px",padding:"10px 0",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:[h.jsx("span",{style:{color:"var(--fg-dim)"},children:Zl(e.postedAt)}),h.jsx("span",{style:{color:"var(--fg)",minWidth:0,overflowWrap:"anywhere"},children:((t=e.summary)==null?void 0:t.title)??e.taskId}),h.jsx("span",{style:{color:"var(--accent-sky)",textTransform:"uppercase",letterSpacing:"0.12em"},children:y0(e.state)}),h.jsxs("span",{style:{color:"var(--fg-muted)",textAlign:"right"},children:[e.claims.current,"/",e.claims.max]})]})}function C0(){var g,n;const e=be({queryKey:["launcher-status","activity"],queryFn:()=>re.fetchLauncherStatus(),refetchInterval:5e3}),t=be({queryKey:["launcher-tasks","activity"],queryFn:()=>re.fetchLauncherTasks({limit:5}),refetchInterval:1e4}),r=((g=e.data)==null?void 0:g.nets)??[],i=((n=t.data)==null?void 0:n.tasks)??[],s=H.useMemo(()=>r.reduce((a,f)=>a+f.openTasks,0),[r]),c=r.filter(a=>a.generator.state==="active"&&!a.generator.stale).length;return h.jsxs("section",{"data-testid":"launcher-activity",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px",flexWrap:"wrap"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{className:"j-label",children:"Launcher activity"}),h.jsx("h2",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"30px",fontWeight:400,margin:0,color:"var(--fg)",letterSpacing:0},children:"Generators"})]}),h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--vow-green)",border:"1px solid var(--vow-green)",borderRadius:"var(--radius-1)",padding:"3px 8px"},children:[c," active · ",s," open"]})]}),e.isLoading&&h.jsx("p",{"data-testid":"launcher-activity-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"Loading launcher activity…"}),e.isError&&h.jsx("p",{role:"alert","data-testid":"launcher-activity-error",style:{margin:0,color:"var(--break-red)",fontSize:"13px"},children:e.error instanceof Error?e.error.message:"Failed to load launcher activity."}),!e.isLoading&&!e.isError&&r.length===0&&h.jsx("p",{"data-testid":"launcher-activity-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No launcher generators running yet."}),r.length>0&&h.jsx("div",{"data-testid":"launcher-process-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"10px"},children:r.map(a=>h.jsx(w0,{net:a},a.name))}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"center"},children:[h.jsx("span",{className:"j-label",children:"Recent task posts"}),h.jsx(Br,{href:"/launcher/create",style:{color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",textDecoration:"none"},children:"Create →"})]}),t.isError&&h.jsx("p",{role:"alert",style:{margin:0,color:"var(--break-red)",fontSize:"13px"},children:t.error instanceof Error?t.error.message:"Failed to load recent launcher tasks."}),!t.isLoading&&!t.isError&&i.length===0&&h.jsx("p",{"data-testid":"launcher-task-activity-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No launcher tasks posted yet."}),i.length>0&&h.jsx("ul",{"data-testid":"launcher-task-activity-list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},children:i.map(a=>h.jsx(b0,{task:a},a.taskId))})]})]})}const Wd={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 E0(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 R0({status:e}){const t=Wd[e]??Wd.launching;return h.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 j0({label:e}){return h.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 D0({record:e}){const[,t]=_n(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,i=e.summary,s=(i==null?void 0:i.name)??e.solverNetId,c=i!==void 0?`${i.contractId}.${i.contractVersion}`:null;return h.jsxs("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":i!==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:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[h.jsx("div",{"data-testid":"launcher-owned-row-primary",style:{fontFamily:i!==void 0?"'Instrument Serif', 'Times New Roman', serif":"'JetBrains Mono', monospace",fontSize:i!==void 0?"18px":"14px",fontWeight:i!==void 0?400:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",letterSpacing:i!==void 0?"-0.01em":void 0},children:s}),c!==null&&h.jsx("div",{"data-testid":"launcher-owned-row-contract",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:c}),i!==void 0&&h.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:[h.jsxs("span",{children:["solution ",$r(i.solutionPriceWei)]}),h.jsxs("span",{children:["verdict ",$r(i.verdictPriceWei)]})]}),i!==void 0&&i.openRoles.length>0&&h.jsx("div",{"data-testid":"launcher-owned-row-roles",style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:i.openRoles.map(g=>h.jsx(j0,{label:g},g))}),h.jsxs("div",{style:{display:"flex",gap:"14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[h.jsxs("span",{children:["cid ",k0(e.manifestCid)]}),h.jsxs("span",{children:["launched ",E0(e.launchedAt)]})]})]}),h.jsx(R0,{status:e.status})]})}function T0(){return h.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:[h.jsx("h2",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)",margin:0,letterSpacing:"-0.01em"},children:"No SolverNets created yet."}),h.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."}),h.jsx("div",{children:h.jsx(Br,{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 L0(){const{data:e,isLoading:t,isError:r,error:i,refetch:s}=be({queryKey:["solvernets","launched","owned"],queryFn:()=>re.solvernets.listLaunched(),refetchInterval:3e4});return h.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[h.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&&h.jsx(Br,{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"})]}),h.jsx(C0,{}),t&&h.jsx("p",{"data-testid":"launcher-loading",style:{color:"var(--fg-muted)",fontSize:"13px",margin:0},children:"Loading…"}),r&&h.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:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Failed to load your SolverNets."}),h.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:i instanceof Error?i.message:"Unknown error"})]}),h.jsx("button",{type:"button",onClick:()=>{s()},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&&h.jsx(T0,{}),!t&&!r&&e&&e.records.length>0&&h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.records.map(c=>h.jsx(D0,{record:c},c.solverNetId))})]})}function M0({current:e,total:t=5}){return h.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:[h.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),h.jsx("div",{style:{display:"flex",gap:"4px",flex:1,maxWidth:"320px"},children:Array.from({length:t}).map((r,i)=>{const s=i+1,c=s<=e;return h.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":c?"true":"false",style:{flex:1,height:"3px",background:c?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},s)})})]})}function Sn({step:e,total:t=5,title:r,blurb:i,children:s,footer:c,error:g}){return h.jsxs("main",{"data-testid":`launcher-create-step-${e}`,style:{padding:"24px",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"720px",margin:"0 auto"},children:[h.jsx(M0,{current:e,total:t}),h.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400,letterSpacing:"-0.01em"},children:r}),i&&h.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.5},children:i})]}),g&&h.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}),h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:s}),h.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:c})]})}function xn({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:i=!1,busy:s=!1,right:c}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{children:e&&h.jsx("button",{type:"button","data-testid":"launcher-create-back",onClick:e,disabled:s,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:s?"wait":"pointer"},children:"Back"})}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[c,t&&h.jsx("button",{type:"button","data-testid":"launcher-create-next",onClick:t,disabled:i||s,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 22px",background:i||s?"var(--bg-elevated)":"var(--accent-sky)",color:i||s?"var(--fg-dim)":"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:i||s?"not-allowed":"pointer",opacity:i||s?.6:1},children:r})]})]})}function Xe({label:e,helperText:t,error:r,children:i}){return h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),i,r?h.jsx("span",{style:{fontSize:"12px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:r}):t&&h.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:t})]})}const hv={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"},ft=hv,At={...hv,border:"1px solid var(--break-red)"};function $d({draft:e,onAdvance:t,busy:r,error:i}){const[s,c]=H.useState(e.name??""),[g,n]=H.useState(e.description??""),[a,f]=H.useState(!1),_=a&&s.trim().length===0?"Name is required.":null,p=a&&g.trim().length===0?"Description is required.":null,m=async S=>{S==null||S.preventDefault(),f(!0),!(s.trim().length===0||g.trim().length===0)&&await t({name:s.trim(),description:g.trim(),completedSteps:yn(e.completedSteps,"define")})};return h.jsx(Sn,{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:i,footer:h.jsx(xn,{onNext:()=>{m()},nextDisabled:s.trim().length===0||g.trim().length===0,busy:r}),children:h.jsxs("form",{onSubmit:S=>{m(S)},style:{display:"flex",flexDirection:"column",gap:"16px"},children:[h.jsx(Xe,{label:"Name",error:_,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:h.jsx("input",{"data-testid":"launcher-create-name",type:"text",value:s,onChange:S=>c(S.target.value),placeholder:"e.g. Polymarket forecasts",style:_?At:ft,disabled:r})}),h.jsx(Xe,{label:"Description",error:p,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:h.jsx("textarea",{"data-testid":"launcher-create-description",value:g,onChange:S=>n(S.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",style:{...p?At:ft,resize:"vertical",minHeight:"96px",fontFamily:"'JetBrains Mono', monospace"},disabled:r})}),h.jsx("button",{type:"submit",hidden:!0,"aria-hidden":!0,tabIndex:-1})]})})}const is={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",inputs:["prediction.v1 Task","prediction.v1 Solution","Polymarket/UMA resolution"],output:"prediction.v1 Verdict"},aggregationFunction:{id:"prediction.trailing-mean-brier-spread.v1",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}},he=is;function P0({draft:e,onAdvance:t,onBack:r,busy:i,error:s}){const c=()=>{t({templateContractId:he.id,templateContractVersion:he.version,completedSteps:yn(e.completedSteps,"reviewContract")})};return h.jsx(Sn,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest. Day-1 only one template ships.",error:s,footer:h.jsx(xn,{onBack:r,onNext:c,busy:i}),children:h.jsxs("article",{"data-testid":"launcher-create-template","data-template-id":`${he.id}.${he.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:[h.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[he.id,".",he.version]}),h.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",fontWeight:400,color:"var(--fg)"},children:he.name}),h.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:he.description})]}),h.jsxs(Cs,{title:"Schemas",children:[h.jsx(Ve,{label:"Task",value:he.schemas.task.name,hint:he.schemas.task.description}),h.jsx(Ve,{label:"Solution",value:he.schemas.solution.name,hint:he.schemas.solution.description}),h.jsx(Ve,{label:"Verdict",value:he.schemas.verdict.name,hint:he.schemas.verdict.description})]}),h.jsxs(Cs,{title:"Evaluation function",children:[h.jsx(Ve,{label:"Id",value:he.evaluationFunction.id,mono:!0}),h.jsx(Ve,{label:"Deterministic",value:"yes"}),h.jsx(Ve,{label:"Inputs",value:he.evaluationFunction.inputs.join(", ")}),h.jsx(Ve,{label:"Output",value:he.evaluationFunction.output})]}),h.jsxs(Cs,{title:"Aggregation function",children:[h.jsx(Ve,{label:"Id",value:he.aggregationFunction.id,mono:!0}),h.jsx(Ve,{label:"Window",value:`${he.aggregationFunction.windowDays} days`}),h.jsx(Ve,{label:"Output",value:he.aggregationFunction.output})]}),h.jsxs(Cs,{title:"Claim policy defaults",children:[h.jsx(Ve,{label:"Mode",value:he.claimPolicyDefaults.mode}),h.jsx(Ve,{label:"Max claims",value:String(he.claimPolicyDefaults.maxClaims)}),h.jsx(Ve,{label:"Per operator",value:String(he.claimPolicyDefaults.maxClaimsPerOperator)}),h.jsx(Ve,{label:"Lease TTL",value:`${he.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),h.jsxs(Cs,{title:"Credential requirements",children:[h.jsx(Fa,{role:"creator",creds:he.credentialRequirements.creator}),h.jsx(Fa,{role:"solver",creds:he.credentialRequirements.solver}),h.jsx(Fa,{role:"evaluator",creds:he.credentialRequirements.evaluator})]})]})})}function Cs({title:e,children:t}){return h.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"8px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[h.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:t})]})}function Ve({label:e,value:t,hint:r,mono:i}){return h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"12px",alignItems:"baseline"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),h.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[h.jsx("span",{style:{fontFamily:i?"'JetBrains Mono', monospace":"inherit",fontSize:"13px",color:"var(--fg)"},children:t}),r&&h.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:r})]})]})}function Fa({role:e,creds:t}){return h.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em",textTransform:"capitalize"},children:e}),t.length===0?h.jsx("div",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"None."}):t.map(r=>h.jsxs("div",{style:{fontSize:"12px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:[h.jsx("span",{style:{color:"var(--accent-sky)"},children:r.id}),h.jsxs("span",{style:{color:"var(--fg-dim)"},children:[" · ",r.kind]}),r.required&&h.jsx("span",{style:{color:"var(--wane)"},children:" · required"}),h.jsx("div",{style:{color:"var(--fg-muted)"},children:r.description})]},r.id))]})}const Ud=6e4;function hi(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function Kd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function B0(e){const t=is.generatorDefaults,r=60*60*1e3;return{cadenceMs:hi(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:hi((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:hi(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:hi(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:hi(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:hi(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:Kd(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:Kd(e==null?void 0:e.blocklistConditionIds)}}function Jd(e){const t={},r=fi(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<Ud&&(t.cadenceMs=`Cadence must be at least ${Ud/1e3}s.`);const i=fi(e.windowMs);i===null&&(t.windowMs="Must be a positive integer (ms).");const s=fi(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const c=fi(e.maxNewRoundsPerPoll);c===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const g=fi(e.maxNewRoundsPerDay);g===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const n=fi(e.maxOpenRounds);return n===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:i,resolveGapMs:s,submissionWindowMs:i,maxNewRoundsPerPoll:c,maxNewRoundsPerDay:g,maxOpenRounds:n,allowlistConditionIds:qd(e.allowlistConditionIds),blocklistConditionIds:qd(e.blocklistConditionIds)}}}function fi(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 qd(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function A0({draft:e,onAdvance:t,onBack:r,busy:i,error:s}){const c=H.useMemo(()=>B0(e.generatorConfig),[e.generatorConfig]),[g,n]=H.useState(c),[a,f]=H.useState(!1),_=a?Jd(g):{ok:!0,errors:{}},p=a?_.errors:{},m=()=>{f(!0);const b=Jd(g);!b.ok||!b.generatorConfig||t({generatorConfig:b.generatorConfig,completedSteps:yn(e.completedSteps,"configureGenerator")})},S=(b,w)=>{n(u=>({...u,[b]:w}))};return h.jsxs(Sn,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:s,footer:h.jsx(xn,{onBack:r,onNext:m,busy:i,nextDisabled:a&&!_.ok}),children:[h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[h.jsx(Xe,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:p.cadenceMs??null,children:h.jsx("input",{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:g.cadenceMs,onChange:b=>S("cadenceMs",b.target.value),style:p.cadenceMs?At:ft,disabled:i})}),h.jsx(Xe,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:p.windowMs??null,children:h.jsx("input",{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:g.windowMs,onChange:b=>S("windowMs",b.target.value),style:p.windowMs?At:ft,disabled:i})}),h.jsx(Xe,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:p.resolveGapMs??null,children:h.jsx("input",{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:g.resolveGapMs,onChange:b=>S("resolveGapMs",b.target.value),style:p.resolveGapMs?At:ft,disabled:i})}),h.jsx(Xe,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:p.maxNewRoundsPerPoll??null,children:h.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerPoll,onChange:b=>S("maxNewRoundsPerPoll",b.target.value),style:p.maxNewRoundsPerPoll?At:ft,disabled:i})}),h.jsx(Xe,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:p.maxNewRoundsPerDay??null,children:h.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerDay,onChange:b=>S("maxNewRoundsPerDay",b.target.value),style:p.maxNewRoundsPerDay?At:ft,disabled:i})}),h.jsx(Xe,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:p.maxOpenRounds??null,children:h.jsx("input",{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:g.maxOpenRounds,onChange:b=>S("maxOpenRounds",b.target.value),style:p.maxOpenRounds?At:ft,disabled:i})})]}),h.jsx(Xe,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:h.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:g.allowlistConditionIds,onChange:b=>S("allowlistConditionIds",b.target.value),rows:2,placeholder:"0xabc…, 0xdef…",style:{...ft,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:i})}),h.jsx(Xe,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:h.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:g.blocklistConditionIds,onChange:b=>S("blocklistConditionIds",b.target.value),rows:2,placeholder:"0xabc…",style:{...ft,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:i})})]})}function O0(e,t){const r={};let i,s;try{i=zd(e),i===null?r.solutionPriceWei="Required.":i<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",i=null}try{s=zd(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return i!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&i===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:i??void 0,verdictWei:s??void 0}}function I0(e,t,r,i){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const c=t+r*BigInt(i);return c<=0n?null:{tasks:Number(s/c),perTaskWei:c}}function F0({draft:e,onAdvance:t,onBack:r,fundingSafeAddress:i,fundingSafeBalanceWei:s,busy:c,error:g}){var l,o;const[n,a]=H.useState(e.solutionPriceWei??""),[f,_]=H.useState(e.verdictPriceWei??""),[p,m]=H.useState(!1),S=H.useMemo(()=>O0(n,f),[n,f]),b=H.useMemo(()=>I0(s??null,S.solutionWei,S.verdictWei,is.claimPolicyDefaults.maxClaimsPerOperator),[s,S.solutionWei,S.verdictWei]),w=()=>{m(!0),S.ok&&t({solutionPriceWei:n,verdictPriceWei:f,completedSteps:yn(e.completedSteps,"configurePricing")})},u=p?S.errors:{};return h.jsxs(Sn,{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:g,footer:h.jsx(xn,{onBack:r,onNext:w,busy:c,nextDisabled:p&&!S.ok}),children:[h.jsx(Xe,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",children:h.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)"})}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[h.jsx(Xe,{label:"Solution price (wei)",helperText:`≈ ${$r((l=S.solutionWei)==null?void 0:l.toString())}`,error:u.solutionPriceWei??null,children:h.jsx("input",{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:n,onChange:d=>a(d.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",style:u.solutionPriceWei?At:ft,disabled:c})}),h.jsx(Xe,{label:"Verdict price (wei)",helperText:`≈ ${$r((o=S.verdictWei)==null?void 0:o.toString())}`,error:u.verdictPriceWei??null,children:h.jsx("input",{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:f,onChange:d=>_(d.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",style:u.verdictPriceWei?At:ft,disabled:c})})]}),u.combined&&h.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:u.combined}),h.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:[h.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Runway projection"}),h.jsx(Na,{label:"Safe balance",value:s?`${$r(s)} (${s} wei)`:"—"}),h.jsx(Na,{label:"Per-Task cost",value:b?`${$r(b.perTaskWei.toString())} (${b.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${is.claimPolicyDefaults.maxClaimsPerOperator})`}),h.jsx(Na,{label:"Projected Tasks",value:b?`~${b.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})]})}function Na({label:e,value:t,hint:r,testId:i}){return h.jsxs("div",{"data-testid":i,style:{display:"grid",gridTemplateColumns:"160px 1fr",alignItems:"baseline",gap:"12px"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),h.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t}),r&&h.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:r})]})]})}const N0=1500,Vd=["pinning","recording","broadcasting","confirming","spawning"],H0={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function z0({draft:e,onUpdateDraft:t,onBack:r,onLaunchFailure:i,navigateTo:s,pollIntervalMs:c=N0}){const[,g]=_n(),n=s??g,a=H.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[f,_]=H.useState(a),[p,m]=H.useState({kind:"idle"}),S=H.useRef(!1);H.useEffect(()=>()=>{S.current=!0},[]);const b=o=>{_(d=>d.includes(o)?d.filter(v=>v!==o):[...d,o])},w=async()=>{var o,d,v;if(f.length!==0){m(y=>y.kind==="failed"?{kind:"idle"}:y),S.current=!1;try{await t({openRoles:f,completedSteps:yn(e.completedSteps,"configurePricing")});const y=await re.solvernets.launch(e.draftId);if(S.current)return;let C="pinning";for(m({kind:"launching",phase:C,solverNetId:y.solverNetId});;){if(S.current)return;let k;try{k=await re.solvernets.get(y.solverNetId)}catch{if(S.current)return;await Yd(c);continue}if((o=k.launchProgress)!=null&&o.phase&&(C=k.launchProgress.phase),k.status==="launched"){m({kind:"launching",phase:"spawning",solverNetId:y.solverNetId}),n(`/launcher/launched/${encodeURIComponent(y.solverNetId)}`);return}if(k.status==="failed"){const x=((v=(d=k.launchProgress)==null?void 0:d.txError)==null?void 0:v.message)??`Launch failed during ${C}.`;m({kind:"failed",message:x,solverNetId:y.solverNetId}),i==null||i();return}m({kind:"launching",phase:C,solverNetId:y.solverNetId}),await Yd(c)}}catch(y){if(S.current)return;m({kind:"failed",message:y instanceof Error?y.message:String(y)}),i==null||i()}}},u=p.kind==="launching",l=f.length===0||u;return h.jsxs(Sn,{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:h.jsx(xn,{onBack:r,onNext:()=>{w()},nextLabel:u?"Launching…":"Launch",nextDisabled:l,busy:u,right:u&&h.jsx(W0,{current:p.kind==="launching"?p.phase:"pinning"})}),children:[h.jsx($0,{draft:e}),h.jsxs(Xe,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",children:[h.jsxs("div",{"data-testid":"launcher-create-openRoles",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[h.jsx(Xd,{role:"solver",checked:f.includes("solver"),onChange:()=>b("solver"),disabled:u}),h.jsx(Xd,{role:"evaluator",checked:f.includes("evaluator"),onChange:()=>b("evaluator"),disabled:u})]}),f.length===0&&h.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."})]}),p.kind==="failed"&&h.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:[h.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Launch failed."}),h.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px",fontFamily:"'JetBrains Mono', monospace"},children:p.message}),h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[h.jsx("button",{type:"button","data-testid":"launcher-create-launch-retry",onClick:()=>{w()},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"}),h.jsx("button",{type:"button","data-testid":"launcher-create-launch-abandon",onClick:()=>{n("/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 W0({current:e}){const t=Vd.indexOf(e);return h.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:[h.jsx("span",{"data-testid":"launcher-create-launch-phase",children:H0[e]}),h.jsx("div",{style:{display:"flex",gap:"3px"},children:Vd.map((r,i)=>h.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":i<=t?"true":"false",style:{width:"8px",height:"3px",background:i<=t?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},r))})]})}function $0({draft:e}){const t=e.generatorConfig??{},r=Ha(t.cadenceMs),i=Ha(t.windowMs??t.submissionWindowMs),s=Ha(t.maxOpenRounds);return h.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:[h.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[e.templateContractId??is.id,".",e.templateContractVersion??is.version]}),h.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&&h.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:e.description})]}),h.jsxs(U0,{children:[h.jsx(Ar,{label:"Solution price",value:Qd(e.solutionPriceWei)}),h.jsx(Ar,{label:"Verdict price",value:Qd(e.verdictPriceWei)}),h.jsx(Ar,{label:"Cadence",value:r?`${r} ms`:"—"}),h.jsx(Ar,{label:"Window",value:i?`${i} ms`:"—"}),h.jsx(Ar,{label:"Max open rounds",value:s??"—"}),h.jsx(Ar,{label:"Allowlist",value:Gd(t.allowlistConditionIds)}),h.jsx(Ar,{label:"Blocklist",value:Gd(t.blocklistConditionIds)})]})]})}function Qd(e){return e?`${e} wei (${$r(e)})`:"—"}function Ha(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function Gd(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function U0({children:e}){return h.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px 16px",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:e})}function Ar({label:e,value:t}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}function Xd({role:e,checked:t,onChange:r,disabled:i}){return h.jsxs("label",{style:{display:"flex",gap:"10px",alignItems:"center",cursor:i?"not-allowed":"pointer",opacity:i?.6:1},children:[h.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:i}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:e})]})}function Yd(e){return new Promise(t=>setTimeout(t,e))}const ec="jinn.launcher-create.draftId.v1";function K0(){if(typeof window>"u")return null;try{return window.localStorage.getItem(ec)}catch{return null}}function Zd(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(ec):window.localStorage.setItem(ec,e)}catch{}}function J0(){var d;const[e,t]=H.useState(null),[r,i]=H.useState(null),[s,c]=H.useState(1),[g,n]=H.useState(!1),[a,f]=H.useState(null),_=H.useRef(!1),{data:p}=be({queryKey:["bootstrap"],queryFn:()=>re.getBootstrap(),refetchInterval:3e4}),{data:m}=be({queryKey:["status"],queryFn:()=>re.getStatus(),refetchInterval:3e4}),S=(p==null?void 0:p.master_address)??(m==null?void 0:m.master_address)??null,b=((d=m==null?void 0:m.masterGas)==null?void 0:d.balanceWei)??null;H.useEffect(()=>{if(_.current)return;_.current=!0;let v=!1;return(async()=>{const C=K0();if(C)try{const k=await re.solvernets.getDraft(C);if(v)return;t(k);return}catch{Zd(null)}try{const k=await re.solvernets.createDraft();if(v)return;Zd(k.draftId),t(k)}catch(k){if(v)return;i(k instanceof Error?k.message:"Failed to create draft.")}})(),()=>{v=!0}},[]);const w=async v=>{if(e){n(!0),f(null);try{const y=await re.solvernets.updateDraft(e.draftId,v);t(y),c(C=>C<5?C+1:C)}catch(y){f(y instanceof Error?y.message:String(y))}finally{n(!1)}}},u=async v=>{if(e){n(!0),f(null);try{const y=await re.solvernets.updateDraft(e.draftId,v);t(y)}catch(y){f(y instanceof Error?y.message:String(y))}finally{n(!1)}}},l=()=>{f(null),c(v=>v>1?v-1:v)},o=()=>{f(null)};if(r)return h.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",style:{padding:"24px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace"},children:[h.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"}),h.jsx("p",{style:{marginTop:"12px",color:"var(--break-red)",fontSize:"13px"},children:r})]});if(!e)return h.jsx("main",{"data-testid":"launcher-create-loading",style:{padding:"24px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:"Loading draft…"});switch(s){case 1:return h.jsx($d,{draft:e,onAdvance:w,busy:g,error:a});case 2:return h.jsx(P0,{draft:e,onAdvance:w,onBack:l,busy:g,error:a});case 3:return h.jsx(A0,{draft:e,onAdvance:w,onBack:l,busy:g,error:a});case 4:return h.jsx(F0,{draft:e,onAdvance:w,onBack:l,fundingSafeAddress:S,fundingSafeBalanceWei:b??null,busy:g,error:a});case 5:return h.jsx(z0,{draft:e,onUpdateDraft:u,onBack:l,onLaunchFailure:o});default:return h.jsx($d,{draft:e,onAdvance:w,busy:g,error:a})}}const eh={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 fv(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function pv(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function tc(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 q0={launched:["paused","retired"],paused:["launched","retired"]};function qn(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-4?`${r.toExponential(3)} ETH`:`${r.toFixed(r<1?6:4)} ETH`}catch{return"—"}}function V0(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let i;try{i=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(i/s),perTaskWei:s}}const th=6e4;function Q0(e){const t=e??{};return{cadenceMs:pi(t.cadenceMs),windowMs:pi(t.windowMs??t.submissionWindowMs),resolveGapMs:pi(t.resolveGapMs),maxNewRoundsPerPoll:pi(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:pi(t.maxNewRoundsPerDay),maxOpenRounds:pi(t.maxOpenRounds),allowlistConditionIds:rh(t.allowlistConditionIds),blocklistConditionIds:rh(t.blocklistConditionIds)}}function pi(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function rh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function G0(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 X0(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function Y0(e,t){const r={},i={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const c=G0(e[s]);if(c===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&c<th){r[s]=`Cadence must be at least ${th/1e3}s.`;continue}s==="windowMs"?i.submissionWindowMs=c:i[s]=c}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(i[s]=X0(e[s]));return{ok:Object.keys(r).length===0,patch:i,errors:r}}function Z0({record:e,onSave:t}){var m,S;const r=H.useMemo(()=>Q0(e.generatorConfig),[e.generatorConfig]),[i,s]=H.useState(r),[c,g]=H.useState({kind:"idle"});H.useEffect(()=>{s(w=>JSON.stringify(w)!==JSON.stringify(b())?w:r);function b(){return r}},[JSON.stringify(e.generatorConfig)]);const n=(b,w)=>{s(u=>({...u,[b]:w}))},a=H.useMemo(()=>Y0(i,r),[i,r]),f=Object.keys(a.patch).length>0,_=c.kind==="saving",p=async()=>{if(!(!a.ok||!f||_)){g({kind:"saving"});try{await t(a.patch),g({kind:"saved",at:new Date})}catch(b){g({kind:"error",message:b instanceof Error?b.message:String(b)})}}};return h.jsxs("section",{"data-testid":"launcher-launched-generator-panel",style:rS,children:[h.jsxs("header",{style:iS,children:[h.jsx("h2",{style:sS,children:"Generator"}),h.jsx(eS,{record:e})]}),h.jsxs("dl",{style:nS,children:[h.jsx(sh,{label:"Last poll",value:tc((m=e.generatorState)==null?void 0:m.lastPollAt),testid:"launcher-launched-generator-last-poll"}),h.jsx(sh,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),((S=e.generatorState)==null?void 0:S.lastError)&&h.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:[h.jsxs("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:500},children:["Last error · ",tc(e.generatorState.lastError.at)]}),h.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:e.generatorState.lastError.message})]}),h.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Hot-apply config"}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[h.jsx(vi,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:i.cadenceMs,onChange:b=>n("cadenceMs",b),error:a.errors.cadenceMs,disabled:_}),h.jsx(vi,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:i.windowMs,onChange:b=>n("windowMs",b),error:a.errors.windowMs,disabled:_}),h.jsx(vi,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:i.resolveGapMs,onChange:b=>n("resolveGapMs",b),error:a.errors.resolveGapMs,disabled:_}),h.jsx(vi,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:i.maxNewRoundsPerPoll,onChange:b=>n("maxNewRoundsPerPoll",b),error:a.errors.maxNewRoundsPerPoll,disabled:_}),h.jsx(vi,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:i.maxNewRoundsPerDay,onChange:b=>n("maxNewRoundsPerDay",b),error:a.errors.maxNewRoundsPerDay,disabled:_}),h.jsx(vi,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:i.maxOpenRounds,onChange:b=>n("maxOpenRounds",b),error:a.errors.maxOpenRounds,disabled:_})]}),h.jsx(ih,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:i.allowlistConditionIds,onChange:b=>n("allowlistConditionIds",b),disabled:_}),h.jsx(ih,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:i.blocklistConditionIds,onChange:b=>n("blocklistConditionIds",b),disabled:_}),h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:[h.jsx(tS,{status:c}),h.jsx("button",{type:"button","data-testid":"launcher-launched-generator-save",onClick:()=>{p()},disabled:!f||!a.ok||_,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:f&&a.ok&&!_?"var(--accent-sky)":"var(--bg-elevated)",color:f&&a.ok&&!_?"var(--bg-sunken)":"var(--fg-dim)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:f&&a.ok&&!_?"pointer":"not-allowed",opacity:f&&a.ok&&!_?1:.7},children:_?"Saving…":"Save"})]})]})}function eS({record:e}){var s;const t=e.generatorEnabled,i=!!((s=e.generatorState)!=null&&s.lastError)?{fg:"var(--break-red)",label:"Errored"}:t?{fg:"var(--vow-green)",label:"Enabled"}:{fg:"var(--fg-dim)",label:"Disabled"};return h.jsx("span",{"data-testid":"launcher-launched-generator-state-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:i.fg,border:`1px solid ${i.fg}`,borderRadius:"var(--radius-1)",padding:"2px 8px"},children:i.label})}function tS({status:e}){if(e.kind==="saving")return h.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 h.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"?h.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]}):h.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 vi({label:e,testid:t,value:r,onChange:i,error:s,disabled:c}){return h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:au,children:e}),h.jsx("input",{"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:g=>i(g.target.value),disabled:c,style:s?oS:lu}),s&&h.jsx("span",{"data-testid":`${t}-error`,style:{fontSize:"11px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:s})]})}function ih({label:e,testid:t,value:r,onChange:i,disabled:s}){return h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("span",{style:au,children:e}),h.jsx("textarea",{"data-testid":t,value:r,onChange:c=>i(c.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",style:{...lu,resize:"vertical"}})]})}function sh({label:e,value:t,testid:r}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[h.jsx("dt",{style:au,children:e}),h.jsx("dd",{"data-testid":r,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}const rS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"14px"},iS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},sS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},au={fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},nS={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"8px 16px",margin:0},lu={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"},oS={...lu,border:"1px solid var(--break-red)"},aS={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 lS({open:e,target:t,solverNetName:r,onConfirm:i,onCancel:s,pending:c=!1,errorMessage:g}){const[n,a]=H.useState("");if(H.useEffect(()=>{e||a("")},[e,t]),!e)return null;const f=aS[t],_=t==="retired",p=!_||n.trim()===r.trim(),m=c||!p;return h.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:S=>{S.target===S.currentTarget&&!c&&s()},children:h.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:[h.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}),h.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:f.body}),_&&h.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Type ",h.jsx("span",{style:{color:"var(--fg)"},children:r})," to confirm"]}),h.jsx("input",{"data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:n,onChange:S=>a(S.target.value),disabled:c,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&&h.jsx("span",{"data-testid":"launcher-launched-dialog-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:g}),h.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[h.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-cancel",onClick:s,disabled:c,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:c?"wait":"pointer"},children:"Cancel"}),h.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-confirm",onClick:i,disabled:m,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:f.danger?m?"var(--bg-elevated)":"var(--break-red)":m?"var(--bg-elevated)":"var(--accent-sky)",color:m?"var(--fg-dim)":(f.danger,"var(--bg-sunken)"),border:`1px solid ${f.danger?"var(--break-red)":"var(--accent-sky)"}`,borderRadius:"var(--radius-2)",cursor:m?"not-allowed":"pointer",opacity:m?.6:1},children:c?`${f.confirmLabel}…`:f.confirmLabel})]})]})})}function cS({record:e,manifest:t,fetchLauncherStatus:r}){const i=r??(()=>re.fetchLauncherStatus()),{data:s,isLoading:c,isError:g}=be({queryKey:["launcher-status",e.solverNetId],queryFn:()=>i(),refetchInterval:3e4}),n=t?s==null?void 0:s.nets.find(S=>S.name===t.name):void 0,a=n==null?void 0:n.budget.safeBalanceWei,f=(n==null?void 0:n.budget.safeAddress)??e.launcherSafeAddress,_=t==null?void 0:t.solutionPriceWei,p=t==null?void 0:t.verdictPriceWei,m=V0(a,_,p);return h.jsxs("section",{"data-testid":"launcher-launched-spend-panel",style:uS,children:[h.jsx("header",{style:dS,children:h.jsx("h2",{style:hS,children:"Spend & runway"})}),h.jsxs("dl",{style:fS,children:[h.jsx(gi,{label:"Safe address",value:pv(f),title:f,testid:"launcher-launched-spend-safe-address"}),h.jsx(gi,{label:"Safe balance",value:c?"—":a?`${qn(a)} (${a} wei)`:"unavailable",testid:"launcher-launched-spend-safe-balance"}),h.jsx(gi,{label:"Solution price",value:_?`${_} wei (${qn(_)})`:"—",testid:"launcher-launched-spend-solution-price"}),h.jsx(gi,{label:"Verdict price",value:p?`${p} wei (${qn(p)})`:"—",testid:"launcher-launched-spend-verdict-price"}),h.jsx(gi,{label:"Per-Task cost",value:m?`${m.perTaskWei.toString()} wei (${qn(m.perTaskWei.toString())})`:"—",testid:"launcher-launched-spend-per-task"}),h.jsx(gi,{label:"Projected runway",value:m?`${m.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),g&&h.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."}),h.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 gi({label:e,value:t,testid:r,title:i}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[h.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),h.jsx("dd",{"data-testid":r,title:i,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const uS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},dS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},hS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},fS={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"8px 16px",margin:0},pS={paused:"Pause",launched:"Resume",retired:"Retire"};function vS({record:e,manifest:t,onAction:r,pending:i}){const s=eh[e.status]??eh.launching,c=q0[e.status]??[],g=(t==null?void 0:t.name)??"— unnamed";return h.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:[h.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",flexWrap:"wrap"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[h.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}),h.jsx("span",{"data-testid":"launcher-launched-status-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:s.fg,border:`1px solid ${s.border}`,borderRadius:"var(--radius-1)",padding:"3px 10px",whiteSpace:"nowrap"},children:s.label})]}),(t==null?void 0:t.description)&&h.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5,maxWidth:"720px"},children:t.description})]}),h.jsx(gS,{allowed:c,onAction:r,pending:i??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),h.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:[h.jsx(Vn,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id",mono:!0}),h.jsx(Vn,{label:"Manifest cid",value:fv(e.manifestCid),testid:"launcher-launched-manifest-cid",mono:!0,title:e.manifestCid}),h.jsx(Vn,{label:"Launcher Safe",value:pv(e.launcherSafeAddress),testid:"launcher-launched-safe",mono:!0,title:e.launcherSafeAddress}),h.jsx(Vn,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent",mono:!0})]})]})}function Vn({label:e,value:t,testid:r,mono:i=!1,title:s}){return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[h.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),h.jsx("dd",{"data-testid":r,title:s,style:{margin:0,fontFamily:i?"'JetBrains Mono', monospace":void 0,fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}function gS({allowed:e,onAction:t,pending:r,terminal:i,launching:s}){return i?h.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"}):s?h.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:h.jsx("div",{"data-testid":"launcher-launched-actions",style:{display:"flex",gap:"8px",alignSelf:"flex-start",flexWrap:"wrap"},children:e.map(c=>{const g=pS[c],n=r===c,a=c==="retired";return h.jsx("button",{type:"button","data-testid":`launcher-launched-action-${c}`,onClick:()=>t(c),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&&!n?.6:1,whiteSpace:"nowrap"},children:n?`${g}…`:g},c)})})}const nh=25,mS={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 _S({record:e,fetchTasks:t}){var S,b,w;const[r,i]=H.useState([void 0]),s=r[r.length-1],c=t??(u=>re.fetchLauncherTasks(u)),{data:g,isLoading:n,isError:a,error:f,refetch:_}=be({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>c({cursor:s,limit:nh}),refetchInterval:15e3}),p=()=>{var u;(u=g==null?void 0:g.cursor)!=null&&u.before&&i(l=>[...l,g.cursor.before])},m=()=>{i(u=>u.length>1?u.slice(0,-1):u)};return h.jsxs("section",{"data-testid":"launcher-launched-tasks-panel",style:xS,children:[h.jsxs("header",{style:wS,children:[h.jsx("h2",{style:bS,children:"Recent posted Tasks"}),h.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{_()},style:za,children:"Refresh"})]}),n&&h.jsx("p",{"data-testid":"launcher-launched-tasks-loading",style:oh,children:"Loading…"}),a&&h.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"]}),!n&&!a&&g&&g.tasks.length===0&&h.jsx(SS,{}),!n&&!a&&g&&g.tasks.length>0&&h.jsxs(h.Fragment,{children:[h.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:[h.jsxs("div",{role:"row",style:CS,children:[h.jsx("span",{children:"Task"}),h.jsx("span",{children:"Posted"}),h.jsx("span",{children:"State"}),h.jsx("span",{style:{textAlign:"right"},children:"Claims"})]}),g.tasks.map(u=>h.jsx(yS,{task:u},u.taskId))]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[h.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-prev",onClick:m,disabled:r.length<=1,style:{...za,opacity:r.length<=1?.5:1,cursor:r.length<=1?"not-allowed":"pointer"},children:"← Newer"}),h.jsxs("span",{style:oh,children:["Page ",r.length,g.tasks.length<nh&&g.cursor===void 0?" · end":""]}),h.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-next",onClick:p,disabled:!((S=g.cursor)!=null&&S.before),style:{...za,opacity:(b=g.cursor)!=null&&b.before?1:.5,cursor:(w=g.cursor)!=null&&w.before?"pointer":"not-allowed"},children:"Older →"})]})]})]})}function yS({task:e}){var r;const t=mS[e.state]??{fg:"var(--fg-muted)",label:e.state};return h.jsxs("div",{role:"row","data-testid":"launcher-launched-task-row","data-task-id":e.taskId,style:kS,children:[h.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)??fv(e.taskCid)}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:tc(e.postedAt)}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:t.fg,textTransform:"uppercase",letterSpacing:"0.1em"},children:t.label}),h.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",textAlign:"right"},children:[e.claims.current," / ",e.claims.max]})]})}function SS(){return h.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 xS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},wS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},bS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},CS={display:"grid",gridTemplateColumns:"2fr 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)"},kS={display:"grid",gridTemplateColumns:"2fr 1.4fr 1fr 0.8fr",gap:"12px",alignItems:"center",padding:"10px 14px",borderBottom:"1px solid var(--border)"},za={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"},oh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},ES=2500;function RS({pollIntervalMs:e=ES,navigateTo:t,solverNetId:r}={}){var d,v,y;const i=ou(),[,s]=_n(),c=t??s,g=ta(),n=r??i.solverNetId,a=be({queryKey:["solvernets","launched",n],queryFn:()=>re.solvernets.get(n),refetchInterval:e,enabled:!!n}),f=(d=a.data)==null?void 0:d.manifestCid,_=be({queryKey:["solvernets","manifest",f],queryFn:()=>re.solvernets.getManifest(f),enabled:!!f,staleTime:1/0}),[p,m]=H.useState(null),[S,b]=H.useState(null),w=Gl({mutationFn:({target:C})=>re.solvernets.transitionLifecycle(n,C),onSuccess:async C=>{await g.cancelQueries({queryKey:["solvernets","launched",n]}),g.setQueryData(["solvernets","launched",n],C),m(null),b(null)},onError:C=>{b(C instanceof Error?C.message:String(C))}}),u=Gl({mutationFn:C=>re.solvernets.updateGeneratorConfig(n,C),onSuccess:()=>{g.invalidateQueries({queryKey:["solvernets","launched",n]})}});if(!n)return h.jsx("main",{"data-testid":"launcher-launched-missing-id",style:Qn,children:h.jsx(ah,{message:"No solverNetId supplied.",onBack:()=>c("/launcher")})});if(a.isLoading)return h.jsx("main",{"data-testid":"launcher-launched-loading",style:Qn,children:h.jsx("p",{style:jS,children:"Loading…"})});if(a.isError||!a.data){const C=a.error instanceof Error?a.error.message:"Unknown error";return h.jsx("main",{"data-testid":"launcher-launched-error",style:Qn,children:h.jsx(ah,{message:`Failed to load SolverNet: ${C}`,onBack:()=>c("/launcher"),onRetry:()=>{a.refetch()}})})}const l=a.data,o=(v=_.data)==null?void 0:v.manifest;return h.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":n,style:Qn,children:[h.jsx(vS,{record:l,manifest:o,onAction:C=>{b(null),m(C)},pending:w.isPending?((y=w.variables)==null?void 0:y.target)??null:null}),h.jsx(Z0,{record:l,onSave:async C=>{await u.mutateAsync(C)}}),h.jsx(_S,{record:l}),h.jsx(cS,{record:l,manifest:o}),_.isError&&h.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:"," ",_.error instanceof Error?_.error.message:"unknown error"]}),h.jsx(lS,{open:p!==null,target:p??"paused",solverNetName:(o==null?void 0:o.name)??"",pending:w.isPending,errorMessage:S??void 0,onCancel:()=>{w.isPending||(m(null),b(null))},onConfirm:()=>{p&&w.mutate({target:p})}})]})}function ah({message:e,onBack:t,onRetry:r}){return h.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:[h.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&h.jsx("button",{type:"button","data-testid":"launcher-launched-error-retry",onClick:r,style:lh,children:"Retry"}),h.jsx("button",{type:"button","data-testid":"launcher-launched-error-back",onClick:t,style:lh,children:"Back to launcher"})]})]})}const Qn={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"960px",margin:"0 auto"},jS={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},lh={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"},rc=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}];function DS(e){const t=rc.find(r=>r.id===e)??null;return t?{canonical:t,label:t.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}const Gn="claude-code-learner";function TS(e){return`${e.contract.id}.${e.contract.version}`}function LS(e,t){return e==null?void 0:e.nets.find(r=>r.intrinsicSolverType===t)}function ch(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-4?`${r.toExponential(3)} ETH`:`${r.toFixed(r<1?6:4)} ETH`}catch{return"—"}}function MS(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function PS({manifestCid:e,navigateTo:t}={}){var E,T,B;const r=ou(),[,i]=_n(),s=t??i,c=ta(),g=e??r.cid,n=be({queryKey:["solvernets","manifest",g],queryFn:()=>re.solvernets.getManifest(g),enabled:!!g,retry:!1}),a=be({queryKey:["solvernets","catalog"],queryFn:()=>re.getSolverNets()}),f=(E=n.data)==null?void 0:E.manifest,_=f?LS(a.data,TS(f)):void 0,p=((T=_==null?void 0:_.compatibleHarnesses[0])==null?void 0:T.name)??Gn,m=rc[0].id,[S,b]=H.useState({roles:[],harness:p,plugins:[],model:m}),[w,u]=H.useState(null),l=(B=_==null?void 0:_.compatibleHarnesses[0])==null?void 0:B.name;l&&S.harness===Gn&&l!==Gn&&!(_!=null&&_.compatibleHarnesses.some(D=>D.name===Gn))&&b({...S,harness:l});const o=Gl({mutationFn:()=>re.operator.join(g,{...(f==null?void 0:f.name)!==void 0?{name:f.name}:{},roles:S.roles,...S.roles.includes("solver")?{harness:S.harness,plugins:S.plugins,model:S.model}:{}}),onSuccess:()=>{c.invalidateQueries({queryKey:["operator","joined"]}),s("/operator#solvernets")},onError:D=>{u(D instanceof Error?D.message:String(D))}});if(!g)return h.jsx("main",{"data-testid":"join-flow-missing-cid",style:Xn,children:h.jsx(uh,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(n.isLoading)return h.jsx("main",{"data-testid":"join-flow-loading",style:Xn,children:h.jsx("p",{style:BS,children:"Loading manifest…"})});if(n.isError||!f){const D=n.error instanceof Error?n.error.message:"Unknown error";return h.jsx("main",{"data-testid":"join-flow-error",style:Xn,children:h.jsx(uh,{message:`Failed to load manifest: ${D}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{n.refetch()}})})}const{openRoles:d}=f,v=D=>{d.includes(D)&&b(P=>{const N=P.roles.includes(D)?P.roles.filter($=>$!==D):d.filter($=>$===D||P.roles.includes($));return{...P,roles:N}})},y=D=>{b(P=>{const F=P.plugins.includes(D);return{...P,plugins:F?P.plugins.filter(N=>N!==D):[...P.plugins,D]}})},C=S.roles.includes("solver"),k=S.roles.includes("evaluator"),x=S.roles.length>0&&!o.isPending;return h.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":g,style:Xn,children:[h.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsxs("span",{"data-testid":"join-flow-title",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:"var(--fg)"},children:["Join ",f.name]}),h.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:f.description})]}),h.jsxs("section",{"data-testid":"join-flow-summary",style:ks,children:[h.jsx("span",{style:Es,children:"Manifest"}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[h.jsx("span",{children:"Contract"}),h.jsxs("span",{style:{color:"var(--fg)"},children:[f.contract.id," · ",f.contract.version]}),h.jsx("span",{children:"Solution price"}),h.jsx("span",{style:{color:"var(--fg)"},children:ch(f.solutionPriceWei)}),h.jsx("span",{children:"Verdict price"}),h.jsx("span",{style:{color:"var(--fg)"},children:ch(f.verdictPriceWei)}),h.jsx("span",{children:"Open roles"}),h.jsx("span",{"data-testid":"join-flow-open-roles",style:{color:"var(--fg)"},children:d.join(", ")||"none"}),h.jsx("span",{children:"Launcher"}),h.jsxs("span",{style:{color:"var(--fg)"},children:[MS(f.launcher.safeAddress)," · agentId"," ",f.launcher.agentId]}),h.jsx("span",{children:"Manifest CID"}),h.jsx("span",{"data-testid":"join-flow-manifest-cid",style:{color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g})]})]}),h.jsxs("section",{style:ks,children:[h.jsx("span",{style:Es,children:"Roles"}),h.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${d.length||1}, 1fr)`,border:"1px solid var(--border)",borderRadius:"var(--radius-2)",overflow:"hidden"},children:d.map((D,P)=>{const F=S.roles.includes(D),N=`join-role-${D}`;return h.jsxs("label",{htmlFor:N,"data-testid":"join-role-option","data-role":D,"data-role-active":F?"true":"false",style:{padding:"12px 16px",display:"flex",flexDirection:"column",gap:"6px",background:F?"var(--bg)":"transparent",color:F?"var(--fg)":"var(--fg-muted)",borderRight:P<d.length-1?"1px solid var(--border)":"none",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[h.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h.jsx("input",{id:N,type:"checkbox",checked:F,onChange:()=>v(D),"aria-label":D==="solver"?"Solver":"Evaluator",style:{accentColor:"var(--accent-sky)",width:"14px",height:"14px"}}),h.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:D==="solver"?"Solver":"Evaluator"})]}),h.jsx("span",{style:{fontSize:"11px",color:F?"var(--fg-muted)":"var(--fg-dim)",paddingLeft:"22px"},children:D==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},D)})})]}),C&&h.jsxs("section",{"data-testid":"join-flow-solver-fields",style:ks,children:[h.jsx("span",{style:Es,children:"Solver configuration"}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("span",{style:Wa,children:"Harness"}),h.jsxs("select",{"aria-label":"Harness","data-testid":"join-harness-select",value:S.harness,onChange:D=>b({...S,harness:D.target.value}),style:dh,children:[((_==null?void 0:_.compatibleHarnesses)??[]).map(D=>h.jsxs("option",{value:D.name,children:[D.name,"@",D.version]},D.name)),(!_||_.compatibleHarnesses.length===0)&&h.jsx("option",{value:S.harness,children:S.harness})]})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[h.jsx("span",{style:Wa,children:"Claude model"}),h.jsxs("select",{"aria-label":"Claude model","data-testid":"join-model-select",value:S.model,onChange:D=>b({...S,model:D.target.value}),style:dh,children:[rc.map(D=>h.jsx("option",{value:D.id,children:D.label},D.id)),(()=>{const D=DS(S.model);return D.isCustom?h.jsx("option",{value:S.model,children:D.label},S.model):null})()]})]})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[h.jsx("span",{style:Wa,children:"Plugins"}),((_==null?void 0:_.compatiblePlugins)??[]).length===0?h.jsx("span",{"data-testid":"join-plugins-empty",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:"No plugins available for this SolverNet"}):((_==null?void 0:_.compatiblePlugins)??[]).map(D=>{const P=S.plugins.includes(D.name),F=`join-plugin-${D.name}`;return h.jsxs("label",{htmlFor:F,"data-testid":"join-plugin-option","data-plugin":D.name,"data-plugin-active":P?"true":"false",style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:[h.jsx("input",{id:F,type:"checkbox","aria-label":`Plugin: ${D.name}`,checked:P,onChange:()=>y(D.name),style:{accentColor:"var(--accent-sky)"}}),h.jsx("span",{style:{fontSize:"14px",color:"var(--fg)",flex:1},children:D.name}),h.jsxs("span",{style:{fontSize:"12px",color:"var(--fg-dim)"},children:[D.source," · ",D.version]})]},D.name)})]})]}),k&&!C&&h.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:ks,children:[h.jsx("span",{style:Es,children:"Evaluator configuration"}),h.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["The evaluator harness is bound to"," ",h.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]})]}),k&&C&&h.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:ks,children:[h.jsx("span",{style:Es,children:"Evaluator binding"}),h.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["Evaluator harness is bound to"," ",h.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]})]}),w&&h.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:w}),h.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[h.jsx("button",{type:"button","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),style:Fo,children:"Cancel"}),h.jsx("button",{type:"button","data-testid":"join-flow-submit",disabled:!x,onClick:()=>{u(null),o.mutate()},style:{...Fo,background:x?"var(--accent-sky)":"transparent",color:x?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${x?"var(--accent-sky)":"var(--border)"}`,cursor:x?"pointer":"not-allowed"},children:o.isPending?"Joining…":"Join SolverNet"})]})]})}function uh({message:e,onBack:t,onRetry:r}){return h.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:[h.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&h.jsx("button",{type:"button","data-testid":"join-flow-retry",onClick:r,style:Fo,children:"Retry"}),h.jsx("button",{type:"button","data-testid":"join-flow-back",onClick:t,style:Fo,children:"Back"})]})]})}const Xn={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"880px",margin:"0 auto"},BS={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},ks={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},Es={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},Wa={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},dh={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"},Fo={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 AS(){const{data:e,isLoading:t}=be({queryKey:["bootstrap"],queryFn:()=>re.getBootstrap(),refetchInterval:1500}),[r,i]=H.useState(!1);if(t||!e||e.mode==="uninitialized"){const g=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return h.jsx(iy,{headline:g})}if(e.mode!=="running")return h.jsx(vy,{});const s=e.chain==="base"?"mainnet":"testnet",c=e.master_address??"";return h.jsxs(nv,{children:[h.jsx(Py,{restartPending:r,onRestart:async()=>{await re.restartDaemon(),i(!1)}}),h.jsx(Ry,{header:h.jsx(Dy,{network:s,rpcHealthy:!0,masterAddress:c}),tabs:h.jsx(Ly,{}),rail:h.jsx(My,{}),children:h.jsxs(ey,{children:[h.jsx(Tt,{path:"/overview",component:Jy}),h.jsx(Tt,{path:"/operator/join/:cid",children:h.jsx(PS,{})}),h.jsx(Tt,{path:"/operator",children:h.jsx(m0,{onRestartPending:()=>i(!0)})}),h.jsx(Tt,{path:"/configuration",children:h.jsx(OS,{})}),h.jsx(Tt,{path:"/launcher/create",children:h.jsx(J0,{})}),h.jsx(Tt,{path:"/launcher/launched/:solverNetId",children:h.jsx(RS,{})}),h.jsx(Tt,{path:"/launcher",children:h.jsx(L0,{})}),h.jsx(Tt,{path:"/leaderboard/:solverNet",children:g=>h.jsx(Gy,{solverNet:g.solverNet})}),h.jsx(Tt,{path:"/leaderboard",children:h.jsx(Xl,{to:"/leaderboard/prediction"})}),h.jsx(Tt,{children:h.jsx(Xl,{to:"/overview"})})]})})]})}function OS(){const e=typeof window>"u"?"":window.location.hash;return h.jsx(Xl,{to:`/operator${e}`})}const IS=new g_({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});ty().finally(()=>{$a.createRoot(document.getElementById("root")).render(h.jsx(Ph.StrictMode,{children:h.jsx(m_,{client:IS,children:h.jsx(AS,{})})}))});
|