@jinn-network/client 0.1.7 → 0.1.8-canary.0a152013
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/README.md +67 -1
- package/dist/adapters/mech/adapter.d.ts +19 -1
- package/dist/adapters/mech/adapter.js +130 -14
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +22 -1
- package/dist/adapters/mech/contracts.js +34 -24
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe.d.ts +1 -1
- package/dist/adapters/mech/safe.js +5 -3
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +6 -1
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/operator-claude.js +8 -0
- package/dist/agent/operator-claude.js.map +1 -1
- package/dist/api/activity-events-endpoint.d.ts +14 -0
- package/dist/api/activity-events-endpoint.js +59 -0
- package/dist/api/activity-events-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +1 -2
- package/dist/api/bootstrap-endpoint.js +42 -24
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +22 -5
- package/dist/api/codex-doctor-endpoint.js +136 -17
- package/dist/api/codex-doctor-endpoint.js.map +1 -1
- package/dist/api/debug-report-endpoint.d.ts +27 -0
- package/dist/api/debug-report-endpoint.js +157 -0
- package/dist/api/debug-report-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +24 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/gather-status.d.ts +33 -0
- package/dist/api/gather-status.js +211 -26
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/hermes-doctor-endpoint.d.ts +15 -7
- package/dist/api/hermes-doctor-endpoint.js +56 -19
- package/dist/api/hermes-doctor-endpoint.js.map +1 -1
- package/dist/api/launcher-status.d.ts +4 -2
- package/dist/api/launcher-status.js +11 -10
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +1 -1
- package/dist/api/launcher-tasks.js +12 -8
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/operator-artifacts-endpoint.js +73 -6
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +7 -1
- package/dist/api/portfolio-v0-build.js +6 -2
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +6 -0
- package/dist/api/prediction-v1-build.js +3 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +40 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +0 -9
- package/dist/api/setup-endpoints.js +11 -153
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +30 -63
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +115 -2
- package/dist/api/status-build.js +47 -11
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-harness-rollup.d.ts +35 -0
- package/dist/api/status-harness-rollup.js +45 -0
- package/dist/api/status-harness-rollup.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +8 -0
- package/dist/api/task-runs-build.js +5 -1
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/live-publisher.js +24 -4
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +1 -1
- package/dist/chain-read-errors.d.ts +12 -0
- package/dist/chain-read-errors.js +26 -1
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.d.ts +33 -0
- package/dist/cli/commands/codedigest-revert-check.js +249 -0
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -0
- package/dist/cli/commands/eval.d.ts +76 -0
- package/dist/cli/commands/eval.js +391 -0
- package/dist/cli/commands/eval.js.map +1 -0
- package/dist/cli/commands/solver-nets.d.ts +1 -0
- package/dist/cli/commands/solver-nets.js +177 -22
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins-block.d.ts +33 -0
- package/dist/cli/commands/solver-plugins-block.js +118 -0
- package/dist/cli/commands/solver-plugins-block.js.map +1 -0
- package/dist/cli/commands/solver-plugins-feedback.d.ts +72 -0
- package/dist/cli/commands/solver-plugins-feedback.js +262 -0
- package/dist/cli/commands/solver-plugins-feedback.js.map +1 -0
- package/dist/cli/commands/solver-plugins-read.d.ts +54 -0
- package/dist/cli/commands/solver-plugins-read.js +259 -0
- package/dist/cli/commands/solver-plugins-read.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +35 -0
- package/dist/cli/commands/solver-plugins.js +399 -2
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/tasks.js +15 -2
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +7 -0
- package/dist/cli/task-native-readiness.js +7 -5
- package/dist/cli/task-native-readiness.js.map +1 -1
- package/dist/config.d.ts +199 -232
- package/dist/config.js +268 -107
- package/dist/config.js.map +1 -1
- package/dist/daemon/ai-units-gate.d.ts +54 -0
- package/dist/daemon/ai-units-gate.js +82 -0
- package/dist/daemon/ai-units-gate.js.map +1 -0
- package/dist/daemon/creator.js +13 -0
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +10 -0
- package/dist/daemon/daemon.js +203 -30
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +7 -0
- package/dist/daemon/eviction-loop.js +16 -0
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/gate-logger.d.ts +9 -0
- package/dist/daemon/gate-logger.js +2 -0
- package/dist/daemon/gate-logger.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.js +22 -4
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/readiness-gate.d.ts +1 -4
- package/dist/daemon/readiness-gate.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +40 -0
- package/dist/daemon/spend-cap-gate.js +46 -0
- package/dist/daemon/spend-cap-gate.js.map +1 -0
- package/dist/dashboard/assets/index-CldYENtT.js +359 -0
- package/dist/dashboard/assets/index-CzKxvMcU.css +32 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.js +411 -2
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +123 -5
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +202 -0
- package/dist/discovery/types.js +40 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +34 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +25 -3
- package/dist/earning/bootstrap.js +69 -15
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/safe-adapter.js +34 -11
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/types.d.ts +6 -6
- package/dist/earning/viem-clients.d.ts +11 -4
- package/dist/earning/viem-clients.js +14 -5
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/identity.d.ts +19 -3
- package/dist/erc8004/identity.js +38 -11
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/eval/eval-harness-run.d.ts +63 -0
- package/dist/eval/eval-harness-run.js +123 -0
- package/dist/eval/eval-harness-run.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +146 -0
- package/dist/eval/orchestrator.js +221 -0
- package/dist/eval/orchestrator.js.map +1 -0
- package/dist/eval/resolve-slate-tasks.d.ts +35 -0
- package/dist/eval/resolve-slate-tasks.js +56 -0
- package/dist/eval/resolve-slate-tasks.js.map +1 -0
- package/dist/eval/slope.d.ts +29 -0
- package/dist/eval/slope.js +46 -0
- package/dist/eval/slope.js.map +1 -0
- package/dist/eval/train-sequence.d.ts +35 -0
- package/dist/eval/train-sequence.js +59 -0
- package/dist/eval/train-sequence.js.map +1 -0
- package/dist/eval/wilson.d.ts +45 -0
- package/dist/eval/wilson.js +48 -0
- package/dist/eval/wilson.js.map +1 -0
- package/dist/events/types.d.ts +2 -2
- package/dist/harnesses/cost-estimates.d.ts +10 -31
- package/dist/harnesses/cost-estimates.js +11 -43
- package/dist/harnesses/cost-estimates.js.map +1 -1
- package/dist/harnesses/engine/canonical-json.js +5 -3
- package/dist/harnesses/engine/canonical-json.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +37 -4
- package/dist/harnesses/engine/engine.js +138 -17
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +21 -4
- package/dist/harnesses/engine/persistence.js +43 -6
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/state.d.ts +9 -0
- package/dist/harnesses/engine/state.js +23 -10
- package/dist/harnesses/engine/state.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +4 -2
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.js +4 -2
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +14 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +16 -2
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/prompt.d.ts +6 -6
- package/dist/harnesses/impls/hermes-agent/prompt.js +6 -6
- package/dist/harnesses/impls/learner/adapters/claude-code.d.ts +17 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +113 -14
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +9 -0
- package/dist/harnesses/impls/learner/adapters/codex-code.js +30 -8
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +24 -0
- package/dist/harnesses/impls/learner/harness.js +33 -4
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +3 -1
- package/dist/harnesses/impls/learner/harvest.js +30 -6
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/learner/restoration-patch.d.ts +2 -2
- package/dist/harnesses/impls/learner/restoration-patch.js +25 -6
- package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +21 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +74 -5
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +103 -32
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +7 -0
- package/dist/harnesses/readiness-registry.js +9 -0
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/learner/revert-decision.d.ts +59 -0
- package/dist/learner/revert-decision.js +53 -0
- package/dist/learner/revert-decision.js.map +1 -0
- package/dist/learner/revert-stats.d.ts +24 -0
- package/dist/learner/revert-stats.js +44 -0
- package/dist/learner/revert-stats.js.map +1 -0
- package/dist/main.js +178 -104
- package/dist/main.js.map +1 -1
- package/dist/mcp/get-codedigest-reward.d.ts +13 -0
- package/dist/mcp/get-codedigest-reward.js +23 -0
- package/dist/mcp/get-codedigest-reward.js.map +1 -0
- package/dist/mcp/server.js +23 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/debug-report-assemble.d.ts +43 -0
- package/dist/observability/debug-report-assemble.js +80 -0
- package/dist/observability/debug-report-assemble.js.map +1 -0
- package/dist/observability/emit-event.d.ts +9 -2
- package/dist/observability/emit-event.js +36 -2
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/file-logger.d.ts +69 -0
- package/dist/observability/file-logger.js +177 -0
- package/dist/observability/file-logger.js.map +1 -0
- package/dist/observability/redact-secrets.d.ts +65 -0
- package/dist/observability/redact-secrets.js +300 -0
- package/dist/observability/redact-secrets.js.map +1 -0
- package/dist/observability/tar.d.ts +30 -0
- package/dist/observability/tar.js +102 -0
- package/dist/observability/tar.js.map +1 -0
- package/dist/plugins/learner/hooks/session-start +18 -1
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +18 -1
- package/dist/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/dist/preflight/pidfile-liveness.d.ts +50 -0
- package/dist/preflight/pidfile-liveness.js +117 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -0
- package/dist/preflight/rpc-network.d.ts +40 -0
- package/dist/preflight/rpc-network.js +67 -1
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/rpc/transport.d.ts +109 -0
- package/dist/rpc/transport.js +220 -0
- package/dist/rpc/transport.js.map +1 -0
- package/dist/scripts/donation-consumption-acceptance.js +7 -28
- package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-pytest-missing.json +16 -0
- package/dist/solver-nets/prediction-operator-ux.d.ts +1 -2
- package/dist/solver-nets/prediction-operator-ux.js +56 -53
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +19 -1
- package/dist/solver-nets/registry.js +37 -24
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +64 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +139 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool.d.ts +9 -2
- package/dist/solver-types/_swe-rebench-v2-pool.js +15 -20
- package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +15 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +19 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +116 -2
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +296 -21
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
- package/dist/solver-types/solver-type.d.ts +8 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +20 -11
- package/dist/solver-types/swe-rebench-v2-auto.js +64 -19
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +8 -2
- package/dist/solver-types/swe-rebench-v2.js +151 -12
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +1 -1
- package/dist/solvernets/daemon-init.js +19 -4
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +4 -0
- package/dist/solvernets/launched-record-dispatcher.js +10 -4
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +11 -0
- package/dist/solvernets/registry-client-erc8004.js.map +1 -1
- package/dist/solvernets/store.d.ts +2 -2
- package/dist/solvernets/store.js +7 -2
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/ai-units-config.d.ts +39 -0
- package/dist/spend/ai-units-config.js +28 -0
- package/dist/spend/ai-units-config.js.map +1 -0
- package/dist/spend/ai-units.d.ts +89 -0
- package/dist/spend/ai-units.js +156 -0
- package/dist/spend/ai-units.js.map +1 -0
- package/dist/spend/cost-surface-status.d.ts +12 -0
- package/dist/spend/cost-surface-status.js +24 -0
- package/dist/spend/cost-surface-status.js.map +1 -0
- package/dist/spend/credential.d.ts +39 -0
- package/dist/spend/credential.js +71 -0
- package/dist/spend/credential.js.map +1 -0
- package/dist/spend/daemon-config.d.ts +13 -0
- package/dist/spend/daemon-config.js +24 -0
- package/dist/spend/daemon-config.js.map +1 -0
- package/dist/spend/pricing.d.ts +16 -0
- package/dist/spend/pricing.js +26 -0
- package/dist/spend/pricing.js.map +1 -0
- package/dist/spend/record.d.ts +13 -0
- package/dist/spend/record.js +36 -0
- package/dist/spend/record.js.map +1 -0
- package/dist/spend/usage.d.ts +27 -0
- package/dist/spend/usage.js +113 -0
- package/dist/spend/usage.js.map +1 -0
- package/dist/store/store.d.ts +144 -0
- package/dist/store/store.js +396 -4
- package/dist/store/store.js.map +1 -1
- package/dist/trajectory/transcript-parsers/codex-session.d.ts +12 -6
- package/dist/trajectory/transcript-parsers/codex-session.js +114 -13
- package/dist/trajectory/transcript-parsers/codex-session.js.map +1 -1
- package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
- package/dist/trajectory/transcript-session-dirs.d.ts +18 -0
- package/dist/trajectory/transcript-session-dirs.js +85 -0
- package/dist/trajectory/transcript-session-dirs.js.map +1 -0
- package/dist/trajectory/transcript-watcher.d.ts +20 -1
- package/dist/trajectory/transcript-watcher.js +108 -32
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +25 -0
- package/dist/tx-retry.js +95 -7
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-apy-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-v0.d.ts +12 -12
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
- package/dist/vendor/@jinn-network/sdk/package.json +4 -0
- package/package.json +21 -12
- package/plugins/learner/hooks/session-start +18 -1
- package/plugins/learner/skills/learn/consolidator-prompt.md +18 -1
- package/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/plugins/swe-rebench-v2-diffmin/README.md +10 -9
- package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +1 -1
- package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +15 -10
- package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +10 -12
- package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +1 -1
- package/plugins/swe-rebench-v2-runtime/.codex-plugin/plugin.json +3 -3
- package/plugins/swe-rebench-v2-runtime/README.md +6 -6
- package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +2 -3
- package/plugins/swe-rebench-v2-runtime/skills/task/SKILL.md +81 -0
- package/dist/dashboard/assets/index-BUlE8F3Y.js +0 -330
- package/dist/dashboard/assets/index-blqc7eqq.css +0 -32
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +0 -29
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +0 -53
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
var Q_=e=>{throw TypeError(e)};var fh=(e,t,r)=>t.has(e)||Q_("Cannot "+r);var z=(e,t,r)=>(fh(e,t,"read from private field"),r?r.call(e):t.get(e)),ye=(e,t,r)=>t.has(e)?Q_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(fh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Te=(e,t,r)=>(fh(e,t,"access private method"),r);var yu=(e,t,r,n)=>({set _(s){ue(e,t,s,r)},get _(){return z(e,t,n)}});function jR(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Eg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mS={exports:{}},vf={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var kR=Symbol.for("react.transitional.element"),RR=Symbol.for("react.fragment");function pS(e,t,r){var n=null;if(r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),"key"in t){r={};for(var s in t)s!=="key"&&(r[s]=t[s])}else r=t;return t=r.ref,{$$typeof:kR,type:e,key:n,ref:t!==void 0?t:null,props:r}}vf.Fragment=RR;vf.jsx=pS;vf.jsxs=pS;mS.exports=vf;var o=mS.exports,gS={exports:{}},ke={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var jg=Symbol.for("react.transitional.element"),NR=Symbol.for("react.portal"),TR=Symbol.for("react.fragment"),AR=Symbol.for("react.strict_mode"),DR=Symbol.for("react.profiler"),OR=Symbol.for("react.consumer"),MR=Symbol.for("react.context"),LR=Symbol.for("react.forward_ref"),PR=Symbol.for("react.suspense"),BR=Symbol.for("react.memo"),vS=Symbol.for("react.lazy"),IR=Symbol.for("react.activity"),J_=Symbol.iterator;function HR(e){return e===null||typeof e!="object"?null:(e=J_&&e[J_]||e["@@iterator"],typeof e=="function"?e:null)}var _S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yS=Object.assign,xS={};function dl(e,t,r){this.props=e,this.context=t,this.refs=xS,this.updater=r||_S}dl.prototype.isReactComponent={};dl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};dl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bS(){}bS.prototype=dl.prototype;function kg(e,t,r){this.props=e,this.context=t,this.refs=xS,this.updater=r||_S}var Rg=kg.prototype=new bS;Rg.constructor=kg;yS(Rg,dl.prototype);Rg.isPureReactComponent=!0;var ey=Array.isArray;function Em(){}var ft={H:null,A:null,T:null,S:null},SS=Object.prototype.hasOwnProperty;function Ng(e,t,r){var n=r.ref;return{$$typeof:jg,type:e,key:t,ref:n!==void 0?n:null,props:r}}function zR(e,t){return Ng(e.type,t,e.props)}function Tg(e){return typeof e=="object"&&e!==null&&e.$$typeof===jg}function FR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ty=/\/+/g;function hh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FR(""+e.key):t.toString(36)}function UR(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Em,Em):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Xa(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case jg:case NR:l=!0;break;case vS:return l=e._init,Xa(l(e._payload),t,r,n,s)}}if(l)return s=s(e),l=n===""?"."+hh(e,0):n,ey(s)?(r="",l!=null&&(r=l.replace(ty,"$&/")+"/"),Xa(s,t,r,"",function(d){return d})):s!=null&&(Tg(s)&&(s=zR(s,r+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(ty,"$&/")+"/")+l)),t.push(s)),1;l=0;var a=n===""?".":n+":";if(ey(e))for(var c=0;c<e.length;c++)n=e[c],i=a+hh(n,c),l+=Xa(n,t,r,i,s);else if(c=HR(e),typeof c=="function")for(e=c.call(e),c=0;!(n=e.next()).done;)n=n.value,i=a+hh(n,c++),l+=Xa(n,t,r,i,s);else if(i==="object"){if(typeof e.then=="function")return Xa(UR(e),t,r,n,s);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function xu(e,t,r){if(e==null)return e;var n=[],s=0;return Xa(e,n,"","",function(i){return t.call(r,i,s++)}),n}function $R(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 ry=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},VR={map:xu,forEach:function(e,t,r){xu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return xu(e,function(){t++}),t},toArray:function(e){return xu(e,function(t){return t})||[]},only:function(e){if(!Tg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Activity=IR;ke.Children=VR;ke.Component=dl;ke.Fragment=TR;ke.Profiler=DR;ke.PureComponent=kg;ke.StrictMode=AR;ke.Suspense=PR;ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ft;ke.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ft.H.useMemoCache(e)}};ke.cache=function(e){return function(){return e.apply(null,arguments)}};ke.cacheSignal=function(){return null};ke.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=yS({},e.props),s=e.key;if(t!=null)for(i in t.key!==void 0&&(s=""+t.key),t)!SS.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(n[i]=t[i]);var i=arguments.length-2;if(i===1)n.children=r;else if(1<i){for(var l=Array(i),a=0;a<i;a++)l[a]=arguments[a+2];n.children=l}return Ng(e.type,s,n)};ke.createContext=function(e){return e={$$typeof:MR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:OR,_context:e},e};ke.createElement=function(e,t,r){var n,s={},i=null;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)SS.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return Ng(e,i,s)};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:LR,render:e}};ke.isValidElement=Tg;ke.lazy=function(e){return{$$typeof:vS,_payload:{_status:-1,_result:e},_init:$R}};ke.memo=function(e,t){return{$$typeof:BR,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=ft.T,r={};ft.T=r;try{var n=e(),s=ft.S;s!==null&&s(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Em,ry)}catch(i){ry(i)}finally{t!==null&&r.types!==null&&(t.types=r.types),ft.T=t}};ke.unstable_useCacheRefresh=function(){return ft.H.useCacheRefresh()};ke.use=function(e){return ft.H.use(e)};ke.useActionState=function(e,t,r){return ft.H.useActionState(e,t,r)};ke.useCallback=function(e,t){return ft.H.useCallback(e,t)};ke.useContext=function(e){return ft.H.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e,t){return ft.H.useDeferredValue(e,t)};ke.useEffect=function(e,t){return ft.H.useEffect(e,t)};ke.useEffectEvent=function(e){return ft.H.useEffectEvent(e)};ke.useId=function(){return ft.H.useId()};ke.useImperativeHandle=function(e,t,r){return ft.H.useImperativeHandle(e,t,r)};ke.useInsertionEffect=function(e,t){return ft.H.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return ft.H.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return ft.H.useMemo(e,t)};ke.useOptimistic=function(e,t){return ft.H.useOptimistic(e,t)};ke.useReducer=function(e,t,r){return ft.H.useReducer(e,t,r)};ke.useRef=function(e){return ft.H.useRef(e)};ke.useState=function(e){return ft.H.useState(e)};ke.useSyncExternalStore=function(e,t,r){return ft.H.useSyncExternalStore(e,t,r)};ke.useTransition=function(){return ft.H.useTransition()};ke.version="19.2.7";gS.exports=ke;var C=gS.exports;const X=Eg(C),_f=jR({__proto__:null,default:X},[C]);var wS={exports:{}},yf={},CS={exports:{}},ES={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(P,U){var N=P.length;P.push(U);e:for(;0<N;){var D=N-1>>>1,L=P[D];if(0<s(L,U))P[D]=U,P[N]=L,N=D;else break e}}function r(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var U=P[0],N=P.pop();if(N!==U){P[0]=N;e:for(var D=0,L=P.length,I=L>>>1;D<I;){var Q=2*(D+1)-1,q=P[Q],J=Q+1,Z=P[J];if(0>s(q,N))J<L&&0>s(Z,q)?(P[D]=Z,P[J]=N,D=J):(P[D]=q,P[Q]=N,D=Q);else if(J<L&&0>s(Z,N))P[D]=Z,P[J]=N,D=J;else break e}}return U}function s(P,U){var N=P.sortIndex-U.sortIndex;return N!==0?N:P.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],d=[],p=1,u=null,g=3,_=!1,x=!1,b=!1,h=!1,f=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function y(P){for(var U=r(d);U!==null;){if(U.callback===null)n(d);else if(U.startTime<=P)n(d),U.sortIndex=U.expirationTime,t(c,U);else break;U=r(d)}}function S(P){if(b=!1,y(P),!x)if(r(c)!==null)x=!0,E||(E=!0,T());else{var U=r(d);U!==null&&$(S,U.startTime-P)}}var E=!1,k=-1,w=5,j=-1;function R(){return h?!0:!(e.unstable_now()-j<w)}function M(){if(h=!1,E){var P=e.unstable_now();j=P;var U=!0;try{e:{x=!1,b&&(b=!1,m(k),k=-1),_=!0;var N=g;try{t:{for(y(P),u=r(c);u!==null&&!(u.expirationTime>P&&R());){var D=u.callback;if(typeof D=="function"){u.callback=null,g=u.priorityLevel;var L=D(u.expirationTime<=P);if(P=e.unstable_now(),typeof L=="function"){u.callback=L,y(P),U=!0;break t}u===r(c)&&n(c),y(P)}else n(c);u=r(c)}if(u!==null)U=!0;else{var I=r(d);I!==null&&$(S,I.startTime-P),U=!1}}break e}finally{u=null,g=N,_=!1}U=void 0}}finally{U?T():E=!1}}}var T;if(typeof v=="function")T=function(){v(M)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,F=O.port2;O.port1.onmessage=M,T=function(){F.postMessage(null)}}else T=function(){f(M,0)};function $(P,U){k=f(function(){P(e.unstable_now())},U)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(P){switch(g){case 1:case 2:case 3:var U=3;break;default:U=g}var N=g;g=U;try{return P()}finally{g=N}},e.unstable_requestPaint=function(){h=!0},e.unstable_runWithPriority=function(P,U){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var N=g;g=P;try{return U()}finally{g=N}},e.unstable_scheduleCallback=function(P,U,N){var D=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?D+N:D):N=D,P){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=N+L,P={id:p++,callback:U,priorityLevel:P,startTime:N,expirationTime:L,sortIndex:-1},N>D?(P.sortIndex=N,t(d,P),r(c)===null&&P===r(d)&&(b?(m(k),k=-1):b=!0,$(S,N-D))):(P.sortIndex=L,t(c,P),x||_||(x=!0,E||(E=!0,T()))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var U=g;return function(){var N=g;g=U;try{return P.apply(this,arguments)}finally{g=N}}}})(ES);CS.exports=ES;var qR=CS.exports,jS={exports:{}},fr={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var WR=C;function kS(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;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."}function Hs(){}var dr={d:{f:Hs,r:function(){throw Error(kS(522))},D:Hs,C:Hs,L:Hs,m:Hs,X:Hs,S:Hs,M:Hs},p:0,findDOMNode:null},GR=Symbol.for("react.portal");function KR(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:GR,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}var Jl=WR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function xf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dr;fr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(kS(299));return KR(e,t,null,r)};fr.flushSync=function(e){var t=Jl.T,r=dr.p;try{if(Jl.T=null,dr.p=2,e)return e()}finally{Jl.T=t,dr.p=r,dr.d.f()}};fr.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,dr.d.C(e,t))};fr.prefetchDNS=function(e){typeof e=="string"&&dr.d.D(e)};fr.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,n=xf(r,t.crossOrigin),s=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?dr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:s,fetchPriority:i}):r==="script"&&dr.d.X(e,{crossOrigin:n,integrity:s,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fr.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=xf(t.as,t.crossOrigin);dr.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&dr.d.M(e)};fr.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,n=xf(r,t.crossOrigin);dr.d.L(e,r,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};fr.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=xf(t.as,t.crossOrigin);dr.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else dr.d.m(e)};fr.requestFormReset=function(e){dr.d.r(e)};fr.unstable_batchedUpdates=function(e,t){return e(t)};fr.useFormState=function(e,t,r){return Jl.H.useFormState(e,t,r)};fr.useFormStatus=function(){return Jl.H.useHostTransitionStatus()};fr.version="19.2.7";function RS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RS)}catch(e){console.error(e)}}RS(),jS.exports=fr;var bf=jS.exports;const NS=Eg(bf);/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Bt=qR,TS=C,YR=bf;function ee(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;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."}function AS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qc(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 DS(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 OS(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ny(e){if(qc(e)!==e)throw Error(ee(188))}function ZR(e){var t=e.alternate;if(!t){if(t=qc(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return ny(s),e;if(i===n)return ny(s),t;i=i.sibling}throw Error(ee(188))}if(r.return!==n.return)r=s,n=i;else{for(var l=!1,a=s.child;a;){if(a===r){l=!0,r=s,n=i;break}if(a===n){l=!0,n=s,r=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===r){l=!0,r=i,n=s;break}if(a===n){l=!0,n=i,r=s;break}a=a.sibling}if(!l)throw Error(ee(189))}}if(r.alternate!==n)throw Error(ee(190))}if(r.tag!==3)throw Error(ee(188));return r.stateNode.current===r?e:t}function MS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=MS(e),t!==null)return t;e=e.sibling}return null}var ht=Object.assign,XR=Symbol.for("react.element"),bu=Symbol.for("react.transitional.element"),Vl=Symbol.for("react.portal"),no=Symbol.for("react.fragment"),LS=Symbol.for("react.strict_mode"),jm=Symbol.for("react.profiler"),PS=Symbol.for("react.consumer"),gs=Symbol.for("react.context"),Ag=Symbol.for("react.forward_ref"),km=Symbol.for("react.suspense"),Rm=Symbol.for("react.suspense_list"),Dg=Symbol.for("react.memo"),Vs=Symbol.for("react.lazy"),Nm=Symbol.for("react.activity"),QR=Symbol.for("react.memo_cache_sentinel"),sy=Symbol.iterator;function Rl(e){return e===null||typeof e!="object"?null:(e=sy&&e[sy]||e["@@iterator"],typeof e=="function"?e:null)}var JR=Symbol.for("react.client.reference");function Tm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===JR?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case no:return"Fragment";case jm:return"Profiler";case LS:return"StrictMode";case km:return"Suspense";case Rm:return"SuspenseList";case Nm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Vl:return"Portal";case gs:return e.displayName||"Context";case PS:return(e._context.displayName||"Context")+".Consumer";case Ag:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dg:return t=e.displayName||null,t!==null?t:Tm(e.type)||"Memo";case Vs:t=e._payload,e=e._init;try{return Tm(e(t))}catch{}}return null}var ql=Array.isArray,we=TS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ve=YR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fa={pending:!1,data:null,method:null,action:null},Am=[],so=-1;function Qn(e){return{current:e}}function Vt(e){0>so||(e.current=Am[so],Am[so]=null,so--)}function ot(e,t){so++,Am[so]=e.current,e.current=t}var Kn=Qn(null),gc=Qn(null),pi=Qn(null),gd=Qn(null);function vd(e,t){switch(ot(pi,t),ot(gc,e),ot(Kn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ux(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ux(t),e=rC(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Vt(Kn),ot(Kn,e)}function Vo(){Vt(Kn),Vt(gc),Vt(pi)}function Dm(e){e.memoizedState!==null&&ot(gd,e);var t=Kn.current,r=rC(t,e.type);t!==r&&(ot(gc,e),ot(Kn,r))}function _d(e){gc.current===e&&(Vt(Kn),Vt(gc)),gd.current===e&&(Vt(gd),kc._currentValue=fa)}var mh,iy;function Zi(e){if(mh===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);mh=t&&t[1]||"",iy=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+mh+e+iy}var ph=!1;function gh(e,t){if(!e||ph)return"";ph=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(_){var g=_}Reflect.construct(e,[],u)}else{try{u.call()}catch(_){g=_}e.call(u.prototype)}}else{try{throw Error()}catch(_){g=_}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(_){if(_&&g&&typeof _.stack=="string")return[_.stack,g.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),l=i[0],a=i[1];if(l&&a){var c=l.split(`
|
|
44
|
+
`),d=a.split(`
|
|
45
|
+
`);for(s=n=0;n<c.length&&!c[n].includes("DetermineComponentFrameRoot");)n++;for(;s<d.length&&!d[s].includes("DetermineComponentFrameRoot");)s++;if(n===c.length||s===d.length)for(n=c.length-1,s=d.length-1;1<=n&&0<=s&&c[n]!==d[s];)s--;for(;1<=n&&0<=s;n--,s--)if(c[n]!==d[s]){if(n!==1||s!==1)do if(n--,s--,0>s||c[n]!==d[s]){var p=`
|
|
46
|
+
`+c[n].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),p}while(1<=n&&0<=s);break}}}finally{ph=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Zi(r):""}function eN(e,t){switch(e.tag){case 26:case 27:case 5:return Zi(e.type);case 16:return Zi("Lazy");case 13:return e.child!==t&&t!==null?Zi("Suspense Fallback"):Zi("Suspense");case 19:return Zi("SuspenseList");case 0:case 15:return gh(e.type,!1);case 11:return gh(e.type.render,!1);case 1:return gh(e.type,!0);case 31:return Zi("Activity");default:return""}}function ay(e){try{var t="",r=null;do t+=eN(e,r),r=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var Om=Object.prototype.hasOwnProperty,Og=Bt.unstable_scheduleCallback,vh=Bt.unstable_cancelCallback,tN=Bt.unstable_shouldYield,rN=Bt.unstable_requestPaint,Hr=Bt.unstable_now,nN=Bt.unstable_getCurrentPriorityLevel,BS=Bt.unstable_ImmediatePriority,IS=Bt.unstable_UserBlockingPriority,yd=Bt.unstable_NormalPriority,sN=Bt.unstable_LowPriority,HS=Bt.unstable_IdlePriority,iN=Bt.log,aN=Bt.unstable_setDisableYieldValue,Wc=null,zr=null;function li(e){if(typeof iN=="function"&&aN(e),zr&&typeof zr.setStrictMode=="function")try{zr.setStrictMode(Wc,e)}catch{}}var Fr=Math.clz32?Math.clz32:cN,oN=Math.log,lN=Math.LN2;function cN(e){return e>>>=0,e===0?32:31-(oN(e)/lN|0)|0}var Su=256,wu=262144,Cu=4194304;function Xi(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Sf(e,t,r){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var a=n&134217727;return a!==0?(n=a&~i,n!==0?s=Xi(n):(l&=a,l!==0?s=Xi(l):r||(r=a&~e,r!==0&&(s=Xi(r))))):(a=n&~i,a!==0?s=Xi(a):l!==0?s=Xi(l):r||(r=n&~e,r!==0&&(s=Xi(r)))),s===0?0:t!==0&&t!==s&&!(t&i)&&(i=s&-s,r=t&-t,i>=r||i===32&&(r&4194048)!==0)?t:s}function Gc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function uN(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zS(){var e=Cu;return Cu<<=1,!(Cu&62914560)&&(Cu=4194304),e}function _h(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Kc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dN(e,t,r,n,s,i){var l=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var a=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(r=l&~r;0<r;){var p=31-Fr(r),u=1<<p;a[p]=0,c[p]=-1;var g=d[p];if(g!==null)for(d[p]=null,p=0;p<g.length;p++){var _=g[p];_!==null&&(_.lane&=-536870913)}r&=~u}n!==0&&FS(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(l&~t))}function FS(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Fr(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|r&261930}function US(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Fr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}function $S(e,t){var r=t&-t;return r=r&42?1:Mg(r),r&(e.suspendedLanes|t)?0:r}function Mg(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Lg(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function VS(){var e=Ve.p;return e!==0?e:(e=window.event,e===void 0?32:hC(e.type))}function oy(e,t){var r=Ve.p;try{return Ve.p=e,t()}finally{Ve.p=r}}var Bi=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Bi,jr="__reactProps$"+Bi,fl="__reactContainer$"+Bi,Mm="__reactEvents$"+Bi,fN="__reactListeners$"+Bi,hN="__reactHandles$"+Bi,ly="__reactResources$"+Bi,Yc="__reactMarker$"+Bi;function Pg(e){delete e[Yt],delete e[jr],delete e[Mm],delete e[fN],delete e[hN]}function io(e){var t=e[Yt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[fl]||r[Yt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=px(e);e!==null;){if(r=e[Yt])return r;e=px(e)}return t}e=r,r=e.parentNode}return null}function hl(e){if(e=e[Yt]||e[fl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Wl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ee(33))}function vo(e){var t=e[ly];return t||(t=e[ly]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $t(e){e[Yc]=!0}var qS=new Set,WS={};function ja(e,t){qo(e,t),qo(e+"Capture",t)}function qo(e,t){for(WS[e]=t,e=0;e<t.length;e++)qS.add(t[e])}var mN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cy={},uy={};function pN(e){return Om.call(uy,e)?!0:Om.call(cy,e)?!1:mN.test(e)?uy[e]=!0:(cy[e]=!0,!1)}function Xu(e,t,r){if(pN(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Eu(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function ns(e,t,r,n){if(n===null)e.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+n)}}function tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function GS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gN(e,t,r){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lm(e){if(!e._valueTracker){var t=GS(e)?"checked":"value";e._valueTracker=gN(e,t,""+e[t])}}function KS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=GS(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function xd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var vN=/[\n"\\]/g;function sn(e){return e.replace(vN,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Pm(e,t,r,n,s,i,l,a){e.name="",l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.type=l:e.removeAttribute("type"),t!=null?l==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tn(t)):e.value!==""+tn(t)&&(e.value=""+tn(t)):l!=="submit"&&l!=="reset"||e.removeAttribute("value"),t!=null?Bm(e,l,tn(t)):r!=null?Bm(e,l,tn(r)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+tn(a):e.removeAttribute("name")}function YS(e,t,r,n,s,i,l,a){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||r!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Lm(e);return}r=r!=null?""+tn(r):"",t=t!=null?""+tn(t):r,a||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=a?e.checked:!!n,e.defaultChecked=!!n,l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.name=l),Lm(e)}function Bm(e,t,r){t==="number"&&xd(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function _o(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+tn(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function ZS(e,t,r){if(t!=null&&(t=""+tn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+tn(r):""}function XS(e,t,r,n){if(t==null){if(n!=null){if(r!=null)throw Error(ee(92));if(ql(n)){if(1<n.length)throw Error(ee(93));n=n[0]}r=n}r==null&&(r=""),t=r}r=tn(t),e.defaultValue=r,n=e.textContent,n===r&&n!==""&&n!==null&&(e.value=n),Lm(e)}function Wo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var _N=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dy(e,t,r){var n=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,r):typeof r!="number"||r===0||_N.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function QS(e,t,r){if(t!=null&&typeof t!="object")throw Error(ee(62));if(e=e.style,r!=null){for(var n in r)!r.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&r[s]!==n&&dy(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&dy(e,i,t[i])}function Bg(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qu(e){return xN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function vs(){}var Im=null;function Ig(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ao=null,yo=null;function fy(e){var t=hl(e);if(t&&(e=t.stateNode)){var r=e[jr]||null;e:switch(e=t.stateNode,t.type){case"input":if(Pm(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+sn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=n[jr]||null;if(!s)throw Error(ee(90));Pm(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<r.length;t++)n=r[t],n.form===e.form&&KS(n)}break e;case"textarea":ZS(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&_o(e,!!r.multiple,t,!1)}}}var yh=!1;function JS(e,t,r){if(yh)return e(t,r);yh=!0;try{var n=e(t);return n}finally{if(yh=!1,(ao!==null||yo!==null)&&(Mf(),ao&&(t=ao,e=yo,yo=ao=null,fy(t),e)))for(t=0;t<e.length;t++)fy(e[t])}}function vc(e,t){var r=e.stateNode;if(r===null)return null;var n=r[jr]||null;if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ee(231,t,typeof r));return r}var Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hm=!1;if(Cs)try{var Nl={};Object.defineProperty(Nl,"passive",{get:function(){Hm=!0}}),window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{Hm=!1}var ci=null,Hg=null,Ju=null;function e1(){if(Ju)return Ju;var e,t=Hg,r=t.length,n,s="value"in ci?ci.value:ci.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[i-n];n++);return Ju=s.slice(e,1<n?1-n:void 0)}function ed(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 ju(){return!0}function hy(){return!1}function kr(e){function t(r,n,s,i,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ju:hy,this.isPropagationStopped=hy,this}return ht(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=ju)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ju)},persist:function(){},isPersistent:ju}),t}var ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wf=kr(ka),Zc=ht({},ka,{view:0,detail:0}),bN=kr(Zc),xh,bh,Tl,Cf=ht({},Zc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zg,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!==Tl&&(Tl&&e.type==="mousemove"?(xh=e.screenX-Tl.screenX,bh=e.screenY-Tl.screenY):bh=xh=0,Tl=e),xh)},movementY:function(e){return"movementY"in e?e.movementY:bh}}),my=kr(Cf),SN=ht({},Cf,{dataTransfer:0}),wN=kr(SN),CN=ht({},Zc,{relatedTarget:0}),Sh=kr(CN),EN=ht({},ka,{animationName:0,elapsedTime:0,pseudoElement:0}),jN=kr(EN),kN=ht({},ka,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),RN=kr(kN),NN=ht({},ka,{data:0}),py=kr(NN),TN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AN={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"},DN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ON(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=DN[e])?!!t[e]:!1}function zg(){return ON}var MN=ht({},Zc,{key:function(e){if(e.key){var t=TN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ed(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?AN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zg,charCode:function(e){return e.type==="keypress"?ed(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ed(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),LN=kr(MN),PN=ht({},Cf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gy=kr(PN),BN=ht({},Zc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zg}),IN=kr(BN),HN=ht({},ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),zN=kr(HN),FN=ht({},Cf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),UN=kr(FN),$N=ht({},ka,{newState:0,oldState:0}),VN=kr($N),qN=[9,13,27,32],Fg=Cs&&"CompositionEvent"in window,ec=null;Cs&&"documentMode"in document&&(ec=document.documentMode);var WN=Cs&&"TextEvent"in window&&!ec,t1=Cs&&(!Fg||ec&&8<ec&&11>=ec),vy=" ",_y=!1;function r1(e,t){switch(e){case"keyup":return qN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function n1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oo=!1;function GN(e,t){switch(e){case"compositionend":return n1(t);case"keypress":return t.which!==32?null:(_y=!0,vy);case"textInput":return e=t.data,e===vy&&_y?null:e;default:return null}}function KN(e,t){if(oo)return e==="compositionend"||!Fg&&r1(e,t)?(e=e1(),Ju=Hg=ci=null,oo=!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 t1&&t.locale!=="ko"?null:t.data;default:return null}}var YN={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 yy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!YN[e.type]:t==="textarea"}function s1(e,t,r,n){ao?yo?yo.push(n):yo=[n]:ao=n,t=Id(t,"onChange"),0<t.length&&(r=new wf("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var tc=null,_c=null;function ZN(e){Jw(e,0)}function Ef(e){var t=Wl(e);if(KS(t))return e}function xy(e,t){if(e==="change")return t}var i1=!1;if(Cs){var wh;if(Cs){var Ch="oninput"in document;if(!Ch){var by=document.createElement("div");by.setAttribute("oninput","return;"),Ch=typeof by.oninput=="function"}wh=Ch}else wh=!1;i1=wh&&(!document.documentMode||9<document.documentMode)}function Sy(){tc&&(tc.detachEvent("onpropertychange",a1),_c=tc=null)}function a1(e){if(e.propertyName==="value"&&Ef(_c)){var t=[];s1(t,_c,e,Ig(e)),JS(ZN,t)}}function XN(e,t,r){e==="focusin"?(Sy(),tc=t,_c=r,tc.attachEvent("onpropertychange",a1)):e==="focusout"&&Sy()}function QN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ef(_c)}function JN(e,t){if(e==="click")return Ef(t)}function eT(e,t){if(e==="input"||e==="change")return Ef(t)}function tT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qr=typeof Object.is=="function"?Object.is:tT;function yc(e,t){if(qr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Om.call(t,s)||!qr(e[s],t[s]))return!1}return!0}function wy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cy(e,t){var r=wy(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=wy(r)}}function o1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?o1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xd(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=xd(e.document)}return t}function Ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var rT=Cs&&"documentMode"in document&&11>=document.documentMode,lo=null,zm=null,rc=null,Fm=!1;function Ey(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Fm||lo==null||lo!==xd(n)||(n=lo,"selectionStart"in n&&Ug(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),rc&&yc(rc,n)||(rc=n,n=Id(zm,"onSelect"),0<n.length&&(t=new wf("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=lo)))}function Vi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var co={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Eh={},c1={};Cs&&(c1=document.createElement("div").style,"AnimationEvent"in window||(delete co.animationend.animation,delete co.animationiteration.animation,delete co.animationstart.animation),"TransitionEvent"in window||delete co.transitionend.transition);function Ra(e){if(Eh[e])return Eh[e];if(!co[e])return e;var t=co[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in c1)return Eh[e]=t[r];return e}var u1=Ra("animationend"),d1=Ra("animationiteration"),f1=Ra("animationstart"),nT=Ra("transitionrun"),sT=Ra("transitionstart"),iT=Ra("transitioncancel"),h1=Ra("transitionend"),m1=new Map,Um="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Um.push("scrollEnd");function Mn(e,t){m1.set(e,t),ja(t,[e])}var bd=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},en=[],uo=0,$g=0;function jf(){for(var e=uo,t=$g=uo=0;t<e;){var r=en[t];en[t++]=null;var n=en[t];en[t++]=null;var s=en[t];en[t++]=null;var i=en[t];if(en[t++]=null,n!==null&&s!==null){var l=n.pending;l===null?s.next=s:(s.next=l.next,l.next=s),n.pending=s}i!==0&&p1(r,s,i)}}function kf(e,t,r,n){en[uo++]=e,en[uo++]=t,en[uo++]=r,en[uo++]=n,$g|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Vg(e,t,r,n){return kf(e,t,r,n),Sd(e)}function Na(e,t){return kf(e,null,null,t),Sd(e)}function p1(e,t,r){e.lanes|=r;var n=e.alternate;n!==null&&(n.lanes|=r);for(var s=!1,i=e.return;i!==null;)i.childLanes|=r,n=i.alternate,n!==null&&(n.childLanes|=r),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-Fr(r),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=r|536870912),i):null}function Sd(e){if(50<dc)throw dc=0,cp=null,Error(ee(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fo={};function aT(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(e,t,r,n){return new aT(e,t,r,n)}function qg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ys(e,t){var r=e.alternate;return r===null?(r=Br(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&65011712,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.refCleanup=e.refCleanup,r}function g1(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function td(e,t,r,n,s,i){var l=0;if(n=e,typeof e=="function")qg(e)&&(l=1);else if(typeof e=="string")l=dA(e,r,Kn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Nm:return e=Br(31,r,t,s),e.elementType=Nm,e.lanes=i,e;case no:return ha(r.children,s,i,t);case LS:l=8,s|=24;break;case jm:return e=Br(12,r,t,s|2),e.elementType=jm,e.lanes=i,e;case km:return e=Br(13,r,t,s),e.elementType=km,e.lanes=i,e;case Rm:return e=Br(19,r,t,s),e.elementType=Rm,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gs:l=10;break e;case PS:l=9;break e;case Ag:l=11;break e;case Dg:l=14;break e;case Vs:l=16,n=null;break e}l=29,r=Error(ee(130,e===null?"null":typeof e,"")),n=null}return t=Br(l,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function ha(e,t,r,n){return e=Br(7,e,n,t),e.lanes=r,e}function jh(e,t,r){return e=Br(6,e,null,t),e.lanes=r,e}function v1(e){var t=Br(18,null,null,0);return t.stateNode=e,t}function kh(e,t,r){return t=Br(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jy=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var r=jy.get(e);return r!==void 0?r:(t={value:e,source:t,stack:ay(t)},jy.set(e,t),t)}return{value:e,source:t,stack:ay(t)}}var ho=[],mo=0,wd=null,xc=0,rn=[],nn=0,Ni=null,Vn=1,qn="";function us(e,t){ho[mo++]=xc,ho[mo++]=wd,wd=e,xc=t}function _1(e,t,r){rn[nn++]=Vn,rn[nn++]=qn,rn[nn++]=Ni,Ni=e;var n=Vn;e=qn;var s=32-Fr(n)-1;n&=~(1<<s),r+=1;var i=32-Fr(t)+s;if(30<i){var l=s-s%5;i=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Vn=1<<32-Fr(t)+s|r<<s|n,qn=i+e}else Vn=1<<i|r<<s|n,qn=e}function Wg(e){e.return!==null&&(us(e,1),_1(e,1,0))}function Gg(e){for(;e===wd;)wd=ho[--mo],ho[mo]=null,xc=ho[--mo],ho[mo]=null;for(;e===Ni;)Ni=rn[--nn],rn[nn]=null,qn=rn[--nn],rn[nn]=null,Vn=rn[--nn],rn[nn]=null}function y1(e,t){rn[nn++]=Vn,rn[nn++]=qn,rn[nn++]=Ni,Vn=t.id,qn=t.overflow,Ni=e}var Zt=null,dt=null,ze=!1,gi=null,on=!1,$m=Error(ee(519));function Ti(e){var t=Error(ee(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bc(an(t,e)),$m}function ky(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[Yt]=e,t[jr]=n,r){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(r=0;r<Ec.length;r++)Pe(Ec[r],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),YS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),XS(t,n.value,n.defaultValue,n.children)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||n.suppressHydrationWarning===!0||tC(t.textContent,r)?(n.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),n.onScroll!=null&&Pe("scroll",t),n.onScrollEnd!=null&&Pe("scrollend",t),n.onClick!=null&&(t.onclick=vs),t=!0):t=!1,t||Ti(e,!0)}function Ry(e){for(Zt=e.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:on=!1;return;case 27:case 3:on=!0;return;default:Zt=Zt.return}}function Ha(e){if(e!==Zt)return!1;if(!ze)return Ry(e),ze=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||mp(e.type,e.memoizedProps)),r=!r),r&&dt&&Ti(e),Ry(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));dt=mx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));dt=mx(e)}else t===27?(t=dt,Ii(e.type)?(e=_p,_p=null,dt=e):dt=t):dt=Zt?un(e.stateNode.nextSibling):null;return!0}function va(){dt=Zt=null,ze=!1}function Rh(){var e=gi;return e!==null&&(br===null?br=e:br.push.apply(br,e),gi=null),e}function bc(e){gi===null?gi=[e]:gi.push(e)}var Vm=Qn(null),Ta=null,_s=null;function Ys(e,t,r){ot(Vm,t._currentValue),t._currentValue=r}function xs(e){e._currentValue=Vm.current,Vt(Vm)}function qm(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Wm(e,t,r,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var l=s.child;i=i.firstContext;e:for(;i!==null;){var a=i;i=s;for(var c=0;c<t.length;c++)if(a.context===t[c]){i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),qm(i.return,r,e),n||(l=null);break e}i=a.next}}else if(s.tag===18){if(l=s.return,l===null)throw Error(ee(341));l.lanes|=r,i=l.alternate,i!==null&&(i.lanes|=r),qm(l,r,e),l=null}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===e){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}}function ml(e,t,r,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if(s.flags&524288)i=!0;else if(s.flags&262144)break}if(s.tag===10){var l=s.alternate;if(l===null)throw Error(ee(387));if(l=l.memoizedProps,l!==null){var a=s.type;qr(s.pendingProps.value,l.value)||(e!==null?e.push(a):e=[a])}}else if(s===gd.current){if(l=s.alternate,l===null)throw Error(ee(387));l.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(kc):e=[kc])}s=s.return}e!==null&&Wm(t,e,r,n),t.flags|=262144}function Cd(e){for(e=e.firstContext;e!==null;){if(!qr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _a(e){Ta=e,_s=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xt(e){return x1(Ta,e)}function ku(e,t){return Ta===null&&_a(e),x1(e,t)}function x1(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},_s===null){if(e===null)throw Error(ee(308));_s=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _s=_s.next=t;return r}var oT=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},lT=Bt.unstable_scheduleCallback,cT=Bt.unstable_NormalPriority,Dt={$$typeof:gs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kg(){return{controller:new oT,data:new Map,refCount:0}}function Xc(e){e.refCount--,e.refCount===0&&lT(cT,function(){e.controller.abort()})}var nc=null,Gm=0,Go=0,xo=null;function uT(e,t){if(nc===null){var r=nc=[];Gm=0,Go=yv(),xo={status:"pending",value:void 0,then:function(n){r.push(n)}}}return Gm++,t.then(Ny,Ny),t}function Ny(){if(--Gm===0&&nc!==null){xo!==null&&(xo.status="fulfilled");var e=nc;nc=null,Go=0,xo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dT(e,t){var r=[],n={status:"pending",value:null,reason:null,then:function(s){r.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<r.length;s++)(0,r[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<r.length;s++)(0,r[s])(void 0)}),n}var Ty=we.S;we.S=function(e,t){Mw=Hr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&uT(e,t),Ty!==null&&Ty(e,t)};var ma=Qn(null);function Yg(){var e=ma.current;return e!==null?e:it.pooledCache}function rd(e,t){t===null?ot(ma,ma.current):ot(ma,t.pool)}function b1(){var e=Yg();return e===null?null:{parent:Dt._currentValue,pool:e}}var pl=Error(ee(460)),Zg=Error(ee(474)),Rf=Error(ee(542)),Ed={then:function(){}};function Ay(e){return e=e.status,e==="fulfilled"||e==="rejected"}function S1(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(vs,vs),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oy(e),e;default:if(typeof t.status=="string")t.then(vs,vs);else{if(e=it,e!==null&&100<e.shellSuspendCounter)throw Error(ee(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oy(e),e}throw pa=t,pl}}function Qi(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(pa=r,pl):r}}var pa=null;function Dy(){if(pa===null)throw Error(ee(459));var e=pa;return pa=null,e}function Oy(e){if(e===pl||e===Rf)throw Error(ee(483))}var bo=null,Sc=0;function Ru(e){var t=Sc;return Sc+=1,bo===null&&(bo=[]),S1(bo,e,t)}function Al(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Nu(e,t){throw t.$$typeof===XR?Error(ee(525)):(e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function w1(e){function t(f,m){if(e){var v=f.deletions;v===null?(f.deletions=[m],f.flags|=16):v.push(m)}}function r(f,m){if(!e)return null;for(;m!==null;)t(f,m),m=m.sibling;return null}function n(f){for(var m=new Map;f!==null;)f.key!==null?m.set(f.key,f):m.set(f.index,f),f=f.sibling;return m}function s(f,m){return f=ys(f,m),f.index=0,f.sibling=null,f}function i(f,m,v){return f.index=v,e?(v=f.alternate,v!==null?(v=v.index,v<m?(f.flags|=67108866,m):v):(f.flags|=67108866,m)):(f.flags|=1048576,m)}function l(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function a(f,m,v,y){return m===null||m.tag!==6?(m=jh(v,f.mode,y),m.return=f,m):(m=s(m,v),m.return=f,m)}function c(f,m,v,y){var S=v.type;return S===no?p(f,m,v.props.children,y,v.key):m!==null&&(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Vs&&Qi(S)===m.type)?(m=s(m,v.props),Al(m,v),m.return=f,m):(m=td(v.type,v.key,v.props,null,f.mode,y),Al(m,v),m.return=f,m)}function d(f,m,v,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=kh(v,f.mode,y),m.return=f,m):(m=s(m,v.children||[]),m.return=f,m)}function p(f,m,v,y,S){return m===null||m.tag!==7?(m=ha(v,f.mode,y,S),m.return=f,m):(m=s(m,v),m.return=f,m)}function u(f,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=jh(""+m,f.mode,v),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case bu:return v=td(m.type,m.key,m.props,null,f.mode,v),Al(v,m),v.return=f,v;case Vl:return m=kh(m,f.mode,v),m.return=f,m;case Vs:return m=Qi(m),u(f,m,v)}if(ql(m)||Rl(m))return m=ha(m,f.mode,v,null),m.return=f,m;if(typeof m.then=="function")return u(f,Ru(m),v);if(m.$$typeof===gs)return u(f,ku(f,m),v);Nu(f,m)}return null}function g(f,m,v,y){var S=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return S!==null?null:a(f,m,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bu:return v.key===S?c(f,m,v,y):null;case Vl:return v.key===S?d(f,m,v,y):null;case Vs:return v=Qi(v),g(f,m,v,y)}if(ql(v)||Rl(v))return S!==null?null:p(f,m,v,y,null);if(typeof v.then=="function")return g(f,m,Ru(v),y);if(v.$$typeof===gs)return g(f,m,ku(f,v),y);Nu(f,v)}return null}function _(f,m,v,y,S){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,a(m,f,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case bu:return f=f.get(y.key===null?v:y.key)||null,c(m,f,y,S);case Vl:return f=f.get(y.key===null?v:y.key)||null,d(m,f,y,S);case Vs:return y=Qi(y),_(f,m,v,y,S)}if(ql(y)||Rl(y))return f=f.get(v)||null,p(m,f,y,S,null);if(typeof y.then=="function")return _(f,m,v,Ru(y),S);if(y.$$typeof===gs)return _(f,m,v,ku(m,y),S);Nu(m,y)}return null}function x(f,m,v,y){for(var S=null,E=null,k=m,w=m=0,j=null;k!==null&&w<v.length;w++){k.index>w?(j=k,k=null):j=k.sibling;var R=g(f,k,v[w],y);if(R===null){k===null&&(k=j);break}e&&k&&R.alternate===null&&t(f,k),m=i(R,m,w),E===null?S=R:E.sibling=R,E=R,k=j}if(w===v.length)return r(f,k),ze&&us(f,w),S;if(k===null){for(;w<v.length;w++)k=u(f,v[w],y),k!==null&&(m=i(k,m,w),E===null?S=k:E.sibling=k,E=k);return ze&&us(f,w),S}for(k=n(k);w<v.length;w++)j=_(k,f,w,v[w],y),j!==null&&(e&&j.alternate!==null&&k.delete(j.key===null?w:j.key),m=i(j,m,w),E===null?S=j:E.sibling=j,E=j);return e&&k.forEach(function(M){return t(f,M)}),ze&&us(f,w),S}function b(f,m,v,y){if(v==null)throw Error(ee(151));for(var S=null,E=null,k=m,w=m=0,j=null,R=v.next();k!==null&&!R.done;w++,R=v.next()){k.index>w?(j=k,k=null):j=k.sibling;var M=g(f,k,R.value,y);if(M===null){k===null&&(k=j);break}e&&k&&M.alternate===null&&t(f,k),m=i(M,m,w),E===null?S=M:E.sibling=M,E=M,k=j}if(R.done)return r(f,k),ze&&us(f,w),S;if(k===null){for(;!R.done;w++,R=v.next())R=u(f,R.value,y),R!==null&&(m=i(R,m,w),E===null?S=R:E.sibling=R,E=R);return ze&&us(f,w),S}for(k=n(k);!R.done;w++,R=v.next())R=_(k,f,w,R.value,y),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?w:R.key),m=i(R,m,w),E===null?S=R:E.sibling=R,E=R);return e&&k.forEach(function(T){return t(f,T)}),ze&&us(f,w),S}function h(f,m,v,y){if(typeof v=="object"&&v!==null&&v.type===no&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case bu:e:{for(var S=v.key;m!==null;){if(m.key===S){if(S=v.type,S===no){if(m.tag===7){r(f,m.sibling),y=s(m,v.props.children),y.return=f,f=y;break e}}else if(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Vs&&Qi(S)===m.type){r(f,m.sibling),y=s(m,v.props),Al(y,v),y.return=f,f=y;break e}r(f,m);break}else t(f,m);m=m.sibling}v.type===no?(y=ha(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=td(v.type,v.key,v.props,null,f.mode,y),Al(y,v),y.return=f,f=y)}return l(f);case Vl:e:{for(S=v.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){r(f,m.sibling),y=s(m,v.children||[]),y.return=f,f=y;break e}else{r(f,m);break}else t(f,m);m=m.sibling}y=kh(v,f.mode,y),y.return=f,f=y}return l(f);case Vs:return v=Qi(v),h(f,m,v,y)}if(ql(v))return x(f,m,v,y);if(Rl(v)){if(S=Rl(v),typeof S!="function")throw Error(ee(150));return v=S.call(v),b(f,m,v,y)}if(typeof v.then=="function")return h(f,m,Ru(v),y);if(v.$$typeof===gs)return h(f,m,ku(f,v),y);Nu(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(r(f,m.sibling),y=s(m,v),y.return=f,f=y):(r(f,m),y=jh(v,f.mode,y),y.return=f,f=y),l(f)):r(f,m)}return function(f,m,v,y){try{Sc=0;var S=h(f,m,v,y);return bo=null,S}catch(k){if(k===pl||k===Rf)throw k;var E=Br(29,k,null,f.mode);return E.lanes=y,E.return=f,E}finally{}}}var ya=w1(!0),C1=w1(!1),qs=!1;function Xg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Km(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _i(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,$e&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Sd(e),p1(e,null,r),t}return kf(e,n,t,r),Sd(e)}function sc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,US(e,r)}}function Nh(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var l={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};i===null?s=i=l:i=i.next=l,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Ym=!1;function ic(){if(Ym){var e=xo;if(e!==null)throw e}}function ac(e,t,r,n){Ym=!1;var s=e.updateQueue;qs=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,d=c.next;c.next=null,l===null?i=d:l.next=d,l=c;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==l&&(a===null?p.firstBaseUpdate=d:a.next=d,p.lastBaseUpdate=c))}if(i!==null){var u=s.baseState;l=0,p=d=c=null,a=i;do{var g=a.lane&-536870913,_=g!==a.lane;if(_?(Ie&g)===g:(n&g)===g){g!==0&&g===Go&&(Ym=!0),p!==null&&(p=p.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var x=e,b=a;g=t;var h=r;switch(b.tag){case 1:if(x=b.payload,typeof x=="function"){u=x.call(h,u,g);break e}u=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,g=typeof x=="function"?x.call(h,u,g):x,g==null)break e;u=ht({},u,g);break e;case 2:qs=!0}}g=a.callback,g!==null&&(e.flags|=64,_&&(e.flags|=8192),_=s.callbacks,_===null?s.callbacks=[g]:_.push(g))}else _={lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(d=p=_,c=u):p=p.next=_,l|=g;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;_=a,a=_.next,_.next=null,s.lastBaseUpdate=_,s.shared.pending=null}}while(!0);p===null&&(c=u),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=p,i===null&&(s.shared.lanes=0),Di|=l,e.lanes=l,e.memoizedState=u}}function E1(e,t){if(typeof e!="function")throw Error(ee(191,e));e.call(t)}function j1(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)E1(r[e],t)}var Ko=Qn(null),jd=Qn(0);function My(e,t){e=Rs,ot(jd,e),ot(Ko,t),Rs=e|t.baseLanes}function Zm(){ot(jd,Rs),ot(Ko,Ko.current)}function Qg(){Rs=jd.current,Vt(Ko),Vt(jd)}var Wr=Qn(null),cn=null;function Zs(e){var t=e.alternate;ot(wt,wt.current&1),ot(Wr,e),cn===null&&(t===null||Ko.current!==null||t.memoizedState!==null)&&(cn=e)}function Xm(e){ot(wt,wt.current),ot(Wr,e),cn===null&&(cn=e)}function k1(e){e.tag===22?(ot(wt,wt.current),ot(Wr,e),cn===null&&(cn=e)):Xs()}function Xs(){ot(wt,wt.current),ot(Wr,Wr.current)}function Lr(e){Vt(Wr),cn===e&&(cn=null),Vt(wt)}var wt=Qn(0);function kd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||gp(r)||vp(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Es=0,Re=null,rt=null,Tt=null,Rd=!1,So=!1,xa=!1,Nd=0,wc=0,wo=null,fT=0;function vt(){throw Error(ee(321))}function Jg(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!qr(e[r],t[r]))return!1;return!0}function ev(e,t,r,n,s,i){return Es=i,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,we.H=e===null||e.memoizedState===null?sw:dv,xa=!1,i=r(n,s),xa=!1,So&&(i=N1(t,r,n,s)),R1(e),i}function R1(e){we.H=Cc;var t=rt!==null&&rt.next!==null;if(Es=0,Tt=rt=Re=null,Rd=!1,wc=0,wo=null,t)throw Error(ee(300));e===null||Ot||(e=e.dependencies,e!==null&&Cd(e)&&(Ot=!0))}function N1(e,t,r,n){Re=e;var s=0;do{if(So&&(wo=null),wc=0,So=!1,25<=s)throw Error(ee(301));if(s+=1,Tt=rt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}we.H=iw,i=t(r,n)}while(So);return i}function hT(){var e=we.H,t=e.useState()[0];return t=typeof t.then=="function"?Qc(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Re.flags|=1024),t}function tv(){var e=Nd!==0;return Nd=0,e}function rv(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function nv(e){if(Rd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Rd=!1}Es=0,Tt=rt=Re=null,So=!1,wc=Nd=0,wo=null}function cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Re.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function Ct(){if(rt===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Tt===null?Re.memoizedState:Tt.next;if(t!==null)Tt=t,rt=e;else{if(e===null)throw Re.alternate===null?Error(ee(467)):Error(ee(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Tt===null?Re.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Nf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(e){var t=wc;return wc+=1,wo===null&&(wo=[]),e=S1(wo,e,t),t=Re,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,we.H=t===null||t.memoizedState===null?sw:dv),e}function Tf(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qc(e);if(e.$$typeof===gs)return Xt(e)}throw Error(ee(438,String(e)))}function sv(e){var t=null,r=Re.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var n=Re.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Nf(),Re.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),n=0;n<e;n++)r[n]=QR;return t.index++,r}function js(e,t){return typeof t=="function"?t(e):t}function nd(e){var t=Ct();return iv(t,rt,e)}function iv(e,t,r){var n=e.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=r;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var l=s.next;s.next=i.next,i.next=l}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var a=l=null,c=null,d=t,p=!1;do{var u=d.lane&-536870913;if(u!==d.lane?(Ie&u)===u:(Es&u)===u){var g=d.revertLane;if(g===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),u===Go&&(p=!0);else if((Es&g)===g){d=d.next,g===Go&&(p=!0);continue}else u={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(a=c=u,l=i):c=c.next=u,Re.lanes|=g,Di|=g;u=d.action,xa&&r(i,u),i=d.hasEagerState?d.eagerState:r(i,u)}else g={lane:u,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(a=c=g,l=i):c=c.next=g,Re.lanes|=u,Di|=u;d=d.next}while(d!==null&&d!==t);if(c===null?l=i:c.next=a,!qr(i,e.memoizedState)&&(Ot=!0,p&&(r=xo,r!==null)))throw r;e.memoizedState=i,e.baseState=l,e.baseQueue=c,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Th(e){var t=Ct(),r=t.queue;if(r===null)throw Error(ee(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do i=e(i,l.action),l=l.next;while(l!==s);qr(i,t.memoizedState)||(Ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function T1(e,t,r){var n=Re,s=Ct(),i=ze;if(i){if(r===void 0)throw Error(ee(407));r=r()}else r=t();var l=!qr((rt||s).memoizedState,r);if(l&&(s.memoizedState=r,Ot=!0),s=s.queue,av(O1.bind(null,n,s,e),[e]),s.getSnapshot!==t||l||Tt!==null&&Tt.memoizedState.tag&1){if(n.flags|=2048,Yo(9,{destroy:void 0},D1.bind(null,n,s,r,t),null),it===null)throw Error(ee(349));i||Es&127||A1(n,t,r)}return r}function A1(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Re.updateQueue,t===null?(t=Nf(),Re.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function D1(e,t,r,n){t.value=r,t.getSnapshot=n,M1(t)&&L1(e)}function O1(e,t,r){return r(function(){M1(t)&&L1(e)})}function M1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!qr(e,r)}catch{return!0}}function L1(e){var t=Na(e,2);t!==null&&wr(t,e,2)}function Qm(e){var t=cr();if(typeof e=="function"){var r=e;if(e=r(),xa){li(!0);try{r()}finally{li(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:e},t}function P1(e,t,r,n){return e.baseState=r,iv(e,rt,typeof n=="function"?n:js)}function mT(e,t,r,n,s){if(Df(e))throw Error(ee(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){i.listeners.push(l)}};we.T!==null?r(!0):i.isTransition=!1,n(i),r=t.pending,r===null?(i.next=t.pending=i,B1(t,i)):(i.next=r.next,t.pending=r.next=i)}}function B1(e,t){var r=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=we.T,l={};we.T=l;try{var a=r(s,n),c=we.S;c!==null&&c(l,a),Ly(e,t,a)}catch(d){Jm(e,t,d)}finally{i!==null&&l.types!==null&&(i.types=l.types),we.T=i}}else try{i=r(s,n),Ly(e,t,i)}catch(d){Jm(e,t,d)}}function Ly(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){Py(e,t,n)},function(n){return Jm(e,t,n)}):Py(e,t,r)}function Py(e,t,r){t.status="fulfilled",t.value=r,I1(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,B1(e,r)))}function Jm(e,t,r){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=r,I1(t),t=t.next;while(t!==n)}e.action=null}function I1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function H1(e,t){return t}function By(e,t){if(ze){var r=it.formState;if(r!==null){e:{var n=Re;if(ze){if(dt){t:{for(var s=dt,i=on;s.nodeType!==8;){if(!i){s=null;break t}if(s=un(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){dt=un(s.nextSibling),n=s.data==="F!";break e}}Ti(n)}n=!1}n&&(t=r[0])}}return r=cr(),r.memoizedState=r.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H1,lastRenderedState:t},r.queue=n,r=tw.bind(null,Re,n),n.dispatch=r,n=Qm(!1),i=uv.bind(null,Re,!1,n.queue),n=cr(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,r=mT.bind(null,Re,s,i,r),s.dispatch=r,n.memoizedState=e,[t,r,!1]}function Iy(e){var t=Ct();return z1(t,rt,e)}function z1(e,t,r){if(t=iv(e,t,H1)[0],e=nd(js)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Qc(t)}catch(l){throw l===pl?Rf:l}else n=t;t=Ct();var s=t.queue,i=s.dispatch;return r!==t.memoizedState&&(Re.flags|=2048,Yo(9,{destroy:void 0},pT.bind(null,s,r),null)),[n,i,e]}function pT(e,t){e.action=t}function Hy(e){var t=Ct(),r=rt;if(r!==null)return z1(t,r,e);Ct(),t=t.memoizedState,r=Ct();var n=r.queue.dispatch;return r.memoizedState=e,[t,n,!1]}function Yo(e,t,r,n){return e={tag:e,create:r,deps:n,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Nf(),Re.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function F1(){return Ct().memoizedState}function sd(e,t,r,n){var s=cr();Re.flags|=e,s.memoizedState=Yo(1|t,{destroy:void 0},r,n===void 0?null:n)}function Af(e,t,r,n){var s=Ct();n=n===void 0?null:n;var i=s.memoizedState.inst;rt!==null&&n!==null&&Jg(n,rt.memoizedState.deps)?s.memoizedState=Yo(t,i,r,n):(Re.flags|=e,s.memoizedState=Yo(1|t,i,r,n))}function zy(e,t){sd(8390656,8,e,t)}function av(e,t){Af(2048,8,e,t)}function gT(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Nf(),Re.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function U1(e){var t=Ct().memoizedState;return gT({ref:t,nextImpl:e}),function(){if($e&2)throw Error(ee(440));return t.impl.apply(void 0,arguments)}}function $1(e,t){return Af(4,2,e,t)}function V1(e,t){return Af(4,4,e,t)}function q1(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function W1(e,t,r){r=r!=null?r.concat([e]):null,Af(4,4,q1.bind(null,t,e),r)}function ov(){}function G1(e,t){var r=Ct();t=t===void 0?null:t;var n=r.memoizedState;return t!==null&&Jg(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function K1(e,t){var r=Ct();t=t===void 0?null:t;var n=r.memoizedState;if(t!==null&&Jg(t,n[1]))return n[0];if(n=e(),xa){li(!0);try{e()}finally{li(!1)}}return r.memoizedState=[n,t],n}function lv(e,t,r){return r===void 0||Es&1073741824&&!(Ie&261930)?e.memoizedState=t:(e.memoizedState=r,e=Pw(),Re.lanes|=e,Di|=e,r)}function Y1(e,t,r,n){return qr(r,t)?r:Ko.current!==null?(e=lv(e,r,n),qr(e,t)||(Ot=!0),e):!(Es&42)||Es&1073741824&&!(Ie&261930)?(Ot=!0,e.memoizedState=r):(e=Pw(),Re.lanes|=e,Di|=e,t)}function Z1(e,t,r,n,s){var i=Ve.p;Ve.p=i!==0&&8>i?i:8;var l=we.T,a={};we.T=a,uv(e,!1,t,r);try{var c=s(),d=we.S;if(d!==null&&d(a,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var p=dT(c,n);oc(e,t,p,Ur(e))}else oc(e,t,n,Ur(e))}catch(u){oc(e,t,{then:function(){},status:"rejected",reason:u},Ur())}finally{Ve.p=i,l!==null&&a.types!==null&&(l.types=a.types),we.T=l}}function vT(){}function ep(e,t,r,n){if(e.tag!==5)throw Error(ee(476));var s=X1(e).queue;Z1(e,s,t,fa,r===null?vT:function(){return Q1(e),r(n)})}function X1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fa,baseState:fa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:fa},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Q1(e){var t=X1(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},Ur())}function cv(){return Xt(kc)}function J1(){return Ct().memoizedState}function ew(){return Ct().memoizedState}function _T(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Ur();e=vi(r);var n=_i(t,e,r);n!==null&&(wr(n,t,r),sc(n,t,r)),t={cache:Kg()},e.payload=t;return}t=t.return}}function yT(e,t,r){var n=Ur();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Df(e)?rw(t,r):(r=Vg(e,t,r,n),r!==null&&(wr(r,e,n),nw(r,t,n)))}function tw(e,t,r){var n=Ur();oc(e,t,r,n)}function oc(e,t,r,n){var s={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Df(e))rw(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,r);if(s.hasEagerState=!0,s.eagerState=a,qr(a,l))return kf(e,t,s,0),it===null&&jf(),!1}catch{}finally{}if(r=Vg(e,t,s,n),r!==null)return wr(r,e,n),nw(r,t,n),!0}return!1}function uv(e,t,r,n){if(n={lane:2,revertLane:yv(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Df(e)){if(t)throw Error(ee(479))}else t=Vg(e,r,n,2),t!==null&&wr(t,e,2)}function Df(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function rw(e,t){So=Rd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function nw(e,t,r){if(r&4194048){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,US(e,r)}}var Cc={readContext:Xt,use:Tf,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};Cc.useEffectEvent=vt;var sw={readContext:Xt,use:Tf,useCallback:function(e,t){return cr().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:zy,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,sd(4194308,4,q1.bind(null,t,e),r)},useLayoutEffect:function(e,t){return sd(4194308,4,e,t)},useInsertionEffect:function(e,t){sd(4,2,e,t)},useMemo:function(e,t){var r=cr();t=t===void 0?null:t;var n=e();if(xa){li(!0);try{e()}finally{li(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=cr();if(r!==void 0){var s=r(t);if(xa){li(!0);try{r(t)}finally{li(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=yT.bind(null,Re,e),[n.memoizedState,e]},useRef:function(e){var t=cr();return e={current:e},t.memoizedState=e},useState:function(e){e=Qm(e);var t=e.queue,r=tw.bind(null,Re,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:ov,useDeferredValue:function(e,t){var r=cr();return lv(r,e,t)},useTransition:function(){var e=Qm(!1);return e=Z1.bind(null,Re,e.queue,!0,!1),cr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var n=Re,s=cr();if(ze){if(r===void 0)throw Error(ee(407));r=r()}else{if(r=t(),it===null)throw Error(ee(349));Ie&127||A1(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,zy(O1.bind(null,n,i,e),[e]),n.flags|=2048,Yo(9,{destroy:void 0},D1.bind(null,n,i,r,t),null),r},useId:function(){var e=cr(),t=it.identifierPrefix;if(ze){var r=qn,n=Vn;r=(n&~(1<<32-Fr(n)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Nd++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=fT++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cv,useFormState:By,useActionState:By,useOptimistic:function(e){var t=cr();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=uv.bind(null,Re,!0,r),r.dispatch=t,[e,t]},useMemoCache:sv,useCacheRefresh:function(){return cr().memoizedState=_T.bind(null,Re)},useEffectEvent:function(e){var t=cr(),r={impl:e};return t.memoizedState=r,function(){if($e&2)throw Error(ee(440));return r.impl.apply(void 0,arguments)}}},dv={readContext:Xt,use:Tf,useCallback:G1,useContext:Xt,useEffect:av,useImperativeHandle:W1,useInsertionEffect:$1,useLayoutEffect:V1,useMemo:K1,useReducer:nd,useRef:F1,useState:function(){return nd(js)},useDebugValue:ov,useDeferredValue:function(e,t){var r=Ct();return Y1(r,rt.memoizedState,e,t)},useTransition:function(){var e=nd(js)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:Qc(e),t]},useSyncExternalStore:T1,useId:J1,useHostTransitionStatus:cv,useFormState:Iy,useActionState:Iy,useOptimistic:function(e,t){var r=Ct();return P1(r,rt,e,t)},useMemoCache:sv,useCacheRefresh:ew};dv.useEffectEvent=U1;var iw={readContext:Xt,use:Tf,useCallback:G1,useContext:Xt,useEffect:av,useImperativeHandle:W1,useInsertionEffect:$1,useLayoutEffect:V1,useMemo:K1,useReducer:Th,useRef:F1,useState:function(){return Th(js)},useDebugValue:ov,useDeferredValue:function(e,t){var r=Ct();return rt===null?lv(r,e,t):Y1(r,rt.memoizedState,e,t)},useTransition:function(){var e=Th(js)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:Qc(e),t]},useSyncExternalStore:T1,useId:J1,useHostTransitionStatus:cv,useFormState:Hy,useActionState:Hy,useOptimistic:function(e,t){var r=Ct();return rt!==null?P1(r,rt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:sv,useCacheRefresh:ew};iw.useEffectEvent=U1;function Ah(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ht({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var tp={enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Ur(),s=vi(n);s.payload=t,r!=null&&(s.callback=r),t=_i(e,s,n),t!==null&&(wr(t,e,n),sc(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Ur(),s=vi(n);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=_i(e,s,n),t!==null&&(wr(t,e,n),sc(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ur(),n=vi(r);n.tag=2,t!=null&&(n.callback=t),t=_i(e,n,r),t!==null&&(wr(t,e,r),sc(t,e,r))}};function Fy(e,t,r,n,s,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,l):t.prototype&&t.prototype.isPureReactComponent?!yc(r,n)||!yc(s,i):!0}function Uy(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&tp.enqueueReplaceState(t,t.state,null)}function ba(e,t){var r=t;if("ref"in t){r={};for(var n in t)n!=="ref"&&(r[n]=t[n])}if(e=e.defaultProps){r===t&&(r=ht({},r));for(var s in e)r[s]===void 0&&(r[s]=e[s])}return r}function aw(e){bd(e)}function ow(e){console.error(e)}function lw(e){bd(e)}function Td(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function $y(e,t,r){try{var n=e.onCaughtError;n(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function rp(e,t,r){return r=vi(r),r.tag=3,r.payload={element:null},r.callback=function(){Td(e,t)},r}function cw(e){return e=vi(e),e.tag=3,e}function uw(e,t,r,n){var s=r.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){$y(t,r,n)}}var l=r.stateNode;l!==null&&typeof l.componentDidCatch=="function"&&(e.callback=function(){$y(t,r,n),typeof s!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var a=n.stack;this.componentDidCatch(n.value,{componentStack:a!==null?a:""})})}function xT(e,t,r,n,s){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=r.alternate,t!==null&&ml(t,r,s,!0),r=Wr.current,r!==null){switch(r.tag){case 31:case 13:return cn===null?Ld():r.alternate===null&&yt===0&&(yt=3),r.flags&=-257,r.flags|=65536,r.lanes=s,n===Ed?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([n]):t.add(n),Uh(e,n,s)),!1;case 22:return r.flags|=65536,n===Ed?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([n]):r.add(n)),Uh(e,n,s)),!1}throw Error(ee(435,r.tag))}return Uh(e,n,s),Ld(),!1}if(ze)return t=Wr.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==$m&&(e=Error(ee(422),{cause:n}),bc(an(e,r)))):(n!==$m&&(t=Error(ee(423),{cause:n}),bc(an(t,r))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=an(n,r),s=rp(e.stateNode,n,s),Nh(e,s),yt!==4&&(yt=2)),!1;var i=Error(ee(520),{cause:n});if(i=an(i,r),uc===null?uc=[i]:uc.push(i),yt!==4&&(yt=2),t===null)return!0;n=an(n,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=s&-s,r.lanes|=e,e=rp(r.stateNode,n,e),Nh(r,e),!1;case 1:if(t=r.type,i=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(yi===null||!yi.has(i))))return r.flags|=65536,s&=-s,r.lanes|=s,s=cw(s),uw(s,e,r,n),Nh(r,s),!1}r=r.return}while(r!==null);return!1}var fv=Error(ee(461)),Ot=!1;function Gt(e,t,r,n){t.child=e===null?C1(t,null,r,n):ya(t,e.child,r,n)}function Vy(e,t,r,n,s){r=r.render;var i=t.ref;if("ref"in n){var l={};for(var a in n)a!=="ref"&&(l[a]=n[a])}else l=n;return _a(t),n=ev(e,t,r,l,i,s),a=tv(),e!==null&&!Ot?(rv(e,t,s),ks(e,t,s)):(ze&&a&&Wg(t),t.flags|=1,Gt(e,t,n,s),t.child)}function qy(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!qg(i)&&i.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=i,dw(e,t,i,n,s)):(e=td(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!hv(e,s)){var l=i.memoizedProps;if(r=r.compare,r=r!==null?r:yc,r(l,n)&&e.ref===t.ref)return ks(e,t,s)}return t.flags|=1,e=ys(i,n),e.ref=t.ref,e.return=t,t.child=e}function dw(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(yc(i,n)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=n=i,hv(e,s))e.flags&131072&&(Ot=!0);else return t.lanes=e.lanes,ks(e,t,s)}return np(e,t,r,n,s)}function fw(e,t,r,n){var s=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|r:r,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~i}else n=0,t.child=null;return Wy(e,t,i,r,n)}if(r&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&rd(t,i!==null?i.cachePool:null),i!==null?My(t,i):Zm(),k1(t);else return n=t.lanes=536870912,Wy(e,t,i!==null?i.baseLanes|r:r,r,n)}else i!==null?(rd(t,i.cachePool),My(t,i),Xs(),t.memoizedState=null):(e!==null&&rd(t,null),Zm(),Xs());return Gt(e,t,s,r),t.child}function Gl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wy(e,t,r,n,s){var i=Yg();return i=i===null?null:{parent:Dt._currentValue,pool:i},t.memoizedState={baseLanes:r,cachePool:i},e!==null&&rd(t,null),Zm(),k1(t),e!==null&&ml(e,t,n,!0),t.childLanes=s,null}function id(e,t){return t=Ad({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gy(e,t,r){return ya(t,e.child,null,r),e=id(t,t.pendingProps),e.flags|=2,Lr(t),t.memoizedState=null,e}function bT(e,t,r){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(n.mode==="hidden")return e=id(t,n),t.lanes=536870912,Gl(null,e);if(Xm(t),(e=dt)?(e=sC(e,on),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ni!==null?{id:Vn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=v1(e),r.return=t,t.child=r,Zt=t,dt=null)):e=null,e===null)throw Ti(t);return t.lanes=536870912,null}return id(t,n)}var i=e.memoizedState;if(i!==null){var l=i.dehydrated;if(Xm(t),s)if(t.flags&256)t.flags&=-257,t=Gy(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(ee(558));else if(Ot||ml(e,t,r,!1),s=(r&e.childLanes)!==0,Ot||s){if(n=it,n!==null&&(l=$S(n,r),l!==0&&l!==i.retryLane))throw i.retryLane=l,Na(e,l),wr(n,e,l),fv;Ld(),t=Gy(e,t,r)}else e=i.treeContext,dt=un(l.nextSibling),Zt=t,ze=!0,gi=null,on=!1,e!==null&&y1(t,e),t=id(t,n),t.flags|=4096;return t}return e=ys(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ad(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(ee(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function np(e,t,r,n,s){return _a(t),r=ev(e,t,r,n,void 0,s),n=tv(),e!==null&&!Ot?(rv(e,t,s),ks(e,t,s)):(ze&&n&&Wg(t),t.flags|=1,Gt(e,t,r,s),t.child)}function Ky(e,t,r,n,s,i){return _a(t),t.updateQueue=null,r=N1(t,n,r,s),R1(e),n=tv(),e!==null&&!Ot?(rv(e,t,i),ks(e,t,i)):(ze&&n&&Wg(t),t.flags|=1,Gt(e,t,r,i),t.child)}function Yy(e,t,r,n,s){if(_a(t),t.stateNode===null){var i=fo,l=r.contextType;typeof l=="object"&&l!==null&&(i=Xt(l)),i=new r(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=tp,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Xg(t),l=r.contextType,i.context=typeof l=="object"&&l!==null?Xt(l):fo,i.state=t.memoizedState,l=r.getDerivedStateFromProps,typeof l=="function"&&(Ah(t,r,l,n),i.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(l=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),l!==i.state&&tp.enqueueReplaceState(i,i.state,null),ac(t,n,i,s),ic(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var a=t.memoizedProps,c=ba(r,a);i.props=c;var d=i.context,p=r.contextType;l=fo,typeof p=="object"&&p!==null&&(l=Xt(p));var u=r.getDerivedStateFromProps;p=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,p||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a||d!==l)&&Uy(t,i,n,l),qs=!1;var g=t.memoizedState;i.state=g,ac(t,n,i,s),ic(),d=t.memoizedState,a||g!==d||qs?(typeof u=="function"&&(Ah(t,r,u,n),d=t.memoizedState),(c=qs||Fy(t,r,c,n,g,d,l))?(p||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=d),i.props=n,i.state=d,i.context=l,n=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Km(e,t),l=t.memoizedProps,p=ba(r,l),i.props=p,u=t.pendingProps,g=i.context,d=r.contextType,c=fo,typeof d=="object"&&d!==null&&(c=Xt(d)),a=r.getDerivedStateFromProps,(d=typeof a=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==u||g!==c)&&Uy(t,i,n,c),qs=!1,g=t.memoizedState,i.state=g,ac(t,n,i,s),ic();var _=t.memoizedState;l!==u||g!==_||qs||e!==null&&e.dependencies!==null&&Cd(e.dependencies)?(typeof a=="function"&&(Ah(t,r,a,n),_=t.memoizedState),(p=qs||Fy(t,r,p,n,g,_,c)||e!==null&&e.dependencies!==null&&Cd(e.dependencies))?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,_,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,_,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=_),i.props=n,i.state=_,i.context=c,n=p):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,ad(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,r=n&&typeof r.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=ya(t,e.child,null,s),t.child=ya(t,null,r,s)):Gt(e,t,r,s),t.memoizedState=i.state,e=t.child):e=ks(e,t,s),e}function Zy(e,t,r,n){return va(),t.flags|=256,Gt(e,t,r,n),t.child}var Dh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oh(e){return{baseLanes:e,cachePool:b1()}}function Mh(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Ir),e}function hw(e,t,r){var n=t.pendingProps,s=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),l&&(s=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(s?Zs(t):Xs(),(e=dt)?(e=sC(e,on),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ni!==null?{id:Vn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=v1(e),r.return=t,t.child=r,Zt=t,dt=null)):e=null,e===null)throw Ti(t);return vp(e)?t.lanes=32:t.lanes=536870912,null}var a=n.children;return n=n.fallback,s?(Xs(),s=t.mode,a=Ad({mode:"hidden",children:a},s),n=ha(n,s,r,null),a.return=t,n.return=t,a.sibling=n,t.child=a,n=t.child,n.memoizedState=Oh(r),n.childLanes=Mh(e,l,r),t.memoizedState=Dh,Gl(null,n)):(Zs(t),sp(t,a))}var c=e.memoizedState;if(c!==null&&(a=c.dehydrated,a!==null)){if(i)t.flags&256?(Zs(t),t.flags&=-257,t=Lh(e,t,r)):t.memoizedState!==null?(Xs(),t.child=e.child,t.flags|=128,t=null):(Xs(),a=n.fallback,s=t.mode,n=Ad({mode:"visible",children:n.children},s),a=ha(a,s,r,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,ya(t,e.child,null,r),n=t.child,n.memoizedState=Oh(r),n.childLanes=Mh(e,l,r),t.memoizedState=Dh,t=Gl(null,n));else if(Zs(t),vp(a)){if(l=a.nextSibling&&a.nextSibling.dataset,l)var d=l.dgst;l=d,n=Error(ee(419)),n.stack="",n.digest=l,bc({value:n,source:null,stack:null}),t=Lh(e,t,r)}else if(Ot||ml(e,t,r,!1),l=(r&e.childLanes)!==0,Ot||l){if(l=it,l!==null&&(n=$S(l,r),n!==0&&n!==c.retryLane))throw c.retryLane=n,Na(e,n),wr(l,e,n),fv;gp(a)||Ld(),t=Lh(e,t,r)}else gp(a)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,dt=un(a.nextSibling),Zt=t,ze=!0,gi=null,on=!1,e!==null&&y1(t,e),t=sp(t,n.children),t.flags|=4096);return t}return s?(Xs(),a=n.fallback,s=t.mode,c=e.child,d=c.sibling,n=ys(c,{mode:"hidden",children:n.children}),n.subtreeFlags=c.subtreeFlags&65011712,d!==null?a=ys(d,a):(a=ha(a,s,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,Gl(null,n),n=t.child,a=e.child.memoizedState,a===null?a=Oh(r):(s=a.cachePool,s!==null?(c=Dt._currentValue,s=s.parent!==c?{parent:c,pool:c}:s):s=b1(),a={baseLanes:a.baseLanes|r,cachePool:s}),n.memoizedState=a,n.childLanes=Mh(e,l,r),t.memoizedState=Dh,Gl(e.child,n)):(Zs(t),r=e.child,e=r.sibling,r=ys(r,{mode:"visible",children:n.children}),r.return=t,r.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=r,t.memoizedState=null,r)}function sp(e,t){return t=Ad({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ad(e,t){return e=Br(22,e,null,t),e.lanes=0,e}function Lh(e,t,r){return ya(t,e.child,null,r),e=sp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xy(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),qm(e.return,t,r)}function Ph(e,t,r,n,s,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s,treeForkCount:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=n,l.tail=r,l.tailMode=s,l.treeForkCount=i)}function mw(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var l=wt.current,a=(l&2)!==0;if(a?(l=l&1|2,t.flags|=128):l&=1,ot(wt,l),Gt(e,t,n,r),n=ze?xc:0,!a&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xy(e,r,t);else if(e.tag===19)Xy(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}switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&kd(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Ph(t,!1,s,r,i,n);break;case"backwards":case"unstable_legacy-backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&kd(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Ph(t,!0,r,null,i,n);break;case"together":Ph(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function ks(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,!(r&t.childLanes))if(e!==null){if(ml(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,r=ys(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ys(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function hv(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Cd(e)))}function ST(e,t,r){switch(t.tag){case 3:vd(t,t.stateNode.containerInfo),Ys(t,Dt,e.memoizedState.cache),va();break;case 27:case 5:Dm(t);break;case 4:vd(t,t.stateNode.containerInfo);break;case 10:Ys(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xm(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Zs(t),t.flags|=128,null):r&t.child.childLanes?hw(e,t,r):(Zs(t),e=ks(e,t,r),e!==null?e.sibling:null);Zs(t);break;case 19:var s=(e.flags&128)!==0;if(n=(r&t.childLanes)!==0,n||(ml(e,t,r,!1),n=(r&t.childLanes)!==0),s){if(n)return mw(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ot(wt,wt.current),n)break;return null;case 22:return t.lanes=0,fw(e,t,r,t.pendingProps);case 24:Ys(t,Dt,e.memoizedState.cache)}return ks(e,t,r)}function pw(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!hv(e,r)&&!(t.flags&128))return Ot=!1,ST(e,t,r);Ot=!!(e.flags&131072)}else Ot=!1,ze&&t.flags&1048576&&_1(t,xc,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Qi(t.elementType),t.type=e,typeof e=="function")qg(e)?(n=ba(e,n),t.tag=1,t=Yy(null,t,e,n,r)):(t.tag=0,t=np(null,t,e,n,r));else{if(e!=null){var s=e.$$typeof;if(s===Ag){t.tag=11,t=Vy(null,t,e,n,r);break e}else if(s===Dg){t.tag=14,t=qy(null,t,e,n,r);break e}}throw t=Tm(e)||e,Error(ee(306,t,""))}}return t;case 0:return np(e,t,t.type,t.pendingProps,r);case 1:return n=t.type,s=ba(n,t.pendingProps),Yy(e,t,n,s,r);case 3:e:{if(vd(t,t.stateNode.containerInfo),e===null)throw Error(ee(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,Km(e,t),ac(t,n,null,r);var l=t.memoizedState;if(n=l.cache,Ys(t,Dt,n),n!==i.cache&&Wm(t,[Dt],r,!0),ic(),n=l.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Zy(e,t,n,r);break e}else if(n!==s){s=an(Error(ee(424)),t),bc(s),t=Zy(e,t,n,r);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(dt=un(e.firstChild),Zt=t,ze=!0,gi=null,on=!0,r=C1(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(va(),n===s){t=ks(e,t,r);break e}Gt(e,t,n,r)}t=t.child}return t;case 26:return ad(e,t),e===null?(r=vx(t.type,null,t.pendingProps,null))?t.memoizedState=r:ze||(r=t.type,e=t.pendingProps,n=Hd(pi.current).createElement(r),n[Yt]=t,n[jr]=e,Qt(n,r,e),$t(n),t.stateNode=n):t.memoizedState=vx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dm(t),e===null&&ze&&(n=t.stateNode=iC(t.type,t.pendingProps,pi.current),Zt=t,on=!0,s=dt,Ii(t.type)?(_p=s,dt=un(n.firstChild)):dt=s),Gt(e,t,t.pendingProps.children,r),ad(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((s=n=dt)&&(n=QT(n,t.type,t.pendingProps,on),n!==null?(t.stateNode=n,Zt=t,dt=un(n.firstChild),on=!1,s=!0):s=!1),s||Ti(t)),Dm(t),s=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,n=i.children,mp(s,i)?n=null:l!==null&&mp(s,l)&&(t.flags|=32),t.memoizedState!==null&&(s=ev(e,t,hT,null,null,r),kc._currentValue=s),ad(e,t),Gt(e,t,n,r),t.child;case 6:return e===null&&ze&&((e=r=dt)&&(r=JT(r,t.pendingProps,on),r!==null?(t.stateNode=r,Zt=t,dt=null,e=!0):e=!1),e||Ti(t)),null;case 13:return hw(e,t,r);case 4:return vd(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ya(t,null,n,r):Gt(e,t,n,r),t.child;case 11:return Vy(e,t,t.type,t.pendingProps,r);case 7:return Gt(e,t,t.pendingProps,r),t.child;case 8:return Gt(e,t,t.pendingProps.children,r),t.child;case 12:return Gt(e,t,t.pendingProps.children,r),t.child;case 10:return n=t.pendingProps,Ys(t,t.type,n.value),Gt(e,t,n.children,r),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,_a(t),s=Xt(s),n=n(s),t.flags|=1,Gt(e,t,n,r),t.child;case 14:return qy(e,t,t.type,t.pendingProps,r);case 15:return dw(e,t,t.type,t.pendingProps,r);case 19:return mw(e,t,r);case 31:return bT(e,t,r);case 22:return fw(e,t,r,t.pendingProps);case 24:return _a(t),n=Xt(Dt),e===null?(s=Yg(),s===null&&(s=it,i=Kg(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=r),s=i),t.memoizedState={parent:n,cache:s},Xg(t),Ys(t,Dt,s)):(e.lanes&r&&(Km(e,t),ac(t,null,null,r),ic()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ys(t,Dt,n)):(n=i.cache,Ys(t,Dt,n),n!==s.cache&&Wm(t,[Dt],r,!0))),Gt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(ee(156,t.tag))}function ss(e){e.flags|=4}function Bh(e,t,r,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Hw())e.flags|=8192;else throw pa=Ed,Zg}else e.flags&=-16777217}function Qy(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!lC(t))if(Hw())e.flags|=8192;else throw pa=Ed,Zg}function Tu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zS():536870912,e.lanes|=t,Zo|=t)}function Dl(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function wT(e,t,r){var n=t.pendingProps;switch(Gg(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return r=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xs(Dt),Vo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ha(t)?ss(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rh())),lt(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(ss(t),i!==null?(lt(t),Qy(t,i)):(lt(t),Bh(t,s,null,n,r))):i?i!==e.memoizedState?(ss(t),lt(t),Qy(t,i)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&ss(t),lt(t),Bh(t,s,e,n,r)),null;case 27:if(_d(t),r=pi.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ss(t);else{if(!n){if(t.stateNode===null)throw Error(ee(166));return lt(t),null}e=Kn.current,Ha(t)?ky(t):(e=iC(s,n,r),t.stateNode=e,ss(t))}return lt(t),null;case 5:if(_d(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ss(t);else{if(!n){if(t.stateNode===null)throw Error(ee(166));return lt(t),null}if(i=Kn.current,Ha(t))ky(t);else{var l=Hd(pi.current);switch(i){case 1:i=l.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=l.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=l.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=l.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=l.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?l.createElement("select",{is:n.is}):l.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?l.createElement(s,{is:n.is}):l.createElement(s)}}i[Yt]=t,i[jr]=n;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=i;e:switch(Qt(i,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&ss(t)}}return lt(t),Bh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ss(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ee(166));if(e=pi.current,Ha(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,s=Zt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[Yt]=t,e=!!(e.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||tC(e.nodeValue,r)),e||Ti(t,!0)}else e=Hd(e).createTextNode(n),e[Yt]=t,t.stateNode=e}return lt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ha(t),r!==null){if(e===null){if(!n)throw Error(ee(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(557));e[Yt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else r=Rh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Lr(t),t):(Lr(t),null);if(t.flags&128)throw Error(ee(558))}return lt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ha(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(ee(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ee(317));s[Yt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),s=!1}else s=Rh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Lr(t),t):(Lr(t),null)}return Lr(t),t.flags&128?(t.lanes=r,t):(r=n!==null,e=e!==null&&e.memoizedState!==null,r&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Tu(t,t.updateQueue),lt(t),null);case 4:return Vo(),e===null&&xv(t.stateNode.containerInfo),lt(t),null;case 10:return xs(t.type),lt(t),null;case 19:if(Vt(wt),n=t.memoizedState,n===null)return lt(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Dl(n,!1);else{if(yt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=kd(e),i!==null){for(t.flags|=128,Dl(n,!1),e=i.updateQueue,t.updateQueue=e,Tu(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)g1(r,e),r=r.sibling;return ot(wt,wt.current&1|2),ze&&us(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Hr()>Od&&(t.flags|=128,s=!0,Dl(n,!1),t.lanes=4194304)}else{if(!s)if(e=kd(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Tu(t,e),Dl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!ze)return lt(t),null}else 2*Hr()-n.renderingStartTime>Od&&r!==536870912&&(t.flags|=128,s=!0,Dl(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Hr(),e.sibling=null,r=wt.current,ot(wt,s?r&1|2:r&1),ze&&us(t,n.treeForkCount),e):(lt(t),null);case 22:case 23:return Lr(t),Qg(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?r&536870912&&!(t.flags&128)&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),r=t.updateQueue,r!==null&&Tu(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==r&&(t.flags|=2048),e!==null&&Vt(ma),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xs(Dt),lt(t),null;case 25:return null;case 30:return null}throw Error(ee(156,t.tag))}function CT(e,t){switch(Gg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xs(Dt),Vo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _d(t),null;case 31:if(t.memoizedState!==null){if(Lr(t),t.alternate===null)throw Error(ee(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vt(wt),null;case 4:return Vo(),null;case 10:return xs(t.type),null;case 22:case 23:return Lr(t),Qg(),e!==null&&Vt(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xs(Dt),null;case 25:return null;default:return null}}function gw(e,t){switch(Gg(t),t.tag){case 3:xs(Dt),Vo();break;case 26:case 27:case 5:_d(t);break;case 4:Vo();break;case 31:t.memoizedState!==null&&Lr(t);break;case 13:Lr(t);break;case 19:Vt(wt);break;case 10:xs(t.type);break;case 22:case 23:Lr(t),Qg(),e!==null&&Vt(ma);break;case 24:xs(Dt)}}function Jc(e,t){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var s=n.next;r=s;do{if((r.tag&e)===e){n=void 0;var i=r.create,l=r.inst;n=i(),l.destroy=n}r=r.next}while(r!==s)}}catch(a){Xe(t,t.return,a)}}function Ai(e,t,r){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var l=n.inst,a=l.destroy;if(a!==void 0){l.destroy=void 0,s=t;var c=r,d=a;try{d()}catch(p){Xe(s,c,p)}}}n=n.next}while(n!==i)}}catch(p){Xe(t,t.return,p)}}function vw(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{j1(t,r)}catch(n){Xe(e,e.return,n)}}}function _w(e,t,r){r.props=ba(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(n){Xe(e,t,n)}}function lc(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof r=="function"?e.refCleanup=r(n):r.current=n}}catch(s){Xe(e,t,s)}}function Wn(e,t){var r=e.ref,n=e.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(s){Xe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(s){Xe(e,t,s)}else r.current=null}function yw(e){var t=e.type,r=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(s){Xe(e,e.return,s)}}function Ih(e,t,r){try{var n=e.stateNode;WT(n,e.type,r,t),n[jr]=t}catch(s){Xe(e,e.return,s)}}function xw(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ii(e.type)||e.tag===4}function Hh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ii(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ip(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=vs));else if(n!==4&&(n===27&&Ii(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(ip(e,t,r),e=e.sibling;e!==null;)ip(e,t,r),e=e.sibling}function Dd(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(n===27&&Ii(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Dd(e,t,r),e=e.sibling;e!==null;)Dd(e,t,r),e=e.sibling}function bw(e){var t=e.stateNode,r=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Qt(t,n,r),t[Yt]=e,t[jr]=r}catch(i){Xe(e,e.return,i)}}var ps=!1,At=!1,zh=!1,Jy=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function ET(e,t){if(e=e.containerInfo,fp=$d,e=l1(e),Ug(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var l=0,a=-1,c=-1,d=0,p=0,u=e,g=null;t:for(;;){for(var _;u!==r||s!==0&&u.nodeType!==3||(a=l+s),u!==i||n!==0&&u.nodeType!==3||(c=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)g=u,u=_;for(;;){if(u===e)break t;if(g===r&&++d===s&&(a=l),g===i&&++p===n&&(c=l),(_=u.nextSibling)!==null)break;u=g,g=u.parentNode}u=_}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},$d=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)s=e[r],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,r=t,s=i.memoizedProps,i=i.memoizedState,n=r.stateNode;try{var x=ba(r.type,s);e=n.getSnapshotBeforeUpdate(x,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(b){Xe(r,r.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)pp(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(ee(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function Sw(e,t,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:as(e,r),n&4&&Jc(5,r);break;case 1:if(as(e,r),n&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(l){Xe(r,r.return,l)}else{var s=ba(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){Xe(r,r.return,l)}}n&64&&vw(r),n&512&&lc(r,r.return);break;case 3:if(as(e,r),n&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{j1(e,t)}catch(l){Xe(r,r.return,l)}}break;case 27:t===null&&n&4&&bw(r);case 26:case 5:as(e,r),t===null&&n&4&&yw(r),n&512&&lc(r,r.return);break;case 12:as(e,r);break;case 31:as(e,r),n&4&&Ew(e,r);break;case 13:as(e,r),n&4&&jw(e,r),n&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=MT.bind(null,r),eA(e,r))));break;case 22:if(n=r.memoizedState!==null||ps,!n){t=t!==null&&t.memoizedState!==null||At,s=ps;var i=At;ps=n,(At=t)&&!i?ls(e,r,(r.subtreeFlags&8772)!==0):as(e,r),ps=s,At=i}break;case 30:break;default:as(e,r)}}function ww(e){var t=e.alternate;t!==null&&(e.alternate=null,ww(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pg(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,xr=!1;function is(e,t,r){for(r=r.child;r!==null;)Cw(e,t,r),r=r.sibling}function Cw(e,t,r){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(Wc,r)}catch{}switch(r.tag){case 26:At||Wn(r,t),is(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:At||Wn(r,t);var n=mt,s=xr;Ii(r.type)&&(mt=r.stateNode,xr=!1),is(e,t,r),fc(r.stateNode),mt=n,xr=s;break;case 5:At||Wn(r,t);case 6:if(n=mt,s=xr,mt=null,is(e,t,r),mt=n,xr=s,mt!==null)if(xr)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(r.stateNode)}catch(i){Xe(r,t,i)}else try{mt.removeChild(r.stateNode)}catch(i){Xe(r,t,i)}break;case 18:mt!==null&&(xr?(e=mt,fx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),el(e)):fx(mt,r.stateNode));break;case 4:n=mt,s=xr,mt=r.stateNode.containerInfo,xr=!0,is(e,t,r),mt=n,xr=s;break;case 0:case 11:case 14:case 15:Ai(2,r,t),At||Ai(4,r,t),is(e,t,r);break;case 1:At||(Wn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"&&_w(r,t,n)),is(e,t,r);break;case 21:is(e,t,r);break;case 22:At=(n=At)||r.memoizedState!==null,is(e,t,r),At=n;break;default:is(e,t,r)}}function Ew(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{el(e)}catch(r){Xe(t,t.return,r)}}}function jw(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{el(e)}catch(r){Xe(t,t.return,r)}}function jT(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jy),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jy),t;default:throw Error(ee(435,e.tag))}}function Au(e,t){var r=jT(e);t.forEach(function(n){if(!r.has(n)){r.add(n);var s=LT.bind(null,e,n);n.then(s,s)}})}function pr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n],i=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 27:if(Ii(a.type)){mt=a.stateNode,xr=!1;break e}break;case 5:mt=a.stateNode,xr=!1;break e;case 3:case 4:mt=a.stateNode.containerInfo,xr=!0;break e}a=a.return}if(mt===null)throw Error(ee(160));Cw(i,l,s),mt=null,xr=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kw(t,e),t=t.sibling}var Cn=null;function kw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pr(t,e),gr(e),n&4&&(Ai(3,e,e.return),Jc(3,e),Ai(5,e,e.return));break;case 1:pr(t,e),gr(e),n&512&&(At||r===null||Wn(r,r.return)),n&64&&ps&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?n:r.concat(n))));break;case 26:var s=Cn;if(pr(t,e),gr(e),n&512&&(At||r===null||Wn(r,r.return)),n&4){var i=r!==null?r.memoizedState:null;if(n=e.memoizedState,r===null)if(n===null)if(e.stateNode===null){e:{n=e.type,r=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":i=s.getElementsByTagName("title")[0],(!i||i[Yc]||i[Yt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),Qt(i,n,r),i[Yt]=e,$t(i),n=i;break e;case"link":var l=yx("link","href",s).get(n+(r.href||""));if(l){for(var a=0;a<l.length;a++)if(i=l[a],i.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&i.getAttribute("rel")===(r.rel==null?null:r.rel)&&i.getAttribute("title")===(r.title==null?null:r.title)&&i.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){l.splice(a,1);break t}}i=s.createElement(n),Qt(i,n,r),s.head.appendChild(i);break;case"meta":if(l=yx("meta","content",s).get(n+(r.content||""))){for(a=0;a<l.length;a++)if(i=l[a],i.getAttribute("content")===(r.content==null?null:""+r.content)&&i.getAttribute("name")===(r.name==null?null:r.name)&&i.getAttribute("property")===(r.property==null?null:r.property)&&i.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&i.getAttribute("charset")===(r.charSet==null?null:r.charSet)){l.splice(a,1);break t}}i=s.createElement(n),Qt(i,n,r),s.head.appendChild(i);break;default:throw Error(ee(468,n))}i[Yt]=e,$t(i),n=i}e.stateNode=n}else xx(s,e.type,e.stateNode);else e.stateNode=_x(s,n,e.memoizedProps);else i!==n?(i===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):i.count--,n===null?xx(s,e.type,e.stateNode):_x(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ih(e,e.memoizedProps,r.memoizedProps)}break;case 27:pr(t,e),gr(e),n&512&&(At||r===null||Wn(r,r.return)),r!==null&&n&4&&Ih(e,e.memoizedProps,r.memoizedProps);break;case 5:if(pr(t,e),gr(e),n&512&&(At||r===null||Wn(r,r.return)),e.flags&32){s=e.stateNode;try{Wo(s,"")}catch(x){Xe(e,e.return,x)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,Ih(e,s,r!==null?r.memoizedProps:s)),n&1024&&(zh=!0);break;case 6:if(pr(t,e),gr(e),n&4){if(e.stateNode===null)throw Error(ee(162));n=e.memoizedProps,r=e.stateNode;try{r.nodeValue=n}catch(x){Xe(e,e.return,x)}}break;case 3:if(cd=null,s=Cn,Cn=zd(t.containerInfo),pr(t,e),Cn=s,gr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{el(t.containerInfo)}catch(x){Xe(e,e.return,x)}zh&&(zh=!1,Rw(e));break;case 4:n=Cn,Cn=zd(e.stateNode.containerInfo),pr(t,e),gr(e),Cn=n;break;case 12:pr(t,e),gr(e);break;case 31:pr(t,e),gr(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Au(e,n)));break;case 13:pr(t,e),gr(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Of=Hr()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Au(e,n)));break;case 22:s=e.memoizedState!==null;var c=r!==null&&r.memoizedState!==null,d=ps,p=At;if(ps=d||s,At=p||c,pr(t,e),At=p,ps=d,gr(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(r===null||c||ps||At||Ji(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){c=r=t;try{if(i=c.stateNode,s)l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none";else{a=c.stateNode;var u=c.memoizedProps.style,g=u!=null&&u.hasOwnProperty("display")?u.display:null;a.style.display=g==null||typeof g=="boolean"?"":(""+g).trim()}}catch(x){Xe(c,c.return,x)}}}else if(t.tag===6){if(r===null){c=t;try{c.stateNode.nodeValue=s?"":c.memoizedProps}catch(x){Xe(c,c.return,x)}}}else if(t.tag===18){if(r===null){c=t;try{var _=c.stateNode;s?hx(_,!0):hx(c.stateNode,!1)}catch(x){Xe(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(r=n.retryQueue,r!==null&&(n.retryQueue=null,Au(e,r))));break;case 19:pr(t,e),gr(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Au(e,n)));break;case 30:break;case 21:break;default:pr(t,e),gr(e)}}function gr(e){var t=e.flags;if(t&2){try{for(var r,n=e.return;n!==null;){if(xw(n)){r=n;break}n=n.return}if(r==null)throw Error(ee(160));switch(r.tag){case 27:var s=r.stateNode,i=Hh(e);Dd(e,i,s);break;case 5:var l=r.stateNode;r.flags&32&&(Wo(l,""),r.flags&=-33);var a=Hh(e);Dd(e,a,l);break;case 3:case 4:var c=r.stateNode.containerInfo,d=Hh(e);ip(e,d,c);break;default:throw Error(ee(161))}}catch(p){Xe(e,e.return,p)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rw(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rw(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function as(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sw(e,t.alternate,t),t=t.sibling}function Ji(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ai(4,t,t.return),Ji(t);break;case 1:Wn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&_w(t,t.return,r),Ji(t);break;case 27:fc(t.stateNode);case 26:case 5:Wn(t,t.return),Ji(t);break;case 22:t.memoizedState===null&&Ji(t);break;case 30:Ji(t);break;default:Ji(t)}e=e.sibling}}function ls(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,i=t,l=i.flags;switch(i.tag){case 0:case 11:case 15:ls(s,i,r),Jc(4,i);break;case 1:if(ls(s,i,r),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(d){Xe(n,n.return,d)}if(n=i,s=n.updateQueue,s!==null){var a=n.stateNode;try{var c=s.shared.hiddenCallbacks;if(c!==null)for(s.shared.hiddenCallbacks=null,s=0;s<c.length;s++)E1(c[s],a)}catch(d){Xe(n,n.return,d)}}r&&l&64&&vw(i),lc(i,i.return);break;case 27:bw(i);case 26:case 5:ls(s,i,r),r&&n===null&&l&4&&yw(i),lc(i,i.return);break;case 12:ls(s,i,r);break;case 31:ls(s,i,r),r&&l&4&&Ew(s,i);break;case 13:ls(s,i,r),r&&l&4&&jw(s,i);break;case 22:i.memoizedState===null&&ls(s,i,r),lc(i,i.return);break;case 30:break;default:ls(s,i,r)}t=t.sibling}}function mv(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Xc(r))}function pv(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xc(e))}function bn(e,t,r,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nw(e,t,r,n),t=t.sibling}function Nw(e,t,r,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:bn(e,t,r,n),s&2048&&Jc(9,t);break;case 1:bn(e,t,r,n);break;case 3:bn(e,t,r,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xc(e)));break;case 12:if(s&2048){bn(e,t,r,n),e=t.stateNode;try{var i=t.memoizedProps,l=i.id,a=i.onPostCommit;typeof a=="function"&&a(l,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Xe(t,t.return,c)}}else bn(e,t,r,n);break;case 31:bn(e,t,r,n);break;case 13:bn(e,t,r,n);break;case 23:break;case 22:i=t.stateNode,l=t.alternate,t.memoizedState!==null?i._visibility&2?bn(e,t,r,n):cc(e,t):i._visibility&2?bn(e,t,r,n):(i._visibility|=2,Qa(e,t,r,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&mv(l,t);break;case 24:bn(e,t,r,n),s&2048&&pv(t.alternate,t);break;default:bn(e,t,r,n)}}function Qa(e,t,r,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,l=t,a=r,c=n,d=l.flags;switch(l.tag){case 0:case 11:case 15:Qa(i,l,a,c,s),Jc(8,l);break;case 23:break;case 22:var p=l.stateNode;l.memoizedState!==null?p._visibility&2?Qa(i,l,a,c,s):cc(i,l):(p._visibility|=2,Qa(i,l,a,c,s)),s&&d&2048&&mv(l.alternate,l);break;case 24:Qa(i,l,a,c,s),s&&d&2048&&pv(l.alternate,l);break;default:Qa(i,l,a,c,s)}t=t.sibling}}function cc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,n=t,s=n.flags;switch(n.tag){case 22:cc(r,n),s&2048&&mv(n.alternate,n);break;case 24:cc(r,n),s&2048&&pv(n.alternate,n);break;default:cc(r,n)}t=t.sibling}}var Kl=8192;function za(e,t,r){if(e.subtreeFlags&Kl)for(e=e.child;e!==null;)Tw(e,t,r),e=e.sibling}function Tw(e,t,r){switch(e.tag){case 26:za(e,t,r),e.flags&Kl&&e.memoizedState!==null&&fA(r,Cn,e.memoizedState,e.memoizedProps);break;case 5:za(e,t,r);break;case 3:case 4:var n=Cn;Cn=zd(e.stateNode.containerInfo),za(e,t,r),Cn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Kl,Kl=16777216,za(e,t,r),Kl=n):za(e,t,r));break;default:za(e,t,r)}}function Aw(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];Ut=n,Ow(n,e)}Aw(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dw(e),e=e.sibling}function Dw(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ai(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,od(e)):Ol(e);break;default:Ol(e)}}function od(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];Ut=n,Ow(n,e)}Aw(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ai(8,t,t.return),od(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,od(t));break;default:od(t)}e=e.sibling}}function Ow(e,t){for(;Ut!==null;){var r=Ut;switch(r.tag){case 0:case 11:case 15:Ai(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var n=r.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Xc(r.memoizedState.cache)}if(n=r.child,n!==null)n.return=r,Ut=n;else e:for(r=e;Ut!==null;){n=Ut;var s=n.sibling,i=n.return;if(ww(n),n===r){Ut=null;break e}if(s!==null){s.return=i,Ut=s;break e}Ut=i}}}var kT={getCacheForType:function(e){var t=Xt(Dt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return Xt(Dt).controller.signal}},RT=typeof WeakMap=="function"?WeakMap:Map,$e=0,it=null,Be=null,Ie=0,Ze=0,Tr=null,ui=!1,gl=!1,gv=!1,Rs=0,yt=0,Di=0,ga=0,vv=0,Ir=0,Zo=0,uc=null,br=null,ap=!1,Of=0,Mw=0,Od=1/0,Md=null,yi=null,Pt=0,xi=null,Xo=null,bs=0,op=0,lp=null,Lw=null,dc=0,cp=null;function Ur(){return $e&2&&Ie!==0?Ie&-Ie:we.T!==null?yv():VS()}function Pw(){if(Ir===0)if(!(Ie&536870912)||ze){var e=wu;wu<<=1,!(wu&3932160)&&(wu=262144),Ir=e}else Ir=536870912;return e=Wr.current,e!==null&&(e.flags|=32),Ir}function wr(e,t,r){(e===it&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Qo(e,0),di(e,Ie,Ir,!1)),Kc(e,r),(!($e&2)||e!==it)&&(e===it&&(!($e&2)&&(ga|=r),yt===4&&di(e,Ie,Ir,!1)),Jn(e))}function Bw(e,t,r){if($e&6)throw Error(ee(327));var n=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Gc(e,t),s=n?AT(e,t):Fh(e,t,!0),i=n;do{if(s===0){gl&&!n&&di(e,t,0,!1);break}else{if(r=e.current.alternate,i&&!NT(r)){s=Fh(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var a=e;s=uc;var c=a.current.memoizedState.isDehydrated;if(c&&(Qo(a,l).flags|=256),l=Fh(a,l,!1),l!==2){if(gv&&!c){a.errorRecoveryDisabledLanes|=i,ga|=i,s=4;break e}i=br,br=s,i!==null&&(br===null?br=i:br.push.apply(br,i))}s=l}if(i=!1,s!==2)continue}}if(s===1){Qo(e,0),di(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(ee(345));case 4:if((t&4194048)!==t)break;case 6:di(n,t,Ir,!ui);break e;case 2:br=null;break;case 3:case 5:break;default:throw Error(ee(329))}if((t&62914560)===t&&(s=Of+300-Hr(),10<s)){if(di(n,t,Ir,!ui),Sf(n,0,!0)!==0)break e;bs=t,n.timeoutHandle=nC(ex.bind(null,n,r,br,Md,ap,t,Ir,ga,Zo,ui,i,"Throttled",-0,0),s);break e}ex(n,r,br,Md,ap,t,Ir,ga,Zo,ui,i,null,-0,0)}}break}while(!0);Jn(e)}function ex(e,t,r,n,s,i,l,a,c,d,p,u,g,_){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vs},Tw(t,i,u);var x=(i&62914560)===i?Of-Hr():(i&4194048)===i?Mw-Hr():0;if(x=hA(u,x),x!==null){bs=i,e.cancelPendingCommit=x(rx.bind(null,e,t,i,r,n,s,l,a,c,p,u,null,g,_)),di(e,i,l,!d);return}}rx(e,t,i,r,n,s,l,a,c)}function NT(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!qr(i(),s))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function di(e,t,r,n){t&=~vv,t&=~ga,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-Fr(s),l=1<<i;n[i]=-1,s&=~l}r!==0&&FS(e,r,t)}function Mf(){return $e&6?!0:(eu(0),!1)}function _v(){if(Be!==null){if(Ze===0)var e=Be.return;else e=Be,_s=Ta=null,nv(e),bo=null,Sc=0,e=Be;for(;e!==null;)gw(e.alternate,e),e=e.return;Be=null}}function Qo(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,YT(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),bs=0,_v(),it=e,Be=r=ys(e.current,null),Ie=t,Ze=0,Tr=null,ui=!1,gl=Gc(e,t),gv=!1,Zo=Ir=vv=ga=Di=yt=0,br=uc=null,ap=!1,t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-Fr(n),i=1<<s;t|=e[s],n&=~i}return Rs=t,jf(),r}function Iw(e,t){Re=null,we.H=Cc,t===pl||t===Rf?(t=Dy(),Ze=3):t===Zg?(t=Dy(),Ze=4):Ze=t===fv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Tr=t,Be===null&&(yt=1,Td(e,an(t,e.current)))}function Hw(){var e=Wr.current;return e===null?!0:(Ie&4194048)===Ie?cn===null:(Ie&62914560)===Ie||Ie&536870912?e===cn:!1}function zw(){var e=we.H;return we.H=Cc,e===null?Cc:e}function Fw(){var e=we.A;return we.A=kT,e}function Ld(){yt=4,ui||(Ie&4194048)!==Ie&&Wr.current!==null||(gl=!0),!(Di&134217727)&&!(ga&134217727)||it===null||di(it,Ie,Ir,!1)}function Fh(e,t,r){var n=$e;$e|=2;var s=zw(),i=Fw();(it!==e||Ie!==t)&&(Md=null,Qo(e,t)),t=!1;var l=yt;e:do try{if(Ze!==0&&Be!==null){var a=Be,c=Tr;switch(Ze){case 8:_v(),l=6;break e;case 3:case 2:case 9:case 6:Wr.current===null&&(t=!0);var d=Ze;if(Ze=0,Tr=null,po(e,a,c,d),r&&gl){l=0;break e}break;default:d=Ze,Ze=0,Tr=null,po(e,a,c,d)}}TT(),l=yt;break}catch(p){Iw(e,p)}while(!0);return t&&e.shellSuspendCounter++,_s=Ta=null,$e=n,we.H=s,we.A=i,Be===null&&(it=null,Ie=0,jf()),l}function TT(){for(;Be!==null;)Uw(Be)}function AT(e,t){var r=$e;$e|=2;var n=zw(),s=Fw();it!==e||Ie!==t?(Md=null,Od=Hr()+500,Qo(e,t)):gl=Gc(e,t);e:do try{if(Ze!==0&&Be!==null){t=Be;var i=Tr;t:switch(Ze){case 1:Ze=0,Tr=null,po(e,t,i,1);break;case 2:case 9:if(Ay(i)){Ze=0,Tr=null,tx(t);break}t=function(){Ze!==2&&Ze!==9||it!==e||(Ze=7),Jn(e)},i.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Ay(i)?(Ze=0,Tr=null,tx(t)):(Ze=0,Tr=null,po(e,t,i,7));break;case 5:var l=null;switch(Be.tag){case 26:l=Be.memoizedState;case 5:case 27:var a=Be;if(l?lC(l):a.stateNode.complete){Ze=0,Tr=null;var c=a.sibling;if(c!==null)Be=c;else{var d=a.return;d!==null?(Be=d,Lf(d)):Be=null}break t}}Ze=0,Tr=null,po(e,t,i,5);break;case 6:Ze=0,Tr=null,po(e,t,i,6);break;case 8:_v(),yt=6;break e;default:throw Error(ee(462))}}DT();break}catch(p){Iw(e,p)}while(!0);return _s=Ta=null,we.H=n,we.A=s,$e=r,Be!==null?0:(it=null,Ie=0,jf(),yt)}function DT(){for(;Be!==null&&!tN();)Uw(Be)}function Uw(e){var t=pw(e.alternate,e,Rs);e.memoizedProps=e.pendingProps,t===null?Lf(e):Be=t}function tx(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Ky(r,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Ky(r,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:nv(t);default:gw(r,t),t=Be=g1(t,Rs),t=pw(r,t,Rs)}e.memoizedProps=e.pendingProps,t===null?Lf(e):Be=t}function po(e,t,r,n){_s=Ta=null,nv(t),bo=null,Sc=0;var s=t.return;try{if(xT(e,s,t,r,Ie)){yt=1,Td(e,an(r,e.current)),Be=null;return}}catch(i){if(s!==null)throw Be=s,i;yt=1,Td(e,an(r,e.current)),Be=null;return}t.flags&32768?(ze||n===1?e=!0:gl||Ie&536870912?e=!1:(ui=e=!0,(n===2||n===9||n===3||n===6)&&(n=Wr.current,n!==null&&n.tag===13&&(n.flags|=16384))),$w(t,e)):Lf(t)}function Lf(e){var t=e;do{if(t.flags&32768){$w(t,ui);return}e=t.return;var r=wT(t.alternate,t,Rs);if(r!==null){Be=r;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);yt===0&&(yt=5)}function $w(e,t){do{var r=CT(e.alternate,e);if(r!==null){r.flags&=32767,Be=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=r}while(e!==null);yt=6,Be=null}function rx(e,t,r,n,s,i,l,a,c){e.cancelPendingCommit=null;do Pf();while(Pt!==0);if($e&6)throw Error(ee(327));if(t!==null){if(t===e.current)throw Error(ee(177));if(i=t.lanes|t.childLanes,i|=$g,dN(e,r,i,l,a,c),e===it&&(Be=it=null,Ie=0),Xo=t,xi=e,bs=r,op=i,lp=s,Lw=n,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,PT(yd,function(){return Kw(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,t.subtreeFlags&13878||n){n=we.T,we.T=null,s=Ve.p,Ve.p=2,l=$e,$e|=4;try{ET(e,t,r)}finally{$e=l,Ve.p=s,we.T=n}}Pt=1,Vw(),qw(),Ww()}}function Vw(){if(Pt===1){Pt=0;var e=xi,t=Xo,r=(t.flags&13878)!==0;if(t.subtreeFlags&13878||r){r=we.T,we.T=null;var n=Ve.p;Ve.p=2;var s=$e;$e|=4;try{kw(t,e);var i=hp,l=l1(e.containerInfo),a=i.focusedElem,c=i.selectionRange;if(l!==a&&a&&a.ownerDocument&&o1(a.ownerDocument.documentElement,a)){if(c!==null&&Ug(a)){var d=c.start,p=c.end;if(p===void 0&&(p=d),"selectionStart"in a)a.selectionStart=d,a.selectionEnd=Math.min(p,a.value.length);else{var u=a.ownerDocument||document,g=u&&u.defaultView||window;if(g.getSelection){var _=g.getSelection(),x=a.textContent.length,b=Math.min(c.start,x),h=c.end===void 0?b:Math.min(c.end,x);!_.extend&&b>h&&(l=h,h=b,b=l);var f=Cy(a,b),m=Cy(a,h);if(f&&m&&(_.rangeCount!==1||_.anchorNode!==f.node||_.anchorOffset!==f.offset||_.focusNode!==m.node||_.focusOffset!==m.offset)){var v=u.createRange();v.setStart(f.node,f.offset),_.removeAllRanges(),b>h?(_.addRange(v),_.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),_.addRange(v))}}}}for(u=[],_=a;_=_.parentNode;)_.nodeType===1&&u.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<u.length;a++){var y=u[a];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}$d=!!fp,hp=fp=null}finally{$e=s,Ve.p=n,we.T=r}}e.current=t,Pt=2}}function qw(){if(Pt===2){Pt=0;var e=xi,t=Xo,r=(t.flags&8772)!==0;if(t.subtreeFlags&8772||r){r=we.T,we.T=null;var n=Ve.p;Ve.p=2;var s=$e;$e|=4;try{Sw(e,t.alternate,t)}finally{$e=s,Ve.p=n,we.T=r}}Pt=3}}function Ww(){if(Pt===4||Pt===3){Pt=0,rN();var e=xi,t=Xo,r=bs,n=Lw;t.subtreeFlags&10256||t.flags&10256?Pt=5:(Pt=0,Xo=xi=null,Gw(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(yi=null),Lg(r),t=t.stateNode,zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(Wc,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=we.T,s=Ve.p,Ve.p=2,we.T=null;try{for(var i=e.onRecoverableError,l=0;l<n.length;l++){var a=n[l];i(a.value,{componentStack:a.stack})}}finally{we.T=t,Ve.p=s}}bs&3&&Pf(),Jn(e),s=e.pendingLanes,r&261930&&s&42?e===cp?dc++:(dc=0,cp=e):dc=0,eu(0)}}function Gw(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xc(t)))}function Pf(){return Vw(),qw(),Ww(),Kw()}function Kw(){if(Pt!==5)return!1;var e=xi,t=op;op=0;var r=Lg(bs),n=we.T,s=Ve.p;try{Ve.p=32>r?32:r,we.T=null,r=lp,lp=null;var i=xi,l=bs;if(Pt=0,Xo=xi=null,bs=0,$e&6)throw Error(ee(331));var a=$e;if($e|=4,Dw(i.current),Nw(i,i.current,l,r),$e=a,eu(0,!1),zr&&typeof zr.onPostCommitFiberRoot=="function")try{zr.onPostCommitFiberRoot(Wc,i)}catch{}return!0}finally{Ve.p=s,we.T=n,Gw(e,t)}}function nx(e,t,r){t=an(r,t),t=rp(e.stateNode,t,2),e=_i(e,t,2),e!==null&&(Kc(e,2),Jn(e))}function Xe(e,t,r){if(e.tag===3)nx(e,e,r);else for(;t!==null;){if(t.tag===3){nx(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(yi===null||!yi.has(n))){e=an(r,e),r=cw(2),n=_i(t,r,2),n!==null&&(uw(r,n,t,e),Kc(n,2),Jn(n));break}}t=t.return}}function Uh(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new RT;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(gv=!0,s.add(r),e=OT.bind(null,e,t,r),t.then(e,e))}function OT(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,it===e&&(Ie&r)===r&&(yt===4||yt===3&&(Ie&62914560)===Ie&&300>Hr()-Of?!($e&2)&&Qo(e,0):vv|=r,Zo===Ie&&(Zo=0)),Jn(e)}function Yw(e,t){t===0&&(t=zS()),e=Na(e,t),e!==null&&(Kc(e,t),Jn(e))}function MT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Yw(e,r)}function LT(e,t){var r=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(ee(314))}n!==null&&n.delete(t),Yw(e,r)}function PT(e,t){return Og(e,t)}var Pd=null,Ja=null,up=!1,Bd=!1,$h=!1,fi=0;function Jn(e){e!==Ja&&e.next===null&&(Ja===null?Pd=Ja=e:Ja=Ja.next=e),Bd=!0,up||(up=!0,IT())}function eu(e,t){if(!$h&&Bd){$h=!0;do for(var r=!1,n=Pd;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var l=n.suspendedLanes,a=n.pingedLanes;i=(1<<31-Fr(42|e)+1)-1,i&=s&~(l&~a),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(r=!0,sx(n,i))}else i=Ie,i=Sf(n,n===it?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(i&3)||Gc(n,i)||(r=!0,sx(n,i));n=n.next}while(r);$h=!1}}function BT(){Zw()}function Zw(){Bd=up=!1;var e=0;fi!==0&&KT()&&(e=fi);for(var t=Hr(),r=null,n=Pd;n!==null;){var s=n.next,i=Xw(n,t);i===0?(n.next=null,r===null?Pd=s:r.next=s,s===null&&(Ja=r)):(r=n,(e!==0||i&3)&&(Bd=!0)),n=s}Pt!==0&&Pt!==5||eu(e),fi!==0&&(fi=0)}function Xw(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var l=31-Fr(i),a=1<<l,c=s[l];c===-1?(!(a&r)||a&n)&&(s[l]=uN(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}if(t=it,r=Ie,r=Sf(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,r===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&vh(n),e.callbackNode=null,e.callbackPriority=0;if(!(r&3)||Gc(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(n!==null&&vh(n),Lg(r)){case 2:case 8:r=IS;break;case 32:r=yd;break;case 268435456:r=HS;break;default:r=yd}return n=Qw.bind(null,e),r=Og(r,n),e.callbackPriority=t,e.callbackNode=r,t}return n!==null&&n!==null&&vh(n),e.callbackPriority=2,e.callbackNode=null,2}function Qw(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Pf()&&e.callbackNode!==r)return null;var n=Ie;return n=Sf(e,e===it?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Bw(e,n,t),Xw(e,Hr()),e.callbackNode!=null&&e.callbackNode===r?Qw.bind(null,e):null)}function sx(e,t){if(Pf())return null;Bw(e,t,!0)}function IT(){ZT(function(){$e&6?Og(BS,BT):Zw()})}function yv(){if(fi===0){var e=Go;e===0&&(e=Su,Su<<=1,!(Su&261888)&&(Su=256)),fi=e}return fi}function ix(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qu(""+e)}function ax(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function HT(e,t,r,n,s){if(t==="submit"&&r&&r.stateNode===s){var i=ix((s[jr]||null).action),l=n.submitter;l&&(t=(t=l[jr]||null)?ix(t.formAction):l.getAttribute("formAction"),t!==null&&(i=t,l=null));var a=new wf("action","action",null,n,s);e.push({event:a,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(fi!==0){var c=l?ax(s,l):new FormData(s);ep(r,{pending:!0,data:c,method:s.method,action:i},null,c)}}else typeof i=="function"&&(a.preventDefault(),c=l?ax(s,l):new FormData(s),ep(r,{pending:!0,data:c,method:s.method,action:i},i,c))},currentTarget:s}]})}}for(var Vh=0;Vh<Um.length;Vh++){var qh=Um[Vh],zT=qh.toLowerCase(),FT=qh[0].toUpperCase()+qh.slice(1);Mn(zT,"on"+FT)}Mn(u1,"onAnimationEnd");Mn(d1,"onAnimationIteration");Mn(f1,"onAnimationStart");Mn("dblclick","onDoubleClick");Mn("focusin","onFocus");Mn("focusout","onBlur");Mn(nT,"onTransitionRun");Mn(sT,"onTransitionStart");Mn(iT,"onTransitionCancel");Mn(h1,"onTransitionEnd");qo("onMouseEnter",["mouseout","mouseover"]);qo("onMouseLeave",["mouseout","mouseover"]);qo("onPointerEnter",["pointerout","pointerover"]);qo("onPointerLeave",["pointerout","pointerover"]);ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ja("onBeforeInput",["compositionend","keypress","textInput","paste"]);ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ec="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(" "),UT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ec));function Jw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var l=n.length-1;0<=l;l--){var a=n[l],c=a.instance,d=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;i=a,s.currentTarget=d;try{i(s)}catch(p){bd(p)}s.currentTarget=null,i=c}else for(l=0;l<n.length;l++){if(a=n[l],c=a.instance,d=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;i=a,s.currentTarget=d;try{i(s)}catch(p){bd(p)}s.currentTarget=null,i=c}}}}function Pe(e,t){var r=t[Mm];r===void 0&&(r=t[Mm]=new Set);var n=e+"__bubble";r.has(n)||(eC(t,e,2,!1),r.add(n))}function Wh(e,t,r){var n=0;t&&(n|=4),eC(r,e,n,t)}var Du="_reactListening"+Math.random().toString(36).slice(2);function xv(e){if(!e[Du]){e[Du]=!0,qS.forEach(function(r){r!=="selectionchange"&&(UT.has(r)||Wh(r,!1,e),Wh(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Du]||(t[Du]=!0,Wh("selectionchange",!1,t))}}function eC(e,t,r,n){switch(hC(t)){case 2:var s=gA;break;case 8:s=vA;break;default:s=Cv}r=s.bind(null,t,r,e),s=void 0,!Hm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Gh(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var a=n.stateNode.containerInfo;if(a===s)break;if(l===4)for(l=n.return;l!==null;){var c=l.tag;if((c===3||c===4)&&l.stateNode.containerInfo===s)return;l=l.return}for(;a!==null;){if(l=io(a),l===null)return;if(c=l.tag,c===5||c===6||c===26||c===27){n=i=l;continue e}a=a.parentNode}}n=n.return}JS(function(){var d=i,p=Ig(r),u=[];e:{var g=m1.get(e);if(g!==void 0){var _=wf,x=e;switch(e){case"keypress":if(ed(r)===0)break e;case"keydown":case"keyup":_=LN;break;case"focusin":x="focus",_=Sh;break;case"focusout":x="blur",_=Sh;break;case"beforeblur":case"afterblur":_=Sh;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":_=my;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=wN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=IN;break;case u1:case d1:case f1:_=jN;break;case h1:_=zN;break;case"scroll":case"scrollend":_=bN;break;case"wheel":_=UN;break;case"copy":case"cut":case"paste":_=RN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=gy;break;case"toggle":case"beforetoggle":_=VN}var b=(t&4)!==0,h=!b&&(e==="scroll"||e==="scrollend"),f=b?g!==null?g+"Capture":null:g;b=[];for(var m=d,v;m!==null;){var y=m;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=vc(m,f),y!=null&&b.push(jc(m,y,v))),h)break;m=m.return}0<b.length&&(g=new _(g,x,null,r,p),u.push({event:g,listeners:b}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",g&&r!==Im&&(x=r.relatedTarget||r.fromElement)&&(io(x)||x[fl]))break e;if((_||g)&&(g=p.window===p?p:(g=p.ownerDocument)?g.defaultView||g.parentWindow:window,_?(x=r.relatedTarget||r.toElement,_=d,x=x?io(x):null,x!==null&&(h=qc(x),b=x.tag,x!==h||b!==5&&b!==27&&b!==6)&&(x=null)):(_=null,x=d),_!==x)){if(b=my,y="onMouseLeave",f="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=gy,y="onPointerLeave",f="onPointerEnter",m="pointer"),h=_==null?g:Wl(_),v=x==null?g:Wl(x),g=new b(y,m+"leave",_,r,p),g.target=h,g.relatedTarget=v,y=null,io(p)===d&&(b=new b(f,m+"enter",x,r,p),b.target=v,b.relatedTarget=h,y=b),h=y,_&&x)t:{for(b=$T,f=_,m=x,v=0,y=f;y;y=b(y))v++;y=0;for(var S=m;S;S=b(S))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)m=b(m),y--;for(;v--;){if(f===m||m!==null&&f===m.alternate){b=f;break t}f=b(f),m=b(m)}b=null}else b=null;_!==null&&ox(u,g,_,b,!1),x!==null&&h!==null&&ox(u,h,x,b,!0)}}e:{if(g=d?Wl(d):window,_=g.nodeName&&g.nodeName.toLowerCase(),_==="select"||_==="input"&&g.type==="file")var E=xy;else if(yy(g))if(i1)E=eT;else{E=QN;var k=XN}else _=g.nodeName,!_||_.toLowerCase()!=="input"||g.type!=="checkbox"&&g.type!=="radio"?d&&Bg(d.elementType)&&(E=xy):E=JN;if(E&&(E=E(e,d))){s1(u,E,r,p);break e}k&&k(e,g,d),e==="focusout"&&d&&g.type==="number"&&d.memoizedProps.value!=null&&Bm(g,"number",g.value)}switch(k=d?Wl(d):window,e){case"focusin":(yy(k)||k.contentEditable==="true")&&(lo=k,zm=d,rc=null);break;case"focusout":rc=zm=lo=null;break;case"mousedown":Fm=!0;break;case"contextmenu":case"mouseup":case"dragend":Fm=!1,Ey(u,r,p);break;case"selectionchange":if(rT)break;case"keydown":case"keyup":Ey(u,r,p)}var w;if(Fg)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else oo?r1(e,r)&&(j="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(j="onCompositionStart");j&&(t1&&r.locale!=="ko"&&(oo||j!=="onCompositionStart"?j==="onCompositionEnd"&&oo&&(w=e1()):(ci=p,Hg="value"in ci?ci.value:ci.textContent,oo=!0)),k=Id(d,j),0<k.length&&(j=new py(j,e,null,r,p),u.push({event:j,listeners:k}),w?j.data=w:(w=n1(r),w!==null&&(j.data=w)))),(w=WN?GN(e,r):KN(e,r))&&(j=Id(d,"onBeforeInput"),0<j.length&&(k=new py("onBeforeInput","beforeinput",null,r,p),u.push({event:k,listeners:j}),k.data=w)),HT(u,e,d,r,p)}Jw(u,t)})}function jc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Id(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=vc(e,r),s!=null&&n.unshift(jc(e,s,i)),s=vc(e,t),s!=null&&n.push(jc(e,s,i))),e.tag===3)return n;e=e.return}return[]}function $T(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ox(e,t,r,n,s){for(var i=t._reactName,l=[];r!==null&&r!==n;){var a=r,c=a.alternate,d=a.stateNode;if(a=a.tag,c!==null&&c===n)break;a!==5&&a!==26&&a!==27||d===null||(c=d,s?(d=vc(r,i),d!=null&&l.unshift(jc(r,d,c))):s||(d=vc(r,i),d!=null&&l.push(jc(r,d,c)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var VT=/\r\n?/g,qT=/\u0000|\uFFFD/g;function lx(e){return(typeof e=="string"?e:""+e).replace(VT,`
|
|
49
|
+
`).replace(qT,"")}function tC(e,t){return t=lx(t),lx(e)===t}function tt(e,t,r,n,s,i){switch(r){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Wo(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Wo(e,""+n);break;case"className":Eu(e,"class",n);break;case"tabIndex":Eu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Eu(e,r,n);break;case"style":QS(e,n,i);break;case"data":if(t!=="object"){Eu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=Qu(""+n),e.setAttribute(r,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(r==="formAction"?(t!=="input"&&tt(e,t,"name",s.name,s,null),tt(e,t,"formEncType",s.formEncType,s,null),tt(e,t,"formMethod",s.formMethod,s,null),tt(e,t,"formTarget",s.formTarget,s,null)):(tt(e,t,"encType",s.encType,s,null),tt(e,t,"method",s.method,s,null),tt(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=Qu(""+n),e.setAttribute(r,n);break;case"onClick":n!=null&&(e.onclick=vs);break;case"onScroll":n!=null&&Pe("scroll",e);break;case"onScrollEnd":n!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(ee(61));if(r=n.__html,r!=null){if(s.children!=null)throw Error(ee(60));e.innerHTML=r}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}r=Qu(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,""+n):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":n===!0?e.setAttribute(r,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,n):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(r,n):e.removeAttribute(r);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(r):e.setAttribute(r,n);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),Xu(e,"popover",n);break;case"xlinkActuate":ns(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ns(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ns(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ns(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ns(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ns(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ns(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ns(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ns(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Xu(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=yN.get(r)||r,Xu(e,r,n))}}function dp(e,t,r,n,s,i){switch(r){case"style":QS(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(ee(61));if(r=n.__html,r!=null){if(s.children!=null)throw Error(ee(60));e.innerHTML=r}}break;case"children":typeof n=="string"?Wo(e,n):(typeof n=="number"||typeof n=="bigint")&&Wo(e,""+n);break;case"onScroll":n!=null&&Pe("scroll",e);break;case"onScrollEnd":n!=null&&Pe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=vs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!WS.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(s=r.endsWith("Capture"),t=r.slice(2,s?r.length-7:void 0),i=e[jr]||null,i=i!=null?i[r]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,n,s);break e}r in e?e[r]=n:n===!0?e.setAttribute(r,""):Xu(e,r,n)}}}function Qt(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var n=!1,s=!1,i;for(i in r)if(r.hasOwnProperty(i)){var l=r[i];if(l!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ee(137,t));default:tt(e,t,i,l,r,null)}}s&&tt(e,t,"srcSet",r.srcSet,r,null),n&&tt(e,t,"src",r.src,r,null);return;case"input":Pe("invalid",e);var a=i=l=s=null,c=null,d=null;for(n in r)if(r.hasOwnProperty(n)){var p=r[n];if(p!=null)switch(n){case"name":s=p;break;case"type":l=p;break;case"checked":c=p;break;case"defaultChecked":d=p;break;case"value":i=p;break;case"defaultValue":a=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(ee(137,t));break;default:tt(e,t,n,p,r,null)}}YS(e,i,a,c,d,l,s,!1);return;case"select":Pe("invalid",e),n=l=i=null;for(s in r)if(r.hasOwnProperty(s)&&(a=r[s],a!=null))switch(s){case"value":i=a;break;case"defaultValue":l=a;break;case"multiple":n=a;default:tt(e,t,s,a,r,null)}t=i,r=l,e.multiple=!!n,t!=null?_o(e,!!n,t,!1):r!=null&&_o(e,!!n,r,!0);return;case"textarea":Pe("invalid",e),i=s=n=null;for(l in r)if(r.hasOwnProperty(l)&&(a=r[l],a!=null))switch(l){case"value":n=a;break;case"defaultValue":s=a;break;case"children":i=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(ee(91));break;default:tt(e,t,l,a,r,null)}XS(e,n,s,i);return;case"option":for(c in r)if(r.hasOwnProperty(c)&&(n=r[c],n!=null))switch(c){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:tt(e,t,c,n,r,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(n=0;n<Ec.length;n++)Pe(Ec[n],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in r)if(r.hasOwnProperty(d)&&(n=r[d],n!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(ee(137,t));default:tt(e,t,d,n,r,null)}return;default:if(Bg(t)){for(p in r)r.hasOwnProperty(p)&&(n=r[p],n!==void 0&&dp(e,t,p,n,r,void 0));return}}for(a in r)r.hasOwnProperty(a)&&(n=r[a],n!=null&&tt(e,t,a,n,r,null))}function WT(e,t,r,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,i=null,l=null,a=null,c=null,d=null,p=null;for(_ in r){var u=r[_];if(r.hasOwnProperty(_)&&u!=null)switch(_){case"checked":break;case"value":break;case"defaultValue":c=u;default:n.hasOwnProperty(_)||tt(e,t,_,null,n,u)}}for(var g in n){var _=n[g];if(u=r[g],n.hasOwnProperty(g)&&(_!=null||u!=null))switch(g){case"type":i=_;break;case"name":s=_;break;case"checked":d=_;break;case"defaultChecked":p=_;break;case"value":l=_;break;case"defaultValue":a=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(ee(137,t));break;default:_!==u&&tt(e,t,g,_,n,u)}}Pm(e,l,a,c,d,p,i,s);return;case"select":_=l=a=g=null;for(i in r)if(c=r[i],r.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":_=c;default:n.hasOwnProperty(i)||tt(e,t,i,null,n,c)}for(s in n)if(i=n[s],c=r[s],n.hasOwnProperty(s)&&(i!=null||c!=null))switch(s){case"value":g=i;break;case"defaultValue":a=i;break;case"multiple":l=i;default:i!==c&&tt(e,t,s,i,n,c)}t=a,r=l,n=_,g!=null?_o(e,!!r,g,!1):!!n!=!!r&&(t!=null?_o(e,!!r,t,!0):_o(e,!!r,r?[]:"",!1));return;case"textarea":_=g=null;for(a in r)if(s=r[a],r.hasOwnProperty(a)&&s!=null&&!n.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:tt(e,t,a,null,n,s)}for(l in n)if(s=n[l],i=r[l],n.hasOwnProperty(l)&&(s!=null||i!=null))switch(l){case"value":g=s;break;case"defaultValue":_=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(ee(91));break;default:s!==i&&tt(e,t,l,s,n,i)}ZS(e,g,_);return;case"option":for(var x in r)if(g=r[x],r.hasOwnProperty(x)&&g!=null&&!n.hasOwnProperty(x))switch(x){case"selected":e.selected=!1;break;default:tt(e,t,x,null,n,g)}for(c in n)if(g=n[c],_=r[c],n.hasOwnProperty(c)&&g!==_&&(g!=null||_!=null))switch(c){case"selected":e.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:tt(e,t,c,g,n,_)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in r)g=r[b],r.hasOwnProperty(b)&&g!=null&&!n.hasOwnProperty(b)&&tt(e,t,b,null,n,g);for(d in n)if(g=n[d],_=r[d],n.hasOwnProperty(d)&&g!==_&&(g!=null||_!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(ee(137,t));break;default:tt(e,t,d,g,n,_)}return;default:if(Bg(t)){for(var h in r)g=r[h],r.hasOwnProperty(h)&&g!==void 0&&!n.hasOwnProperty(h)&&dp(e,t,h,void 0,n,g);for(p in n)g=n[p],_=r[p],!n.hasOwnProperty(p)||g===_||g===void 0&&_===void 0||dp(e,t,p,g,n,_);return}}for(var f in r)g=r[f],r.hasOwnProperty(f)&&g!=null&&!n.hasOwnProperty(f)&&tt(e,t,f,null,n,g);for(u in n)g=n[u],_=r[u],!n.hasOwnProperty(u)||g===_||g==null&&_==null||tt(e,t,u,g,n,_)}function cx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GT(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),n=0;n<r.length;n++){var s=r[n],i=s.transferSize,l=s.initiatorType,a=s.duration;if(i&&a&&cx(l)){for(l=0,a=s.responseEnd,n+=1;n<r.length;n++){var c=r[n],d=c.startTime;if(d>a)break;var p=c.transferSize,u=c.initiatorType;p&&cx(u)&&(c=c.responseEnd,l+=p*(c<a?1:(a-d)/(c-d)))}if(--n,t+=8*(i+l)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fp=null,hp=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function ux(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rC(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function mp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kh=null;function KT(){var e=window.event;return e&&e.type==="popstate"?e===Kh?!1:(Kh=e,!0):(Kh=null,!1)}var nC=typeof setTimeout=="function"?setTimeout:void 0,YT=typeof clearTimeout=="function"?clearTimeout:void 0,dx=typeof Promise=="function"?Promise:void 0,ZT=typeof queueMicrotask=="function"?queueMicrotask:typeof dx<"u"?function(e){return dx.resolve(null).then(e).catch(XT)}:nC;function XT(e){setTimeout(function(){throw e})}function Ii(e){return e==="head"}function fx(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"||r==="/&"){if(n===0){e.removeChild(s),el(t);return}n--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")n++;else if(r==="html")fc(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,fc(r);for(var i=r.firstChild;i;){var l=i.nextSibling,a=i.nodeName;i[Yc]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&i.rel.toLowerCase()==="stylesheet"||r.removeChild(i),i=l}}else r==="body"&&fc(e.ownerDocument.body);r=s}while(r);el(t)}function hx(e,t){var r=e;e=0;do{var n=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=n}while(r)}function pp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":pp(r),Pg(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function QT(e,t,r,n){for(;e.nodeType===1;){var s=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Yc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=un(e.nextSibling),e===null)break}return null}function JT(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=un(e.nextSibling),e===null))return null;return e}function sC(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=un(e.nextSibling),e===null))return null;return e}function gp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function eA(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var n=function(){t(),r.removeEventListener("DOMContentLoaded",n)};r.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _p=null;function mx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return un(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function px(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function iC(e,t,r){switch(t=Hd(r),e){case"html":if(e=t.documentElement,!e)throw Error(ee(452));return e;case"head":if(e=t.head,!e)throw Error(ee(453));return e;case"body":if(e=t.body,!e)throw Error(ee(454));return e;default:throw Error(ee(451))}}function fc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pg(e)}var mn=new Map,gx=new Set;function zd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ms=Ve.d;Ve.d={f:tA,r:rA,D:nA,C:sA,L:iA,m:aA,X:lA,S:oA,M:cA};function tA(){var e=Ms.f(),t=Mf();return e||t}function rA(e){var t=hl(e);t!==null&&t.tag===5&&t.type==="form"?Q1(t):Ms.r(e)}var vl=typeof document>"u"?null:document;function aC(e,t,r){var n=vl;if(n&&typeof t=="string"&&t){var s=sn(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof r=="string"&&(s+='[crossorigin="'+r+'"]'),gx.has(s)||(gx.add(s),e={rel:e,crossOrigin:r,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),Qt(t,"link",e),$t(t),n.head.appendChild(t)))}}function nA(e){Ms.D(e),aC("dns-prefetch",e,null)}function sA(e,t){Ms.C(e,t),aC("preconnect",e,t)}function iA(e,t,r){Ms.L(e,t,r);var n=vl;if(n&&e&&t){var s='link[rel="preload"][as="'+sn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(s+='[imagesrcset="'+sn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(s+='[imagesizes="'+sn(r.imageSizes)+'"]')):s+='[href="'+sn(e)+'"]';var i=s;switch(t){case"style":i=Jo(e);break;case"script":i=_l(e)}mn.has(i)||(e=ht({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),mn.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(tu(i))||t==="script"&&n.querySelector(ru(i))||(t=n.createElement("link"),Qt(t,"link",e),$t(t),n.head.appendChild(t)))}}function aA(e,t){Ms.m(e,t);var r=vl;if(r&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+sn(n)+'"][href="'+sn(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_l(e)}if(!mn.has(i)&&(e=ht({rel:"modulepreload",href:e},t),mn.set(i,e),r.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ru(i)))return}n=r.createElement("link"),Qt(n,"link",e),$t(n),r.head.appendChild(n)}}}function oA(e,t,r){Ms.S(e,t,r);var n=vl;if(n&&e){var s=vo(n).hoistableStyles,i=Jo(e);t=t||"default";var l=s.get(i);if(!l){var a={loading:0,preload:null};if(l=n.querySelector(tu(i)))a.loading=5;else{e=ht({rel:"stylesheet",href:e,"data-precedence":t},r),(r=mn.get(i))&&bv(e,r);var c=l=n.createElement("link");$t(c),Qt(c,"link",e),c._p=new Promise(function(d,p){c.onload=d,c.onerror=p}),c.addEventListener("load",function(){a.loading|=1}),c.addEventListener("error",function(){a.loading|=2}),a.loading|=4,ld(l,t,n)}l={type:"stylesheet",instance:l,count:1,state:a},s.set(i,l)}}}function lA(e,t){Ms.X(e,t);var r=vl;if(r&&e){var n=vo(r).hoistableScripts,s=_l(e),i=n.get(s);i||(i=r.querySelector(ru(s)),i||(e=ht({src:e,async:!0},t),(t=mn.get(s))&&Sv(e,t),i=r.createElement("script"),$t(i),Qt(i,"link",e),r.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function cA(e,t){Ms.M(e,t);var r=vl;if(r&&e){var n=vo(r).hoistableScripts,s=_l(e),i=n.get(s);i||(i=r.querySelector(ru(s)),i||(e=ht({src:e,async:!0,type:"module"},t),(t=mn.get(s))&&Sv(e,t),i=r.createElement("script"),$t(i),Qt(i,"link",e),r.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function vx(e,t,r,n){var s=(s=pi.current)?zd(s):null;if(!s)throw Error(ee(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Jo(r.href),r=vo(s).hoistableStyles,n=r.get(t),n||(n={type:"style",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Jo(r.href);var i=vo(s).hoistableStyles,l=i.get(e);if(l||(s=s.ownerDocument||s,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,l),(i=s.querySelector(tu(e)))&&!i._p&&(l.instance=i,l.state.loading=5),mn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},mn.set(e,r),i||uA(s,e,r,l.state))),t&&n===null)throw Error(ee(528,""));return l}if(t&&n!==null)throw Error(ee(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_l(r),r=vo(s).hoistableScripts,n=r.get(t),n||(n={type:"script",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(ee(444,e))}}function Jo(e){return'href="'+sn(e)+'"'}function tu(e){return'link[rel="stylesheet"]['+e+"]"}function oC(e){return ht({},e,{"data-precedence":e.precedence,precedence:null})}function uA(e,t,r,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Qt(t,"link",r),$t(t),e.head.appendChild(t))}function _l(e){return'[src="'+sn(e)+'"]'}function ru(e){return"script[async]"+e}function _x(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+sn(r.href)+'"]');if(n)return t.instance=n,$t(n),n;var s=ht({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),$t(n),Qt(n,"style",s),ld(n,r.precedence,e),t.instance=n;case"stylesheet":s=Jo(r.href);var i=e.querySelector(tu(s));if(i)return t.state.loading|=4,t.instance=i,$t(i),i;n=oC(r),(s=mn.get(s))&&bv(n,s),i=(e.ownerDocument||e).createElement("link"),$t(i);var l=i;return l._p=new Promise(function(a,c){l.onload=a,l.onerror=c}),Qt(i,"link",n),t.state.loading|=4,ld(i,r.precedence,e),t.instance=i;case"script":return i=_l(r.src),(s=e.querySelector(ru(i)))?(t.instance=s,$t(s),s):(n=r,(s=mn.get(i))&&(n=ht({},r),Sv(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),$t(s),Qt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(ee(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(n=t.instance,t.state.loading|=4,ld(n,r.precedence,e));return t.instance}function ld(e,t,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,l=0;l<n.length;l++){var a=n[l];if(a.dataset.precedence===t)i=a;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function bv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cd=null;function yx(e,t,r){if(cd===null){var n=new Map,s=cd=new Map;s.set(r,n)}else s=cd,n=s.get(r),n||(n=new Map,s.set(r,n));if(n.has(e))return n;for(n.set(e,null),r=r.getElementsByTagName(e),s=0;s<r.length;s++){var i=r[s];if(!(i[Yc]||i[Yt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var l=i.getAttribute(t)||"";l=e+l;var a=n.get(l);a?a.push(i):n.set(l,[i])}}return n}function xx(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function dA(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function lC(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function fA(e,t,r,n){if(r.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var s=Jo(n.href),i=t.querySelector(tu(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fd.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=i,$t(i);return}i=t.ownerDocument||t,n=oC(n),(s=mn.get(s))&&bv(n,s),i=i.createElement("link"),$t(i);var l=i;l._p=new Promise(function(a,c){l.onload=a,l.onerror=c}),Qt(i,"link",n),r.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&!(r.state.loading&3)&&(e.count++,r=Fd.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var Yh=0;function hA(e,t){return e.stylesheets&&e.count===0&&ud(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var n=setTimeout(function(){if(e.stylesheets&&ud(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Yh===0&&(Yh=62500*GT());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ud(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Yh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function Fd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ud(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ud=null;function ud(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ud=new Map,t.forEach(mA,e),Ud=null,Fd.call(e))}function mA(e,t){if(!(t.state.loading&4)){var r=Ud.get(e);if(r)var n=r.get(null);else{r=new Map,Ud.set(e,r);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var l=s[i];(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")&&(r.set(l.dataset.precedence,l),n=l)}n&&r.set(null,n)}s=t.instance,l=s.getAttribute("data-precedence"),i=r.get(l)||n,i===n&&r.set(null,s),r.set(l,s),this.count++,n=Fd.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var kc={$$typeof:gs,Provider:null,Consumer:null,_currentValue:fa,_currentValue2:fa,_threadCount:0};function pA(e,t,r,n,s,i,l,a,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_h(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_h(0),this.hiddenUpdates=_h(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cC(e,t,r,n,s,i,l,a,c,d,p,u){return e=new pA(e,t,r,l,c,d,p,u,a),t=1,i===!0&&(t|=24),i=Br(3,null,null,t),e.current=i,i.stateNode=e,t=Kg(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:r,cache:t},Xg(i),e}function uC(e){return e?(e=fo,e):fo}function dC(e,t,r,n,s,i){s=uC(s),n.context===null?n.context=s:n.pendingContext=s,n=vi(t),n.payload={element:r},i=i===void 0?null:i,i!==null&&(n.callback=i),r=_i(e,n,t),r!==null&&(wr(r,e,t),sc(r,e,t))}function bx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function wv(e,t){bx(e,t),(e=e.alternate)&&bx(e,t)}function fC(e){if(e.tag===13||e.tag===31){var t=Na(e,67108864);t!==null&&wr(t,e,67108864),wv(e,67108864)}}function Sx(e){if(e.tag===13||e.tag===31){var t=Ur();t=Mg(t);var r=Na(e,t);r!==null&&wr(r,e,t),wv(e,t)}}var $d=!0;function gA(e,t,r,n){var s=we.T;we.T=null;var i=Ve.p;try{Ve.p=2,Cv(e,t,r,n)}finally{Ve.p=i,we.T=s}}function vA(e,t,r,n){var s=we.T;we.T=null;var i=Ve.p;try{Ve.p=8,Cv(e,t,r,n)}finally{Ve.p=i,we.T=s}}function Cv(e,t,r,n){if($d){var s=yp(n);if(s===null)Gh(e,t,n,Vd,r),wx(e,n);else if(yA(s,e,t,r,n))n.stopPropagation();else if(wx(e,n),t&4&&-1<_A.indexOf(e)){for(;s!==null;){var i=hl(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var l=Xi(i.pendingLanes);if(l!==0){var a=i;for(a.pendingLanes|=2,a.entangledLanes|=2;l;){var c=1<<31-Fr(l);a.entanglements[1]|=c,l&=~c}Jn(i),!($e&6)&&(Od=Hr()+500,eu(0))}}break;case 31:case 13:a=Na(i,2),a!==null&&wr(a,i,2),Mf(),wv(i,2)}if(i=yp(n),i===null&&Gh(e,t,n,Vd,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else Gh(e,t,n,null,r)}}function yp(e){return e=Ig(e),Ev(e)}var Vd=null;function Ev(e){if(Vd=null,e=io(e),e!==null){var t=qc(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=DS(t),e!==null)return e;e=null}else if(r===31){if(e=OS(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 Vd=e,null}function hC(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nN()){case BS:return 2;case IS:return 8;case yd:case sN:return 32;case HS:return 268435456;default:return 32}default:return 32}}var xp=!1,bi=null,Si=null,wi=null,Rc=new Map,Nc=new Map,Qs=[],_A="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function wx(e,t){switch(e){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nc.delete(t.pointerId)}}function Ml(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=hl(t),t!==null&&fC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function yA(e,t,r,n,s){switch(t){case"focusin":return bi=Ml(bi,e,t,r,n,s),!0;case"dragenter":return Si=Ml(Si,e,t,r,n,s),!0;case"mouseover":return wi=Ml(wi,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return Rc.set(i,Ml(Rc.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Nc.set(i,Ml(Nc.get(i)||null,e,t,r,n,s)),!0}return!1}function mC(e){var t=io(e.target);if(t!==null){var r=qc(t);if(r!==null){if(t=r.tag,t===13){if(t=DS(r),t!==null){e.blockedOn=t,oy(e.priority,function(){Sx(r)});return}}else if(t===31){if(t=OS(r),t!==null){e.blockedOn=t,oy(e.priority,function(){Sx(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 dd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=yp(e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Im=n,r.target.dispatchEvent(n),Im=null}else return t=hl(r),t!==null&&fC(t),e.blockedOn=r,!1;t.shift()}return!0}function Cx(e,t,r){dd(e)&&r.delete(t)}function xA(){xp=!1,bi!==null&&dd(bi)&&(bi=null),Si!==null&&dd(Si)&&(Si=null),wi!==null&&dd(wi)&&(wi=null),Rc.forEach(Cx),Nc.forEach(Cx)}function Ou(e,t){e.blockedOn===t&&(e.blockedOn=null,xp||(xp=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,xA)))}var Mu=null;function Ex(e){Mu!==e&&(Mu=e,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,function(){Mu===e&&(Mu=null);for(var t=0;t<e.length;t+=3){var r=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Ev(n||r)===null)continue;break}var i=hl(r);i!==null&&(e.splice(t,3),t-=3,ep(i,{pending:!0,data:s,method:r.method,action:n},n,s))}}))}function el(e){function t(c){return Ou(c,e)}bi!==null&&Ou(bi,e),Si!==null&&Ou(Si,e),wi!==null&&Ou(wi,e),Rc.forEach(t),Nc.forEach(t);for(var r=0;r<Qs.length;r++){var n=Qs[r];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Qs.length&&(r=Qs[0],r.blockedOn===null);)mC(r),r.blockedOn===null&&Qs.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(n=0;n<r.length;n+=3){var s=r[n],i=r[n+1],l=s[jr]||null;if(typeof i=="function")l||Ex(r);else if(l){var a=null;if(i&&i.hasAttribute("formAction")){if(s=i,l=i[jr]||null)a=l.formAction;else if(Ev(s)!==null)continue}else a=l.action;typeof a=="function"?r[n+1]=a:(r.splice(n,3),n-=3),Ex(r)}}}function pC(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(l){return s=l})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(r,20)}function r(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function jv(e){this._internalRoot=e}Bf.prototype.render=jv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));var r=t.current,n=Ur();dC(r,n,e,t,null,null)};Bf.prototype.unmount=jv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dC(e.current,2,null,e,null,null),Mf(),t[fl]=null}};function Bf(e){this._internalRoot=e}Bf.prototype.unstable_scheduleHydration=function(e){if(e){var t=VS();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Qs.length&&t!==0&&t<Qs[r].priority;r++);Qs.splice(r,0,e),r===0&&mC(e)}};var jx=TS.version;if(jx!=="19.2.7")throw Error(ee(527,jx,"19.2.7"));Ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=ZR(t),e=e!==null?MS(e):null,e=e===null?null:e.stateNode,e};var bA={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:we,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lu.isDisabled&&Lu.supportsFiber)try{Wc=Lu.inject(bA),zr=Lu}catch{}}yf.createRoot=function(e,t){if(!AS(e))throw Error(ee(299));var r=!1,n="",s=aw,i=ow,l=lw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=cC(e,1,!1,null,null,r,n,null,s,i,l,pC),e[fl]=t.current,xv(e),new jv(t)};yf.hydrateRoot=function(e,t,r){if(!AS(e))throw Error(ee(299));var n=!1,s="",i=aw,l=ow,a=lw,c=null;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onUncaughtError!==void 0&&(i=r.onUncaughtError),r.onCaughtError!==void 0&&(l=r.onCaughtError),r.onRecoverableError!==void 0&&(a=r.onRecoverableError),r.formState!==void 0&&(c=r.formState)),t=cC(e,1,!0,t,r??null,n,s,c,i,l,a,pC),t.context=uC(null),r=t.current,n=Ur(),n=Mg(n),s=vi(n),s.callback=null,_i(r,s,n),r=n,t.current.lanes=r,Kc(t,r),Jn(t),e[fl]=t.current,xv(e),new Bf(t)};yf.version="19.2.7";function gC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gC)}catch(e){console.error(e)}}gC(),wS.exports=yf;var SA=wS.exports;const wA=Eg(SA);var yl=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(){}},na,Js,Ao,nS,CA=(nS=class extends yl{constructor(){super();ye(this,na);ye(this,Js);ye(this,Ao);ue(this,Ao,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){z(this,Js)||this.setEventListener(z(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Js))==null||t.call(this),ue(this,Js,void 0))}setEventListener(t){var r;ue(this,Ao,t),(r=z(this,Js))==null||r.call(this),ue(this,Js,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){z(this,na)!==t&&(ue(this,na,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof z(this,na)=="boolean"?z(this,na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},na=new WeakMap,Js=new WeakMap,Ao=new WeakMap,nS),kv=new CA,EA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ei,Cg,sS,jA=(sS=class{constructor(){ye(this,ei,EA);ye(this,Cg,!1)}setTimeoutProvider(e){ue(this,ei,e)}setTimeout(e,t){return z(this,ei).setTimeout(e,t)}clearTimeout(e){z(this,ei).clearTimeout(e)}setInterval(e,t){return z(this,ei).setInterval(e,t)}clearInterval(e){z(this,ei).clearInterval(e)}},ei=new WeakMap,Cg=new WeakMap,sS),ea=new jA;function kA(e){setTimeout(e,0)}var RA=typeof window>"u"||"Deno"in globalThis;function ur(){}function NA(e,t){return typeof e=="function"?e(t):e}function bp(e){return typeof e=="number"&&e>=0&&e!==1/0}function vC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Dr(e,t){return typeof e=="function"?e(t):e}function kx(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:l,stale:a}=e;if(l){if(n){if(t.queryHash!==Rv(l,t.options))return!1}else if(!Tc(t.queryKey,l))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function Rx(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Sa(t.options.mutationKey)!==Sa(i))return!1}else if(!Tc(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Rv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sa)(e)}function Sa(e){return JSON.stringify(e,(t,r)=>Sp(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Tc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Tc(e[r],t[r])):!1}var TA=Object.prototype.hasOwnProperty;function _C(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Nx(e)&&Nx(t);if(!n&&!(Sp(e)&&Sp(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),a=l.length,c=n?new Array(a):{};let d=0;for(let p=0;p<a;p++){const u=n?p:l[p],g=e[u],_=t[u];if(g===_){c[u]=g,(n?p<i:TA.call(e,u))&&d++;continue}if(g===null||_===null||typeof g!="object"||typeof _!="object"){c[u]=_;continue}const x=_C(g,_,r+1);c[u]=x,x===g&&d++}return i===a&&d===i?e:c}function qd(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 Nx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sp(e){if(!Tx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Tx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Tx(e){return Object.prototype.toString.call(e)==="[object Object]"}function AA(e){return new Promise(t=>{ea.setTimeout(t,e)})}function wp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?_C(e,t):t}function DA(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function OA(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Nv=Symbol();function yC(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Nv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Tv(e,t){return typeof e=="function"?e(...t):!!e}function MA(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ac=(()=>{let e=()=>RA;return{isServer(){return e()},setIsServer(t){e=t}}})();function Cp(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var LA=kA;function PA(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=LA;const i=a=>{t?e.push(a):s(()=>{r(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||l()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Lt=PA(),Do,ti,Oo,iS,BA=(iS=class extends yl{constructor(){super();ye(this,Do,!0);ye(this,ti);ye(this,Oo);ue(this,Oo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){z(this,ti)||this.setEventListener(z(this,Oo))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,ti))==null||t.call(this),ue(this,ti,void 0))}setEventListener(t){var r;ue(this,Oo,t),(r=z(this,ti))==null||r.call(this),ue(this,ti,t(this.setOnline.bind(this)))}setOnline(t){z(this,Do)!==t&&(ue(this,Do,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return z(this,Do)}},Do=new WeakMap,ti=new WeakMap,Oo=new WeakMap,iS),Wd=new BA;function IA(e){return Math.min(1e3*2**e,3e4)}function xC(e){return(e??"online")==="online"?Wd.isOnline():!0}var Ep=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bC(e){let t=!1,r=0,n;const s=Cp(),i=()=>s.status!=="pending",l=b=>{var h;if(!i()){const f=new Ep(b);g(f),(h=e.onCancel)==null||h.call(e,f)}},a=()=>{t=!0},c=()=>{t=!1},d=()=>kv.isFocused()&&(e.networkMode==="always"||Wd.isOnline())&&e.canRun(),p=()=>xC(e.networkMode)&&e.canRun(),u=b=>{i()||(n==null||n(),s.resolve(b))},g=b=>{i()||(n==null||n(),s.reject(b))},_=()=>new Promise(b=>{var h;n=f=>{(i()||d())&&b(f)},(h=e.onPause)==null||h.call(e)}).then(()=>{var b;n=void 0,i()||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(i())return;let b;const h=r===0?e.initialPromise:void 0;try{b=h??e.fn()}catch(f){b=Promise.reject(f)}Promise.resolve(b).then(u).catch(f=>{var E;if(i())return;const m=e.retry??(Ac.isServer()?0:3),v=e.retryDelay??IA,y=typeof v=="function"?v(r,f):v,S=m===!0||typeof m=="number"&&r<m||typeof m=="function"&&m(r,f);if(t||!S){g(f);return}r++,(E=e.onFail)==null||E.call(e,r,f),AA(y).then(()=>d()?void 0:_()).then(()=>{t?g(f):x()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:p,start:()=>(p()?x():_().then(x),s)}}var sa,aS,SC=(aS=class{constructor(){ye(this,sa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bp(this.gcTime)&&ue(this,sa,ea.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ac.isServer()?1/0:5*60*1e3))}clearGcTimeout(){z(this,sa)!==void 0&&(ea.clearTimeout(z(this,sa)),ue(this,sa,void 0))}},sa=new WeakMap,aS);function HA(e){return{onFetch:(t,r)=>{var p,u,g,_,x;const n=t.options,s=(g=(u=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:u.fetchMore)==null?void 0:g.direction,i=((_=t.state.data)==null?void 0:_.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let b=!1;const h=v=>{MA(v,()=>t.signal,()=>b=!0)},f=yC(t.options,t.fetchOptions),m=async(v,y,S)=>{if(b)return Promise.reject(t.signal.reason);if(y==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:y,direction:S?"backward":"forward",meta:t.options.meta};return h(M),M})(),w=await f(k),{maxPages:j}=t.options,R=S?OA:DA;return{pages:R(v.pages,w,j),pageParams:R(v.pageParams,y,j)}};if(s&&i.length){const v=s==="backward",y=v?wC:jp,S={pages:i,pageParams:l},E=y(n,S);a=await m(S,E,v)}else{const v=e??i.length;do{const y=c===0?l[0]??n.initialPageParam:jp(n,a);if(c>0&&y==null)break;a=await m(a,y),c++}while(c<v)}return a};t.options.persister?t.fetchFn=()=>{var b,h;return(h=(b=t.options).persister)==null?void 0:h.call(b,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function jp(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function wC(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function zA(e,t){return t?jp(e,t)!=null:!1}function FA(e,t){return!t||!e.getPreviousPageParam?!1:wC(e,t)!=null}var Mo,ia,Lo,Jr,aa,Ft,zc,oa,Ar,CC,cs,oS,UA=(oS=class extends SC{constructor(t){super();ye(this,Ar);ye(this,Mo);ye(this,ia);ye(this,Lo);ye(this,Jr);ye(this,aa);ye(this,Ft);ye(this,zc);ye(this,oa);ue(this,oa,!1),ue(this,zc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,aa,t.client),ue(this,Jr,z(this,aa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,ia,Dx(this.options)),this.state=t.state??z(this,ia),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return z(this,Mo)}get promise(){var t;return(t=z(this,Ft))==null?void 0:t.promise}setOptions(t){if(this.options={...z(this,zc),...t},t!=null&&t._type&&ue(this,Mo,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Dx(this.options);r.data!==void 0&&(this.setState(Ax(r.data,r.dataUpdatedAt)),ue(this,ia,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,Jr).remove(this)}setData(t,r){const n=wp(this.state.data,t,this.options);return Te(this,Ar,cs).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Te(this,Ar,cs).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=z(this,Ft))==null?void 0:n.promise;return(s=z(this,Ft))==null||s.cancel(t),r?r.then(ur).catch(ur):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,ia)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(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:!vC(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,Ft))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,Ft))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,Jr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(z(this,Ft)&&(z(this,oa)||Te(this,Ar,CC).call(this)?z(this,Ft).cancel({revert:!0}):z(this,Ft).cancelRetry()),this.scheduleGc()),z(this,Jr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,Ar,cs).call(this,{type:"invalidate"})}async fetch(t,r){var d,p,u,g,_,x,b,h,f,m,v;if(this.state.fetchStatus!=="idle"&&((d=z(this,Ft))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(z(this,Ft))return z(this,Ft).continueRetry(),z(this,Ft).promise}if(t&&this.setOptions(t),!this.options.queryFn){const y=this.observers.find(S=>S.options.queryFn);y&&this.setOptions(y.options)}const n=new AbortController,s=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(ue(this,oa,!0),n.signal)})},i=()=>{const y=yC(this.options,r),E=(()=>{const k={client:z(this,aa),queryKey:this.queryKey,meta:this.meta};return s(k),k})();return ue(this,oa,!1),this.options.persister?this.options.persister(y,E,this):y(E)},a=(()=>{const y={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:z(this,aa),state:this.state,fetchFn:i};return s(y),y})(),c=z(this,Mo)==="infinite"?HA(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),ue(this,Lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&Te(this,Ar,cs).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta}),ue(this,Ft,bC({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:y=>{y instanceof Ep&&y.revert&&this.setState({...z(this,Lo),fetchStatus:"idle"}),n.abort()},onFail:(y,S)=>{Te(this,Ar,cs).call(this,{type:"failed",failureCount:y,error:S})},onPause:()=>{Te(this,Ar,cs).call(this,{type:"pause"})},onContinue:()=>{Te(this,Ar,cs).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const y=await z(this,Ft).start();if(y===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(y),(_=(g=z(this,Jr).config).onSuccess)==null||_.call(g,y,this),(b=(x=z(this,Jr).config).onSettled)==null||b.call(x,y,this.state.error,this),y}catch(y){if(y instanceof Ep){if(y.silent)return z(this,Ft).promise;if(y.revert){if(this.state.data===void 0)throw y;return this.state.data}}throw Te(this,Ar,cs).call(this,{type:"error",error:y}),(f=(h=z(this,Jr).config).onError)==null||f.call(h,y,this),(v=(m=z(this,Jr).config).onSettled)==null||v.call(m,this.state.data,y,this),y}finally{this.scheduleGc()}}},Mo=new WeakMap,ia=new WeakMap,Lo=new WeakMap,Jr=new WeakMap,aa=new WeakMap,Ft=new WeakMap,zc=new WeakMap,oa=new WeakMap,Ar=new WeakSet,CC=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},cs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...EC(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Ax(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Lo,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Lt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),z(this,Jr).notify({query:this,type:"updated",action:t})})},oS);function EC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xC(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ax(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var _r,He,Fc,lr,la,Po,ds,ri,Uc,Bo,Io,ca,ua,ni,Ho,Ge,Yl,kp,Rp,Np,Tp,Ap,Dp,Op,kC,lS,jC=(lS=class extends yl{constructor(t,r){super();ye(this,Ge);ye(this,_r);ye(this,He);ye(this,Fc);ye(this,lr);ye(this,la);ye(this,Po);ye(this,ds);ye(this,ri);ye(this,Uc);ye(this,Bo);ye(this,Io);ye(this,ca);ye(this,ua);ye(this,ni);ye(this,Ho,new Set);this.options=r,ue(this,_r,t),ue(this,ri,null),ue(this,ds,Cp()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,He).addObserver(this),Ox(z(this,He),this.options)?Te(this,Ge,Yl).call(this):this.updateResult(),Te(this,Ge,Tp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mp(z(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mp(z(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ge,Ap).call(this),Te(this,Ge,Dp).call(this),z(this,He).removeObserver(this)}setOptions(t){const r=this.options,n=z(this,He);if(this.options=z(this,_r).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dr(this.options.enabled,z(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ge,Op).call(this),z(this,He).setOptions(this.options),r._defaulted&&!qd(this.options,r)&&z(this,_r).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,He),observer:this});const s=this.hasListeners();s&&Mx(z(this,He),n,this.options,r)&&Te(this,Ge,Yl).call(this),this.updateResult(),s&&(z(this,He)!==n||Dr(this.options.enabled,z(this,He))!==Dr(r.enabled,z(this,He))||Ci(this.options.staleTime,z(this,He))!==Ci(r.staleTime,z(this,He)))&&Te(this,Ge,kp).call(this);const i=Te(this,Ge,Rp).call(this);s&&(z(this,He)!==n||Dr(this.options.enabled,z(this,He))!==Dr(r.enabled,z(this,He))||i!==z(this,ni))&&Te(this,Ge,Np).call(this,i)}getOptimisticResult(t){const r=z(this,_r).getQueryCache().build(z(this,_r),t),n=this.createResult(r,t);return VA(this,n)&&(ue(this,lr,n),ue(this,Po,this.options),ue(this,la,z(this,He).state)),n}getCurrentResult(){return z(this,lr)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,ds).status==="pending"&&z(this,ds).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){z(this,Ho).add(t)}getCurrentQuery(){return z(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=z(this,_r).defaultQueryOptions(t),n=z(this,_r).getQueryCache().build(z(this,_r),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Te(this,Ge,Yl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,lr)))}createResult(t,r){var j;const n=z(this,He),s=this.options,i=z(this,lr),l=z(this,la),a=z(this,Po),d=t!==n?t.state:z(this,Fc),{state:p}=t;let u={...p},g=!1,_;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&Ox(t,r),T=R&&Mx(t,n,r,s);(M||T)&&(u={...u,...EC(p.data,t.options)}),r._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:h}=u;_=u.data;let f=!1;if(r.placeholderData!==void 0&&_===void 0&&h==="pending"){let R;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(R=i.data,f=!0):R=typeof r.placeholderData=="function"?r.placeholderData((j=z(this,Io))==null?void 0:j.state.data,z(this,Io)):r.placeholderData,R!==void 0&&(h="success",_=wp(i==null?void 0:i.data,R,r),g=!0)}if(r.select&&_!==void 0&&!f)if(i&&_===(l==null?void 0:l.data)&&r.select===z(this,Uc))_=z(this,Bo);else try{ue(this,Uc,r.select),_=r.select(_),_=wp(i==null?void 0:i.data,_,r),ue(this,Bo,_),ue(this,ri,null)}catch(R){ue(this,ri,R)}z(this,ri)&&(x=z(this,ri),_=z(this,Bo),b=Date.now(),h="error");const m=u.fetchStatus==="fetching",v=h==="pending",y=h==="error",S=v&&m,E=_!==void 0,w={status:h,fetchStatus:u.fetchStatus,isPending:v,isSuccess:h==="success",isError:y,isInitialLoading:S,isLoading:S,data:_,dataUpdatedAt:u.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:y&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:y&&E,isStale:Av(t,r),refetch:this.refetch,promise:z(this,ds),isEnabled:Dr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=w.data!==void 0,M=w.status==="error"&&!R,T=$=>{M?$.reject(w.error):R&&$.resolve(w.data)},O=()=>{const $=ue(this,ds,w.promise=Cp());T($)},F=z(this,ds);switch(F.status){case"pending":t.queryHash===n.queryHash&&T(F);break;case"fulfilled":(M||w.data!==F.value)&&O();break;case"rejected":(!M||w.error!==F.reason)&&O();break}}return w}updateResult(){const t=z(this,lr),r=this.createResult(z(this,He),this.options);if(ue(this,la,z(this,He).state),ue(this,Po,this.options),z(this,la).data!==void 0&&ue(this,Io,z(this,He)),qd(r,t))return;ue(this,lr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!z(this,Ho).size)return!0;const l=new Set(i??z(this,Ho));return this.options.throwOnError&&l.add("error"),Object.keys(z(this,lr)).some(a=>{const c=a;return z(this,lr)[c]!==t[c]&&l.has(c)})};Te(this,Ge,kC).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ge,Tp).call(this)}},_r=new WeakMap,He=new WeakMap,Fc=new WeakMap,lr=new WeakMap,la=new WeakMap,Po=new WeakMap,ds=new WeakMap,ri=new WeakMap,Uc=new WeakMap,Bo=new WeakMap,Io=new WeakMap,ca=new WeakMap,ua=new WeakMap,ni=new WeakMap,Ho=new WeakMap,Ge=new WeakSet,Yl=function(t){Te(this,Ge,Op).call(this);let r=z(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(ur)),r},kp=function(){Te(this,Ge,Ap).call(this);const t=Ci(this.options.staleTime,z(this,He));if(Ac.isServer()||z(this,lr).isStale||!bp(t))return;const n=vC(z(this,lr).dataUpdatedAt,t)+1;ue(this,ca,ea.setTimeout(()=>{z(this,lr).isStale||this.updateResult()},n))},Rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,He)):this.options.refetchInterval)??!1},Np=function(t){Te(this,Ge,Dp).call(this),ue(this,ni,t),!(Ac.isServer()||Dr(this.options.enabled,z(this,He))===!1||!bp(z(this,ni))||z(this,ni)===0)&&ue(this,ua,ea.setInterval(()=>{(this.options.refetchIntervalInBackground||kv.isFocused())&&Te(this,Ge,Yl).call(this)},z(this,ni)))},Tp=function(){Te(this,Ge,kp).call(this),Te(this,Ge,Np).call(this,Te(this,Ge,Rp).call(this))},Ap=function(){z(this,ca)!==void 0&&(ea.clearTimeout(z(this,ca)),ue(this,ca,void 0))},Dp=function(){z(this,ua)!==void 0&&(ea.clearInterval(z(this,ua)),ue(this,ua,void 0))},Op=function(){const t=z(this,_r).getQueryCache().build(z(this,_r),this.options);if(t===z(this,He))return;const r=z(this,He);ue(this,He,t),ue(this,Fc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},kC=function(t){Lt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(z(this,lr))}),z(this,_r).getQueryCache().notify({query:z(this,He),type:"observerResultsUpdated"})})},lS);function $A(e,t){return Dr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Dr(t.retryOnMount,e)===!1)}function Ox(e,t){return $A(e,t)||e.state.data!==void 0&&Mp(e,t,t.refetchOnMount)}function Mp(e,t,r){if(Dr(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Av(e,t)}return!1}function Mx(e,t,r,n){return(e!==t||Dr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Av(e,r)}function Av(e,t){return Dr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function VA(e,t){return!qd(e.getCurrentResult(),t)}var qA=class extends jC{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var x,b;const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:l,isRefetchError:a}=n,c=(b=(x=r.fetchMeta)==null?void 0:x.fetchMore)==null?void 0:b.direction,d=l&&c==="forward",p=s&&c==="forward",u=l&&c==="backward",g=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:zA(t,r.data),hasPreviousPage:FA(t,r.data),isFetchNextPageError:d,isFetchingNextPage:p,isFetchPreviousPageError:u,isFetchingPreviousPage:g,isRefetchError:a&&!d&&!u,isRefetching:i&&!p&&!g}}},$c,Hn,er,da,zn,Us,cS,WA=(cS=class extends SC{constructor(t){super();ye(this,zn);ye(this,$c);ye(this,Hn);ye(this,er);ye(this,da);ue(this,$c,t.client),this.mutationId=t.mutationId,ue(this,er,t.mutationCache),ue(this,Hn,[]),this.state=t.state||RC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Hn).includes(t)||(z(this,Hn).push(t),this.clearGcTimeout(),z(this,er).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,Hn,z(this,Hn).filter(r=>r!==t)),this.scheduleGc(),z(this,er).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Hn).length||(this.state.status==="pending"?this.scheduleGc():z(this,er).remove(this))}continue(){var t;return((t=z(this,da))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,c,d,p,u,g,_,x,b,h,f,m,v,y,S,E,k;const r=()=>{Te(this,zn,Us).call(this,{type:"continue"})},n={client:z(this,$c),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,da,bC({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(w,j)=>{Te(this,zn,Us).call(this,{type:"failed",failureCount:w,error:j})},onPause:()=>{Te(this,zn,Us).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,er).canRun(this)}));const s=this.state.status==="pending",i=!z(this,da).canStart();try{if(s)r();else{Te(this,zn,Us).call(this,{type:"pending",variables:t,isPaused:i}),z(this,er).config.onMutate&&await z(this,er).config.onMutate(t,this,n);const j=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,n));j!==this.state.context&&Te(this,zn,Us).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const w=await z(this,da).start();return await((d=(c=z(this,er).config).onSuccess)==null?void 0:d.call(c,w,t,this.state.context,this,n)),await((u=(p=this.options).onSuccess)==null?void 0:u.call(p,w,t,this.state.context,n)),await((_=(g=z(this,er).config).onSettled)==null?void 0:_.call(g,w,null,this.state.variables,this.state.context,this,n)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,w,null,t,this.state.context,n)),Te(this,zn,Us).call(this,{type:"success",data:w}),w}catch(w){try{await((f=(h=z(this,er).config).onError)==null?void 0:f.call(h,w,t,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((v=(m=this.options).onError)==null?void 0:v.call(m,w,t,this.state.context,n))}catch(j){Promise.reject(j)}try{await((S=(y=z(this,er).config).onSettled)==null?void 0:S.call(y,void 0,w,this.state.variables,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((k=(E=this.options).onSettled)==null?void 0:k.call(E,void 0,w,t,this.state.context,n))}catch(j){Promise.reject(j)}throw Te(this,zn,Us).call(this,{type:"error",error:w}),w}finally{z(this,er).runNext(this)}}},$c=new WeakMap,Hn=new WeakMap,er=new WeakMap,da=new WeakMap,zn=new WeakSet,Us=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Lt.batch(()=>{z(this,Hn).forEach(n=>{n.onMutationUpdate(t)}),z(this,er).notify({mutation:this,type:"updated",action:t})})},cS);function RC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fs,wn,Vc,uS,GA=(uS=class extends yl{constructor(t={}){super();ye(this,fs);ye(this,wn);ye(this,Vc);this.config=t,ue(this,fs,new Set),ue(this,wn,new Map),ue(this,Vc,0)}build(t,r,n){const s=new WA({client:t,mutationCache:this,mutationId:++yu(this,Vc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){z(this,fs).add(t);const r=Pu(t);if(typeof r=="string"){const n=z(this,wn).get(r);n?n.push(t):z(this,wn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,fs).delete(t)){const r=Pu(t);if(typeof r=="string"){const n=z(this,wn).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&z(this,wn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Pu(t);if(typeof r=="string"){const n=z(this,wn).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Pu(t);if(typeof r=="string"){const s=(n=z(this,wn).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Lt.batch(()=>{z(this,fs).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,fs).clear(),z(this,wn).clear()})}getAll(){return Array.from(z(this,fs))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Rx(r,n))}findAll(t={}){return this.getAll().filter(r=>Rx(t,r))}notify(t){Lt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Lt.batch(()=>Promise.all(t.map(r=>r.continue().catch(ur))))}},fs=new WeakMap,wn=new WeakMap,Vc=new WeakMap,uS);function Pu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var hs,si,yr,ms,ws,fd,Lp,dS,KA=(dS=class extends yl{constructor(r,n){super();ye(this,ws);ye(this,hs);ye(this,si);ye(this,yr);ye(this,ms);ue(this,hs,r),this.setOptions(n),this.bindMethods(),Te(this,ws,fd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=z(this,hs).defaultMutationOptions(r),qd(this.options,n)||z(this,hs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,yr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Sa(n.mutationKey)!==Sa(this.options.mutationKey)?this.reset():((s=z(this,yr))==null?void 0:s.state.status)==="pending"&&z(this,yr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=z(this,yr))==null||r.removeObserver(this)}onMutationUpdate(r){Te(this,ws,fd).call(this),Te(this,ws,Lp).call(this,r)}getCurrentResult(){return z(this,si)}reset(){var r;(r=z(this,yr))==null||r.removeObserver(this),ue(this,yr,void 0),Te(this,ws,fd).call(this),Te(this,ws,Lp).call(this)}mutate(r,n){var s;return ue(this,ms,n),(s=z(this,yr))==null||s.removeObserver(this),ue(this,yr,z(this,hs).getMutationCache().build(z(this,hs),this.options)),z(this,yr).addObserver(this),z(this,yr).execute(r)}},hs=new WeakMap,si=new WeakMap,yr=new WeakMap,ms=new WeakMap,ws=new WeakSet,fd=function(){var n;const r=((n=z(this,yr))==null?void 0:n.state)??RC();ue(this,si,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Lp=function(r){Lt.batch(()=>{var n,s,i,l,a,c,d,p;if(z(this,ms)&&this.hasListeners()){const u=z(this,si).variables,g=z(this,si).context,_={client:z(this,hs),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=z(this,ms)).onSuccess)==null||s.call(n,r.data,u,g,_)}catch(x){Promise.reject(x)}try{(l=(i=z(this,ms)).onSettled)==null||l.call(i,r.data,null,u,g,_)}catch(x){Promise.reject(x)}}else if((r==null?void 0:r.type)==="error"){try{(c=(a=z(this,ms)).onError)==null||c.call(a,r.error,u,g,_)}catch(x){Promise.reject(x)}try{(p=(d=z(this,ms)).onSettled)==null||p.call(d,void 0,r.error,u,g,_)}catch(x){Promise.reject(x)}}}this.listeners.forEach(u=>{u(z(this,si))})})},dS),Fn,fS,YA=(fS=class extends yl{constructor(t={}){super();ye(this,Fn);this.config=t,ue(this,Fn,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??Rv(s,r);let l=this.get(i);return l||(l=new UA({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){z(this,Fn).has(t.queryHash)||(z(this,Fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=z(this,Fn).get(t.queryHash);r&&(t.destroy(),r===t&&z(this,Fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,Fn).get(t)}getAll(){return[...z(this,Fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>kx(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>kx(t,n)):r}notify(t){Lt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Lt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Lt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fn=new WeakMap,fS),_t,ii,ai,zo,Fo,oi,Uo,$o,hS,ZA=(hS=class{constructor(e={}){ye(this,_t);ye(this,ii);ye(this,ai);ye(this,zo);ye(this,Fo);ye(this,oi);ye(this,Uo);ye(this,$o);ue(this,_t,e.queryCache||new YA),ue(this,ii,e.mutationCache||new GA),ue(this,ai,e.defaultOptions||{}),ue(this,zo,new Map),ue(this,Fo,new Map),ue(this,oi,0)}mount(){yu(this,oi)._++,z(this,oi)===1&&(ue(this,Uo,kv.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,_t).onFocus())})),ue(this,$o,Wd.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,_t).onOnline())})))}unmount(){var e,t;yu(this,oi)._--,z(this,oi)===0&&((e=z(this,Uo))==null||e.call(this),ue(this,Uo,void 0),(t=z(this,$o))==null||t.call(this),ue(this,$o,void 0))}isFetching(e){return z(this,_t).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,ii).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,_t).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=z(this,_t).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ci(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return z(this,_t).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=z(this,_t).get(n.queryHash),i=s==null?void 0:s.state.data,l=NA(t,i);if(l!==void 0)return z(this,_t).build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return Lt.batch(()=>z(this,_t).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,_t).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=z(this,_t);Lt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=z(this,_t);return Lt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Lt.batch(()=>z(this,_t).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(ur).catch(ur)}invalidateQueries(e,t={}){return Lt.batch(()=>(z(this,_t).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Lt.batch(()=>z(this,_t).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(ur)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(ur)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=z(this,_t).build(this,t);return r.isStaleByTime(Ci(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ur).catch(ur)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ur).catch(ur)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Wd.isOnline()?z(this,ii).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,_t)}getMutationCache(){return z(this,ii)}getDefaultOptions(){return z(this,ai)}setDefaultOptions(e){ue(this,ai,e)}setQueryDefaults(e,t){z(this,zo).set(Sa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,zo).values()],r={};return t.forEach(n=>{Tc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){z(this,Fo).set(Sa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,Fo).values()],r={};return t.forEach(n=>{Tc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,ai).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rv(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===Nv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,ai).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,_t).clear(),z(this,ii).clear()}},_t=new WeakMap,ii=new WeakMap,ai=new WeakMap,zo=new WeakMap,Fo=new WeakMap,oi=new WeakMap,Uo=new WeakMap,$o=new WeakMap,hS),NC=C.createContext(void 0),Hi=e=>{const t=C.useContext(NC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},XA=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(NC.Provider,{value:e,children:t})),TC=C.createContext(!1),QA=()=>C.useContext(TC);TC.Provider;function JA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eD=C.createContext(JA()),tD=()=>C.useContext(eD),rD=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Tv(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},nD=e=>{C.useEffect(()=>{e.clearReset()},[e])},sD=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Tv(r,[e.error,n])),iD=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},aD=(e,t)=>e.isLoading&&e.isFetching&&!t,oD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Lx=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function AC(e,t,r){var _,x,b,h;const n=QA(),s=tD(),i=Hi(),l=i.defaultQueryOptions(e);(x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||x.call(_,l);const a=i.getQueryCache().get(l.queryHash),c=e.subscribed!==!1;l._optimisticResults=n?"isRestoring":c?"optimistic":void 0,iD(l),rD(l,s,a),nD(s);const d=!i.getQueryCache().get(l.queryHash),[p]=C.useState(()=>new t(i,l)),u=p.getOptimisticResult(l),g=!n&&c;if(C.useSyncExternalStore(C.useCallback(f=>{const m=g?p.subscribe(Lt.batchCalls(f)):ur;return p.updateResult(),m},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),C.useEffect(()=>{p.setOptions(l)},[l,p]),oD(l,u))throw Lx(l,p,s);if(sD({result:u,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw u.error;if((h=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||h.call(b,l,u),l.experimental_prefetchInRender&&!Ac.isServer()&&aD(u,n)){const f=d?Lx(l,p,s):a==null?void 0:a.promise;f==null||f.catch(ur).finally(()=>{p.updateResult()})}return l.notifyOnChangeProps?u:p.trackResult(u)}function Oe(e,t){return AC(e,jC)}function Ss(e,t){const r=Hi(),[n]=C.useState(()=>new KA(r,e));C.useEffect(()=>{n.setOptions(e)},[n,e]);const s=C.useSyncExternalStore(C.useCallback(l=>n.subscribe(Lt.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=C.useCallback((l,a)=>{n.mutate(l,a).catch(ur)},[n]);if(s.error&&Tv(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function lD(e,t){return AC(e,qA)}function cD(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,i,l=[],a="",c=e.split("/");for(c[0]||c.shift();s=c.shift();)r=s[0],r==="*"?(l.push(r),a+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),i=s.indexOf(".",1),l.push(s.substring(1,~n?n:~i?i:s.length)),a+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(a+=(~n?"?":"")+"\\"+s.substring(i))):a+="/"+s;return{keys:l,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var DC={exports:{}},OC={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var tl=C;function uD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dD=typeof Object.is=="function"?Object.is:uD,fD=tl.useState,hD=tl.useEffect,mD=tl.useLayoutEffect,pD=tl.useDebugValue;function gD(e,t){var r=t(),n=fD({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return mD(function(){s.value=r,s.getSnapshot=t,Zh(s)&&i({inst:s})},[e,r,t]),hD(function(){return Zh(s)&&i({inst:s}),e(function(){Zh(s)&&i({inst:s})})},[e]),pD(r),r}function Zh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dD(e,r)}catch{return!0}}function vD(e,t){return t()}var _D=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?vD:gD;OC.useSyncExternalStore=tl.useSyncExternalStore!==void 0?tl.useSyncExternalStore:_D;DC.exports=OC;var yD=DC.exports;const xD=_f.useInsertionEffect,bD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MC=bD?C.useLayoutEffect:C.useEffect,SD=xD||MC,Dv=e=>{const t=C.useRef([e,(...r)=>t[0](...r)]).current;return SD(()=>{t[0]=e}),t[1]},wD="popstate",Ov="pushState",Mv="replaceState",CD="hashchange",Px=[wD,Ov,Mv,CD],ED=e=>{for(const t of Px)addEventListener(t,e);return()=>{for(const t of Px)removeEventListener(t,e)}},LC=(e,t)=>yD.useSyncExternalStore(ED,e,t),Bx=()=>location.search,jD=({ssrSearch:e}={})=>LC(Bx,e!=null?()=>e:Bx),Ix=()=>location.pathname,kD=({ssrPath:e}={})=>LC(Ix,e!=null?()=>e:Ix),RD=(e,{replace:t=!1,state:r=null}={})=>history[t?Mv:Ov](r,"",e),ND=(e={})=>[kD(e),RD],Hx=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Hx]>"u"){for(const e of[Ov,Mv]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,Hx,{value:!0})}const TD=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",PC=(e="")=>e==="/"?"":e,AD=(e,t)=>e[0]==="~"?e.slice(1):PC(t)+e,DD=(e="",t)=>TD(zx(PC(e)),zx(t)),zx=e=>{try{return decodeURI(e)}catch{return e}},BC={hook:ND,searchHook:jD,parser:cD,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},IC=C.createContext(BC),Aa=()=>C.useContext(IC),HC={},zC=C.createContext(HC),If=()=>C.useContext(zC),nu=e=>{const[t,r]=e.hook(e);return[DD(e.base,t),Dv((n,s)=>e.aroundNav(r,AD(n,e.base),s))]},gn=()=>nu(Aa()),Lv=(e,t,r,n)=>{const{pattern:s,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[a,...c]=l;return a!==void 0?[!0,(()=>{const d=i!==!1?Object.fromEntries(i.map((u,g)=>[u,c[g]])):l.groups;let p={...c};return d&&Object.assign(p,d),p})(),...n?[a]:[]]:[!1,null]},OD=e=>Lv(Aa().parser,e,gn()[0]),FC=({children:e,...t})=>{var p,u,g;const r=Aa(),n=t.hook?BC:r;let s=n;const[i,l=t.ssrSearch??""]=((p=t.ssrPath)==null?void 0:p.split("?"))??[];i&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??((u=t.hook)==null?void 0:u.hrefs),t.searchHook=t.searchHook??((g=t.hook)==null?void 0:g.searchHook);let a=C.useRef({}),c=a.current,d=c;for(let _ in n){const x=_==="base"?n[_]+(t[_]??""):t[_]??n[_];c===d&&x!==d[_]&&(a.current=d={...d}),d[_]=x,(x!==n[_]||x!==s[_])&&(s=d)}return C.createElement(IC.Provider,{value:s,children:e})},Fx=({children:e,component:t},r)=>t?C.createElement(t,{params:r}):typeof e=="function"?e(r):e,MD=e=>{let t=C.useRef(HC);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},Wt=({path:e,nest:t,match:r,...n})=>{const s=Aa(),[i]=nu(s),[l,a,c]=r??Lv(s.parser,e,i,t),d=MD({...If(),...a});if(!l)return null;const p=c?C.createElement(FC,{base:c},Fx(n,d)):Fx(n,d);return C.createElement(zC.Provider,{value:d,children:p})},Cr=C.forwardRef((e,t)=>{const r=Aa(),[n,s]=nu(r),{to:i="",href:l=i,onClick:a,asChild:c,children:d,className:p,replace:u,state:g,transition:_,...x}=e,b=Dv(f=>{f.ctrlKey||f.metaKey||f.altKey||f.shiftKey||f.button!==0||(a==null||a(f),f.defaultPrevented||(f.preventDefault(),s(l,e)))}),h=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return c&&C.isValidElement(d)?C.cloneElement(d,{onClick:b,href:h}):C.createElement("a",{...x,onClick:b,href:h,className:p!=null&&p.call?p(n===l):p,children:d,ref:t})}),UC=e=>Array.isArray(e)?e.flatMap(t=>UC(t&&t.type===C.Fragment?t.props.children:t)):[e],LD=({children:e,location:t})=>{const r=Aa(),[n]=nu(r);for(const s of UC(e)){let i=0;if(C.isValidElement(s)&&(i=Lv(r.parser,s.props.path,t||n,s.props.nest))[0])return C.cloneElement(s,{match:i})}return null},Zl=e=>{const{to:t,href:r=t}=e,n=Aa(),[,s]=nu(n),i=Dv(()=>s(t||r,e)),{ssrContext:l}=n;return MC(()=>{i()},[]),l&&(l.redirectTo=t),null};async function PD(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{const r=await e.json();if(typeof r!="object"||r===null)return null;const n=r;return{error:typeof n.error=="string"?n.error:void 0,message:typeof n.message=="string"?n.message:void 0}}catch{return null}}async function xe(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok){const n=await PD(r),s=(n==null?void 0:n.message)??(n==null?void 0:n.error),i=new Error(s?`${r.status} ${r.statusText}: ${s} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw i.status=r.status,i.code=n==null?void 0:n.error,i}return r.json()}const he={getStatus:()=>xe("/v1/status"),getBootstrap:()=>xe("/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)),xe(`/v1/events/recent?${r.toString()}`)},getActivityEvents:e=>{const t=new URLSearchParams;e!=null&&e.kinds&&e.kinds.length>0&&t.set("kinds",e.kinds.join(",")),e!=null&&e.outcome&&t.set("outcome",e.outcome),e!=null&&e.requestId&&t.set("requestId",e.requestId),(e==null?void 0:e.beforeId)!==void 0&&t.set("beforeId",String(e.beforeId)),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return xe(`/v1/activity-events${r?`?${r}`:""}`)},getActivityEvent:e=>xe(`/v1/activity-events/${encodeURIComponent(String(e))}`),getClaudeAuth:()=>xe("/v1/auth/claude"),installClaudeCode:()=>xe("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>xe("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:e=>xe(e!=null&&e.singleDrip?"/v1/setup/drip?singleDrip=true":"/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>xe("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),restartDaemon:e=>xe("/api/admin/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),stopDaemon:()=>xe("/api/admin/stop",{method:"POST"}),getSolverNets:()=>xe("/v1/solvernets"),updateSolverNet:(e,t)=>xe(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>xe("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),retryAgentBinding:e=>xe("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),retryBootstrap:()=>xe("/v1/setup/bootstrap/retry",{method:"POST"}),updateHarnessMode:e=>xe("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>xe("/api/hermes/doctor"),codexDoctor:()=>xe("/api/codex/doctor"),harnessReadiness:e=>xe(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>xe("/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 xe(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>xe(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>xe("/v1/solvernets/drafts"),getDraft:e=>xe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>xe("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>xe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>xe(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>xe(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>xe(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>xe(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>xe(`/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 xe(`/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 xe(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>xe(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{const t=new URLSearchParams;e.source&&t.set("source",e.source),e.artifactType&&t.set("artifactType",e.artifactType),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return xe(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>xe("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>xe(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>xe(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>xe("/v1/operator/joined")},captures:{listPending:()=>xe("/api/captures/pending"),get:e=>xe(`/api/captures/${encodeURIComponent(e)}`),approve:e=>xe(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>xe(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>xe("/api/captures/trust-repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},debugReport:{manifest:()=>xe("/v1/debug-report/manifest"),download:async e=>{const t=await fetch("/v1/debug-report",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(e?{screenshotPngBase64:e}:{})});if(!t.ok)throw new Error(`debug report failed: ${t.status} ${t.statusText}`);return t.blob()}},discovery:{listPluginPublications:e=>{const t=new URLSearchParams;e!=null&&e.solverType&&t.set("solverType",e.solverType),e!=null&&e.builderAgentId&&t.set("builderAgentId",e.builderAgentId),(e==null?void 0:e.includeRevoked)!==void 0&&t.set("includeRevoked",String(e.includeRevoked));const r=t.toString();return xe(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),xe(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),xe(`/v1/discovery/plugin-scores?${r.toString()}`)},getSolverNetOperatorCount:e=>{const t=new URLSearchParams({cid:e});return xe(`/v1/discovery/solvernet-operator-count?${t.toString()}`)},getTaskPostCounts:e=>{const t=new URLSearchParams;(e??[]).forEach(n=>t.append("cid",n));const r=t.toString();return xe(`/v1/discovery/task-post-counts${r?`?${r}`:""}`)}}};async function BD(){const e=new URL(window.location.href),t=e.searchParams.get("k");if(t){try{await fetch(`/auth/handshake?k=${encodeURIComponent(t)}`,{credentials:"same-origin"})}catch{}e.searchParams.delete("k"),window.history.replaceState({},"",e.toString())}}async function ID(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const s=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json"},cache:"no-store",signal:r.signal});return s.status===502||s.status===503||s.status===504?{ok:!1,error:`daemon unavailable (HTTP ${s.status})`}:{ok:!0,error:null}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}function $C(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:s=3500,probeUrl:i="/v1/status"}=e,[l,a]=C.useState({status:"connected",lastConnectedAt:Date.now()}),c=C.useRef(0),d=C.useRef(t),p=C.useRef(!1);return C.useEffect(()=>{p.current=!1;let u=null;const g=x=>{p.current||(u=setTimeout(_,x))},_=async()=>{const x=await ID(i,s);if(p.current)return;if(x.ok){c.current=0,d.current=t,a(h=>h.status==="connected"?h:{status:"connected",lastConnectedAt:Date.now()}),g(t);return}c.current+=1,c.current>=r?(a(h=>h.status==="disconnected"?{...h,attempts:h.attempts+1,lastError:x.error}:{status:"disconnected",since:Date.now(),lastError:x.error,attempts:1}),d.current=Math.min(Math.max(d.current*2,t*2),n),g(d.current)):g(t)};return _(),()=>{p.current=!0,u!==null&&clearTimeout(u)}},[t,r,n,s,i]),l}/**
|
|
58
|
+
* @license lucide-react v0.454.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const HD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VC=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
63
|
+
* @license lucide-react v0.454.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/var zD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
68
|
+
* @license lucide-react v0.454.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const FD=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:l,...a},c)=>C.createElement("svg",{ref:c,...zD,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:VC("lucide",s),...a},[...l.map(([d,p])=>C.createElement(d,p)),...Array.isArray(i)?i:[i]]));/**
|
|
73
|
+
* @license lucide-react v0.454.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const pt=(e,t)=>{const r=C.forwardRef(({className:n,...s},i)=>C.createElement(FD,{ref:i,iconNode:t,className:VC(`lucide-${HD(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
78
|
+
* @license lucide-react v0.454.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const qC=pt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
83
|
+
* @license lucide-react v0.454.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const UD=pt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
88
|
+
* @license lucide-react v0.454.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const $D=pt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
93
|
+
* @license lucide-react v0.454.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Hf=pt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
98
|
+
* @license lucide-react v0.454.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const WC=pt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
103
|
+
* @license lucide-react v0.454.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Pv=pt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
108
|
+
* @license lucide-react v0.454.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const VD=pt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
113
|
+
* @license lucide-react v0.454.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const qD=pt("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
|
|
118
|
+
* @license lucide-react v0.454.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const WD=pt("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
123
|
+
* @license lucide-react v0.454.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const GC=pt("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/**
|
|
128
|
+
* @license lucide-react v0.454.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Co=pt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
133
|
+
* @license lucide-react v0.454.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const GD=pt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
138
|
+
* @license lucide-react v0.454.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const KD=pt("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
143
|
+
* @license lucide-react v0.454.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const YD=pt("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
|
|
148
|
+
* @license lucide-react v0.454.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const Pp=pt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
153
|
+
* @license lucide-react v0.454.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const ZD=pt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
158
|
+
* @license lucide-react v0.454.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const XD=pt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
163
|
+
* @license lucide-react v0.454.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const QD=pt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
168
|
+
* @license lucide-react v0.454.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const JD=pt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
173
|
+
* @license lucide-react v0.454.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const eO=pt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
178
|
+
* @license lucide-react v0.454.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const tO=pt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
183
|
+
* @license lucide-react v0.454.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const rO=pt("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
188
|
+
* @license lucide-react v0.454.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const Bv=pt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
193
|
+
* @license lucide-react v0.454.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const Dc=pt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function KC(e){const[t,r]=C.useState([]),[n,s]=C.useState(!1);return C.useEffect(()=>{const i=e&&e.length>0?`?kinds=${e.join(",")}`:"",l=new EventSource(`/v1/events${i}`,{withCredentials:!0});return l.onopen=()=>s(!0),l.onerror=()=>s(!1),l.onmessage=a=>{try{const c=JSON.parse(a.data);r(d=>[...d.slice(-499),c])}catch{}},()=>{l.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function Ux(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ls(...e){return t=>{let r=!1;const n=e.map(s=>{const i=Ux(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():Ux(e[s],null)}}}}function qe(...e){return C.useCallback(Ls(...e),e)}var nO=Symbol.for("react.lazy"),Gd=_f[" use ".trim().toString()];function sO(e){return typeof e=="object"&&e!==null&&"then"in e}function YC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nO&&"_payload"in e&&sO(e._payload)}function Iv(e){const t=iO(e),r=C.forwardRef((n,s)=>{let{children:i,...l}=n;YC(i)&&typeof Gd=="function"&&(i=Gd(i._payload));const a=C.Children.toArray(i),c=a.find(oO);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var ZC=Iv("Slot");function iO(e){const t=C.forwardRef((r,n)=>{let{children:s,...i}=r;if(YC(s)&&typeof Gd=="function"&&(s=Gd(s._payload)),C.isValidElement(s)){const l=cO(s),a=lO(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aO=Symbol("radix.slottable");function oO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aO}function lO(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function cO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function XC(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=XC(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function QC(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=XC(e))&&(n&&(n+=" "),n+=t);return n}const $x=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vx=QC,zf=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Vx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(d=>{const p=r==null?void 0:r[d],u=i==null?void 0:i[d];if(p===null)return null;const g=$x(p)||$x(u);return s[d][g]}),a=r&&Object.entries(r).reduce((d,p)=>{let[u,g]=p;return g===void 0||(d[u]=g),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:u,className:g,..._}=p;return Object.entries(_).every(x=>{let[b,h]=x;return Array.isArray(h)?h.includes({...i,...a}[b]):{...i,...a}[b]===h})?[...d,u,g]:d},[]);return Vx(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Hv="-",uO=e=>{const t=fO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Hv);return a[0]===""&&a.length!==1&&a.shift(),JC(a,t)||dO(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},JC=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?JC(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Hv);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},qx=/^\[(.+)\]$/,dO=e=>{if(qx.test(e)){const t=qx.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fO=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return mO(Object.entries(e.classGroups),r).forEach(([i,l])=>{Bp(l,n,i,t)}),n},Bp=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Wx(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(hO(s)){Bp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{Bp(l,Wx(t,i),r,n)})})},Wx=(e,t)=>{let r=e;return t.split(Hv).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},hO=e=>e.isThemeGetter,mO=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,pO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},eE="!",gO=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,l=a=>{const c=[];let d=0,p=0,u;for(let h=0;h<a.length;h++){let f=a[h];if(d===0){if(f===s&&(n||a.slice(h,h+i)===t)){c.push(a.slice(p,h)),p=h+i;continue}if(f==="/"){u=h;continue}}f==="["?d++:f==="]"&&d--}const g=c.length===0?a:a.substring(p),_=g.startsWith(eE),x=_?g.substring(1):g,b=u&&u>p?u-p:void 0;return{modifiers:c,hasImportantModifier:_,baseClassName:x,maybePostfixModifierPosition:b}};return r?a=>r({className:a,parseClassName:l}):l},vO=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},_O=e=>({cache:pO(e.cacheSize),parseClassName:gO(e),...uO(e)}),yO=/\s+/,xO=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(yO);let a="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{modifiers:p,hasImportantModifier:u,baseClassName:g,maybePostfixModifierPosition:_}=r(d);let x=!!_,b=n(x?g.substring(0,_):g);if(!b){if(!x){a=d+(a.length>0?" "+a:a);continue}if(b=n(g),!b){a=d+(a.length>0?" "+a:a);continue}x=!1}const h=vO(p).join(":"),f=u?h+eE:h,m=f+b;if(i.includes(m))continue;i.push(m);const v=s(b,x);for(let y=0;y<v.length;++y){const S=v[y];i.push(f+S)}a=d+(a.length>0?" "+a:a)}return a};function bO(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=tE(t))&&(n&&(n+=" "),n+=r);return n}const tE=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=tE(e[n]))&&(r&&(r+=" "),r+=t);return r};function SO(e,...t){let r,n,s,i=l;function l(c){const d=t.reduce((p,u)=>u(p),e());return r=_O(d),n=r.cache.get,s=r.cache.set,i=a,a(c)}function a(c){const d=n(c);if(d)return d;const p=xO(c,r);return s(c,p),p}return function(){return i(bO.apply(null,arguments))}}const ct=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},rE=/^\[(?:([a-z-]+):)?(.+)\]$/i,wO=/^\d+\/\d+$/,CO=new Set(["px","full","screen"]),EO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,os=e=>Eo(e)||CO.has(e)||wO.test(e),zs=e=>xl(e,"length",BO),Eo=e=>!!e&&!Number.isNaN(Number(e)),Xh=e=>xl(e,"number",Eo),Ll=e=>!!e&&Number.isInteger(Number(e)),TO=e=>e.endsWith("%")&&Eo(e.slice(0,-1)),Ae=e=>rE.test(e),Fs=e=>EO.test(e),AO=new Set(["length","size","percentage"]),DO=e=>xl(e,AO,nE),OO=e=>xl(e,"position",nE),MO=new Set(["image","url"]),LO=e=>xl(e,MO,HO),PO=e=>xl(e,"",IO),Pl=()=>!0,xl=(e,t,r)=>{const n=rE.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},BO=e=>jO.test(e)&&!kO.test(e),nE=()=>!1,IO=e=>RO.test(e),HO=e=>NO.test(e),zO=()=>{const e=ct("colors"),t=ct("spacing"),r=ct("blur"),n=ct("brightness"),s=ct("borderColor"),i=ct("borderRadius"),l=ct("borderSpacing"),a=ct("borderWidth"),c=ct("contrast"),d=ct("grayscale"),p=ct("hueRotate"),u=ct("invert"),g=ct("gap"),_=ct("gradientColorStops"),x=ct("gradientColorStopPositions"),b=ct("inset"),h=ct("margin"),f=ct("opacity"),m=ct("padding"),v=ct("saturate"),y=ct("scale"),S=ct("sepia"),E=ct("skew"),k=ct("space"),w=ct("translate"),j=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Ae,t],T=()=>[Ae,t],O=()=>["",os,zs],F=()=>["auto",Eo,Ae],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ae],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[Eo,Ae];return{cacheSize:500,separator:":",theme:{colors:[Pl],spacing:[os,zs],blur:["none","",Fs,Ae],brightness:I(),borderColor:[e],borderRadius:["none","","full",Fs,Ae],borderSpacing:T(),borderWidth:O(),contrast:I(),grayscale:D(),hueRotate:I(),invert:D(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[TO,zs],inset:M(),margin:M(),opacity:I(),padding:T(),saturate:I(),scale:I(),sepia:D(),skew:I(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ae]}],container:["container"],columns:[{columns:[Fs]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),Ae]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ll,Ae]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ae]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Ll,Ae]}],"grid-cols":[{"grid-cols":[Pl]}],"col-start-end":[{col:["auto",{span:["full",Ll,Ae]},Ae]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Pl]}],"row-start-end":[{row:["auto",{span:[Ll,Ae]},Ae]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ae]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ae,t]}],"min-w":[{"min-w":[Ae,t,"min","max","fit"]}],"max-w":[{"max-w":[Ae,t,"none","full","min","max","fit","prose",{screen:[Fs]},Fs]}],h:[{h:[Ae,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ae,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Fs,zs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xh]}],"font-family":[{font:[Pl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ae]}],"line-clamp":[{"line-clamp":["none",Eo,Xh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",os,Ae]}],"list-image":[{"list-image":["none",Ae]}],"list-style-type":[{list:["none","disc","decimal",Ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",os,zs]}],"underline-offset":[{"underline-offset":["auto",os,Ae]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),OO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",DO]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LO]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:P()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[os,Ae]}],"outline-w":[{outline:[os,zs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[os,zs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Fs,PO]}],"shadow-color":[{shadow:[Pl]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Fs,Ae]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ae]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",Ae]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Ll,Ae]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ae]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[os,zs,Xh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},FO=SO(zO);function te(...e){return FO(QC(e))}const zv=zf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-mono text-[11px] uppercase tracking-[0.14em] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[var(--accent-sky)] text-[var(--bg-sunken)] hover:bg-[var(--accent-sky-hover)]",destructive:"border border-[var(--break-red)] bg-transparent text-[var(--break-red)] hover:bg-[var(--severity-blocking-bg)]",outline:"border border-[var(--accent-sky)] bg-transparent text-[var(--accent-sky)] hover:bg-[var(--bg-sunken)]",secondary:"border border-[var(--border)] bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",ghost:"bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",link:"bg-transparent normal-case tracking-normal text-[var(--accent-sky)] hover:text-[var(--accent-sky-hover)] underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 px-2.5 text-[10px]",lg:"h-10 px-4 text-xs",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ie=C.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const l=n?ZC:"button";return o.jsx(l,{className:te(zv({variant:t,size:r,className:e})),ref:i,...s})});ie.displayName="Button";const be=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("rounded-lg border border-border bg-card text-card-foreground",e),...t}));be.displayName="Card";const ir=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("flex flex-col gap-1.5 p-6 pb-3",e),...t}));ir.displayName="CardHeader";const pn=C.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:te("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",e),...t}));pn.displayName="CardTitle";const Ns=C.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:te("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));Ns.displayName="CardDescription";const et=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("px-6 pb-6",e),...t}));et.displayName="CardContent";const UO=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("flex items-center px-6 pb-6 pt-0",e),...t}));UO.displayName="CardFooter";function $O(e){const t=VO(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(WO);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function VO(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=KO(s),a=GO(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qO=Symbol("radix.slottable");function WO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qO}function GO(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function KO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var YO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=YO.reduce((e,t)=>{const r=$O(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sE(e,t){e&&bf.flushSync(()=>e.dispatchEvent(t))}var Ts=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function ZO(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var ar=e=>{const{present:t,children:r}=e,n=XO(t),s=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),i=qe(n.ref,QO(s));return typeof r=="function"||n.isPresent?C.cloneElement(s,{ref:i}):null};ar.displayName="Presence";function XO(e){const[t,r]=C.useState(),n=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),l=e?"mounted":"unmounted",[a,c]=ZO(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=Bu(n.current);i.current=a==="mounted"?d:"none"},[a]),Ts(()=>{const d=n.current,p=s.current;if(p!==e){const g=i.current,_=Bu(d);e?c("MOUNT"):_==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(p&&g!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Ts(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,u=_=>{const b=Bu(n.current).includes(CSS.escape(_.animationName));if(_.target===t&&b&&(c("ANIMATION_END"),!s.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},g=_=>{_.target===t&&(i.current=Bu(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Bu(e){return(e==null?void 0:e.animationName)||"none"}function QO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function JO(e,t){const r=C.createContext(t),n=i=>{const{children:l,...a}=i,c=C.useMemo(()=>a,Object.values(a));return o.jsx(r.Provider,{value:c,children:l})};n.displayName=e+"Provider";function s(i){const l=C.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function Ln(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l),c=r.length;r=[...r,l];const d=u=>{var f;const{scope:g,children:_,...x}=u,b=((f=g==null?void 0:g[e])==null?void 0:f[c])||a,h=C.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:h,children:_})};d.displayName=i+"Provider";function p(u,g){var b;const _=((b=g==null?void 0:g[e])==null?void 0:b[c])||a,x=C.useContext(_);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,p]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,eM(s,...t)]}function eM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function nr(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var tM=C.createContext(void 0);function Fv(e){const t=C.useContext(tM);return e||t||"ltr"}function rM(e,[t,r]){return Math.min(r,Math.max(t,e))}function _e(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function nM(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Uv="ScrollArea",[iE]=Ln(Uv),[sM,vn]=iE(Uv),aE=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...l}=e,[a,c]=C.useState(null),[d,p]=C.useState(null),[u,g]=C.useState(null),[_,x]=C.useState(null),[b,h]=C.useState(null),[f,m]=C.useState(0),[v,y]=C.useState(0),[S,E]=C.useState(!1),[k,w]=C.useState(!1),j=qe(t,M=>c(M)),R=Fv(s);return o.jsx(sM,{scope:r,type:n,dir:R,scrollHideDelay:i,scrollArea:a,viewport:d,onViewportChange:p,content:u,onContentChange:g,scrollbarX:_,onScrollbarXChange:x,scrollbarXEnabled:S,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:h,scrollbarYEnabled:k,onScrollbarYEnabledChange:w,onCornerWidthChange:m,onCornerHeightChange:y,children:o.jsx(We.div,{dir:R,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":f+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});aE.displayName=Uv;var oE="ScrollAreaViewport",lE=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,l=vn(oE,r),a=C.useRef(null),c=qe(t,a,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx(We.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});lE.displayName=oE;var es="ScrollAreaScrollbar",$v=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=vn(es,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):l(!0),()=>{a?i(!1):l(!1)}),[a,i,l]),s.type==="hover"?o.jsx(iM,{...n,ref:t,forceMount:r}):s.type==="scroll"?o.jsx(aM,{...n,ref:t,forceMount:r}):s.type==="auto"?o.jsx(cE,{...n,ref:t,forceMount:r}):s.type==="always"?o.jsx(Vv,{...n,ref:t}):null});$v.displayName=es;var iM=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=vn(es,e.__scopeScrollArea),[i,l]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const d=()=>{window.clearTimeout(c),l(!0)},p=()=>{c=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",p)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(ar,{present:r||i,children:o.jsx(cE,{"data-state":i?"visible":"hidden",...n,ref:t})})}),aM=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=vn(es,e.__scopeScrollArea),i=e.orientation==="horizontal",l=Uf(()=>c("SCROLL_END"),100),[a,c]=nM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const d=s.viewport,p=i?"scrollLeft":"scrollTop";if(d){let u=d[p];const g=()=>{const _=d[p];u!==_&&(c("SCROLL"),l()),u=_};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,i,c,l]),o.jsx(ar,{present:r||a!=="hidden",children:o.jsx(Vv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),cE=C.forwardRef((e,t)=>{const r=vn(es,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,l]=C.useState(!1),a=e.orientation==="horizontal",c=Uf(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,p=r.viewport.offsetHeight<r.viewport.scrollHeight;l(a?d:p)}},10);return rl(r.viewport,c),rl(r.content,c),o.jsx(ar,{present:n||i,children:o.jsx(Vv,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Vv=C.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=vn(es,e.__scopeScrollArea),i=C.useRef(null),l=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=mE(a.viewport,a.content),p={...n,sizes:a,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function u(g,_){return fM(g,l.current,a,_)}return r==="horizontal"?o.jsx(oM,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,_=Gx(g,a,s.dir);i.current.style.transform=`translate3d(${_}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=u(g,s.dir))}}):r==="vertical"?o.jsx(lM,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,_=Gx(g,a);i.current.style.transform=`translate3d(0, ${_}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=u(g))}}):null}),oM=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=vn(es,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),d=qe(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(dE,{"data-orientation":"horizontal",...s,ref:d,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ff(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,u)=>{if(i.viewport){const g=i.viewport.scrollLeft+p.deltaX;e.onWheelScroll(g),gE(g,u)&&p.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Yd(l.paddingLeft),paddingEnd:Yd(l.paddingRight)}})}})}),lM=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=vn(es,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),d=qe(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(dE,{"data-orientation":"vertical",...s,ref:d,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ff(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,u)=>{if(i.viewport){const g=i.viewport.scrollTop+p.deltaY;e.onWheelScroll(g),gE(g,u)&&p.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Yd(l.paddingTop),paddingEnd:Yd(l.paddingBottom)}})}})}),[cM,uE]=iE(es),dE=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:p,onResize:u,...g}=e,_=vn(es,r),[x,b]=C.useState(null),h=qe(t,j=>b(j)),f=C.useRef(null),m=C.useRef(""),v=_.viewport,y=n.content-n.viewport,S=nr(p),E=nr(c),k=Uf(u,10);function w(j){if(f.current){const R=j.clientX-f.current.left,M=j.clientY-f.current.top;d({x:R,y:M})}}return C.useEffect(()=>{const j=R=>{const M=R.target;(x==null?void 0:x.contains(M))&&S(R,y)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[v,x,y,S]),C.useEffect(E,[n,E]),rl(x,k),rl(_.content,k),o.jsx(cM,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:nr(i),onThumbPointerUp:nr(l),onThumbPositionChange:E,onThumbPointerDown:nr(a),children:o.jsx(We.div,{...g,ref:h,style:{position:"absolute",...g.style},onPointerDown:_e(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),f.current=x.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",_.viewport&&(_.viewport.style.scrollBehavior="auto"),w(j))}),onPointerMove:_e(e.onPointerMove,w),onPointerUp:_e(e.onPointerUp,j=>{const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=m.current,_.viewport&&(_.viewport.style.scrollBehavior=""),f.current=null})})})}),Kd="ScrollAreaThumb",fE=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=uE(Kd,e.__scopeScrollArea);return o.jsx(ar,{present:r||s.hasThumb,children:o.jsx(uM,{ref:t,...n})})}),uM=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=vn(Kd,r),l=uE(Kd,r),{onThumbPositionChange:a}=l,c=qe(t,u=>l.onThumbChange(u)),d=C.useRef(void 0),p=Uf(()=>{d.current&&(d.current(),d.current=void 0)},100);return C.useEffect(()=>{const u=i.viewport;if(u){const g=()=>{if(p(),!d.current){const _=hM(u,a);d.current=_,a()}};return a(),u.addEventListener("scroll",g),()=>u.removeEventListener("scroll",g)}},[i.viewport,p,a]),o.jsx(We.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_e(e.onPointerDownCapture,u=>{const _=u.target.getBoundingClientRect(),x=u.clientX-_.left,b=u.clientY-_.top;l.onThumbPointerDown({x,y:b})}),onPointerUp:_e(e.onPointerUp,l.onThumbPointerUp)})});fE.displayName=Kd;var qv="ScrollAreaCorner",hE=C.forwardRef((e,t)=>{const r=vn(qv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?o.jsx(dM,{...e,ref:t}):null});hE.displayName=qv;var dM=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=vn(qv,r),[i,l]=C.useState(0),[a,c]=C.useState(0),d=!!(i&&a);return rl(s.scrollbarX,()=>{var u;const p=((u=s.scrollbarX)==null?void 0:u.offsetHeight)||0;s.onCornerHeightChange(p),c(p)}),rl(s.scrollbarY,()=>{var u;const p=((u=s.scrollbarY)==null?void 0:u.offsetWidth)||0;s.onCornerWidthChange(p),l(p)}),d?o.jsx(We.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Yd(e){return e?parseInt(e,10):0}function mE(e,t){const r=e/t;return isNaN(r)?0:r}function Ff(e){const t=mE(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function fM(e,t,r,n="ltr"){const s=Ff(r),i=s/2,l=t||i,a=s-l,c=r.scrollbar.paddingStart+l,d=r.scrollbar.size-r.scrollbar.paddingEnd-a,p=r.content-r.viewport,u=n==="ltr"?[0,p]:[p*-1,0];return pE([c,d],u)(e)}function Gx(e,t,r="ltr"){const n=Ff(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,l=t.content-t.viewport,a=i-n,c=r==="ltr"?[0,l]:[l*-1,0],d=rM(e,c);return pE([0,l],[0,a])(d)}function pE(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function gE(e,t){return e>0&&e<t}var hM=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},l=r.left!==i.left,a=r.top!==i.top;(l||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Uf(e,t){const r=nr(e),n=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),C.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function rl(e,t){const r=nr(t);Ts(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var vE=aE,mM=lE,pM=hE;const su=C.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(vE,{ref:n,className:te("relative overflow-hidden",e),...r,children:[o.jsx(mM,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(_E,{}),o.jsx(pM,{})]}));su.displayName=vE.displayName;const _E=C.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx($v,{ref:n,orientation:t,className:te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-px",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(fE,{className:"relative flex-1 rounded-full bg-[var(--border-strong)]"})}));_E.displayName=$v.displayName;const gM="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",vM="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function _M({headline:e}){const[t,r]=C.useState(!1),{events:n}=KC(),s=n.length>0?n[n.length-1]:null;return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:gM,children:"Jinn · starting up"}),o.jsxs("h1",{className:vM,children:[e,"."]}),o.jsx("p",{className:"min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]",children:s?yM(s):"The daemon is booting. This usually takes a second."}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(i=>!i),"aria-expanded":t,children:[t?o.jsx(Pv,{}):o.jsx(Hf,{}),t?"Hide details":"Show details"]}),t&&o.jsx(be,{className:"bg-[var(--bg-elevated)]",children:o.jsx(et,{className:"p-0",children:o.jsx(su,{className:"h-64",children:o.jsxs("div",{className:"px-3 py-2 font-mono text-xs",children:[n.length===0&&o.jsx("div",{className:"text-[var(--fg-dim)]",children:"no events yet"}),n.slice().reverse().map(i=>o.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:i.ts.slice(11,19)}),o.jsx("span",{className:te(i.kind==="error"?"text-[var(--break-red)]":i.kind==="system"?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]"),children:i.kind}),o.jsx("span",{className:"text-foreground",children:i.message})]},i.id))]})})})})]})})}function yM(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const xM=zf("relative w-full border-l-2 px-4 py-2 font-mono text-[12px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3 [&>svg+div]:translate-y-[-3px]",{variants:{variant:{default:"border-[var(--severity-info-fg)] bg-transparent text-foreground",info:"border-[var(--severity-info-fg)] bg-transparent text-foreground",warning:"border-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)] text-foreground",blocking:"border-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)] text-foreground",success:"border-[var(--vow-green)] bg-transparent text-foreground"}},defaultVariants:{variant:"default"}}),nt=C.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:te(xM({variant:t}),e),...r}));nt.displayName="Alert";const It=C.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:te("mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]",e),...t}));It.displayName="AlertTitle";const at=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("text-[12px] [&_p]:leading-relaxed",e),...t}));at.displayName="AlertDescription";function bM(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l);a.displayName=i+"Context";const c=r.length;r=[...r,l];const d=u=>{var f;const{scope:g,children:_,...x}=u,b=((f=g==null?void 0:g[e])==null?void 0:f[c])||a,h=C.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:h,children:_})};d.displayName=i+"Provider";function p(u,g){var b;const _=((b=g==null?void 0:g[e])==null?void 0:b[c])||a,x=C.useContext(_);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,p]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,SM(s,...t)]}function SM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var wM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yE=wM.reduce((e,t)=>{const r=Iv(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Wv="Progress",Gv=100,[CM]=bM(Wv),[EM,jM]=CM(Wv),xE=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=kM,...l}=e;(s||s===0)&&!Kx(s)&&console.error(RM(`${s}`,"Progress"));const a=Kx(s)?s:Gv;n!==null&&!Yx(n,a)&&console.error(NM(`${n}`,"Progress"));const c=Yx(n,a)?n:null,d=Zd(c)?i(c,a):void 0;return o.jsx(EM,{scope:r,value:c,max:a,children:o.jsx(yE.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Zd(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":wE(c,a),"data-value":c??void 0,"data-max":a,...l,ref:t})})});xE.displayName=Wv;var bE="ProgressIndicator",SE=C.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=jM(bE,r);return o.jsx(yE.div,{"data-state":wE(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});SE.displayName=bE;function kM(e,t){return`${Math.round(e/t*100)}%`}function wE(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Zd(e){return typeof e=="number"}function Kx(e){return Zd(e)&&!isNaN(e)&&e>0}function Yx(e,t){return Zd(e)&&!isNaN(e)&&e<=t&&e>=0}function RM(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Gv}\`.`}function NM(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
198
|
+
- a positive number
|
|
199
|
+
- less than the value passed to \`max\` (or ${Gv} if no \`max\` prop is set)
|
|
200
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
201
|
+
|
|
202
|
+
Defaulting to \`null\`.`}var CE=xE,TM=SE;const Kv=C.forwardRef(({className:e,value:t,...r},n)=>o.jsx(CE,{ref:n,className:te("relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]",e),...r,children:o.jsx(TM,{className:"h-full w-full flex-1 bg-[var(--accent-sky)] transition-all",style:{transform:`translateX(-${100-(t??0)}%)`}})}));Kv.displayName=CE.displayName;const AM={base:"Base","base-sepolia":"Base Sepolia"},DM="font-mono text-[11px] font-medium uppercase tracking-[0.14em]";function OM({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:s=!1}){var k;const[i,l]=C.useState(!1),[a,c]=C.useState(null),[d,p]=C.useState(0),u=C.useRef(!1),[g,_]=C.useState({state:"idle"});C.useEffect(()=>{if(a===null)return;p(Math.max(0,Math.floor((Date.now()-a)/1e3)));const w=window.setInterval(()=>{p(Math.max(0,Math.floor((Date.now()-a)/1e3)))},1e3);return()=>window.clearInterval(w)},[a]);const x=async()=>{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)},b=async()=>{var w;u.current=!0,c(Date.now()),p(0),_({state:"requesting"});try{const j=await he.triggerDrip();c(null),j.ok?_({state:"sent",txHash:j.txHash??((w=j.txHashes)==null?void 0:w.at(-1)),txHashes:j.txHashes,attempts:j.attempts,balanceWei:j.balanceWei,targetWei:j.targetWei}):j.rateLimited||j.reason&&/rate|claimed|429/i.test(j.reason)?_({state:"rate_limited",reason:j.reason??"faucet rate-limited"}):_({state:"failed",reason:j.reason??"faucet funding failed"})}catch(j){c(null),_({state:"failed",reason:j instanceof Error?j.message:"drip failed"})}},h=C.useRef(t);C.useEffect(()=>{h.current!==t&&(h.current=t,_({state:"idle"}),u.current&&b())},[t]);const f=w=>{if(!w)return"unknown";try{const j=Number(BigInt(w))/1e18;return`${j.toFixed(j<.001?4:3)} ETH`}catch{return`${w} wei`}},m=f(t),v=C.useMemo(()=>g.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(d/60*92))),[g.state,d]),y=g.state==="sent"?((k=g.txHashes)==null?void 0:k.length)??g.attempts??(g.txHash?1:0):0,S=g.state==="sent"&&g.balanceWei!==void 0&&g.targetWei!==void 0&&(()=>{try{return BigInt(g.balanceWei)>=BigInt(g.targetWei)}catch{return!1}})(),E=g.state==="sent"&&!S;return o.jsxs(nt,{variant:"warning",className:"flex flex-col gap-4 border-l-2 px-6 py-5",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(It,{className:te(DM,"text-[var(--accent-gold)]"),children:"Action needed · fund the master EOA"}),o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:"auto-detected on chain"})]}),o.jsxs(at,{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"break-all font-mono text-xs text-foreground",children:e}),o.jsxs("span",{className:"font-mono text-xs text-[var(--fg-muted)]",children:["send at least ",m," on ",AM[n??""]??"this chain"]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ie,{type:"button",onClick:b,disabled:g.state==="requesting"||S,className:"bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]",children:g.state==="requesting"?"Funding...":S?"Faucet funded":E?"Fund more":"Fund from faucet"}),o.jsx(ie,{type:"button",variant:"secondary",onClick:x,children:i?"Copied":"Copy address"}),o.jsx(ie,{asChild:!0,variant:"ghost",children:o.jsxs("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(Co,{}),"View on explorer"]})})]}),g.state==="sent"&&o.jsxs("p",{className:te("font-mono text-[11px]",S?"text-[var(--vow-green)]":"text-[var(--accent-gold)]"),children:[S?"Faucet funding complete":"Faucet funding partial",y>0?` (${y} drip${y===1?"":"s"})`:"",".",g.balanceWei&&g.targetWei?` Balance ${f(g.balanceWei)} / target ${f(g.targetWei)}.`:"",E?' Click "Fund more" to top up.':"",g.txHash&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:`${r}/tx/${g.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent-sky)] hover:underline",children:"view latest tx"})]})]}),g.state==="requesting"&&o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(Kv,{value:v,className:"h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]"}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:["Requesting faucet drips for ",MM(e),". Elapsed ",d,"s; this can take about a minute on a fresh wallet."]})]}),g.state==="rate_limited"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--wane)]",children:"Faucet rate-limited. Send manually or wait before trying again."}),g.state==="failed"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--break-red)]",children:g.reason}),s&&o.jsx("p",{"data-testid":"onboarding-shared-rpc-nudge",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Using a shared trial RPC — add your own key in the Network section for reliable operation."})]})}const MM=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var EE={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(l,a,c){var d=this&&this.__decorate||function(v,y,S,E){var k,w=arguments.length,j=w<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,y,S,E);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(j=(w<3?k(j):w>3?k(y,S,j):k(y,S))||j);return w>3&&j&&Object.defineProperty(y,S,j),j},p=this&&this.__param||function(v,y){return function(S,E){y(S,E,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),g=c(6114),_=c(9924),x=c(844),b=c(5596),h=c(4725),f=c(3656);let m=a.AccessibilityManager=class extends x.Disposable{constructor(v,y){super(),this._terminal=v,this._renderService=y,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 S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(S=>this._handleResize(S.rows))),this.register(this._terminal.onRender(S=>this._refreshRows(S.start,S.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(S=>this._handleChar(S))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
203
|
+
`))),this.register(this._terminal.onA11yTab(S=>this._handleTab(S))),this.register(this._terminal.onKey(S=>this._handleKey(S.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new b.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,f.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,x.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(v){for(let y=0;y<v;y++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
|
|
204
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),g.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,g.isMac&&this._liveRegion.remove()}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,y){this._liveRegionDebouncer.refresh(v,y,this._terminal.rows)}_renderRows(v,y){const S=this._terminal.buffer,E=S.lines.length.toString();for(let k=v;k<=y;k++){const w=S.translateBufferLineToString(S.ydisp+k,!0),j=(S.ydisp+k+1).toString(),R=this._rowElements[k];R&&(w.length===0?R.innerText=" ":R.textContent=w,R.setAttribute("aria-posinset",j),R.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,y){const S=v.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==E)return;let k,w;if(y===0?(k=S,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(k=this._rowElements.shift(),w=S,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=document.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_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 v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=m=d([p(1,h.IRenderService)],m)},3614:(l,a)=>{function c(g){return g.replace(/\r?\n/g,"\r")}function d(g,_){return _?"\x1B[200~"+g+"\x1B[201~":g}function p(g,_,x,b){g=d(g=c(g),x.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(g,!0),_.value=""}function u(g,_,x){const b=x.getBoundingClientRect(),h=g.clientX-b.left-10,f=g.clientY-b.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${h}px`,_.style.top=`${f}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=d,a.copyHandler=function(g,_){g.clipboardData&&g.clipboardData.setData("text/plain",_.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,_,x,b){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),_,x,b)},a.paste=p,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(g,_,x,b,h){u(g,_,x),h&&b.rightClickSelect(g),_.value=b.selectionText,_.select()}},7239:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=c(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,u,g){this._css.set(p,u,g)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,g){this._color.set(p,u,g)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,d,p,u){c.addEventListener(d,p,u);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(d,p,u))}}}},6465:function(l,a,c){var d=this&&this.__decorate||function(h,f,m,v){var y,S=arguments.length,E=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,f,m,v);else for(var k=h.length-1;k>=0;k--)(y=h[k])&&(E=(S<3?y(E):S>3?y(f,m,E):y(f,m))||E);return S>3&&E&&Object.defineProperty(f,m,E),E},p=this&&this.__param||function(h,f){return function(m,v){f(m,v,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier2=void 0;const u=c(3656),g=c(8460),_=c(844),x=c(2585);let b=a.Linkifier2=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const f=this._linkProviders.indexOf(h);f!==-1&&this._linkProviders.splice(f,1)}}}attachToDom(h,f,m){this._element=h,this._mouseService=f,this._renderService=m,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const m=h.composedPath();for(let v=0;v<m.length;v++){const y=m[v];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,f){var m,v;this._activeProviderReplies&&f||((m=this._activeProviderReplies)===null||m===void 0||m.forEach(S=>{S==null||S.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let y=!1;for(const[S,E]of this._linkProviders.entries())f?!((v=this._activeProviderReplies)===null||v===void 0)&&v.get(S)&&(y=this._checkLinkProviderResult(S,h,y)):E.provideLinks(h.y,k=>{var w,j;if(this._isMouseOut)return;const R=k==null?void 0:k.map(M=>({link:M}));(w=this._activeProviderReplies)===null||w===void 0||w.set(S,R),y=this._checkLinkProviderResult(S,h,y),((j=this._activeProviderReplies)===null||j===void 0?void 0:j.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,f){const m=new Set;for(let v=0;v<f.size;v++){const y=f.get(v);if(y)for(let S=0;S<y.length;S++){const E=y[S],k=E.link.range.start.y<h?0:E.link.range.start.x,w=E.link.range.end.y>h?this._bufferService.cols:E.link.range.end.x;for(let j=k;j<=w;j++){if(m.has(j)){y.splice(S--,1);break}m.add(j)}}}}_checkLinkProviderResult(h,f,m){var v;if(!this._activeProviderReplies)return m;const y=this._activeProviderReplies.get(h);let S=!1;for(let E=0;E<h;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(S=!0);if(!S&&y){const E=y.find(k=>this._linkAtPosition(k.link,f));E&&(m=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviders.length&&!m)for(let E=0;E<this._activeProviderReplies.size;E++){const k=(v=this._activeProviderReplies.get(E))===null||v===void 0?void 0:v.find(w=>this._linkAtPosition(w.link,f));if(k){m=!0,this._handleNewLink(k);break}}return m}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!this._currentLink)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,f){this._element&&this._currentLink&&this._lastMouseEvent&&(!h||!f||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(h.link,f)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var m,v;return(v=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||v===void 0?void 0:v.decorations.pointerCursor},set:m=>{var v,y;!((v=this._currentLink)===null||v===void 0)&&v.state&&this._currentLink.state.decorations.pointerCursor!==m&&(this._currentLink.state.decorations.pointerCursor=m,this._currentLink.state.isHovered&&((y=this._element)===null||y===void 0||y.classList.toggle("xterm-cursor-pointer",m)))}},underline:{get:()=>{var m,v;return(v=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||v===void 0?void 0:v.decorations.underline},set:m=>{var v,y,S;!((v=this._currentLink)===null||v===void 0)&&v.state&&((S=(y=this._currentLink)===null||y===void 0?void 0:y.state)===null||S===void 0?void 0:S.decorations.underline)!==m&&(this._currentLink.state.decorations.underline=m,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,m))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(m=>{if(!this._currentLink)return;const v=m.start===0?0:m.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+m.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(v,y),this._lastMouseEvent&&this._element)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}})))}_linkHover(h,f,m){var v;!((v=this._currentLink)===null||v===void 0)&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(m,f.text)}_fireUnderlineEvent(h,f){const m=h.range,v=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-v-1,m.end.x,m.end.y-v-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(h,f,m){var v;!((v=this._currentLink)===null||v===void 0)&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(m,f.text)}_linkAtPosition(h,f){const m=h.range.start.y*this._bufferService.cols+h.range.start.x,v=h.range.end.y*this._bufferService.cols+h.range.end.x,y=f.y*this._bufferService.cols+f.x;return m<=y&&y<=v}_positionFromMouseEvent(h,f,m){const v=m.getCoords(h,f,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,f,m,v,y){return{x1:h,y1:f,x2:m,y2:v,cols:this._bufferService.cols,fg:y}}};a.Linkifier2=b=d([p(0,x.IBufferService)],b)},9042:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,a,c){var d=this&&this.__decorate||function(b,h,f,m){var v,y=arguments.length,S=y<3?h:m===null?m=Object.getOwnPropertyDescriptor(h,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,h,f,m);else for(var E=b.length-1;E>=0;E--)(v=b[E])&&(S=(y<3?v(S):y>3?v(h,f,S):v(h,f))||S);return y>3&&S&&Object.defineProperty(h,f,S),S},p=this&&this.__param||function(b,h){return function(f,m){h(f,m,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),g=c(2585);let _=a.OscLinkProvider=class{constructor(b,h,f){this._bufferService=b,this._optionsService=h,this._oscLinkService=f}provideLinks(b,h){var f;const m=this._bufferService.buffer.lines.get(b-1);if(!m)return void h(void 0);const v=[],y=this._optionsService.rawOptions.linkHandler,S=new u.CellData,E=m.getTrimmedLength();let k=-1,w=-1,j=!1;for(let R=0;R<E;R++)if(w!==-1||m.hasContent(R)){if(m.loadCell(R,S),S.hasExtendedAttrs()&&S.extended.urlId){if(w===-1){w=R,k=S.extended.urlId;continue}j=S.extended.urlId!==k}else w!==-1&&(j=!0);if(j||w!==-1&&R===E-1){const M=(f=this._oscLinkService.getLinkData(k))===null||f===void 0?void 0:f.uri;if(M){const T={start:{x:w+1,y:b},end:{x:R+(j||R!==E-1?0:1),y:b}};let O=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const F=new URL(M);["http:","https:"].includes(F.protocol)||(O=!0)}catch{O=!0}O||v.push({text:M,range:T,activate:(F,$)=>y?y.activate(F,$,T):x(0,$),hover:(F,$)=>{var P;return(P=y==null?void 0:y.hover)===null||P===void 0?void 0:P.call(y,F,$,T)},leave:(F,$)=>{var P;return(P=y==null?void 0:y.leave)===null||P===void 0?void 0:P.call(y,F,$,T)}})}j=!1,S.hasExtendedAttrs()&&S.extended.urlId?(w=R,k=S.extended.urlId):(w=-1,k=-1)}}h(v)}};function x(b,h){if(confirm(`Do you want to navigate to ${h}?
|
|
205
|
+
|
|
206
|
+
WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=_=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],_)},6193:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,d){this._parentWindow=c,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},5596:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ScreenDprMonitor=void 0;const d=c(844);class p extends d.Disposable{constructor(g){super(),this._parentWindow=g,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(g){this._listener&&this.clearListener(),this._listener=g,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}a.ScreenDprMonitor=p},3236:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=c(3614),p=c(3656),u=c(6465),g=c(9042),_=c(3730),x=c(1680),b=c(3107),h=c(5744),f=c(2950),m=c(1296),v=c(428),y=c(4269),S=c(5114),E=c(8934),k=c(3230),w=c(9312),j=c(4725),R=c(6731),M=c(8055),T=c(8969),O=c(8460),F=c(844),$=c(6114),P=c(8437),U=c(2584),N=c(7399),D=c(5941),L=c(9074),I=c(2585),Q=c(5435),q=c(4567),J=typeof window<"u"?window.document:null;class Z extends T.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(A={}){super(A),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new O.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new O.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new O.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new O.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new O.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new O.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new O.EventEmitter),this._onBlur=this.register(new O.EventEmitter),this._onA11yCharEmitter=this.register(new O.EventEmitter),this._onA11yTabEmitter=this.register(new O.EventEmitter),this._onWillOpen=this.register(new O.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((H,G)=>this.refresh(H,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(H=>this._reportWindowsOptions(H))),this.register(this._inputHandler.onColor(H=>this._handleColorEvent(H))),this.register((0,O.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,O.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(H=>this._afterResize(H.cols,H.rows))),this.register((0,F.toDisposable)(()=>{var H,G;this._customKeyEventHandler=void 0,(G=(H=this.element)===null||H===void 0?void 0:H.parentNode)===null||G===void 0||G.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const H of A){let G,Y="";switch(H.index){case 256:G="foreground",Y="10";break;case 257:G="background",Y="11";break;case 258:G="cursor",Y="12";break;default:G="ansi",Y="4;"+H.index}switch(H.type){case 0:const ce=M.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${Y};${(0,D.toRgbString)(ce)}${U.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(K=>K.ansi[H.index]=M.rgba.toColor(...H.color));else{const K=G;this._themeService.modifyColors(pe=>pe[K]=M.rgba.toColor(...H.color))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.updateCursorStyle(A),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var A;return(A=this.textarea)===null||A===void 0?void 0:A.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(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 A=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(A);if(!H)return;const G=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,ce=H.getWidth(G),K=this._renderService.dimensions.css.cell.width*ce,pe=this.buffer.y*this._renderService.dimensions.css.cell.height,Me=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Me+"px",this.textarea.style.top=pe+"px",this.textarea.style.width=K+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",H=>{this.hasSelection()&&(0,d.copyHandler)(H,this._selectionService)}));const A=H=>(0,d.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,p.addDisposableDomListener)(this.element,"paste",A)),$.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",H=>{H.button===2&&(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",H=>{(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",H=>{H.button===1&&(0,d.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){var H;if(!A)throw new Error("Terminal requires a parent element.");A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=A.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const G=J.createDocumentFragment();this._viewportElement=J.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=J.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=J.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=J.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=J.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),$.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(S.CoreBrowserService,this.textarea,(H=this._document.defaultView)!==null&&H!==void 0?H:window),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",Y=>this._handleTextAreaFocus(Y))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(Y=>this._onRender.fire(Y))),this.onResize(Y=>this._renderService.resize(Y.cols,Y.rows)),this._compositionView=J.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(Y=>this.scrollLines(Y.amount,Y.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(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(Y=>this._renderService.handleSelectionChanged(Y.start,Y.end,Y.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(Y=>{this.textarea.value=Y,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(Y=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",Y=>this._selectionService.handleMouseDown(Y))),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",Y=>this._handleScreenReaderModeOptionChange(Y))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const A=this,H=this.element;function G(K){const pe=A._mouseService.getMouseReportCoords(K,A.screenElement);if(!pe)return!1;let Me,Ke;switch(K.overrideType||K.type){case"mousemove":Ke=32,K.buttons===void 0?(Me=3,K.button!==void 0&&(Me=K.button<3?K.button:3)):Me=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":Ke=0,Me=K.button<3?K.button:3;break;case"mousedown":Ke=1,Me=K.button<3?K.button:3;break;case"wheel":if(A.viewport.getLinesScrolled(K)===0)return!1;Ke=K.deltaY<0?0:1,Me=4;break;default:return!1}return!(Ke===void 0||Me===void 0||Me>4)&&A.coreMouseService.triggerMouseEvent({col:pe.col,row:pe.row,x:pe.x,y:pe.y,button:Me,action:Ke,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:K=>(G(K),K.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(K)),wheel:K=>(G(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&G(K)},mousemove:K=>{K.buttons||G(K)}};this.register(this.coreMouseService.onProtocolChange(K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?Y.mousemove||(H.addEventListener("mousemove",ce.mousemove),Y.mousemove=ce.mousemove):(H.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&K?Y.wheel||(H.addEventListener("wheel",ce.wheel,{passive:!1}),Y.wheel=ce.wheel):(H.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&K?Y.mouseup||(H.addEventListener("mouseup",ce.mouseup),Y.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),H.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&K?Y.mousedrag||(Y.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(H,"mousedown",K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return G(K),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(K)})),this.register((0,p.addDisposableDomListener)(H,"wheel",K=>{if(!Y.wheel){if(!this.buffer.hasScrollback){const pe=this.viewport.getLinesScrolled(K);if(pe===0)return;const Me=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let Ke="";for(let Ht=0;Ht<Math.abs(pe);Ht++)Ke+=Me;return this.coreService.triggerDataEvent(Ke,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(H,"touchstart",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)},{passive:!0})),this.register((0,p.addDisposableDomListener)(H,"touchmove",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)},{passive:!1}))}refresh(A,H){var G;(G=this._renderService)===null||G===void 0||G.refreshRows(A,H)}updateCursorStyle(A){var H;!((H=this._selectionService)===null||H===void 0)&&H.shouldColumnSelect(A)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(A,H,G=0){var Y;G===1?(super.scrollLines(A,H,G),this.refresh(0,this.rows-1)):(Y=this.viewport)===null||Y===void 0||Y.scrollLines(A)}paste(A){(0,d.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}registerLinkProvider(A){return this.linkifier2.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,H,G){this._selectionService.setSelection(A,H,G)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var A;(A=this._selectionService)===null||A===void 0||A.clearSelection()}selectAll(){var A;(A=this._selectionService)===null||A===void 0||A.selectAll()}selectLines(A,H){var G;(G=this._selectionService)===null||G===void 0||G.selectLines(A,H)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!H&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,N.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),G.type===3||G.type===2){const Y=this.rows-1;return this.scrollLines(G.type===2?-Y:Y),this.cancel(A,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(G.cancel&&this.cancel(A,!0),!G.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==U.C0.ETX&&G.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,H){const G=A.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||A.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||A.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?G:G&&(!H.keyCode||H.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)H=A.charCode;else if(A.which===null||A.which===void 0)H=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;H=A.which}return!(!H||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=A.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(A),!0}return!1}resize(A,H){A!==this.cols||H!==this.rows?super.resize(A,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,H){var G,Y;(G=this._charSizeService)===null||G===void 0||G.measure(),(Y=this.viewport)===null||Y===void 0||Y.syncScrollArea(!0)}clear(){var A;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(A=this.viewport)===null||A===void 0||A.reset(),this.refresh(0,this.rows-1)}}reset(){var A,H;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(A=this._selectionService)===null||A===void 0||A.reset(),this._decorationService.reset(),(H=this.viewport)===null||H===void 0||H.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var A;(A=this._renderService)===null||A===void 0||A.clearTextureAtlas()}_reportFocus(){var A;!((A=this.element)===null||A===void 0)&&A.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case Q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${G};${H}t`);break;case Q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${ce};${Y}t`)}}cancel(A,H){if(this.options.cancelEvents||H)return A.preventDefault(),A.stopPropagation(),!1}}a.Terminal=Z},9924:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=u-this._lastRefreshMs,_=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(l,a,c){var d=this&&this.__decorate||function(f,m,v,y){var S,E=arguments.length,k=E<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,m,v,y);else for(var w=f.length-1;w>=0;w--)(S=f[w])&&(k=(E<3?S(k):E>3?S(m,v,k):S(m,v))||k);return E>3&&k&&Object.defineProperty(m,v,k),k},p=this&&this.__param||function(f,m){return function(v,y){m(v,y,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),g=c(4725),_=c(8460),x=c(844),b=c(2585);let h=a.Viewport=class extends x.Disposable{constructor(f,m,v,y,S,E,k,w){super(),this._viewportElement=f,this._scrollArea=m,this._bufferService=v,this._optionsService=y,this._charSizeService=S,this._renderService=E,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(j=>this._activeBuffer=j.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(j=>this._renderDimensions=j)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(j=>this._handleThemeChange(j))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)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 m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){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 m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,m){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&v<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const m=this._getPixelsScrolled(f);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(f,m))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let m=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(f,m){var v;let y,S="";const E=[],k=m??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let j=f;j<k;j++){const R=w.get(j);if(!R)continue;const M=(v=w.get(j+1))===null||v===void 0?void 0:v.isWrapped;if(S+=R.translateToString(!M),!M||j===w.length-1){const T=document.createElement("div");T.textContent=S,E.push(T),S.length>0&&(y=T),S=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let m=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(f,m){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&m.altKey||v==="ctrl"&&m.ctrlKey||v==="shift"&&m.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const m=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(f,m))}};a.Viewport=h=d([p(2,b.IBufferService),p(3,b.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],h)},3107:function(l,a,c){var d=this&&this.__decorate||function(h,f,m,v){var y,S=arguments.length,E=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,f,m,v);else for(var k=h.length-1;k>=0;k--)(y=h[k])&&(E=(S<3?y(E):S>3?y(f,m,E):y(f,m))||E);return S>3&&E&&Object.defineProperty(f,m,E),E},p=this&&this.__param||function(h,f){return function(m,v){f(m,v,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(3656),g=c(4725),_=c(844),x=c(2585);let b=a.BufferDecorationRenderer=class extends _.Disposable{constructor(h,f,m,v){super(),this._screenElement=h,this._bufferService=f,this._decorationService=m,this._renderService=v,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,u.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(y=>this._removeDecoration(y))),this.register((0,_.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var f,m;const v=document.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((f=h==null?void 0:h.options)===null||f===void 0?void 0:f.layer)==="top"),v.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=(m=h.options.x)!==null&&m!==void 0?m:0;return y&&y>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(h,v),v}_refreshStyle(h){const f=h.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let m=this._decorationElements.get(h);m||(m=this._createElement(h),h.element=m,this._decorationElements.set(h,m),this._container.appendChild(m),h.onDispose(()=>{this._decorationElements.delete(h),m.remove()})),m.style.top=f*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(m)}}_refreshXPosition(h,f=h.element){var m;if(!f)return;const v=(m=h.options.x)!==null&&m!==void 0?m:0;(h.options.anchor||"left")==="right"?f.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":f.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var f;(f=this._decorationElements.get(h))===null||f===void 0||f.remove(),this._decorationElements.delete(h),h.dispose()}};a.BufferDecorationRenderer=b=d([p(1,x.IBufferService),p(2,x.IDecorationService),p(3,g.IRenderService)],b)},5871:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,p){return d>=c.startBufferLine-this._linePadding[p||"full"]&&d<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(l,a,c){var d=this&&this.__decorate||function(y,S,E,k){var w,j=arguments.length,R=j<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,S,E,k);else for(var M=y.length-1;M>=0;M--)(w=y[M])&&(R=(j<3?w(R):j>3?w(S,E,R):w(S,E))||R);return j>3&&R&&Object.defineProperty(S,E,R),R},p=this&&this.__param||function(y,S){return function(E,k){S(E,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),g=c(3656),_=c(4725),x=c(844),b=c(2585),h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let v=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,S,E,k,w,j,R){var M;super(),this._viewportElement=y,this._screenElement=S,this._bufferService=E,this._decorationService=k,this._renderService=w,this._optionsService=j,this._coreBrowseService=R,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)===null||M===void 0||M.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)(()=>{var O;(O=this._canvas)===null||O===void 0||O.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,g.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=y,f.center=S,f.right=y,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=f.left,m.right=f.left+f.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowseService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowseService.dpr);h.left=S,h.center=S,h.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const S of y)S.position!=="full"&&this._renderColorZone(S);for(const S of y)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(m[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-h[y.position||"full"]/2),f[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[y.position||"full"]))}_queueRefresh(y,S){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=v=d([p(2,b.IBufferService),p(3,b.IDecorationService),p(4,_.IRenderService),p(5,b.IOptionsService),p(6,_.ICoreBrowserService)],v)},2950:function(l,a,c){var d=this&&this.__decorate||function(b,h,f,m){var v,y=arguments.length,S=y<3?h:m===null?m=Object.getOwnPropertyDescriptor(h,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,h,f,m);else for(var E=b.length-1;E>=0;E--)(v=b[E])&&(S=(y<3?v(S):y>3?v(h,f,S):v(h,f))||S);return y>3&&S&&Object.defineProperty(h,f,S),S},p=this&&this.__param||function(b,h){return function(f,m){h(f,m,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),g=c(2585),_=c(2584);let x=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,h,f,m,v,y){this._textarea=b,this._compositionView=h,this._bufferService=f,this._optionsService=m,this._coreService=v,this._renderService=y,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,f=h.replace(b,"");this._dataAlreadySent=f,h.length>b.length?this._coreService.triggerDataEvent(f,!0):h.length<b.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):h.length===b.length&&h!==b&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}b||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a.CompositionHelper=x=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,u.IRenderService)],x)},9806:(l,a)=>{function c(d,p,u){const g=u.getBoundingClientRect(),_=d.getComputedStyle(u),x=parseInt(_.getPropertyValue("padding-left")),b=parseInt(_.getPropertyValue("padding-top"));return[p.clientX-g.left-x,p.clientY-g.top-b]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(d,p,u,g,_,x,b,h,f){if(!x)return;const m=c(d,p,u);return m?(m[0]=Math.ceil((m[0]+(f?b/2:0))/b),m[1]=Math.ceil(m[1]/h),m[0]=Math.min(Math.max(m[0],1),g+(f?1:0)),m[1]=Math.min(Math.max(m[1],1),_),m):void 0}},9504:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=c(2584);function p(h,f,m,v){const y=h-u(h,m),S=f-u(f,m),E=Math.abs(y-S)-function(k,w,j){let R=0;const M=k-u(k,j),T=w-u(w,j);for(let O=0;O<Math.abs(M-T);O++){const F=g(k,w)==="A"?-1:1,$=j.buffer.lines.get(M+F*O);$!=null&&$.isWrapped&&R++}return R}(h,f,m);return b(E,x(g(h,f),v))}function u(h,f){let m=0,v=f.buffer.lines.get(h),y=v==null?void 0:v.isWrapped;for(;y&&h>=0&&h<f.rows;)m++,v=f.buffer.lines.get(--h),y=v==null?void 0:v.isWrapped;return m}function g(h,f){return h>f?"A":"B"}function _(h,f,m,v,y,S){let E=h,k=f,w="";for(;E!==m||k!==v;)E+=y?1:-1,y&&E>S.cols-1?(w+=S.buffer.translateBufferLineToString(k,!1,h,E),E=0,h=0,k++):!y&&E<0&&(w+=S.buffer.translateBufferLineToString(k,!1,0,h+1),E=S.cols-1,h=E,k--);return w+S.buffer.translateBufferLineToString(k,!1,h,E)}function x(h,f){const m=f?"O":"[";return d.C0.ESC+m+h}function b(h,f){h=Math.floor(h);let m="";for(let v=0;v<h;v++)m+=f;return m}a.moveToCellSequence=function(h,f,m,v){const y=m.buffer.x,S=m.buffer.y;if(!m.buffer.hasScrollback)return function(w,j,R,M,T,O){return p(j,M,T,O).length===0?"":b(_(w,j,w,j-u(j,T),!1,T).length,x("D",O))}(y,S,0,f,m,v)+p(S,f,m,v)+function(w,j,R,M,T,O){let F;F=p(j,M,T,O).length>0?M-u(M,T):j;const $=M,P=function(U,N,D,L,I,Q){let q;return q=p(D,L,I,Q).length>0?L-u(L,I):N,U<D&&q<=L||U>=D&&q<L?"C":"D"}(w,j,R,M,T,O);return b(_(w,F,R,$,P==="C",T).length,x(P,O))}(y,S,h,f,m,v);let E;if(S===f)return E=y>h?"D":"C",b(Math.abs(y-h),x(E,v));E=S>f?"D":"C";const k=Math.abs(S-f);return b(function(w,j){return j.cols-w}(S>f?h:y,m)+(k-1)*m.cols+1+((S>f?y:h)-1),x(E,v))}},1296:function(l,a,c){var d=this&&this.__decorate||function(T,O,F,$){var P,U=arguments.length,N=U<3?O:$===null?$=Object.getOwnPropertyDescriptor(O,F):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(T,O,F,$);else for(var D=T.length-1;D>=0;D--)(P=T[D])&&(N=(U<3?P(N):U>3?P(O,F,N):P(O,F))||N);return U>3&&N&&Object.defineProperty(O,F,N),N},p=this&&this.__param||function(T,O){return function(F,$){O(F,$,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),g=c(2550),_=c(2223),x=c(6171),b=c(4725),h=c(8055),f=c(8460),m=c(844),v=c(2585),y="xterm-dom-renderer-owner-",S="xterm-rows",E="xterm-fg-",k="xterm-bg-",w="xterm-focus",j="xterm-selection";let R=1,M=a.DomRenderer=class extends m.Disposable{constructor(T,O,F,$,P,U,N,D,L,I){super(),this._element=T,this._screenElement=O,this._viewportElement=F,this._linkifier2=$,this._charSizeService=U,this._optionsService=N,this._bufferService=D,this._coreBrowserService=L,this._themeService=I,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,m.toDisposable)(()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new g.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const 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 O=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let O=`${this._terminalSelector} .${S} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${S} .xterm-dim { color: ${h.color.multiplyOpacity(T.foreground,.5).css};}`,O+=`${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;}`,O+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",O+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,O+=`${this._terminalSelector} .${S}.${w} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${S}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[F,$]of T.ansi.entries())O+=`${this._terminalSelector} .${E}${F} { color: ${$.css}; }${this._terminalSelector} .${E}${F}.xterm-dim { color: ${h.color.multiplyOpacity($,.5).css}; }${this._terminalSelector} .${k}${F} { background-color: ${$.css}; }`;O+=`${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(T.background).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${k}${_.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=O}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,O){for(let F=this._rowElements.length;F<=O;F++){const $=document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,O){this._refreshRowElements(T,O),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(w)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,O,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,O,F),this.renderRows(0,this._bufferService.rows-1),!T||!O)return;const $=T[1]-this._bufferService.buffer.ydisp,P=O[1]-this._bufferService.buffer.ydisp,U=Math.max($,0),N=Math.min(P,this._bufferService.rows-1);if(U>=this._bufferService.rows||N<0)return;const D=document.createDocumentFragment();if(F){const L=T[0]>O[0];D.appendChild(this._createSelectionElement(U,L?O[0]:T[0],L?T[0]:O[0],N-U+1))}else{const L=$===U?T[0]:0,I=U===P?O[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(U,L,I));const Q=N-U-1;if(D.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,Q)),U!==N){const q=P===N?O[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(N,0,q))}}this._selectionContainer.appendChild(D)}_createSelectionElement(T,O,F,$=1){const P=document.createElement("div");return P.style.height=$*this.dimensions.css.cell.height+"px",P.style.top=T*this.dimensions.css.cell.height+"px",P.style.left=O*this.dimensions.css.cell.width+"px",P.style.width=this.dimensions.css.cell.width*(F-O)+"px",P}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,O){const F=this._bufferService.buffer,$=F.ybase+F.y,P=Math.min(F.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=T;L<=O;L++){const I=L+F.ydisp,Q=this._rowElements[L],q=F.lines.get(I);if(!Q||!q)break;Q.replaceChildren(...this._rowFactory.createRow(q,I,I===$,N,D,P,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,O,F,$,P,U){F<0&&(T=0),$<0&&(O=0);const N=this._bufferService.rows-1;F=Math.max(Math.min(F,N),0),$=Math.max(Math.min($,N),0),P=Math.min(P,this._bufferService.cols);const D=this._bufferService.buffer,L=D.ybase+D.y,I=Math.min(D.x,P-1),Q=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let Z=F;Z<=$;++Z){const me=Z+D.ydisp,A=this._rowElements[Z],H=D.lines.get(me);if(!A||!H)break;A.replaceChildren(...this._rowFactory.createRow(H,me,me===L,q,J,I,Q,this.dimensions.css.cell.width,this._widthCache,U?Z===F?T:0:-1,U?(Z===$?O:P)-1:-1))}}};a.DomRenderer=M=d([p(4,v.IInstantiationService),p(5,b.ICharSizeService),p(6,v.IOptionsService),p(7,v.IBufferService),p(8,b.ICoreBrowserService),p(9,b.IThemeService)],M)},3787:function(l,a,c){var d=this&&this.__decorate||function(E,k,w,j){var R,M=arguments.length,T=M<3?k:j===null?j=Object.getOwnPropertyDescriptor(k,w):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(E,k,w,j);else for(var O=E.length-1;O>=0;O--)(R=E[O])&&(T=(M<3?R(T):M>3?R(k,w,T):R(k,w))||T);return M>3&&T&&Object.defineProperty(k,w,T),T},p=this&&this.__param||function(E,k){return function(w,j){k(w,j,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),g=c(643),_=c(511),x=c(2585),b=c(8055),h=c(4725),f=c(4269),m=c(6171),v=c(3734);let y=a.DomRendererRowFactory=class{constructor(E,k,w,j,R,M,T){this._document=E,this._characterJoinerService=k,this._optionsService=w,this._coreBrowserService=j,this._coreService=R,this._decorationService=M,this._themeService=T,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,k,w){this._selectionStart=E,this._selectionEnd=k,this._columnSelectMode=w}createRow(E,k,w,j,R,M,T,O,F,$,P){const U=[],N=this._characterJoinerService.getJoinedCharacters(k),D=this._themeService.colors;let L,I=E.getNoBgTrimmedLength();w&&I<M+1&&(I=M+1);let Q=0,q="",J=0,Z=0,me=0,A=!1,H=0,G=!1,Y=0;const ce=[],K=$!==-1&&P!==-1;for(let pe=0;pe<I;pe++){E.loadCell(pe,this._workCell);let Me=this._workCell.getWidth();if(Me===0)continue;let Ke=!1,Ht=pe,Se=this._workCell;if(N.length>0&&pe===N[0][0]){Ke=!0;const de=N.shift();Se=new f.JoinedCellData(this._workCell,E.translateToString(!0,de[0],de[1]),de[1]-de[0]),Ht=de[1]-1,Me=Se.getWidth()}const Zr=this._isCellInSelection(pe,k),xt=w&&pe===M,Is=K&&pe>=$&&pe<=P;let Fi=!1;this._decorationService.forEachDecorationAtCell(pe,k,void 0,de=>{Fi=!0});let Et=Se.getChars()||g.WHITESPACE_CELL_CHAR;if(Et===" "&&(Se.isUnderline()||Se.isOverline())&&(Et=" "),Y=Me*O-F.get(Et,Se.isBold(),Se.isItalic()),L){if(Q&&(Zr&&G||!Zr&&!G&&Se.bg===J)&&(Zr&&G&&D.selectionForeground||Se.fg===Z)&&Se.extended.ext===me&&Is===A&&Y===H&&!xt&&!Ke&&!Fi){q+=Et,Q++;continue}Q&&(L.textContent=q),L=this._document.createElement("span"),Q=0,q=""}else L=this._document.createElement("span");if(J=Se.bg,Z=Se.fg,me=Se.extended.ext,A=Is,H=Y,G=Zr,Ke&&M>=pe&&M<=Ht&&(M=pe),!this._coreService.isCursorHidden&&xt){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&ce.push("xterm-cursor-blink"),ce.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Se.isBold()&&ce.push("xterm-bold"),Se.isItalic()&&ce.push("xterm-italic"),Se.isDim()&&ce.push("xterm-dim"),q=Se.isInvisible()?g.WHITESPACE_CELL_CHAR:Se.getChars()||g.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(ce.push(`xterm-underline-${Se.extended.underlineStyle}`),q===" "&&(q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let de=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&de<8&&(de+=8),L.style.textDecorationColor=D.ansi[de].css}Se.isOverline()&&(ce.push("xterm-overline"),q===" "&&(q=" ")),Se.isStrikethrough()&&ce.push("xterm-strikethrough"),Is&&(L.style.textDecoration="underline");let jt=Se.getFgColor(),Bn=Se.getFgColorMode(),B=Se.getBgColor(),V=Se.getBgColorMode();const W=!!Se.isInverse();if(W){const de=jt;jt=B,B=de;const De=Bn;Bn=V,V=De}let ne,se,re,le=!1;switch(this._decorationService.forEachDecorationAtCell(pe,k,void 0,de=>{de.options.layer!=="top"&&le||(de.backgroundColorRGB&&(V=50331648,B=de.backgroundColorRGB.rgba>>8&16777215,ne=de.backgroundColorRGB),de.foregroundColorRGB&&(Bn=50331648,jt=de.foregroundColorRGB.rgba>>8&16777215,se=de.foregroundColorRGB),le=de.options.layer==="top")}),!le&&Zr&&(ne=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,B=ne.rgba>>8&16777215,V=50331648,le=!0,D.selectionForeground&&(Bn=50331648,jt=D.selectionForeground.rgba>>8&16777215,se=D.selectionForeground)),le&&ce.push("xterm-decoration-top"),V){case 16777216:case 33554432:re=D.ansi[B],ce.push(`xterm-bg-${B}`);break;case 50331648:re=b.rgba.toColor(B>>16,B>>8&255,255&B),this._addStyle(L,`background-color:#${S((B>>>0).toString(16),"0",6)}`);break;default:W?(re=D.foreground,ce.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):re=D.background}switch(ne||Se.isDim()&&(ne=b.color.multiplyOpacity(re,.5)),Bn){case 16777216:case 33554432:Se.isBold()&&jt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(jt+=8),this._applyMinimumContrast(L,re,D.ansi[jt],Se,ne,void 0)||ce.push(`xterm-fg-${jt}`);break;case 50331648:const de=b.rgba.toColor(jt>>16&255,jt>>8&255,255&jt);this._applyMinimumContrast(L,re,de,Se,ne,se)||this._addStyle(L,`color:#${S(jt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,re,D.foreground,Se,ne,void 0)||W&&ce.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}ce.length&&(L.className=ce.join(" "),ce.length=0),xt||Ke||Fi?L.textContent=q:Q++,Y!==this.defaultSpacing&&(L.style.letterSpacing=`${Y}px`),U.push(L),pe=Ht}return L&&Q&&(L.textContent=q),U}_applyMinimumContrast(E,k,w,j,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.excludeFromContrastRatioDemands)(j.getCode()))return!1;const T=this._getContrastCache(j);let O;if(R||M||(O=T.getColor(k.rgba,w.rgba)),O===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);O=b.color.ensureContrastRatio(R||k,M||w,F),T.setColor((R||k).rgba,(M||w).rgba,O??null)}return!!O&&(this._addStyle(E,`color:${O.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,k){E.setAttribute("style",`${E.getAttribute("style")||""}${k};`)}_isCellInSelection(E,k){const w=this._selectionStart,j=this._selectionEnd;return!(!w||!j)&&(this._columnSelectMode?w[0]<=j[0]?E>=w[0]&&k>=w[1]&&E<j[0]&&k<=j[1]:E<w[0]&&k>=w[1]&&E>=j[0]&&k<=j[1]:k>w[1]&&k<j[1]||w[1]===j[1]&&k===w[1]&&E>=w[0]&&E<j[0]||w[1]<j[1]&&k===j[1]&&E<j[0]||w[1]<j[1]&&k===w[1]&&E>=w[0])}};function S(E,k,w){for(;E.length<w;)E=k+E;return E}a.DomRendererRowFactory=y=d([p(1,h.ICharacterJoinerService),p(2,x.IOptionsService),p(3,h.ICoreBrowserService),p(4,x.ICoreService),p(5,x.IDecorationService),p(6,h.IThemeService)],y)},2550:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=c.createElement("span"),p=c.createElement("span");p.style.fontWeight="bold";const u=c.createElement("span");u.style.fontStyle="italic";const g=c.createElement("span");g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[d,p,u,g],this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(g),c.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,d,p,u){c===this._font&&d===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=d,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,d,p){let u=0;if(!d&&!p&&c.length===1&&(u=c.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(c,0);let g=c;d&&(g+="B"),p&&(g+="I");let _=this._holey.get(g);if(_===void 0){let x=0;d&&(x|=1),p&&(x|=2),_=this._measure(c,x),this._holey.set(g,_)}return _}_measure(c,d){const p=this._measureElements[d];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(l,a)=>{function c(d){return 57508<=d&&d<=57558}Object.defineProperty(a,"__esModule",{value:!0}),a.createRenderDimensions=a.excludeFromContrastRatioDemands=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},a.excludeFromContrastRatioDemands=function(d){return c(d)||function(p){return 9472<=p&&p<=9631}(d)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,a,c){var d=this&&this.__decorate||function(h,f,m,v){var y,S=arguments.length,E=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,f,m,v);else for(var k=h.length-1;k>=0;k--)(y=h[k])&&(E=(S<3?y(E):S>3?y(f,m,E):y(f,m))||E);return S>3&&E&&Object.defineProperty(f,m,E),E},p=this&&this.__param||function(h,f){return function(m,v){f(m,v,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),g=c(8460),_=c(844);let x=a.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,f,m){super(),this._optionsService=m,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new b(h,f,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};a.CharSizeService=x=d([p(2,u.IOptionsService)],x);class b{constructor(f,m,v){this._document=f,this._parentElement=m,this._optionsService=v,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 f={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return f.width!==0&&f.height!==0&&(this._result.width=f.width/32,this._result.height=Math.ceil(f.height)),this._result}}},4269:function(l,a,c){var d=this&&this.__decorate||function(f,m,v,y){var S,E=arguments.length,k=E<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,m,v,y);else for(var w=f.length-1;w>=0;w--)(S=f[w])&&(k=(E<3?S(k):E>3?S(m,v,k):S(m,v))||k);return E>3&&k&&Object.defineProperty(m,v,k),k},p=this&&this.__param||function(f,m){return function(v,y){m(v,y,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),g=c(643),_=c(511),x=c(2585);class b extends u.AttributeData{constructor(m,v,y){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=v,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=b;let h=a.CharacterJoinerService=class jE{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(m){const v={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(v),v.id}deregister(m){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===m)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(m);if(!v||v.length===0)return[];const y=[],S=v.translateToString(!0);let E=0,k=0,w=0,j=v.getFg(0),R=v.getBg(0);for(let M=0;M<v.getTrimmedLength();M++)if(v.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==R){if(M-E>1){const T=this._getJoinedRanges(S,w,k,v,E);for(let O=0;O<T.length;O++)y.push(T[O])}E=M,w=k,j=this._workCell.fg,R=this._workCell.bg}k+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const M=this._getJoinedRanges(S,w,k,v,E);for(let T=0;T<M.length;T++)y.push(M[T])}return y}_getJoinedRanges(m,v,y,S,E){const k=m.substring(v,y);let w=[];try{w=this._characterJoiners[0].handler(k)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const R=this._characterJoiners[j].handler(k);for(let M=0;M<R.length;M++)jE._mergeRanges(w,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(w,S,E),w}_stringRangesToCellRanges(m,v,y){let S=0,E=!1,k=0,w=m[S];if(w){for(let j=y;j<this._bufferService.cols;j++){const R=v.getWidth(j),M=v.getString(j).length||g.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!E&&w[0]<=k&&(w[0]=j,E=!0),w[1]<=k){if(w[1]=j,w=m[++S],!w)break;w[0]<=k?(w[0]=j,E=!0):E=!1}k+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(m,v){let y=!1;for(let S=0;S<m.length;S++){const E=m[S];if(y){if(v[1]<=E[0])return m[S-1][1]=v[1],m;if(v[1]<=E[1])return m[S-1][1]=Math.max(v[1],E[1]),m.splice(S,1),m;m.splice(S,1),S--}else{if(v[1]<=E[0])return m.splice(S,0,v),m;if(v[1]<=E[1])return E[0]=Math.min(v[0],E[0]),m;v[0]<E[1]&&(E[0]=Math.min(v[0],E[0]),y=!0)}}return y?m[m.length-1][1]=v[1]:m.push(v),m}};a.CharacterJoinerService=h=d([p(0,x.IBufferService)],h)},5114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0,a.CoreBrowserService=class{constructor(c,d){this._textarea=c,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(l,a,c){var d=this&&this.__decorate||function(x,b,h,f){var m,v=arguments.length,y=v<3?b:f===null?f=Object.getOwnPropertyDescriptor(b,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(x,b,h,f);else for(var S=x.length-1;S>=0;S--)(m=x[S])&&(y=(v<3?m(y):v>3?m(b,h,y):m(b,h))||y);return v>3&&y&&Object.defineProperty(b,h,y),y},p=this&&this.__param||function(x,b){return function(h,f){b(h,f,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),g=c(9806);let _=a.MouseService=class{constructor(x,b){this._renderService=x,this._charSizeService=b}getCoords(x,b,h,f,m){return(0,g.getCoords)(window,x,b,h,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(x,b){const h=(0,g.getCoordsRelativeToElement)(window,x,b);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};a.MouseService=_=d([p(0,u.IRenderService),p(1,u.ICharSizeService)],_)},3230:function(l,a,c){var d=this&&this.__decorate||function(y,S,E,k){var w,j=arguments.length,R=j<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,S,E,k);else for(var M=y.length-1;M>=0;M--)(w=y[M])&&(R=(j<3?w(R):j>3?w(S,E,R):w(S,E))||R);return j>3&&R&&Object.defineProperty(S,E,R),R},p=this&&this.__param||function(y,S){return function(E,k){S(E,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(3656),g=c(6193),_=c(5596),x=c(4725),b=c(8460),h=c(844),f=c(7226),m=c(2585);let v=a.RenderService=class extends h.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(y,S,E,k,w,j,R,M){if(super(),this._rowCount=y,this._charSizeService=k,this._renderer=this.register(new h.MutableDisposable),this._pausedResizeTask=new f.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(R.window,(T,O)=>this._renderRows(T,O)),this.register(this._renderDebouncer),this._screenDprMonitor=new _.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(j.onResize(()=>this._fullRefresh())),this.register(j.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(E.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(w.onDecorationRegistered(()=>this._fullRefresh())),this.register(w.onDecorationRemoved(()=>this._fullRefresh())),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()})),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(j.buffer.y,j.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(M.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const T=new R.window.IntersectionObserver(O=>this._handleIntersectionChange(O[O.length-1]),{threshold:0});T.observe(S),this.register({dispose:()=>T.disconnect()})}}_handleIntersectionChange(y){this._isPaused=y.isIntersecting===void 0?y.intersectionRatio===0:!y.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(y,S,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(y,S,this._rowCount))}_renderRows(y,S){this._renderer.value&&(y=Math.min(y,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(y,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:y,end:S}),this._onRender.fire({start:y,end:S}),this._isNextRenderRedrawOnly=!0)}resize(y,S){this._rowCount=S,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(y){this._renderer.value=y,this._renderer.value.onRequestRedraw(S=>this.refreshRows(S.start,S.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(y){return this._renderDebouncer.addRefreshCallback(y)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var y,S;this._renderer.value&&((S=(y=this._renderer.value).clearTextureAtlas)===null||S===void 0||S.call(y),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(y,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(y,S)):this._renderer.value.handleResize(y,S),this._fullRefresh())}handleCharSizeChanged(){var y;(y=this._renderer.value)===null||y===void 0||y.handleCharSizeChanged()}handleBlur(){var y;(y=this._renderer.value)===null||y===void 0||y.handleBlur()}handleFocus(){var y;(y=this._renderer.value)===null||y===void 0||y.handleFocus()}handleSelectionChanged(y,S,E){var k;this._selectionState.start=y,this._selectionState.end=S,this._selectionState.columnSelectMode=E,(k=this._renderer.value)===null||k===void 0||k.handleSelectionChanged(y,S,E)}handleCursorMove(){var y;(y=this._renderer.value)===null||y===void 0||y.handleCursorMove()}clear(){var y;(y=this._renderer.value)===null||y===void 0||y.clear()}};a.RenderService=v=d([p(2,m.IOptionsService),p(3,x.ICharSizeService),p(4,m.IDecorationService),p(5,m.IBufferService),p(6,x.ICoreBrowserService),p(7,x.IThemeService)],v)},9312:function(l,a,c){var d=this&&this.__decorate||function(w,j,R,M){var T,O=arguments.length,F=O<3?j:M===null?M=Object.getOwnPropertyDescriptor(j,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(w,j,R,M);else for(var $=w.length-1;$>=0;$--)(T=w[$])&&(F=(O<3?T(F):O>3?T(j,R,F):T(j,R))||F);return O>3&&F&&Object.defineProperty(j,R,F),F},p=this&&this.__param||function(w,j){return function(R,M){j(R,M,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),g=c(9504),_=c(456),x=c(4725),b=c(8460),h=c(844),f=c(6114),m=c(4841),v=c(511),y=c(2585),S=" ",E=new RegExp(S,"g");let k=a.SelectionService=class extends h.Disposable{constructor(w,j,R,M,T,O,F,$,P){super(),this._element=w,this._screenElement=j,this._linkifier=R,this._bufferService=M,this._coreService=T,this._mouseService=O,this._optionsService=F,this._renderService=$,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!w||!j||w[0]===j[0]&&w[1]===j[1])}get selectionText(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!w||!j)return"";const R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(w[0]===j[0])return"";const T=w[0]<j[0]?w[0]:j[0],O=w[0]<j[0]?j[0]:w[0];for(let F=w[1];F<=j[1];F++){const $=R.translateBufferLineToString(F,!0,T,O);M.push($)}}else{const T=w[1]===j[1]?j[0]:void 0;M.push(R.translateBufferLineToString(w[1],!0,w[0],T));for(let O=w[1]+1;O<=j[1]-1;O++){const F=R.lines.get(O),$=R.translateBufferLineToString(O,!0);F!=null&&F.isWrapped?M[M.length-1]+=$:M.push($)}if(w[1]!==j[1]){const O=R.lines.get(j[1]),F=R.translateBufferLineToString(j[1],!0,0,j[0]);O&&O.isWrapped?M[M.length-1]+=F:M.push(F)}}return M.map(T=>T.replace(E," ")).join(f.isWindows?`\r
|
|
207
|
+
`:`
|
|
208
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.isLinux&&w&&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(w){const j=this._getMouseBufferCoords(w),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&j)&&this._areCoordsInSelection(j,R,M)}isCellInSelection(w,j){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([w,j],R,M)}_areCoordsInSelection(w,j,R){return w[1]>j[1]&&w[1]<R[1]||j[1]===R[1]&&w[1]===j[1]&&w[0]>=j[0]&&w[0]<R[0]||j[1]<R[1]&&w[1]===R[1]&&w[0]<R[0]||j[1]<R[1]&&w[1]===j[1]&&w[0]>=j[0]}_selectWordAtCursor(w,j){var R,M;const T=(M=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||M===void 0?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(w);return!!O&&(this._selectWordAt(O,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,j){this._model.clearSelection(),w=Math.max(w,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const j=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(w){let j=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=R?0:(j>R&&(j-=R),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(w){return f.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const j=this._getMouseBufferCoords(w);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(w){return w.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const j=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,g.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,R=!(!w||!j||w[0]===j[0]&&w[1]===j[1]);R?w&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,j,R)):this._oldHasSelection&&this._fireOnSelectionChange(w,j,R)}_fireOnSelectionChange(w,j,R){this._oldSelectionStart=w,this._oldSelectionEnd=j,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(j=>this._handleTrim(j))}_convertViewportColToCharacterIndex(w,j){let R=j;for(let M=0;j>=M;M++){const T=w.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&j!==M&&(R+=T-1)}return R}setSelection(w,j,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,j],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,j,R=!0,M=!0){if(w[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,O=T.lines.get(w[1]);if(!O)return;const F=T.translateBufferLineToString(w[1],!1);let $=this._convertViewportColToCharacterIndex(O,w[0]),P=$;const U=w[0]-$;let N=0,D=0,L=0,I=0;if(F.charAt($)===" "){for(;$>0&&F.charAt($-1)===" ";)$--;for(;P<F.length&&F.charAt(P+1)===" ";)P++}else{let J=w[0],Z=w[0];O.getWidth(J)===0&&(N++,J--),O.getWidth(Z)===2&&(D++,Z++);const me=O.getString(Z).length;for(me>1&&(I+=me-1,P+=me-1);J>0&&$>0&&!this._isCharWordSeparator(O.loadCell(J-1,this._workCell));){O.loadCell(J-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,J--):A>1&&(L+=A-1,$-=A-1),$--,J--}for(;Z<O.length&&P+1<F.length&&!this._isCharWordSeparator(O.loadCell(Z+1,this._workCell));){O.loadCell(Z+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,Z++):A>1&&(I+=A-1,P+=A-1),P++,Z++}}P++;let Q=$+U-N+L,q=Math.min(this._bufferService.cols,P-$+N+D-L-I);if(j||F.slice($,P).trim()!==""){if(R&&Q===0&&O.getCodePoint(0)!==32){const J=T.lines.get(w[1]-1);if(J&&O.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(Z){const me=this._bufferService.cols-Z.start;Q-=me,q+=me}}}if(M&&Q+q===this._bufferService.cols&&O.getCodePoint(this._bufferService.cols-1)!==32){const J=T.lines.get(w[1]+1);if(J!=null&&J.isWrapped&&J.getCodePoint(0)!==32){const Z=this._getWordAt([0,w[1]+1],!1,!1,!0);Z&&(q+=Z.length)}}return{start:Q,length:q}}}_selectWordAt(w,j){const R=this._getWordAt(w,j);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[R.start,w[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(w){const j=this._getWordAt(w,!0);if(j){let R=w[1];for(;j.start<0;)j.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,R]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const j=this._bufferService.buffer.getWrappedRangeForLine(w),R={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(R,this._bufferService.cols)}};a.SelectionService=k=d([p(3,y.IBufferService),p(4,y.ICoreService),p(5,x.IMouseService),p(6,y.IOptionsService),p(7,x.IRenderService),p(8,x.ICoreBrowserService)],k)},4725:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=c(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(l,a,c){var d=this&&this.__decorate||function(k,w,j,R){var M,T=arguments.length,O=T<3?w:R===null?R=Object.getOwnPropertyDescriptor(w,j):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,w,j,R);else for(var F=k.length-1;F>=0;F--)(M=k[F])&&(O=(T<3?M(O):T>3?M(w,j,O):M(w,j))||O);return T>3&&O&&Object.defineProperty(w,j,O),O},p=this&&this.__param||function(k,w){return function(j,R){w(j,R,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),g=c(8055),_=c(8460),x=c(844),b=c(2585),h=g.css.toColor("#ffffff"),f=g.css.toColor("#000000"),m=g.css.toColor("#ffffff"),v=g.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let j=0;j<216;j++){const R=w[j/36%6|0],M=w[j/6%6|0],T=w[j%6];k.push({css:g.channels.toCss(R,M,T),rgba:g.channels.toRgba(R,M,T)})}for(let j=0;j<24;j++){const R=8+10*j;k.push({css:g.channels.toCss(R,R,R),rgba:g.channels.toRgba(R,R,R)})}return k})());let S=a.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:f,cursor:m,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:g.color.blend(f,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:g.color.blend(f,y),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(k={}){const w=this._colors;if(w.foreground=E(k.foreground,h),w.background=E(k.background,f),w.cursor=E(k.cursor,m),w.cursorAccent=E(k.cursorAccent,v),w.selectionBackgroundTransparent=E(k.selectionBackground,y),w.selectionBackgroundOpaque=g.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=E(k.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=g.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=k.selectionForeground?E(k.selectionForeground,g.NULL_COLOR):void 0,w.selectionForeground===g.NULL_COLOR&&(w.selectionForeground=void 0),g.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=g.color.opacity(w.selectionBackgroundTransparent,.3)),g.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=g.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=a.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=E(k.black,a.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=E(k.red,a.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=E(k.green,a.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=E(k.yellow,a.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=E(k.blue,a.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=E(k.magenta,a.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=E(k.cyan,a.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=E(k.white,a.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=E(k.brightBlack,a.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=E(k.brightRed,a.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=E(k.brightGreen,a.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=E(k.brightYellow,a.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=E(k.brightBlue,a.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=E(k.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=E(k.brightCyan,a.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=E(k.brightWhite,a.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const j=Math.min(w.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<j;R++)w.ansi[R+16]=E(k.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+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 w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}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 E(k,w){if(k!==void 0)try{return g.css.toColor(k)}catch{}return w}a.ThemeService=S=d([p(0,b.IOptionsService)],S)},6349:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=c(8460),p=c(844);class u extends p.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const x=new Array(_);for(let b=0;b<Math.min(_,this.length);b++)x[b]=this._array[this._getCyclicIndex(b)];this._array=x,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let x=this._length;x<_;x++)this._array[x]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,x){this._array[this._getCyclicIndex(_)]=x}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,x,...b){if(x){for(let h=_;h<this._length-x;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+x)];this._length-=x,this.onDeleteEmitter.fire({index:_,amount:x})}for(let h=this._length-1;h>=_;h--)this._array[this._getCyclicIndex(h+b.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<b.length;h++)this._array[this._getCyclicIndex(_+h)]=b[h];if(b.length&&this.onInsertEmitter.fire({index:_,amount:b.length}),this._length+b.length>this._maxLength){const h=this._length+b.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=b.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,x,b){if(!(x<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let f=x-1;f>=0;f--)this.set(_+f+b,this.get(_+f));const h=_+x+b-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<x;h++)this.set(_+h+b,this.get(_+h))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}a.CircularList=u},1439:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(d,p=5){if(typeof d!="object")return d;const u=Array.isArray(d)?[]:{};for(const g in d)u[g]=p<=1?d[g]:d[g]&&c(d[g],p-1);return u}},8055:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;const d=c(6114);let p=0,u=0,g=0,_=0;var x,b,h,f,m;function v(S){const E=S.toString(16);return E.length<2?"0"+E:E}function y(S,E){return S<E?(E+.05)/(S+.05):(S+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(S){S.toCss=function(E,k,w,j){return j!==void 0?`#${v(E)}${v(k)}${v(w)}${v(j)}`:`#${v(E)}${v(k)}${v(w)}`},S.toRgba=function(E,k,w,j=255){return(E<<24|k<<16|w<<8|j)>>>0}}(x||(a.channels=x={})),function(S){function E(k,w){return _=Math.round(255*w),[p,u,g]=m.toChannels(k.rgba),{css:x.toCss(p,u,g,_),rgba:x.toRgba(p,u,g,_)}}S.blend=function(k,w){if(_=(255&w.rgba)/255,_===1)return{css:w.css,rgba:w.rgba};const j=w.rgba>>24&255,R=w.rgba>>16&255,M=w.rgba>>8&255,T=k.rgba>>24&255,O=k.rgba>>16&255,F=k.rgba>>8&255;return p=T+Math.round((j-T)*_),u=O+Math.round((R-O)*_),g=F+Math.round((M-F)*_),{css:x.toCss(p,u,g),rgba:x.toRgba(p,u,g)}},S.isOpaque=function(k){return(255&k.rgba)==255},S.ensureContrastRatio=function(k,w,j){const R=m.ensureContrastRatio(k.rgba,w.rgba,j);if(R)return m.toColor(R>>24&255,R>>16&255,R>>8&255)},S.opaque=function(k){const w=(255|k.rgba)>>>0;return[p,u,g]=m.toChannels(w),{css:x.toCss(p,u,g),rgba:w}},S.opacity=E,S.multiplyOpacity=function(k,w){return _=255&k.rgba,E(k,_*w/255)},S.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}}(b||(a.color=b={})),function(S){let E,k;if(!d.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const j=w.getContext("2d",{willReadFrequently:!0});j&&(E=j,E.globalCompositeOperation="copy",k=E.createLinearGradient(0,0,1,1))}S.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),m.toColor(p,u,g);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),_=parseInt(w.slice(4,5).repeat(2),16),m.toColor(p,u,g,_);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const j=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return p=parseInt(j[1]),u=parseInt(j[2]),g=parseInt(j[3]),_=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),m.toColor(p,u,g,_);if(!E||!k)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=k,E.fillStyle=w,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[p,u,g,_]=E.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(p,u,g,_),css:w}}}(h||(a.css=h={})),function(S){function E(k,w,j){const R=k/255,M=w/255,T=j/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}S.relativeLuminance=function(k){return E(k>>16&255,k>>8&255,255&k)},S.relativeLuminance2=E}(f||(a.rgb=f={})),function(S){function E(w,j,R){const M=w>>24&255,T=w>>16&255,O=w>>8&255;let F=j>>24&255,$=j>>16&255,P=j>>8&255,U=y(f.relativeLuminance2(F,$,P),f.relativeLuminance2(M,T,O));for(;U<R&&(F>0||$>0||P>0);)F-=Math.max(0,Math.ceil(.1*F)),$-=Math.max(0,Math.ceil(.1*$)),P-=Math.max(0,Math.ceil(.1*P)),U=y(f.relativeLuminance2(F,$,P),f.relativeLuminance2(M,T,O));return(F<<24|$<<16|P<<8|255)>>>0}function k(w,j,R){const M=w>>24&255,T=w>>16&255,O=w>>8&255;let F=j>>24&255,$=j>>16&255,P=j>>8&255,U=y(f.relativeLuminance2(F,$,P),f.relativeLuminance2(M,T,O));for(;U<R&&(F<255||$<255||P<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),$=Math.min(255,$+Math.ceil(.1*(255-$))),P=Math.min(255,P+Math.ceil(.1*(255-P))),U=y(f.relativeLuminance2(F,$,P),f.relativeLuminance2(M,T,O));return(F<<24|$<<16|P<<8|255)>>>0}S.ensureContrastRatio=function(w,j,R){const M=f.relativeLuminance(w>>8),T=f.relativeLuminance(j>>8);if(y(M,T)<R){if(T<M){const $=E(w,j,R),P=y(M,f.relativeLuminance($>>8));if(P<R){const U=k(w,j,R);return P>y(M,f.relativeLuminance(U>>8))?$:U}return $}const O=k(w,j,R),F=y(M,f.relativeLuminance(O>>8));if(F<R){const $=E(w,j,R);return F>y(M,f.relativeLuminance($>>8))?O:$}return O}},S.reduceLuminance=E,S.increaseLuminance=k,S.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},S.toColor=function(w,j,R,M){return{css:x.toCss(w,j,R,M),rgba:x.toRgba(w,j,R,M)}}}(m||(a.rgba=m={})),a.toPaddedHex=v,a.contrastRatio=y},8969:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=c(844),p=c(2585),u=c(4348),g=c(7866),_=c(744),x=c(7302),b=c(6975),h=c(8460),f=c(1753),m=c(1480),v=c(7994),y=c(9282),S=c(5435),E=c(5981),k=c(2660);let w=!1;class j extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(M=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(M.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(M){for(const T in M)this.optionsService.options[T]=M[T]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new E.WriteBuffer((T,O)=>this._inputHandler.parse(T,O))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,T){this._writeBuffer.write(M,T)}writeSync(M,T){this._logService.logLevel<=p.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(M,T)}resize(M,T){isNaN(M)||isNaN(T)||(M=Math.max(M,_.MINIMUM_COLS),T=Math.max(T,_.MINIMUM_ROWS),this._bufferService.resize(M,T))}scroll(M,T=!1){this._bufferService.scroll(M,T)}scrollLines(M,T,O){this._bufferService.scrollLines(M,T,O)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const T=M-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(M,T){return this._inputHandler.registerEscHandler(M,T)}registerDcsHandler(M,T){return this._inputHandler.registerDcsHandler(M,T)}registerCsiHandler(M,T){return this._inputHandler.registerCsiHandler(M,T)}registerOscHandler(M,T){return this._inputHandler.registerOscHandler(M,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?M=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const T of M)T.dispose()})}}}a.CoreTerminal=j},8460:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,d){return c(p=>d.fire(p))}},5435:function(l,a,c){var d=this&&this.__decorate||function(U,N,D,L){var I,Q=arguments.length,q=Q<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,D):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(U,N,D,L);else for(var J=U.length-1;J>=0;J--)(I=U[J])&&(q=(Q<3?I(q):Q>3?I(N,D,q):I(N,D))||q);return Q>3&&q&&Object.defineProperty(N,D,q),q},p=this&&this.__param||function(U,N){return function(D,L){N(D,L,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),g=c(7116),_=c(2015),x=c(844),b=c(482),h=c(8437),f=c(8460),m=c(643),v=c(511),y=c(3734),S=c(2585),E=c(6242),k=c(6351),w=c(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function M(U,N){if(U>24)return N.setWinLines||!1;switch(U){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var T;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let O=0;class F extends x.Disposable{getAttrData(){return this._curAttrData}constructor(N,D,L,I,Q,q,J,Z,me=new _.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=D,this._coreService=L,this._logService=I,this._optionsService=Q,this._oscLinkService=q,this._coreMouseService=J,this._unicodeService=Z,this._parser=me,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:H.toArray()})}),this._parser.setEscHandlerFallback(A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})}),this._parser.setExecuteHandlerFallback(A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})}),this._parser.setOscHandlerFallback((A,H,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:H,data:G})}),this._parser.setDcsHandlerFallback((A,H,G)=>{H==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:H,payload:G})}),this._parser.setPrintHandler((A,H,G)=>this.print(A,H,G)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new E.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new E.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new E.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new E.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new E.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new E.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new E.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new E.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new E.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new E.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new E.OscHandler(A=>this.restoreCursorColor(A))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const A in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},()=>this.selectCharset("("+A)),this._parser.registerEscHandler({intermediates:")",final:A},()=>this.selectCharset(")"+A)),this._parser.registerEscHandler({intermediates:"*",final:A},()=>this.selectCharset("*"+A)),this._parser.registerEscHandler({intermediates:"+",final:A},()=>this.selectCharset("+"+A)),this._parser.registerEscHandler({intermediates:"-",final:A},()=>this.selectCharset("-"+A)),this._parser.registerEscHandler({intermediates:".",final:A},()=>this.selectCharset("."+A)),this._parser.registerEscHandler({intermediates:"/",final:A},()=>this.selectCharset("/"+A));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(A=>(this._logService.error("Parsing error: ",A),A)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((A,H)=>this.requestStatusString(A,H)))}_preserveStack(N,D,L,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=L,this._parseStack.position=I}_logSlowResolvingAsync(N){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([N,new Promise((D,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,D){let L,I=this._activeBuffer.x,Q=this._activeBuffer.y,q=0;const J=this._parseStack.paused;if(J){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(L),L;I=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>R&&(q=this._parseStack.position+R)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,Z=>String.fromCharCode(Z)).join("")}"`),typeof N=="string"?N.split("").map(Z=>Z.charCodeAt(0)):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(N.length,R))),J||this._dirtyRowTracker.clearRange(),N.length>R)for(let Z=q;Z<N.length;Z+=R){const me=Z+R<N.length?Z+R:N.length,A=typeof N=="string"?this._stringDecoder.decode(N.substring(Z,me),this._parseBuffer):this._utf8Decoder.decode(N.subarray(Z,me),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,A))return this._preserveStack(I,Q,A,Z),this._logSlowResolvingAsync(L),L}else if(!J){const Z=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,Z))return this._preserveStack(I,Q,Z,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===I&&this._activeBuffer.y===Q||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(N,D,L){let I,Q;const q=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,me=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,H=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-D>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodePoint(this._activeBuffer.x-1,0,1,H.fg,H.bg,H.extended);for(let Y=D;Y<L;++Y){if(I=N[Y],Q=this._unicodeService.wcwidth(I),I<127&&q){const ce=q[String.fromCharCode(I)];ce&&(I=ce.charCodeAt(0))}if(J&&this._onA11yChar.fire((0,b.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),Q||!this._activeBuffer.x){if(this._activeBuffer.x+Q-1>=Z){if(me){for(;this._activeBuffer.x<Z;)G.setCellFromCodePoint(this._activeBuffer.x++,0,1,H.fg,H.bg,H.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=Z-1,Q===2)continue}if(A&&(G.insertCells(this._activeBuffer.x,Q,this._activeBuffer.getNullCell(H),H),G.getWidth(Z-1)===2&&G.setCellFromCodePoint(Z-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,H.fg,H.bg,H.extended)),G.setCellFromCodePoint(this._activeBuffer.x++,I,Q,H.fg,H.bg,H.extended),Q>0)for(;--Q;)G.setCellFromCodePoint(this._activeBuffer.x++,0,0,H.fg,H.bg,H.extended)}else G.getWidth(this._activeBuffer.x-1)?G.addCodepointToCell(this._activeBuffer.x-1,I):G.addCodepointToCell(this._activeBuffer.x-2,I)}L-D>0&&(G.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<Z&&L-D>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodePoint(this._activeBuffer.x,0,1,H.fg,H.bg,H.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,D){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,D):this._parser.registerCsiHandler(N,L=>!M(L.params[0],this._optionsService.rawOptions.windowOptions)||D(L))}registerDcsHandler(N,D){return this._parser.registerDcsHandler(N,new k.DcsHandler(D))}registerEscHandler(N,D){return this._parser.registerEscHandler(N,D)}registerOscHandler(N,D){return this._parser.registerOscHandler(N,new E.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var N;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||N===void 0)&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=N,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+D)}cursorUp(N){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const D=N.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=N.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=N.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const D=N.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,D,L,I=!1,Q=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.replaceCells(D,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),Q),I&&(q.isWrapped=!1)}_resetBufferLine(N,D=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,D=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);L<this._bufferService.rows;L++)this._resetBufferLine(L,D);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,D);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(N,D=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let D=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;D--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let D=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;D--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let D=N.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let D=N.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);I.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);I.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);I.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);I.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){if(!this._parser.precedingCodepoint)return!0;const D=N.params[0]||1,L=new Uint32Array(D);for(let I=0;I<D;++I)L[I]=this._parser.precedingCodepoint;return this.print(L,0,L.length),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let D=0;D<N.length;D++)switch(N.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let D=0;D<N.length;D++)switch(N.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(N){for(let D=0;D<N.length;D++)switch(N.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let D=0;D<N.length;D++)switch(N.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,D){const L=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:Q}=this._coreMouseService,q=this._coreService,{buffers:J,cols:Z}=this._bufferService,{active:me,alt:A}=J,H=this._optionsService.rawOptions,G=pe=>pe?1:2,Y=N.params[0];return ce=Y,K=D?Y===2?4:Y===4?G(q.modes.insertMode):Y===12?3:Y===20?G(H.convertEol):0:Y===1?G(L.applicationCursorKeys):Y===3?H.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:Y===6?G(L.origin):Y===7?G(L.wraparound):Y===8?3:Y===9?G(I==="X10"):Y===12?G(H.cursorBlink):Y===25?G(!q.isCursorHidden):Y===45?G(L.reverseWraparound):Y===66?G(L.applicationKeypad):Y===67?4:Y===1e3?G(I==="VT200"):Y===1002?G(I==="DRAG"):Y===1003?G(I==="ANY"):Y===1004?G(L.sendFocus):Y===1005?4:Y===1006?G(Q==="SGR"):Y===1015?4:Y===1016?G(Q==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?G(me===A):Y===2004?G(L.bracketedPasteMode):0,q.triggerDataEvent(`${u.C0.ESC}[${D?"":"?"}${ce};${K}$y`),!0;var ce,K}_updateAttrColor(N,D,L,I,Q){return D===2?(N|=50331648,N&=-16777216,N|=y.AttributeData.fromColorRGB([L,I,Q])):D===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,D,L){const I=[0,0,-1,0,0,0];let Q=0,q=0;do{if(I[q+Q]=N.params[D+q],N.hasSubParams(D+q)){const J=N.getSubParams(D+q);let Z=0;do I[1]===5&&(Q=1),I[q+Z+1+Q]=J[Z];while(++Z<J.length&&Z+q+1+Q<I.length);break}if(I[1]===5&&q+Q>=2||I[1]===2&&q+Q>=5)break;I[1]&&(Q=1)}while(++q+D<N.length&&q+Q<I.length);for(let J=2;J<I.length;++J)I[J]===-1&&(I[J]=0);switch(I[0]){case 38:L.fg=this._updateAttrColor(L.fg,I[1],I[3],I[4],I[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,I[1],I[3],I[4],I[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,I[1],I[3],I[4],I[5])}return q}_processUnderline(N,D){D.extended=D.extended.clone(),(!~N||N>5)&&(N=1),D.extended.underlineStyle=N,D.fg|=268435456,N===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(N){N.fg=h.DEFAULT_ATTR_DATA.fg,N.bg=h.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=N.length;let L;const I=this._curAttrData;for(let Q=0;Q<D;Q++)L=N.params[Q],L>=30&&L<=37?(I.fg&=-50331904,I.fg|=16777216|L-30):L>=40&&L<=47?(I.bg&=-50331904,I.bg|=16777216|L-40):L>=90&&L<=97?(I.fg&=-50331904,I.fg|=16777224|L-90):L>=100&&L<=107?(I.bg&=-50331904,I.bg|=16777224|L-100):L===0?this._processSGR0(I):L===1?I.fg|=134217728:L===3?I.bg|=67108864:L===4?(I.fg|=268435456,this._processUnderline(N.hasSubParams(Q)?N.getSubParams(Q)[0]:1,I)):L===5?I.fg|=536870912:L===7?I.fg|=67108864:L===8?I.fg|=1073741824:L===9?I.fg|=2147483648:L===2?I.bg|=134217728:L===21?this._processUnderline(2,I):L===22?(I.fg&=-134217729,I.bg&=-134217729):L===23?I.bg&=-67108865:L===24?(I.fg&=-268435457,this._processUnderline(0,I)):L===25?I.fg&=-536870913:L===27?I.fg&=-67108865:L===28?I.fg&=-1073741825:L===29?I.fg&=2147483647:L===39?(I.fg&=-67108864,I.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):L===49?(I.bg&=-67108864,I.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?Q+=this._extractColor(N,Q,I):L===53?I.bg|=1073741824:L===55?I.bg&=-1073741825:L===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):L===100?(I.fg&=-67108864,I.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${D};${L}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const D=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${D};${L}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const D=N.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const L=D%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(N){const D=N.params[0]||1;let L;return(N.length<2||(L=N.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(N){if(!M(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const D=[],L=N.split(";");for(;L.length>1;){const I=L.shift(),Q=L.shift();if(/^\d+$/.exec(I)){const q=parseInt(I);if(P(q))if(Q==="?")D.push({type:0,index:q});else{const J=(0,w.parseColor)(Q);J&&D.push({type:1,index:q,color:J})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(N){const D=N.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(N,D){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let I;const Q=L.findIndex(q=>q.startsWith("id="));return Q!==-1&&(I=L[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,D){const L=N.split(";");for(let I=0;I<L.length&&!(D>=this._specialColors.length);++I,++D)if(L[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const Q=(0,w.parseColor)(L[I]);Q&&this._onColor.fire([{type:1,index:this._specialColors[D],color:Q}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const D=[],L=N.split(";");for(let I=0;I<L.length;++I)if(/^\d+$/.exec(L[I])){const Q=parseInt(L[I]);P(Q)&&D.push({type:2,index:Q})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(j[N[0]],g.CHARSETS[N[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const L=this._activeBuffer.ybase+this._activeBuffer.y+D,I=this._activeBuffer.lines.get(L);I&&(I.fill(N),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,D){const L=this._bufferService.buffer,I=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${Q}${u.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,D){this._dirtyRowTracker.markRangeDirty(N,D)}}a.InputHandler=F;let $=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,N){U>N&&(O=U,U=N,N=O),U<this.start&&(this.start=U),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(U){return 0<=U&&U<256}$=d([p(0,S.IBufferService)],$)},844:(l,a)=>{function c(d){for(const p of d)p.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var p;this._isDisposed||d===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=c,a.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,g){this._data[p]||(this._data[p]={}),this._data[p][u]=g}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(d,p,u,g,_){this._data.get(d,p)||this._data.set(d,p,new c),this._data.get(d,p).set(u,g,_)}get(d,p,u,g){var _;return(_=this._data.get(d,p))===null||_===void 0?void 0:_.get(u,g)}clear(){this._data.clear()}}},6114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof navigator>"u";const c=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,p){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let p=0,u=this._array.length-1;for(;u>=p;){let g=p+u>>1;const _=this._getKey(this._array[g]);if(_>d)u=g-1;else{if(!(_<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let x=0,b=0,h=_.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),b=Math.max(x,b),f=_.timeRemaining(),1.5*b>f)return h-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-x))}ms`),void this._start();h=f}this.clear()}}class u extends p{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const x=Date.now()+_;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=c(643);a.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=u==null?void 0:u.get(p.cols-1),_=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);_&&g&&(_.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}a.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=c(6349),p=c(7226),u=c(3734),g=c(8437),_=c(4634),x=c(511),b=c(643),h=c(4863),f=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(m,v,y){this._hasScrollback=m,this._optionsService=v,this._bufferService=y,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,v){return new g.BufferLine(this._bufferService.cols,this.getNullCell(m),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const v=m+this._optionsService.rawOptions.scrollback;return v>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:v}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=g.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,v){const y=this.getNullCell(g.DEFAULT_ATTR_DATA);let S=0;const E=this._getCorrectBufferLength(v);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<m)for(let w=0;w<this.lines.length;w++)S+=+this.lines.get(w).resize(m,y);let k=0;if(this._rows<v)for(let w=this._rows;w<v;w++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(m,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(m,y)));else for(let w=this._rows;w>v;w--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){const w=this.lines.length-E;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=E}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,v-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(m,v),this._cols>m))for(let k=0;k<this.lines.length;k++)S+=+this.lines.get(k).resize(m,y);this._cols=m,this._rows=v,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,v){this._cols!==m&&(m>this._cols?this._reflowLarger(m,v):this._reflowSmaller(m,v))}_reflowLarger(m,v){const y=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(y.length>0){const S=(0,_.reflowLargerCreateNewLayout)(this.lines,y);(0,_.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(m,v,S.countRemoved)}}_reflowLargerAdjustViewport(m,v,y){const S=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=y;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new g.BufferLine(m,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(m,v){const y=this.getNullCell(g.DEFAULT_ATTR_DATA),S=[];let E=0;for(let k=this.lines.length-1;k>=0;k--){let w=this.lines.get(k);if(!w||!w.isWrapped&&w.getTrimmedLength()<=m)continue;const j=[w];for(;w.isWrapped&&k>0;)w=this.lines.get(--k),j.unshift(w);const R=this.ybase+this.y;if(R>=k&&R<k+j.length)continue;const M=j[j.length-1].getTrimmedLength(),T=(0,_.reflowSmallerGetNewLineLengths)(j,this._cols,m),O=T.length-j.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+O):Math.max(0,this.lines.length-this.lines.maxLength+O);const $=[];for(let I=0;I<O;I++){const Q=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);$.push(Q)}$.length>0&&(S.push({start:k+j.length+E,newLines:$}),E+=$.length),j.push(...$);let P=T.length-1,U=T[P];U===0&&(P--,U=T[P]);let N=j.length-O-1,D=M;for(;N>=0;){const I=Math.min(D,U);if(j[P]===void 0)break;if(j[P].copyCellsFrom(j[N],D-I,U-I,I,!0),U-=I,U===0&&(P--,U=T[P]),D-=I,D===0){N--;const Q=Math.max(N,0);D=(0,_.getWrappedLineTrimmedLength)(j,Q,this._cols)}}for(let I=0;I<j.length;I++)T[I]<m&&j[I].setCell(T[I],y);let L=O-F;for(;L-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+E)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+O,this.ybase+v-1)}if(S.length>0){const k=[],w=[];for(let P=0;P<this.lines.length;P++)w.push(this.lines.get(P));const j=this.lines.length;let R=j-1,M=0,T=S[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+E);let O=0;for(let P=Math.min(this.lines.maxLength-1,j+E-1);P>=0;P--)if(T&&T.start>R+O){for(let U=T.newLines.length-1;U>=0;U--)this.lines.set(P--,T.newLines[U]);P++,k.push({index:R+1,amount:T.newLines.length}),O+=T.newLines.length,T=S[++M]}else this.lines.set(P,w[R--]);let F=0;for(let P=k.length-1;P>=0;P--)k[P].index+=F,this.lines.onInsertEmitter.fire(k[P]),F+=k[P].amount;const $=Math.max(0,j+E-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(m,v,y=0,S){const E=this.lines.get(m);return E?E.translateToString(v,y,S):""}getWrappedRangeForLine(m){let v=m,y=m;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:v,last:y}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===m&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const v=new h.Marker(m);return this.markers.push(v),v.register(this.lines.onTrim(y=>{v.line-=y,v.line<0&&v.dispose()})),v.register(this.lines.onInsert(y=>{v.line>=y.index&&(v.line+=y.amount)})),v.register(this.lines.onDelete(y=>{v.line>=y.index&&v.line<y.index+y.amount&&v.dispose(),v.line>y.index&&(v.line-=y.amount)})),v.register(v.onDispose(()=>this._removeMarker(v))),v}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=c(3734),p=c(511),u=c(643),g=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let _=0;class x{constructor(h,f,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const v=f||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let y=0;y<h;++y)this.setCell(y,v);this.length=h}get(h){const f=this._data[3*h+0],m=2097151&f;return[this._data[3*h+1],2097152&f?this._combined[h]:m?(0,g.stringFromCodePoint)(m):"",f>>22,2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):m]}set(h,f){this._data[3*h+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=f[1],this._data[3*h+0]=2097152|h|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&f}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h]:2097151&f?(0,g.stringFromCodePoint)(2097151&f):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,f){return _=3*h,f.content=this._data[_+0],f.fg=this._data[_+1],f.bg=this._data[_+2],2097152&f.content&&(f.combinedData=this._combined[h]),268435456&f.bg&&(f.extended=this._extendedAttrs[h]),f}setCell(h,f){2097152&f.content&&(this._combined[h]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[h]=f.extended),this._data[3*h+0]=f.content,this._data[3*h+1]=f.fg,this._data[3*h+2]=f.bg}setCellFromCodePoint(h,f,m,v,y,S){268435456&y&&(this._extendedAttrs[h]=S),this._data[3*h+0]=f|m<<22,this._data[3*h+1]=v,this._data[3*h+2]=y}addCodepointToCell(h,f){let m=this._data[3*h+0];2097152&m?this._combined[h]+=(0,g.stringFromCodePoint)(f):(2097151&m?(this._combined[h]=(0,g.stringFromCodePoint)(2097151&m)+(0,g.stringFromCodePoint)(f),m&=-2097152,m|=2097152):m=f|4194304,this._data[3*h+0]=m)}insertCells(h,f,m,v){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs),f<this.length-h){const y=new p.CellData;for(let S=this.length-h-f-1;S>=0;--S)this.setCell(h+f+S,this.loadCell(h+S,y));for(let S=0;S<f;++S)this.setCell(h+S,m)}else for(let y=h;y<this.length;++y)this.setCell(y,m);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs)}deleteCells(h,f,m,v){if(h%=this.length,f<this.length-h){const y=new p.CellData;for(let S=0;S<this.length-h-f;++S)this.setCell(h+S,this.loadCell(h+f+S,y));for(let S=this.length-f;S<this.length;++S)this.setCell(S,m)}else for(let y=h;y<this.length;++y)this.setCell(y,m);h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodePoint(h,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs)}replaceCells(h,f,m,v,y=!1){if(y)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodePoint(h-1,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodePoint(f,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs);h<f&&h<this.length;)this.isProtected(h)||this.setCell(h,m),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f,0,1,(v==null?void 0:v.fg)||0,(v==null?void 0:v.bg)||0,(v==null?void 0:v.extended)||new d.ExtendedAttrs);h<f&&h<this.length;)this.setCell(h++,m)}resize(h,f){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const v=new Uint32Array(m);v.set(this._data),this._data=v}for(let v=this.length;v<h;++v)this.setCell(v,f)}else{this._data=this._data.subarray(0,m);const v=Object.keys(this._combined);for(let S=0;S<v.length;S++){const E=parseInt(v[S],10);E>=h&&delete this._combined[E]}const y=Object.keys(this._extendedAttrs);for(let S=0;S<y.length;S++){const E=parseInt(y[S],10);E>=h&&delete this._extendedAttrs[E]}}return this.length=h,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,f=!1){if(f)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,h);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const f in h._combined)this._combined[f]=h._combined[f];this._extendedAttrs={};for(const f in h._extendedAttrs)this._extendedAttrs[f]=h._extendedAttrs[f];this.isWrapped=h.isWrapped}clone(){const h=new x(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const f in this._combined)h._combined[f]=this._combined[f];for(const f in this._extendedAttrs)h._extendedAttrs[f]=this._extendedAttrs[f];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,f,m,v,y){const S=h._data;if(y)for(let k=v-1;k>=0;k--){for(let w=0;w<3;w++)this._data[3*(m+k)+w]=S[3*(f+k)+w];268435456&S[3*(f+k)+2]&&(this._extendedAttrs[m+k]=h._extendedAttrs[f+k])}else for(let k=0;k<v;k++){for(let w=0;w<3;w++)this._data[3*(m+k)+w]=S[3*(f+k)+w];268435456&S[3*(f+k)+2]&&(this._extendedAttrs[m+k]=h._extendedAttrs[f+k])}const E=Object.keys(h._combined);for(let k=0;k<E.length;k++){const w=parseInt(E[k],10);w>=f&&(this._combined[w-f+m]=h._combined[w])}}translateToString(h=!1,f=0,m=this.length){h&&(m=Math.min(m,this.getTrimmedLength()));let v="";for(;f<m;){const y=this._data[3*f+0],S=2097151&y;v+=2097152&y?this._combined[f]:S?(0,g.stringFromCodePoint)(S):u.WHITESPACE_CELL_CHAR,f+=y>>22||1}return v}}a.BufferLine=x},4841:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,a)=>{function c(d,p,u){if(p===d.length-1)return d[p].getTrimmedLength();const g=!d[p].hasContent(u-1)&&d[p].getWidth(u-1)===1,_=d[p+1].getWidth(0)===2;return g&&_?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,p,u,g,_){const x=[];for(let b=0;b<d.length-1;b++){let h=b,f=d.get(++h);if(!f.isWrapped)continue;const m=[d.get(b)];for(;h<d.length&&f.isWrapped;)m.push(f),f=d.get(++h);if(g>=b&&g<h){b+=m.length-1;continue}let v=0,y=c(m,v,p),S=1,E=0;for(;S<m.length;){const w=c(m,S,p),j=w-E,R=u-y,M=Math.min(j,R);m[v].copyCellsFrom(m[S],E,y,M,!1),y+=M,y===u&&(v++,y=0),E+=M,E===w&&(S++,E=0),y===0&&v!==0&&m[v-1].getWidth(u-1)===2&&(m[v].copyCellsFrom(m[v-1],u-1,y++,1,!1),m[v-1].setCell(u-1,_))}m[v].replaceCells(y,u,_);let k=0;for(let w=m.length-1;w>0&&(w>v||m[w].getTrimmedLength()===0);w--)k++;k>0&&(x.push(b+m.length-k),x.push(k)),b+=m.length-1}return x},a.reflowLargerCreateNewLayout=function(d,p){const u=[];let g=0,_=p[g],x=0;for(let b=0;b<d.length;b++)if(_===b){const h=p[++g];d.onDeleteEmitter.fire({index:b-x,amount:h}),b+=h-1,x+=h,_=p[++g]}else u.push(b);return{layout:u,countRemoved:x}},a.reflowLargerApplyNewLayout=function(d,p){const u=[];for(let g=0;g<p.length;g++)u.push(d.get(p[g]));for(let g=0;g<u.length;g++)d.set(g,u[g]);d.length=p.length},a.reflowSmallerGetNewLineLengths=function(d,p,u){const g=[],_=d.map((f,m)=>c(d,m,p)).reduce((f,m)=>f+m);let x=0,b=0,h=0;for(;h<_;){if(_-h<u){g.push(_-h);break}x+=u;const f=c(d,b,p);x>f&&(x-=f,b++);const m=d[b].getWidth(x-1)===2;m&&x--;const v=m?u-1:u;g.push(v),h+=v}return g},a.getWrappedLineTrimmedLength=c},5295:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=c(8460),p=c(844),u=c(9092);class g extends p.Disposable{constructor(x,b){super(),this._optionsService=x,this._bufferService=b,this._onBufferActivate=this.register(new d.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,b){this._normal.resize(x,b),this._alt.resize(x,b),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}a.BufferSet=g},511:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=c(482),p=c(643),u=c(3734);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const b=new g;return b.setFromCharData(x),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(x[p.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(x[p.CHAR_DATA_CHAR_INDEX].length===2){const h=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|x[p.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[p.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=x[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=c(8460),p=c(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}a.Marker=u,u._nextId=1},7116:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,a)=>{var c,d,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
209
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(c||(a.C0=c={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(d||(a.C1=d={})),function(u){u.ST=`${c.ESC}\\`}(p||(a.C1_ESCAPED=p={}))},7399:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(u,g,_,x){const b={type:0,cancel:!1,key:void 0},h=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?b.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?b.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?b.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(b.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(u.altKey){b.key=d.C0.ESC+d.C0.DEL;break}b.key=d.C0.DEL;break;case 9:if(u.shiftKey){b.key=d.C0.ESC+"[Z";break}b.key=d.C0.HT,b.cancel=!0;break;case 13:b.key=u.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,b.cancel=!0;break;case 27:b.key=d.C0.ESC,u.altKey&&(b.key=d.C0.ESC+d.C0.ESC),b.cancel=!0;break;case 37:if(u.metaKey)break;h?(b.key=d.C0.ESC+"[1;"+(h+1)+"D",b.key===d.C0.ESC+"[1;3D"&&(b.key=d.C0.ESC+(_?"b":"[1;5D"))):b.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(u.metaKey)break;h?(b.key=d.C0.ESC+"[1;"+(h+1)+"C",b.key===d.C0.ESC+"[1;3C"&&(b.key=d.C0.ESC+(_?"f":"[1;5C"))):b.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(u.metaKey)break;h?(b.key=d.C0.ESC+"[1;"+(h+1)+"A",_||b.key!==d.C0.ESC+"[1;3A"||(b.key=d.C0.ESC+"[1;5A")):b.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(u.metaKey)break;h?(b.key=d.C0.ESC+"[1;"+(h+1)+"B",_||b.key!==d.C0.ESC+"[1;3B"||(b.key=d.C0.ESC+"[1;5B")):b.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(b.key=d.C0.ESC+"[2~");break;case 46:b.key=h?d.C0.ESC+"[3;"+(h+1)+"~":d.C0.ESC+"[3~";break;case 36:b.key=h?d.C0.ESC+"[1;"+(h+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:b.key=h?d.C0.ESC+"[1;"+(h+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:u.shiftKey?b.type=2:u.ctrlKey?b.key=d.C0.ESC+"[5;"+(h+1)+"~":b.key=d.C0.ESC+"[5~";break;case 34:u.shiftKey?b.type=3:u.ctrlKey?b.key=d.C0.ESC+"[6;"+(h+1)+"~":b.key=d.C0.ESC+"[6~";break;case 112:b.key=h?d.C0.ESC+"[1;"+(h+1)+"P":d.C0.ESC+"OP";break;case 113:b.key=h?d.C0.ESC+"[1;"+(h+1)+"Q":d.C0.ESC+"OQ";break;case 114:b.key=h?d.C0.ESC+"[1;"+(h+1)+"R":d.C0.ESC+"OR";break;case 115:b.key=h?d.C0.ESC+"[1;"+(h+1)+"S":d.C0.ESC+"OS";break;case 116:b.key=h?d.C0.ESC+"[15;"+(h+1)+"~":d.C0.ESC+"[15~";break;case 117:b.key=h?d.C0.ESC+"[17;"+(h+1)+"~":d.C0.ESC+"[17~";break;case 118:b.key=h?d.C0.ESC+"[18;"+(h+1)+"~":d.C0.ESC+"[18~";break;case 119:b.key=h?d.C0.ESC+"[19;"+(h+1)+"~":d.C0.ESC+"[19~";break;case 120:b.key=h?d.C0.ESC+"[20;"+(h+1)+"~":d.C0.ESC+"[20~";break;case 121:b.key=h?d.C0.ESC+"[21;"+(h+1)+"~":d.C0.ESC+"[21~";break;case 122:b.key=h?d.C0.ESC+"[23;"+(h+1)+"~":d.C0.ESC+"[23~";break;case 123:b.key=h?d.C0.ESC+"[24;"+(h+1)+"~":d.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(_&&!x||!u.altKey||u.metaKey)!_||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?b.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(b.key=d.C0.US),u.key==="@"&&(b.key=d.C0.NUL)):u.keyCode===65&&(b.type=1);else{const f=p[u.keyCode],m=f==null?void 0:f[u.shiftKey?1:0];if(m)b.key=d.C0.ESC+m;else if(u.keyCode>=65&&u.keyCode<=90){const v=u.ctrlKey?u.keyCode-64:u.keyCode+32;let y=String.fromCharCode(v);u.shiftKey&&(y=y.toUpperCase()),b.key=d.C0.ESC+y}else if(u.keyCode===32)b.key=d.C0.ESC+(u.ctrlKey?d.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let v=u.code.slice(3,4);u.shiftKey||(v=v.toLowerCase()),b.key=d.C0.ESC+v,b.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?b.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?b.key=d.C0.NUL:u.keyCode>=51&&u.keyCode<=55?b.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?b.key=d.C0.DEL:u.keyCode===219?b.key=d.C0.ESC:u.keyCode===220?b.key=d.C0.FS:u.keyCode===221&&(b.key=d.C0.GS)}return b}},482:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,d=0,p=c.length){let u="";for(let g=d;g<p;++g){let _=c[g];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const p=c.length;if(!p)return 0;let u=0,g=0;if(this._interim){const _=c.charCodeAt(g++);56320<=_&&_<=57343?d[u++]=1024*(this._interim-55296)+_-56320+65536:(d[u++]=this._interim,d[u++]=_),this._interim=0}for(let _=g;_<p;++_){const x=c.charCodeAt(_);if(55296<=x&&x<=56319){if(++_>=p)return this._interim=x,u;const b=c.charCodeAt(_);56320<=b&&b<=57343?d[u++]=1024*(x-55296)+b-56320+65536:(d[u++]=x,d[u++]=b)}else x!==65279&&(d[u++]=x)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const p=c.length;if(!p)return 0;let u,g,_,x,b=0,h=0,f=0;if(this.interim[0]){let y=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let E,k=0;for(;(E=63&this.interim[++k])&&k<4;)S<<=6,S|=E;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=w-k;for(;f<j;){if(f>=p)return 0;if(E=c[f++],(192&E)!=128){f--,y=!0;break}this.interim[k++]=E,S<<=6,S|=63&E}y||(w===2?S<128?f--:d[b++]=S:w===3?S<2048||S>=55296&&S<=57343||S===65279||(d[b++]=S):S<65536||S>1114111||(d[b++]=S)),this.interim.fill(0)}const m=p-4;let v=f;for(;v<p;){for(;!(!(v<m)||128&(u=c[v])||128&(g=c[v+1])||128&(_=c[v+2])||128&(x=c[v+3]));)d[b++]=u,d[b++]=g,d[b++]=_,d[b++]=x,v+=4;if(u=c[v++],u<128)d[b++]=u;else if((224&u)==192){if(v>=p)return this.interim[0]=u,b;if(g=c[v++],(192&g)!=128){v--;continue}if(h=(31&u)<<6|63&g,h<128){v--;continue}d[b++]=h}else if((240&u)==224){if(v>=p)return this.interim[0]=u,b;if(g=c[v++],(192&g)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=g,b;if(_=c[v++],(192&_)!=128){v--;continue}if(h=(15&u)<<12|(63&g)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;d[b++]=h}else if((248&u)==240){if(v>=p)return this.interim[0]=u,b;if(g=c[v++],(192&g)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=g,b;if(_=c[v++],(192&_)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=_,b;if(x=c[v++],(192&x)!=128){v--;continue}if(h=(7&u)<<18|(63&g)<<12|(63&_)<<6|63&x,h<65536||h>1114111)continue;d[b++]=h}}return b}}},225:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[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 p;a.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let u=0;u<c.length;++u)p.fill(0,c[u][0],c[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?p[u]:function(g,_){let x,b=0,h=_.length-1;if(g<_[0][0]||g>_[h][1])return!1;for(;h>=b;)if(x=b+h>>1,g>_[x][1])b=x+1;else{if(!(g<_[x][0]))return!0;h=x-1}return!1}(u,d)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=c(8460),p=c(844);class u extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(x)}_innerWrite(_=0,x=!0){const b=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],f=this._action(h,x);if(f){const v=y=>Date.now()-b>=12?setTimeout(()=>this._innerWrite(0,y)):this._innerWrite(b,y);return void f.catch(y=>(queueMicrotask(()=>{throw y}),Promise.resolve(!1))).then(v)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-b>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=u},5941:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function p(u,g){const _=u.toString(16),x=_.length<2?"0"+_:_;switch(g){case 4:return _[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}a.parseColor=function(u){if(!u)return;let g=u.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const _=c.exec(g);if(_){const x=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/x*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/x*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/x*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const _=g.length/3,x=[0,0,0];for(let b=0;b<3;++b){const h=parseInt(g.slice(_*b,_*b+_),16);x[b]=_===1?h<<4:_===2?h:_===3?h>>4:h>>8}return x}},a.toRgbString=function(u,g=16){const[_,x,b]=u;return`rgb:${p(_,g)}/${p(x,g)}/${p(b,g)}`}},5770:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=c(482),p=c(8742),u=c(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(x,b){this._handlers[x]===void 0&&(this._handlers[x]=[]);const h=this._handlers[x];return h.push(b),{dispose:()=>{const f=h.indexOf(b);f!==-1&&h.splice(f,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(x,b){if(this.reset(),this._ident=x,this._active=this._handlers[x]||g,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(x,b,h){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(x,b,h);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(x,b,h))}unhook(x,b=!0){if(this._active.length){let h=!1,f=this._active.length-1,m=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,h=b,m=this._stack.fallThrough,this._stack.paused=!1),!m&&h===!1){for(;f>=0&&(h=this._active[f].unhook(x),h!==!0);f--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,h;f--}for(;f>=0;f--)if(h=this._active[f].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",x);this._active=g,this._ident=0}};const _=new p.Params;_.addParam(0),a.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=_,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():_,this._data="",this._hitLimit=!1}put(x,b,h){this._hitLimit||(this._data+=(0,d.utf32ToString)(x,b,h),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let b=!1;if(this._hitLimit)b=!1;else if(x&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then(h=>(this._params=_,this._data="",this._hitLimit=!1,h));return this._params=_,this._data="",this._hitLimit=!1,b}}},2015:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=c(844),p=c(8742),u=c(6242),g=c(6351);class _{constructor(f){this.table=new Uint8Array(f)}setDefault(f,m){this.table.fill(f<<4|m)}add(f,m,v,y){this.table[m<<8|f]=v<<4|y}addMany(f,m,v,y){for(let S=0;S<f.length;S++)this.table[m<<8|f[S]]=v<<4|y}}a.TransitionTable=_;const x=160;a.VT500_TRANSITION_TABLE=function(){const h=new _(4095),f=Array.apply(null,Array(256)).map((k,w)=>w),m=(k,w)=>f.slice(k,w),v=m(32,127),y=m(0,24);y.push(25),y.push.apply(y,m(28,32));const S=m(0,14);let E;for(E in h.setDefault(1,0),h.addMany(v,0,2,0),S)h.addMany([24,26,153,154],E,3,0),h.addMany(m(128,144),E,3,0),h.addMany(m(144,152),E,3,0),h.add(156,E,0,0),h.add(27,E,11,1),h.add(157,E,4,8),h.addMany([152,158,159],E,0,7),h.add(155,E,11,3),h.add(144,E,11,9);return h.addMany(y,0,3,0),h.addMany(y,1,3,1),h.add(127,1,0,1),h.addMany(y,8,0,8),h.addMany(y,3,3,3),h.add(127,3,0,3),h.addMany(y,4,3,4),h.add(127,4,0,4),h.addMany(y,6,3,6),h.addMany(y,5,3,5),h.add(127,5,0,5),h.addMany(y,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(v,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(m(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(v,7,0,7),h.addMany(y,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(m(64,127),3,7,0),h.addMany(m(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(m(48,60),4,8,4),h.addMany(m(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(m(32,64),6,0,6),h.add(127,6,0,6),h.addMany(m(64,127),6,0,0),h.addMany(m(32,48),3,9,5),h.addMany(m(32,48),5,9,5),h.addMany(m(48,64),5,0,6),h.addMany(m(64,127),5,7,0),h.addMany(m(32,48),4,9,5),h.addMany(m(32,48),1,9,2),h.addMany(m(32,48),2,9,2),h.addMany(m(48,127),2,10,0),h.addMany(m(48,80),1,10,0),h.addMany(m(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(m(96,127),1,10,0),h.add(80,1,11,9),h.addMany(y,9,0,9),h.add(127,9,0,9),h.addMany(m(28,32),9,0,9),h.addMany(m(32,48),9,9,12),h.addMany(m(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(y,11,0,11),h.addMany(m(32,128),11,0,11),h.addMany(m(28,32),11,0,11),h.addMany(y,10,0,10),h.add(127,10,0,10),h.addMany(m(28,32),10,0,10),h.addMany(m(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(m(32,48),10,9,12),h.addMany(y,12,0,12),h.add(127,12,0,12),h.addMany(m(28,32),12,0,12),h.addMany(m(32,48),12,9,12),h.addMany(m(48,64),12,0,11),h.addMany(m(64,127),12,12,13),h.addMany(m(64,127),10,12,13),h.addMany(m(64,127),9,12,13),h.addMany(y,13,13,13),h.addMany(v,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(x,0,2,0),h.add(x,8,5,8),h.add(x,6,0,6),h.add(x,11,0,11),h.add(x,13,13,13),h}();class b extends d.Disposable{constructor(f=a.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(m,v,y)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,v)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,m=[64,126]){let v=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=f.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<f.intermediates.length;++S){const E=f.intermediates.charCodeAt(S);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=E}}if(f.final.length!==1)throw new Error("final must be a single byte");const y=f.final.charCodeAt(0);if(m[0]>y||y>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return v<<=8,v|=y,v}identToString(f){const m=[];for(;f;)m.push(String.fromCharCode(255&f)),f>>=8;return m.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,m){const v=this._identifier(f,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const y=this._escHandlers[v];return y.push(m),{dispose:()=>{const S=y.indexOf(m);S!==-1&&y.splice(S,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,m){this._executeHandlers[f.charCodeAt(0)]=m}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,m){const v=this._identifier(f);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const y=this._csiHandlers[v];return y.push(m),{dispose:()=>{const S=y.indexOf(m);S!==-1&&y.splice(S,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,m){return this._dcsParser.registerHandler(this._identifier(f),m)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,m){return this._oscParser.registerHandler(f,m)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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(f,m,v,y,S){this._parseStack.state=f,this._parseStack.handlers=m,this._parseStack.handlerPos=v,this._parseStack.transition=y,this._parseStack.chunkPos=S}parse(f,m,v){let y,S=0,E=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&j>-1){for(;j>=0&&(y=w[j](this._params),y!==!0);j--)if(y instanceof Promise)return this._parseStack.handlerPos=j,y}this._parseStack.handlers=[];break;case 4:if(v===!1&&j>-1){for(;j>=0&&(y=w[j](),y!==!0);j--)if(y instanceof Promise)return this._parseStack.handlerPos=j,y}this._parseStack.handlers=[];break;case 6:if(S=f[this._parseStack.chunkPos],y=this._dcsParser.unhook(S!==24&&S!==26,v),y)return y;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=f[this._parseStack.chunkPos],y=this._oscParser.end(S!==24&&S!==26,v),y)return y;S===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 w=k;w<m;++w){switch(S=f[w],E=this._transitions.table[this.currentState<<8|(S<160?S:x)],E>>4){case 2:for(let O=w+1;;++O){if(O>=m||(S=f[O])<32||S>126&&S<x){this._printHandler(f,w,O),w=O-1;break}if(++O>=m||(S=f[O])<32||S>126&&S<x){this._printHandler(f,w,O),w=O-1;break}if(++O>=m||(S=f[O])<32||S>126&&S<x){this._printHandler(f,w,O),w=O-1;break}if(++O>=m||(S=f[O])<32||S>126&&S<x){this._printHandler(f,w,O),w=O-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|S];let R=j?j.length-1:-1;for(;R>=0&&(y=j[R](this._params),y!==!0);R--)if(y instanceof Promise)return this._preserveStack(3,j,R,E,w),y;R<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingCodepoint=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++w<m&&(S=f[w])>47&&S<60);w--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const M=this._escHandlers[this._collect<<8|S];let T=M?M.length-1:-1;for(;T>=0&&(y=M[T](),y!==!0);T--)if(y instanceof Promise)return this._preserveStack(4,M,T,E,w),y;T<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let O=w+1;;++O)if(O>=m||(S=f[O])===24||S===26||S===27||S>127&&S<x){this._dcsParser.put(f,w,O),w=O-1;break}break;case 14:if(y=this._dcsParser.unhook(S!==24&&S!==26),y)return this._preserveStack(6,[],0,E,w),y;S===27&&(E|=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 O=w+1;;O++)if(O>=m||(S=f[O])<32||S>127&&S<x){this._oscParser.put(f,w,O),w=O-1;break}break;case 6:if(y=this._oscParser.end(S!==24&&S!==26),y)return this._preserveStack(5,[],0,E,w),y;S===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&E}}}a.EscapeSequenceParser=b},6242:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=c(5770),p=c(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,_){this._handlers[g]===void 0&&(this._handlers[g]=[]);const x=this._handlers[g];return x.push(_),{dispose:()=>{const b=x.indexOf(_);b!==-1&&x.splice(b,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,_,x){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(g,_,x);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,_,x))}start(){this.reset(),this._state=1}put(g,_,x){if(this._state!==3){if(this._state===1)for(;_<x;){const b=g[_++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&x-_>0&&this._put(g,_,x)}}end(g,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,b=this._active.length-1,h=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,x=_,h=this._stack.fallThrough,this._stack.paused=!1),!h&&x===!1){for(;b>=0&&(x=this._active[b].end(g),x!==!0);b--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,x;b--}for(;b>=0;b--)if(x=this._active[b].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",g);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,_,x){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,_,x),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let _=!1;if(this._hitLimit)_=!1;else if(g&&(_=this._handler(this._data),_ instanceof Promise))return _.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,_}}},8742:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class d{static fromArray(u){const g=new d;if(!u.length)return g;for(let _=Array.isArray(u[0])?1:0;_<u.length;++_){const x=u[_];if(Array.isArray(x))for(let b=0;b<x.length;++b)g.addSubParam(x[b]);else g.addParam(x)}return g}constructor(u=32,g=32){if(this.maxLength=u,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new d(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let g=0;g<this.length;++g){u.push(this.params[g]);const _=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-_>0&&u.push(Array.prototype.slice.call(this._subParams,_,x))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const g=this._subParamsIdx[u]>>8,_=255&this._subParamsIdx[u];return _-g>0?this._subParams.subarray(g,_):null}getSubParamsAll(){const u={};for(let g=0;g<this.length;++g){const _=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-_>0&&(u[g]=this._subParams.slice(_,x))}return u}addDigit(u){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,x=_[g-1];_[g-1]=~x?Math.min(10*x+u,c):u}}a.Params=d},5741:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=c(3785),p=c(511);a.BufferApiView=class{constructor(u,g){this._buffer=u,this.type=g}init(u){return this._buffer=u,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(u){const g=this._buffer.lines.get(u);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=c(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new d.CellData)}translateToString(p,u,g){return this._line.translateToString(p,u,g)}}},8285:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=c(8771),p=c(8460),u=c(844);class g extends u.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=g},7975:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,p=>d(p.toArray()))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,(p,u)=>d(p,u.toArray()))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,a,c){var d=this&&this.__decorate||function(h,f,m,v){var y,S=arguments.length,E=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,f,m,v);else for(var k=h.length-1;k>=0;k--)(y=h[k])&&(E=(S<3?y(E):S>3?y(f,m,E):y(f,m))||E);return S>3&&E&&Object.defineProperty(f,m,E),E},p=this&&this.__param||function(h,f){return function(m,v){f(m,v,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=c(8460),g=c(844),_=c(5295),x=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let b=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(h,this))}resize(h,f){this.cols=h,this.rows=f,this.buffers.resize(h,f),this._onResize.fire({cols:h,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,f=!1){const m=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===h.fg&&v.getBg(0)===h.bg||(v=m.getBlankLine(h,f),this._cachedBlankLine=v),v.isWrapped=f;const y=m.ybase+m.scrollTop,S=m.ybase+m.scrollBottom;if(m.scrollTop===0){const E=m.lines.isFull;S===m.lines.length-1?E?m.lines.recycle().copyFrom(v):m.lines.push(v.clone()):m.lines.splice(S+1,0,v.clone()),E?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const E=S-y+1;m.lines.shiftElements(y+1,E-1,-1),m.lines.set(S,v.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(h,f,m){const v=this.buffer;if(h<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else h+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const y=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+h,v.ybase),0),y!==v.ydisp&&(f||this._onScroll.fire(v.ydisp))}};a.BufferService=b=d([p(0,x.IOptionsService)],b)},7994:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(l,a,c){var d=this&&this.__decorate||function(v,y,S,E){var k,w=arguments.length,j=w<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,y,S,E);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(j=(w<3?k(j):w>3?k(y,S,j):k(y,S))||j);return w>3&&j&&Object.defineProperty(y,S,j),j},p=this&&this.__param||function(v,y){return function(S,E){y(S,E,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=c(2585),g=c(8460),_=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function b(v,y){let S=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(S|=64,S|=v.action):(S|=3&v.button,4&v.button&&(S|=64),8&v.button&&(S|=128),v.action===32?S|=32:v.action!==0||y||(S|=3)),S}const h=String.fromCharCode,f={DEFAULT:v=>{const y=[b(v,!1)+32,v.col+32,v.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${h(y[0])}${h(y[1])}${h(y[2])}`},SGR:v=>{const y=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.col};${v.row}${y}`},SGR_PIXELS:v=>{const y=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${b(v,!0)};${v.x};${v.y}${y}`}};let m=a.CoreMouseService=class extends _.Disposable{constructor(v,y){super(),this._bufferService=v,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(x))this.addProtocol(S,x[S]);for(const S of Object.keys(f))this.addEncoding(S,f[S]);this.reset()}addProtocol(v,y){this._protocols[v]=y}addEncoding(v,y){this._encodings[v]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const y=this._encodings[this._activeEncoding](v);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,y,S){if(S){if(v.x!==y.x||v.y!==y.y)return!1}else if(v.col!==y.col||v.row!==y.row)return!1;return v.button===y.button&&v.action===y.action&&v.ctrl===y.ctrl&&v.alt===y.alt&&v.shift===y.shift}};a.CoreMouseService=m=d([p(0,u.IBufferService),p(1,u.ICoreService)],m)},6975:function(l,a,c){var d=this&&this.__decorate||function(m,v,y,S){var E,k=arguments.length,w=k<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,v,y,S);else for(var j=m.length-1;j>=0;j--)(E=m[j])&&(w=(k<3?E(w):k>3?E(v,y,w):E(v,y))||w);return k>3&&w&&Object.defineProperty(v,y,w),w},p=this&&this.__param||function(m,v){return function(y,S){v(y,S,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=c(1439),g=c(8460),_=c(844),x=c(2585),b=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=a.CoreService=class extends _.Disposable{constructor(m,v,y){super(),this._bufferService=m,this._logService=v,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(b),this.decPrivateModes=(0,u.clone)(h)}reset(){this.modes=(0,u.clone)(b),this.decPrivateModes=(0,u.clone)(h)}triggerDataEvent(m,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,()=>m.split("").map(S=>S.charCodeAt(0))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,()=>m.split("").map(v=>v.charCodeAt(0))),this._onBinary.fire(m))}};a.CoreService=f=d([p(0,x.IBufferService),p(1,x.ILogService),p(2,x.IOptionsService)],f)},9074:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=c(8055),p=c(8460),u=c(844),g=c(6106);let _=0,x=0;class b extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList(m=>m==null?void 0:m.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(m){if(m.marker.isDisposed)return;const v=new h(m);if(v){const y=v.marker.onDispose(()=>v.dispose());v.onDispose(()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),y.dispose())}),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,v,y){var S,E,k;let w=0,j=0;for(const R of this._decorations.getKeyIterator(v))w=(S=R.options.x)!==null&&S!==void 0?S:0,j=w+((E=R.options.width)!==null&&E!==void 0?E:1),m>=w&&m<j&&(!y||((k=R.options.layer)!==null&&k!==void 0?k:"bottom")===y)&&(yield R)}forEachDecorationAtCell(m,v,y,S){this._decorations.forEachByKey(v,E=>{var k,w,j;_=(k=E.options.x)!==null&&k!==void 0?k:0,x=_+((w=E.options.width)!==null&&w!==void 0?w:1),m>=_&&m<x&&(!y||((j=E.options.layer)!==null&&j!==void 0?j:"bottom")===y)&&S(E)})}}a.DecorationService=b;class h extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=c(2585),p=c(8343);class u{constructor(..._){this._entries=new Map;for(const[x,b]of _)this.set(x,b)}set(_,x){const b=this._entries.get(_);return this._entries.set(_,x),b}forEach(_){for(const[x,b]of this._entries.entries())_(x,b)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(d.IInstantiationService,this)}setService(g,_){this._services.set(g,_)}getService(g){return this._services.get(g)}createInstance(g,..._){const x=(0,p.getServiceDependencies)(g).sort((f,m)=>f.index-m.index),b=[];for(const f of x){const m=this._services.get(f.id);if(!m)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${f.id}.`);b.push(m)}const h=x.length>0?x[0].index:_.length;if(_.length!==h)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${h+1} conflicts with ${_.length} static arguments`);return new g(..._,...b)}}},7866:function(l,a,c){var d=this&&this.__decorate||function(h,f,m,v){var y,S=arguments.length,E=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,f,m,v);else for(var k=h.length-1;k>=0;k--)(y=h[k])&&(E=(S<3?y(E):S>3?y(f,m,E):y(f,m))||E);return S>3&&E&&Object.defineProperty(f,m,E),E},p=this&&this.__param||function(h,f){return function(m,v){f(m,v,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=c(844),g=c(2585),_={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,b=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,m){this._evalLazyOptionalParams(m),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...m)}trace(h,...f){var m,v;this._logLevel<=g.LogLevelEnum.TRACE&&this._log((v=(m=this._optionsService.options.logger)===null||m===void 0?void 0:m.trace.bind(this._optionsService.options.logger))!==null&&v!==void 0?v:console.log,h,f)}debug(h,...f){var m,v;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log((v=(m=this._optionsService.options.logger)===null||m===void 0?void 0:m.debug.bind(this._optionsService.options.logger))!==null&&v!==void 0?v:console.log,h,f)}info(h,...f){var m,v;this._logLevel<=g.LogLevelEnum.INFO&&this._log((v=(m=this._optionsService.options.logger)===null||m===void 0?void 0:m.info.bind(this._optionsService.options.logger))!==null&&v!==void 0?v:console.info,h,f)}warn(h,...f){var m,v;this._logLevel<=g.LogLevelEnum.WARN&&this._log((v=(m=this._optionsService.options.logger)===null||m===void 0?void 0:m.warn.bind(this._optionsService.options.logger))!==null&&v!==void 0?v:console.warn,h,f)}error(h,...f){var m,v;this._logLevel<=g.LogLevelEnum.ERROR&&this._log((v=(m=this._optionsService.options.logger)===null||m===void 0?void 0:m.error.bind(this._optionsService.options.logger))!==null&&v!==void 0?v:console.error,h,f)}};a.LogService=b=d([p(0,g.IOptionsService)],b),a.setTraceLogger=function(h){x=h},a.traceCall=function(h,f,m){if(typeof m.value!="function")throw new Error("not supported");const v=m.value;m.value=function(...y){if(x.logLevel!==g.LogLevelEnum.TRACE)return v.apply(this,y);x.trace(`GlyphRenderer#${v.name}(${y.map(E=>JSON.stringify(E)).join(", ")})`);const S=v.apply(this,y);return x.trace(`GlyphRenderer#${v.name} return`,S),S}}},7302:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=c(8460),p=c(844),u=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(b){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h=Object.assign({},a.DEFAULT_OPTIONS);for(const f in b)if(f in h)try{const m=b[f];h[f]=this._sanitizeAndValidateOption(f,m)}catch(m){console.error(m)}this.rawOptions=h,this.options=Object.assign({},h),this._setupOptions()}onSpecificOptionChange(b,h){return this.onOptionChange(f=>{f===b&&h(this.rawOptions[b])})}onMultipleOptionChange(b,h){return this.onOptionChange(f=>{b.indexOf(f)!==-1&&h()})}_setupOptions(){const b=f=>{if(!(f in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},h=(f,m)=>{if(!(f in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);m=this._sanitizeAndValidateOption(f,m),this.rawOptions[f]!==m&&(this.rawOptions[f]=m,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const m={get:b.bind(this,f),set:h.bind(this,f)};Object.defineProperty(this.options,f,m)}}_sanitizeAndValidateOption(b,h){switch(b){case"cursorStyle":if(h||(h=a.DEFAULT_OPTIONS[b]),!function(f){return f==="block"||f==="underline"||f==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${b}`);break;case"wordSeparator":h||(h=a.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=g.includes(h)?h:a.DEFAULT_OPTIONS[b];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${b} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${b} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}a.OptionsService=_},2660:function(l,a,c){var d=this&&this.__decorate||function(_,x,b,h){var f,m=arguments.length,v=m<3?x:h===null?h=Object.getOwnPropertyDescriptor(x,b):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(_,x,b,h);else for(var y=_.length-1;y>=0;y--)(f=_[y])&&(v=(m<3?f(v):m>3?f(x,b,v):f(x,b))||v);return m>3&&v&&Object.defineProperty(x,b,v),v},p=this&&this.__param||function(_,x){return function(b,h){x(b,h,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=c(2585);let g=a.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const x=this._bufferService.buffer;if(_.id===void 0){const y=x.addMarker(x.ybase+x.y),S={data:_,id:this._nextId++,lines:[y]};return y.onDispose(()=>this._removeMarkerFromLink(S,y)),this._dataByLinkId.set(S.id,S),S.id}const b=_,h=this._getEntryIdKey(b),f=this._entriesWithId.get(h);if(f)return this.addLineToLink(f.id,x.ybase+x.y),f.id;const m=x.addMarker(x.ybase+x.y),v={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(v,m)),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(_,x){const b=this._dataByLinkId.get(_);if(b&&b.lines.every(h=>h.line!==x)){const h=this._bufferService.buffer.addMarker(x);b.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(b,h))}}getLinkData(_){var x;return(x=this._dataByLinkId.get(_))===null||x===void 0?void 0:x.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,x){const b=_.lines.indexOf(x);b!==-1&&(_.lines.splice(b,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};a.OscLinkService=g=d([p(0,u.IBufferService)],g)},8343:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[d]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const u=function(g,_,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,h,f){h[c]===h?h[d].push({id:b,index:f}):(h[d]=[{id:b,index:f}],h[c]=h)})(u,g,x)};return u.toString=()=>p,a.serviceRegistry.set(p,u),u}},2585:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=c(8343);var p;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(a.LogLevelEnum=p={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=c(8460),p=c(225);a.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const u=new p.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let g=0;const _=u.length;for(let x=0;x<_;++x){let b=u.charCodeAt(x);if(55296<=b&&b<=56319){if(++x>=_)return g+this.wcwidth(b);const h=u.charCodeAt(x);56320<=h&&h<=57343?b=1024*(b-55296)+h-56320+65536:g+=this.wcwidth(h)}g+=this.wcwidth(b)}return g}}}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const a=s(9042),c=s(3236),d=s(844),p=s(5741),u=s(8285),g=s(7975),_=s(7090),x=["cols","rows"];class b extends d.Disposable{constructor(f){super(),this._core=this.register(new c.Terminal(f)),this._addonManager=this.register(new p.AddonManager),this._publicOptions=Object.assign({},this._core.options);const m=y=>this._core.options[y],v=(y,S)=>{this._checkReadonlyOptions(y),this._core.options[y]=S};for(const y in this._core.options){const S={get:m.bind(this,y),set:v.bind(this,y)};Object.defineProperty(this._publicOptions,y,S)}}_checkReadonlyOptions(f){if(x.includes(f))throw new Error(`Option "${f}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const m in f)this._publicOptions[m]=f[m]}blur(){this._core.blur()}focus(){this._core.focus()}resize(f,m){this._verifyIntegers(f,m),this._core.resize(f,m)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){var m,v,y;return this._checkProposedApi(),this._verifyPositiveIntegers((m=f.x)!==null&&m!==void 0?m:0,(v=f.width)!==null&&v!==void 0?v:0,(y=f.height)!==null&&y!==void 0?y:0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,m,v){this._verifyIntegers(f,m,v),this._core.select(f,m,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,m){this._verifyIntegers(f,m),this._core.selectLines(f,m)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,m){this._core.write(f,m)}writeln(f,m){this._core.write(f),this._core.write(`\r
|
|
210
|
+
`,m)}paste(f){this._core.paste(f)}refresh(f,m){this._verifyIntegers(f,m),this._core.refresh(f,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return a}_verifyIntegers(...f){for(const m of f)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const m of f)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}l.Terminal=b})(),i})())})(EE);var LM=EE.exports,kE={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(g/i.css.cell.width)),rows:Math.max(1,Math.floor(u/i.css.cell.height))}}}})(),r})())})(kE);var PM=kE.exports,RE={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(d,p,u,g={}){this._terminal=d,this._regex=p,this._handler=u,this._options=g}provideLinks(d,p){const u=c.computeLink(d,this._regex,this._terminal,this._handler);p(this._addCallbacks(u))}_addCallbacks(d){return d.map(p=>(p.leave=this._options.leave,p.hover=(u,g)=>{if(this._options.hover){const{range:_}=p;this._options.hover(u,g,_)}},p))}};class c{static computeLink(p,u,g,_){const x=new RegExp(u.source,(u.flags||"")+"g"),[b,h]=c._getWindowedLineStrings(p-1,g),f=b.join("");let m;const v=[];for(;m=x.exec(f);){const y=m[0];try{const R=new URL(y),M=decodeURI(R.toString());if(y!==M&&y+"/"!==M)continue}catch{continue}const[S,E]=c._mapStrIdx(g,h,0,m.index),[k,w]=c._mapStrIdx(g,S,E,y.length);if(S===-1||E===-1||k===-1||w===-1)continue;const j={start:{x:E+1,y:S+1},end:{x:w,y:k+1}};v.push({range:j,text:y,activate:_})}return v}static _getWindowedLineStrings(p,u){let g,_=p,x=p,b=0,h="";const f=[];if(g=u.buffer.active.getLine(p)){const m=g.translateToString(!0);if(g.isWrapped&&m[0]!==" "){for(b=0;(g=u.buffer.active.getLine(--_))&&b<2048&&(h=g.translateToString(!0),b+=h.length,f.push(h),g.isWrapped&&h.indexOf(" ")===-1););f.reverse()}for(f.push(m),b=0;(g=u.buffer.active.getLine(++x))&&g.isWrapped&&b<2048&&(h=g.translateToString(!0),b+=h.length,f.push(h),h.indexOf(" ")===-1););}return[f,_]}static _mapStrIdx(p,u,g,_){const x=p.buffer.active,b=x.getNullCell();let h=g;for(;_;){const f=x.getLine(u);if(!f)return[-1,-1];for(let m=h;m<f.length;++m){f.getCell(m,b);const v=b.getChars();if(b.getWidth()&&(_-=v.length||1,m===f.length-1&&v==="")){const y=x.getLine(u+1);y&&y.isWrapped&&(y.getCell(0,b),b.getWidth()===2&&(_+=1))}if(_<0)return[u,m]}u++,h=0}return[u,h]}}a.LinkComputer=c}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l](c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const a=s(6),c=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(p,u){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(p=d,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,g=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,u))}dispose(){var p;(p=this._linkProvider)===null||p===void 0||p.dispose()}}})(),i})())})(RE);var BM=RE.exports;const IM=zf("inline-flex items-center rounded-sm border px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] transition-colors",{variants:{variant:{default:"border-transparent bg-[var(--accent-sky)] text-[var(--bg-sunken)]",secondary:"border-transparent bg-[var(--bg-sunken)] text-[var(--fg-muted)]",destructive:"border-[var(--severity-blocking-border)] bg-[var(--severity-blocking-bg)] text-[var(--severity-blocking-fg)]",warning:"border-[var(--severity-warning-border)] bg-[var(--severity-warning-bg)] text-[var(--severity-warning-fg)]",success:"border-[var(--severity-success-border)] bg-[var(--severity-success-bg)] text-[var(--severity-success-fg)]",outline:"border-[var(--border)] bg-transparent text-[var(--fg)]",pill:"rounded-full border-[var(--wane)] bg-transparent text-[var(--wane)] normal-case tracking-[0.12em] px-1.5"}},defaultVariants:{variant:"default"}});function Ce({className:e,variant:t,...r}){return o.jsx("span",{className:te(IM({variant:t}),e),...r})}function NE({agentGated:e=!1}={}){const t=C.useRef(null),[r,n]=C.useState(null),[s,i]=C.useState(!1),[l,a]=C.useState(!1),[c,d]=C.useState(null);C.useEffect(()=>{if(!t.current)return;let u=!1,g=null,_=null,x=null;const b=window.location.protocol==="https:"?"wss":"ws",h=new WebSocket(`${b}://${window.location.host}/api/agent/ws`),f=()=>{if(_||!t.current)return _;const m=new LM.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}),v=new PM.FitAddon;m.loadAddon(v),m.loadAddon(new BM.WebLinksAddon),m.open(t.current);const y=()=>{if(!(u||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{v.fit()}catch{}};return g=window.requestAnimationFrame(y),x=new ResizeObserver(()=>{y()}),x.observe(t.current),m.onData(S=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"input",data:S}))}),m.onResize(({cols:S,rows:E})=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"resize",cols:S,rows:E}))}),_=m,m};return h.onopen=()=>{i(!0),f()},h.onclose=()=>i(!1),h.onerror=()=>i(!1),h.onmessage=m=>{try{const v=JSON.parse(m.data);v.kind==="data"&&typeof v.data=="string"?_==null||_.write(v.data):v.kind==="meta"?(n({active:!!v.autoMode,reason:v.reason??""}),typeof v.agentReady=="boolean"&&a(v.agentReady)):v.kind==="auth_url"&&typeof v.url=="string"||(v.kind==="error"?v.recoverable&&v.remediation?d({message:v.message??"agent failed to start",remediation:v.remediation}):_==null||_.write(`\r
|
|
211
|
+
\x1B[31m[error] ${v.message??"unknown error"}\x1B[0m\r
|
|
212
|
+
`):v.kind==="exit"&&(_==null||_.write(`\r
|
|
213
|
+
\x1B[33m[claude session exited]\x1B[0m\r
|
|
214
|
+
`)))}catch{}},()=>{u=!0,g!==null&&window.cancelAnimationFrame(g),h.close(),x==null||x.disconnect(),_==null||_.dispose()}},[]);const p=e&&!l;return o.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--bg-sunken)]",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2",children:[o.jsx("span",{className:te("font-mono text-[11px] tracking-[0.05em]",s?"text-[var(--vow-green)]":"text-[var(--fg-dim)]"),children:s?"● connected":"○ disconnected"}),r&&o.jsx(Ce,{variant:r.active?"warning":"secondary",title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),c&&o.jsxs(nt,{variant:"blocking",className:"m-3 flex flex-col gap-2",children:[o.jsx(It,{className:"text-[var(--break-red)]",children:"Agent panel unavailable"}),o.jsx(at,{className:"font-mono text-xs text-[var(--fg-muted)]",children:c.message}),c.remediation&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:[o.jsx("span",{className:"text-[var(--fg-muted)]",children:"Fix · "}),c.remediation]})]}),o.jsx("div",{ref:t,className:te("w-full flex-1 bg-[var(--bg-sunken)] p-3","min-h-[400px]",p&&"invisible hidden")}),p&&!c&&o.jsx(HM,{})]})}function HM(){return o.jsx("div",{className:"flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6",children:o.jsxs("div",{className:"flex max-w-[34ch] flex-col items-center gap-4 text-center",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:"The agent will come online once harness setup is complete."})]})})}const zM={pluginBuilderUi:!1,embeddedAgent:!1};function Yv(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?zM:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function FM({envelope:e,chainExplorerBase:t}){const r=UM(e),n=$M(e.generatedAt),[s,i]=C.useState("idle"),[l,a]=C.useState(null),c=e.details,p=(typeof(c==null?void 0:c.category)=="string"?c.category:void 0)==="insufficient_funds",u=typeof(c==null?void 0:c.address)=="string"?c.address:null,g=typeof(c==null?void 0:c.requiredWei)=="string"?c.requiredWei:typeof(c==null?void 0:c.needWei)=="string"?c.needWei:null,_=typeof(c==null?void 0:c.haveWei)=="string"?c.haveWei:null,b=(typeof(c==null?void 0:c.txHash)=="string"?c.txHash:null)??r,h=C.useCallback(async()=>{i("retrying"),a(null);try{await he.retryBootstrap(),i("success")}catch(f){i("error"),a(f instanceof Error?f.message:String(f))}},[]);return o.jsxs(nt,{variant:"blocking",className:"flex flex-col gap-3 px-5 py-4",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs(It,{className:"text-[var(--break-red)]",children:["Bootstrap halted · ",e.code]}),n&&o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:n})]}),o.jsx(at,{className:"break-words font-mono text-xs text-foreground",children:e.message}),p&&u&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Iu,{label:"Send ETH to",children:u}),g&&o.jsx(Iu,{label:"Required",children:Qh(g)}),_&&o.jsx(Iu,{label:"Currently have",children:Qh(_)}),g&&_&&o.jsx(Iu,{label:"Shortfall",children:Qh((BigInt(g)-BigInt(_)).toString())})]}),!p&&e.hint&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Fix · "}),e.hint]}),b&&o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"self-start px-0",children:o.jsxs("a",{href:`${t}/tx/${b}`,target:"_blank",rel:"noopener noreferrer",children:["view failed tx",o.jsx(Co,{})]})}),o.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[o.jsx(ie,{variant:"destructive",size:"sm",type:"button",onClick:()=>{h()},disabled:s==="retrying",children:s==="retrying"?"Retrying…":s==="success"?"Resuming…":"Retry"}),s==="success"&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:"Daemon resumed — waiting for bootstrap to complete"}),s==="error"&&l&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:l})]}),s==="idle"&&o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Once you've addressed the cause above, click Retry or"," ",o.jsx("code",{className:"text-[var(--fg-muted)]",children:"jinn run"})," to resume from the persisted state."]})]})}function Iu({label:e,children:t}){return o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]",children:e}),o.jsx("span",{className:"break-all font-mono text-[11px] text-foreground",children:t})]})}function Qh(e){try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-6?`${t} wei`:`${r.toFixed(6).replace(/\.?0+$/,"")} ETH`}catch{return e}}function UM(e){var r,n;const t=[(r=e.details)==null?void 0:r.txHash,(n=e.details)==null?void 0:n.cause,e.message];for(const s of t){if(typeof s!="string")continue;const i=/(0x[a-fA-F0-9]{64})/.exec(s);if(i)return i[1]}return null}function $M(e){try{const t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;const r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const n=Math.round(r/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}catch{return null}}function VM(e,t=globalThis==null?void 0:globalThis.document){const r=nr(e);C.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var qM="DismissableLayer",Ip="dismissableLayer.update",WM="dismissableLayer.pointerDownOutside",GM="dismissableLayer.focusOutside",Zx,TE=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iu=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:a,...c}=e,d=C.useContext(TE),[p,u]=C.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=C.useState({}),x=qe(t,k=>u(k)),b=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),f=b.indexOf(h),m=p?b.indexOf(p):-1,v=d.layersWithOutsidePointerEventsDisabled.size>0,y=m>=f,S=ZM(k=>{const w=k.target,j=[...d.branches].some(R=>R.contains(w));!y||j||(s==null||s(k),l==null||l(k),k.defaultPrevented||a==null||a())},g),E=XM(k=>{const w=k.target;[...d.branches].some(R=>R.contains(w))||(i==null||i(k),l==null||l(k),k.defaultPrevented||a==null||a())},g);return VM(k=>{m===d.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},g),C.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Zx=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Xx(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Zx)}},[p,g,r,d]),C.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Xx())},[p,d]),C.useEffect(()=>{const k=()=>_({});return document.addEventListener(Ip,k),()=>document.removeEventListener(Ip,k)},[]),o.jsx(We.div,{...c,ref:x,style:{pointerEvents:v?y?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,E.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,S.onPointerDownCapture)})});iu.displayName=qM;var KM="DismissableLayerBranch",YM=C.forwardRef((e,t)=>{const r=C.useContext(TE),n=C.useRef(null),s=qe(t,n);return C.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),o.jsx(We.div,{...e,ref:s})});YM.displayName=KM;function ZM(e,t=globalThis==null?void 0:globalThis.document){const r=nr(e),n=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let c=function(){AE(WM,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function XM(e,t=globalThis==null?void 0:globalThis.document){const r=nr(e),n=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!n.current&&AE(GM,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Xx(){const e=new CustomEvent(Ip);document.dispatchEvent(e)}function AE(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?sE(s,i):s.dispatchEvent(i)}var QM=_f[" useId ".trim().toString()]||(()=>{}),JM=0;function Ei(e){const[t,r]=C.useState(QM());return Ts(()=>{r(n=>n??String(JM++))},[e]),t?`radix-${t}`:""}const e3=["top","right","bottom","left"],Oi=Math.min,Pr=Math.max,Xd=Math.round,Hu=Math.floor,Yn=e=>({x:e,y:e}),t3={left:"right",right:"left",bottom:"top",top:"bottom"};function Hp(e,t,r){return Pr(e,Oi(t,r))}function As(e,t){return typeof e=="function"?e(t):e}function Ds(e){return e.split("-")[0]}function bl(e){return e.split("-")[1]}function Zv(e){return e==="x"?"y":"x"}function Xv(e){return e==="y"?"height":"width"}function Gn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Qv(e){return Zv(Gn(e))}function r3(e,t,r){r===void 0&&(r=!1);const n=bl(e),s=Qv(e),i=Xv(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Qd(l)),[l,Qd(l)]}function n3(e){const t=Qd(e);return[zp(e),t,zp(t)]}function zp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Qx=["left","right"],Jx=["right","left"],s3=["top","bottom"],i3=["bottom","top"];function a3(e,t,r){switch(e){case"top":case"bottom":return r?t?Jx:Qx:t?Qx:Jx;case"left":case"right":return t?s3:i3;default:return[]}}function o3(e,t,r,n){const s=bl(e);let i=a3(Ds(e),r==="start",n);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(zp)))),i}function Qd(e){const t=Ds(e);return t3[t]+e.slice(t.length)}function l3(e){return{top:0,right:0,bottom:0,left:0,...e}}function DE(e){return typeof e!="number"?l3(e):{top:e,right:e,bottom:e,left:e}}function Jd(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function eb(e,t,r){let{reference:n,floating:s}=e;const i=Gn(t),l=Qv(t),a=Xv(l),c=Ds(t),d=i==="y",p=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,g=n[a]/2-s[a]/2;let _;switch(c){case"top":_={x:p,y:n.y-s.height};break;case"bottom":_={x:p,y:n.y+n.height};break;case"right":_={x:n.x+n.width,y:u};break;case"left":_={x:n.x-s.width,y:u};break;default:_={x:n.x,y:n.y}}switch(bl(t)){case"start":_[l]-=g*(r&&d?-1:1);break;case"end":_[l]+=g*(r&&d?-1:1);break}return _}async function c3(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:u="floating",altBoundary:g=!1,padding:_=0}=As(t,e),x=DE(_),h=a[g?u==="floating"?"reference":"floating":u],f=Jd(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:c})),m=u==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),y=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},S=Jd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:c}):m);return{top:(f.top-S.top+x.top)/y.y,bottom:(S.bottom-f.bottom+x.bottom)/y.y,left:(f.left-S.left+x.left)/y.x,right:(S.right-f.right+x.right)/y.x}}const u3=50,d3=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:l}=r,a=l.detectOverflow?l:{...l,detectOverflow:c3},c=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:u}=eb(d,n,c),g=n,_=0;const x={};for(let b=0;b<i.length;b++){const h=i[b];if(!h)continue;const{name:f,fn:m}=h,{x:v,y,data:S,reset:E}=await m({x:p,y:u,initialPlacement:n,placement:g,strategy:s,middlewareData:x,rects:d,platform:a,elements:{reference:e,floating:t}});p=v??p,u=y??u,x[f]={...x[f],...S},E&&_<u3&&(_++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(d=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:p,y:u}=eb(d,g,c)),b=-1)}return{x:p,y:u,placement:g,strategy:s,middlewareData:x}},f3=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:l,elements:a,middlewareData:c}=t,{element:d,padding:p=0}=As(e,t)||{};if(d==null)return{};const u=DE(p),g={x:r,y:n},_=Qv(s),x=Xv(_),b=await l.getDimensions(d),h=_==="y",f=h?"top":"left",m=h?"bottom":"right",v=h?"clientHeight":"clientWidth",y=i.reference[x]+i.reference[_]-g[_]-i.floating[x],S=g[_]-i.reference[_],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let k=E?E[v]:0;(!k||!await(l.isElement==null?void 0:l.isElement(E)))&&(k=a.floating[v]||i.floating[x]);const w=y/2-S/2,j=k/2-b[x]/2-1,R=Oi(u[f],j),M=Oi(u[m],j),T=R,O=k-b[x]-M,F=k/2-b[x]/2+w,$=Hp(T,F,O),P=!c.arrow&&bl(s)!=null&&F!==$&&i.reference[x]/2-(F<T?R:M)-b[x]/2<0,U=P?F<T?F-T:F-O:0;return{[_]:g[_]+U,data:{[_]:$,centerOffset:F-$-U,...P&&{alignmentOffset:U}},reset:P}}}),h3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:u=!0,fallbackPlacements:g,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...h}=As(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const f=Ds(s),m=Gn(a),v=Ds(a)===a,y=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=g||(v||!b?[Qd(a)]:n3(a)),E=x!=="none";!g&&E&&S.push(...o3(a,b,x,y));const k=[a,...S],w=await c.detectOverflow(t,h),j=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(p&&j.push(w[f]),u){const F=r3(s,l,y);j.push(w[F[0]],w[F[1]])}if(R=[...R,{placement:s,overflows:j}],!j.every(F=>F<=0)){var M,T;const F=(((M=i.flip)==null?void 0:M.index)||0)+1,$=k[F];if($&&(!(u==="alignment"?m!==Gn($):!1)||R.every(N=>Gn(N.placement)===m?N.overflows[0]>0:!0)))return{data:{index:F,overflows:R},reset:{placement:$}};let P=(T=R.filter(U=>U.overflows[0]<=0).sort((U,N)=>U.overflows[1]-N.overflows[1])[0])==null?void 0:T.placement;if(!P)switch(_){case"bestFit":{var O;const U=(O=R.filter(N=>{if(E){const D=Gn(N.placement);return D===m||D==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(D=>D>0).reduce((D,L)=>D+L,0)]).sort((N,D)=>N[1]-D[1])[0])==null?void 0:O[0];U&&(P=U);break}case"initialPlacement":P=a;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function tb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rb(e){return e3.some(t=>e[t]>=0)}const m3=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...i}=As(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=tb(l,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rb(a)}}}case"escaped":{const l=await n.detectOverflow(t,{...i,altBoundary:!0}),a=tb(l,r.floating);return{data:{escapedOffsets:a,escaped:rb(a)}}}default:return{}}}}},OE=new Set(["left","top"]);async function p3(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=Ds(r),a=bl(r),c=Gn(r)==="y",d=OE.has(l)?-1:1,p=i&&c?-1:1,u=As(t,e);let{mainAxis:g,crossAxis:_,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof x=="number"&&(_=a==="end"?x*-1:x),c?{x:_*p,y:g*d}:{x:g*d,y:_*p}}const g3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:l,middlewareData:a}=t,c=await p3(t,e);return l===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:l}}}}},v3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:c={fn:f=>{let{x:m,y:v}=f;return{x:m,y:v}}},...d}=As(e,t),p={x:r,y:n},u=await i.detectOverflow(t,d),g=Gn(Ds(s)),_=Zv(g);let x=p[_],b=p[g];if(l){const f=_==="y"?"top":"left",m=_==="y"?"bottom":"right",v=x+u[f],y=x-u[m];x=Hp(v,x,y)}if(a){const f=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=b+u[f],y=b-u[m];b=Hp(v,b,y)}const h=c.fn({...t,[_]:x,[g]:b});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[_]:l,[g]:a}}}}}},_3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=As(e,t),p={x:r,y:n},u=Gn(s),g=Zv(u);let _=p[g],x=p[u];const b=As(a,t),h=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const v=g==="y"?"height":"width",y=i.reference[g]-i.floating[v]+h.mainAxis,S=i.reference[g]+i.reference[v]-h.mainAxis;_<y?_=y:_>S&&(_=S)}if(d){var f,m;const v=g==="y"?"width":"height",y=OE.has(Ds(s)),S=i.reference[u]-i.floating[v]+(y&&((f=l.offset)==null?void 0:f[u])||0)+(y?0:h.crossAxis),E=i.reference[u]+i.reference[v]+(y?0:((m=l.offset)==null?void 0:m[u])||0)-(y?h.crossAxis:0);x<S?x=S:x>E&&(x=E)}return{[g]:_,[u]:x}}}},y3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:l,elements:a}=t,{apply:c=()=>{},...d}=As(e,t),p=await l.detectOverflow(t,d),u=Ds(s),g=bl(s),_=Gn(s)==="y",{width:x,height:b}=i.floating;let h,f;u==="top"||u==="bottom"?(h=u,f=g===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(f=u,h=g==="end"?"top":"bottom");const m=b-p.top-p.bottom,v=x-p.left-p.right,y=Oi(b-p[h],m),S=Oi(x-p[f],v),E=!t.middlewareData.shift;let k=y,w=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(w=v),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=m),E&&!g){const R=Pr(p.left,0),M=Pr(p.right,0),T=Pr(p.top,0),O=Pr(p.bottom,0);_?w=x-2*(R!==0||M!==0?R+M:Pr(p.left,p.right)):k=b-2*(T!==0||O!==0?T+O:Pr(p.top,p.bottom))}await c({...t,availableWidth:w,availableHeight:k});const j=await l.getDimensions(a.floating);return x!==j.width||b!==j.height?{reset:{rects:!0}}:{}}}};function $f(){return typeof window<"u"}function Sl(e){return ME(e)?(e.nodeName||"").toLowerCase():"#document"}function $r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ts(e){var t;return(t=(ME(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ME(e){return $f()?e instanceof Node||e instanceof $r(e).Node:!1}function Dn(e){return $f()?e instanceof Element||e instanceof $r(e).Element:!1}function Ps(e){return $f()?e instanceof HTMLElement||e instanceof $r(e).HTMLElement:!1}function nb(e){return!$f()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $r(e).ShadowRoot}function au(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=On(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function x3(e){return/^(table|td|th)$/.test(Sl(e))}function Vf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const b3=/transform|translate|scale|rotate|perspective|filter/,S3=/paint|layout|strict|content/,qi=e=>!!e&&e!=="none";let Jh;function Jv(e){const t=Dn(e)?On(e):e;return qi(t.transform)||qi(t.translate)||qi(t.scale)||qi(t.rotate)||qi(t.perspective)||!e_()&&(qi(t.backdropFilter)||qi(t.filter))||b3.test(t.willChange||"")||S3.test(t.contain||"")}function w3(e){let t=Mi(e);for(;Ps(t)&&!nl(t);){if(Jv(t))return t;if(Vf(t))return null;t=Mi(t)}return null}function e_(){return Jh==null&&(Jh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Jh}function nl(e){return/^(html|body|#document)$/.test(Sl(e))}function On(e){return $r(e).getComputedStyle(e)}function qf(e){return Dn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mi(e){if(Sl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nb(e)&&e.host||ts(e);return nb(t)?t.host:t}function LE(e){const t=Mi(e);return nl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ps(t)&&au(t)?t:LE(t)}function Oc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=LE(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),l=$r(s);if(i){const a=Fp(l);return t.concat(l,l.visualViewport||[],au(s)?s:[],a&&r?Oc(a):[])}else return t.concat(s,Oc(s,[],r))}function Fp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PE(e){const t=On(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Ps(e),i=s?e.offsetWidth:r,l=s?e.offsetHeight:n,a=Xd(r)!==i||Xd(n)!==l;return a&&(r=i,n=l),{width:r,height:n,$:a}}function t_(e){return Dn(e)?e:e.contextElement}function jo(e){const t=t_(e);if(!Ps(t))return Yn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=PE(t);let l=(i?Xd(r.width):r.width)/n,a=(i?Xd(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const C3=Yn(0);function BE(e){const t=$r(e);return!e_()||!t.visualViewport?C3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function E3(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$r(e)?!1:t}function wa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=t_(e);let l=Yn(1);t&&(n?Dn(n)&&(l=jo(n)):l=jo(e));const a=E3(i,r,n)?BE(i):Yn(0);let c=(s.left+a.x)/l.x,d=(s.top+a.y)/l.y,p=s.width/l.x,u=s.height/l.y;if(i){const g=$r(i),_=n&&Dn(n)?$r(n):n;let x=g,b=Fp(x);for(;b&&n&&_!==x;){const h=jo(b),f=b.getBoundingClientRect(),m=On(b),v=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*h.x,y=f.top+(b.clientTop+parseFloat(m.paddingTop))*h.y;c*=h.x,d*=h.y,p*=h.x,u*=h.y,c+=v,d+=y,x=$r(b),b=Fp(x)}}return Jd({width:p,height:u,x:c,y:d})}function Wf(e,t){const r=qf(e).scrollLeft;return t?t.left+r:wa(ts(e)).left+r}function IE(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Wf(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function j3(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",l=ts(n),a=t?Vf(t.floating):!1;if(n===l||a&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Yn(1);const p=Yn(0),u=Ps(n);if((u||!u&&!i)&&((Sl(n)!=="body"||au(l))&&(c=qf(n)),u)){const _=wa(n);d=jo(n),p.x=_.x+n.clientLeft,p.y=_.y+n.clientTop}const g=l&&!u&&!i?IE(l,c):Yn(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+p.x+g.x,y:r.y*d.y-c.scrollTop*d.y+p.y+g.y}}function k3(e){return Array.from(e.getClientRects())}function R3(e){const t=ts(e),r=qf(e),n=e.ownerDocument.body,s=Pr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Pr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Wf(e);const a=-r.scrollTop;return On(n).direction==="rtl"&&(l+=Pr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:l,y:a}}const sb=25;function N3(e,t){const r=$r(e),n=ts(e),s=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;const p=e_();(!p||p&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const d=Wf(n);if(d<=0){const p=n.ownerDocument,u=p.body,g=getComputedStyle(u),_=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(n.clientWidth-u.clientWidth-_);x<=sb&&(i-=x)}else d<=sb&&(i+=d);return{width:i,height:l,x:a,y:c}}function T3(e,t){const r=wa(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=Ps(e)?jo(e):Yn(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,d=n*i.y;return{width:l,height:a,x:c,y:d}}function ib(e,t,r){let n;if(t==="viewport")n=N3(e,r);else if(t==="document")n=R3(ts(e));else if(Dn(t))n=T3(t,r);else{const s=BE(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Jd(n)}function HE(e,t){const r=Mi(e);return r===t||!Dn(r)||nl(r)?!1:On(r).position==="fixed"||HE(r,t)}function A3(e,t){const r=t.get(e);if(r)return r;let n=Oc(e,[],!1).filter(a=>Dn(a)&&Sl(a)!=="body"),s=null;const i=On(e).position==="fixed";let l=i?Mi(e):e;for(;Dn(l)&&!nl(l);){const a=On(l),c=Jv(l);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||au(l)&&!c&&HE(e,l))?n=n.filter(p=>p!==l):s=a,l=Mi(l)}return t.set(e,n),n}function D3(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?Vf(t)?[]:A3(t,this._c):[].concat(r),n],a=ib(t,l[0],s);let c=a.top,d=a.right,p=a.bottom,u=a.left;for(let g=1;g<l.length;g++){const _=ib(t,l[g],s);c=Pr(_.top,c),d=Oi(_.right,d),p=Oi(_.bottom,p),u=Pr(_.left,u)}return{width:d-u,height:p-c,x:u,y:c}}function O3(e){const{width:t,height:r}=PE(e);return{width:t,height:r}}function M3(e,t,r){const n=Ps(t),s=ts(t),i=r==="fixed",l=wa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Yn(0);function d(){c.x=Wf(s)}if(n||!n&&!i)if((Sl(t)!=="body"||au(s))&&(a=qf(t)),n){const _=wa(t,!0,i,t);c.x=_.x+t.clientLeft,c.y=_.y+t.clientTop}else s&&d();i&&!n&&s&&d();const p=s&&!n&&!i?IE(s,a):Yn(0),u=l.left+a.scrollLeft-c.x-p.x,g=l.top+a.scrollTop-c.y-p.y;return{x:u,y:g,width:l.width,height:l.height}}function em(e){return On(e).position==="static"}function ab(e,t){if(!Ps(e)||On(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ts(e)===r&&(r=r.ownerDocument.body),r}function zE(e,t){const r=$r(e);if(Vf(e))return r;if(!Ps(e)){let s=Mi(e);for(;s&&!nl(s);){if(Dn(s)&&!em(s))return s;s=Mi(s)}return r}let n=ab(e,t);for(;n&&x3(n)&&em(n);)n=ab(n,t);return n&&nl(n)&&em(n)&&!Jv(n)?r:n||w3(e)||r}const L3=async function(e){const t=this.getOffsetParent||zE,r=this.getDimensions,n=await r(e.floating);return{reference:M3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function P3(e){return On(e).direction==="rtl"}const B3={convertOffsetParentRelativeRectToViewportRelativeRect:j3,getDocumentElement:ts,getClippingRect:D3,getOffsetParent:zE,getElementRects:L3,getClientRects:k3,getDimensions:O3,getScale:jo,isElement:Dn,isRTL:P3};function FE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function I3(e,t){let r=null,n;const s=ts(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:p,top:u,width:g,height:_}=d;if(a||t(),!g||!_)return;const x=Hu(u),b=Hu(s.clientWidth-(p+g)),h=Hu(s.clientHeight-(u+_)),f=Hu(p),v={rootMargin:-x+"px "+-b+"px "+-h+"px "+-f+"px",threshold:Pr(0,Oi(1,c))||1};let y=!0;function S(E){const k=E[0].intersectionRatio;if(k!==c){if(!y)return l();k?l(!1,k):n=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!FE(d,e.getBoundingClientRect())&&l(),y=!1}try{r=new IntersectionObserver(S,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,v)}r.observe(e)}return l(!0),i}function H3(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=t_(e),p=s||i?[...d?Oc(d):[],...t?Oc(t):[]]:[];p.forEach(f=>{s&&f.addEventListener("scroll",r,{passive:!0}),i&&f.addEventListener("resize",r)});const u=d&&a?I3(d,r):null;let g=-1,_=null;l&&(_=new ResizeObserver(f=>{let[m]=f;m&&m.target===d&&_&&t&&(_.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=_)==null||v.observe(t)})),r()}),d&&!c&&_.observe(d),t&&_.observe(t));let x,b=c?wa(e):null;c&&h();function h(){const f=wa(e);b&&!FE(b,f)&&r(),b=f,x=requestAnimationFrame(h)}return r(),()=>{var f;p.forEach(m=>{s&&m.removeEventListener("scroll",r),i&&m.removeEventListener("resize",r)}),u==null||u(),(f=_)==null||f.disconnect(),_=null,c&&cancelAnimationFrame(x)}}const z3=g3,F3=v3,U3=h3,$3=y3,V3=m3,ob=f3,q3=_3,W3=(e,t,r)=>{const n=new Map,s={platform:B3,...r},i={...s.platform,_c:n};return d3(e,t,{...s,platform:i})};var G3=typeof document<"u",K3=function(){},hd=G3?C.useLayoutEffect:K3;function ef(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ef(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!ef(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function UE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lb(e,t){const r=UE(e);return Math.round(t*r)/r}function tm(e){const t=C.useRef(e);return hd(()=>{t.current=e}),t}function Y3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:c,open:d}=e,[p,u]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,_]=C.useState(n);ef(g,n)||_(n);const[x,b]=C.useState(null),[h,f]=C.useState(null),m=C.useCallback(N=>{N!==E.current&&(E.current=N,b(N))},[]),v=C.useCallback(N=>{N!==k.current&&(k.current=N,f(N))},[]),y=i||x,S=l||h,E=C.useRef(null),k=C.useRef(null),w=C.useRef(p),j=c!=null,R=tm(c),M=tm(s),T=tm(d),O=C.useCallback(()=>{if(!E.current||!k.current)return;const N={placement:t,strategy:r,middleware:g};M.current&&(N.platform=M.current),W3(E.current,k.current,N).then(D=>{const L={...D,isPositioned:T.current!==!1};F.current&&!ef(w.current,L)&&(w.current=L,bf.flushSync(()=>{u(L)}))})},[g,t,r,M,T]);hd(()=>{d===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[d]);const F=C.useRef(!1);hd(()=>(F.current=!0,()=>{F.current=!1}),[]),hd(()=>{if(y&&(E.current=y),S&&(k.current=S),y&&S){if(R.current)return R.current(y,S,O);O()}},[y,S,O,R,j]);const $=C.useMemo(()=>({reference:E,floating:k,setReference:m,setFloating:v}),[m,v]),P=C.useMemo(()=>({reference:y,floating:S}),[y,S]),U=C.useMemo(()=>{const N={position:r,left:0,top:0};if(!P.floating)return N;const D=lb(P.floating,p.x),L=lb(P.floating,p.y);return a?{...N,transform:"translate("+D+"px, "+L+"px)",...UE(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:L}},[r,a,P.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:O,refs:$,elements:P,floatingStyles:U}),[p,O,$,P,U])}const Z3=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ob({element:n.current,padding:s}).fn(r):{}:n?ob({element:n,padding:s}).fn(r):{}}}},X3=(e,t)=>{const r=z3(e);return{name:r.name,fn:r.fn,options:[e,t]}},Q3=(e,t)=>{const r=F3(e);return{name:r.name,fn:r.fn,options:[e,t]}},J3=(e,t)=>({fn:q3(e).fn,options:[e,t]}),e5=(e,t)=>{const r=U3(e);return{name:r.name,fn:r.fn,options:[e,t]}},t5=(e,t)=>{const r=$3(e);return{name:r.name,fn:r.fn,options:[e,t]}},r5=(e,t)=>{const r=V3(e);return{name:r.name,fn:r.fn,options:[e,t]}},n5=(e,t)=>{const r=Z3(e);return{name:r.name,fn:r.fn,options:[e,t]}};var s5="Arrow",$E=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return o.jsx(We.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});$E.displayName=s5;var i5=$E;function VE(e){const[t,r]=C.useState(void 0);return Ts(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,a;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;l=d.inlineSize,a=d.blockSize}else l=e.offsetWidth,a=e.offsetHeight;r({width:l,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var r_="Popper",[qE,wl]=Ln(r_),[a5,WE]=qE(r_),GE=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return o.jsx(a5,{scope:t,anchor:n,onAnchorChange:s,children:r})};GE.displayName=r_;var KE="PopperAnchor",YE=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=WE(KE,r),l=C.useRef(null),a=qe(t,l),c=C.useRef(null);return C.useEffect(()=>{const d=c.current;c.current=(n==null?void 0:n.current)||l.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:o.jsx(We.div,{...s,ref:a})});YE.displayName=KE;var n_="PopperContent",[o5,l5]=qE(n_),ZE=C.forwardRef((e,t)=>{var A,H,G,Y,ce,K;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:u="partial",hideWhenDetached:g=!1,updatePositionStrategy:_="optimized",onPlaced:x,...b}=e,h=WE(n_,r),[f,m]=C.useState(null),v=qe(t,pe=>m(pe)),[y,S]=C.useState(null),E=VE(y),k=(E==null?void 0:E.width)??0,w=(E==null?void 0:E.height)??0,j=n+(i!=="center"?"-"+i:""),R=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(d)?d:[d],T=M.length>0,O={padding:R,boundary:M.filter(u5),altBoundary:T},{refs:F,floatingStyles:$,placement:P,isPositioned:U,middlewareData:N}=Y3({strategy:"fixed",placement:j,whileElementsMounted:(...pe)=>H3(...pe,{animationFrame:_==="always"}),elements:{reference:h.anchor},middleware:[X3({mainAxis:s+w,alignmentAxis:l}),c&&Q3({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?J3():void 0,...O}),c&&e5({...O}),t5({...O,apply:({elements:pe,rects:Me,availableWidth:Ke,availableHeight:Ht})=>{const{width:Se,height:Zr}=Me.reference,xt=pe.floating.style;xt.setProperty("--radix-popper-available-width",`${Ke}px`),xt.setProperty("--radix-popper-available-height",`${Ht}px`),xt.setProperty("--radix-popper-anchor-width",`${Se}px`),xt.setProperty("--radix-popper-anchor-height",`${Zr}px`)}}),y&&n5({element:y,padding:a}),d5({arrowWidth:k,arrowHeight:w}),g&&r5({strategy:"referenceHidden",...O})]}),[D,L]=JE(P),I=nr(x);Ts(()=>{U&&(I==null||I())},[U,I]);const Q=(A=N.arrow)==null?void 0:A.x,q=(H=N.arrow)==null?void 0:H.y,J=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[Z,me]=C.useState();return Ts(()=>{f&&me(window.getComputedStyle(f).zIndex)},[f]),o.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(Y=N.transformOrigin)==null?void 0:Y.x,(ce=N.transformOrigin)==null?void 0:ce.y].join(" "),...((K=N.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(o5,{scope:r,placedSide:D,onArrowChange:S,arrowX:Q,arrowY:q,shouldHideArrow:J,children:o.jsx(We.div,{"data-side":D,"data-align":L,...b,ref:v,style:{...b.style,animation:U?void 0:"none"}})})})});ZE.displayName=n_;var XE="PopperArrow",c5={top:"bottom",right:"left",bottom:"top",left:"right"},QE=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=l5(XE,n),l=c5[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(i5,{...s,ref:r,style:{...s.style,display:"block"}})})});QE.displayName=XE;function u5(e){return e!==null}var d5=e=>({name:"transformOrigin",options:e,fn(t){var h,f,m;const{placement:r,rects:n,middlewareData:s}=t,l=((h=s.arrow)==null?void 0:h.centerOffset)!==0,a=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[d,p]=JE(r),u={start:"0%",center:"50%",end:"100%"}[p],g=(((f=s.arrow)==null?void 0:f.x)??0)+a/2,_=(((m=s.arrow)==null?void 0:m.y)??0)+c/2;let x="",b="";return d==="bottom"?(x=l?u:`${g}px`,b=`${-c}px`):d==="top"?(x=l?u:`${g}px`,b=`${n.floating.height+c}px`):d==="right"?(x=`${-c}px`,b=l?u:`${_}px`):d==="left"&&(x=`${n.floating.width+c}px`,b=l?u:`${_}px`),{data:{x,y:b}}}});function JE(e){const[t,r="center"]=e.split("-");return[t,r]}var s_=GE,Gf=YE,i_=ZE,a_=QE,f5="Portal",ou=C.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=C.useState(!1);Ts(()=>i(!0),[]);const l=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?NS.createPortal(o.jsx(We.div,{...n,ref:t}),l):null});ou.displayName=f5;var h5=Symbol("radix.slottable");function m5(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=h5,t}var p5=_f[" useInsertionEffect ".trim().toString()]||Ts;function Cl({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,l]=g5({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:s;{const p=C.useRef(e!==void 0);C.useEffect(()=>{const u=p.current;u!==a&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=a},[a,n])}const d=C.useCallback(p=>{var u;if(a){const g=v5(p)?p(e):p;g!==e&&((u=l.current)==null||u.call(l,g))}else i(p)},[a,e,i,l]);return[c,d]}function g5({defaultProp:e,onChange:t}){const[r,n]=C.useState(e),s=C.useRef(r),i=C.useRef(t);return p5(()=>{i.current=t},[t]),C.useEffect(()=>{var l;s.current!==r&&((l=i.current)==null||l.call(i,r),s.current=r)},[r,s]),[r,n,i]}function v5(e){return typeof e=="function"}var _5=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),y5="VisuallyHidden",ej=C.forwardRef((e,t)=>o.jsx(We.span,{...e,ref:t,style:{..._5,...e.style}}));ej.displayName=y5;var x5=ej,[Kf]=Ln("Tooltip",[wl]),Yf=wl(),tj="TooltipProvider",b5=700,Up="tooltip.open",[S5,o_]=Kf(tj),rj=e=>{const{__scopeTooltip:t,delayDuration:r=b5,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,l=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(S5,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),l.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(d=>{a.current=d},[]),disableHoverableContent:s,children:i})};rj.displayName=tj;var Mc="Tooltip",[w5,lu]=Kf(Mc),nj=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,c=o_(Mc,e.__scopeTooltip),d=Yf(t),[p,u]=C.useState(null),g=Ei(),_=C.useRef(0),x=l??c.disableHoverableContent,b=a??c.delayDuration,h=C.useRef(!1),[f,m]=Cl({prop:n,defaultProp:s??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(Up))):c.onClose(),i==null||i(k)},caller:Mc}),v=C.useMemo(()=>f?h.current?"delayed-open":"instant-open":"closed",[f]),y=C.useCallback(()=>{window.clearTimeout(_.current),_.current=0,h.current=!1,m(!0)},[m]),S=C.useCallback(()=>{window.clearTimeout(_.current),_.current=0,m(!1)},[m]),E=C.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{h.current=!0,m(!0),_.current=0},b)},[b,m]);return C.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),o.jsx(s_,{...d,children:o.jsx(w5,{scope:t,contentId:g,open:f,stateAttribute:v,trigger:p,onTriggerChange:u,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?E():y()},[c.isOpenDelayedRef,E,y]),onTriggerLeave:C.useCallback(()=>{x?S():(window.clearTimeout(_.current),_.current=0)},[S,x]),onOpen:y,onClose:S,disableHoverableContent:x,children:r})})};nj.displayName=Mc;var $p="TooltipTrigger",sj=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=lu($p,r),i=o_($p,r),l=Yf(r),a=C.useRef(null),c=qe(t,a,s.onTriggerChange),d=C.useRef(!1),p=C.useRef(!1),u=C.useCallback(()=>d.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),o.jsx(Gf,{asChild:!0,...l,children:o.jsx(We.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:_e(e.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:_e(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:_e(e.onBlur,s.onClose),onClick:_e(e.onClick,s.onClose)})})});sj.displayName=$p;var l_="TooltipPortal",[C5,E5]=Kf(l_,{forceMount:void 0}),ij=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,i=lu(l_,t);return o.jsx(C5,{scope:t,forceMount:r,children:o.jsx(ar,{present:r||i.open,children:o.jsx(ou,{asChild:!0,container:s,children:n})})})};ij.displayName=l_;var sl="TooltipContent",aj=C.forwardRef((e,t)=>{const r=E5(sl,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,l=lu(sl,e.__scopeTooltip);return o.jsx(ar,{present:n||l.open,children:l.disableHoverableContent?o.jsx(oj,{side:s,...i,ref:t}):o.jsx(j5,{side:s,...i,ref:t})})}),j5=C.forwardRef((e,t)=>{const r=lu(sl,e.__scopeTooltip),n=o_(sl,e.__scopeTooltip),s=C.useRef(null),i=qe(t,s),[l,a]=C.useState(null),{trigger:c,onClose:d}=r,p=s.current,{onPointerInTransitChange:u}=n,g=C.useCallback(()=>{a(null),u(!1)},[u]),_=C.useCallback((x,b)=>{const h=x.currentTarget,f={x:x.clientX,y:x.clientY},m=A5(f,h.getBoundingClientRect()),v=D5(f,m),y=O5(b.getBoundingClientRect()),S=L5([...v,...y]);a(S),u(!0)},[u]);return C.useEffect(()=>()=>g(),[g]),C.useEffect(()=>{if(c&&p){const x=h=>_(h,p),b=h=>_(h,c);return c.addEventListener("pointerleave",x),p.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",b)}}},[c,p,_,g]),C.useEffect(()=>{if(l){const x=b=>{const h=b.target,f={x:b.clientX,y:b.clientY},m=(c==null?void 0:c.contains(h))||(p==null?void 0:p.contains(h)),v=!M5(f,l);m?g():v&&(g(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,p,l,d,g]),o.jsx(oj,{...e,ref:i})}),[k5,R5]=Kf(Mc,{isInside:!1}),N5=m5("TooltipContent"),oj=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,c=lu(sl,r),d=Yf(r),{onClose:p}=c;return C.useEffect(()=>(document.addEventListener(Up,p),()=>document.removeEventListener(Up,p)),[p]),C.useEffect(()=>{if(c.trigger){const u=g=>{const _=g.target;_!=null&&_.contains(c.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,p]),o.jsx(iu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u=>u.preventDefault(),onDismiss:p,children:o.jsxs(i_,{"data-state":c.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(N5,{children:n}),o.jsx(k5,{scope:r,isInside:!0,children:o.jsx(x5,{id:c.contentId,role:"tooltip",children:s||n})})]})})});aj.displayName=sl;var lj="TooltipArrow",T5=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Yf(r);return R5(lj,r).isInside?null:o.jsx(a_,{...s,...n,ref:t})});T5.displayName=lj;function A5(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function D5(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function O5(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function M5(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],d=a.x,p=a.y,u=c.x,g=c.y;p>n!=g>n&&r<(u-d)*(n-p)/(g-p)+d&&(s=!s)}return s}function L5(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),P5(t)}function P5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],l=r[r.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var B5=rj,I5=nj,H5=sj,z5=ij,cj=aj;const ln=B5,Tn=I5,An=H5,dn=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(z5,{children:o.jsx(cj,{ref:n,sideOffset:t,className:te("z-50 overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1.5 font-mono text-[11px] text-popover-foreground shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));dn.displayName=cj.displayName;function F5({chain:e}){const t=e==="base";return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ce,{variant:t?"secondary":"outline",children:"Testnet"}),o.jsx(ln,{delayDuration:120,children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{children:o.jsx(Ce,{variant:"secondary",className:"border-dashed border-border opacity-60",children:"Mainnet · soon"})})}),o.jsx(dn,{children:"Mainnet support is coming. v1 supports testnet only."})]})})]})}function U5({status:e}){return e==="done"?o.jsxs(Ce,{variant:"success",className:"gap-1.5",children:[o.jsx(VD,{className:"h-3 w-3"}),"Done"]}):e==="error"?o.jsxs(Ce,{variant:"destructive",className:"gap-1.5",children:[o.jsx(Bv,{className:"h-3 w-3"}),"Failed"]}):e==="active"?o.jsxs(Ce,{variant:"warning",className:"gap-2",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]"}),"Active"]}):o.jsx(Ce,{variant:"secondary",children:"Queued"})}const $5={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function V5({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",i=t==="done",l=n||s,a=s?"text-[var(--break-red)]":n?"text-[var(--accent-gold)]":i?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]",c=s||n?"text-foreground":i?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]",d=l?"font-serif text-[28px] leading-[1.2]":"font-mono text-[14px] leading-[1.2]";return o.jsxs("li",{className:"phase-row border-t border-border","data-status":t,"data-testid":`onboarding-phase-${e}`,children:[o.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[o.jsx("span",{className:te("font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200",a),children:String(e).padStart(2,"0")}),o.jsx("span",{className:te(d,c,"transition-colors duration-200"),children:$5[e]}),o.jsx(U5,{status:t})]}),l&&r&&o.jsx("div",{className:"jinn-anim-fade-slide ml-12 pb-5 pr-2",children:r})]})}function q5({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:i,contractRevertReason:l}){const a=!!l;return o.jsxs("div",{className:te("flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3",a?"border-[var(--break-red)]":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:te("jinn-anim-pulse h-1.5 w-1.5 rounded-full",a?"bg-[var(--break-red)]":"bg-[var(--accent-sky)]")}),o.jsx("span",{className:"font-mono text-sm text-foreground",children:e}),o.jsx("span",{className:te("ml-auto font-mono text-[10px]",a?"text-[var(--break-red)]":"text-[var(--fg-dim)]"),children:a?"binding failed · will retry":"running · no action needed"})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-1 font-mono text-[11px] text-[var(--fg-muted)] md:grid-cols-[120px_1fr]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Current step"}),o.jsx("span",{children:W5(t)}),r!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Service"}),o.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Safe"}),o.jsx("a",{href:`${i}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"break-all text-[var(--accent-sky)] hover:underline",children:s})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Contract revert reason"}),o.jsx("code",{className:"break-words text-xs text-[var(--break-red)]",children:l})]})]})]})}function W5(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const G5={wallet:{phase:1,subState:null},safe_predicted:{phase:1,subState:null},awaiting_funding:{phase:2,subState:null},safe_deployed:{phase:3,subState:"Deploying"},service_created:{phase:3,subState:"Deploying"},service_activated:{phase:3,subState:"Deploying"},agents_registered:{phase:3,subState:"Deploying"},service_deployed:{phase:3,subState:"Deploying"},service_staked:{phase:3,subState:"Deploying"},staked:{phase:3,subState:"Deploying"},mech_deployed:{phase:3,subState:"Joining the network"},agent_registered:{phase:3,subState:"Joining the network"},safe_binding_pending:{phase:3,subState:"Binding identity"}};function K5(e){return G5[e]??{phase:1,subState:null}}function Y5(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}const Z5="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]";function X5(){var p;const{data:e,isLoading:t}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:2e3});if(t||!e)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:s,subState:i}=K5(e.currentStep),l=e.error,a=e.services.find(u=>u.step===e.currentStep)??e.services[0],c=(p=e.funding)==null?void 0:p.targetMet,d=Yv().embeddedAgent;return o.jsx("div",{className:"min-h-screen w-full bg-background text-foreground",children:o.jsxs("div",{className:"mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10",children:[o.jsxs("section",{className:te("col-span-12 flex flex-col gap-8",d&&"lg:col-span-7"),children:[o.jsxs("header",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:Z5,children:"Jinn · Onboarding"}),o.jsx(F5,{chain:e.chain})]}),o.jsx("h1",{className:"font-serif text-[76px] leading-[1.05] text-foreground",children:"Welcome to Jinn."}),o.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":"onboarding-progress","aria-label":"Onboarding progress",children:[o.jsx(Kv,{value:Math.min(100,(s-1)/2*100+(s===3?33:0))}),o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:["Phase ",s," of 3"]})]}),o.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(u=>{var x;const g=Y5(u,s,c),_=l&&u===s;return o.jsxs(V5,{phase:u,status:_?"error":g,children:[_&&o.jsx(FM,{envelope:l,chainExplorerBase:r}),!_&&u===2&&g==="active"&&n&&o.jsx(OM,{address:n,minimumWei:((x=e.funding)==null?void 0:x.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!_&&u===3&&g==="active"&&o.jsx(q5,{label:i??"Working",step:e.currentStep,serviceIndex:a==null?void 0:a.index,serviceId:a==null?void 0:a.service_id,safeAddress:a==null?void 0:a.safe_address,explorer:r,contractRevertReason:(a==null?void 0:a.error_revert_reason)??null})]},u)})})]}),d&&o.jsxs("aside",{className:"col-span-12 flex flex-col gap-3 lg:col-span-5",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Ask Claude"}),o.jsx(be,{className:"h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0",children:o.jsx(NE,{agentGated:!1})})]})]})})}const Q5="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",J5="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function eL({connection:e}){const[t,r]=C.useState(!1);return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground","data-testid":"daemon-offline-screen",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:Q5,children:"Jinn · offline"}),o.jsx("h1",{className:J5,children:"Daemon not running."}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:"Open a terminal and run:"}),o.jsx("code",{className:"self-start rounded bg-[var(--bg-elevated)] px-2 py-1 font-mono text-sm text-foreground",children:"jinn run"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:"(or the command you originally used to start it)"})]}),o.jsxs("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:["Reconnecting…",e.attempts>0&&o.jsxs("span",{className:"ml-1 text-[var(--fg-dim)]",children:["(attempt ",e.attempts,")"]})]}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(n=>!n),"aria-expanded":t,children:[t?o.jsx(Pv,{}):o.jsx(Hf,{}),t?"Hide details":"Show details"]}),t&&e.lastError&&o.jsx(be,{className:"bg-[var(--bg-elevated)]",children:o.jsx(et,{className:"px-3 py-2",children:o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:e.lastError})})})]})})}const tL={blocking:"border-l-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)]",warning:"border-l-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)]",info:"border-l-[var(--severity-info-fg)]"},rL={blocking:"text-[var(--severity-blocking-fg)]",warning:"text-[var(--severity-warning-fg)]",info:"text-[var(--severity-info-fg)]"};function nL({notice:e}){return o.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:te("flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground",tL[e.severity]),children:[o.jsx("span",{"aria-hidden":"true",className:te("min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]",rL[e.severity]),children:e.severity}),o.jsx("span",{className:"flex-1",children:e.message}),e.jumpTo?o.jsx(Cr,{href:e.jumpTo,className:"font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]",children:"resolve →"}):null]})}function sL({notices:e}){return e.length===0?null:o.jsx("section",{"aria-label":"Notifications",role:"region",children:o.jsx("ul",{className:"m-0 list-none p-0",children:e.map((t,r)=>o.jsx(nL,{notice:t},`${t.kind}-${r}`))})})}const uj=C.createContext({restartPending:!1,setRestartPending:()=>{}});function iL(){return C.useContext(uj)}const aL=3,oL=1e3*60*60*24*90;function lL(e){const t=[],r=e.status;if(e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<aL&&t.push({kind:"funding_low",severity:"warning",message:`Runway is ${r.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:"/overview"}),!r.harness.ready){const n=r.harness.name===null?"A harness":`Harness ${r.harness.name}`,s=r.harness.reason?`: ${r.harness.reason}`:"";t.push({kind:"harness_not_ready",severity:"blocking",message:`${n} is not ready${s}.`,jumpTo:"/operator/memberships"})}return r.rpc.reachable||t.push({kind:"rpc_unreachable",severity:"blocking",message:"RPC endpoint is unreachable.",jumpTo:"/operator/network"}),Object.keys(r.joinedSolverNets).length===0&&e.bootstrap.mode==="running"&&t.push({kind:"no_solvernets_joined",severity:"info",message:"No SolverNets joined. Browse the registry to start earning.",jumpTo:"/operator/registry"}),r.services.some(n=>!n.safeBound)&&t.push({kind:"safe_binding_pending",severity:"warning",message:"Safe wallet binding is pending.",jumpTo:"/overview"}),r.restartPending&&t.push({kind:"restart_required",severity:"warning",message:"A configuration change is pending — restart to apply.",jumpTo:"/overview"}),r.latestVersion&&r.latestVersion!==r.daemonVersion&&t.push({kind:"update_available",severity:"info",message:`Daemon ${r.latestVersion} available (running ${r.daemonVersion}).`}),r.passwordRotatedAt&&(e.now??Date.now())-new Date(r.passwordRotatedAt).getTime()>oL&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),t}const cb={blocking:0,warning:1,info:2},cL=30*60*1e3,uL=60*1e3,dL=["intent"];function fL(e,t,r){var p,u,g,_,x;const n=e??{},s=t??{},i=String(((p=n.masterGas)==null?void 0:p.balanceWei)??"0");let l="0",a=Number.POSITIVE_INFINITY;try{const b=BigInt(i);l=b.toString(),a=b>0n?Number.POSITIVE_INFINITY:0}catch{}const c=Array.isArray((u=n.fleet)==null?void 0:u.services)?n.fleet.services:[],d=s.joinedSolverNets&&typeof s.joinedSolverNets=="object"?s.joinedSolverNets:{};return{funds:{eth:l,runwayDays:a},harness:{ready:((g=n.harness)==null?void 0:g.ready)!==!1,name:typeof((_=n.harness)==null?void 0:_.name)=="string"?n.harness.name:null,reason:typeof((x=n.harness)==null?void 0:x.reason)=="string"?n.harness.reason:null},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:c.map(b=>({safeBound:(b==null?void 0:b.safeBoundToAgent)!==!1})),joinedSolverNets:d,passwordRotatedAt:void 0}}function hL(){const e=$C(),{restartPending:t}=iL(),r=Oe({queryKey:["status"],queryFn:()=>he.getStatus()}),n=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap()}),{events:s}=KC(dL),[i,l]=C.useState(()=>Date.now());C.useEffect(()=>{const c=setInterval(()=>l(Date.now()),uL);return()=>clearInterval(c)},[]);const a=C.useMemo(()=>{const c=i-cL,d=new Set,p=s.filter(g=>{if(g.kind!=="intent"||g.errorCode!=="claim_failed")return!1;const _=Date.parse(g.ts);return Number.isNaN(_)||_<c||d.has(g.id)?!1:(d.add(g.id),!0)});if(p.length===0)return null;const u=p.length;return{kind:"claim_failed",severity:"warning",message:`${u} claim attempt${u===1?"":"s"} failed in the last 30 minutes. Check Tasks for details.`,jumpTo:"/overview",details:{count:u,sinceMs:c}}},[s,i]);return C.useMemo(()=>{if(e.status==="disconnected")return[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}];if(!r.data||!n.data)return[];const c=lL({bootstrap:n.data,status:fL(r.data,n.data,t)});return(a?[...c,a]:[...c]).sort((p,u)=>cb[p.severity]-cb[u.severity])},[e.status,t,r.data,n.data,a])}function mL({header:e,tabs:t,rail:r,children:n}){const s=r!=null,i=hL(),l=i.length>0?"grid-rows-[auto_auto_auto_minmax(0,1fr)]":"grid-rows-[auto_auto_minmax(0,1fr)]";return o.jsxs("div",{className:te("grid h-screen w-full overflow-hidden bg-background text-foreground",s?"grid-cols-[1fr_320px]":"grid-cols-1",l),children:[o.jsx("div",{className:"col-span-full border-b border-border",children:e}),o.jsx("div",{className:"col-span-full border-b border-border",children:t}),i.length>0&&o.jsx("div",{className:"col-span-full border-b border-border",children:o.jsx(sL,{notices:i})}),o.jsx("main",{className:"min-h-0 overflow-y-auto",children:n}),s&&o.jsx("aside",{className:"h-full min-h-0 overflow-y-auto border-l border-border",children:r})]})}function pL(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),s=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(s),t&&(n.href=t),s.href=e,s.href}const gL=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function ji(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let Fa=null;function dj(e={}){return Fa||(e.includeStyleProperties?(Fa=e.includeStyleProperties,Fa):(Fa=ji(window.getComputedStyle(document.documentElement)),Fa))}function tf(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function vL(e){const t=tf(e,"border-left-width"),r=tf(e,"border-right-width");return e.clientWidth+t+r}function _L(e){const t=tf(e,"border-top-width"),r=tf(e,"border-bottom-width");return e.clientHeight+t+r}function fj(e,t={}){const r=t.width||vL(e),n=t.height||_L(e);return{width:r,height:n}}function yL(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Nr=16384;function xL(e){(e.width>Nr||e.height>Nr)&&(e.width>Nr&&e.height>Nr?e.width>e.height?(e.height*=Nr/e.width,e.width=Nr):(e.width*=Nr/e.height,e.height=Nr):e.width>Nr?(e.height*=Nr/e.width,e.width=Nr):(e.width*=Nr/e.height,e.height=Nr))}function rf(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function bL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function SL(e,t,r){const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),i=document.createElementNS(n,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${r}`),s.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),s.appendChild(i),i.appendChild(e),bL(s)}const Er=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||Er(r,t)};function wL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function CL(e,t){return dj(t).map(r=>{const n=e.getPropertyValue(r),s=e.getPropertyPriority(r);return`${r}: ${n}${s?" !important":""};`}).join(" ")}function EL(e,t,r,n){const s=`.${e}:${t}`,i=r.cssText?wL(r):CL(r,n);return document.createTextNode(`${s}{${i}}`)}function ub(e,t,r,n){const s=window.getComputedStyle(e,r),i=s.getPropertyValue("content");if(i===""||i==="none")return;const l=gL();try{t.className=`${t.className} ${l}`}catch{return}const a=document.createElement("style");a.appendChild(EL(l,r,s,n)),t.appendChild(a)}function jL(e,t,r){ub(e,t,":before",r),ub(e,t,":after",r)}const db="application/font-woff",fb="image/jpeg",kL={woff:db,woff2:db,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:fb,jpeg:fb,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function RL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function c_(e){const t=RL(e).toLowerCase();return kL[t]||""}function NL(e){return e.split(/,/)[1]}function Vp(e){return e.search(/^(data:)/)!==-1}function TL(e,t){return`data:${t};base64,${e}`}async function hj(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const s=await n.blob();return new Promise((i,l)=>{const a=new FileReader;a.onerror=l,a.onloadend=()=>{try{i(r({res:n,result:a.result}))}catch(c){l(c)}},a.readAsDataURL(s)})}const rm={};function AL(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function u_(e,t,r){const n=AL(e,t,r.includeQueryParams);if(rm[n]!=null)return rm[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const i=await hj(e,r.fetchRequestInit,({res:l,result:a})=>(t||(t=l.headers.get("Content-Type")||""),NL(a)));s=TL(i,t)}catch(i){s=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return rm[n]=s,s}async function DL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rf(t)}async function OL(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const a=i.toDataURL();return rf(a)}const r=e.poster,n=c_(r),s=await u_(r,n,t);return rf(s)}async function ML(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await Zf(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function LL(e,t){return Er(e,HTMLCanvasElement)?DL(e):Er(e,HTMLVideoElement)?OL(e,t):Er(e,HTMLIFrameElement)?ML(e,t):e.cloneNode(mj(e))}const PL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",mj=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function BL(e,t,r){var n,s;if(mj(t))return t;let i=[];return PL(e)&&e.assignedNodes?i=ji(e.assignedNodes()):Er(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?i=ji(e.contentDocument.body.childNodes):i=ji(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),i.length===0||Er(e,HTMLVideoElement)||await i.reduce((l,a)=>l.then(()=>Zf(a,r)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function IL(e,t,r){const n=t.style;if(!n)return;const s=window.getComputedStyle(e);s.cssText?(n.cssText=s.cssText,n.transformOrigin=s.transformOrigin):dj(r).forEach(i=>{let l=s.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),Er(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(i,l,s.getPropertyPriority(i))})}function HL(e,t){Er(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Er(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function zL(e,t){if(Er(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(s=>e.value===s.getAttribute("value"));n&&n.setAttribute("selected","")}}function FL(e,t,r){return Er(t,Element)&&(IL(e,t,r),jL(e,t,r),HL(e,t),zL(e,t)),t}async function UL(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let i=0;i<r.length;i++){const a=r[i].getAttribute("xlink:href");if(a){const c=e.querySelector(a),d=document.querySelector(a);!c&&d&&!n[a]&&(n[a]=await Zf(d,t,!0))}}const s=Object.values(n);if(s.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const a=document.createElementNS(i,"defs");l.appendChild(a);for(let c=0;c<s.length;c++)a.appendChild(s[c]);e.appendChild(l)}return e}async function Zf(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>LL(n,t)).then(n=>BL(e,n,t)).then(n=>FL(e,n,t)).then(n=>UL(n,t))}const pj=/url\((['"]?)([^'"]+?)\1\)/g,$L=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,VL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function qL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function WL(e){const t=[];return e.replace(pj,(r,n,s)=>(t.push(s),r)),t.filter(r=>!Vp(r))}async function GL(e,t,r,n,s){try{const i=r?pL(t,r):t,l=c_(t);let a;return s||(a=await u_(i,l,n)),e.replace(qL(t),`$1${a}$3`)}catch{}return e}function KL(e,{preferredFontFormat:t}){return t?e.replace(VL,r=>{for(;;){const[n,,s]=$L.exec(r)||[];if(!s)return"";if(s===t)return`src: ${n};`}}):e}function gj(e){return e.search(pj)!==-1}async function vj(e,t,r){if(!gj(e))return e;const n=KL(e,r);return WL(n).reduce((i,l)=>i.then(a=>GL(a,l,t,r)),Promise.resolve(n))}async function Ua(e,t,r){var n;const s=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(s){const i=await vj(s,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function YL(e,t){await Ua("background",e,t)||await Ua("background-image",e,t),await Ua("mask",e,t)||await Ua("-webkit-mask",e,t)||await Ua("mask-image",e,t)||await Ua("-webkit-mask-image",e,t)}async function ZL(e,t){const r=Er(e,HTMLImageElement);if(!(r&&!Vp(e.src))&&!(Er(e,SVGImageElement)&&!Vp(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,s=await u_(n,c_(n),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...c)=>{try{i(t.onImageErrorHandler(...c))}catch(d){l(d)}}:l;const a=e;a.decode&&(a.decode=i),a.loading==="lazy"&&(a.loading="eager"),r?(e.srcset="",e.src=s):e.href.baseVal=s})}async function XL(e,t){const n=ji(e.childNodes).map(s=>_j(s,t));await Promise.all(n).then(()=>e)}async function _j(e,t){Er(e,Element)&&(await YL(e,t),await ZL(e,t),await XL(e,t))}function QL(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(s=>{r[s]=n[s]}),e}const hb={};async function mb(e){let t=hb[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},hb[e]=t,t}async function pb(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let a=l.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),hj(a,t.fetchRequestInit,({result:c})=>(r=r.replace(l,`url(${c})`),[l,c]))});return Promise.all(i).then(()=>r)}function gb(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=s.exec(n);if(c===null)break;t.push(c[0])}n=n.replace(s,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(l,"gi");for(;;){let c=i.exec(n);if(c===null){if(c=a.exec(n),c===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(c[0])}return t}async function JL(e,t){const r=[],n=[];return e.forEach(s=>{if("cssRules"in s)try{ji(s.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let a=l+1;const c=i.href,d=mb(c).then(p=>pb(p,t)).then(p=>gb(p).forEach(u=>{try{s.insertRule(u,u.startsWith("@import")?a+=1:s.cssRules.length)}catch(g){console.error("Error inserting rule from remote css",{rule:u,error:g})}})).catch(p=>{console.error("Error loading remote css",p.toString())});n.push(d)}})}catch(i){const l=e.find(a=>a.href==null)||document.styleSheets[0];s.href!=null&&n.push(mb(s.href).then(a=>pb(a,t)).then(a=>gb(a).forEach(c=>{l.insertRule(c,l.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",i)}}),Promise.all(n).then(()=>(e.forEach(s=>{if("cssRules"in s)try{ji(s.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${s.href}`,i)}}),r))}function e4(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>gj(t.style.getPropertyValue("src")))}async function t4(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=ji(e.ownerDocument.styleSheets),n=await JL(r,t);return e4(n)}function yj(e){return e.trim().replace(/["']/g,"")}function r4(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(i=>{t.add(yj(i))}),Array.from(n.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function n4(e,t){const r=await t4(e,t),n=r4(e);return(await Promise.all(r.filter(i=>n.has(yj(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return vj(i.cssText,l,t)}))).join(`
|
|
215
|
+
`)}async function s4(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await n4(e,t);if(r){const n=document.createElement("style"),s=document.createTextNode(r);n.appendChild(s),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function i4(e,t={}){const{width:r,height:n}=fj(e,t),s=await Zf(e,t,!0);return await s4(s,t),await _j(s,t),QL(s,t),await SL(s,r,n)}async function a4(e,t={}){const{width:r,height:n}=fj(e,t),s=await i4(e,t),i=await rf(s),l=document.createElement("canvas"),a=l.getContext("2d"),c=t.pixelRatio||yL(),d=t.canvasWidth||r,p=t.canvasHeight||n;return l.width=d*c,l.height=p*c,t.skipAutoScale||xL(l),l.style.width=`${d}`,l.style.height=`${p}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,l.width,l.height)),a.drawImage(i,0,0,l.width,l.height),l}async function o4(e,t={}){return(await a4(e,t)).toDataURL()}async function l4(){try{return(await o4(document.body,{canvasWidth:1600,cacheBust:!0})).replace(/^data:image\/png;base64,/,"")}catch{return}}function c4(e,t){const r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(r)}const u4={background:"var(--bg-raised, var(--bg))",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",maxWidth:"420px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)"};function d4(){const[e,t]=C.useState("idle"),[r,n]=C.useState(null),[s,i]=C.useState(null);async function l(){t("loading-manifest"),i(null);try{const d=await he.debugReport.manifest();n(d),t("reviewing")}catch(d){i(d instanceof Error?d.message:String(d)),t("error")}}function a(){t("idle"),n(null),i(null)}async function c(){t("building"),i(null);try{const d=await l4(),p=await he.debugReport.download(d),u=new Date().toISOString().slice(0,10);c4(p,`jinn-debug-report-${u}.tar.gz`),a()}catch(d){i(d instanceof Error?d.message:String(d)),t("error")}}return o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:()=>void l(),disabled:e==="loading-manifest"||e==="building",style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"4px 10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--fg-muted)",cursor:e==="building"?"wait":"pointer"},children:e==="building"?"building report…":"debug report"}),(e==="reviewing"||e==="building"||e==="error")&&o.jsx("div",{role:"dialog","aria-label":"Download debug report",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:a,children:o.jsxs("div",{style:u4,onClick:d=>d.stopPropagation(),children:[o.jsx("h2",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",margin:"0 0 8px",color:"var(--fg)"},children:"Download debug report"}),o.jsx("p",{style:{color:"var(--fg-muted)",margin:"0 0 14px",lineHeight:1.5},children:"A support bundle for debugging this daemon. Secret values in the config, logs, and events are redacted — but the screenshot is not (see below). Review what it contains:"}),r&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{color:"var(--fg-dim)",marginBottom:"4px"},children:"Bundle contents"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg)"},children:r.files.map(d=>o.jsx("li",{children:d},d))})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("div",{style:{color:"var(--fg-dim)",marginBottom:"4px"},children:"Redacted"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg-muted)"},children:r.redaction.redacted.map(d=>o.jsx("li",{children:d},d))})]}),r.redaction.notRedacted&&r.redaction.notRedacted.length>0&&o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("div",{style:{color:"var(--break-red)",marginBottom:"4px"},children:"Not redacted — review before sharing"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg-muted)"},children:r.redaction.notRedacted.map(d=>o.jsx("li",{children:d},d))})]})]}),s&&o.jsx("p",{style:{color:"var(--break-red)",margin:"0 0 12px"},children:s}),o.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[o.jsx("button",{type:"button",onClick:a,style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",cursor:"pointer"},children:"Cancel"}),o.jsx("button",{type:"button",onClick:()=>void c(),disabled:e==="building",style:{background:"var(--fg)",border:"1px solid var(--fg)",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--bg)",cursor:e==="building"?"wait":"pointer"},children:e==="building"?"Building…":"Download"})]})]})})]})}function f4({network:e}){return o.jsxs("header",{className:"flex items-center justify-between px-6 py-3.5",children:[o.jsx(Cr,{href:"/overview",className:"font-serif text-[26px] text-foreground no-underline",children:"jinn operator"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ce,{variant:"outline",children:e}),o.jsx(d4,{})]})]})}const vb=[{path:"/overview",label:"Dashboard"},{path:"/events",label:"Events"},{path:"/operator",label:"Settings"}];function h4(){const[e]=gn(),t=e.split(/[?#]/)[0]||"/",r=t==="/launcher"||t.startsWith("/launcher/"),{data:n}=Oe({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>he.solvernets.listLaunched(),refetchInterval:3e4,enabled:!r}),s=Yv().pluginBuilderUi?[...vb,{path:"/build",label:"Build"}]:vb,l=r||((n==null?void 0:n.records.length)??0)>0?[...s,{path:"/launcher",label:"Launcher"}]:s;return o.jsx("nav",{className:"-mb-px flex px-6",children:l.map(a=>{const c=t===a.path||t.startsWith(`${a.path}/`);return o.jsx(Cr,{href:a.path,"data-active":c?"true":"false",className:te("border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors",c?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:a.label},a.path)})})}function m4({agentGated:e}){return o.jsxs("div",{className:"agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]",children:"Claude"}),o.jsx(NE,{agentGated:e})]})}function p4(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const g4=e=>{switch(e){case"success":return y4;case"info":return b4;case"warning":return x4;case"error":return S4;default:return null}},v4=Array(12).fill(0),_4=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},v4.map((r,n)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),y4=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),x4=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b4=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),S4=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),w4=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),C4=()=>{const[e,t]=X.useState(document.hidden);return X.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let qp=1;class E4{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:qp++,l=this.toasts.find(c=>c.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:n}),{...c,...t,id:i,dismissible:a,title:n}):c):this.addToast({title:n,...s,dismissible:a,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=n!==void 0,l;const a=s.then(async d=>{if(l=["resolve",d],X.isValidElement(d))i=!1,this.create({id:n,type:"default",message:d});else if(k4(d)&&!d.ok){i=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof u=="object"&&!X.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:g,...x})}else if(d instanceof Error){i=!1;const u=typeof r.error=="function"?await r.error(d):r.error,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof u=="object"&&!X.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:g,...x})}else if(r.success!==void 0){i=!1;const u=typeof r.success=="function"?await r.success(d):r.success,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof u=="object"&&!X.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:g,...x})}}).catch(async d=>{if(l=["reject",d],r.error!==void 0){i=!1;const p=typeof r.error=="function"?await r.error(d):r.error,u=typeof r.description=="function"?await r.description(d):r.description,_=typeof p=="object"&&!X.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:u,..._})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((d,p)=>a.then(()=>l[0]==="reject"?p(l[1]):d(l[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||qp++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Sr=new E4,j4=(e,t)=>{const r=(t==null?void 0:t.id)||qp++;return Sr.addToast({title:e,...t,id:r}),r},k4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",R4=j4,N4=()=>Sr.toasts,T4=()=>Sr.getActiveToasts(),Xn=Object.assign(R4,{success:Sr.success,info:Sr.info,warning:Sr.warning,error:Sr.error,custom:Sr.custom,message:Sr.message,promise:Sr.promise,dismiss:Sr.dismiss,loading:Sr.loading},{getHistory:N4,getToasts:T4});p4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function zu(e){return e.label!==void 0}const A4=3,D4="24px",O4="16px",_b=4e3,M4=356,L4=14,P4=45,B4=200;function In(...e){return e.filter(Boolean).join(" ")}function I4(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const H4=e=>{var t,r,n,s,i,l,a,c,d;const{invert:p,toast:u,unstyled:g,interacting:_,setHeights:x,visibleToasts:b,heights:h,index:f,toasts:m,expanded:v,removeToast:y,defaultRichColors:S,closeButton:E,style:k,cancelButtonStyle:w,actionButtonStyle:j,className:R="",descriptionClassName:M="",duration:T,position:O,gap:F,expandByDefault:$,classNames:P,icons:U,closeButtonAriaLabel:N="Close toast"}=e,[D,L]=X.useState(null),[I,Q]=X.useState(null),[q,J]=X.useState(!1),[Z,me]=X.useState(!1),[A,H]=X.useState(!1),[G,Y]=X.useState(!1),[ce,K]=X.useState(!1),[pe,Me]=X.useState(0),[Ke,Ht]=X.useState(0),Se=X.useRef(u.duration||T||_b),Zr=X.useRef(null),xt=X.useRef(null),Is=f===0,Fi=f+1<=b,Et=u.type,jt=u.dismissible!==!1,Bn=u.className||"",B=u.descriptionClassName||"",V=X.useMemo(()=>h.findIndex(Ne=>Ne.toastId===u.id)||0,[h,u.id]),W=X.useMemo(()=>{var Ne;return(Ne=u.closeButton)!=null?Ne:E},[u.closeButton,E]),ne=X.useMemo(()=>u.duration||T||_b,[u.duration,T]),se=X.useRef(0),re=X.useRef(0),le=X.useRef(0),de=X.useRef(null),[De,kt]=O.split("-"),or=X.useMemo(()=>h.reduce((Ne,zt,Jt)=>Jt>=V?Ne:Ne+zt.height,0),[h,V]),mr=C4(),rs=u.invert||p,Ui=Et==="loading";re.current=X.useMemo(()=>V*F+or,[V,or]),X.useEffect(()=>{Se.current=ne},[ne]),X.useEffect(()=>{J(!0)},[]),X.useEffect(()=>{const Ne=xt.current;if(Ne){const zt=Ne.getBoundingClientRect().height;return Ht(zt),x(Jt=>[{toastId:u.id,height:zt,position:u.position},...Jt]),()=>x(Jt=>Jt.filter(Rr=>Rr.toastId!==u.id))}},[x,u.id]),X.useLayoutEffect(()=>{if(!q)return;const Ne=xt.current,zt=Ne.style.height;Ne.style.height="auto";const Jt=Ne.getBoundingClientRect().height;Ne.style.height=zt,Ht(Jt),x(Rr=>Rr.find(qt=>qt.toastId===u.id)?Rr.map(qt=>qt.toastId===u.id?{...qt,height:Jt}:qt):[{toastId:u.id,height:Jt,position:u.position},...Rr])},[q,u.title,u.description,x,u.id,u.jsx,u.action,u.cancel]);const Xr=X.useCallback(()=>{me(!0),Me(re.current),x(Ne=>Ne.filter(zt=>zt.toastId!==u.id)),setTimeout(()=>{y(u)},B4)},[u,y,x,re]);X.useEffect(()=>{if(u.promise&&Et==="loading"||u.duration===1/0||u.type==="loading")return;let Ne;return v||_||mr?(()=>{if(le.current<se.current){const Rr=new Date().getTime()-se.current;Se.current=Se.current-Rr}le.current=new Date().getTime()})():(()=>{Se.current!==1/0&&(se.current=new Date().getTime(),Ne=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Xr()},Se.current))})(),()=>clearTimeout(Ne)},[v,_,u,Et,mr,Xr]),X.useEffect(()=>{u.delete&&(Xr(),u.onDismiss==null||u.onDismiss.call(u,u))},[Xr,u.delete]);function dh(){var Ne;if(U!=null&&U.loading){var zt;return X.createElement("div",{className:In(P==null?void 0:P.loader,u==null||(zt=u.classNames)==null?void 0:zt.loader,"sonner-loader"),"data-visible":Et==="loading"},U.loading)}return X.createElement(_4,{className:In(P==null?void 0:P.loader,u==null||(Ne=u.classNames)==null?void 0:Ne.loader),visible:Et==="loading"})}const pu=u.icon||(U==null?void 0:U[Et])||g4(Et);var gu,kl;return X.createElement("li",{tabIndex:0,ref:xt,className:In(R,Bn,P==null?void 0:P.toast,u==null||(t=u.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[Et],u==null||(r=u.classNames)==null?void 0:r[Et]),"data-sonner-toast":"","data-rich-colors":(gu=u.richColors)!=null?gu:S,"data-styled":!(u.jsx||u.unstyled||g),"data-mounted":q,"data-promise":!!u.promise,"data-swiped":ce,"data-removed":Z,"data-visible":Fi,"data-y-position":De,"data-x-position":kt,"data-index":f,"data-front":Is,"data-swiping":A,"data-dismissible":jt,"data-type":Et,"data-invert":rs,"data-swipe-out":G,"data-swipe-direction":I,"data-expanded":!!(v||$&&q),"data-testid":u.testId,style:{"--index":f,"--toasts-before":f,"--z-index":m.length-f,"--offset":`${Z?pe:re.current}px`,"--initial-height":$?"auto":`${Ke}px`,...k,...u.style},onDragEnd:()=>{H(!1),L(null),de.current=null},onPointerDown:Ne=>{Ne.button!==2&&(Ui||!jt||(Zr.current=new Date,Me(re.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(H(!0),de.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,zt,Jt;if(G||!jt)return;de.current=null;const Rr=Number(((Ne=xt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),vu=Number(((zt=xt.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((Jt=Zr.current)==null?void 0:Jt.getTime()),Qr=D==="x"?Rr:vu,_u=Math.abs(Qr)/qt;if(Math.abs(Qr)>=P4||_u>.11){Me(re.current),u.onDismiss==null||u.onDismiss.call(u,u),Q(D==="x"?Rr>0?"right":"left":vu>0?"down":"up"),Xr(),Y(!0);return}else{var yn,xn;(yn=xt.current)==null||yn.style.setProperty("--swipe-amount-x","0px"),(xn=xt.current)==null||xn.style.setProperty("--swipe-amount-y","0px")}K(!1),H(!1),L(null)},onPointerMove:Ne=>{var zt,Jt,Rr;if(!de.current||!jt||((zt=window.getSelection())==null?void 0:zt.toString().length)>0)return;const qt=Ne.clientY-de.current.y,Qr=Ne.clientX-de.current.x;var _u;const yn=(_u=e.swipeDirections)!=null?_u:I4(O);!D&&(Math.abs(Qr)>1||Math.abs(qt)>1)&&L(Math.abs(Qr)>Math.abs(qt)?"x":"y");let xn={x:0,y:0};const X_=$i=>1/(1.5+Math.abs($i)/20);if(D==="y"){if(yn.includes("top")||yn.includes("bottom"))if(yn.includes("top")&&qt<0||yn.includes("bottom")&&qt>0)xn.y=qt;else{const $i=qt*X_(qt);xn.y=Math.abs($i)<Math.abs(qt)?$i:qt}}else if(D==="x"&&(yn.includes("left")||yn.includes("right")))if(yn.includes("left")&&Qr<0||yn.includes("right")&&Qr>0)xn.x=Qr;else{const $i=Qr*X_(Qr);xn.x=Math.abs($i)<Math.abs(Qr)?$i:Qr}(Math.abs(xn.x)>0||Math.abs(xn.y)>0)&&K(!0),(Jt=xt.current)==null||Jt.style.setProperty("--swipe-amount-x",`${xn.x}px`),(Rr=xt.current)==null||Rr.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},W&&!u.jsx&&Et!=="loading"?X.createElement("button",{"aria-label":N,"data-disabled":Ui,"data-close-button":!0,onClick:Ui||!jt?()=>{}:()=>{Xr(),u.onDismiss==null||u.onDismiss.call(u,u)},className:In(P==null?void 0:P.closeButton,u==null||(n=u.classNames)==null?void 0:n.closeButton)},(kl=U==null?void 0:U.close)!=null?kl:w4):null,(Et||u.icon||u.promise)&&u.icon!==null&&((U==null?void 0:U[Et])!==null||u.icon)?X.createElement("div",{"data-icon":"",className:In(P==null?void 0:P.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||dh():null,u.type!=="loading"?pu:null):null,X.createElement("div",{"data-content":"",className:In(P==null?void 0:P.content,u==null||(i=u.classNames)==null?void 0:i.content)},X.createElement("div",{"data-title":"",className:In(P==null?void 0:P.title,u==null||(l=u.classNames)==null?void 0:l.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?X.createElement("div",{"data-description":"",className:In(M,B,P==null?void 0:P.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),X.isValidElement(u.cancel)?u.cancel:u.cancel&&zu(u.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||w,onClick:Ne=>{zu(u.cancel)&&jt&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ne),Xr())},className:In(P==null?void 0:P.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,X.isValidElement(u.action)?u.action:u.action&&zu(u.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||j,onClick:Ne=>{zu(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ne),!Ne.defaultPrevented&&Xr())},className:In(P==null?void 0:P.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function yb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function z4(e,t){const r={};return[e,t].forEach((n,s)=>{const i=s===1,l=i?"--mobile-offset":"--offset",a=i?O4:D4;function c(d){["top","right","bottom","left"].forEach(p=>{r[`${l}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${l}-${d}`]=a:r[`${l}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(a)}),r}const F4=X.forwardRef(function(t,r){const{id:n,invert:s,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:a,closeButton:c,className:d,offset:p,mobileOffset:u,theme:g="light",richColors:_,duration:x,style:b,visibleToasts:h=A4,toastOptions:f,dir:m=yb(),gap:v=L4,icons:y,containerAriaLabel:S="Notifications"}=t,[E,k]=X.useState([]),w=X.useMemo(()=>n?E.filter(q=>q.toasterId===n):E.filter(q=>!q.toasterId),[E,n]),j=X.useMemo(()=>Array.from(new Set([i].concat(w.filter(q=>q.position).map(q=>q.position)))),[w,i]),[R,M]=X.useState([]),[T,O]=X.useState(!1),[F,$]=X.useState(!1),[P,U]=X.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=X.useRef(null),D=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=X.useRef(null),I=X.useRef(!1),Q=X.useCallback(q=>{k(J=>{var Z;return(Z=J.find(me=>me.id===q.id))!=null&&Z.delete||Sr.dismiss(q.id),J.filter(({id:me})=>me!==q.id)})},[]);return X.useEffect(()=>Sr.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{k(J=>J.map(Z=>Z.id===q.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{NS.flushSync(()=>{k(J=>{const Z=J.findIndex(me=>me.id===q.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...q},...J.slice(Z+1)]:[q,...J]})})})}),[E]),X.useEffect(()=>{if(g!=="system"){U(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:J})=>{U(J?"dark":"light")})}catch{q.addListener(({matches:Z})=>{try{U(Z?"dark":"light")}catch(me){console.error(me)}})}},[g]),X.useEffect(()=>{E.length<=1&&O(!1)},[E]),X.useEffect(()=>{const q=J=>{var Z;if(l.every(H=>J[H]||J.code===H)){var A;O(!0),(A=N.current)==null||A.focus()}J.code==="Escape"&&(document.activeElement===N.current||(Z=N.current)!=null&&Z.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[l]),X.useEffect(()=>{if(N.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,I.current=!1)}},[N.current]),X.createElement("section",{ref:r,"aria-label":`${S} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((q,J)=>{var Z;const[me,A]=q.split("-");return w.length?X.createElement("ol",{key:q,dir:m==="auto"?yb():m,tabIndex:-1,ref:N,className:d,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":me,"data-x-position":A,style:{"--front-toast-height":`${((Z=R[0])==null?void 0:Z.height)||0}px`,"--width":`${M4}px`,"--gap":`${v}px`,...b,...z4(p,u)},onBlur:H=>{I.current&&!H.currentTarget.contains(H.relatedTarget)&&(I.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||I.current||(I.current=!0,L.current=H.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{F||O(!1)},onDragEnd:()=>O(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},w.filter(H=>!H.position&&J===0||H.position===q).map((H,G)=>{var Y,ce;return X.createElement(H4,{key:H.id,icons:y,index:G,toast:H,defaultRichColors:_,duration:(Y=f==null?void 0:f.duration)!=null?Y:x,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:s,visibleToasts:h,closeButton:(ce=f==null?void 0:f.closeButton)!=null?ce:c,interacting:F,position:q,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,closeButtonAriaLabel:f==null?void 0:f.closeButtonAriaLabel,removeToast:Q,toasts:w.filter(K=>K.position==H.position),heights:R.filter(K=>K.position==H.position),setHeights:M,expandByDefault:a,gap:v,expanded:T,swipeDirections:t.swipeDirections})})):null}))}),st=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>o.jsx("div",{ref:s,role:r?"none":"separator","aria-orientation":t,className:te("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));st.displayName="Separator";const U4="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",nm="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",$4="font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground",V4="font-mono text-[12px] font-medium text-[var(--fg-muted)]",xb="font-mono text-[12px] text-[var(--fg-dim)]";function q4(e,t,r){switch(e){case"ready":return{value:t,copy:null};case"error":return{value:"unavailable",copy:r??"Sepolia tJINN balance temporarily unavailable."};case"pending":return{value:"pending",copy:"Waiting for Sepolia balance."}}}function W4({totalEth:e,runwayDays:t,tjinnEarned:r,tjinnEarnedLast24h:n,tjinnState:s,tjinnError:i,lastPasswordRotationAt:l,onTopUp:a,actionsDisabled:c=!1}){const[,d]=gn(),{value:p,copy:u}=q4(s,r,i);return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{role:"region","aria-label":"Wallet","data-testid":"wallet-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:U4,children:"Wallet"}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-rewards",children:[o.jsx("span",{className:nm,children:"Rewards"}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-24h-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"JINN earned last 24hrs"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-2xl font-bold tracking-tight","data-testid":"tjinn-earned-24h-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:n??(s==="error"?"unavailable":"pending")}),n!==null&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state-prefix",children:"Lifetime"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-base font-medium","data-testid":"tjinn-earned-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:p}),s==="ready"&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]}),u&&o.jsx("span",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state",children:u})]})]}),o.jsx(st,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-gas",children:[o.jsx("span",{className:nm,children:"Gas"}),o.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[o.jsx("span",{className:$4,children:e}),o.jsx("span",{className:V4,children:"ETH"}),o.jsx("span",{className:xb,children:"·"}),o.jsxs("span",{className:xb,children:[t,"d runway"]})]}),o.jsx(ie,{variant:"outline",size:"sm","aria-label":"Top up from faucet",onClick:a,disabled:c,"data-testid":"wallet-topup",className:"self-start",children:"Top up from faucet (free)"})]}),o.jsx(st,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-password",children:[o.jsx("span",{className:nm,children:"Password"}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-dim)]",children:["last rotated:"," ",l?o.jsx("time",{dateTime:l,className:"text-[var(--fg-muted)]",children:l}):o.jsx("span",{className:"text-[var(--fg-muted)]",children:"never"})]}),o.jsx(ie,{variant:"secondary",size:"sm","aria-label":"Change password",onClick:()=>d("/operator/security"),"data-testid":"wallet-change-password",className:"self-start",children:"Change password"})]})]})})}const G4="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",K4="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",Wp="font-mono text-[14px] text-foreground",Y4="font-mono text-[14px] text-[var(--fg-muted)]";function Z4(e){return e.length<10?e:`${e.slice(0,6)}…${e.slice(-4)}`}function Gp(){return o.jsx("span",{"data-testid":"identity-stat-empty",className:Y4,children:"—"})}function Kp({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:K4,children:e}),t]})}function bb({label:e,address:t,testId:r}){return o.jsx(Kp,{label:e,children:t?o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{"data-testid":r,tabIndex:0,className:`cursor-help ${Wp}`,children:Z4(t)})}),o.jsx(dn,{children:t})]}):o.jsx(Gp,{})})}function X4({masterAddress:e,safeAddress:t,serviceId:r,agentId:n,services:s=[],bindingError:i}){const l=s.find(h=>h.agentId!==null&&!h.safeBoundToAgent),[a,c]=C.useState(!1),[d,p]=C.useState(!1),[u,g]=C.useState(null),[_,x]=C.useState(i??null),b=async()=>{if(l){p(!0),g(null),x(null);try{const f=(await he.retryAgentBinding({serviceIndex:l.index})).attempts[0];(f==null?void 0:f.status)==="success"?(g("success"),c(!1)):(g("reverted"),x((f==null?void 0:f.detail)??"Bind reverted on chain."))}catch(h){g("reverted"),x(h instanceof Error?h.message:String(h))}finally{p(!1)}}};return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{role:"region","aria-label":"Identity","data-testid":"identity-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:G4,children:"Identity"}),o.jsxs("div",{className:"flex flex-wrap gap-8",children:[o.jsx(Kp,{label:"Service",children:r!==null?o.jsxs("span",{"data-testid":"identity-service-id",className:Wp,children:["#",r]}):o.jsx(Gp,{})}),o.jsx(Kp,{label:"Agent",children:o.jsxs("span",{className:`flex items-center gap-2 ${Wp}`,children:[n!==null?`#${n}`:o.jsx(Gp,{}),l&&o.jsx("button",{type:"button",onClick:()=>c(h=>!h),className:"cursor-pointer rounded-full border border-[var(--wane)] bg-transparent px-1.5 py-px font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--wane)]",children:"binding pending"}),u==="success"&&o.jsx(Ce,{variant:"success",className:"rounded-full normal-case tracking-[0.12em]",children:"bound"})]})}),o.jsx(bb,{label:"Master",address:e,testId:"identity-master-address"}),o.jsx(bb,{label:"Safe",address:t,testId:"identity-safe-address"})]}),l&&o.jsxs(nt,{variant:"warning","data-testid":"identity-state-message-safe-not-bound",className:"flex flex-col gap-2",children:[o.jsxs(at,{children:["Service #",l.index," Safe is not yet bound to agent #",l.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),a&&_&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:_}),o.jsx(ie,{variant:"default",size:"sm",onClick:()=>{a||c(!0),b()},disabled:d,className:"self-start",children:d?"Retrying…":"Retry binding"})]}),n===null&&o.jsx(nt,{variant:"warning","data-testid":"identity-state-message-agent-id-not-minted",children:o.jsx(at,{children:"Agent ID has not yet been minted. The daemon mints it during bootstrap; if this persists, check the bootstrap logs."})})]})})}const d_="claude-code",Xf="codex",il="hermes-agent",Q4={"claude-code-learner":d_,"codex-code-learner":Xf},J4={[d_]:"Claude Code",[Xf]:"Codex",[il]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function Gr(e){return e?Q4[e]??e:""}function ki(e){const t=Gr(e);return J4[t]??t}function xj(e,t){const r=ki(e);return t?`${r} ${t}`:r}function eP(e,t){return Gr(e)===Gr(t)}const tP="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",rP="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function nP({name:e}){var g;const t=Hi(),{data:r,isError:n,error:s}=Oe({queryKey:["harness-readiness",e],queryFn:()=>he.harnessReadiness(e),refetchInterval:3e4}),i=Gr(e)===Xf,l=Oe({queryKey:["codex-doctor"],queryFn:()=>he.codexDoctor(),refetchInterval:3e4,enabled:i});function a(){return n?"error":(r==null?void 0:r.ready)===!0?"ready":(r==null?void 0:r.ready)===!1?"not-ready":null}const c=a(),d=c==="not-ready",p=()=>{t.invalidateQueries({queryKey:["harness-readiness",e]})},u=()=>{const _=r==null?void 0:r.nextStep;if(_){if(_.url){window.open(_.url,"_blank","noopener,noreferrer");return}_.cli&&navigator.clipboard.writeText(_.cli).then(()=>Xn.success("Command copied",{description:_.cli,duration:5e3})).catch(()=>Xn.error("Could not copy",{description:_.cli,duration:1/0}))}};return o.jsxs("div",{"data-testid":`harness-row-${e}`,className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline gap-3",children:[o.jsx("span",{className:rP,children:e}),c==="ready"&&o.jsx(Ce,{variant:"success","data-testid":`harness-pill-ready-${e}`,children:"ready"}),c==="not-ready"&&o.jsx(Ce,{variant:"destructive","data-testid":`harness-pill-not-ready-${e}`,children:"not ready"}),c==="error"&&o.jsx(Ce,{variant:"outline","data-testid":`harness-pill-error-${e}`,children:"unavailable"})]}),c==="not-ready"&&(r==null?void 0:r.reason)&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--break-red)]",children:r.reason}),c==="not-ready"&&(r==null?void 0:r.nextStep)&&o.jsxs("span",{"data-testid":`harness-next-step-${e}`,className:"font-mono text-[12px] text-[var(--fg-muted)]",children:[r.nextStep.description,r.nextStep.cli?` (${r.nextStep.cli})`:""]}),c==="error"&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:s instanceof Error?s.message:"Readiness check failed."}),i&&((g=l.data)==null?void 0:g.versionStatus)==="untested"&&o.jsxs("span",{"data-testid":"codex-version-hint-untested",className:"font-mono text-[12px] text-[var(--severity-warning-fg)]",children:["Codex CLI ",l.data.cliVersion," is outside the tested range — harness may break."]}),d&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{variant:"default",size:"sm","data-testid":`harness-reauth-${e}`,onClick:u,children:"Re-authenticate"}),o.jsx(ie,{variant:"outline",size:"sm","data-testid":`harness-recheck-${e}`,onClick:p,children:"Re-check"})]})]})}function sP(){const[,e]=gn();return o.jsxs("div",{className:"flex flex-col gap-2","data-testid":"harness-empty-state",children:[o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"No SolverNets joined — Harness Readiness will populate after you join one."}),o.jsx(ie,{variant:"outline",size:"sm",onClick:()=>e("/operator/registry"),"data-testid":"harness-empty-state-browse",className:"self-start",children:"Browse SolverNets"})]})}function iP({harnessNames:e}){return o.jsxs(be,{role:"region","aria-label":"Harness Readiness","data-testid":"harness-status-panel",className:"flex flex-col gap-4 p-6",children:[o.jsx("span",{className:tP,children:"Harness Readiness"}),e.length===0?o.jsx(sP,{}):o.jsx("div",{className:"flex flex-col gap-4",children:e.map((t,r)=>o.jsxs(C.Fragment,{children:[r>0&&o.jsx(st,{}),o.jsx(nP,{name:t})]},t))})]})}const sm="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",Sb="flex items-center gap-2 font-mono text-[17px] font-medium text-foreground";function wb({tone:e}){const t=e==="good"?"bg-[var(--vow-green)]":e==="bad"?"bg-[var(--break-red)]":"bg-[var(--fg-muted)]";return o.jsx("span",{"aria-hidden":"true",className:te("inline-block h-2 w-2 rounded-full",t)})}function aP({daemonStatus:e,daemonStateMessage:t,rpcStatus:r,onRestart:n}){const[,s]=gn(),[i,l]=C.useState(null),a=e==="running",c=r==="healthy";function d(){i||!n||(l("restart"),Promise.resolve().then(n).catch(p=>console.error("[node-health] restart failed:",p)).finally(()=>l(null)))}return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{"data-testid":"node-health-card","aria-labelledby":"node-health-heading",className:"flex flex-col gap-4 p-6",children:[o.jsx("h2",{id:"node-health-heading",className:te(sm,"m-0 text-[var(--fg-dim)]"),children:"Node health"}),o.jsxs("div",{"data-testid":"node-health-daemon-row","data-status":e,className:"flex flex-col gap-2",children:[o.jsx("span",{className:sm,children:"Daemon"}),o.jsxs("span",{className:Sb,children:[o.jsx(wb,{tone:a?"good":"bad"}),a?"Running":"Stopped"]}),t&&o.jsx("span",{"data-testid":"node-health-daemon-state",className:"font-mono text-[12px] leading-snug text-[var(--fg-muted)]",children:t}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{tabIndex:a?-1:0,children:o.jsx(ie,{variant:"outline",size:"sm",disabled:!a||i!==null,"data-testid":"node-health-restart",onClick:d,children:i==="restart"?"Restarting...":"Restart"})})}),o.jsx(dn,{children:a?"Restart the daemon. The dashboard reconnects when it comes back.":"Daemon is stopped — re-run jinn from your terminal to start it."})]})})]}),o.jsxs("div",{"data-testid":"node-health-rpc-row","data-status":r,className:"flex flex-col gap-2",children:[o.jsx("span",{className:sm,children:"RPC"}),o.jsxs("span",{className:Sb,children:[o.jsx(wb,{tone:c?"good":"bad"}),c?"Healthy":"Unreachable"]}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsx(ie,{variant:"outline",size:"sm","data-testid":"node-health-rpc-settings",onClick:()=>s("/operator/network"),children:"Manage RPC"})})]})]})})}const Da=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:te("w-full caption-bottom font-mono text-[12px]",e),...t})}));Da.displayName="Table";const Oa=C.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:te("[&_tr]:border-b [&_tr]:border-border",e),...t}));Oa.displayName="TableHeader";const Ma=C.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:te("[&_tr:last-child]:border-0",e),...t}));Ma.displayName="TableBody";const oP=C.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:te("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));oP.displayName="TableFooter";const Kr=C.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:te("border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]",e),...t}));Kr.displayName="TableRow";const Qe=C.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:te("h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",e),...t}));Qe.displayName="TableHead";const Je=C.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:te("px-2 py-2 align-middle",e),...t}));Je.displayName="TableCell";const lP=C.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:te("mt-4 text-[12px] text-[var(--fg-muted)]",e),...t}));lP.displayName="TableCaption";const cP=new Set(["DISCOVERED","CLAIMED","WAITING","PRE_SNAPSHOT","RUNNING","POST_SNAPSHOT","PACKAGING","DELIVERING"]);function uP(e,t=6,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}…${e.slice(-r)}`}function dP(e){return e==="restoration"?"solve":e==="evaluation"?"evaluate":"—"}function fP(e){return e==="COMPLETE"?{label:"succeeded",detail:"COMPLETE",tone:"good"}:e==="FAILED"?{label:"failed",detail:"FAILED",tone:"bad"}:e==="RACE_LOST"?{label:"race-lost",detail:"RACE_LOST",tone:"neutral"}:cP.has(e)?{label:"active",detail:e.toLowerCase().replace(/_/g," "),tone:"active"}:{label:e.toLowerCase().replace(/_/g," "),detail:e,tone:"neutral"}}function hP(e){return e==="bad"?"destructive":e==="good"?"success":e==="active"?"default":"outline"}function mP(e){if(!e)return"—";const t=Math.floor((Date.now()-e)/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function pP(e){return e==="solving"||e==="solver"?"solver":e==="evaluating"||e==="evaluator"?"evaluator":e}const gP="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0";function Yp({children:e,className:t}){return o.jsx("h3",{className:te(gP,t),children:e})}function Fu({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Yp,{children:e}),o.jsx("div",{className:"font-mono text-[12px] text-foreground",children:t})]})}function vP({joined:e,tasks:t}){var a,c;const[,r]=gn(),[n,s]=C.useState(((a=e[0])==null?void 0:a.manifestCid)??((c=e[0])==null?void 0:c.name)??null),i=C.useMemo(()=>e.find(d=>(d.manifestCid??d.name)===n)??e[0]??null,[e,n]),l=C.useMemo(()=>i?t.filter(d=>{if(d.state==="FAILED"){if(d.runStartedAt===null)return!1;const p=(d.failureReason??"").toLowerCase();if(p.includes("not ready")||p.includes("not enabled"))return!1}return e.length<=1?!0:d.solverType&&i.solverType?d.solverType===i.solverType:d.manifestCid&&i.manifestCid?d.manifestCid===i.manifestCid:!0}):[],[t,i,e.length,n]);return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{role:"region","aria-label":"Activity","data-testid":"activity-card",children:[o.jsxs(ir,{className:"flex flex-row items-center justify-between gap-3 pb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(qC,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),o.jsx(pn,{children:"Activity"})]}),o.jsxs(ie,{variant:"secondary",size:"sm","data-testid":"activity-view-event-log",onClick:()=>r("/events"),children:[o.jsx(YD,{className:"h-3 w-3","aria-hidden":"true"}),"View event log"]})]}),o.jsx(et,{children:o.jsxs("div",{className:"grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]",children:[o.jsxs("div",{"data-testid":"activity-joined",className:"flex min-w-0 flex-col gap-3",children:[o.jsx(Yp,{children:"Joined"}),e.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNets joined."}):o.jsx(su,{className:"max-h-[280px]",children:o.jsx("div",{className:"flex flex-col gap-1 pr-2",children:e.map(d=>{const p=d.manifestCid??d.name,u=p===((i==null?void 0:i.manifestCid)??(i==null?void 0:i.name));return o.jsx(ie,{variant:"ghost",size:"sm","data-testid":`activity-joined-row-${p}`,"data-state":u?"active":void 0,"aria-current":u?"true":void 0,onClick:()=>s(p),className:te("h-auto w-full justify-start gap-0 rounded-sm border-l-2 px-2.5 py-1.5 font-mono text-[12px] normal-case tracking-normal",u?"border-l-primary bg-accent text-foreground":"border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground"),children:o.jsx("span",{className:"truncate",children:d.name})},p)})})}),o.jsxs(ie,{variant:"outline",size:"sm","data-testid":"activity-join-more",onClick:()=>r("/operator/registry"),className:"self-start",children:[o.jsx(JD,{className:"h-3 w-3","aria-hidden":"true"}),"Join more SolverNets"]})]}),o.jsxs("div",{"data-testid":"activity-tasks",className:"flex min-w-0 flex-col gap-3",children:[i&&o.jsx("h2",{className:"m-0 font-serif text-[20px] font-normal leading-tight text-foreground",children:i.name}),l.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No task runs recorded yet."}):o.jsx("div",{"data-testid":"activity-tasks-table",children:o.jsxs(Da,{children:[o.jsx(Oa,{children:o.jsxs(Kr,{className:"hover:bg-transparent",children:[o.jsx(Qe,{children:"Run"}),o.jsx(Qe,{children:"Task"}),o.jsx(Qe,{children:"State"}),o.jsx(Qe,{children:"Started"})]})}),o.jsx(Ma,{children:l.map(d=>{const p=fP(d.state),u=p.tone==="active";return o.jsxs(Kr,{"data-active":u?"true":void 0,"data-testid":`activity-task-row-${d.requestId}`,className:te("border-l-2",u?"border-l-primary bg-primary/[0.06]":"border-l-transparent"),children:[o.jsx(Je,{className:"text-muted-foreground",children:dP(d.taskRole)}),o.jsx(Je,{children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("button",{type:"button",className:"bg-transparent p-0 font-mono text-[12px] text-[var(--accent-sky)] underline-offset-4 hover:underline",onClick:()=>r(`/events?requestId=${encodeURIComponent(d.requestId)}`),children:uP(d.requestId)})}),o.jsx(dn,{children:d.requestId})]})}),o.jsx(Je,{children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0",children:o.jsx(Ce,{variant:hP(p.tone),children:p.label})})}),o.jsx(dn,{children:p.detail})]})}),o.jsx(Je,{className:"text-muted-foreground",children:mP(d.runStartedAt??d.stateUpdatedAt)})]},d.requestId)})})]})})]}),o.jsxs("div",{"data-testid":"activity-settings",className:"flex min-w-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(Yp,{children:"Settings"}),o.jsxs(ie,{variant:"link",size:"sm","data-testid":"activity-settings-edit",onClick:()=>r("/operator/memberships"),className:"h-auto gap-1 p-0 text-[11px] uppercase tracking-[0.14em]",children:[o.jsx(QD,{className:"h-3 w-3","aria-hidden":"true"}),"Edit"]})]}),i?o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx(Fu,{label:"Roles",children:i.roles.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.roles.map(d=>o.jsx(Ce,{variant:"outline",children:pP(d)},d))})}),o.jsx(st,{}),o.jsx(Fu,{label:"Harness",children:i.harness??"—"}),o.jsx(st,{}),o.jsx(Fu,{label:"Model",children:o.jsx("span",{className:te(!i.model&&"text-muted-foreground"),children:i.model??"—"})}),o.jsx(st,{}),o.jsx(Fu,{label:"Plugins",children:!i.plugins||i.plugins.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:i.plugins.map(d=>o.jsxs("li",{"data-testid":`activity-plugin-${d.name}`,className:"flex items-center gap-2 overflow-hidden",children:[o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground",children:d.displayName})}),o.jsx(dn,{children:d.name})]}),d.defaultIncluded&&o.jsx(Ce,{variant:"secondary",className:"shrink-0",children:"default"})]},d.name))})})]}):o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNet selected."})]})]})})]})})}function _P(e){const t=new Date(e),r=String(t.getUTCHours()).padStart(2,"0"),n=String(t.getUTCMinutes()).padStart(2,"0");return`${r}:${n} UTC`}function yP({aiUnits:e}){if(!e)return null;const t=e.credentials.filter(r=>r.paused);return t.length===0?null:o.jsx("div",{className:"flex flex-col gap-2",children:t.map(r=>{const s=r.unitsThisBlock>=r.capPerBlock?"block":"week",i=s==="block"?r.blockResetsAt:r.weekResetsAt,l=s==="block"?"6h":"7d";return o.jsxs(nt,{variant:"warning","data-testid":`ai-units-pause-alert-${r.credentialId}`,children:[o.jsx(qD,{className:"h-4 w-4","aria-hidden":"true"}),o.jsxs(It,{className:"font-mono text-[13px]",children:["Paused — ",l," AI-unit cap reached"]}),o.jsx(at,{className:"font-mono text-[12px] text-muted-foreground",children:o.jsxs("span",{children:["Credential ",o.jsx("span",{className:"text-foreground",children:r.credentialId})," used"," ",s==="block"?`${r.unitsThisBlock} / ${r.capPerBlock} units this block`:`${r.unitsThisWeek} / ${r.capPerWeek} units this 7-day window`,". Claims resume at ",o.jsx("span",{className:"text-foreground",children:_P(i)}),"."]})})]},r.credentialId)})})}const xP=[{name:"network-tools",version:"0.1.0",defaultIncluded:!0},{name:"claude-code-learner",version:"0.1.0",defaultIncluded:!0}],bP=new Set(["swe-rebench-v2-runtime"]),SP={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Zp="bundled:";function Xp(e){return SP[e]??e}function Uu(e){return e.startsWith(Zp)?e.slice(Zp.length):e}function wP(e){const t=Gr(e)===il;return xP.filter(r=>!(t&&r.name==="claude-code-learner")).map(r=>({name:r.name,displayName:Xp(r.name),source:"bundled",version:r.version,defaultIncluded:!0}))}function CP({harness:e,explicit:t,disabledDefaults:r,catalogCompatible:n=[]}){const s=new Set(r.map(Uu)),i=new Set(t.map(Uu));new Map(t.map(c=>[Uu(c),c]));const l=[],a=new Set;for(const c of wP(e))a.has(c.name)||(a.add(c.name),!s.has(c.name)&&l.push(c));for(const c of n){if(a.has(c.name))continue;a.add(c.name);const d=bP.has(c.name),p=i.has(c.name);!d&&!p||d&&s.has(c.name)||l.push({name:c.name,displayName:Xp(c.name),source:"catalog",version:c.version,defaultIncluded:d})}for(const c of t){const d=Uu(c);a.has(d)||(a.add(d),l.push({name:d,displayName:Xp(d),source:c.startsWith(Zp)?"bundled":"custom",version:"configured",defaultIncluded:!1}))}return l}function Wi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function EP(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function jP(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function kP(){var j,R,M,T,O,F,$,P,U,N,D,L,I,Q,q,J;const[e,t]=C.useState(null),{data:r,isError:n}=Oe({queryKey:["status"],queryFn:()=>he.getStatus(),refetchInterval:5e3}),{data:s}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:3e4}),{data:i}=Oe({queryKey:["solvernets","catalog"],queryFn:()=>he.getSolverNets(),refetchInterval:5*6e4}),l=(((j=r==null?void 0:r.fleet)==null?void 0:j.services)??[]).map(Z=>({index:Z.index,serviceId:Z.serviceId??null,safeAddress:Z.safeAddress??"",agentId:Z.agentId??null,safeBoundToAgent:Z.safeBoundToAgent??!1})),a=((R=l.find(Z=>Z.serviceId!==null))==null?void 0:R.serviceId)??null,c=C.useMemo(()=>{const Z=me=>{const A=new Set;for(const H of Object.values(me??{}))H!=null&&H.harness&&A.add(H.harness);return A};return Array.from(Z(s==null?void 0:s.joinedSolverNets)).sort()},[s]),d=((M=r==null?void 0:r.tJinn)==null?void 0:M.state)??"pending",p=((T=r==null?void 0:r.tJinn)==null?void 0:T.state)==="ready"?Wi(r.tJinn.safeBalanceWei??"0"):Wi(((O=r==null?void 0:r.tJinn)==null?void 0:O.safeBalanceWei)??void 0),u=((F=r==null?void 0:r.tJinn)==null?void 0:F.operatorMintedLast24hWei)!=null?Wi(r.tJinn.operatorMintedLast24hWei):null,g=(($=r==null?void 0:r.tJinn)==null?void 0:$.error)??null,_=Wi((P=r==null?void 0:r.masterGas)==null?void 0:P.balanceWei),x=((U=r==null?void 0:r.masterGas)==null?void 0:U.runwayDaysExcess)??"—",b=(N=r==null?void 0:r.balances)==null?void 0:N.eth,h=Wi(((D=b==null?void 0:b.master)==null?void 0:D.balanceWei)??void 0),f=Wi(((L=b==null?void 0:b.agent)==null?void 0:L.balanceWei)??void 0),m=Wi(((I=b==null?void 0:b.safe)==null?void 0:I.balanceWei)??void 0),v=C.useMemo(()=>{const Z=[],me=s==null?void 0:s.joinedSolverNets;if(!me)return Z;for(const[A,H]of Object.entries(me)){if(!H)continue;const G=H.contract?i==null?void 0:i.nets.find(ce=>{var K,pe;return ce.contract.id===((K=H.contract)==null?void 0:K.id)&&ce.contract.version===((pe=H.contract)==null?void 0:pe.version)}):void 0,Y=CP({harness:H.harness,explicit:Array.isArray(H.plugins)?H.plugins:[],disabledDefaults:Array.isArray(H.disabledDefaultPlugins)?H.disabledDefaultPlugins:[],catalogCompatible:G==null?void 0:G.compatiblePlugins});Z.push({name:H.name??H.manifestCid??A,manifestCid:H.manifestCid??A,solverType:H.contract?`${H.contract.id}.${H.contract.version}`:void 0,roles:Array.isArray(H.roles)?H.roles:[],harness:H.harness,model:H.model,plugins:Y})}return Z},[s,i]),y=C.useMemo(()=>{var A,H,G;const Z=new Map,me=Y=>{if(Y)for(const ce of Y)ce.requestId&&(Z.has(ce.requestId)||Z.set(ce.requestId,{requestId:ce.requestId,manifestCid:ce.manifestCid??null,solverType:ce.solverType??null,taskRole:ce.taskRole,state:ce.state,implName:ce.implName??null,windowStartTs:ce.windowStartTs??0,runStartedAt:ce.runStartedAt??null,stateUpdatedAt:ce.stateUpdatedAt,deliveryTxHash:ce.deliveryTxHash??null,failureReason:ce.failureReason??null}))};return me((A=r==null?void 0:r.taskRuns)==null?void 0:A.recentTasks),me((H=r==null?void 0:r.taskRuns)==null?void 0:H.inFlight),me((G=r==null?void 0:r.predictionV1)==null?void 0:G.recentTasks),Array.from(Z.values()).sort((Y,ce)=>ce.stateUpdatedAt-Y.stateUpdatedAt)},[r]),S=n&&r===void 0?"stopped":"running",E="healthy",k=void 0,w=(Z,me,A)=>{t(Z),Promise.resolve().then(me).then(H=>{Xn.success(Z,{description:H==null?void 0:H.message,duration:A==null?void 0:A.autoClearMs})}).catch(H=>{Xn.error(`${Z} failed`,{description:H instanceof Error?H.message:String(H),duration:1/0})}).finally(()=>t(null))};return o.jsxs("div",{"data-testid":"overview-page-grid",className:"grid items-start gap-6 p-6 [grid-template-columns:minmax(0,1fr)_minmax(0,380px)]",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-6",children:[o.jsx(yP,{aiUnits:r==null?void 0:r.aiUnits}),o.jsx(X4,{masterAddress:(s==null?void 0:s.master_address)??null,agentAddress:null,safeAddress:((Q=l[0])==null?void 0:Q.safeAddress)??null,serviceId:a,agentId:((q=l[0])==null?void 0:q.agentId)??null,services:l}),o.jsx(iP,{harnessNames:c}),o.jsx(vP,{joined:v,tasks:y})]}),o.jsxs("aside",{className:"flex flex-col gap-6",children:[o.jsx(aP,{daemonStatus:S,daemonStateMessage:k,rpcStatus:E,onStop:async()=>{if(!(await he.stopDaemon()).ok)throw new Error("Stop request failed.")},onRestart:async()=>{if(!(await he.restartDaemon({forceRespawn:!0})).ok)throw new Error("Restart request failed.")}}),o.jsx(W4,{totalEth:_,runwayDays:x,actionsDisabled:e!==null,perRole:{master:h,agent:f,safe:m},tjinnEarned:p,tjinnEarnedLast24h:u,tjinnState:d,tjinnError:g,lastPasswordRotationAt:((J=r==null?void 0:r.security)==null?void 0:J.lastPasswordRotationAt)??null,onTopUp:()=>w("Top up gas",async()=>{var G;const Z=await he.triggerDrip({singleDrip:!0});if(!Z.ok)throw new Error(Z.reason??"Gas top-up failed.");const me=Z.txHash??((G=Z.txHashes)==null?void 0:G.at(-1));if(!me)return{message:"Gas top-up checked; the faucet sent no funds."};const A=EP(Z.deltaWei),H=jP(me);return{message:A?`Gas topped up: +${A} · tx ${H}`:`Gas top-up sent · tx ${H}`}},{autoClearMs:5e3})})]})]})}const RP=["task_posted","intent_registry_failed","request_claimed","delivery_submitted","evaluation_submitted","reward_claimed","balance_topup","jinn_claim_emitted","jinn_claim_ticket_recorded","jinn_claim_submitted","jinn_claim_canonical_skip","engine_transition","tick_error","race_lost","startup","shutdown"],NP={task_posted:{label:"Task posted",description:"A new task intent was published on-chain.",tone:"info"},intent_registry_failed:{label:"Intent registry failed",description:"Posting a task intent to the registry did not succeed.",tone:"error"},request_claimed:{label:"Request claimed",description:"The solver claimed a task request to work on.",tone:"info"},delivery_submitted:{label:"Delivery submitted",description:"A completed solution was delivered on-chain.",tone:"success"},evaluation_submitted:{label:"Evaluation submitted",description:"An evaluation verdict was submitted for a delivery.",tone:"success"},reward_claimed:{label:"Reward claimed",description:"Staking rewards were claimed to the operator's safe.",tone:"reward"},balance_topup:{label:"Balance top-up",description:"Gas balance was topped up from the faucet.",tone:"info"},jinn_claim_emitted:{label:"JINN claim emitted",description:"A JINN earnings claim was emitted locally.",tone:"info"},jinn_claim_ticket_recorded:{label:"JINN ticket recorded",description:"A JINN claim ticket was recorded for later submission.",tone:"info"},jinn_claim_submitted:{label:"JINN claim submitted",description:"A JINN earnings claim was submitted on-chain.",tone:"success"},jinn_claim_canonical_skip:{label:"JINN claim skipped",description:"A JINN claim was skipped as already canonical.",tone:"neutral"},engine_transition:{label:"Engine transition",description:"A task run moved to a new lifecycle state.",tone:"info"},tick_error:{label:"Tick error",description:"An error occurred during a daemon polling tick.",tone:"error"},race_lost:{label:"Race lost",description:"A claim or evaluation lost the on-chain race (task already filled or evaluation deadline passed); no action needed.",tone:"neutral"},startup:{label:"Daemon started",description:"The jinn daemon process started.",tone:"neutral"},shutdown:{label:"Daemon stopped",description:"The jinn daemon process shut down.",tone:"neutral"}};function TP(e){const t=e.replace(/_/g," ").trim();return t.length===0?"Event":t.charAt(0).toUpperCase()+t.slice(1)}function nf(e){const t=NP[e];return t||{label:TP(e),description:"A daemon lifecycle event.",tone:"neutral"}}function Qp(e,t){if(t==="failed")return"destructive";if(t==="warn")return"warning";const r=nf(e).tone;return r==="error"?"destructive":r==="warning"?"warning":r==="success"||r==="reward"?"success":r==="neutral"?"secondary":"default"}const AP=50;function DP(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)}function Cb(e,t=8,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}...${e.slice(-r)}`}function OP(e){return e.requestId??e.solverType??"-"}function MP(){const[e]=gn();return C.useMemo(()=>{var i;const t=e.includes("?")?e.split("?")[1]:"",r=typeof window>"u"?"":window.location.search.replace(/^\?/,""),n=t||r;return((i=new URLSearchParams(n).get("requestId"))==null?void 0:i.trim())||void 0},[e])}function LP({pageSize:e=AP}={}){var u,g;const t=MP(),[r,n]=C.useState([]),[s,i]=C.useState("all"),l=lD({queryKey:["activity-events",r,s,t,e],queryFn:({pageParam:_})=>he.getActivityEvents({kinds:r.length>0?r:void 0,outcome:s==="all"?void 0:s,requestId:t,beforeId:typeof _=="number"?_:void 0,limit:e}),initialPageParam:void 0,getNextPageParam:_=>_.nextCursor??void 0}),a=((u=l.data)==null?void 0:u.pages)??[],c=a.flatMap(_=>_.events),d=((g=a[0])==null?void 0:g.counts)??{};function p(_){n(x=>x.includes(_)?x.filter(b=>b!==_):[...x,_])}return o.jsxs("main",{"data-testid":"events-page",className:"mx-auto flex w-full max-w-6xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:"Events"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"Persistent lifecycle activity from this operator."})]}),o.jsx(ie,{asChild:!0,variant:"secondary",size:"sm",children:o.jsx(Cr,{href:"/overview","data-testid":"events-back",children:"Overview"})})]}),t&&o.jsxs(nt,{variant:"info","data-testid":"events-request-scope",children:[o.jsx(It,{children:"Request scoped"}),o.jsxs(at,{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"break-all",children:["Showing events for ",t]}),o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"h-auto p-0",children:o.jsxs(Cr,{href:"/events","data-testid":"events-clear-request",children:[o.jsx(Dc,{"aria-hidden":"true"}),"Clear"]})})]})]}),o.jsxs(be,{children:[o.jsxs(ir,{children:[o.jsx(pn,{children:"Filters"}),o.jsx(Ns,{children:"Kind and outcome filters page through the same durable log."})]}),o.jsxs(et,{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Kind"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:RP.map(_=>{const x=r.includes(_),b=nf(_);return o.jsxs(ie,{type:"button",size:"sm",variant:x?"outline":"secondary","aria-pressed":x?"true":"false","data-testid":`events-kind-filter-${_}`,onClick:()=>p(_),className:"normal-case tracking-normal",children:[b.label,d[_]!==void 0&&o.jsx(Ce,{variant:"secondary",children:d[_]})]},_)})})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Outcome"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","ok","failed","warn"].map(_=>o.jsx(ie,{type:"button",size:"sm",variant:s===_?"outline":"secondary","aria-pressed":s===_?"true":"false","data-testid":`events-outcome-${_}`,onClick:()=>i(_),children:_},_))})]})]})]}),o.jsxs(be,{"data-testid":"events-list-section",children:[o.jsxs(ir,{children:[o.jsx(pn,{children:"Event Log"}),o.jsxs(Ns,{children:[c.length," loaded"]})]}),o.jsxs(et,{className:"flex flex-col gap-4",children:[l.isLoading&&o.jsxs("div",{"data-testid":"events-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Pp,{className:"animate-spin","aria-hidden":"true"}),"Loading events"]}),l.isError&&o.jsxs(nt,{variant:"blocking","data-testid":"events-error",children:[o.jsx(It,{children:"Events unavailable"}),o.jsxs(at,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:l.error instanceof Error?l.error.message:"Failed to load events."}),o.jsx(ie,{type:"button",size:"sm",variant:"secondary",onClick:()=>{l.refetch()},children:"Retry"})]})]}),!l.isLoading&&!l.isError&&c.length===0&&o.jsx("p",{"data-testid":"events-empty",className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No events match the current filters."}),c.length>0&&o.jsx("div",{"data-testid":"events-list",className:"overflow-x-auto",children:o.jsxs(Da,{children:[o.jsx(Oa,{children:o.jsxs(Kr,{className:"hover:bg-transparent",children:[o.jsx(Qe,{children:"Time"}),o.jsx(Qe,{children:"Kind"}),o.jsx(Qe,{children:"Subject"}),o.jsx(Qe,{children:"Outcome"}),o.jsx(Qe,{children:"Tx"}),o.jsx(Qe,{className:"w-8"})]})}),o.jsx(Ma,{children:c.map(_=>{const x=nf(_.kind);return o.jsxs(Kr,{"data-testid":"events-row",children:[o.jsx(Je,{className:"whitespace-nowrap text-muted-foreground",children:DP(_.ts)}),o.jsx(Je,{children:o.jsx(Ce,{variant:Qp(_.kind,_.outcome),children:x.label})}),o.jsx(Je,{className:"max-w-[280px] font-mono text-[12px]",children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{className:te(_.requestId&&"cursor-help"),children:_.requestId?Cb(_.requestId):OP(_)})}),_.requestId&&o.jsx(dn,{children:_.requestId})]})}),o.jsx(Je,{children:o.jsx(Ce,{variant:Qp(_.kind,_.outcome),children:_.outcome??"-"})}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:_.txHash?Cb(_.txHash,6,4):"-"}),o.jsx(Je,{className:"text-right",children:o.jsx(ie,{asChild:!0,variant:"ghost",size:"icon","aria-label":`Inspect event ${_.id}`,children:o.jsx(Cr,{href:`/events/${_.id}`,"data-testid":"events-row-link",children:o.jsx(WC,{"aria-hidden":"true"})})})})]},_.id)})})]})}),l.hasNextPage&&o.jsxs(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"events-load-more",disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},className:"self-start",children:[l.isFetchingNextPage&&o.jsx(Pp,{className:"animate-spin","aria-hidden":"true"}),l.isFetchingNextPage?"Loading":"Load more"]})]})]})]})}function PP(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().replace("T"," ").slice(0,19)} UTC`}function BP(e){return e==="base"?"https://basescan.org":"https://sepolia.basescan.org"}function Gi({label:e,children:t}){return o.jsxs("div",{className:"grid gap-1 py-2 sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-4",children:[o.jsx("dt",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:e}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:t})]})}function IP(){const t=If().id??"",{data:r}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap()}),{data:n,isLoading:s,isError:i,error:l,refetch:a}=Oe({queryKey:["activity-events","detail",t],queryFn:()=>he.getActivityEvent(t),enabled:t.length>0}),c=n?nf(n.kind):null,d=BP(r==null?void 0:r.chain);return o.jsxs("main",{"data-testid":"event-detail",className:"mx-auto flex w-full max-w-4xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:c?c.label:"Event"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:["Event ",t]})]}),o.jsx(ie,{asChild:!0,variant:"secondary",size:"sm",children:o.jsxs(Cr,{href:"/events","data-testid":"event-detail-back",children:[o.jsx(UD,{"aria-hidden":"true"}),"Events"]})})]}),s&&o.jsxs("div",{"data-testid":"event-detail-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Pp,{className:"animate-spin","aria-hidden":"true"}),"Loading event"]}),i&&o.jsxs(nt,{variant:"blocking","data-testid":"event-detail-error",children:[o.jsx(It,{children:"Event unavailable"}),o.jsxs(at,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:(l==null?void 0:l.status)===404?"This event could not be found.":l instanceof Error?l.message:"Failed to load this event."}),o.jsx(ie,{type:"button",size:"sm",variant:"secondary",onClick:()=>{a()},children:"Retry"})]})]}),n&&c&&o.jsxs(o.Fragment,{children:[o.jsxs(be,{"data-testid":"event-detail-summary",children:[o.jsxs(ir,{children:[o.jsx(pn,{children:"Summary"}),o.jsx(Ns,{children:c.description})]}),o.jsxs(et,{className:"flex flex-wrap gap-2",children:[o.jsx(Ce,{variant:Qp(n.kind,n.outcome),children:n.outcome??"-"}),o.jsx(Ce,{variant:"outline",children:PP(n.ts)})]})]}),o.jsxs(be,{"data-testid":"event-detail-payload",children:[o.jsxs(ir,{children:[o.jsx(pn,{children:"Details"}),o.jsx(Ns,{children:"Raw event fields from the persistent activity log."})]}),o.jsx(et,{children:o.jsxs("dl",{className:"m-0",children:[o.jsx(Gi,{label:"Event id",children:n.id}),o.jsx(st,{}),o.jsx(Gi,{label:"Kind",children:n.kind}),o.jsx(st,{}),o.jsx(Gi,{label:"Request id",children:n.requestId??"-"}),o.jsx(st,{}),o.jsx(Gi,{label:"Service index",children:n.serviceIndex!==null?n.serviceIndex:"-"}),o.jsx(st,{}),o.jsx(Gi,{label:"Solver type",children:n.solverType??"-"}),o.jsx(st,{}),o.jsx(Gi,{label:"Transaction",children:n.txHash?o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"h-auto justify-start p-0 font-mono text-[12px] normal-case tracking-normal",children:o.jsxs("a",{"data-testid":"event-detail-tx-link",href:`${d}/tx/${n.txHash}`,target:"_blank",rel:"noreferrer",children:[n.txHash,o.jsx(Co,{"aria-hidden":"true"})]})}):"-"}),o.jsx(st,{}),o.jsx(Gi,{label:"Detail",children:n.detail??"-"})]})})]})]})]})}function El(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function ta(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${Eb(t,18,t>=r?4:6)} ETH`:t>=s?`${Eb(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function Eb(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function jb(e){const t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw new Error("not a non-negative integer");return BigInt(t)}const kb={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function HP(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function zP(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 FP({status:e}){const t=kb[e]??kb.launching;return o.jsx(Ce,{variant:t.variant,className:"whitespace-nowrap",children:t.label})}function UP({postCounts:e,loading:t,error:r}){let n;return r?n=o.jsx("span",{className:"text-[var(--wane)]",children:"posts unavailable"}):t&&!e?n=o.jsx("span",{className:"text-[var(--fg-dim)]",children:"…"}):!e||e.h24===0?n=o.jsx("span",{className:"text-[var(--fg-dim)]",children:"No recent posts"}):n=o.jsxs("span",{className:"text-[var(--fg-muted)]",children:[e.h1," · ",e.h6," · ",e.h24]}),o.jsxs("div",{"data-testid":"launcher-owned-row-postcounts",className:"flex flex-col items-end gap-0.5 font-mono text-[12px]",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:"recent posts (1h · 6h · 24h)"}),n]})}function $P({label:e}){return o.jsx(Ce,{"data-testid":"launcher-owned-row-role",variant:"outline",className:"normal-case tracking-[0.12em] text-[var(--fg-muted)]",children:e})}function VP({record:e,postCounts:t,postCountsLoading:r,postCountsError:n}){const[,s]=gn(),i=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,l=e.summary,a=(l==null?void 0:l.name)??e.solverNetId,c=l!==void 0?`${l.contractId}.${l.contractVersion}`:null;return o.jsx("a",{href:i,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":l!==void 0?"true":"false",onClick:d=>{d.preventDefault(),s(i)},className:"block text-inherit no-underline",children:o.jsxs(be,{className:te("grid grid-cols-[1fr_auto] items-center gap-4 p-4","transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer"),children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("div",{"data-testid":"launcher-owned-row-primary",className:te("truncate text-foreground",l!==void 0?"font-serif text-[18px] font-normal tracking-[-0.01em]":"font-mono text-[14px] font-medium"),children:a}),c!==null&&o.jsx("div",{"data-testid":"launcher-owned-row-contract",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:c}),l!==void 0&&o.jsxs("div",{"data-testid":"launcher-owned-row-prices",className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["solution ",ta(l.solutionPriceWei)]}),o.jsxs("span",{children:["verdict ",ta(l.verdictPriceWei)]})]}),l!==void 0&&l.openRoles.length>0&&o.jsx("div",{"data-testid":"launcher-owned-row-roles",className:"flex flex-wrap gap-1.5",children:l.openRoles.map(d=>o.jsx($P,{label:d},d))}),o.jsxs("div",{className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["cid ",HP(e.manifestCid)]}),o.jsxs("span",{children:["launched ",zP(e.launchedAt)]})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-2",children:[o.jsx(FP,{status:e.status}),o.jsx(UP,{postCounts:t,loading:r,error:n})]})]})})}function qP(){return o.jsxs(be,{"data-testid":"launcher-empty-state",className:"flex flex-col gap-3.5 p-8",children:[o.jsx("h2",{className:"m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground",children:"No SolverNets created yet."}),o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-[var(--fg-muted)]",children:"Create a SolverNet to direct operators toward a specific kind of knowledge work."}),o.jsx("div",{children:o.jsx(ie,{asChild:!0,variant:"default",size:"lg",children:o.jsx(Cr,{href:"/launcher/create",children:"Create SolverNet"})})})]})}function WP(){var c;const{data:e,isLoading:t,isError:r,error:n,refetch:s}=Oe({queryKey:["solvernets","launched","owned"],queryFn:()=>he.solvernets.listLaunched(),refetchInterval:3e4}),i=((e==null?void 0:e.records)??[]).map(d=>d.manifestCid),l=Oe({queryKey:["discovery","task-post-counts","launcher",i],queryFn:()=>he.discovery.getTaskPostCounts(i),enabled:i.length>0,refetchInterval:3e4}),a=(c=l.data)==null?void 0:c.byCid;return o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex items-end justify-between",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal text-foreground",children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&o.jsx(ie,{asChild:!0,variant:"default","data-testid":"launcher-create-cta",children:o.jsx(Cr,{href:"/launcher/create",children:"Create SolverNet"})})]}),t&&o.jsx("p",{"data-testid":"launcher-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"}),r&&o.jsxs(nt,{"data-testid":"launcher-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(It,{className:"font-mono text-[13px] font-medium text-destructive",children:"Failed to load your SolverNets."}),o.jsx(at,{className:"text-[12px] text-[var(--fg-muted)]",children:n instanceof Error?n.message:"Unknown error"})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>{s()},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&o.jsx(qP,{}),!t&&!r&&e&&e.records.length>0&&o.jsx("div",{className:"flex flex-col gap-2",children:e.records.map(d=>o.jsx(VP,{record:d,postCounts:a==null?void 0:a[d.manifestCid],postCountsLoading:l.isLoading,postCountsError:l.isError},d.solverNetId))})]})}const St=C.forwardRef(({className:e,type:t,...r},n)=>o.jsx("input",{type:t,ref:n,className:te("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-[13px] text-foreground transition-colors","placeholder:text-[var(--fg-dim)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r}));St.displayName="Input";var GP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KP=GP.reduce((e,t)=>{const r=Iv(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),YP="Label",bj=C.forwardRef((e,t)=>o.jsx(KP.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));bj.displayName=YP;var Sj=bj;const Vr=C.forwardRef(({className:e,...t},r)=>o.jsx(Sj,{ref:r,className:te("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)] peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Vr.displayName=Sj.displayName;function ZP({current:e,total:t=5}){return o.jsxs("div",{"data-testid":"launcher-create-progress",className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-[0.14em] text-fg-muted",children:[o.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex max-w-[320px] flex-1 gap-1",children:Array.from({length:t}).map((r,n)=>{const s=n+1,i=s<=e;return o.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":i?"true":"false",className:te("h-[3px] flex-1 rounded-sm",i?"bg-accent-sky":"bg-border")},s)})})]})}function La({step:e,total:t=5,title:r,blurb:n,children:s,footer:i,error:l}){return o.jsxs("main",{"data-testid":`launcher-create-step-${e}`,className:"mx-auto flex max-w-[720px] flex-col gap-5 p-6",children:[o.jsx(ZP,{current:e,total:t}),o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground",children:r}),n&&o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-fg-muted",children:n})]}),l&&o.jsx(nt,{variant:"blocking","data-testid":"launcher-create-error",className:"font-mono text-[13px]",children:o.jsx(at,{children:l})}),o.jsx("div",{className:"flex flex-col gap-4",children:s}),o.jsx(st,{}),o.jsx("div",{className:"flex items-center justify-between gap-3",children:i})]})}function Pa({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:i}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{children:e&&o.jsx(ie,{type:"button",variant:"secondary",size:"lg","data-testid":"launcher-create-back",onClick:e,disabled:s,children:"Back"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[i,t&&o.jsx(ie,{type:"button",size:"lg","data-testid":"launcher-create-next",onClick:t,disabled:n||s,children:r})]})]})}function Mt({label:e,helperText:t,error:r,children:n,asLabel:s=!0}){const i=o.jsxs(o.Fragment,{children:[o.jsx(Vr,{children:e}),n,r?o.jsx("span",{className:"font-mono text-[12px] text-break-red",children:r}):t&&o.jsx("span",{className:"font-mono text-[11px] text-fg-dim",children:t})]});return s?o.jsx("label",{className:"flex flex-col gap-1.5",children:i}):o.jsx("div",{className:"flex flex-col gap-1.5",children:i})}const XP="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function Rb({draft:e,onAdvance:t,busy:r,error:n}){const[s,i]=C.useState(e.name??""),[l,a]=C.useState(e.description??""),[c,d]=C.useState(!1),p=c&&s.trim().length===0?"Name is required.":null,u=c&&l.trim().length===0?"Description is required.":null,g=async _=>{_==null||_.preventDefault(),d(!0),!(s.trim().length===0||l.trim().length===0)&&await t({name:s.trim(),description:l.trim(),completedSteps:El(e.completedSteps,"define")})};return o.jsx(La,{step:1,title:"Name your SolverNet",blurb:"Pick a short, recognisable name and describe what kind of knowledge work this SolverNet directs operators toward.",error:n,footer:o.jsx(Pa,{onNext:()=>{g()},nextDisabled:s.trim().length===0||l.trim().length===0,busy:r}),children:o.jsxs("form",{onSubmit:_=>{g(_)},className:"flex flex-col gap-4",children:[o.jsx(Mt,{label:"Name",error:p,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:o.jsx(St,{"data-testid":"launcher-create-name",type:"text",value:s,onChange:_=>i(_.target.value),placeholder:"e.g. Polymarket forecasts",className:te(p&&"border-break-red"),disabled:r})}),o.jsx(Mt,{label:"Description",error:u,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:o.jsx("textarea",{"data-testid":"launcher-create-description",value:l,onChange:_=>a(_.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",className:te(XP,"min-h-[96px] resize-y",u&&"border-break-red"),disabled:r})}),o.jsx(ie,{type:"submit",className:"hidden","aria-hidden":!0,tabIndex:-1})]})})}const jl={id:"prediction",version:"v1",name:"Prediction",description:"Forecast resolved outcomes. Solvers submit a probability for a binary market; evaluators score against the on-chain resolution using Brier loss.",schemas:{task:{name:"prediction.v1 Task",description:"A binary Polymarket market with resolution time, condition id, and orderbook snapshot."},solution:{name:"prediction.v1 Solution",description:"A scalar probability in [0, 1] that the market resolves YES."},verdict:{name:"prediction.v1 Verdict",description:"Brier-loss score derived from the solver probability and the resolved outcome."}},evaluationFunction:{id:"prediction.brier-loss.v1",deterministic:!0,inputs:["prediction.v1 Task","prediction.v1 Solution","Polymarket/UMA resolution"],output:"prediction.v1 Verdict"},aggregationFunction:{id:"prediction.trailing-mean-brier-spread.v1",deterministic:!0,inputs:["SCORED prediction.v1 Verdicts"],output:"trailing mean brierSpread",windowDays:84},claimPolicyDefaults:{mode:"parallel",maxClaims:25,maxClaimsPerOperator:1,claimLeaseTtlSeconds:30*60},credentialRequirements:{creator:[{id:"polymarket.public.market-data.read",kind:"public-api",required:!0,description:"Read public Polymarket market metadata and orderbook snapshots for Task creation."}],solver:[],evaluator:[{id:"polymarket.public.resolution.read",kind:"public-api",required:!0,description:"Read public Polymarket/UMA final market state for resolution mapping."}]},generatorDefaults:{cadenceMs:6*60*60*1e3,submissionWindowMs:6*60*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:"10000",minVolume24hUsd:"2500",maxYesSpread:"0.10",maxOrderbookAgeSeconds:60}},wj={id:"swe-rebench-v2",version:"v1",name:"SWE-rebench v2",description:"Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.",schemas:{task:{name:"swe-rebench-v2.v1 Task",description:"A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement."},solution:{name:"swe-rebench-v2.v1 Solution",description:"A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload."},verdict:{name:"swe-rebench-v2.v1 Verdict",description:"Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata."}},evaluationFunction:{id:"swe-rebench-v2.docker-test-suite.v1",deterministic:!0,inputs:["swe-rebench-v2.v1 Task","swe-rebench-v2.v1 Solution","per-instance Docker image"],output:"swe-rebench-v2.v1 Verdict"},aggregationFunction:{id:"swe-rebench-v2.multi-winrate.v1",deterministic:!0,inputs:["SCORED swe-rebench-v2.v1 Verdicts"],output:"mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate",windowDays:30},claimPolicyDefaults:{mode:"parallel",maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60},credentialRequirements:{creator:[{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits."}],solver:[],evaluator:[{id:"docker.local.run",kind:"local-runtime",required:!0,description:"Run per-instance Docker images that ship with the upstream eval.py harness."},{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS."}]},generatorDefaults:{N_target_successes:5,posting_window_ms:24*60*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:60*60}},Jp={"prediction.v1":jl,"swe-rebench-v2.v1":wj},QP="prediction.v1",JP="font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim";function e6({draft:e,template:t=jl,onAdvance:r,onBack:n,busy:s,error:i}){const l=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:El(e.completedSteps,"reviewContract")})};return o.jsx(La,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:i,footer:o.jsx(Pa,{onBack:n,onNext:l,busy:s}),children:o.jsx(be,{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,children:o.jsxs(et,{className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:JP,children:[t.id,".",t.version]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:t.name}),o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:t.description})]}),o.jsxs(Bl,{title:"Schemas",children:[o.jsx(vr,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),o.jsx(vr,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),o.jsx(vr,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),o.jsxs(Bl,{title:"Evaluation function",children:[o.jsx(vr,{label:"Id",value:t.evaluationFunction.id,mono:!0}),o.jsx(vr,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),o.jsx(vr,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),o.jsx(vr,{label:"Output",value:t.evaluationFunction.output})]}),o.jsxs(Bl,{title:"Aggregation function",children:[o.jsx(vr,{label:"Id",value:t.aggregationFunction.id,mono:!0}),o.jsx(vr,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),o.jsx(vr,{label:"Output",value:t.aggregationFunction.output})]}),o.jsxs(Bl,{title:"Claim policy defaults",children:[o.jsx(vr,{label:"Mode",value:t.claimPolicyDefaults.mode}),o.jsx(vr,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),o.jsx(vr,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),o.jsx(vr,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),o.jsxs(Bl,{title:"Credential requirements",children:[o.jsx(im,{role:"creator",creds:t.credentialRequirements.creator}),o.jsx(im,{role:"solver",creds:t.credentialRequirements.solver}),o.jsx(im,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})})}function Bl({title:e,children:t}){return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx(st,{}),o.jsx("h3",{className:te("m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted"),children:e}),o.jsx("div",{className:"flex flex-col gap-1.5",children:t})]})}function vr({label:e,value:t,hint:r,mono:n}){return o.jsxs("div",{className:"grid grid-cols-[140px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:te("text-[13px] text-foreground",n?"font-mono":"font-sans"),children:t}),r&&o.jsx("span",{className:"font-mono text-[12px] leading-relaxed text-fg-muted",children:r})]})]})}function im({role:e,creds:t}){return o.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim",children:e}),t.length===0?o.jsx("div",{className:"text-[12px] text-fg-muted",children:"None."}):t.map(r=>o.jsxs("div",{className:"flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-accent-sky",children:r.id}),o.jsx(Ce,{variant:"secondary",children:r.kind}),r.required&&o.jsx(Ce,{variant:"warning",children:"required"})]}),o.jsx("div",{className:"text-fg-muted",children:r.description})]},r.id))]})}const Nb="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-y";function t6(e){const t=e.template??jl;switch(t.id){case"prediction":return o.jsx(n6,{...e,template:t});case"swe-rebench-v2":return o.jsx(i6,{...e,template:t});default:return o.jsx(La,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:o.jsx(Pa,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:o.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const Tb=6e4;function En(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function Ab(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function r6(e){const t=jl.generatorDefaults,r=60*60*1e3;return{cadenceMs:En(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:En((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:En(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:En(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:En(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:En(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:Ab(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:Ab(e==null?void 0:e.blocklistConditionIds)}}function Db(e){const t={},r=jn(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<Tb&&(t.cadenceMs=`Cadence must be at least ${Tb/1e3}s.`);const n=jn(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=jn(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const i=jn(e.maxNewRoundsPerPoll);i===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const l=jn(e.maxNewRoundsPerDay);l===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const a=jn(e.maxOpenRounds);return a===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:i,maxNewRoundsPerDay:l,maxOpenRounds:a,allowlistConditionIds:Ob(e.allowlistConditionIds),blocklistConditionIds:Ob(e.blocklistConditionIds)}}}function jn(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 Ob(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function n6({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>r6(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,d]=C.useState(!1),p=c?Db(l):{ok:!0,errors:{}},u=c?p.errors:{},g=()=>{d(!0);const x=Db(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:El(e.completedSteps,"configureGenerator")})},_=(x,b)=>{a(h=>({...h,[x]:b}))};return o.jsxs(La,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:s,footer:o.jsx(Pa,{onBack:r,onNext:g,busy:n,nextDisabled:c&&!p.ok}),children:[o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(Mt,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:u.cadenceMs??null,children:o.jsx(St,{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:l.cadenceMs,onChange:x=>_("cadenceMs",x.target.value),className:te(u.cadenceMs&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:u.windowMs??null,children:o.jsx(St,{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:l.windowMs,onChange:x=>_("windowMs",x.target.value),className:te(u.windowMs&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:u.resolveGapMs??null,children:o.jsx(St,{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:l.resolveGapMs,onChange:x=>_("resolveGapMs",x.target.value),className:te(u.resolveGapMs&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:u.maxNewRoundsPerPoll??null,children:o.jsx(St,{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerPoll,onChange:x=>_("maxNewRoundsPerPoll",x.target.value),className:te(u.maxNewRoundsPerPoll&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:u.maxNewRoundsPerDay??null,children:o.jsx(St,{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerDay,onChange:x=>_("maxNewRoundsPerDay",x.target.value),className:te(u.maxNewRoundsPerDay&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:u.maxOpenRounds??null,children:o.jsx(St,{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:l.maxOpenRounds,onChange:x=>_("maxOpenRounds",x.target.value),className:te(u.maxOpenRounds&&"border-break-red"),disabled:n})})]}),o.jsx(Mt,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:o.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:l.allowlistConditionIds,onChange:x=>_("allowlistConditionIds",x.target.value),rows:2,placeholder:"0xabc…, 0xdef…",className:Nb,disabled:n})}),o.jsx(Mt,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:o.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:l.blocklistConditionIds,onChange:x=>_("blocklistConditionIds",x.target.value),rows:2,placeholder:"0xabc…",className:Nb,disabled:n})})]})}function s6(e){const t=wj.generatorDefaults,r=typeof(e==null?void 0:e.claimPolicy)=="object"&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:En(e==null?void 0:e.N_target_successes,t.N_target_successes),posting_window_ms:En(e==null?void 0:e.posting_window_ms,t.posting_window_ms),post_batch_size:En(e==null?void 0:e.post_batch_size,t.post_batch_size),maxClaimsPerOperator:En((e==null?void 0:e.maxClaimsPerOperator)??r.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:En((e==null?void 0:e.claimLeaseTtlSeconds)??r.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function Mb(e){const t={},r=jn(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=jn(e.posting_window_ms);n===null&&(t.posting_window_ms="Must be a positive integer (ms).");const s=jn(e.post_batch_size);s===null&&(t.post_batch_size="Must be a positive integer.");const i=jn(e.maxClaimsPerOperator);i===null&&(t.maxClaimsPerOperator="Must be a positive integer.");const l=jn(e.claimLeaseTtlSeconds);return l===null&&(t.claimLeaseTtlSeconds="Must be a positive integer (seconds)."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,posting_window_ms:n,post_batch_size:s,maxClaimsPerOperator:i,claimLeaseTtlSeconds:l}}}function i6({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>s6(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,d]=C.useState(!1),p=c?Mb(l):{ok:!0,errors:{}},u=c?p.errors:{},g=()=>{d(!0);const x=Mb(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:El(e.completedSteps,"configureGenerator")})},_=(x,b)=>{a(h=>({...h,[x]:b}))};return o.jsx(La,{step:3,title:"Configure generator",blurb:"The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.",error:s,footer:o.jsx(Pa,{onBack:r,onNext:g,busy:n,nextDisabled:c&&!p.ok}),children:o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(Mt,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:u.N_target_successes??null,children:o.jsx(St,{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:l.N_target_successes,onChange:x=>_("N_target_successes",x.target.value),className:te(u.N_target_successes&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Posting window (ms)",helperText:"On-chain claim-window deadline for each posting. Reposts trigger on claim-budget exhaustion observed via the indexer, not this window.",error:u.posting_window_ms??null,children:o.jsx(St,{"data-testid":"launcher-create-posting_window_ms",type:"text",inputMode:"numeric",value:l.posting_window_ms,onChange:x=>_("posting_window_ms",x.target.value),className:te(u.posting_window_ms&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Post batch size",helperText:"Maximum number of SWE instances to post in one creator tick.",error:u.post_batch_size??null,children:o.jsx(St,{"data-testid":"launcher-create-post_batch_size",type:"text",inputMode:"numeric",value:l.post_batch_size,onChange:x=>_("post_batch_size",x.target.value),className:te(u.post_batch_size&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Max claims per operator",helperText:"Optional cap; each posting is still limited by remaining target successes.",error:u.maxClaimsPerOperator??null,children:o.jsx(St,{"data-testid":"launcher-create-maxClaimsPerOperator",type:"text",inputMode:"numeric",value:l.maxClaimsPerOperator,onChange:x=>_("maxClaimsPerOperator",x.target.value),className:te(u.maxClaimsPerOperator&&"border-break-red"),disabled:n})}),o.jsx(Mt,{label:"Claim lease (seconds)",helperText:"How long a claimed SWE task slot stays leased.",error:u.claimLeaseTtlSeconds??null,children:o.jsx(St,{"data-testid":"launcher-create-claimLeaseTtlSeconds",type:"text",inputMode:"numeric",value:l.claimLeaseTtlSeconds,onChange:x=>_("claimLeaseTtlSeconds",x.target.value),className:te(u.claimLeaseTtlSeconds&&"border-break-red"),disabled:n})})]})})}function a6(e,t){const r={};let n,s;try{n=jb(e),n===null?r.solutionPriceWei="Required.":n<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",n=null}try{s=jb(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return n!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:s??void 0}}function o6(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const i=t+r*BigInt(n);return i<=0n?null:{tasks:Number(s/i),perTaskWei:i}}function l6({draft:e,template:t=jl,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:i,busy:l,error:a}){var v,y;const[c,d]=C.useState(e.solutionPriceWei??""),[p,u]=C.useState(e.verdictPriceWei??""),[g,_]=C.useState(!1),x=C.useMemo(()=>a6(c,p),[c,p]),b=t.claimPolicyDefaults.maxClaimsPerOperator,h=C.useMemo(()=>o6(i??null,x.solutionWei,x.verdictWei,b),[i,x.solutionWei,x.verdictWei,b]),f=()=>{_(!0),x.ok&&r({solutionPriceWei:c,verdictPriceWei:p,completedSteps:El(e.completedSteps,"configurePricing")})},m=g?x.errors:{};return o.jsxs(La,{step:4,title:"Configure pricing",blurb:"Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.",error:a,footer:o.jsx(Pa,{onBack:n,onNext:f,busy:l,nextDisabled:g&&!x.ok}),children:[o.jsx(Mt,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",asLabel:!1,children:o.jsx("div",{"data-testid":"launcher-create-fundingSafe",className:"rounded-md border border-border bg-surface-sunken px-3 py-2.5 font-mono text-[13px] text-fg-muted break-all",children:s??"— (master Safe will be picked at launch)"})}),o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(Mt,{label:"Solution price (wei)",helperText:`≈ ${ta((v=x.solutionWei)==null?void 0:v.toString())}`,error:m.solutionPriceWei??null,children:o.jsx(St,{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:c,onChange:S=>d(S.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",className:te(m.solutionPriceWei&&"border-break-red"),disabled:l})}),o.jsx(Mt,{label:"Verdict price (wei)",helperText:`≈ ${ta((y=x.verdictWei)==null?void 0:y.toString())}`,error:m.verdictPriceWei??null,children:o.jsx(St,{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:p,onChange:S=>u(S.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",className:te(m.verdictPriceWei&&"border-break-red"),disabled:l})})]}),m.combined&&o.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",className:"font-mono text-[12px] text-break-red",children:m.combined}),o.jsx(be,{"data-testid":"launcher-create-projection",children:o.jsxs(et,{className:"flex flex-col gap-2.5 p-5",children:[o.jsx("h3",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted",children:"Runway projection"}),o.jsx(st,{}),o.jsx(am,{label:"Safe balance",value:i?`${ta(i)} (${i} wei)`:"—"}),o.jsx(am,{label:"Per-Task cost",value:h?`${ta(h.perTaskWei.toString())} (${h.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${b})`}),o.jsx(am,{label:"Projected Tasks",value:h?`~${h.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})})]})}function am({label:e,value:t,hint:r,testId:n}){return o.jsxs("div",{"data-testid":n,className:"grid grid-cols-[160px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t}),r&&o.jsx("span",{className:"text-[12px] text-fg-muted",children:r})]})]})}const c6=1500,Lb=["pinning","recording","broadcasting","confirming","spawning"],u6={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function d6({draft:e,template:t=jl,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:i,pollIntervalMs:l=c6}){const[,a]=gn(),c=i??a,d=C.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[p,u]=C.useState(d),[g,_]=C.useState({kind:"idle"}),x=C.useRef(!1);C.useEffect(()=>()=>{x.current=!0},[]);const b=v=>{u(y=>y.includes(v)?y.filter(S=>S!==v):[...y,v])},h=async()=>{var v,y,S;if(p.length!==0){_(E=>E.kind==="failed"?{kind:"idle"}:E),x.current=!1;try{await r({openRoles:p,completedSteps:El(e.completedSteps,"configurePricing")});const E=await he.solvernets.launch(e.draftId);if(x.current)return;let k="pinning";for(_({kind:"launching",phase:k,solverNetId:E.solverNetId});;){if(x.current)return;let w;try{w=await he.solvernets.get(E.solverNetId)}catch{if(x.current)return;await Hb(l);continue}if((v=w.launchProgress)!=null&&v.phase&&(k=w.launchProgress.phase),w.status==="launched"){_({kind:"launching",phase:"spawning",solverNetId:E.solverNetId}),c(`/launcher/launched/${encodeURIComponent(E.solverNetId)}`);return}if(w.status==="failed"){const j=((S=(y=w.launchProgress)==null?void 0:y.txError)==null?void 0:S.message)??`Launch failed during ${k}.`;_({kind:"failed",message:j,solverNetId:E.solverNetId}),s==null||s();return}_({kind:"launching",phase:k,solverNetId:E.solverNetId}),await Hb(l)}}catch(E){if(x.current)return;_({kind:"failed",message:E instanceof Error?E.message:String(E)}),s==null||s()}}},f=g.kind==="launching",m=p.length===0||f;return o.jsxs(La,{step:5,title:"Review & launch",blurb:"One last check. The Launch button signs the manifest, pins it to IPFS, and broadcasts the registry transaction.",footer:o.jsx(Pa,{onBack:n,onNext:()=>{h()},nextLabel:f?"Launching…":"Launch",nextDisabled:m,busy:f,right:f&&o.jsx(f6,{current:g.kind==="launching"?g.phase:"pinning"})}),children:[o.jsx(h6,{draft:e,template:t}),o.jsxs(Mt,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",asLabel:!1,children:[o.jsxs("div",{"data-testid":"launcher-create-openRoles",className:"flex flex-col gap-2.5",children:[o.jsx(Ib,{role:"solver",checked:p.includes("solver"),onChange:()=>b("solver"),disabled:f}),o.jsx(Ib,{role:"evaluator",checked:p.includes("evaluator"),onChange:()=>b("evaluator"),disabled:f})]}),p.length===0&&o.jsx("span",{"data-testid":"launcher-create-openRoles-error",className:"font-mono text-[12px] text-break-red",children:"At least one role must be open."})]}),g.kind==="failed"&&o.jsxs(nt,{variant:"blocking","data-testid":"launcher-create-launch-failure",children:[o.jsx(It,{className:"font-mono text-[13px] font-medium text-break-red",children:"Launch failed."}),o.jsx(at,{className:"font-mono text-[12px] text-fg-muted",children:g.message}),o.jsxs("div",{className:"mt-2.5 flex gap-2",children:[o.jsx(ie,{type:"button",size:"sm","data-testid":"launcher-create-launch-retry",onClick:()=>{h()},children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-create-launch-abandon",onClick:()=>{c("/launcher")},children:"Abandon"})]})]})]})}function f6({current:e}){const t=Lb.indexOf(e);return o.jsxs("div",{"data-testid":"launcher-create-launch-progress","data-phase":e,className:"flex items-center gap-1.5 font-mono text-[11px] tracking-[0.06em] text-fg-muted",children:[o.jsx("span",{"data-testid":"launcher-create-launch-phase",children:u6[e]}),o.jsx("div",{className:"flex gap-[3px]",children:Lb.map((r,n)=>o.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",className:te("h-[3px] w-2 rounded-sm",n<=t?"bg-accent-sky":"bg-border")},r))})]})}function h6({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return o.jsx(be,{"data-testid":"launcher-create-manifest-summary",children:o.jsxs(et,{className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim",children:[n,".",s]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:e.name??"— unnamed"}),e.description&&o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:e.description})]}),o.jsx(st,{}),o.jsxs(g6,{children:[o.jsx(Un,{label:"Solution price",value:Pb(e.solutionPriceWei)}),o.jsx(Un,{label:"Verdict price",value:Pb(e.verdictPriceWei)}),t.id==="prediction"?o.jsx(m6,{generator:r}):o.jsx(p6,{generator:r})]})]})})}function m6({generator:e}){const t=ko(e.cadenceMs),r=ko(e.windowMs??e.submissionWindowMs),n=ko(e.maxOpenRounds);return o.jsxs(o.Fragment,{children:[o.jsx(Un,{label:"Cadence",value:t?`${t} ms`:"—"}),o.jsx(Un,{label:"Window",value:r?`${r} ms`:"—"}),o.jsx(Un,{label:"Max open rounds",value:n??"—"}),o.jsx(Un,{label:"Allowlist",value:Bb(e.allowlistConditionIds)}),o.jsx(Un,{label:"Blocklist",value:Bb(e.blocklistConditionIds)})]})}function p6({generator:e}){const t=ko(e.N_target_successes),r=ko(e.posting_window_ms),n=ko(e.post_batch_size);return o.jsxs(o.Fragment,{children:[o.jsx(Un,{label:"Target successes",value:t??"—"}),o.jsx(Un,{label:"Posting window",value:r?`${r} ms`:"—"}),o.jsx(Un,{label:"Batch size",value:n??"—"})]})}function Pb(e){return e?`${e} wei (${ta(e)})`:"—"}function ko(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function Bb(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function g6({children:e}){return o.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2",children:e})}function Un({label:e,value:t}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim",children:e}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t})]})}function Ib({role:e,checked:t,onChange:r,disabled:n}){return o.jsxs("label",{className:te("flex items-center gap-2.5",n?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[o.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n,className:"h-4 w-4 cursor-pointer accent-accent-sky"}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:e})]})}function Hb(e){return new Promise(t=>setTimeout(t,e))}const eg="jinn.launcher-create.draftId.v1";function v6(){if(typeof window>"u")return null;try{return window.localStorage.getItem(eg)}catch{return null}}function zb(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(eg):window.localStorage.setItem(eg,e)}catch{}}function _6(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function y6({templateKey:e}={}){var E;const t=e??_6()??QP,r=C.useMemo(()=>Jp[t]??null,[t]),[n,s]=C.useState(null),[i,l]=C.useState(null),[a,c]=C.useState(1),[d,p]=C.useState(!1),[u,g]=C.useState(null),_=C.useRef(!1),{data:x}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:3e4}),{data:b}=Oe({queryKey:["status"],queryFn:()=>he.getStatus(),refetchInterval:3e4}),h=(x==null?void 0:x.master_address)??(b==null?void 0:b.master_address)??null,f=((E=b==null?void 0:b.masterGas)==null?void 0:E.balanceWei)??null;C.useEffect(()=>{if(_.current)return;_.current=!0;let k=!1;return(async()=>{const j=v6();if(j)try{const R=await he.solvernets.getDraft(j);if(k)return;s(R);return}catch{zb(null)}try{const R=await he.solvernets.createDraft();if(k)return;zb(R.draftId),s(R)}catch(R){if(k)return;l(R instanceof Error?R.message:"Failed to create draft.")}})(),()=>{k=!0}},[]);const m=async k=>{if(n){p(!0),g(null);try{const w=await he.solvernets.updateDraft(n.draftId,k);s(w),c(j=>j<5?j+1:j)}catch(w){g(w instanceof Error?w.message:String(w))}finally{p(!1)}}},v=async k=>{if(n){p(!0),g(null);try{const w=await he.solvernets.updateDraft(n.draftId,k);s(w)}catch(w){g(w instanceof Error?w.message:String(w))}finally{p(!1)}}},y=()=>{g(null),c(k=>k>1?k-1:k)},S=()=>{g(null)};if(r===null)return o.jsxs("main",{"data-testid":"launcher-create-unknown-template","data-template-key":t,className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Unknown SolverNet template"}),o.jsx(nt,{variant:"blocking",children:o.jsxs(at,{className:"font-mono text-[13px]",children:["No template registered for ",o.jsx("code",{children:t}),". Available keys:"," ",Object.keys(Jp).map(k=>`?template=${k}`).join(", "),"."]})})]});if(i)return o.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Couldn't start a new draft"}),o.jsxs(nt,{variant:"blocking",children:[o.jsx(It,{className:"font-mono text-[12px]",children:"Bootstrap error"}),o.jsx(at,{className:"font-mono text-[13px]",children:i})]})]});if(!n)return o.jsx("main",{"data-testid":"launcher-create-loading",className:"p-6 font-mono text-[13px] text-fg-muted",children:"Loading draft…"});switch(a){case 1:return o.jsx(Rb,{draft:n,onAdvance:m,busy:d,error:u});case 2:return o.jsx(e6,{draft:n,template:r,onAdvance:m,onBack:y,busy:d,error:u});case 3:return o.jsx(t6,{draft:n,template:r,onAdvance:m,onBack:y,busy:d,error:u});case 4:return o.jsx(l6,{draft:n,template:r,onAdvance:m,onBack:y,fundingSafeAddress:h,fundingSafeBalanceWei:f??null,busy:d,error:u});case 5:return o.jsx(d6,{draft:n,template:r,onUpdateDraft:v,onBack:y,onLaunchFailure:S});default:return o.jsx(Rb,{draft:n,onAdvance:m,busy:d,error:u})}}function Cj(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function Ej(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function Qf(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 x6={launched:["paused","retired"],paused:["launched","retired"]};function Fb(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function hi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${Fb(t,18,t>=r?4:6)} ETH`:t>=s?`${Fb(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function b6(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let n;try{n=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(n/s),perTaskWei:s}}const Ub=6e4;function S6(e){const t=e??{};return{cadenceMs:kn(t.cadenceMs),windowMs:kn(t.windowMs??t.submissionWindowMs),resolveGapMs:kn(t.resolveGapMs),maxNewRoundsPerPoll:kn(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:kn(t.maxNewRoundsPerDay),maxOpenRounds:kn(t.maxOpenRounds),allowlistConditionIds:$b(t.allowlistConditionIds),blocklistConditionIds:$b(t.blocklistConditionIds)}}function w6(e,t){const r=e??{},n=C6(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:kn(r.N_target_successes),posting_window_ms:kn(r.posting_window_ms),post_batch_size:kn(r.post_batch_size),maxClaimsPerOperator:kn(r.maxClaimsPerOperator??n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:kn(r.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function C6(e){return typeof e=="object"&&e!==null?e:{}}function kn(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function $b(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function jj(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 E6(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function j6(e,t){const r={},n={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=jj(e[s]);if(i===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&i<Ub){r[s]=`Cadence must be at least ${Ub/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=i:n[s]=i}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=E6(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function k6(e,t){const r={},n={};for(const s of["N_target_successes","posting_window_ms","post_batch_size","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=jj(e[s]);if(i===null){r[s]=s==="posting_window_ms"?"Must be a positive integer (ms).":s==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}n[s]=i}return{ok:Object.keys(r).length===0,patch:n,errors:r}}function R6(e,t){var n;if(t)return t.id==="swe-rebench-v2"&&t.version==="v1";if(((n=e.summary)==null?void 0:n.contractId)==="swe-rebench-v2"&&e.summary.contractVersion==="v1")return!0;const r=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(r,"N_target_successes")||Object.prototype.hasOwnProperty.call(r,"N_max_postings_per_task")||Object.prototype.hasOwnProperty.call(r,"posting_window_ms")||Object.prototype.hasOwnProperty.call(r,"cooldown_ms")}function N6({record:e,manifest:t,template:r,onSave:n}){return R6(e,r)?o.jsx(A6,{record:e,manifest:t,onSave:n}):o.jsx(T6,{record:e,onSave:n})}function kj({record:e,configExpanded:t,setConfigExpanded:r,children:n}){var s,i;return o.jsxs(be,{"data-testid":"launcher-launched-generator-panel",role:"region","aria-label":"Generator",className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Generator"}),o.jsx(P6,{record:e})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-generator-toggle","aria-expanded":t,"aria-controls":"launcher-launched-generator-config",onClick:()=>r(l=>!l),children:t?"Hide config":"Edit config"})]}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Ws,{label:"Last poll",value:Qf((s=e.generatorState)==null?void 0:s.lastPollAt),testid:"launcher-launched-generator-last-poll"}),o.jsx(Ws,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),o.jsx(D6,{record:e}),o.jsx(L6,{record:e}),((i=e.generatorState)==null?void 0:i.lastError)&&o.jsx(M6,{record:e}),n]})}function T6({record:e,onSave:t}){const r=C.useMemo(()=>S6(e.generatorConfig),[e.generatorConfig]),[n,s]=C.useState(r),[i,l]=C.useState({kind:"idle"}),[a,c]=C.useState(!1);C.useEffect(()=>{s(b=>JSON.stringify(b)!==JSON.stringify(x())?b:r);function x(){return r}},[JSON.stringify(e.generatorConfig)]);const d=(x,b)=>{s(h=>({...h,[x]:b}))},p=C.useMemo(()=>j6(n,r),[n,r]),u=Object.keys(p.patch).length>0,g=i.kind==="saving",_=async()=>{if(!(!p.ok||!u||g)){l({kind:"saving"});try{await t(p.patch),l({kind:"saved",at:new Date})}catch(x){l({kind:"error",message:x instanceof Error?x.message:String(x)})}}};return o.jsx(kj,{record:e,configExpanded:a,setConfigExpanded:c,children:a&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(st,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Rn,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:x=>d("cadenceMs",x),error:p.errors.cadenceMs,disabled:g}),o.jsx(Rn,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:x=>d("windowMs",x),error:p.errors.windowMs,disabled:g}),o.jsx(Rn,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:x=>d("resolveGapMs",x),error:p.errors.resolveGapMs,disabled:g}),o.jsx(Rn,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:x=>d("maxNewRoundsPerPoll",x),error:p.errors.maxNewRoundsPerPoll,disabled:g}),o.jsx(Rn,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:x=>d("maxNewRoundsPerDay",x),error:p.errors.maxNewRoundsPerDay,disabled:g}),o.jsx(Rn,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:x=>d("maxOpenRounds",x),error:p.errors.maxOpenRounds,disabled:g})]}),o.jsx(Vb,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:x=>d("allowlistConditionIds",x),disabled:g}),o.jsx(Vb,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:x=>d("blocklistConditionIds",x),disabled:g}),o.jsx(Rj,{dirty:u,saving:g,validationOk:p.ok,saveStatus:i,onSubmit:_})]})})}function A6({record:e,manifest:t,onSave:r}){const n=C.useMemo(()=>w6(e.generatorConfig,t),[e.generatorConfig,t]),[s,i]=C.useState(n),[l,a]=C.useState({kind:"idle"}),[c,d]=C.useState(!1);C.useEffect(()=>{i(b=>JSON.stringify(b)!==JSON.stringify(n)?b:n)},[JSON.stringify(e.generatorConfig)]);const p=(b,h)=>{i(f=>({...f,[b]:h}))},u=C.useMemo(()=>k6(s,n),[s,n]),g=Object.keys(u.patch).length>0,_=l.kind==="saving",x=async()=>{if(!(!u.ok||!g||_)){a({kind:"saving"});try{await r(u.patch),a({kind:"saved",at:new Date})}catch(b){a({kind:"error",message:b instanceof Error?b.message:String(b)})}}};return o.jsx(kj,{record:e,configExpanded:c,setConfigExpanded:d,children:c&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(st,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Rn,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:b=>p("N_target_successes",b),error:u.errors.N_target_successes,disabled:_}),o.jsx(Rn,{label:"Posting window (ms)",testid:"launcher-launched-generator-posting_window_ms",value:s.posting_window_ms,onChange:b=>p("posting_window_ms",b),error:u.errors.posting_window_ms,disabled:_}),o.jsx(Rn,{label:"Post batch size",testid:"launcher-launched-generator-post_batch_size",value:s.post_batch_size,onChange:b=>p("post_batch_size",b),error:u.errors.post_batch_size,disabled:_})]}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Claim policy"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Rn,{label:"Max claims per operator",testid:"launcher-launched-generator-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:b=>p("maxClaimsPerOperator",b),error:u.errors.maxClaimsPerOperator,disabled:_}),o.jsx(Rn,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:b=>p("claimLeaseTtlSeconds",b),error:u.errors.claimLeaseTtlSeconds,disabled:_})]}),o.jsx(Rj,{dirty:g,saving:_,validationOk:u.ok,saveStatus:l,onSubmit:x})]})})}function Rj({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const i=e&&r&&!t;return o.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[o.jsx(st,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[o.jsx(B6,{status:n}),o.jsx(ie,{type:"button",variant:"default","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!i,children:t?"Saving…":"Save"})]})]})}function D6({record:e}){var r;const t=(r=e.generatorState)==null?void 0:r.lastPollSummary;return O6(t)?o.jsxs("dl",{"data-testid":"launcher-launched-generator-pool-summary",className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]",children:[o.jsx(Ws,{label:"Pool",value:String(t.poolSize),testid:"launcher-launched-generator-poolSize"}),o.jsx(Ws,{label:"Posted",value:String(t.posted),testid:"launcher-launched-generator-posted"}),o.jsx(Ws,{label:"Unposted",value:String(t.unposted),testid:"launcher-launched-generator-unposted"}),o.jsx(Ws,{label:"Live",value:String(t.live),testid:"launcher-launched-generator-live"}),o.jsx(Ws,{label:"Repostable",value:String(t.repostable),testid:"launcher-launched-generator-repostable"}),o.jsx(Ws,{label:"Saturated",value:String(t.saturated),testid:"launcher-launched-generator-saturated"})]}):null}function O6(e){if(typeof e!="object"||e===null)return!1;const t=e;return["poolSize","posted","unposted","live","repostable","saturated"].every(r=>typeof t[r]=="number")}function M6({record:e}){var t,r,n,s;return o.jsxs("div",{"data-testid":"launcher-launched-generator-error",className:"flex flex-col gap-1 rounded-md border border-destructive bg-card p-3",children:[o.jsxs("span",{className:"font-mono text-[12px] font-medium text-destructive",children:["Last error · ",Qf((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:(s=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:s.message})]})}function L6({record:e}){var i,l,a;const t=(i=e.generatorState)==null?void 0:i.poolPublicationUpdatedAt;if(!t)return null;const r=(l=e.generatorState)==null?void 0:l.poolPublicationPriorSize,n=(a=e.generatorState)==null?void 0:a.poolPublicationCurrentSize,s=typeof r=="number"&&typeof n=="number"?`Pool grew from ${r} → ${n} scorable tasks`:"Pool re-published";return o.jsxs(nt,{"data-testid":"launcher-launched-generator-pool-republished",variant:"default",children:[o.jsx(It,{children:"Vetted pool re-published"}),o.jsxs(at,{children:[s," · ",Qf(t)]})]})}function P6({record:e}){var s;const t=e.generatorEnabled,n=!!((s=e.generatorState)!=null&&s.lastError)?{variant:"destructive",label:"Errored"}:t?{variant:"success",label:"Enabled"}:{variant:"outline",label:"Disabled"};return o.jsx(Ce,{"data-testid":"launcher-launched-generator-state-badge",variant:n.variant,children:n.label})}function B6({status:e}){if(e.kind==="saving")return o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--vow-green)]",children:["Saved at ",t," UTC"]})}return e.kind==="error"?o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-destructive",children:["Save failed: ",e.message]}):o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Edits hot-apply without restart."})}function Rn({label:e,testid:t,value:r,onChange:n,error:s,disabled:i}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Vr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx(St,{id:t,"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:l=>n(l.target.value),disabled:i,className:te(s&&"border-destructive")}),s&&o.jsx("span",{"data-testid":`${t}-error`,className:"font-mono text-[11px] text-destructive",children:s})]})}function Vb({label:e,testid:t,value:r,onChange:n,disabled:s}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Vr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("textarea",{id:t,"data-testid":t,value:r,onChange:i=>n(i.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",className:"flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground transition-colors placeholder:text-[var(--fg-dim)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})]})}function Ws({label:e,value:t,testid:r}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("dd",{"data-testid":r,className:"m-0 font-mono text-[13px] text-foreground",children:t})]})}var om="focusScope.autoFocusOnMount",lm="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},I6="FocusScope",Jf=C.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[a,c]=C.useState(null),d=nr(s),p=nr(i),u=C.useRef(null),g=qe(t,b=>c(b)),_=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let b=function(v){if(_.paused||!a)return;const y=v.target;a.contains(y)?u.current=y:$s(u.current,{select:!0})},h=function(v){if(_.paused||!a)return;const y=v.relatedTarget;y!==null&&(a.contains(y)||$s(u.current,{select:!0}))},f=function(v){if(document.activeElement===document.body)for(const S of v)S.removedNodes.length>0&&$s(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",h);const m=new MutationObserver(f);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",h),m.disconnect()}}},[n,a,_.paused]),C.useEffect(()=>{if(a){Gb.add(_);const b=document.activeElement;if(!a.contains(b)){const f=new CustomEvent(om,qb);a.addEventListener(om,d),a.dispatchEvent(f),f.defaultPrevented||(H6(V6(Nj(a)),{select:!0}),document.activeElement===b&&$s(a))}return()=>{a.removeEventListener(om,d),setTimeout(()=>{const f=new CustomEvent(lm,qb);a.addEventListener(lm,p),a.dispatchEvent(f),f.defaultPrevented||$s(b??document.body,{select:!0}),a.removeEventListener(lm,p),Gb.remove(_)},0)}}},[a,d,p,_]);const x=C.useCallback(b=>{if(!r&&!n||_.paused)return;const h=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,f=document.activeElement;if(h&&f){const m=b.currentTarget,[v,y]=z6(m);v&&y?!b.shiftKey&&f===y?(b.preventDefault(),r&&$s(v,{select:!0})):b.shiftKey&&f===v&&(b.preventDefault(),r&&$s(y,{select:!0})):f===m&&b.preventDefault()}},[r,n,_.paused]);return o.jsx(We.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});Jf.displayName=I6;function H6(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if($s(n,{select:t}),document.activeElement!==r)return}function z6(e){const t=Nj(e),r=Wb(t,e),n=Wb(t.reverse(),e);return[r,n]}function Nj(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wb(e,t){for(const r of e)if(!F6(r,{upTo:t}))return r}function F6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function U6(e){return e instanceof HTMLInputElement&&"select"in e}function $s(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&U6(e)&&t&&e.select()}}var Gb=$6();function $6(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Kb(e,t),e.unshift(t)},remove(t){var r;e=Kb(e,t),(r=e[0])==null||r.resume()}}}function Kb(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function V6(e){return e.filter(t=>t.tagName!=="A")}var cm=0;function f_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Yb()),document.body.insertAdjacentElement("beforeend",e[1]??Yb()),cm++,()=>{cm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cm--}},[])}function Yb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $n=function(){return $n=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},$n.apply(this,arguments)};function Tj(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function q6(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var md="right-scroll-bar-position",pd="width-before-scroll-bar",W6="with-scroll-bars-hidden",G6="--removed-body-scroll-bar-size";function um(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function K6(e,t){var r=C.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Y6=typeof window<"u"?C.useLayoutEffect:C.useEffect,Zb=new WeakMap;function Z6(e,t){var r=K6(null,function(n){return e.forEach(function(s){return um(s,n)})});return Y6(function(){var n=Zb.get(r);if(n){var s=new Set(n),i=new Set(e),l=r.current;s.forEach(function(a){i.has(a)||um(a,null)}),i.forEach(function(a){s.has(a)||um(a,l)})}Zb.set(r,e)},[e]),r}function X6(e){return e}function Q6(e,t){t===void 0&&(t=X6);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var l=t(i,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(i),l=r}var c=function(){var p=l;l=[],p.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(p){l.push(p),d()},filter:function(p){return l=l.filter(p),r}}}};return s}function J6(e){e===void 0&&(e={});var t=Q6(null);return t.options=$n({async:!0,ssr:!1},e),t}var Aj=function(e){var t=e.sideCar,r=Tj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,$n({},r))};Aj.isSideCarExport=!0;function eB(e,t){return e.useMedium(t),Aj}var Dj=J6(),dm=function(){},eh=C.forwardRef(function(e,t){var r=C.useRef(null),n=C.useState({onScrollCapture:dm,onWheelCapture:dm,onTouchMoveCapture:dm}),s=n[0],i=n[1],l=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,u=e.shards,g=e.sideCar,_=e.noRelative,x=e.noIsolation,b=e.inert,h=e.allowPinchZoom,f=e.as,m=f===void 0?"div":f,v=e.gapMode,y=Tj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=g,E=Z6([r,t]),k=$n($n({},y),s);return C.createElement(C.Fragment,null,p&&C.createElement(S,{sideCar:Dj,removeScrollBar:d,shards:u,noRelative:_,noIsolation:x,inert:b,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:v}),l?C.cloneElement(C.Children.only(a),$n($n({},k),{ref:E})):C.createElement(m,$n({},k,{className:c,ref:E}),a))});eh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};eh.classNames={fullWidth:pd,zeroRight:md};var tB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tB();return t&&e.setAttribute("nonce",t),e}function nB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iB=function(){var e=0,t=null;return{add:function(r){e==0&&(t=rB())&&(nB(t,r),sB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aB=function(){var e=iB();return function(t,r){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Oj=function(){var e=aB(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},oB={left:0,top:0,right:0,gap:0},fm=function(e){return parseInt(e||"",10)||0},lB=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[fm(r),fm(n),fm(s)]},cB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oB;var t=lB(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},uB=Oj(),Ro="data-scroll-locked",dB=function(e,t,r,n){var s=e.left,i=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
216
|
+
.`.concat(W6,` {
|
|
217
|
+
overflow: hidden `).concat(n,`;
|
|
218
|
+
padding-right: `).concat(a,"px ").concat(n,`;
|
|
219
|
+
}
|
|
220
|
+
body[`).concat(Ro,`] {
|
|
221
|
+
overflow: hidden `).concat(n,`;
|
|
222
|
+
overscroll-behavior: contain;
|
|
223
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
224
|
+
padding-left: `.concat(s,`px;
|
|
225
|
+
padding-top: `).concat(i,`px;
|
|
226
|
+
padding-right: `).concat(l,`px;
|
|
227
|
+
margin-left:0;
|
|
228
|
+
margin-top:0;
|
|
229
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
230
|
+
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.`).concat(md,` {
|
|
234
|
+
right: `).concat(a,"px ").concat(n,`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.`).concat(pd,` {
|
|
238
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.`).concat(md," .").concat(md,` {
|
|
242
|
+
right: 0 `).concat(n,`;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.`).concat(pd," .").concat(pd,` {
|
|
246
|
+
margin-right: 0 `).concat(n,`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
body[`).concat(Ro,`] {
|
|
250
|
+
`).concat(G6,": ").concat(a,`px;
|
|
251
|
+
}
|
|
252
|
+
`)},Xb=function(){var e=parseInt(document.body.getAttribute(Ro)||"0",10);return isFinite(e)?e:0},fB=function(){C.useEffect(function(){return document.body.setAttribute(Ro,(Xb()+1).toString()),function(){var e=Xb()-1;e<=0?document.body.removeAttribute(Ro):document.body.setAttribute(Ro,e.toString())}},[])},hB=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;fB();var i=C.useMemo(function(){return cB(s)},[s]);return C.createElement(uB,{styles:dB(i,!t,s,r?"":"!important")})},tg=!1;if(typeof window<"u")try{var $u=Object.defineProperty({},"passive",{get:function(){return tg=!0,!0}});window.addEventListener("test",$u,$u),window.removeEventListener("test",$u,$u)}catch{tg=!1}var $a=tg?{passive:!1}:!1,mB=function(e){return e.tagName==="TEXTAREA"},Mj=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mB(e)&&r[t]==="visible")},pB=function(e){return Mj(e,"overflowY")},gB=function(e){return Mj(e,"overflowX")},Qb=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Lj(e,n);if(s){var i=Pj(e,n),l=i[1],a=i[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vB=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},_B=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Lj=function(e,t){return e==="v"?pB(t):gB(t)},Pj=function(e,t){return e==="v"?vB(t):_B(t)},yB=function(e,t){return e==="h"&&t==="rtl"?-1:1},xB=function(e,t,r,n,s){var i=yB(e,window.getComputedStyle(t).direction),l=i*n,a=r.target,c=t.contains(a),d=!1,p=l>0,u=0,g=0;do{if(!a)break;var _=Pj(e,a),x=_[0],b=_[1],h=_[2],f=b-h-i*x;(x||f)&&Lj(e,a)&&(u+=f,g+=x);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(p&&Math.abs(u)<1||!p&&Math.abs(g)<1)&&(d=!0),d},Vu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jb=function(e){return[e.deltaX,e.deltaY]},e0=function(e){return e&&"current"in e?e.current:e},bB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SB=function(e){return`
|
|
253
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
254
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
255
|
+
`)},wB=0,Va=[];function CB(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(wB++)[0],i=C.useState(Oj)[0],l=C.useRef(e);C.useEffect(function(){l.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=q6([e.lockRef.current],(e.shards||[]).map(e0),!0).filter(Boolean);return b.forEach(function(h){return h.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(b,h){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var f=Vu(b),m=r.current,v="deltaX"in b?b.deltaX:m[0]-f[0],y="deltaY"in b?b.deltaY:m[1]-f[1],S,E=b.target,k=Math.abs(v)>Math.abs(y)?"h":"v";if("touches"in b&&k==="h"&&E.type==="range")return!1;var w=window.getSelection(),j=w&&w.anchorNode,R=j?j===E||j.contains(E):!1;if(R)return!1;var M=Qb(k,E);if(!M)return!0;if(M?S=k:(S=k==="v"?"h":"v",M=Qb(k,E)),!M)return!1;if(!n.current&&"changedTouches"in b&&(v||y)&&(n.current=S),!S)return!0;var T=n.current||S;return xB(T,h,b,T==="h"?v:y)},[]),c=C.useCallback(function(b){var h=b;if(!(!Va.length||Va[Va.length-1]!==i)){var f="deltaY"in h?Jb(h):Vu(h),m=t.current.filter(function(S){return S.name===h.type&&(S.target===h.target||h.target===S.shadowParent)&&bB(S.delta,f)})[0];if(m&&m.should){h.cancelable&&h.preventDefault();return}if(!m){var v=(l.current.shards||[]).map(e0).filter(Boolean).filter(function(S){return S.contains(h.target)}),y=v.length>0?a(h,v[0]):!l.current.noIsolation;y&&h.cancelable&&h.preventDefault()}}},[]),d=C.useCallback(function(b,h,f,m){var v={name:b,delta:h,target:f,should:m,shadowParent:EB(f)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(y){return y!==v})},1)},[]),p=C.useCallback(function(b){r.current=Vu(b),n.current=void 0},[]),u=C.useCallback(function(b){d(b.type,Jb(b),b.target,a(b,e.lockRef.current))},[]),g=C.useCallback(function(b){d(b.type,Vu(b),b.target,a(b,e.lockRef.current))},[]);C.useEffect(function(){return Va.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:g}),document.addEventListener("wheel",c,$a),document.addEventListener("touchmove",c,$a),document.addEventListener("touchstart",p,$a),function(){Va=Va.filter(function(b){return b!==i}),document.removeEventListener("wheel",c,$a),document.removeEventListener("touchmove",c,$a),document.removeEventListener("touchstart",p,$a)}},[]);var _=e.removeScrollBar,x=e.inert;return C.createElement(C.Fragment,null,x?C.createElement(i,{styles:SB(s)}):null,_?C.createElement(hB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function EB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jB=eB(Dj,CB);var th=C.forwardRef(function(e,t){return C.createElement(eh,$n({},e,{ref:t,sideCar:jB}))});th.classNames=eh.classNames;var kB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,qu=new WeakMap,Wu={},hm=0,Bj=function(e){return e&&(e.host||Bj(e.parentNode))},RB=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Bj(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},NB=function(e,t,r,n){var s=RB(t,Array.isArray(e)?e:[e]);Wu[r]||(Wu[r]=new WeakMap);var i=Wu[r],l=[],a=new Set,c=new Set(s),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};s.forEach(d);var p=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(g){if(a.has(g))p(g);else try{var _=g.getAttribute(n),x=_!==null&&_!=="false",b=(qa.get(g)||0)+1,h=(i.get(g)||0)+1;qa.set(g,b),i.set(g,h),l.push(g),b===1&&x&&qu.set(g,!0),h===1&&g.setAttribute(r,"true"),x||g.setAttribute(n,"true")}catch(f){console.error("aria-hidden: cannot operate on ",g,f)}})};return p(t),a.clear(),hm++,function(){l.forEach(function(u){var g=qa.get(u)-1,_=i.get(u)-1;qa.set(u,g),i.set(u,_),g||(qu.has(u)||u.removeAttribute(n),qu.delete(u)),_||u.removeAttribute(r)}),hm--,hm||(qa=new WeakMap,qa=new WeakMap,qu=new WeakMap,Wu={})}},h_=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=kB(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),NB(n,s,r,"aria-hidden")):function(){return null}};function TB(e){const t=AB(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(OB);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function AB(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=LB(s),a=MB(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DB=Symbol("radix.slottable");function OB(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DB}function MB(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function LB(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var rh="Dialog",[Ij,Hj]=Ln(rh),[PB,Pn]=Ij(rh),zj=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,a=C.useRef(null),c=C.useRef(null),[d,p]=Cl({prop:n,defaultProp:s??!1,onChange:i,caller:rh});return o.jsx(PB,{scope:t,triggerRef:a,contentRef:c,contentId:Ei(),titleId:Ei(),descriptionId:Ei(),open:d,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(u=>!u),[p]),modal:l,children:r})};zj.displayName=rh;var Fj="DialogTrigger",Uj=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Pn(Fj,r),i=qe(t,s.triggerRef);return o.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":g_(s.open),...n,ref:i,onClick:_e(e.onClick,s.onOpenToggle)})});Uj.displayName=Fj;var m_="DialogPortal",[BB,$j]=Ij(m_,{forceMount:void 0}),Vj=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=Pn(m_,t);return o.jsx(BB,{scope:t,forceMount:r,children:C.Children.map(n,l=>o.jsx(ar,{present:r||i.open,children:o.jsx(ou,{asChild:!0,container:s,children:l})}))})};Vj.displayName=m_;var sf="DialogOverlay",qj=C.forwardRef((e,t)=>{const r=$j(sf,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=Pn(sf,e.__scopeDialog);return i.modal?o.jsx(ar,{present:n||i.open,children:o.jsx(HB,{...s,ref:t})}):null});qj.displayName=sf;var IB=TB("DialogOverlay.RemoveScroll"),HB=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Pn(sf,r);return o.jsx(th,{as:IB,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(We.div,{"data-state":g_(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ca="DialogContent",Wj=C.forwardRef((e,t)=>{const r=$j(Ca,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=Pn(Ca,e.__scopeDialog);return o.jsx(ar,{present:n||i.open,children:i.modal?o.jsx(zB,{...s,ref:t}):o.jsx(FB,{...s,ref:t})})});Wj.displayName=Ca;var zB=C.forwardRef((e,t)=>{const r=Pn(Ca,e.__scopeDialog),n=C.useRef(null),s=qe(t,r.contentRef,n);return C.useEffect(()=>{const i=n.current;if(i)return h_(i)},[]),o.jsx(Gj,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),FB=C.forwardRef((e,t)=>{const r=Pn(Ca,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(Gj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Gj=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,a=Pn(Ca,r),c=C.useRef(null),d=qe(t,c);return f_(),o.jsxs(o.Fragment,{children:[o.jsx(Jf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(iu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":g_(a.open),...l,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx($B,{titleId:a.titleId}),o.jsx(qB,{contentRef:c,descriptionId:a.descriptionId})]})]})}),p_="DialogTitle",Kj=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Pn(p_,r);return o.jsx(We.h2,{id:s.titleId,...n,ref:t})});Kj.displayName=p_;var Yj="DialogDescription",Zj=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Pn(Yj,r);return o.jsx(We.p,{id:s.descriptionId,...n,ref:t})});Zj.displayName=Yj;var Xj="DialogClose",Qj=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Pn(Xj,r);return o.jsx(We.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});Qj.displayName=Xj;function g_(e){return e?"open":"closed"}var Jj="DialogTitleWarning",[UB,e2]=JO(Jj,{contentName:Ca,titleName:p_,docsSlug:"dialog"}),$B=({titleId:e})=>{const t=e2(Jj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
256
|
+
|
|
257
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
258
|
+
|
|
259
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},VB="DialogDescriptionWarning",qB=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${e2(VB).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},t2=zj,WB=Uj,r2=Vj,v_=qj,__=Wj,y_=Kj,x_=Zj,b_=Qj,GB=Symbol("radix.slottable");function KB(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=GB,t}var n2="AlertDialog",[YB]=Ln(n2,[Hj]),Bs=Hj(),s2=e=>{const{__scopeAlertDialog:t,...r}=e,n=Bs(t);return o.jsx(t2,{...n,...r,modal:!0})};s2.displayName=n2;var ZB="AlertDialogTrigger",XB=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Bs(r);return o.jsx(WB,{...s,...n,ref:t})});XB.displayName=ZB;var QB="AlertDialogPortal",i2=e=>{const{__scopeAlertDialog:t,...r}=e,n=Bs(t);return o.jsx(r2,{...n,...r})};i2.displayName=QB;var JB="AlertDialogOverlay",a2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Bs(r);return o.jsx(v_,{...s,...n,ref:t})});a2.displayName=JB;var No="AlertDialogContent",[eI,tI]=YB(No),rI=KB("AlertDialogContent"),o2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Bs(r),l=C.useRef(null),a=qe(t,l),c=C.useRef(null);return o.jsx(UB,{contentName:No,titleName:l2,docsSlug:"alert-dialog",children:o.jsx(eI,{scope:r,cancelRef:c,children:o.jsxs(__,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:_e(s.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(rI,{children:n}),o.jsx(sI,{contentRef:l})]})})})});o2.displayName=No;var l2="AlertDialogTitle",c2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Bs(r);return o.jsx(y_,{...s,...n,ref:t})});c2.displayName=l2;var u2="AlertDialogDescription",d2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Bs(r);return o.jsx(x_,{...s,...n,ref:t})});d2.displayName=u2;var nI="AlertDialogAction",f2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Bs(r);return o.jsx(b_,{...s,...n,ref:t})});f2.displayName=nI;var h2="AlertDialogCancel",m2=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=tI(h2,r),i=Bs(r),l=qe(t,s);return o.jsx(b_,{...i,...n,ref:l})});m2.displayName=h2;var sI=({contentRef:e})=>{const t=`\`${No}\` requires a description for the component to be accessible for screen reader users.
|
|
260
|
+
|
|
261
|
+
You can add a description to the \`${No}\` by passing a \`${u2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
262
|
+
|
|
263
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${No}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
264
|
+
|
|
265
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},iI=s2,aI=i2,p2=a2,g2=o2,v2=f2,_2=m2,y2=c2,x2=d2;const b2=iI,oI=aI,S2=C.forwardRef(({className:e,...t},r)=>o.jsx(p2,{className:te("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));S2.displayName=p2.displayName;const S_=C.forwardRef(({className:e,...t},r)=>o.jsxs(oI,{children:[o.jsx(S2,{}),o.jsx(g2,{ref:r,className:te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));S_.displayName=g2.displayName;const w_=({className:e,...t})=>o.jsx("div",{className:te("flex flex-col gap-2 text-left",e),...t});w_.displayName="AlertDialogHeader";const C_=({className:e,...t})=>o.jsx("div",{className:te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});C_.displayName="AlertDialogFooter";const E_=C.forwardRef(({className:e,...t},r)=>o.jsx(y2,{ref:r,className:te("font-serif text-[20px] leading-tight text-foreground",e),...t}));E_.displayName=y2.displayName;const j_=C.forwardRef(({className:e,...t},r)=>o.jsx(x2,{ref:r,className:te("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));j_.displayName=x2.displayName;const k_=C.forwardRef(({className:e,...t},r)=>o.jsx(v2,{ref:r,className:te(zv(),e),...t}));k_.displayName=v2.displayName;const R_=C.forwardRef(({className:e,...t},r)=>o.jsx(_2,{ref:r,className:te(zv({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));R_.displayName=_2.displayName;const lI={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 cI({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:i=!1,errorMessage:l}){const[a,c]=C.useState("");C.useEffect(()=>{e||c("")},[e,t]);const d=lI[t],p=t==="retired",u=!p||a.trim().toLowerCase()===r.trim().toLowerCase(),g=i||!u;return o.jsx(b2,{open:e,onOpenChange:_=>{!_&&!i&&s()},children:o.jsxs(S_,{"data-testid":"launcher-launched-dialog","data-target":t,className:te("gap-4",d.danger&&"border-destructive"),children:[o.jsxs(w_,{children:[o.jsx(E_,{className:te(d.danger&&"text-destructive"),children:d.title}),o.jsx(j_,{children:d.body})]}),p&&o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(Vr,{htmlFor:"launcher-launched-dialog-typed",className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:["Type"," ",o.jsx("span",{className:"text-foreground",children:r})," to confirm"]}),o.jsx(St,{id:"launcher-launched-dialog-typed","data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:a,onChange:_=>c(_.target.value),disabled:i,className:te(u&&"border-[var(--vow-green)]")})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-dialog-error",className:"font-mono text-[12px] text-destructive",children:l}),o.jsxs(C_,{children:[o.jsx(R_,{"data-testid":"launcher-launched-dialog-cancel",onClick:_=>{_.preventDefault(),s()},disabled:i,children:"Cancel"}),o.jsx(k_,{"data-testid":"launcher-launched-dialog-confirm",onClick:_=>{if(g){_.preventDefault();return}_.preventDefault(),n()},disabled:g,className:te(d.danger&&"border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]"),children:i?`${d.confirmLabel}…`:d.confirmLabel})]})]})})}function uI({record:e,manifest:t,fetchLauncherStatus:r}){var x,b;const n=r??(()=>he.fetchLauncherStatus()),{data:s,isLoading:i,isError:l}=Oe({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),a=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=a?s==null?void 0:s.nets.find(h=>{var f;return h.solverType===a||h.name===((t==null?void 0:t.name)??((f=e.summary)==null?void 0:f.name))}):void 0,d=c==null?void 0:c.budget.safeBalanceWei,p=(c==null?void 0:c.budget.safeAddress)??e.launcherSafeAddress,u=(t==null?void 0:t.solutionPriceWei)??((x=e.summary)==null?void 0:x.solutionPriceWei),g=(t==null?void 0:t.verdictPriceWei)??((b=e.summary)==null?void 0:b.verdictPriceWei),_=b6(d,u,g);return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{"data-testid":"launcher-launched-spend-panel",role:"region","aria-label":"Spend and runway",className:"flex flex-col gap-3 p-6",children:[o.jsx("header",{className:"flex items-center justify-between gap-3",children:o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Spend & runway"})}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Wa,{label:"Safe address",value:Ej(p),tooltip:p,testid:"launcher-launched-spend-safe-address"}),o.jsx(Wa,{label:"Safe balance",value:i?"—":d?hi(d):"unavailable",tooltip:d?`${d} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),o.jsx(Wa,{label:"Solution price",value:u?hi(u):"—",tooltip:u?`${u} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),o.jsx(Wa,{label:"Verdict price",value:g?hi(g):"—",tooltip:g?`${g} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),o.jsx(Wa,{label:"Per-Task cost",value:_?hi(_.perTaskWei.toString()):"—",tooltip:_?`${_.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),o.jsx(Wa,{label:"Projected runway",value:_?`${_.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-spend-error",className:"font-mono text-[12px] text-destructive",children:"Failed to load Safe balance."}),o.jsx("p",{className:"m-0 font-mono text-[11px] leading-relaxed text-[var(--fg-dim)]",children:"Runway projects how many Tasks the Safe can fund at the current manifest prices, before any operator participation cost adjustments."})]})})}function Wa({label:e,value:t,testid:r,tooltip:n}){const s=o.jsx("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:n?0:void 0,children:t});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),n?o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:s}),o.jsx(dn,{children:n})]}):s]})}const dI={paused:"Pause",launched:"Resume",retired:"Retire"},t0={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function fI({record:e,manifest:t,operatorCount:r,onAction:n,pending:s}){var c;const i=t0[e.status]??t0.launching,l=x6[e.status]??[],a=(t==null?void 0:t.name)??((c=e.summary)==null?void 0:c.name)??e.solverNetId;return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{"data-testid":"launcher-launched-status-header","data-status":e.status,role:"region","aria-label":"SolverNet status header",className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("h1",{"data-testid":"launcher-launched-name",className:"m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground",children:a}),o.jsx(Ce,{"data-testid":"launcher-launched-status-badge",variant:i.variant,className:"whitespace-nowrap",children:i.label})]}),(t==null?void 0:t.description)&&o.jsx("p",{className:"m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]",children:t.description})]}),o.jsx(hI,{allowed:l,onAction:n,pending:s??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),o.jsx(st,{}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Il,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id"}),o.jsx(Il,{label:"Manifest cid",value:Cj(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],tooltip:e.manifestCid}),o.jsx(Il,{label:"Launcher Safe",value:Ej(e.launcherSafeAddress),testid:"launcher-launched-safe",tooltip:e.launcherSafeAddress}),o.jsx(Il,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent"}),r!==void 0&&o.jsx(Il,{label:"Operators",value:String(r),testid:"launcher-launched-operator-count",additionalTestIds:["operator-count"],tooltip:"Distinct operators that have ever claimed a task on this SolverNet, including on finalized or refunded tasks"})]})]})})}function Il({label:e,value:t,testid:r,additionalTestIds:n,tooltip:s}){const i=o.jsxs("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:s?0:void 0,children:[t,n==null?void 0:n.map(l=>o.jsx("span",{"data-testid":l,className:"hidden","aria-hidden":"true",children:t},l))]});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),s?o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:i}),o.jsx(dn,{children:s})]}):i]})}function hI({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?o.jsx(Ce,{"data-testid":"launcher-launched-terminal-pill",variant:"outline",className:"self-start whitespace-nowrap",children:"Retired — no further actions"}):s?o.jsx(Ce,{"data-testid":"launcher-launched-launching-pill",variant:"outline",className:"self-start whitespace-nowrap border-primary text-primary",children:"Launching…"}):e.length===0?null:o.jsx("div",{"data-testid":"launcher-launched-actions",className:"flex flex-wrap gap-2 self-start",children:e.map(i=>{const l=dI[i],a=r===i,c=i==="retired";return o.jsx(ie,{type:"button",variant:c?"destructive":"default","data-testid":`launcher-launched-action-${i}`,onClick:()=>t(i),disabled:r!==null,className:r!==null&&!a?"opacity-60":void 0,children:a?`${l}…`:l},i)})})}const r0=5,mI={open:{variant:"default",label:"Open"},"claims-in-flight":{variant:"default",label:"In flight"},"fully-claimed":{variant:"success",label:"Claimed"},settled:{variant:"success",label:"Settled"},failed:{variant:"destructive",label:"Failed"}};function pI({record:e,fetchTasks:t}){var _;const[r,n]=C.useState([void 0]),s=r[r.length-1],i=t??(x=>he.fetchLauncherTasks(x)),{data:l,isLoading:a,isError:c,error:d,refetch:p}=Oe({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>i({cursor:s,limit:r0}),refetchInterval:15e3}),u=()=>{var x;(x=l==null?void 0:l.cursor)!=null&&x.before&&n(b=>[...b,l.cursor.before])},g=()=>{n(x=>x.length>1?x.slice(0,-1):x)};return o.jsx(ln,{delayDuration:150,children:o.jsxs(be,{"data-testid":"launcher-launched-tasks-panel",role:"region","aria-label":"Recent posted Tasks",className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex items-center justify-between gap-3",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Recent posted Tasks"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{p()},children:"Refresh"})]}),a&&o.jsx("p",{"data-testid":"launcher-launched-tasks-loading",className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}),c&&o.jsxs("div",{"data-testid":"launcher-launched-tasks-error",className:"font-mono text-[12px] text-destructive",children:["Failed to load tasks: ",d instanceof Error?d.message:"unknown error"]}),!a&&!c&&l&&l.tasks.length===0&&o.jsx(vI,{}),!a&&!c&&l&&l.tasks.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{"data-testid":"launcher-launched-tasks-list",className:"overflow-hidden rounded-md border border-border",children:o.jsxs(Da,{className:"table-fixed",children:[o.jsx(Oa,{children:o.jsxs(Kr,{className:"bg-[var(--bg)] hover:bg-[var(--bg)]",children:[o.jsx(Qe,{className:"w-[34%]",children:"Task"}),o.jsx(Qe,{className:"w-[16%]",children:"SolverType"}),o.jsx(Qe,{className:"w-[22%]",children:"Posted"}),o.jsx(Qe,{className:"w-[14%]",children:"State"}),o.jsx(Qe,{className:"w-[14%] text-right",children:"Claims"})]})}),o.jsx(Ma,{children:l.tasks.map(x=>o.jsx(gI,{task:x},x.taskId))})]})}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-prev",onClick:g,disabled:r.length<=1,children:"← Newer"}),o.jsxs("span",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Page ",r.length,l.tasks.length<r0&&l.cursor===void 0?" · end":""]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-next",onClick:u,disabled:!((_=l.cursor)!=null&&_.before),children:"Older →"})]})]})]})})}function gI({task:e}){var s;const t=mI[e.state]??{variant:"secondary",label:e.state},r=((s=e.summary)==null?void 0:s.title)??Cj(e.taskCid),n=e.solverType??e.solverNet;return o.jsxs(Kr,{"data-testid":"launcher-launched-task-row","data-task-id":e.taskId,children:[o.jsx(Je,{className:"font-mono text-[13px] text-foreground",children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:r})}),o.jsx(dn,{children:e.taskCid})]})}),o.jsx(Je,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:o.jsxs(Tn,{children:[o.jsx(An,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:n})}),o.jsx(dn,{children:n})]})}),o.jsx(Je,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:Qf(e.postedAt)}),o.jsx(Je,{children:o.jsx(Ce,{variant:t.variant,className:"normal-case tracking-[0.1em]",children:t.label})}),o.jsxs(Je,{className:"text-right font-mono text-[12px] text-[var(--fg-muted)]",children:[e.claims.current," / ",e.claims.max]})]})}function vI(){return o.jsx("div",{"data-testid":"launcher-launched-tasks-empty",className:"rounded-md border border-dashed border-border p-6 text-center font-mono text-[13px] text-[var(--fg-muted)]",children:"Tasks will appear here after the first generator poll posts a Task."})}const _I=2500,yI=3e4,Gu="mx-auto flex max-w-[960px] flex-col gap-4 p-6";function xI({pollIntervalMs:e=_I,navigateTo:t,solverNetId:r}={}){var E,k,w,j;const n=If(),[,s]=gn(),i=t??s,l=Hi(),a=r??n.solverNetId,c=Oe({queryKey:["solvernets","launched",a],queryFn:()=>he.solvernets.get(a),refetchInterval:e,enabled:!!a}),d=(E=c.data)==null?void 0:E.manifestCid,p=Oe({queryKey:["solvernets","manifest",d],queryFn:()=>he.solvernets.getManifest(d),enabled:!!d,staleTime:1/0}),u=Oe({queryKey:["solvernets","operator-count",d],queryFn:async()=>(await he.discovery.getSolverNetOperatorCount(d)).operatorCount,enabled:!!d,refetchInterval:yI}),[g,_]=C.useState(null),[x,b]=C.useState(null),h=Ss({mutationFn:({target:R})=>he.solvernets.transitionLifecycle(a,R),onSuccess:async R=>{await l.cancelQueries({queryKey:["solvernets","launched",a]}),l.setQueryData(["solvernets","launched",a],R),_(null),b(null)},onError:R=>{b(R instanceof Error?R.message:String(R))}}),f=Ss({mutationFn:R=>he.solvernets.updateGeneratorConfig(a,R),onSuccess:()=>{l.invalidateQueries({queryKey:["solvernets","launched",a]})}});if(!a)return o.jsx("main",{"data-testid":"launcher-launched-missing-id",className:Gu,children:o.jsx(n0,{message:"No solverNetId supplied.",onBack:()=>i("/launcher")})});if(c.isLoading)return o.jsx("main",{"data-testid":"launcher-launched-loading",className:Gu,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"})});if(c.isError||!c.data){const R=c.error instanceof Error?c.error.message:"Unknown error";return o.jsx("main",{"data-testid":"launcher-launched-error",className:Gu,children:o.jsx(n0,{message:`Failed to load SolverNet: ${R}`,onBack:()=>i("/launcher"),onRetry:()=>{c.refetch()}})})}const m=c.data,v=(k=p.data)==null?void 0:k.manifest,y=SI(m,v),S=(v==null?void 0:v.name)??((w=m.summary)==null?void 0:w.name)??m.solverNetId;return o.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":a,className:Gu,children:[o.jsx(fI,{record:m,manifest:v,operatorCount:u.data,onAction:R=>{b(null),_(R)},pending:h.isPending?((j=h.variables)==null?void 0:j.target)??null:null}),o.jsx(N6,{record:m,manifest:v,template:y,onSave:async R=>{await f.mutateAsync(R)}}),o.jsx(uI,{record:m,manifest:v}),o.jsx(pI,{record:m}),p.isError&&o.jsxs("p",{"data-testid":"launcher-launched-manifest-error",className:"m-0 font-mono text-[12px] text-destructive",children:["Failed to load manifest:"," ",bI(p.error)]}),o.jsx(cI,{open:g!==null,target:g??"paused",solverNetName:S,pending:h.isPending,errorMessage:x??void 0,onCancel:()=>{h.isPending||(_(null),b(null))},onConfirm:()=>{g&&h.mutate({target:g})}})]})}function bI(e){const t=e instanceof Error?e.message:String(e??"unknown error");return/404|manifest_not_found|registry_unavailable/i.test(t)?`Manifest unavailable from local cache or registry (${t})`:t}function SI(e,t){const r=(t==null?void 0:t.contract)??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(r)return Jp[`${r.id}.${r.version}`]}function n0({message:e,onBack:t,onRetry:r}){return o.jsxs(nt,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(at,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-retry",onClick:r,children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-back",onClick:t,children:"Back to launcher"})]})]})}const s0="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",mm="m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-[var(--bg-sunken)] p-2.5 font-mono text-[12px] text-foreground";function wI({onSuccess:e,onCancel:t}){const[r,n]=C.useState("checking"),[s,i]=C.useState(""),[l,a]=C.useState(""),c=()=>{n("checking"),he.hermesDoctor().then(p=>{if(!p.installed){n("not-installed");return}if(p.exitCode!==0){n("config-issue"),i(p.stderr);return}n("ok"),e()}).catch(p=>{a(p instanceof Error?p.message:String(p)),n("network-error")})},d=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(s0).catch(()=>{})};return C.useEffect(()=>{c()},[]),r==="checking"?o.jsxs(be,{"data-testid":"hermes-precheck-checking",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes install check"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Checking hermes install…"})]}):r==="not-installed"?o.jsxs(be,{"data-testid":"hermes-precheck-not-installed",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent not installed"}),o.jsx("p",{className:"m-0 font-mono text-[13px] text-foreground",children:"Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:"}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("pre",{className:`${mm} flex-1`,children:s0}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:d,children:"Copy"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"I've installed Hermes — retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="network-error"?o.jsxs(nt,{"data-testid":"hermes-precheck-network-error",variant:"blocking",className:"flex flex-col gap-3 border-l-0 border border-destructive p-4",children:[o.jsx(It,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes precheck failed"}),o.jsxs(at,{className:"font-mono text-[13px] text-foreground",children:["Could not reach the daemon API to run ",o.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),l?o.jsx("pre",{className:mm,children:l}):null,o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="config-issue"?o.jsxs(nt,{"data-testid":"hermes-precheck-config-issue",variant:"warning",className:"flex flex-col gap-3 border-l-0 border border-[var(--severity-warning-fg)] p-4",children:[o.jsx(It,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent configuration issue"}),o.jsx(at,{className:"font-mono text-[13px] text-foreground",children:"Hermes is installed but reports configuration issues:"}),o.jsx("pre",{className:mm,children:s||"(no diagnostic output)"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Run ",o.jsx("code",{children:"hermes model"})," or ",o.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):o.jsx(o.Fragment,{})}const w2=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],C2=[{label:"GPT-5.4 Mini",id:"gpt-5.4-mini"},{label:"GPT-5.5",id:"gpt-5.5"},{label:"GPT-5.4",id:"gpt-5.4"},{label:"GPT-5.3 Codex",id:"gpt-5.3-codex"},{label:"GPT-5.3 Codex Spark",id:"gpt-5.3-codex-spark"}],E2=[{label:"Claude Opus 4.7 (OpenRouter)",id:"anthropic/claude-opus-4.7"},{label:"Claude Sonnet 4.6 (OpenRouter)",id:"anthropic/claude-sonnet-4.6"},{label:"Hy3 Preview",id:"tencent/hy3-preview"},{label:"DeepSeek V4 Pro",id:"deepseek/deepseek-v4-pro"},{label:"DeepSeek V4 Flash",id:"deepseek/deepseek-v4-flash"},{label:"Gemini 3.1 Flash Lite",id:"google/gemini-3.1-flash-lite"},{label:"Kimi K2.6",id:"moonshotai/kimi-k2.6"},{label:"Owl Alpha",id:"openrouter/owl-alpha"},{label:"MiniMax M2.7",id:"minimax/minimax-m2.7"}];function CI(e){return Gr(e)===Xf}function EI(e){return Gr(e)===il}function nh(e){return EI(e)?E2:CI(e)?C2:w2}function To(e){return nh(e)[0].id}function N_(e,t){const n=nh(t).find(s=>s.id===e)??null??w2.find(s=>s.id===e)??C2.find(s=>s.id===e)??E2.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function jI(e){const t=kI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(NI);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function kI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=AI(s),a=TI(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RI=Symbol("radix.slottable");function NI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RI}function TI(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function AI(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var sh="Popover",[j2]=Ln(sh,[wl]),cu=wl(),[DI,zi]=j2(sh),k2=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,a=cu(t),c=C.useRef(null),[d,p]=C.useState(!1),[u,g]=Cl({prop:n,defaultProp:s??!1,onChange:i,caller:sh});return o.jsx(s_,{...a,children:o.jsx(DI,{scope:t,contentId:Ei(),triggerRef:c,open:u,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(_=>!_),[g]),hasCustomAnchor:d,onCustomAnchorAdd:C.useCallback(()=>p(!0),[]),onCustomAnchorRemove:C.useCallback(()=>p(!1),[]),modal:l,children:r})})};k2.displayName=sh;var R2="PopoverAnchor",OI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=zi(R2,r),i=cu(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(l(),()=>a()),[l,a]),o.jsx(Gf,{...i,...n,ref:t})});OI.displayName=R2;var N2="PopoverTrigger",T2=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=zi(N2,r),i=cu(r),l=qe(t,s.triggerRef),a=o.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":L2(s.open),...n,ref:l,onClick:_e(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:o.jsx(Gf,{asChild:!0,...i,children:a})});T2.displayName=N2;var T_="PopoverPortal",[MI,LI]=j2(T_,{forceMount:void 0}),A2=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=zi(T_,t);return o.jsx(MI,{scope:t,forceMount:r,children:o.jsx(ar,{present:r||i.open,children:o.jsx(ou,{asChild:!0,container:s,children:n})})})};A2.displayName=T_;var al="PopoverContent",D2=C.forwardRef((e,t)=>{const r=LI(al,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=zi(al,e.__scopePopover);return o.jsx(ar,{present:n||i.open,children:i.modal?o.jsx(BI,{...s,ref:t}):o.jsx(II,{...s,ref:t})})});D2.displayName=al;var PI=jI("PopoverContent.RemoveScroll"),BI=C.forwardRef((e,t)=>{const r=zi(al,e.__scopePopover),n=C.useRef(null),s=qe(t,n),i=C.useRef(!1);return C.useEffect(()=>{const l=n.current;if(l)return h_(l)},[]),o.jsx(th,{as:PI,allowPinchZoom:!0,children:o.jsx(O2,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,d=a.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_e(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),II=C.forwardRef((e,t)=>{const r=zi(al,e.__scopePopover),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(O2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),O2=C.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,...u}=e,g=zi(al,r),_=cu(r);return f_(),o.jsx(Jf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(iu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(i_,{"data-state":L2(g.open),role:"dialog",id:g.contentId,..._,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),M2="PopoverClose",HI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=zi(M2,r);return o.jsx(We.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});HI.displayName=M2;var zI="PopoverArrow",FI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=cu(r);return o.jsx(a_,{...s,...n,ref:t})});FI.displayName=zI;function L2(e){return e?"open":"closed"}var UI=k2,$I=T2,VI=A2,P2=D2;const B2=UI,I2=$I,A_=C.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(VI,{children:o.jsx(P2,{ref:s,align:t,sideOffset:r,className:te("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...n})}));A_.displayName=P2.displayName;const i0=[{name:"network-tools",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Jinn runtime tools"},{name:"claude-code-learner",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Learner loop"}];function qI(e){return Gr(e)===il?i0.filter(t=>t.name!=="claude-code-learner"):i0}const WI=new Set(["swe-rebench-v2-runtime"]),GI={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},af="bundled:";function Hl(e){return GI[e]??e}function go(e){return e.startsWith(af)?e.slice(af.length):e}function KI(e){return e.source==="bundled"?`${af}${e.name}`:e.name}function a0(e){const t=new Set,r=[];for(const n of e){const s=go(n);t.has(s)||(t.add(s),r.push(n))}return r}function YI(e,t,r){const n=new Set,s=[];for(const i of qI(r))n.add(i.name),s.push(i);for(const i of e){if(n.has(i.name))continue;n.add(i.name);const l=WI.has(i.name);s.push({...i,...l?{defaultIncluded:!0}:{recommended:!0},description:i.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const i of t){const l=go(i);n.has(l)||(n.add(l),s.push({name:l,version:"configured",source:i.startsWith(af)?"bundled":"custom",description:"Already configured"}))}return s}function ZI(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function rg({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:i,harness:l}){const[a,c]=C.useState(""),[d,p]=C.useState(!1),[u,g]=C.useState(null),_=C.useMemo(()=>YI(e,t,l),[e,t,l]),x=new Set(t.map(go)),b=new Set(r.map(go)),h=new Set(x);for(const R of _)R.defaultIncluded&&!b.has(R.name)&&h.add(R.name);const f=_.filter(R=>h.has(R.name)),m=f.filter(R=>R.defaultIncluded).length,v=f.length-m,y=_.filter(R=>!h.has(R.name)),S=a.trim().toLowerCase(),E=S?y.filter(R=>`${R.name} ${Hl(R.name)} ${R.source} ${R.description??""}`.toLowerCase().includes(S)):y,k=R=>{const M=R.defaultIncluded?r.filter(O=>go(O)!==R.name):r,T=R.defaultIncluded?t:a0([...t,KI(R)]);n(T,M),p(!1),c("")},w=R=>{if(R.defaultIncluded){g(R),p(!1),c("");return}n(t.filter(M=>go(M)!==R.name),r)},j=()=>{u&&(n(t,a0([...r,u.name])),g(null))};return o.jsxs("div",{className:"relative flex flex-col gap-2",children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(R=>o.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":R.name,className:te("inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-[5px] pl-2.5 font-mono text-[11px] text-foreground",R.defaultIncluded?"bg-sunken":"bg-transparent"),children:[o.jsxs("span",{children:[Hl(R.name),o.jsx("span",{className:"text-dim",children:R.defaultIncluded?" · default":" · selected"})]}),o.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove ${Hl(R.name)}`,"data-testid":`${s}-remove`,"data-plugin":R.name,onClick:()=>w(R),className:"h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:o.jsx(Dc,{"aria-hidden":"true",className:"!size-3"})})]},R.name))}),u&&o.jsxs("div",{role:"alertdialog","data-testid":`${s}-default-warning`,className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-md border border-wane bg-card px-3 py-2.5 font-mono",children:[o.jsxs("span",{className:"text-[12px] text-foreground",children:[Hl(u.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),o.jsxs("span",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":`${s}-default-warning-cancel`,onClick:()=>g(null),children:"Keep"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":`${s}-default-warning-confirm`,onClick:j,children:"Remove"})]})]}),o.jsxs(B2,{open:d,onOpenChange:R=>{p(R),R||c("")},children:[o.jsx(I2,{asChild:!0,children:o.jsxs(ie,{type:"button",variant:"outline","data-testid":`${s}-trigger`,"aria-haspopup":"listbox",className:"grid h-auto grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-border bg-background px-3 py-2.5 text-left font-mono text-[12px] normal-case tracking-normal text-foreground hover:bg-sunken hover:text-foreground",children:[o.jsxs("span",{className:"min-w-0",children:["Add plugin",o.jsxs("span",{className:"text-dim",children:[" ","· ",m," default",v>0?` · ${v} selected`:""]})]}),d?o.jsx(Pv,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"}):o.jsx(Hf,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"})]})}),o.jsxs(A_,{align:"start",sideOffset:6,className:"w-[min(28rem,90vw)] overflow-hidden p-0",children:[o.jsx(St,{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":i,value:a,onChange:R=>c(R.target.value),onKeyDown:R=>{R.key==="Escape"&&(p(!1),c(""))},placeholder:"Search plugins",className:"h-auto rounded-none border-0 border-b border-border bg-background px-3 py-2.5 text-[12px] focus-visible:ring-0"}),o.jsx(su,{className:"max-h-60",children:o.jsx("div",{role:"listbox","aria-label":"Plugins",className:"flex flex-col",children:E.length===0?o.jsx("span",{className:"px-3.5 py-3 font-mono text-[12px] text-dim",children:y.length===0?"No plugins available to add.":"No matching plugins."}):E.map((R,M)=>{const T=h.has(R.name),O=R.defaultIncluded?"text-dim":R.recommended?"text-primary":"text-muted-foreground";return o.jsxs(ie,{type:"button",variant:"ghost",role:"option","aria-selected":T,"data-testid":s,"data-plugin":R.name,"data-plugin-active":T?"true":"false","data-plugin-default":R.defaultIncluded?"true":"false",onClick:()=>k(R),className:te("grid h-auto w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-none px-3 py-2.5 text-left font-mono normal-case tracking-normal transition-colors",M===0?"":"border-t border-border",T?"bg-sunken text-foreground":"bg-transparent text-foreground","hover:bg-sunken focus-visible:bg-sunken"),children:[o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{className:"text-[13px] text-foreground",children:Hl(R.name)}),o.jsx("span",{className:"text-[11px] text-dim",children:ZI(R)})]}),o.jsx("span",{className:te("self-center text-[11px] uppercase",O),children:R.defaultIncluded?"Default":R.recommended?"Recommended":"Add"})]},R.name)})})})]})]})]})}const XI={"claude-opus-4-7":{provider:"anthropic",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-sonnet-4-6":{provider:"anthropic",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-haiku-4-5-20251001":{provider:"anthropic",inputPer1kTokens:.001,outputPer1kTokens:.005,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-opus-4.7":{provider:"openrouter",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-sonnet-4.6":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4-mini":{provider:"openai",inputPer1kTokens:25e-5,outputPer1kTokens:.002,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.5":{provider:"openai",inputPer1kTokens:.015,outputPer1kTokens:.06,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex-spark":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"tencent/hy3-preview":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-pro":{provider:"openrouter",inputPer1kTokens:.0014,outputPer1kTokens:.0028,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-flash":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"google/gemini-3.1-flash-lite":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"moonshotai/kimi-k2.6":{provider:"openrouter",inputPer1kTokens:6e-4,outputPer1kTokens:.0025,typicalInputTokens:5e4,typicalOutputTokens:2e4},"openrouter/owl-alpha":{provider:"openrouter",inputPer1kTokens:.002,outputPer1kTokens:.008,typicalInputTokens:5e4,typicalOutputTokens:2e4},"minimax/minimax-m2.7":{provider:"openrouter",inputPer1kTokens:8e-4,outputPer1kTokens:.0032,typicalInputTokens:5e4,typicalOutputTokens:2e4},"nousresearch/hermes-4-405b":{provider:"nous",inputPer1kTokens:9e-4,outputPer1kTokens:9e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4}},H2=1;function z2(e){const t=XI[e];if(!t)return null;const r=t.typicalInputTokens/1e3*t.inputPer1kTokens,n=t.typicalOutputTokens/1e3*t.outputPer1kTokens;return{usd:r+n,inputUsd:r,outputUsd:n,typicalInputTokens:t.typicalInputTokens,typicalOutputTokens:t.typicalOutputTokens,entry:t}}function D_(e,t,r=H2){if(!e)return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?z2(t):null;return(n==null?void 0:n.entry.subscriptionPath)===!0?{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."}:{showEstimate:!0,estimate:n,requiresConfirmation:n!==null&&n.usd>r,suppressedReason:null}}function QI(e){return Number.isFinite(e)?e===0?"$0":e<.01?"<$0.01":e<1?`$${e.toFixed(2)}`:e<10?`$${e.toFixed(2)}`:`$${e.toFixed(2)}`:"—"}function F2({modelId:e,usesPaidApiKey:t,thresholdUsd:r=H2,variant:n="card",testIdPrefix:s="cost-estimate"}){const i=D_(t,e,r);if(!i.showEstimate)return o.jsxs("div",{"data-testid":`${s}-subscription`,"data-cost-mode":"subscription",className:te("flex items-center gap-2.5 font-mono",n==="card"?"rounded-md border border-border bg-card px-3.5 py-2.5":"py-1.5"),children:[o.jsx(GC,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"text-[12px] text-muted-foreground",children:i.suppressedReason??"Included in subscription, no per-task API cost."})]});const l=i.estimate,a=(l==null?void 0:l.usd)??null,c=i.requiresConfirmation;return o.jsxs("div",{"data-testid":`${s}-panel`,"data-cost-mode":"paid-api","data-cost-usd":a!==null?a.toFixed(4):"unknown","data-cost-high-cost":c?"true":"false",className:te("flex flex-col gap-2 rounded-md border bg-card",c?"border-destructive":"border-border",n==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Estimated cost per task"}),o.jsx("span",{"data-testid":`${s}-amount`,className:te("font-mono font-medium",n==="card"?"text-[18px]":"text-[14px]",c?"text-destructive":"text-foreground"),children:a!==null?`~${QI(a)}`:"unavailable"})]}),l&&o.jsx("span",{"data-testid":`${s}-heuristic`,className:"font-mono text-[11px] text-muted-foreground",children:"Rough estimate — actual cost varies."}),a===null&&o.jsx("span",{"data-testid":`${s}-unknown`,className:"font-mono text-[11px] text-muted-foreground",children:"No pricing entry for this model id — confirm rates with your provider before joining."}),c&&o.jsxs("span",{"data-testid":`${s}-warning`,className:"font-mono text-[11px] text-destructive",children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}const U2="claude-code",$2="codex",JI="hermes-agent",e8={"claude-code-learner":U2,"codex-code-learner":$2};function V2(e){return e8[e]??e}const q2=.5,pm={units_per_block:100,units_per_week:100*28};function t8(e,t,r){if(!e)return null;const n=V2(e);if(!(n===U2||n===$2||n===JI))return 0;if(!t)return null;const i=z2(t);return i?i.usd/q2*100:null}function o0(e){return e<1?e.toFixed(2):e<10?e.toFixed(1):Math.round(e).toString()}function W2({harness:e,modelId:t,variant:r="card",testIdPrefix:n="harness-footprint"}){const s=t8(e,t);if(s===0)return null;if(s===null)return o.jsxs("div",{"data-testid":`${n}-unknown`,className:te("flex flex-col gap-1 rounded-md border border-border bg-card",r==="card"?"px-4 py-3":"gap-1 px-2.5 py-2"),children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"AI-units footprint"}),o.jsx("span",{className:"font-mono text-[12px] text-muted-foreground",children:"No pricing entry for this model id — footprint unavailable."})]});const i=s/100*q2,l=pm.units_per_block/s,a=i*l*4,c=s*l*4*7;return o.jsxs("div",{"data-testid":`${n}-panel`,className:te("flex flex-col gap-2 rounded-md border border-border bg-card",r==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(GC,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"AI-units footprint"})]}),o.jsxs("div",{className:"flex flex-col gap-1.5 font-mono text-[12px] text-foreground",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"Per 6h block, at cap"}),o.jsxs("span",{"data-testid":`${n}-block`,className:"font-medium",children:[o0(s)," / ",pm.units_per_block," units / task"]})]}),o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"Per week, at cap"}),o.jsxs("span",{"data-testid":`${n}-week`,className:"font-medium",children:[o0(c)," / ",pm.units_per_week," units"]})]}),o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"~ Daily cost at cap"}),o.jsxs("span",{"data-testid":`${n}-daily-usd`,className:"font-medium",children:["~$",a<1?a.toFixed(2):a.toFixed(1),"/day"]})]})]}),o.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:"Node pauses claims for this credential when the 6h or 7d cap is reached, then auto-resumes."})]})}function G2(e){const{data:t,isPending:r}=Oe({queryKey:["status"],queryFn:()=>he.getStatus()});if(!e)return!1;if(r||!(t!=null&&t.costSurface))return!0;const n=t.costSurface.harnesses[V2(e)];return(n==null?void 0:n.usesPaidApiKey)??!0}function Ga({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[s,i]=C.useState(!1);return o.jsxs(B2,{open:s,onOpenChange:i,children:[o.jsx(I2,{type:"button","data-testid":"inline-help-trigger","aria-label":e,className:"inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-md border border-muted-foreground bg-card p-0 text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",children:o.jsx(GD,{className:"h-2.5 w-2.5","aria-hidden":"true"})}),o.jsxs(A_,{"data-testid":"inline-help-panel",role:"note",align:"start",className:"max-w-[420px] whitespace-pre-line font-mono text-[11px] font-normal leading-relaxed normal-case tracking-normal text-muted-foreground",children:[t,r&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:n})]})]})]})}const r8="Self-improving agent by Nous Research. Built-in learning loop.",Ka="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",n8=d_,zl="mx-auto flex max-w-[880px] flex-col gap-4 p-6",eo="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",gm=eo,Ya="flex items-start gap-2",l0="rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[14px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function s8(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function i8(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function a8(e){const t=e==null?void 0:e.contract.evaluationFunction.implementation;if(t){if(t.includes("swe-rebench-v2-evaluator"))return"swe-rebench-v2-evaluator";if(t.includes("prediction-v1-evaluator"))return"prediction-v1-evaluator"}}function o8(e){const t=[...new Set(e)].sort();return{readiness:Oe({queryKey:["harness-readiness",t.join(",")],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{const n=await Promise.all(t.map(async s=>{try{return[s,await he.harnessReadiness(s)]}catch(i){if(i.code==="harness_not_found")return[s,void 0];throw i}}));return new Map(n)}}).data??new Map}}function l8({manifestCid:e,navigateTo:t}={}){var G,Y,ce;const r=If(),[,n]=gn(),s=t??n,i=Hi(),l=e??r.cid,a=Oe({queryKey:["solvernets","manifest",l],queryFn:()=>he.solvernets.getManifest(l),enabled:!!l,retry:!1}),c=Oe({queryKey:["solvernets","catalog"],queryFn:()=>he.getSolverNets()}),d=(G=a.data)==null?void 0:G.manifest,p=d?s8(c.data,d.contract):void 0,u=((p==null?void 0:p.compatibleHarnesses)??[]).filter(K=>K.supportsRoles.includes("solving")).map(K=>({...K,name:Gr(K.name)})).filter((K,pe,Me)=>Me.findIndex(Ke=>Ke.name===K.name)===pe),g=((Y=u[0])==null?void 0:Y.name)??n8,_=To(g),[x,b]=C.useState({roles:[],harness:g,plugins:[],disabledDefaultPlugins:[],model:_}),[h,f]=C.useState(null),[m,v]=C.useState(null),[y,S]=C.useState(!1),E=C.useRef(!1),[k,w]=C.useState(!1),j=(ce=u[0])==null?void 0:ce.name;C.useEffect(()=>{E.current||j&&j!==x.harness&&b(K=>({...K,harness:j,model:To(j)}))},[j]);const R=nh(x.harness),M=a8(d),T=[...u.map(K=>K.name),...x.roles.includes("evaluator")&&M?[M]:[]],{readiness:O}=o8(T),F=O.get(x.harness),$=M?O.get(M):void 0,P=x.roles.includes("solver"),U=G2(P?x.harness:void 0),N=D_(U,P?x.model:void 0),D=P&&N.requiresConfirmation,L=D&&!k,I=Ss({mutationFn:()=>he.operator.join(l,{...(d==null?void 0:d.name)!==void 0?{name:d.name}:{},...(d==null?void 0:d.contract)!==void 0?{contract:{id:d.contract.id,version:d.contract.version}}:{},roles:x.roles,...x.roles.includes("solver")?{harness:x.harness,plugins:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,model:x.model}:{}}),onSuccess:K=>{i.invalidateQueries({queryKey:["operator","joined"]}),i.invalidateQueries({queryKey:["bootstrap"]}),v({manifestCid:K.manifestCid,name:K.config.name??(d==null?void 0:d.name)??K.manifestCid,roles:K.config.roles,restartRequired:K.restartRequired})},onError:K=>{f(K instanceof Error?K.message:String(K))}});if(!l)return o.jsx("main",{"data-testid":"join-flow-missing-cid",className:zl,children:o.jsx(c0,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(a.isLoading)return o.jsx("main",{"data-testid":"join-flow-loading",className:zl,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading manifest…"})});if(a.isError||!d){const K=a.error instanceof Error?a.error.message:"Unknown error";return o.jsx("main",{"data-testid":"join-flow-error",className:zl,children:o.jsx(c0,{message:`Failed to load manifest: ${K}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{a.refetch()}})})}if(m)return o.jsx("main",{"data-testid":"join-flow-success",className:zl,children:o.jsx(c8,{success:m,navigate:s})});const{openRoles:Q}=d,q=K=>{Q.includes(K)&&b(pe=>{const Ke=pe.roles.includes(K)?pe.roles.filter(Ht=>Ht!==K):Q.filter(Ht=>Ht===K||pe.roles.includes(Ht));return{...pe,roles:Ke}})},J=x.roles.includes("evaluator"),Z=P&&(F==null?void 0:F.ready)===!1,me=J&&($==null?void 0:$.ready)===!1,A=x.roles.length>0&&!I.isPending&&!L&&!Z&&!me,H=me&&M?o.jsxs("div",{"data-testid":"join-evaluator-not-ready","data-harness":M,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[ki(M)," is not ready",$!=null&&$.reason?`: ${$.reason}`:""]}),($==null?void 0:$.nextStep)&&o.jsxs("span",{"data-testid":"join-evaluator-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[$.nextStep.description,$.nextStep.cli?` (${$.nextStep.cli})`:""]})]}):null;return o.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":l,className:zl,children:[o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{"data-testid":"join-flow-title",className:"font-mono text-[20px] font-medium text-foreground",children:["Join ",d.name]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:d.description})]}),o.jsxs(be,{"data-testid":"join-flow-summary",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:eo,children:"Manifest"}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Contract"}),o.jsxs("span",{className:"text-foreground",children:[d.contract.id," · ",d.contract.version]}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:hi(d.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:hi(d.verdictPriceWei)}),o.jsx("span",{children:"Open roles"}),o.jsx("span",{"data-testid":"join-flow-open-roles",className:"text-foreground",children:Q.join(", ")||"none"}),o.jsx("span",{children:"Launcher"}),o.jsxs("span",{className:"text-foreground",children:[i8(d.launcher.safeAddress)," · agentId"," ",d.launcher.agentId]}),o.jsx("span",{children:"Manifest CID"}),o.jsx("span",{"data-testid":"join-flow-manifest-cid",className:"truncate text-[var(--fg-dim)]",children:l})]})]}),o.jsxs(be,{className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:Ya,children:[o.jsx("span",{className:eo,children:"Roles"}),o.jsxs(Ga,{label:"Roles help",docHref:`${Ka}#solver-vs-evaluator`,children:["Solver attempts tasks and submits solutions. It is the spending role: you pay for model inference and gas. It also has the most upside per task.",`
|
|
266
|
+
|
|
267
|
+
`,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
|
|
268
|
+
|
|
269
|
+
`,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),o.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:Q.map((K,pe)=>{const Me=x.roles.includes(K),Ke=`join-role-${K}`;return o.jsxs("label",{htmlFor:Ke,"data-testid":"join-role-option","data-role":K,"data-role-active":Me?"true":"false",className:te("flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono",Me?"bg-[var(--bg)] text-foreground":"bg-transparent text-[var(--fg-muted)]",pe<Q.length-1&&"border-r border-border"),children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("input",{id:Ke,type:"checkbox",checked:Me,onChange:()=>q(K),"aria-label":K==="solver"?"Solver":"Evaluator",className:"size-3.5 accent-primary"}),o.jsx("span",{className:"text-[14px] font-medium",children:K==="solver"?"Solver":"Evaluator"})]}),o.jsx("span",{className:te("pl-[22px] text-[11px]",Me?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]"),children:K==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},K)})})]}),P&&o.jsxs(be,{"data-testid":"join-flow-solver-fields",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:eo,children:"Solver configuration"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:Ya,children:[o.jsx(Vr,{htmlFor:"join-harness-select",className:gm,children:"Harness"}),o.jsxs(Ga,{label:"Harness help",docHref:`${Ka}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
|
|
270
|
+
|
|
271
|
+
`,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
|
|
272
|
+
|
|
273
|
+
`,"Claude Code uses whatever the `claude` CLI is signed in with: a Claude subscription or an Anthropic API key. Hermes Agent is a separate package; the join form checks it is installed.",`
|
|
274
|
+
|
|
275
|
+
`,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),o.jsxs("select",{id:"join-harness-select","aria-label":"Harness","data-testid":"join-harness-select",value:x.harness,onChange:K=>{const pe=K.target.value;E.current=!0,b({...x,harness:pe,model:To(pe)}),w(!1)},className:l0,children:[u.map(K=>{const pe=O.get(K.name),Me=(pe==null?void 0:pe.ready)===!1;return o.jsxs("option",{value:K.name,disabled:Me,"data-testid":"join-harness-option","data-harness":K.name,"data-harness-ready":pe===void 0?"unknown":pe.ready?"true":"false",children:[xj(K.name,K.version),Me?" — setup required":""]},K.name)}),(!p||u.length===0)&&o.jsx("option",{value:x.harness,children:ki(x.harness)})]}),x.harness===il&&o.jsx("span",{"data-testid":"join-harness-hermes-description",className:"font-mono text-[11px] text-[var(--fg-muted)]",children:r8}),(F==null?void 0:F.ready)===!1&&o.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":x.harness,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[ki(x.harness)," is not ready",F.reason?`: ${F.reason}`:""]}),F.nextStep&&o.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[F.nextStep.description,F.nextStep.cli?` (${F.nextStep.cli})`:""]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:Ya,children:[o.jsx(Vr,{htmlFor:"join-model-select",className:gm,children:"Model"}),o.jsxs(Ga,{label:"Model help",docHref:`${Ka}#harness-and-model`,children:["The model is the LLM the harness runs.",`
|
|
276
|
+
|
|
277
|
+
`,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
|
|
278
|
+
|
|
279
|
+
`,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
|
|
280
|
+
|
|
281
|
+
`,"Check the cost estimate below before you join."]})]}),o.jsxs("select",{id:"join-model-select","aria-label":"Model","data-testid":"join-model-select",value:x.model,onChange:K=>{b({...x,model:K.target.value}),w(!1)},className:l0,children:[R.map(K=>o.jsx("option",{value:K.id,children:K.label},K.id)),(()=>{const K=N_(x.model,x.harness);return K.isCustom?o.jsx("option",{value:x.model,children:K.label},x.model):null})()]})]})]}),o.jsx(F2,{modelId:x.model,usesPaidApiKey:U,testIdPrefix:"join-flow-cost"}),o.jsx(W2,{harness:x.harness,modelId:x.model,testIdPrefix:"join-flow-footprint"}),D&&o.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":k?"true":"false",className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-destructive bg-[var(--bg)] p-3 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:k,onChange:K=>w(K.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated at more than $1 per task; I am responsible for the API spend on my own provider key."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("span",{className:Ya,children:[o.jsx("span",{className:gm,children:"Plugins"}),o.jsxs(Ga,{label:"Plugins help",docHref:`${Ka}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
|
|
282
|
+
|
|
283
|
+
`,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
|
|
284
|
+
|
|
285
|
+
`,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
|
|
286
|
+
|
|
287
|
+
`,"You can re-join later with more plug-ins."]})]}),o.jsx(rg,{available:(p==null?void 0:p.compatiblePlugins)??[],selected:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,onChange:(K,pe)=>b({...x,plugins:K,disabledDefaultPlugins:pe}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:x.harness})]})]}),J&&!P&&o.jsxs(be,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:Ya,children:[o.jsx("span",{className:eo,children:"Evaluator configuration"}),o.jsxs(Ga,{label:"Evaluator configuration help",docHref:`${Ka}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
|
|
288
|
+
|
|
289
|
+
`,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
|
|
290
|
+
|
|
291
|
+
`,"For many SolverNets that function is deterministic and uses no model at all."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["The evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:d.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]}),H]}),J&&P&&o.jsxs(be,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:Ya,children:[o.jsx("span",{className:eo,children:"Evaluator binding"}),o.jsxs(Ga,{label:"Evaluator binding help",docHref:`${Ka}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
|
|
292
|
+
|
|
293
|
+
`,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
|
|
294
|
+
|
|
295
|
+
`,"The harness and model fields above apply only to the solver role."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:d.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]}),H]}),y&&o.jsx(wI,{onSuccess:()=>{S(!1),I.mutate()},onCancel:()=>{S(!1)}}),h&&o.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",className:"m-0 font-mono text-[13px] text-destructive",children:h}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"default","data-testid":"join-flow-submit",disabled:!A,onClick:()=>{if(f(null),x.roles.includes("solver")&&x.harness===il){S(!0);return}I.mutate()},children:I.isPending?"Joining…":"Join SolverNet"})]})]})}function c0({message:e,onBack:t,onRetry:r}){return o.jsxs(nt,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(at,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-retry",onClick:r,children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-back",onClick:t,children:"Back"})]})]})}function c8({success:e,navigate:t}){const r=e.roles.map(c=>c==="solver"?"Solver":"Evaluator").join(" + "),[n,s]=C.useState(!1),[i,l]=C.useState(null),a=async()=>{s(!0),l(null);try{if(!(await he.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(c){l(c instanceof Error?c.message:"Restart request failed."),s(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs(be,{"data-testid":"join-flow-success-card",role:"status",className:"flex flex-col gap-2.5 border-[var(--vow-green)] p-5",children:[o.jsx(Ce,{variant:"success",className:"self-start",children:"Joined"}),o.jsxs("span",{"data-testid":"join-flow-success-name",className:"font-mono text-[18px] font-medium text-foreground",children:["You joined ",e.name]}),o.jsxs("span",{className:"font-mono text-[12px] leading-relaxed text-[var(--fg-muted)]",children:["You're in as ",r||"an operator",". This SolverNet now shows in your joined list."]}),e.restartRequired&&o.jsx("span",{"data-testid":"join-flow-success-restart",className:"font-mono text-[12px] leading-relaxed text-[var(--accent-gold)]",children:"Restart the node to start participating — the daemon picks up SolverNet config on restart."})]}),i&&o.jsx(It,{role:"alert","data-testid":"join-flow-success-restart-error",className:"font-mono text-[12px] leading-relaxed text-destructive",children:i}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),children:"Browse SolverNets"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:"View joined SolverNet"}),o.jsx(ie,{type:"button",variant:"default","data-testid":"join-flow-success-restart-button",onClick:()=>{a()},disabled:n,children:n?"Restarting…":"Restart node now"})]})]})}function u8({capture:e}){var t;return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Executor"}),o.jsxs("dl",{className:"m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]",children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Tool"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.name}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Version"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.version??"unknown"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Repo"}),o.jsx("dd",{className:"m-0 break-words font-mono text-[12px] text-foreground",children:e.repoRemoteUrl??"none"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Commit"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function d8({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Redactions"}),t.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No redacted attributes."}):o.jsx("div",{className:"flex flex-col gap-1.5",children:t.map((r,n)=>o.jsxs("div",{className:"grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]",children:[o.jsx("span",{className:"text-muted-foreground",children:r.span}),o.jsx("span",{className:"break-words",children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function f8({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:i}){const{capture:l,spans:a}=e;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:l.sessionId}),o.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[new Date(l.capturedAt).toLocaleString()," · ",a.length," spans"]})]}),o.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[l.repoRemoteUrl?o.jsx(ie,{variant:"secondary",size:"sm",onClick:()=>i(!0),children:"Trust repo"}):null,o.jsx(ie,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),o.jsx(ie,{variant:"default",size:"sm",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),o.jsx(u8,{capture:l}),o.jsx(d8,{spans:a}),o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Trajectory"}),a.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No spans recorded."}):o.jsx(be,{children:o.jsx(et,{className:"flex flex-col p-0",children:a.map((c,d)=>o.jsxs("div",{children:[d>0&&o.jsx(st,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5",children:[o.jsx("strong",{className:"min-w-0 truncate font-mono text-[12px] font-medium text-foreground",children:c.name}),o.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:c.spanId})]})]},c.spanId))})})]})]})}function h8(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ih="Switch",[m8]=Ln(ih),[p8,g8]=m8(ih),K2=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:l,disabled:a,value:c="on",onCheckedChange:d,form:p,...u}=e,[g,_]=C.useState(null),x=qe(t,v=>_(v)),b=C.useRef(!1),h=g?p||!!g.closest("form"):!0,[f,m]=Cl({prop:s,defaultProp:i??!1,onChange:d,caller:ih});return o.jsxs(p8,{scope:r,checked:f,disabled:a,children:[o.jsx(We.button,{type:"button",role:"switch","aria-checked":f,"aria-required":l,"data-state":Q2(f),"data-disabled":a?"":void 0,disabled:a,value:c,...u,ref:x,onClick:_e(e.onClick,v=>{m(y=>!y),h&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),h&&o.jsx(X2,{control:g,bubbles:!b.current,name:n,value:c,checked:f,required:l,disabled:a,form:p,style:{transform:"translateX(-100%)"}})]})});K2.displayName=ih;var Y2="SwitchThumb",Z2=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=g8(Y2,r);return o.jsx(We.span,{"data-state":Q2(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Z2.displayName=Y2;var v8="SwitchBubbleInput",X2=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const l=C.useRef(null),a=qe(l,i),c=h8(r),d=VE(t);return C.useEffect(()=>{const p=l.current;if(!p)return;const u=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==r&&_){const x=new Event("click",{bubbles:n});_.call(p,r),p.dispatchEvent(x)}},[c,r,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});X2.displayName=v8;function Q2(e){return e?"checked":"unchecked"}var J2=K2,_8=Z2;const ek=C.forwardRef(({className:e,...t},r)=>o.jsx(J2,{className:te("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--vow-green)] data-[state=unchecked]:bg-border",e),...t,ref:r,children:o.jsx(_8,{className:te("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5")})}));ek.displayName=J2.displayName;const fn=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:te("animate-pulse rounded-md bg-muted",e),...t}));fn.displayName="Skeleton";function ng(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function y8(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(ng(e.perArtifactTypePrice))===JSON.stringify(ng(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function u0({label:e,value:t,meta:r}){return o.jsxs("div",{"data-testid":"operator-donation-fact",className:"flex min-w-0 flex-col gap-1.5 rounded-lg border border-border px-3.5 py-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:e}),o.jsx("strong",{className:"font-mono text-[18px] font-medium text-foreground",children:t}),o.jsx("span",{className:"truncate font-mono text-[12px] text-[var(--fg-dim)]",children:r})]})}function x8({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,onSave:s,registerRevert:i}){const[l,a]=C.useState(e.donation.enabled),[c,d]=C.useState(!1),p=C.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:l}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,l]),u=!y8(e,p),g=x=>{if(x&&!l&&!e.donation.enabled){d(!0);return}a(x)},_=()=>{const x={...p,donation:{enabled:!0}};a(!0),d(!1),i(()=>a(!1)),s(x)};return o.jsxs("div",{"data-testid":"operator-donation-status",className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-[260px] flex-[1_1_360px] flex-col gap-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Donate execution data"}),o.jsx("strong",{"data-testid":"operator-donation-mode",className:l?"font-mono text-[18px] font-medium text-[var(--vow-green)]":"font-mono text-[18px] font-medium text-foreground",children:l?"Donation is on":"Donation is off"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[12px] leading-relaxed text-[var(--fg-dim)]",children:"Share scrubbed and anonymized solver/evaluator data from future runs with other operators. This lets the network learn from real executions and improve itself. Public testnet donations are free and published to IPFS."})]}),o.jsxs("label",{"data-testid":"operator-donation-toggle",className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-border bg-[var(--bg-sunken)] px-3 py-2",children:[o.jsx("span",{className:l?"font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--vow-green)]":"font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:l?"On":"Off"}),o.jsx(ek,{"aria-label":"Donate produced data",checked:l,onCheckedChange:g})]})]}),o.jsxs("div",{"data-testid":"operator-donation-facts",className:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]",children:[o.jsx(u0,{label:"Eligible runs",value:String(t),meta:"local history"}),o.jsx(u0,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),o.jsx(nt,{variant:"info","data-testid":"operator-donation-caveat",children:o.jsx(at,{children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."})}),o.jsx(st,{}),o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"data-testid":"operator-donation-settings-state",className:u?"font-mono text-[12px] text-primary":"font-mono text-[12px] text-[var(--fg-dim)]",children:u?"Donation changed":"Current"}),o.jsx(ie,{variant:"default",size:"sm",type:"button",disabled:!u||n,onClick:()=>{const x=e.donation.enabled;l!==x&&i(()=>a(x)),s(p)},children:n?"Saving…":"Save"})]})}),o.jsx(b2,{open:c,onOpenChange:d,children:o.jsxs(S_,{"data-testid":"operator-donation-confirm",children:[o.jsxs(w_,{children:[o.jsx(E_,{children:"Share future execution data"}),o.jsx(j_,{children:"Future solver/evaluator runs will be scrubbed, anonymized, and published to IPFS so other operators can use them. This helps the network learn from real executions and improve itself. Turning donation off later stops future publishing, but data already published to IPFS may remain available."})]}),o.jsxs(C_,{children:[o.jsx(R_,{children:"Cancel"}),o.jsx(k_,{onClick:_,children:"Enable donation"})]})]})})]})}function b8({onRestartPending:e=()=>{}}){const t=Hi(),{data:r,isLoading:n,isError:s,error:i,refetch:l}=Oe({queryKey:["operator-artifacts","served"],queryFn:()=>he.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=C.useRef(null),c=g=>{a.current=g},d=Ss({mutationFn:g=>he.operator.updatePricing(g),onSuccess:async()=>{a.current=null,Xn.success("Donation setting saved",{description:"Restart pending — applies on next daemon start."}),e(),await t.invalidateQueries({queryKey:["operator-artifacts"]})},onError:g=>{const _=a.current;a.current=null,_==null||_(),Xn.error("Failed to save donation setting",{description:g instanceof Error?g.message:String(g)})}}),p=r==null?void 0:r.summary,u=p?`${p.served.totalCount} eligible runs · donation ${r!=null&&r.pricing.donation.enabled?"on":"off"} · ${p.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return o.jsxs(be,{children:[o.jsxs(ir,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(pn,{className:"flex items-center gap-2",children:[o.jsx(tO,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Data donation"]}),o.jsx(Ns,{children:u})]}),o.jsx(Ce,{variant:r!=null&&r.pricing.donation.enabled?"success":"outline",children:r!=null&&r.pricing.donation.enabled?"IPFS donation on":"Donation off"})]}),o.jsxs(et,{children:[n&&o.jsxs("div",{"data-testid":"operator-data-market-loading",className:"flex flex-col gap-3","aria-label":"Loading execution data",children:[o.jsx(fn,{className:"h-6 w-40"}),o.jsx(fn,{className:"h-4 w-72"}),o.jsx(fn,{className:"h-20 w-full"})]}),s&&o.jsxs(nt,{variant:"blocking",role:"alert","data-testid":"operator-data-market-error",className:"flex items-center justify-between gap-3",children:[o.jsx(It,{className:"text-[var(--break-red)]",children:i instanceof Error?i.message:"Failed to load execution data."}),o.jsxs(ie,{variant:"outline",size:"sm",type:"button",onClick:()=>{l()},children:[o.jsx(eO,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]})]}),r&&o.jsx(x8,{pricing:r.pricing,eligibleRuns:r.summary.served.totalCount,peerDatasetsUsed:r.summary.network.totalCount,saving:d.isPending,onSave:g=>d.mutate(g),registerRevert:c},`${r.pricing.publicEndpoint}|${r.pricing.defaultPriceUsdc}|${r.pricing.donation.enabled}|${JSON.stringify(ng(r.pricing.perArtifactTypePrice))}`)]})]})}const S8=t2,w8=r2,tk=C.forwardRef(({className:e,...t},r)=>o.jsx(v_,{className:te("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));tk.displayName=v_.displayName;const C8=zf("fixed z-50 gap-4 bg-card p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rk=C.forwardRef(({side:e="right",className:t,children:r,...n},s)=>o.jsxs(w8,{children:[o.jsx(tk,{}),o.jsxs(__,{ref:s,className:te(C8({side:e}),t),...n,children:[r,o.jsxs(b_,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none",children:[o.jsx(Dc,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));rk.displayName=__.displayName;const nk=({className:e,...t})=>o.jsx("div",{className:te("flex flex-col gap-2 text-left",e),...t});nk.displayName="SheetHeader";const sk=C.forwardRef(({className:e,...t},r)=>o.jsx(y_,{ref:r,className:te("font-serif text-[20px] text-foreground",e),...t}));sk.displayName=y_.displayName;const ik=C.forwardRef(({className:e,...t},r)=>o.jsx(x_,{ref:r,className:te("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));ik.displayName=x_.displayName;function ak(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB"];let r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function of(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function E8(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function j8(e,t){switch(e){case 8453:return`https://basescan.org/tx/${t}`;case 84532:return`https://sepolia.basescan.org/tx/${t}`;case 11155111:return`https://sepolia.etherscan.io/tx/${t}`;default:return null}}function d0(e){return e==null||!Number.isFinite(e)?"—":of(new Date(e*1e3).toISOString())}function Ki({title:e,children:t}){return o.jsxs(be,{children:[o.jsx(ir,{className:"pb-2",children:o.jsx(pn,{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:e})}),o.jsx(et,{className:"p-4 pt-0",children:t})]})}function Yi({rows:e}){return o.jsx("dl",{className:"m-0 grid gap-x-3.5 gap-y-2.5 [grid-template-columns:140px_minmax(0,1fr)]",children:e.map(({label:t,value:r})=>o.jsxs(C.Fragment,{children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:t}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:r??"—"})]},t))})}function hc(e){return e.source==="served"?e.createdAt:e.fetchedAt}function O_(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function f0(e,t){return!e||e.kind!==t.kind?!1:e.kind==="capture"&&t.kind==="capture"?e.id===t.id:e.kind==="artifact"&&t.kind==="artifact"?e.source===t.source&&e.sha256===t.sha256:!1}function sg(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function vm(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(sg(e))}function h0({kind:e,message:t}){const r=e==="permission"?"Permission required to view execution data. Open the dashboard from the daemon handshake URL or refresh an authenticated session.":`Execution data could not be loaded${t?`: ${t}`:"."}`;return o.jsx(nt,{variant:e==="permission"?"warning":"blocking","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",children:o.jsx(at,{children:r})})}function k8(e){return{id:`capture:${e.sessionId}`,selection:{kind:"capture",id:e.sessionId},title:"execution-capture.v1",state:e.status,meta:`${e.originatingTool.name} · ${e.spanCount} spans · ${e.redactedSpanCount} redacted`,at:e.capturedAt}}function R8(e){const t=O_(e);return{id:`artifact:${e.source}:${e.sha256}`,selection:{kind:"artifact",source:e.source,sha256:e.sha256},title:e.artifactType,state:t,meta:`${e.source==="served"?"produced":"peer"} · ${ak(e.contentSize)} · ${E8(e.sha256)}`,at:hc(e)}}function N8({artifact:e}){const t=hc(e),r=e.projection,n=e.anchors??[],s=[{label:"state",value:O_(e)},{label:"sha256",value:e.sha256},{label:"recorded",value:of(t)}],i=[{label:"envelope",value:e.envelopeCid??"—"}];r&&i.push({label:"signature",value:r.signatureHash},{label:"generated",value:d0(r.generatedAt)},{label:"role",value:r.role},{label:"solver",value:r.solverType},{label:"evidence tier",value:r.evidenceTier});const l=r?[{label:"safe",value:r.participantSafeAddress??"—"},{label:"agent EOA",value:r.participantAgentEoa??"—"},{label:"impl",value:r.executor.implName??"—"},{label:"impl version",value:r.executor.implVersion??"—"},{label:"runtime digest",value:r.executor.runtimeBundleDigest??"—"},{label:"plugins",value:r.executor.plugins&&r.executor.plugins.length>0?o.jsx("div",{className:"flex flex-wrap gap-1",children:r.executor.plugins.map(c=>o.jsx(Ce,{variant:"outline",children:c},c))}):"—"}]:null,a=r?[{label:"task CID",value:r.taskCid??"—"},{label:"task ID",value:r.taskId??"—"},{label:"request",value:r.requestId??"—"},{label:"solution ref",value:r.solutionRef?`${r.solutionRef.envelopeCid}${r.solutionRef.ref?` (${r.solutionRef.ref})`:""}`:"—"}]:null;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsx(Ki,{title:"Identity",children:o.jsx(Yi,{rows:s})}),o.jsx(Ki,{title:"Envelope",children:o.jsx(Yi,{rows:i})}),l?o.jsx(Ki,{title:"Participant",children:o.jsx(Yi,{rows:l})}):null,a?o.jsx(Ki,{title:"Task",children:o.jsx(Yi,{rows:a})}):null,o.jsx(Ki,{title:"On-chain anchors",children:n.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"no on-chain anchor recorded yet"}):o.jsx("div",{className:"flex flex-col gap-3",children:n.map(c=>{const d=j8(c.chainId,c.txHash),p=[{label:"content kind",value:c.contentKind},{label:"agent ID",value:c.agentId},{label:"chain ID",value:String(c.chainId)},{label:"tx",value:d?o.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"break-all underline underline-offset-2 hover:text-foreground",children:c.txHash}):c.txHash},{label:"block",value:c.blockNumber!==null?String(c.blockNumber):"pending"},{label:"anchored",value:d0(c.anchoredAt)},{label:"registry",value:c.identityRegistryAddress},{label:"metadata key",value:c.metadataKey}];return o.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[o.jsx(Yi,{rows:p}),o.jsxs("details",{className:"mt-2",children:[o.jsx("summary",{className:"cursor-pointer font-mono text-[11px] text-muted-foreground",children:"payload (ABI-encoded)"}),o.jsx("div",{className:"mt-1 break-all font-mono text-[11px] text-foreground",children:c.payloadHex})]})]},`${c.contentKind}:${c.txHash}`)})})}),e.source==="served"?o.jsx(Ki,{title:"Access",children:o.jsx(Yi,{rows:[{label:"request",value:e.requestId??"—"},{label:"accesses",value:`${e.access.accessCount} total · ${e.access.failedPaymentCount} failed`},{label:"paid serves",value:String(e.access.paidServeCount)},{label:"free serves",value:String(e.access.freeServeCount)},{label:"revenue",value:`${e.access.revenueUsdc} USDC`}]})}):o.jsx(Ki,{title:"Source",children:o.jsx(Yi,{rows:[{label:"operator",value:e.sourceOperator??"—"},{label:"endpoint",value:e.sourceEndpoint??"—"},{label:"origin",value:e.origin},{label:"paid",value:`${e.paidAmountUsdc} USDC`},{label:"peer catalog",value:e.peerCatalogId??"—"}]})})]})}function T8(){var w,j,R,M;const e=Hi(),[t,r]=C.useState(),[n,s]=C.useState(!1),i=Oe({queryKey:["captures","pending"],queryFn:()=>he.captures.listPending(),refetchInterval:2500}),l=Oe({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>he.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=Oe({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>he.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),c=((w=i.data)==null?void 0:w.captures)??[],d=[...((j=l.data)==null?void 0:j.artifacts)??[],...((R=a.data)==null?void 0:R.artifacts)??[]].sort((T,O)=>hc(O).localeCompare(hc(T))),p=[...c.map(k8),...d.map(R8)].sort((T,O)=>O.at.localeCompare(T.at)),u=(t==null?void 0:t.kind)==="capture"?t.id:void 0,g=(t==null?void 0:t.kind)==="artifact"?d.find(T=>T.source===t.source&&T.sha256===t.sha256):void 0,_=i.isLoading||l.isLoading||a.isLoading,x=[i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason,a.isError?a.error:a.failureReason].filter(Boolean),b=x.find(vm),h=b??x[0];C.useEffect(()=>{if(p.length===0){t&&r(void 0),n&&s(!1);return}(!t||!p.some(T=>f0(t,T.selection)))&&r(p[0].selection)},[p,t,n]);const f=Oe({queryKey:["captures",u],queryFn:()=>he.captures.get(u),enabled:!!u}),m=Ss({mutationFn:T=>he.captures.approve(T),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),v=Ss({mutationFn:T=>he.captures.skip(T),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),y=Ss({mutationFn:T=>he.captures.trustRepo(T,!0)}),S=T=>{r(T),s(!0)},E=(t==null?void 0:t.kind)==="capture"?((M=f.data)==null?void 0:M.capture.sessionId)??"Capture":(g==null?void 0:g.artifactType)??"Artifact",k=(t==null?void 0:t.kind)==="capture"&&f.data?`${new Date(f.data.capture.capturedAt).toLocaleString()} · ${f.data.spans.length} spans`:(t==null?void 0:t.kind)==="artifact"&&g?`${O_(g)} · ${ak(g.contentSize)} · ${of(hc(g))}`:"Execution data detail.";return o.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[o.jsx(b8,{defaultExpanded:!0}),o.jsxs(be,{children:[o.jsx(ir,{children:o.jsx(pn,{children:"Execution data"})}),o.jsxs(et,{children:[h?o.jsx("div",{className:"mb-3",children:o.jsx(h0,{kind:b?"permission":"error",message:b?void 0:sg(h)})}):null,_&&p.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"Loading execution data."}):p.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"No execution data yet."}):o.jsx(su,{className:"max-h-[560px]",children:o.jsx("div",{className:"flex flex-col gap-2 pr-2",children:p.map(T=>{const O=f0(t,T.selection);return o.jsxs(ie,{variant:"ghost","data-testid":"execution-data-row","data-state":O?"active":void 0,"aria-current":O?"true":void 0,onClick:()=>S(T.selection),className:te("flex h-auto w-full flex-col items-stretch gap-1.5 rounded-md border border-border bg-card px-4 py-3 text-left font-mono text-[12px] normal-case tracking-normal hover:bg-accent",O&&"border-primary bg-primary/[0.06]"),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("strong",{className:"min-w-0 truncate font-medium text-foreground",children:T.title}),o.jsx(Ce,{variant:"outline",className:"shrink-0",children:T.state})]}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[T.meta," · ",of(T.at)]})]},T.id)})})})]})]}),o.jsx(S8,{open:n,onOpenChange:s,children:o.jsxs(rk,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl","data-testid":"execution-data-sheet",children:[o.jsxs(nk,{children:[o.jsx(sk,{className:"break-all",children:E}),o.jsx(ik,{children:k})]}),o.jsx("div",{className:"mt-4",children:f.error?o.jsx(h0,{kind:vm(f.error)?"permission":"error",message:vm(f.error)?void 0:sg(f.error)}):(t==null?void 0:t.kind)==="capture"&&f.data?o.jsx(f8,{detail:f.data,approving:m.isPending,skipping:v.isPending,onApprove:()=>u&&m.mutate(u),onSkip:()=>u&&v.mutate(u),onTrustRepo:()=>{const T=f.data.capture.repoRemoteUrl;T&&y.mutate(T)}}):(t==null?void 0:t.kind)==="artifact"&&g?o.jsx(N8,{artifact:g}):o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:_?"Loading execution data.":"Select execution data."})})]})})]})}function m0(e){const t=A8(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(O8);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function A8(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=L8(s),a=M8(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var D8=Symbol("radix.slottable");function O8(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D8}function M8(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function L8(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ok(e){const t=e+"CollectionProvider",[r,n]=Ln(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:h,children:f}=b,m=X.useRef(null),v=X.useRef(new Map).current;return o.jsx(s,{scope:h,itemMap:v,collectionRef:m,children:f})};l.displayName=t;const a=e+"CollectionSlot",c=m0(a),d=X.forwardRef((b,h)=>{const{scope:f,children:m}=b,v=i(a,f),y=qe(h,v.collectionRef);return o.jsx(c,{ref:y,children:m})});d.displayName=a;const p=e+"CollectionItemSlot",u="data-radix-collection-item",g=m0(p),_=X.forwardRef((b,h)=>{const{scope:f,children:m,...v}=b,y=X.useRef(null),S=qe(h,y),E=i(p,f);return X.useEffect(()=>(E.itemMap.set(y,{ref:y,...v}),()=>void E.itemMap.delete(y))),o.jsx(g,{[u]:"",ref:S,children:m})});_.displayName=p;function x(b){const h=i(e+"CollectionConsumer",b);return X.useCallback(()=>{const m=h.collectionRef.current;if(!m)return[];const v=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((E,k)=>v.indexOf(E.ref.current)-v.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:d,ItemSlot:_},x,n]}var _m="rovingFocusGroup.onEntryFocus",P8={bubbles:!1,cancelable:!0},uu="RovingFocusGroup",[ig,lk,B8]=ok(uu),[I8,ck]=Ln(uu,[B8]),[H8,z8]=I8(uu),uk=C.forwardRef((e,t)=>o.jsx(ig.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(ig.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(F8,{...e,ref:t})})}));uk.displayName=uu;var F8=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...u}=e,g=C.useRef(null),_=qe(t,g),x=Fv(i),[b,h]=Cl({prop:l,defaultProp:a??null,onChange:c,caller:uu}),[f,m]=C.useState(!1),v=nr(d),y=lk(r),S=C.useRef(!1),[E,k]=C.useState(0);return C.useEffect(()=>{const w=g.current;if(w)return w.addEventListener(_m,v),()=>w.removeEventListener(_m,v)},[v]),o.jsx(H8,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:b,onItemFocus:C.useCallback(w=>h(w),[h]),onItemShiftTab:C.useCallback(()=>m(!0),[]),onFocusableItemAdd:C.useCallback(()=>k(w=>w+1),[]),onFocusableItemRemove:C.useCallback(()=>k(w=>w-1),[]),children:o.jsx(We.div,{tabIndex:f||E===0?-1:0,"data-orientation":n,...u,ref:_,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{S.current=!0}),onFocus:_e(e.onFocus,w=>{const j=!S.current;if(w.target===w.currentTarget&&j&&!f){const R=new CustomEvent(_m,P8);if(w.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=y().filter(P=>P.focusable),T=M.find(P=>P.active),O=M.find(P=>P.id===b),$=[T,O,...M].filter(Boolean).map(P=>P.ref.current);hk($,p)}}S.current=!1}),onBlur:_e(e.onBlur,()=>m(!1))})})}),dk="RovingFocusGroupItem",fk=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:l,...a}=e,c=Ei(),d=i||c,p=z8(dk,r),u=p.currentTabStopId===d,g=lk(r),{onFocusableItemAdd:_,onFocusableItemRemove:x,currentTabStopId:b}=p;return C.useEffect(()=>{if(n)return _(),()=>x()},[n,_,x]),o.jsx(ig.ItemSlot,{scope:r,id:d,focusable:n,active:s,children:o.jsx(We.span,{tabIndex:u?0:-1,"data-orientation":p.orientation,...a,ref:t,onMouseDown:_e(e.onMouseDown,h=>{n?p.onItemFocus(d):h.preventDefault()}),onFocus:_e(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:_e(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){p.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const f=V8(h,p.orientation,p.dir);if(f!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let v=g().filter(y=>y.focusable).map(y=>y.ref.current);if(f==="last")v.reverse();else if(f==="prev"||f==="next"){f==="prev"&&v.reverse();const y=v.indexOf(h.currentTarget);v=p.loop?q8(v,y+1):v.slice(y+1)}setTimeout(()=>hk(v))}}),children:typeof l=="function"?l({isCurrentTabStop:u,hasTabStop:b!=null}):l})})});fk.displayName=dk;var U8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function V8(e,t,r){const n=$8(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return U8[n]}function hk(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function q8(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var W8=uk,G8=fk;function K8(e){const t=Y8(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(X8);if(c){const d=c.props.children,p=a.map(u=>u===c?C.Children.count(d)>1?C.Children.only(null):C.isValidElement(d)?d.props.children:null:u);return o.jsx(t,{...l,ref:s,children:C.isValidElement(d)?C.cloneElement(d,void 0,p):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function Y8(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=J8(s),a=Q8(i,s.props);return s.type!==C.Fragment&&(a.ref=n?Ls(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z8=Symbol("radix.slottable");function X8(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z8}function Q8(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function J8(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ag=["Enter"," "],eH=["ArrowDown","PageUp","Home"],mk=["ArrowUp","PageDown","End"],tH=[...eH,...mk],rH={ltr:[...ag,"ArrowRight"],rtl:[...ag,"ArrowLeft"]},nH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},du="Menu",[Lc,sH,iH]=ok(du),[Ba,pk]=Ln(du,[iH,wl,ck]),ah=wl(),gk=ck(),[aH,Ia]=Ba(du),[oH,fu]=Ba(du),vk=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:l=!0}=e,a=ah(t),[c,d]=C.useState(null),p=C.useRef(!1),u=nr(i),g=Fv(s);return C.useEffect(()=>{const _=()=>{p.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>p.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),o.jsx(s_,{...a,children:o.jsx(aH,{scope:t,open:r,onOpenChange:u,content:c,onContentChange:d,children:o.jsx(oH,{scope:t,onClose:C.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:p,dir:g,modal:l,children:n})})})};vk.displayName=du;var lH="MenuAnchor",M_=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ah(r);return o.jsx(Gf,{...s,...n,ref:t})});M_.displayName=lH;var L_="MenuPortal",[cH,_k]=Ba(L_,{forceMount:void 0}),yk=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=Ia(L_,t);return o.jsx(cH,{scope:t,forceMount:r,children:o.jsx(ar,{present:r||i.open,children:o.jsx(ou,{asChild:!0,container:s,children:n})})})};yk.displayName=L_;var hn="MenuContent",[uH,P_]=Ba(hn),xk=C.forwardRef((e,t)=>{const r=_k(hn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Ia(hn,e.__scopeMenu),l=fu(hn,e.__scopeMenu);return o.jsx(Lc.Provider,{scope:e.__scopeMenu,children:o.jsx(ar,{present:n||i.open,children:o.jsx(Lc.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(dH,{...s,ref:t}):o.jsx(fH,{...s,ref:t})})})})}),dH=C.forwardRef((e,t)=>{const r=Ia(hn,e.__scopeMenu),n=C.useRef(null),s=qe(t,n);return C.useEffect(()=>{const i=n.current;if(i)return h_(i)},[]),o.jsx(B_,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),fH=C.forwardRef((e,t)=>{const r=Ia(hn,e.__scopeMenu);return o.jsx(B_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),hH=K8("MenuContent.ScrollLock"),B_=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:g,onDismiss:_,disableOutsideScroll:x,...b}=e,h=Ia(hn,r),f=fu(hn,r),m=ah(r),v=gk(r),y=sH(r),[S,E]=C.useState(null),k=C.useRef(null),w=qe(t,k,h.onContentChange),j=C.useRef(0),R=C.useRef(""),M=C.useRef(0),T=C.useRef(null),O=C.useRef("right"),F=C.useRef(0),$=x?th:C.Fragment,P=x?{as:hH,allowPinchZoom:!0}:void 0,U=D=>{var A,H;const L=R.current+D,I=y().filter(G=>!G.disabled),Q=document.activeElement,q=(A=I.find(G=>G.ref.current===Q))==null?void 0:A.textValue,J=I.map(G=>G.textValue),Z=EH(J,L,q),me=(H=I.find(G=>G.textValue===Z))==null?void 0:H.ref.current;(function G(Y){R.current=Y,window.clearTimeout(j.current),Y!==""&&(j.current=window.setTimeout(()=>G(""),1e3))})(L),me&&setTimeout(()=>me.focus())};C.useEffect(()=>()=>window.clearTimeout(j.current),[]),f_();const N=C.useCallback(D=>{var I,Q;return O.current===((I=T.current)==null?void 0:I.side)&&kH(D,(Q=T.current)==null?void 0:Q.area)},[]);return o.jsx(uH,{scope:r,searchRef:R,onItemEnter:C.useCallback(D=>{N(D)&&D.preventDefault()},[N]),onItemLeave:C.useCallback(D=>{var L;N(D)||((L=k.current)==null||L.focus(),E(null))},[N]),onTriggerLeave:C.useCallback(D=>{N(D)&&D.preventDefault()},[N]),pointerGraceTimerRef:M,onPointerGraceIntentChange:C.useCallback(D=>{T.current=D},[]),children:o.jsx($,{...P,children:o.jsx(Jf,{asChild:!0,trapped:s,onMountAutoFocus:_e(i,D=>{var L;D.preventDefault(),(L=k.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(iu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:g,onDismiss:_,children:o.jsx(W8,{asChild:!0,...v,dir:f.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:_e(c,D=>{f.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(i_,{role:"menu","aria-orientation":"vertical","data-state":Pk(h.open),"data-radix-menu-content":"",dir:f.dir,...m,...b,ref:w,style:{outline:"none",...b.style},onKeyDown:_e(b.onKeyDown,D=>{const I=D.target.closest("[data-radix-menu-content]")===D.currentTarget,Q=D.ctrlKey||D.altKey||D.metaKey,q=D.key.length===1;I&&(D.key==="Tab"&&D.preventDefault(),!Q&&q&&U(D.key));const J=k.current;if(D.target!==J||!tH.includes(D.key))return;D.preventDefault();const me=y().filter(A=>!A.disabled).map(A=>A.ref.current);mk.includes(D.key)&&me.reverse(),wH(me)}),onBlur:_e(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(j.current),R.current="")}),onPointerMove:_e(e.onPointerMove,Pc(D=>{const L=D.target,I=F.current!==D.clientX;if(D.currentTarget.contains(L)&&I){const Q=D.clientX>F.current?"right":"left";O.current=Q,F.current=D.clientX}}))})})})})})})});xk.displayName=hn;var mH="MenuGroup",I_=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(We.div,{role:"group",...n,ref:t})});I_.displayName=mH;var pH="MenuLabel",bk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(We.div,{...n,ref:t})});bk.displayName=pH;var lf="MenuItem",p0="menu.itemSelect",oh=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=C.useRef(null),l=fu(lf,e.__scopeMenu),a=P_(lf,e.__scopeMenu),c=qe(t,i),d=C.useRef(!1),p=()=>{const u=i.current;if(!r&&u){const g=new CustomEvent(p0,{bubbles:!0,cancelable:!0});u.addEventListener(p0,_=>n==null?void 0:n(_),{once:!0}),sE(u,g),g.defaultPrevented?d.current=!1:l.onClose()}};return o.jsx(Sk,{...s,ref:c,disabled:r,onClick:_e(e.onClick,p),onPointerDown:u=>{var g;(g=e.onPointerDown)==null||g.call(e,u),d.current=!0},onPointerUp:_e(e.onPointerUp,u=>{var g;d.current||(g=u.currentTarget)==null||g.click()}),onKeyDown:_e(e.onKeyDown,u=>{const g=a.searchRef.current!=="";r||g&&u.key===" "||ag.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});oh.displayName=lf;var Sk=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,l=P_(lf,r),a=gk(r),c=C.useRef(null),d=qe(t,c),[p,u]=C.useState(!1),[g,_]=C.useState("");return C.useEffect(()=>{const x=c.current;x&&_((x.textContent??"").trim())},[i.children]),o.jsx(Lc.ItemSlot,{scope:r,disabled:n,textValue:s??g,children:o.jsx(G8,{asChild:!0,...a,focusable:!n,children:o.jsx(We.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:_e(e.onPointerMove,Pc(x=>{n?l.onItemLeave(x):(l.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,Pc(x=>l.onItemLeave(x))),onFocus:_e(e.onFocus,()=>u(!0)),onBlur:_e(e.onBlur,()=>u(!1))})})})}),gH="MenuCheckboxItem",wk=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return o.jsx(Rk,{scope:e.__scopeMenu,checked:r,children:o.jsx(oh,{role:"menuitemcheckbox","aria-checked":cf(r)?"mixed":r,...s,ref:t,"data-state":z_(r),onSelect:_e(s.onSelect,()=>n==null?void 0:n(cf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});wk.displayName=gH;var Ck="MenuRadioGroup",[vH,_H]=Ba(Ck,{value:void 0,onValueChange:()=>{}}),Ek=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=nr(n);return o.jsx(vH,{scope:e.__scopeMenu,value:r,onValueChange:i,children:o.jsx(I_,{...s,ref:t})})});Ek.displayName=Ck;var jk="MenuRadioItem",kk=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=_H(jk,e.__scopeMenu),i=r===s.value;return o.jsx(Rk,{scope:e.__scopeMenu,checked:i,children:o.jsx(oh,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":z_(i),onSelect:_e(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});kk.displayName=jk;var H_="MenuItemIndicator",[Rk,yH]=Ba(H_,{checked:!1}),Nk=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=yH(H_,r);return o.jsx(ar,{present:n||cf(i.checked)||i.checked===!0,children:o.jsx(We.span,{...s,ref:t,"data-state":z_(i.checked)})})});Nk.displayName=H_;var xH="MenuSeparator",Tk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Tk.displayName=xH;var bH="MenuArrow",Ak=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ah(r);return o.jsx(a_,{...s,...n,ref:t})});Ak.displayName=bH;var SH="MenuSub",[h7,Dk]=Ba(SH),Xl="MenuSubTrigger",Ok=C.forwardRef((e,t)=>{const r=Ia(Xl,e.__scopeMenu),n=fu(Xl,e.__scopeMenu),s=Dk(Xl,e.__scopeMenu),i=P_(Xl,e.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},p=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>p,[p]),C.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),o.jsx(M_,{asChild:!0,...d,children:o.jsx(Sk,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":Pk(r.open),...e,ref:Ls(t,s.onTriggerChange),onClick:u=>{var g;(g=e.onClick)==null||g.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,Pc(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:_e(e.onPointerLeave,Pc(u=>{var _,x;p();const g=(_=r.content)==null?void 0:_.getBoundingClientRect();if(g){const b=(x=r.content)==null?void 0:x.dataset.side,h=b==="right",f=h?-5:5,m=g[h?"left":"right"],v=g[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+f,y:u.clientY},{x:m,y:g.top},{x:v,y:g.top},{x:v,y:g.bottom},{x:m,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,u=>{var _;const g=i.searchRef.current!=="";e.disabled||g&&u.key===" "||rH[n.dir].includes(u.key)&&(r.onOpenChange(!0),(_=r.content)==null||_.focus(),u.preventDefault())})})})});Ok.displayName=Xl;var Mk="MenuSubContent",Lk=C.forwardRef((e,t)=>{const r=_k(hn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Ia(hn,e.__scopeMenu),l=fu(hn,e.__scopeMenu),a=Dk(Mk,e.__scopeMenu),c=C.useRef(null),d=qe(t,c);return o.jsx(Lc.Provider,{scope:e.__scopeMenu,children:o.jsx(ar,{present:n||i.open,children:o.jsx(Lc.Slot,{scope:e.__scopeMenu,children:o.jsx(B_,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var u;l.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:_e(e.onFocusOutside,p=>{p.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:_e(e.onKeyDown,p=>{var _;const u=p.currentTarget.contains(p.target),g=nH[l.dir].includes(p.key);u&&g&&(i.onOpenChange(!1),(_=a.trigger)==null||_.focus(),p.preventDefault())})})})})})});Lk.displayName=Mk;function Pk(e){return e?"open":"closed"}function cf(e){return e==="indeterminate"}function z_(e){return cf(e)?"indeterminate":e?"checked":"unchecked"}function wH(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function CH(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function EH(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=CH(e,Math.max(i,0));s.length===1&&(l=l.filter(d=>d!==r));const c=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function jH(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],d=a.x,p=a.y,u=c.x,g=c.y;p>n!=g>n&&r<(u-d)*(n-p)/(g-p)+d&&(s=!s)}return s}function kH(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return jH(r,t)}function Pc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var RH=vk,NH=M_,TH=yk,AH=xk,DH=I_,OH=bk,MH=oh,LH=wk,PH=Ek,BH=kk,IH=Nk,HH=Tk,zH=Ak,FH=Ok,UH=Lk,lh="DropdownMenu",[$H]=Ln(lh,[pk]),hr=pk(),[VH,Bk]=$H(lh),Ik=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:a=!0}=e,c=hr(t),d=C.useRef(null),[p,u]=Cl({prop:s,defaultProp:i??!1,onChange:l,caller:lh});return o.jsx(VH,{scope:t,triggerId:Ei(),triggerRef:d,contentId:Ei(),open:p,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(g=>!g),[u]),modal:a,children:o.jsx(RH,{...c,open:p,onOpenChange:u,dir:n,modal:a,children:r})})};Ik.displayName=lh;var Hk="DropdownMenuTrigger",zk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=Bk(Hk,r),l=hr(r);return o.jsx(NH,{asChild:!0,...l,children:o.jsx(We.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Ls(t,i.triggerRef),onPointerDown:_e(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:_e(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});zk.displayName=Hk;var qH="DropdownMenuPortal",Fk=e=>{const{__scopeDropdownMenu:t,...r}=e,n=hr(t);return o.jsx(TH,{...n,...r})};Fk.displayName=qH;var Uk="DropdownMenuContent",$k=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Bk(Uk,r),i=hr(r),l=C.useRef(!1);return o.jsx(AH,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,a=>{var c;l.current||(c=s.triggerRef.current)==null||c.focus(),l.current=!1,a.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!s.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$k.displayName=Uk;var WH="DropdownMenuGroup",GH=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(DH,{...s,...n,ref:t})});GH.displayName=WH;var KH="DropdownMenuLabel",Vk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(OH,{...s,...n,ref:t})});Vk.displayName=KH;var YH="DropdownMenuItem",qk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(MH,{...s,...n,ref:t})});qk.displayName=YH;var ZH="DropdownMenuCheckboxItem",Wk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(LH,{...s,...n,ref:t})});Wk.displayName=ZH;var XH="DropdownMenuRadioGroup",QH=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(PH,{...s,...n,ref:t})});QH.displayName=XH;var JH="DropdownMenuRadioItem",ez=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(BH,{...s,...n,ref:t})});ez.displayName=JH;var tz="DropdownMenuItemIndicator",Gk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(IH,{...s,...n,ref:t})});Gk.displayName=tz;var rz="DropdownMenuSeparator",Kk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(HH,{...s,...n,ref:t})});Kk.displayName=rz;var nz="DropdownMenuArrow",sz=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(zH,{...s,...n,ref:t})});sz.displayName=nz;var iz="DropdownMenuSubTrigger",az=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(FH,{...s,...n,ref:t})});az.displayName=iz;var oz="DropdownMenuSubContent",lz=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=hr(r);return o.jsx(UH,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lz.displayName=oz;var cz=Ik,uz=zk,dz=Fk,Yk=$k,Zk=Vk,Xk=qk,Qk=Wk,fz=Gk,Jk=Kk;const hz=cz,mz=uz,eR=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(dz,{children:o.jsx(Yk,{ref:n,sideOffset:t,className:te("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r})}));eR.displayName=Yk.displayName;const tR=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(Xk,{ref:n,className:te("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 font-mono text-[12px] outline-none transition-colors focus:bg-[var(--bg-sunken)] focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));tR.displayName=Xk.displayName;const pz=C.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(Qk,{ref:s,className:te("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 font-mono text-[12px] outline-none focus:bg-[var(--bg-sunken)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fz,{children:o.jsx($D,{className:"h-3 w-3"})})}),t]}));pz.displayName=Qk.displayName;const gz=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(Zk,{ref:n,className:te("px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",t&&"pl-8",e),...r}));gz.displayName=Zk.displayName;const vz=C.forwardRef(({className:e,...t},r)=>o.jsx(Jk,{ref:r,className:te("-mx-1 my-1 h-px bg-border",e),...t}));vz.displayName=Jk.displayName;const g0=[{to:"/operator/memberships",label:"Memberships"},{to:"/operator/registry",label:"Registry"},{to:"/operator/execution-data",label:"Execution data"},{to:"/operator/network",label:"Network"},{to:"/operator/security",label:"Security"}];function _z({to:e,label:t}){const[r]=OD(e);return o.jsx("li",{children:o.jsx(Cr,{href:e,"aria-current":r?"page":void 0,className:te("block rounded-sm px-3 py-2 font-mono text-[12px] tracking-[0.08em] no-underline transition-colors",r?"bg-[var(--bg-elevated)] font-medium text-foreground":"bg-transparent font-normal text-[var(--fg-muted)] hover:text-foreground"),children:t})})}function yz(){const[,e]=gn();return o.jsxs("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",className:"flex min-w-[160px] flex-col pt-1",children:[o.jsx("div",{className:"mb-2 sm:hidden",children:o.jsxs(hz,{children:[o.jsx(mz,{asChild:!0,children:o.jsxs(ie,{variant:"outline",size:"sm","data-testid":"operator-sub-nav-trigger",children:[o.jsx(ZD,{className:"h-3.5 w-3.5"})," Sections"]})}),o.jsx(eR,{align:"start",children:g0.map(t=>o.jsx(tR,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),o.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:g0.map(t=>o.jsx(_z,{to:t.to,label:t.label},t.to))})]})}function Fl({children:e}){return o.jsxs("div",{"data-testid":"operator-shell",className:"flex items-start gap-6 p-6",children:[o.jsx(yz,{}),o.jsx("div",{className:"min-w-0 flex-1",children:e})]})}function ym(e){const t=Gr(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??To(t)}}function v0(e,t){const r=Gr(t.harness);if(e.harness!==r||e.model!==(t.model??To(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let a=0;a<n.length;a+=1)if(n[a]!==s[a])return!0;const i=[...e.disabledDefaultPlugins].sort(),l=[...t.disabledDefaultPlugins??[]].sort();if(i.length!==l.length)return!0;for(let a=0;a<i.length;a+=1)if(i[a]!==l[a])return!0;return!1}const _0="flex h-9 w-full rounded-sm border border-border bg-sunken px-2.5 py-1 font-mono text-[13px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function xz({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[i,l]=C.useState(r),[a,c]=C.useState(()=>ym(e)),d=C.useRef(null),p=C.useRef(null),u=Hi(),g=t!==void 0,_=Oe({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>he.solvernets.getManifest(e.manifestCid),enabled:!g&&!!e.manifestCid,staleTime:1/0,retry:!1}),x=Oe({queryKey:["solvernets","catalog"],queryFn:()=>he.getSolverNets(),enabled:!g}),h=(()=>{var J;if(g)return t;const q=(J=_.data)==null?void 0:J.manifest;if(!(!q||!x.data))return x.data.nets.find(Z=>Z.contract.id===q.contract.id&&Z.contract.version===q.contract.version)})(),f=e.contract??(h==null?void 0:h.contract),m=!g&&(_.isLoading||x.isLoading),v=!g&&_.isError&&!_.isLoading;C.useEffect(()=>{v0(a,e)||c(ym(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),C.useEffect(()=>{r&&(l(!0),n==="harness"&&setTimeout(()=>{var q,J;(q=d.current)==null||q.scrollIntoView({block:"center",behavior:"smooth"}),(J=p.current)==null||J.focus()},50))},[r,n]);const y=((h==null?void 0:h.compatibleHarnesses)??[]).filter(q=>q.supportsRoles.includes("solving")).map(q=>({...q,name:Gr(q.name)})).filter((q,J,Z)=>Z.findIndex(me=>me.name===q.name)===J),S=new Set(y.map(q=>q.name)),E=a.harness!==""&&y.length>0&&![...S].some(q=>eP(q,a.harness)),k=h?`${h.contract.id}@${h.contract.version}`:"",w=nh(a.harness),j=Ss({mutationFn:()=>he.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...f!==void 0?{contract:{id:f.id,version:f.version}}:{},roles:e.roles,...a.harness?{harness:a.harness}:{},plugins:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,...a.model?{model:a.model}:{}}),onSuccess:q=>{u.invalidateQueries({queryKey:["operator","joined"]}),q.restartRequired&&(s==null||s())}}),[R,M]=C.useState(!1),T=e.roles.includes("solver"),O=G2(T?a.harness:void 0),F=D_(O,T?a.model:void 0),$=T&&F.requiresConfirmation,P=$&&!R,[U,N]=C.useState(!1),D=Ss({mutationFn:()=>he.operator.leave(e.manifestCid),onSuccess:q=>{u.invalidateQueries({queryKey:["operator","joined"]}),q.restartRequired&&(s==null||s()),N(!1)}}),L=v0(a,e),I=e.name??e.manifestCid,Q=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return o.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":i?"true":"false",className:"flex flex-col gap-2.5 rounded-md border border-border bg-background px-4 py-3.5",children:[o.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{"data-testid":"joined-net-card-name",className:"truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]",children:I}),o.jsxs("div",{className:"flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground",children:[e.roles.map(q=>o.jsx(bz,{label:q},q)),o.jsxs("span",{className:"text-dim",children:["cid ",Q]})]})]}),v?o.jsx("div",{className:"flex flex-col items-end gap-1.5",children:U?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:D.isPending,onClick:()=>N(!1),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:D.isPending,onClick:()=>D.mutate(),children:D.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>N(!0),children:[o.jsx(Dc,{"aria-hidden":"true",className:"!size-3"}),"Leave"]})}):o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-toggle",onClick:()=>l(q=>!q),children:i?o.jsxs(o.Fragment,{children:[o.jsx(Hf,{"aria-hidden":"true",className:"!size-3.5"}),"Close"]}):o.jsxs(o.Fragment,{children:[o.jsx(WC,{"aria-hidden":"true",className:"!size-3.5"}),"Edit"]})})]}),v&&o.jsxs("div",{"data-testid":"joined-net-card-orphaned",className:"rounded-sm border border-wane bg-transparent px-3.5 py-2.5 font-mono text-[12px] leading-relaxed text-muted-foreground",children:[o.jsx(Ce,{variant:"pill",className:"mr-2 align-baseline",children:"Retired"}),"Manifest no longer in the registry. This SolverNet is not claiming on-chain anymore — leaving it removes the entry from your config. Restart the daemon afterwards so it stops looking for this manifest at startup.",D.isError&&o.jsx("div",{role:"alert",className:"mt-1.5 text-[11px] text-destructive",children:D.error instanceof Error?D.error.message:"Leave failed."})]}),!i&&!v&&o.jsx(y0,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:E?`does not support ${k}`:null,warningTestId:"joined-net-card-warn-collapsed"}),v&&o.jsx(y0,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),i&&!v&&o.jsxs("div",{"data-testid":"joined-net-card-form",className:"flex flex-col gap-3.5 border-t border-border pt-3",children:[o.jsxs("div",{ref:d,className:"flex flex-col gap-1.5",children:[o.jsx(Vr,{htmlFor:"joined-net-card-harness-select",children:"Harness"}),o.jsxs("select",{ref:p,id:"joined-net-card-harness-select","aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:a.harness,onChange:q=>{const J=q.target.value;c(Z=>({...Z,harness:J,model:To(J)})),M(!1)},className:te(_0,E&&"border-destructive"),children:[a.harness===""&&o.jsx("option",{value:"",children:"—"}),y.map(q=>o.jsx("option",{value:q.name,children:xj(q.name,q.version)},q.name)),a.harness&&y.length>0&&!S.has(a.harness)&&o.jsxs("option",{value:a.harness,children:[ki(a.harness)," (incompatible)"]}),a.harness&&y.length===0&&o.jsx("option",{value:a.harness,children:ki(a.harness)})]}),E&&o.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",className:"font-mono text-[11px] leading-relaxed text-destructive",children:["⚠ This harness does not support ",o.jsx("span",{className:"text-foreground",children:k}),".",y.length>0&&o.jsxs(o.Fragment,{children:[" Compatible: ",y.map((q,J)=>o.jsxs("span",{className:"text-primary",children:[ki(q.name),J<y.length-1?" · ":""]},q.name))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Vr,{children:"Plugins"}),m?o.jsx("span",{"data-testid":"joined-net-card-catalog-loading",className:"font-mono text-[12px] text-dim",children:"Loading registry catalog…"}):h?(h.compatiblePlugins??[]).length===0?o.jsx(rg,{available:[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(q,J)=>c(Z=>({...Z,plugins:q,disabledDefaultPlugins:J})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx(rg,{available:(h==null?void 0:h.compatiblePlugins)??[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(q,J)=>c(Z=>({...Z,plugins:q,disabledDefaultPlugins:J})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx("span",{"data-testid":"joined-net-card-catalog-missing",className:"font-mono text-[12px] italic text-dim",children:"Registry catalog has no template for this SolverNet's contract — plugins can't be verified."})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Vr,{htmlFor:"joined-net-card-model-select",children:"Model"}),o.jsxs("select",{id:"joined-net-card-model-select","aria-label":"Model","data-testid":"joined-net-card-model-select",value:a.model,onChange:q=>{c({...a,model:q.target.value}),M(!1)},className:_0,children:[w.map(q=>o.jsx("option",{value:q.id,children:q.label},q.id)),(()=>{const q=N_(a.model,a.harness);return q.isCustom?o.jsx("option",{value:a.model,children:q.label},a.model):null})()]})]}),T&&o.jsx(F2,{modelId:a.model,usesPaidApiKey:O,variant:"inline",testIdPrefix:"joined-net-card-cost"}),T&&o.jsx(W2,{harness:a.harness,modelId:a.model,variant:"inline",testIdPrefix:"joined-net-card-footprint"}),$&&o.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":R?"true":"false",className:"flex cursor-pointer items-start gap-2 rounded-md border border-destructive bg-background px-3 py-2.5 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:R,onChange:q=>M(q.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),j.isError&&o.jsx("span",{role:"alert","data-testid":"joined-net-card-error",className:"font-mono text-[12px] text-destructive",children:j.error instanceof Error?j.error.message:"Save failed."}),o.jsx(st,{}),o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-dim",children:[o.jsx("span",{children:L?"Restart required to apply.":"No unsaved changes."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-cancel",disabled:!L||j.isPending,onClick:()=>c(ym(e)),children:"Cancel"}),o.jsx(ie,{type:"button",size:"sm","data-testid":"joined-net-card-save",disabled:!L||j.isPending||P,onClick:()=>j.mutate(),children:j.isPending?"Saving…":"Save"})]})]}),o.jsxs("div",{"data-testid":"joined-net-card-leave-zone",className:"mt-1 flex flex-wrap items-start justify-between gap-3 border-t border-dashed border-border pt-3",children:[o.jsx("span",{"data-testid":"joined-net-card-leave-explainer",className:"max-w-[440px] font-mono text-[11px] leading-relaxed text-dim",children:"Leave removes this SolverNet from your config right away. The running daemon keeps its loaded copy in memory, so it will go on claiming and finishing tasks for this SolverNet until you restart it — restart to actually stop new claims. Tasks already in flight run to completion either way. You can re-join from the Discover catalog later."}),U?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:D.isPending,onClick:()=>N(!1),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:D.isPending,onClick:()=>D.mutate(),children:D.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>N(!0),children:[o.jsx(Dc,{"aria-hidden":"true",className:"!size-3"}),"Leave SolverNet"]})]})]})]})}function y0({harness:e,plugins:t,model:r,harnessWarning:n,warningTestId:s}){return o.jsxs("div",{className:"grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground",children:[o.jsx("span",{children:"harness"}),o.jsxs("span",{className:"text-foreground",children:[e?ki(e):o.jsx("span",{className:"text-dim",children:"—"}),n&&s&&o.jsxs("span",{"data-testid":s,className:"ml-2.5 text-destructive",children:["⚠ ",n]})]}),o.jsx("span",{children:"plugins"}),o.jsx("span",{className:"text-foreground",children:(t??[]).length===0?o.jsx("span",{className:"text-dim",children:"—"}):`${t.length} active`}),o.jsx("span",{children:"model"}),o.jsx("span",{className:"text-foreground",children:r?N_(r,Gr(e)).label:o.jsx("span",{className:"text-dim",children:"—"})})]})}function bz({label:e}){return o.jsx(Ce,{variant:"outline","data-testid":"joined-net-card-role",className:"px-1.5 py-px text-[10px]",children:e})}function Sz({onRestartPending:e}={}){const t=Oe({queryKey:["operator","joined"],queryFn:()=>he.operator.listJoined(),refetchInterval:3e4}),r=C.useMemo(()=>{var s;const n=((s=t.data)==null?void 0:s.joinedSolverNets)??{};return Object.values(n)},[t.data]);return o.jsxs("div",{"data-testid":"memberships-tab",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Joined · ",r.length]}),t.isError&&o.jsx("span",{role:"alert",className:"font-mono text-[11px] text-[var(--break-red)]",children:"Failed to load joined SolverNets."})]}),t.isLoading&&o.jsxs("div",{"data-testid":"memberships-tab-loading",className:"flex flex-col gap-3","aria-label":"Loading",children:[o.jsx(fn,{className:"h-20 w-full"}),o.jsx(fn,{className:"h-20 w-full"})]}),!t.isLoading&&r.length===0&&o.jsxs("p",{"data-testid":"memberships-tab-empty",className:"m-0 font-mono text-[12px] leading-relaxed text-muted-foreground",children:["You haven't joined any SolverNets yet. Browse the"," ",o.jsx(Cr,{href:"/operator/registry",className:"text-primary no-underline hover:underline",children:"Registry"})," ","to participate."]}),r.map(n=>o.jsx(xz,{joined:n,onRestartPending:e},n.manifestCid))]})}const x0={launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"}};function wz(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function Cz(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 Ez(e){if(e instanceof Error){const t=e.code;if(typeof t=="string")return t;if(e.message.includes("subsystem_not_ready"))return"subsystem_not_ready";if(e.message.includes("registry_unavailable"))return"registry_unavailable";if(e.message.includes("rpc_rate_limited"))return"rpc_rate_limited"}return null}const jz={title:"Your RPC endpoint is rate-limited.",detail:"Open the Network section and add your own free key.",actionHref:"/operator#network",actionLabel:"Open Network settings →"};function kz(e){switch(Ez(e)){case"subsystem_not_ready":return{title:"SolverNet subsystem is still starting.",detail:"Wait a few seconds, then retry. If this persists, restart the daemon and check its startup logs."};case"registry_unavailable":return{title:"Registry cache is unavailable.",detail:"The daemon could not read the SolverNet registry cache. Retry after startup finishes; check daemon logs if it keeps failing."};case"rpc_rate_limited":return jz;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function Rz({code:e,message:t}){return e==="rpc_rate_limited"?o.jsxs("span",{"data-testid":"registry-catalog-warn","data-error-code":"rpc_rate_limited",className:"inline-flex gap-2 normal-case tracking-normal text-[var(--wane)]",children:[o.jsx("span",{children:"RPC rate-limited — add your own key"}),o.jsx(Cr,{href:"/operator#network","data-testid":"registry-catalog-warn-action",className:"text-primary no-underline hover:underline",children:"Network settings →"})]}):o.jsxs("span",{"data-testid":"registry-catalog-warn",className:"normal-case tracking-normal text-[var(--wane)]",children:["stale (",t,")"]})}function Nz({status:e}){const t=x0[e]??x0.launched;return o.jsx(Ce,{"data-testid":"registry-status-badge","data-status":e,variant:t.variant,className:"whitespace-nowrap",children:t.label})}function Tz({openRoles:e}){return e.length===0?o.jsx("span",{className:"text-[12px] text-[var(--fg-dim)]",children:"no open roles"}):o.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map(t=>o.jsx(Ce,{"data-testid":"registry-open-role","data-role":t,variant:"outline",className:"rounded-full text-foreground",children:t},t))})}function Az({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0,s=e.status==="launched";return o.jsx(be,{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,className:"flex flex-col gap-3 p-4",children:o.jsxs("article",{className:"flex flex-col gap-3",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-[15px] font-medium text-foreground",children:e.name}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:["Launcher: ",wz(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),o.jsx(Nz,{status:e.status})]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Open roles"}),o.jsx(Tz,{openRoles:e.openRoles}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:hi(e.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:hi(e.verdictPriceWei)})]}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[n&&o.jsxs(Ce,{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,variant:"success",className:"rounded-full px-2.5 py-1",children:["JOINED · ",(t??[]).join(", ")]}),s?o.jsx(ie,{asChild:!0,variant:n?"secondary":"default","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,children:o.jsx(Cr,{href:r,children:n?"Edit":"Join"})}):o.jsx(ie,{type:"button",variant:"secondary","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,disabled:!0,"aria-disabled":!0,className:"pointer-events-none",children:n?"Edit":"Join"})]})]})})}function Dz({refetchIntervalMs:e=3e4}={}){var g;const{data:t,isLoading:r,isError:n,error:s,refetch:i}=Oe({queryKey:["solvernets","registry"],queryFn:()=>he.solvernets.listRegistry(),refetchInterval:e}),l=Oe({queryKey:["operator","joined"],queryFn:()=>he.operator.listJoined(),refetchInterval:e}),a=((g=l.data)==null?void 0:g.joinedSolverNets)??{};if(r||l.isLoading)return o.jsx("p",{"data-testid":"registry-catalog-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading catalog…"});if(n||l.isError){const _=n?s:l.error,x=kz(_);return o.jsxs(nt,{"data-testid":"registry-catalog-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(It,{className:"font-mono text-[13px] font-medium text-destructive",children:x.title}),o.jsx(at,{className:"text-[12px] text-[var(--fg-muted)]",children:x.detail}),x.actionHref&&x.actionLabel&&o.jsx(Cr,{href:x.actionHref,"data-testid":"registry-catalog-error-action",className:"mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline",children:x.actionLabel})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"registry-catalog-retry",onClick:()=>{i()},children:"Retry"})]})}const c=(t==null?void 0:t.summaries)??[],d=c.filter(_=>a[_.manifestCid]===void 0),p=Cz((t==null?void 0:t.lastRefreshedAt)??null),u=(t==null?void 0:t.lastError)??null;return o.jsxs("div",{"data-testid":"registry-catalog",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:[o.jsxs("span",{"data-testid":"registry-catalog-meta",children:[d.length," discoverable · last refreshed"," ",p??"never"]}),u&&o.jsx(Rz,{code:u.code,message:u.message})]}),d.length===0?o.jsx(be,{"data-testid":"registry-catalog-empty",className:"p-6 font-mono text-[13px] text-[var(--fg-muted)]",children:c.length===0?"No launched SolverNets available.":"No unjoined SolverNets available."}):o.jsx("div",{className:"flex flex-col gap-2.5",children:d.map(_=>{var x;return o.jsx(Az,{summary:_,joinedRoles:(x=a[_.manifestCid])==null?void 0:x.roles},_.manifestCid)})})]})}function Oz(){return o.jsxs("div",{"data-testid":"registry-tab",className:"flex flex-col gap-3",children:[o.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[o.jsx(WD,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Discover"]}),o.jsx(Dz,{})]})}function Mz({onRestartPending:e=()=>{}}={}){const{data:t}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:1500}),r=(t==null?void 0:t.chain)??"base-sepolia",n=(t==null?void 0:t.rpcUrl)??"",s=(t==null?void 0:t.defaultRpcUrl)??(r==="base"?"https://mainnet.base.org":"https://base-sepolia-rpc.publicnode.com");return o.jsxs("div",{"data-testid":"network-tab",className:"flex flex-col gap-4",children:[o.jsx(Bz,{chain:r,rpcUrl:n,defaultRpcUrl:s,rpcHealthy:!0,onRestartPending:e}),o.jsx(Pz,{})]})}function Lz(e){if(e instanceof Error){const t=e.code;if(typeof t=="string")return t;if(e.message.includes("rpc_rate_limited"))return"rpc_rate_limited";if(e.message.includes("discovery_unavailable"))return"discovery_unavailable";if(e.message.includes("subsystem_not_ready"))return"subsystem_not_ready"}}function Pz(){const{data:e,isLoading:t,isError:r,error:n}=Oe({queryKey:["discovery","task-post-counts","chain"],queryFn:()=>he.discovery.getTaskPostCounts(),refetchInterval:3e4});let s;return r?s=Lz(n)==="rpc_rate_limited"?o.jsxs(nt,{variant:"warning","data-error-code":"rpc_rate_limited",children:[o.jsx(Bv,{className:"h-4 w-4 text-[var(--wane)]"}),o.jsx(It,{className:"text-[var(--wane)]",children:"RPC rate-limited"}),o.jsx(at,{children:"Your RPC endpoint is rate-limited — add your own free key above to keep the task-post rate live."})]}):o.jsx("p",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Task-post rate is unavailable while the indexer catches up."}):t||!e?s=o.jsx("p",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}):e.chain?e.chain.h24===0?s=o.jsx("p",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"No task posts in the last 24h."}):s=o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[["Last 1h",e.chain.h1],["Last 6h",e.chain.h6],["Last 24h",e.chain.h24]].map(([i,l])=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:i}),o.jsx("span",{className:"font-mono text-[20px] text-foreground",children:l})]},i))}):s=o.jsx("p",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Task-post rate is unavailable while the indexer catches up."}),o.jsxs(be,{"data-testid":"network-task-posts",children:[o.jsxs(ir,{children:[o.jsxs(pn,{className:"flex items-center gap-2",children:[o.jsx(qC,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Task posts"]}),o.jsx(Ns,{children:"On-chain task posts on this network (approximate, block-windowed)."})]}),o.jsx(et,{children:s})]})}function Bz({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s}){const[i,l]=C.useState(t),[a,c]=C.useState(!1),d=i!==t,p=t===r,u=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",g=u.split(" (")[0],_=async()=>{c(!0);try{const x=i.length===0?null:i,b=await he.updateNetwork({rpcUrl:x});Xn.success("RPC URL saved",{description:b.restartRequired?"Restart pending — applies on next daemon start.":"Applied to the running daemon."}),b.restartRequired&&s()}catch(x){Xn.error("Failed to save RPC URL",{description:x instanceof Error?x.message:String(x)})}finally{c(!1)}};return o.jsxs(be,{children:[o.jsxs(ir,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(pn,{className:"flex items-center gap-2",children:[o.jsx(XD,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Network"]}),o.jsxs(Ns,{children:[g," · ",t]})]}),o.jsx(Ce,{variant:n?"success":"destructive",children:n?"Healthy":"Unreachable"})]}),o.jsxs(et,{children:[o.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(Vr,{children:"Chain"}),o.jsx("div",{className:"rounded-md border border-border bg-[var(--bg-sunken)] px-3 py-2 font-mono text-[13px] text-muted-foreground",children:u}),o.jsx(Ce,{variant:"outline",className:"self-start",children:"locked"}),o.jsx("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Switching chains resets fleet state — that's a separate flow."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Vr,{htmlFor:"rpc-url",children:"RPC URL"}),d&&o.jsx(Ce,{variant:"warning",children:"Restart"})]}),o.jsx(St,{id:"rpc-url",type:"text",value:i,onChange:x=>l(x.target.value),placeholder:r,className:d?"border-primary":void 0}),o.jsx(ie,{variant:"link",size:"sm",type:"button",onClick:()=>l(""),className:"h-auto self-start p-0 text-[11px]",children:"Use default"}),p&&o.jsxs(nt,{variant:"warning",className:"mt-3","data-testid":"network-shared-rpc-warning",children:[o.jsx(Bv,{className:"h-4 w-4 text-[var(--wane)]"}),o.jsx(It,{className:"text-[var(--wane)]",children:"Shared RPC"}),o.jsxs(at,{children:["You're on the default RPC — a free public gateway shared with every operator on the default config. Fine for setup; not reliable under load. Get your own free key from"," ",o.jsxs("a",{href:"https://dashboard.tenderly.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Tenderly ",o.jsx(Co,{className:"h-2.5 w-2.5"})]}),","," ",o.jsxs("a",{href:"https://www.alchemy.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Alchemy ",o.jsx(Co,{className:"h-2.5 w-2.5"})]}),", or"," ",o.jsxs("a",{href:"https://www.quicknode.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["QuickNode ",o.jsx(Co,{className:"h-2.5 w-2.5"})]})," ","and paste it above."]})]}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Default: ",r]})]})]}),d&&o.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2 border-t border-border pt-4",children:[o.jsx(ie,{variant:"secondary",size:"sm",type:"button",onClick:()=>l(t),children:"Cancel"}),o.jsx(ie,{variant:"default",size:"sm",type:"button",disabled:a,onClick:()=>{_()},children:a?"Saving…":"Save"})]})]})]})}var hu=e=>e.type==="checkbox",ra=e=>e instanceof Date,Kt=e=>e==null;const rR=e=>typeof e=="object";var gt=e=>!Kt(e)&&!Array.isArray(e)&&rR(e)&&!ra(e),nR=e=>gt(e)&&e.target?hu(e.target)?e.target.checked:e.target.value:e,og=(e,t)=>{const r=t.split("."),n=[];let s=r[0];for(let i=1;i<r.length;s+="."+r[i++])!isNaN(+r[i])&&e.has(s)&&n.push(s);return n},Iz=e=>{const t=e.constructor&&e.constructor.prototype;return gt(t)&&t.hasOwnProperty("isPrototypeOf")},F_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(F_&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(gt(e)&&Iz(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=bt(e[s]));return n}var mu=e=>/^\w*$/.test(e),ut=e=>e===void 0,U_=e=>Array.isArray(e)?e.filter(Boolean):[],ch=e=>U_(e.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(e,t,r)=>{if(!t||!gt(e))return r;const s=(mu(t)?[t]:ch(t)).reduce((i,l)=>Kt(i)?void 0:i[l],e);return ut(s)||s===e?ut(e[t])?r:e[t]:s},Or=e=>typeof e=="boolean",rr=e=>typeof e=="function",Ye=(e,t,r)=>{let n=-1;const s=mu(t)?[t]:ch(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const d=e[a];c=gt(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const Gs={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Nn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},xm="form",sR="root",$_=X.createContext(null);$_.displayName="HookFormControlContext";const V_=()=>X.useContext($_);var iR=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==Nn.all&&(t._proxyFormState[l]=!n||Nn.all),r&&(r[l]=!0),e[l]}});return s};const q_=typeof window<"u"?X.useLayoutEffect:X.useEffect;function Hz(e){const t=V_(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[l,a]=X.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return q_(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:d=>{!n&&a({...r._formState,...d,defaultValues:r._defaultValues})}}),[s,n,i]),X.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),X.useMemo(()=>iR(l,r,c.current,!1),[l,r])}var sr=e=>typeof e=="string",lg=(e,t,r,n,s)=>sr(e)?(n&&t.watch.add(e),oe(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),oe(r,i))):(n&&(t.watchAll=!0),r),cg=e=>Kt(e)||!rR(e);function Mr(e,t,r=new WeakSet){if(e===t)return!0;if(cg(e)||cg(t))return Object.is(e,t);if(ra(e)&&ra(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const l=e[i];if(!(i in t))return!1;if(i!=="ref"){const a=t[i];if(ra(l)&&ra(a)||(gt(l)||Array.isArray(l))&&(gt(a)||Array.isArray(a))?!Mr(l,a,r):!Object.is(l,a))return!1}}return!0}function zz(e){const t=V_(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=X.useRef(s),d=X.useRef(a),p=X.useRef(void 0),u=X.useRef(r),g=X.useRef(n);d.current=a;const[_,x]=X.useState(()=>{const y=r._getWatch(n,c.current);return d.current?d.current(y):y}),b=X.useCallback(y=>{const S=lg(n,r._names,y||r._formValues,!1,c.current);return d.current?d.current(S):S},[r._formValues,r._names,n]),h=X.useCallback(y=>{if(!i){const S=lg(n,r._names,y||r._formValues,!1,c.current);if(d.current){const E=d.current(S);Mr(E,p.current)||(x(E),p.current=E)}else x(S)}},[r._formValues,r._names,i,n]);q_(()=>((u.current!==r||!Mr(g.current,n))&&(u.current=r,g.current=n,h()),r._subscribe({name:n,formState:{values:!0},exact:l,callback:y=>{h(y.values)}})),[r,l,n,h]),X.useEffect(()=>r._removeUnmounted());const f=u.current!==r,m=g.current,v=X.useMemo(()=>{if(i)return null;const y=!f&&!Mr(m,n);return f||y?b():null},[i,f,n,m,b]);return v!==null?v:_}function Fz(e){const t=V_(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:l,exact:a=!0}=e,c=!!og(s._names.array,r).length,d=X.useMemo(()=>oe(s._formValues,r,oe(s._defaultValues,r,l)),[s,r,l]),p=zz({control:s,name:r,defaultValue:d,exact:a}),u=Hz({control:s,name:r,exact:a}),g=X.useRef(e),_=X.useRef(s.register(r,{...e.rules,value:p,...Or(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const x=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!oe(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!oe(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!oe(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!oe(u.validatingFields,r)},error:{enumerable:!0,get:()=>oe(u.errors,r)}}),[u,r]),b=X.useCallback(v=>_.current.onChange({target:{value:nR(v),name:r},type:Gs.CHANGE}),[r]),h=X.useCallback(()=>_.current.onBlur({target:{value:oe(s._formValues,r),name:r},type:Gs.BLUR}),[r,s._formValues]),f=X.useCallback(v=>{const y=oe(s._fields,r);y&&y._f&&v&&(y._f.ref={focus:()=>rr(v.focus)&&v.focus(),select:()=>rr(v.select)&&v.select(),setCustomValidity:S=>rr(v.setCustomValidity)&&v.setCustomValidity(S),reportValidity:()=>rr(v.reportValidity)&&v.reportValidity()})},[s._fields,r]),m=X.useMemo(()=>({name:r,value:p,...Or(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:b,onBlur:h,ref:f}),[r,n,u.disabled,b,h,f,p]);return X.useEffect(()=>{const v=s._options.shouldUnregister||i;s.register(r,{...g.current.rules,...Or(g.current.disabled)?{disabled:g.current.disabled}:{}});const y=(S,E)=>{const k=oe(s._fields,S);k&&k._f&&(k._f.mount=E)};if(y(r,!0),v){const S=bt(oe(s._defaultValues,r,oe(s._options.defaultValues,r,g.current.defaultValue)));Ye(s._defaultValues,r,S),ut(oe(s._formValues,r))&&Ye(s._formValues,r,S)}return!c&&s.register(r),()=>{(c?v&&!s._state.action:v)?s.unregister(r):y(r,!1)}},[r,s,c,i]),X.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),X.useMemo(()=>({field:m,formState:u,fieldState:x}),[m,u,x])}const Uz=e=>e.render(Fz(e)),W_=X.createContext(null);W_.displayName="HookFormContext";const $z=()=>X.useContext(W_),Vz=e=>{const{children:t,watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:d,formState:p,resetField:u,reset:g,handleSubmit:_,unregister:x,control:b,register:h,setFocus:f,subscribe:m}=e,v=X.useMemo(()=>({watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:d,formState:p,resetField:u,reset:g,handleSubmit:_,unregister:x,control:b,register:h,setFocus:f,subscribe:m}),[l,b,p,s,n,_,h,g,u,i,f,a,c,m,d,x,r]);return X.createElement(W_.Provider,{value:v},X.createElement($_.Provider,{value:v.control},t))};var G_=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},mc=e=>Array.isArray(e)?e:[e],b0=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function aR(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&>(s)&&i){const l=aR(s,i);gt(l)&&(r[n]=l)}else e[n]&&(r[n]=i)}return r}var tr=e=>gt(e)&&!Object.keys(e).length,K_=e=>e.type==="file",uf=e=>{if(!F_)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},oR=e=>e.type==="select-multiple",Y_=e=>e.type==="radio",qz=e=>Y_(e)||hu(e),bm=e=>uf(e)&&e.isConnected;function Wz(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Kt(e)){e=void 0;break}e=e[t[n]],n++}return e}function Gz(e){for(const t in e)if(e.hasOwnProperty(t)&&!ut(e[t]))return!1;return!0}function Rt(e,t){if(sr(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:mu(t)?[t]:ch(t),n=r.length===1?e:Wz(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(gt(n)&&tr(n)||Array.isArray(n)&&Gz(n))&&Rt(e,r.slice(0,-1)),e}var Kz=e=>{for(const t in e)if(rr(e[t]))return!0;return!1};function lR(e){return Array.isArray(e)||gt(e)&&!Kz(e)}function ug(e,t={}){for(const r in e){const n=e[r];lR(n)?(t[r]=Array.isArray(n)?[]:{},ug(n,t[r])):ut(n)||(t[r]=!0)}return t}function dg(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>dg(r));return t.some(r=>r!==void 0)?t:void 0}if(gt(e)){const t={};for(const r in e){const n=dg(e[r]);ut(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function to(e,t,r){r||(r=ug(t));for(const n in e){const s=e[n];if(lR(s))ut(t)||cg(r[n])?r[n]=ug(s,Array.isArray(s)?[]:{}):to(s,Kt(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!Mr(s,i)}}return dg(r)||{}}const S0={value:!1,isValid:!1},w0={value:!0,isValid:!0};var cR=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ut(e[0].attributes.value)?ut(e[0].value)||e[0].value===""?w0:{value:e[0].value,isValid:!0}:w0:S0}return S0},uR=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ut(e)?e:t?e===""?NaN:e&&+e:r&&sr(e)?new Date(e):n?n(e):e;const C0={isValid:!1,value:null};var dR=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,C0):C0;function E0(e){const t=e.ref;return K_(t)?t.files:Y_(t)?dR(e.refs).value:oR(t)?[...t.selectedOptions].map(({value:r})=>r):hu(t)?cR(e.refs).value:uR(ut(t.value)?e.ref.value:t.value,e)}var Yz=(e,t,r,n)=>{const s={};for(const i of e){const l=oe(t,i);l&&Ye(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},df=e=>e instanceof RegExp,Ul=e=>ut(e)?e:df(e)?e.source:gt(e)?df(e.value)?e.value.source:e.value:e,j0=e=>({isOnSubmit:!e||e===Nn.onSubmit,isOnBlur:e===Nn.onBlur,isOnChange:e===Nn.onChange,isOnAll:e===Nn.all,isOnTouch:e===Nn.onTouched});const k0="AsyncFunction";var Zz=e=>!!e&&!!e.validate&&!!(rr(e.validate)&&e.validate.constructor.name===k0||gt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===k0)),Xz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),R0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const pc=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=oe(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(pc(a,t))break}else if(gt(a)&&pc(a,t))break}}};function N0(e,t,r){const n=oe(e,r);if(n||mu(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=oe(t,i),a=oe(e,i);if(l&&!Array.isArray(l)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var Qz=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return tr(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!n||Nn.all))},Jz=(e,t,r)=>!e||!t||e===t||mc(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),eF=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,tF=(e,t)=>!U_(oe(e,t)).length&&Rt(e,t),T0=(e,t,r)=>{const n=mc(oe(e,r));return Ye(n,sR,t[r]),Ye(e,r,n),e};function A0(e,t,r="validate"){if(sr(e)||Array.isArray(e)&&e.every(sr)||Or(e)&&!e)return{type:r,message:sr(e)?e:"",ref:t}}var Za=e=>gt(e)&&!df(e)?e:{value:e,message:""},D0=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:d,minLength:p,min:u,max:g,pattern:_,validate:x,name:b,valueAsNumber:h,mount:f}=e._f,m=oe(r,b);if(!f||t.has(b))return{};const v=a?a[0]:l,y=T=>{s&&v.reportValidity&&(v.setCustomValidity(Or(T)?"":T||""),v.reportValidity())},S={},E=Y_(l),k=hu(l),w=E||k,j=(h||K_(l))&&ut(l.value)&&ut(m)||uf(l)&&l.value===""||m===""||Array.isArray(m)&&!m.length||h&&typeof m=="number"&&isNaN(m),R=G_.bind(null,b,n,S),M=(T,O,F,$=Sn.maxLength,P=Sn.minLength)=>{const U=T?O:F;S[b]={type:T?$:P,message:U,ref:l,...R(T?$:P,U)}};if(i?!Array.isArray(m)||!m.length:c&&(!w&&(j||Kt(m))||Or(m)&&!m||k&&!cR(a).isValid||E&&!dR(a).isValid)){const{value:T,message:O}=sr(c)?{value:!!c,message:c}:Za(c);if(T&&(S[b]={type:Sn.required,message:O,ref:v,...R(Sn.required,O)},!n))return y(O),S}if(!j&&(!Kt(u)||!Kt(g))){let T,O;const F=Za(g),$=Za(u);if(!Kt(m)&&!isNaN(m)){const P=l.valueAsNumber||m&&+m;Kt(F.value)||(T=P>F.value),Kt($.value)||(O=P<$.value)}else{const P=l.valueAsDate||new Date(m),U=L=>new Date(new Date().toDateString()+" "+L),N=l.type=="time",D=l.type=="week";sr(F.value)&&m&&(T=N?U(m)>U(F.value):D?m>F.value:P>new Date(F.value)),sr($.value)&&m&&(O=N?U(m)<U($.value):D?m<$.value:P<new Date($.value))}if((T||O)&&(M(!!T,F.message,$.message,Sn.max,Sn.min),!n))return y(S[b].message),S}if((d||p)&&!j&&(sr(m)||i&&Array.isArray(m))){const T=Za(d),O=Za(p),F=!Kt(T.value)&&m.length>+T.value,$=!Kt(O.value)&&m.length<+O.value;if((F||$)&&(M(F,T.message,O.message),!n))return y(S[b].message),S}if(_&&!j&&sr(m)){const{value:T,message:O}=Za(_);if(df(T)&&!m.match(T)&&(S[b]={type:Sn.pattern,message:O,ref:l,...R(Sn.pattern,O)},!n))return y(O),S}if(x){if(rr(x)){const T=await x(m,r),O=A0(T,v);if(O&&(S[b]={...O,...R(Sn.validate,O.message)},!n))return y(O.message),S}else if(gt(x)){let T={};for(const O in x){if(!tr(T)&&!n)break;const F=A0(await x[O](m,r),v,O);F&&(T={...F,...R(O,F.message)},y(F.message),n&&(S[b]=T))}if(!tr(T)&&(S[b]={ref:v,...T},!n))return S}}return y(!0),S};const rF={mode:Nn.onSubmit,reValidateMode:Nn.onChange,shouldFocusError:!0},fR={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function nF(e={}){let t={...rF,...e},r={...bt(fR),isLoading:rr(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=gt(t.defaultValues)||gt(t.values)?bt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:bt(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...p};let g={...u};const _={array:b0(),state:b0()},x=t.criteriaMode===Nn.all,b=B=>V=>{clearTimeout(d),d=setTimeout(B,V)},h=async B=>{if(!l.keepIsValid&&!t.disabled&&(u.isValid||g.isValid||B)){let V;t.resolver?(V=tr((await R()).errors),f()):V=await O({fields:n,onlyCheckValid:!0,eventType:Gs.VALID}),V!==r.isValid&&_.state.next({isValid:V})}},f=(B,V)=>{!t.disabled&&(u.isValidating||u.validatingFields||g.isValidating||g.validatingFields)&&((B||Array.from(a.mount)).forEach(W=>{W&&(V?Ye(r.validatingFields,W,V):Rt(r.validatingFields,W))}),_.state.next({validatingFields:r.validatingFields,isValidating:!tr(r.validatingFields)}))},m=()=>{r.dirtyFields=to(s,i)},v=(B,V=[],W,ne,se=!0,re=!0)=>{if(ne&&W&&!t.disabled){if(l.action=!0,re&&Array.isArray(oe(n,B))){const le=W(oe(n,B),ne.argA,ne.argB);se&&Ye(n,B,le)}if(re&&Array.isArray(oe(r.errors,B))){const le=W(oe(r.errors,B),ne.argA,ne.argB);se&&Ye(r.errors,B,le),tF(r.errors,B)}if((u.touchedFields||g.touchedFields)&&re&&Array.isArray(oe(r.touchedFields,B))){const le=W(oe(r.touchedFields,B),ne.argA,ne.argB);se&&Ye(r.touchedFields,B,le)}(u.dirtyFields||g.dirtyFields)&&m(),_.state.next({name:B,isDirty:$(B,V),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ye(i,B,V)},y=(B,V)=>{Ye(r.errors,B,V),_.state.next({errors:r.errors})},S=B=>{r.errors=B,_.state.next({errors:r.errors,isValid:!1})},E=B=>{const V=mu(B)?[B]:ch(B);let W=i,ne=s;for(let se=0;se<V.length-1;se++){const re=V[se];if(W=Kt(W)?W:W[re],ne=Kt(ne)?ne:ne[re],W===null&&ne!==null)return!0}return!1},k=(B,V,W,ne)=>{const se=oe(n,B);if(se){if(E(B))return;const re=ut(oe(i,B)),le=oe(i,B,ut(W)?oe(s,B):W);ut(le)||ne&&ne.defaultChecked||V?Ye(i,B,V?le:E0(se._f)):N(B,le),l.mount&&!l.action&&(h(),re&&r.isDirty&&(u.isDirty||g.isDirty)&&($()||(r.isDirty=!1,_.state.next({...r}))))}},w=(B,V,W,ne,se)=>{let re=!1,le=!1;const de={name:B};if(!t.disabled){if(!W||ne){(u.isDirty||g.isDirty)&&(le=r.isDirty,r.isDirty=de.isDirty=$(),re=le!==de.isDirty);const De=Mr(oe(s,B),V);le=!!oe(r.dirtyFields,B),De!==r.isDirty?r.dirtyFields=to(s,i):De?Rt(r.dirtyFields,B):Ye(r.dirtyFields,B,!0),de.dirtyFields=r.dirtyFields,re=re||(u.dirtyFields||g.dirtyFields)&&le!==!De}if(W){const De=oe(r.touchedFields,B);De||(Ye(r.touchedFields,B,W),de.touchedFields=r.touchedFields,re=re||(u.touchedFields||g.touchedFields)&&De!==W)}re&&se&&_.state.next(de)}return re?de:{}},j=(B,V,W,ne)=>{const se=oe(r.errors,B),re=(u.isValid||g.isValid)&&Or(V)&&r.isValid!==V;if(t.delayError&&W?(c=b(()=>y(B,W)),c(t.delayError)):(clearTimeout(d),c=null,W?Ye(r.errors,B,W):Rt(r.errors,B)),(W?!Mr(se,W):se)||!tr(ne)||re){const le={...ne,...re&&Or(V)?{isValid:V}:{},errors:r.errors,name:B};r={...r,...le},_.state.next(le)}},R=async B=>(f(B,!0),await t.resolver(i,t.context,Yz(B||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),M=async B=>{const{errors:V}=await R(B);if(f(B),B)for(const W of B){const ne=oe(V,W);ne?a.array.has(W)&>(ne)?T0(r.errors,{[W]:ne},W):Ye(r.errors,W,ne):Rt(r.errors,W)}else r.errors=V;return V},T=async({name:B,eventType:V})=>{if(e.validate){const W=await e.validate({formValues:i,formState:r,name:B,eventType:V});if(gt(W))for(const ne in W){const se=W[ne];se&&H(`${xm}.${ne}`,{message:sr(se.message)?se.message:"",type:se.type||Sn.validate})}else sr(W)||!W?H(xm,{message:W||"",type:Sn.validate}):A(xm);return W}return!0},O=async({fields:B,onlyCheckValid:V,name:W,eventType:ne,context:se={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(se.runRootValidation=!0,!await T({name:W,eventType:ne})&&(se.valid=!1,V)))return se.valid;for(const re in B){const le=B[re];if(le){const{_f:de,...De}=le;if(de){const kt=a.array.has(de.name),or=le._f&&Zz(le._f),mr=u.validatingFields||u.isValidating||g.validatingFields||g.isValidating;or&&mr&&f([de.name],!0);const rs=await D0(le,a.disabled,i,x,t.shouldUseNativeValidation&&!V,kt);if(or&&mr&&f([de.name]),rs[de.name]&&(se.valid=!1,V)||(!V&&(oe(rs,de.name)?kt?T0(r.errors,rs,de.name):Ye(r.errors,de.name,rs[de.name]):Rt(r.errors,de.name)),e.shouldUseNativeValidation&&rs[de.name]))break}!tr(De)&&await O({context:se,onlyCheckValid:V,fields:De,name:re,eventType:ne})}}return se.valid},F=()=>{for(const B of a.unMount){const V=oe(n,B);V&&(V._f.refs?V._f.refs.every(W=>!bm(W)):!bm(V._f.ref))&&K(B)}a.unMount=new Set},$=(B,V)=>!t.disabled&&(B&&V&&Ye(i,B,V),!Mr(Z(),s)),P=(B,V,W)=>lg(B,a,{...l.mount?i:ut(V)?s:sr(B)?{[B]:V}:V},W,V),U=B=>U_(oe(l.mount?i:s,B,t.shouldUnregister?oe(s,B,[]):[])),N=(B,V,W={})=>{const ne=oe(n,B);let se=V;if(ne){const re=ne._f;re&&(!re.disabled&&Ye(i,B,uR(V,re)),se=uf(re.ref)&&Kt(V)?"":V,oR(re.ref)?[...re.ref.options].forEach(le=>le.selected=se.includes(le.value)):re.refs?hu(re.ref)?re.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(se)?le.checked=!!se.find(de=>de===le.value):le.checked=se===le.value||!!se)}):re.refs.forEach(le=>le.checked=le.value===se):K_(re.ref)?re.ref.value="":(re.ref.value=se,re.ref.type||_.state.next({name:B,values:bt(i)})))}(W.shouldDirty||W.shouldTouch)&&w(B,se,W.shouldTouch,W.shouldDirty,!0),W.shouldValidate&&J(B)},D=(B,V,W)=>{for(const ne in V){if(!V.hasOwnProperty(ne))return;const se=V[ne],re=B+"."+ne,le=oe(n,re);(a.array.has(B)||gt(se)||le&&!le._f)&&!ra(se)?D(re,se,W):N(re,se,W)}},L=(B,V,W={})=>{const ne=oe(n,B),se=a.array.has(B),re=bt(V),le=oe(i,B),de=Mr(le,re);if(de||Ye(i,B,re),se)_.array.next({name:B,values:bt(i)}),(u.isDirty||u.dirtyFields||g.isDirty||g.dirtyFields)&&W.shouldDirty&&(m(),_.state.next({name:B,dirtyFields:r.dirtyFields,isDirty:$(B,re)}));else{const De=Array.isArray(re)&&!re.length||tr(re);!ne||ne._f||Kt(re)||De?N(B,re,W):D(B,re,W)}if(!de){const De=R0(B,a),kt=bt(i);if(!se)for(const or of og(a.array,B))_.array.next({name:or,values:kt});_.state.next({...De&&r,name:l.mount||De?B:void 0,values:kt})}},I=B=>{const V=rr(B)?B(i):B;if(!Mr(i,V)){i={...i,...V};for(const W of a.mount)L(W,oe(V,W));_.state.next({...r,values:i})}},Q=async B=>{l.mount=!0;const V=B.target;let W=V.name,ne=!0;const se=oe(n,W),re=De=>{ne=Number.isNaN(De)||ra(De)&&isNaN(De.getTime())||Mr(De,oe(i,W,De))},le=j0(t.mode),de=j0(t.reValidateMode);if(se){let De,kt;const or=V.type?E0(se._f):nR(B),mr=B.type===Gs.BLUR||B.type===Gs.FOCUS_OUT,rs=!Xz(se._f)&&!e.validate&&!t.resolver&&!oe(r.errors,W)&&!se._f.deps||eF(mr,oe(r.touchedFields,W),r.isSubmitted,de,le),Ui=R0(W,a,mr);Ye(i,W,or),mr?(!V||!V.readOnly)&&(se._f.onBlur&&se._f.onBlur(B),c&&c(0)):se._f.onChange&&se._f.onChange(B);const Xr=w(W,or,mr),dh=!tr(Xr)||Ui;if(!mr&&_.state.next({name:W,type:B.type,values:bt(i)}),rs)return(u.isValid||g.isValid)&&(t.mode==="onBlur"?mr&&h():mr||h()),dh&&_.state.next({name:W,...Ui?{}:Xr});if(!t.resolver&&e.validate&&await T({name:W,eventType:B.type}),!mr&&Ui&&_.state.next({...r}),t.resolver){const{errors:pu}=await R([W]);if(f([W]),re(or),ne){const gu=N0(r.errors,n,W),kl=N0(pu,n,gu.name||W);De=kl.error,W=kl.name,kt=tr(pu)}}else f([W],!0),De=(await D0(se,a.disabled,i,x,t.shouldUseNativeValidation))[W],f([W]),re(or),ne&&(De?kt=!1:(u.isValid||g.isValid)&&(kt=await O({fields:n,onlyCheckValid:!0,name:W,eventType:B.type})));ne&&(se._f.deps&&(!Array.isArray(se._f.deps)||se._f.deps.length>0)&&J(se._f.deps),j(W,kt,De,Xr))}},q=(B,V)=>{if(oe(r.errors,V)&&B.focus)return B.focus(),1},J=async(B,V={})=>{let W,ne;const se=mc(B);if(t.resolver){const re=await M(ut(B)?B:se);W=tr(re),ne=B?!se.some(le=>oe(re,le)):W}else B?(ne=(await Promise.all(se.map(async re=>{const le=oe(n,re);return await O({fields:le&&le._f?{[re]:le}:le,eventType:Gs.TRIGGER})}))).every(Boolean),!(!ne&&!r.isValid)&&h()):ne=W=await O({fields:n,name:B,eventType:Gs.TRIGGER});return _.state.next({...!sr(B)||(u.isValid||g.isValid)&&W!==r.isValid?{}:{name:B},...t.resolver||!B?{isValid:W}:{},errors:r.errors}),V.shouldFocus&&!ne&&pc(n,q,B?se:a.mount),ne},Z=(B,V)=>{let W={...l.mount?i:s};return V&&(W=aR(V.dirtyFields?r.dirtyFields:r.touchedFields,W)),ut(B)?W:sr(B)?oe(W,B):B.map(ne=>oe(W,ne))},me=(B,V)=>({invalid:!!oe((V||r).errors,B),isDirty:!!oe((V||r).dirtyFields,B),error:oe((V||r).errors,B),isValidating:!!oe(r.validatingFields,B),isTouched:!!oe((V||r).touchedFields,B)}),A=B=>{const V=B?mc(B):void 0;V==null||V.forEach(W=>Rt(r.errors,W)),V?V.forEach(W=>{_.state.next({name:W,errors:r.errors})}):_.state.next({errors:{}})},H=(B,V,W)=>{const ne=(oe(n,B,{_f:{}})._f||{}).ref,se=oe(r.errors,B)||{},{ref:re,message:le,type:de,...De}=se;Ye(r.errors,B,{...De,...V,ref:ne}),_.state.next({name:B,errors:r.errors,isValid:!1}),W&&W.shouldFocus&&ne&&ne.focus&&ne.focus()},G=(B,V)=>rr(B)?_.state.subscribe({next:W=>"values"in W&&B(W.values||P(void 0,V),W)}):P(B,V,!0),Y=B=>_.state.subscribe({next:V=>{if(Jz(B.name,V.name,B.exact)&&Qz(V,B.formState||u,Et,B.reRenderRoot)){const W={...i};B.callback({values:W,...r,...V,defaultValues:s})}}}).unsubscribe,ce=B=>(l.mount=!0,g={...g,...B.formState},Y({...B,formState:{...p,...B.formState}})),K=(B,V={})=>{for(const W of B?mc(B):a.mount)a.mount.delete(W),a.array.delete(W),V.keepValue||(Rt(n,W),Rt(i,W)),!V.keepError&&Rt(r.errors,W),!V.keepDirty&&Rt(r.dirtyFields,W),!V.keepTouched&&Rt(r.touchedFields,W),!V.keepIsValidating&&Rt(r.validatingFields,W),!t.shouldUnregister&&!V.keepDefaultValue&&Rt(s,W);_.state.next({values:bt(i)}),_.state.next({...r,...V.keepDirty?{isDirty:$()}:{}}),!V.keepIsValid&&h()},pe=({disabled:B,name:V})=>{if(Or(B)&&l.mount||B||a.disabled.has(V)){const se=a.disabled.has(V)!==!!B;B?a.disabled.add(V):a.disabled.delete(V),se&&l.mount&&!l.action&&h()}},Me=(B,V={})=>{let W=oe(n,B);const ne=Or(V.disabled)||Or(t.disabled),se=!a.registerName.has(B)&&W&&W._f&&!W._f.mount;return Ye(n,B,{...W||{},_f:{...W&&W._f?W._f:{ref:{name:B}},name:B,mount:!0,...V}}),a.mount.add(B),W&&!se?pe({disabled:Or(V.disabled)?V.disabled:t.disabled,name:B}):k(B,!0,V.value),{...ne?{disabled:V.disabled||t.disabled}:{},...t.progressive?{required:!!V.required,min:Ul(V.min),max:Ul(V.max),minLength:Ul(V.minLength),maxLength:Ul(V.maxLength),pattern:Ul(V.pattern)}:{},name:B,onChange:Q,onBlur:Q,ref:re=>{if(re){a.registerName.add(B),Me(B,V),a.registerName.delete(B),W=oe(n,B);const le=ut(re.value)&&re.querySelectorAll&&re.querySelectorAll("input,select,textarea")[0]||re,de=qz(le),De=W._f.refs||[];if(de?De.find(kt=>kt===le):le===W._f.ref)return;Ye(n,B,{_f:{...W._f,...de?{refs:[...De.filter(bm),le,...Array.isArray(oe(s,B))?[{}]:[]],ref:{type:le.type,name:B}}:{ref:le}}}),k(B,!1,void 0,le)}else W=oe(n,B,{}),W._f&&(W._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(og(a.array,B).length&&l.action)&&a.unMount.add(B)}}},Ke=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&pc(n,q,a.mount),Ht=B=>{Or(B)&&(_.state.next({disabled:B}),pc(n,(V,W)=>{const ne=oe(n,W);ne&&(V.disabled=ne._f.disabled||B,Array.isArray(ne._f.refs)&&ne._f.refs.forEach(se=>{se.disabled=ne._f.disabled||B}))},0,!1))},Se=(B,V)=>async W=>{let ne;W&&(W.preventDefault&&W.preventDefault(),W.persist&&W.persist());let se=bt(i);if(_.state.next({isSubmitting:!0}),t.resolver){const{errors:re,values:le}=await R();f(),r.errors=re,se=bt(le)}else await O({fields:n,eventType:Gs.SUBMIT});if(a.disabled.size)for(const re of a.disabled)Rt(se,re);if(Rt(r.errors,sR),tr(r.errors)){_.state.next({errors:{}});try{await B(se,W)}catch(re){ne=re}}else V&&await V({...r.errors},W),Ke(),setTimeout(Ke);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tr(r.errors)&&!ne,submitCount:r.submitCount+1,errors:r.errors}),ne)throw ne},Zr=(B,V={})=>{oe(n,B)&&(ut(V.defaultValue)?L(B,bt(oe(s,B))):(L(B,V.defaultValue),Ye(s,B,bt(V.defaultValue))),V.keepTouched||Rt(r.touchedFields,B),V.keepDirty||(Rt(r.dirtyFields,B),r.isDirty=V.defaultValue?$(B,bt(oe(s,B))):$()),V.keepError||(Rt(r.errors,B),u.isValid&&h()),_.state.next({...r}))},xt=(B,V={})=>{const W=B?bt(B):s,ne=bt(W),se=tr(B),re=se?s:ne;if(V.keepDefaultValues||(s=W),!V.keepValues){if(V.keepDirtyValues){const le=new Set([...a.mount,...Object.keys(to(s,i))]);for(const de of Array.from(le)){const De=oe(r.dirtyFields,de),kt=oe(i,de),or=oe(re,de);De&&!ut(kt)?Ye(re,de,kt):!De&&!ut(or)&&L(de,or)}}else{if(F_&&ut(B))for(const le of a.mount){const de=oe(n,le);if(de&&de._f){const De=Array.isArray(de._f.refs)?de._f.refs[0]:de._f.ref;if(uf(De)){const kt=De.closest("form");if(kt){kt.reset();break}}}}if(V.keepFieldsRef)for(const le of a.mount)L(le,oe(re,le));else n={}}i=t.shouldUnregister?V.keepDefaultValues?bt(s):{}:bt(re),_.array.next({values:{...re}}),_.state.next({values:{...re}})}a={mount:V.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!u.isValid||!!V.keepIsValid||!!V.keepDirtyValues||!t.shouldUnregister&&!tr(re),l.watch=!!t.shouldUnregister,l.keepIsValid=!!V.keepIsValid,l.action=!1,V.keepErrors||(r.errors={}),_.state.next({submitCount:V.keepSubmitCount?r.submitCount:0,isDirty:se?!1:V.keepDirty?r.isDirty:!!(V.keepDefaultValues&&!Mr(B,s)),isSubmitted:V.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:se?{}:V.keepDirtyValues?V.keepDefaultValues&&i?to(s,i):r.dirtyFields:V.keepDefaultValues&&B?to(s,B):V.keepDirty?r.dirtyFields:{},touchedFields:V.keepTouched?r.touchedFields:{},errors:V.keepErrors?r.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Is=(B,V)=>xt(rr(B)?B(i):B,{...t.resetOptions,...V}),Fi=(B,V={})=>{const W=oe(n,B),ne=W&&W._f;if(ne){const se=ne.refs?ne.refs[0]:ne.ref;se.focus&&setTimeout(()=>{se.focus(),V.shouldSelect&&rr(se.select)&&se.select()})}},Et=B=>{r={...r,...B}},Bn={control:{register:Me,unregister:K,getFieldState:me,handleSubmit:Se,setError:H,_subscribe:Y,_runSchema:R,_updateIsValidating:f,_focusError:Ke,_getWatch:P,_getDirty:$,_setValid:h,_setFieldArray:v,_setDisabledField:pe,_setErrors:S,_getFieldArray:U,_reset:xt,_resetDefaultValues:()=>rr(t.defaultValues)&&t.defaultValues().then(B=>{Is(B,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Ht,_subjects:_,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(B){l=B},get _defaultValues(){return s},get _names(){return a},set _names(B){a=B},get _formState(){return r},get _options(){return t},set _options(B){t={...t,...B}}},subscribe:ce,trigger:J,register:Me,handleSubmit:Se,watch:G,setValue:L,setValues:I,getValues:Z,reset:Is,resetField:Zr,clearErrors:A,unregister:K,setError:H,setFocus:Fi,getFieldState:me};return{...Bn,formControl:Bn}}function sF(e={}){const t=X.useRef(void 0),r=X.useRef(void 0),[n,s]=X.useState(()=>({...bt(fR),isLoading:rr(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:rr(e.defaultValues)?void 0:e.defaultValues}));if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!rr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=nF(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,q_(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),X.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),X.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),X.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),X.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),X.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),X.useEffect(()=>{var l;e.values&&!Mr(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((l=i._options.resetOptions)===null||l===void 0)&&l.keepIsValid||i._setValid(),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),X.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=X.useMemo(()=>iR(n,i),[i,n]),t.current}const O0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=oe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},fg=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?O0(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>O0(s,r,e))}},M0=(e,t)=>{t.shouldUseNativeValidation&&fg(e,t);const r={};for(const n in e){const s=oe(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(iF(t.names||Object.keys(e),n)){const l=Object.assign({},oe(r,n));Ye(l,"root",i),Ye(r,n,l)}else Ye(r,n,i)}return r},iF=(e,t)=>{const r=L0(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(n=>L0(n).match(`^${r}\\.\\d+`))};function L0(e){return e.replace(/[\[\]]/g,"")}function hR(e,t,r){function n(a,c){var d;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(d=a._zod).traits??(d.traits=new Set),a._zod.traits.add(e),t(a,c);for(const p in l.prototype)p in a||Object.defineProperty(a,p,{value:l.prototype[p].bind(a)});a._zod.constr=l,a._zod.def=c}const s=(r==null?void 0:r.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function l(a){var c;const d=r!=null&&r.Parent?new i:this;n(d,a),(c=d._zod).deferred??(c.deferred=[]);for(const p of d._zod.deferred)p();return d}return Object.defineProperty(l,"init",{value:n}),Object.defineProperty(l,Symbol.hasInstance,{value:a=>{var c,d;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(d=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:d.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class aF extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const oF={};function mR(e){return oF}function lF(e,t){return typeof t=="bigint"?t.toString():t}const pR=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ku(e){return typeof e=="string"?e:e==null?void 0:e.message}function gR(e,t,r){var s,i,l,a,c,d;const n={...e,path:e.path??[]};if(!e.message){const p=Ku((l=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:l.call(i,e))??Ku((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Ku((c=r.customError)==null?void 0:c.call(r,e))??Ku((d=r.localeError)==null?void 0:d.call(r,e))??"Invalid input";n.message=p}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}const vR=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,lF,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cF=hR("$ZodError",vR),_R=hR("$ZodError",vR,{Parent:Error}),uF=e=>(t,r,n,s)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},i);if(l instanceof Promise)throw new aF;if(l.issues.length){const a=new((s==null?void 0:s.Err)??e)(l.issues.map(c=>gR(c,i,mR())));throw pR(a,s==null?void 0:s.callee),a}return l.value},dF=uF(_R),fF=e=>async(t,r,n,s)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let l=t._zod.run({value:r,issues:[]},i);if(l instanceof Promise&&(l=await l),l.issues.length){const a=new((s==null?void 0:s.Err)??e)(l.issues.map(c=>gR(c,i,mR())));throw pR(a,s==null?void 0:s.callee),a}return l.value},hF=fF(_R);function hg(){return hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hg.apply(null,arguments)}function P0(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function mF(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,l=n.path.join(".");if(!r[l])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[l]={message:a.message,type:a.code}}else r[l]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(u){return e.push(u)})}),t){var c=r[l].types,d=c&&c[n.code];r[l]=G_(l,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r}function pF(e,t){for(var r={},n=function(){var s=e[0],i=s.code,l=s.message,a=s.path.join(".");if(!r[a])if(s.code==="invalid_union"&&s.errors.length>0){var c=s.errors[0][0];r[a]={message:c.message,type:c.code}}else r[a]={message:l,type:i};if(s.code==="invalid_union"&&s.errors.forEach(function(u){return u.forEach(function(g){return e.push(hg({},g,{path:[].concat(s.path,g.path)}))})}),t){var d=r[a].types,p=d&&d[s.code];r[a]=G_(a,t,r,i,p?[].concat(p,s.message):s.message)}e.shift()};e.length;)n();return r}function gF(e,t,r){if(r===void 0&&(r={}),function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def}(e))return function(n,s,i){try{return Promise.resolve(P0(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(l){return i.shouldUseNativeValidation&&fg({},i),{errors:{},values:r.raw?Object.assign({},n):l}})},function(l){if(function(a){return Array.isArray(a==null?void 0:a.issues)}(l))return{values:{},errors:M0(mF(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};if(function(n){return"_zod"in n&&typeof n._zod=="object"}(e))return function(n,s,i){try{return Promise.resolve(P0(function(){return Promise.resolve((r.mode==="sync"?dF:hF)(e,n,t)).then(function(l){return i.shouldUseNativeValidation&&fg({},i),{errors:{},values:r.raw?Object.assign({},n):l}})},function(l){if(function(a){return a instanceof cF}(l))return{values:{},errors:M0(pF(l.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}var Ue;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),l={};for(const a of i)l[a]=s[a];return e.objectValues(l)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},e.find=(s,i)=>{for(const l of s)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ue||(Ue={}));var B0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(B0||(B0={}));const ge=Ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ks=e=>{switch(typeof e){case"undefined":return ge.undefined;case"string":return ge.string;case"number":return Number.isNaN(e)?ge.nan:ge.number;case"boolean":return ge.boolean;case"function":return ge.function;case"bigint":return ge.bigint;case"symbol":return ge.symbol;case"object":return Array.isArray(e)?ge.array:e===null?ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ge.promise:typeof Map<"u"&&e instanceof Map?ge.map:typeof Set<"u"&&e instanceof Set?ge.set:typeof Date<"u"&&e instanceof Date?ge.date:ge.object;default:return ge.unknown}},ae=Ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Os extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let a=n,c=0;for(;c<l.path.length;){const d=l.path[c];c===l.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(r(l))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof Os))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Os.create=e=>new Os(e);const mg=(e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===ge.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ue.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ue.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ue.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${Ue.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ue.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ae.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ae.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ue.assertNever(e)}return{message:r}};let vF=mg;function _F(){return vF}const yF=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)a=d(l,{data:t,defaultError:a}).message;return{...s,path:i,message:a}};function fe(e,t){const r=_F(),n=yF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mg?void 0:mg].filter(s=>!!s)});e.common.issues.push(n)}class Yr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Ee;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,l=await s.value;n.push({key:i,value:l})}return Yr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return Ee;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(n[i.value]=l.value)}return{status:t.value,value:n}}}const Ee=Object.freeze({status:"aborted"}),Ql=e=>({status:"dirty",value:e}),_n=e=>({status:"valid",value:e}),I0=e=>e.status==="aborted",H0=e=>e.status==="dirty",ol=e=>e.status==="valid",ff=e=>typeof Promise<"u"&&e instanceof Promise;var ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ve||(ve={}));class Li{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const z0=(e,t)=>{if(ol(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Os(e.common.issues);return this._error=r,this._error}}};function Le(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(l,a)=>{const{message:c}=e;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}class Fe{get description(){return this._def.description}_getType(t){return Ks(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yr,ctx:{common:t.parent.common,data:t.data,parsedType:Ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(ff(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)},s=this._parseSync({data:t,path:n.path,parent:n});return z0(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return ol(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>ol(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(ff(s)?s:Promise.resolve(s));return z0(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const l=t(s),a=()=>i.addIssue({code:ae.custom,...n(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new cl({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ri.create(this,this._def)}nullable(){return ul.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zn.create(this)}promise(){return gf.create(this,this._def)}or(t){return mf.create([this,t],this._def)}and(t){return pf.create(this,t,this._def)}transform(t){return new cl({...Le(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new gg({...Le(this._def),innerType:this,defaultValue:r,typeName:je.ZodDefault})}brand(){return new UF({typeName:je.ZodBranded,type:this,...Le(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new vg({...Le(this._def),innerType:this,catchValue:r,typeName:je.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Z_.create(this,t)}readonly(){return _g.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xF=/^c[^\s-]{8,}$/i,bF=/^[0-9a-z]+$/,SF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,CF=/^[a-z0-9_-]{21}$/i,EF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Sm;const NF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,AF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,DF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",LF=new RegExp(`^${yR}$`);function xR(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function PF(e){return new RegExp(`^${xR(e)}$`)}function BF(e){let t=`${yR}T${xR(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function IF(e,t){return!!((t==="v4"||!t)&&NF.test(e)||(t==="v6"||!t)&&AF.test(e))}function HF(e,t){if(!EF.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function zF(e,t){return!!((t==="v4"||!t)&&TF.test(e)||(t==="v6"||!t)&&DF.test(e))}class mi extends Fe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ge.string){const i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ge.string,received:i.parsedType}),Ee}const n=new Yr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,a=t.data.length<i.value;(l||a)&&(s=this._getOrReturnCtx(t,s),l?fe(s,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&fe(s,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")kF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"email",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Sm||(Sm=new RegExp(RF,"u")),Sm.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"emoji",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")wF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"uuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")CF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"nanoid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")xF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"cuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")bF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"cuid2",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")SF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"ulid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),fe(s,{validation:"url",code:ae.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"regex",code:ae.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?BF(i).test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?LF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?PF(i).test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"duration",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?IF(t.data,i.version)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"ip",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?HF(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"jwt",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?zF(t.data,i.version)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"cidr",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?OF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"base64",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?MF.test(t.data)||(s=this._getOrReturnCtx(t,s),fe(s,{validation:"base64url",code:ae.invalid_string,message:i.message}),n.dirty()):Ue.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:ae.invalid_string,...ve.errToObj(n)})}_addCheck(t){return new mi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ve.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ve.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ve.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ve.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ve.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ve.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ve.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ve.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ve.errToObj(r)})}nonempty(t){return this.min(1,ve.errToObj(t))}trim(){return new mi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}mi.create=e=>new mi({checks:[],typeName:je.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});function FF(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return i%l/10**s}class Bc extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ge.number){const i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ge.number,received:i.parsedType}),Ee}let n;const s=new Yr;for(const i of this._def.checks)i.kind==="int"?Ue.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?FF(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_finite,message:i.message}),s.dirty()):Ue.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Bc({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Bc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ue.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Bc.create=e=>new Bc({checks:[],typeName:je.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Ic extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ge.bigint)return this._getInvalidInput(t);let n;const s=new Yr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ue.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return fe(r,{code:ae.invalid_type,expected:ge.bigint,received:r.parsedType}),Ee}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Ic({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Ic({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ic.create=e=>new Ic({checks:[],typeName:je.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});class F0 extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ge.boolean){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.boolean,received:n.parsedType}),Ee}return _n(t.data)}}F0.create=e=>new F0({typeName:je.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class hf extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ge.date){const i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ge.date,received:i.parsedType}),Ee}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_date}),Ee}const n=new Yr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),fe(s,{code:ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ue.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hf({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ve.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ve.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}hf.create=e=>new hf({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:je.ZodDate,...Le(e)});class U0 extends Fe{_parse(t){if(this._getType(t)!==ge.symbol){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.symbol,received:n.parsedType}),Ee}return _n(t.data)}}U0.create=e=>new U0({typeName:je.ZodSymbol,...Le(e)});class $0 extends Fe{_parse(t){if(this._getType(t)!==ge.undefined){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.undefined,received:n.parsedType}),Ee}return _n(t.data)}}$0.create=e=>new $0({typeName:je.ZodUndefined,...Le(e)});class V0 extends Fe{_parse(t){if(this._getType(t)!==ge.null){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.null,received:n.parsedType}),Ee}return _n(t.data)}}V0.create=e=>new V0({typeName:je.ZodNull,...Le(e)});class q0 extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return _n(t.data)}}q0.create=e=>new q0({typeName:je.ZodAny,...Le(e)});class W0 extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _n(t.data)}}W0.create=e=>new W0({typeName:je.ZodUnknown,...Le(e)});class Pi extends Fe{_parse(t){const r=this._getOrReturnCtx(t);return fe(r,{code:ae.invalid_type,expected:ge.never,received:r.parsedType}),Ee}}Pi.create=e=>new Pi({typeName:je.ZodNever,...Le(e)});class G0 extends Fe{_parse(t){if(this._getType(t)!==ge.undefined){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.void,received:n.parsedType}),Ee}return _n(t.data)}}G0.create=e=>new G0({typeName:je.ZodVoid,...Le(e)});class Zn extends Fe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ge.array)return fe(r,{code:ae.invalid_type,expected:ge.array,received:r.parsedType}),Ee;if(s.exactLength!==null){const l=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(l||a)&&(fe(r,{code:l?ae.too_big:ae.too_small,minimum:a?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(fe(r,{code:ae.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(fe(r,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,a)=>s.type._parseAsync(new Li(r,l,r.path,a)))).then(l=>Yr.mergeArray(n,l));const i=[...r.data].map((l,a)=>s.type._parseSync(new Li(r,l,r.path,a)));return Yr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Zn({...this._def,minLength:{value:t,message:ve.toString(r)}})}max(t,r){return new Zn({...this._def,maxLength:{value:t,message:ve.toString(r)}})}length(t,r){return new Zn({...this._def,exactLength:{value:t,message:ve.toString(r)}})}nonempty(t){return this.min(1,t)}}Zn.create=(e,t)=>new Zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...Le(t)});function ro(e){if(e instanceof Nt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ri.create(ro(n))}return new Nt({...e._def,shape:()=>t})}else return e instanceof Zn?new Zn({...e._def,type:ro(e.element)}):e instanceof Ri?Ri.create(ro(e.unwrap())):e instanceof ul?ul.create(ro(e.unwrap())):e instanceof Ea?Ea.create(e.items.map(t=>ro(t))):e}class Nt extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Ue.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ge.object){const d=this._getOrReturnCtx(t);return fe(d,{code:ae.invalid_type,expected:ge.object,received:d.parsedType}),Ee}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Pi&&this._def.unknownKeys==="strip"))for(const d in s.data)l.includes(d)||a.push(d);const c=[];for(const d of l){const p=i[d],u=s.data[d];c.push({key:{status:"valid",value:d},value:p._parse(new Li(s,u,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Pi){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(d==="strict")a.length>0&&(fe(s,{code:ae.unrecognized_keys,keys:a}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of a){const u=s.data[p];c.push({key:{status:"valid",value:p},value:d._parse(new Li(s,u,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of c){const u=await p.key,g=await p.value;d.push({key:u,value:g,alwaysSet:p.alwaysSet})}return d}).then(d=>Yr.mergeObjectSync(n,d)):Yr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return ve.errToObj,new Nt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,l;const s=((l=(i=this._def).errorMap)==null?void 0:l.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ve.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Nt({...this._def,unknownKeys:"strip"})}passthrough(){return new Nt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Nt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Nt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:je.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Nt({...this._def,catchall:t})}pick(t){const r={};for(const n of Ue.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Nt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ue.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Nt({...this._def,shape:()=>r})}deepPartial(){return ro(this)}partial(t){const r={};for(const n of Ue.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Nt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ue.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ri;)i=i._def.innerType;r[n]=i}return new Nt({...this._def,shape:()=>r})}keyof(){return bR(Ue.objectKeys(this.shape))}}Nt.create=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strip",catchall:Pi.create(),typeName:je.ZodObject,...Le(t)});Nt.strictCreate=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strict",catchall:Pi.create(),typeName:je.ZodObject,...Le(t)});Nt.lazycreate=(e,t)=>new Nt({shape:e,unknownKeys:"strip",catchall:Pi.create(),typeName:je.ZodObject,...Le(t)});class mf extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new Os(a.ctx.common.issues));return fe(r,{code:ae.invalid_union,unionErrors:l}),Ee}if(r.common.async)return Promise.all(n.map(async i=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:d}),d.common.issues.length&&l.push(d.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(c=>new Os(c));return fe(r,{code:ae.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}}mf.create=(e,t)=>new mf({options:e,typeName:je.ZodUnion,...Le(t)});function pg(e,t){const r=Ks(e),n=Ks(t);if(e===t)return{valid:!0,data:e};if(r===ge.object&&n===ge.object){const s=Ue.objectKeys(t),i=Ue.objectKeys(e).filter(a=>s.indexOf(a)!==-1),l={...e,...t};for(const a of i){const c=pg(e[a],t[a]);if(!c.valid)return{valid:!1};l[a]=c.data}return{valid:!0,data:l}}else if(r===ge.array&&n===ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const l=e[i],a=t[i],c=pg(l,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===ge.date&&n===ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class pf extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(i,l)=>{if(I0(i)||I0(l))return Ee;const a=pg(i.value,l.value);return a.valid?((H0(i)||H0(l))&&r.dirty(),{status:r.value,value:a.data}):(fe(n,{code:ae.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}pf.create=(e,t,r)=>new pf({left:e,right:t,typeName:je.ZodIntersection,...Le(r)});class Ea extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.array)return fe(n,{code:ae.invalid_type,expected:ge.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return fe(n,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(fe(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((l,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Li(n,l,n.path,a)):null}).filter(l=>!!l);return n.common.async?Promise.all(i).then(l=>Yr.mergeArray(r,l)):Yr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Ea({...this._def,rest:t})}}Ea.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ea({items:e,typeName:je.ZodTuple,rest:null,...Le(t)})};class K0 extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.map)return fe(n,{code:ae.invalid_type,expected:ge.map,received:n.parsedType}),Ee;const s=this._def.keyType,i=this._def.valueType,l=[...n.data.entries()].map(([a,c],d)=>({key:s._parse(new Li(n,a,n.path,[d,"key"])),value:i._parse(new Li(n,c,n.path,[d,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of l){const d=await c.key,p=await c.value;if(d.status==="aborted"||p.status==="aborted")return Ee;(d.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(d.value,p.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of l){const d=c.key,p=c.value;if(d.status==="aborted"||p.status==="aborted")return Ee;(d.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(d.value,p.value)}return{status:r.value,value:a}}}}K0.create=(e,t,r)=>new K0({valueType:t,keyType:e,typeName:je.ZodMap,...Le(r)});class Hc extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.set)return fe(n,{code:ae.invalid_type,expected:ge.set,received:n.parsedType}),Ee;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(fe(n,{code:ae.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(fe(n,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function l(c){const d=new Set;for(const p of c){if(p.status==="aborted")return Ee;p.status==="dirty"&&r.dirty(),d.add(p.value)}return{status:r.value,value:d}}const a=[...n.data.values()].map((c,d)=>i._parse(new Li(n,c,n.path,d)));return n.common.async?Promise.all(a).then(c=>l(c)):l(a)}min(t,r){return new Hc({...this._def,minSize:{value:t,message:ve.toString(r)}})}max(t,r){return new Hc({...this._def,maxSize:{value:t,message:ve.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Hc.create=(e,t)=>new Hc({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet,...Le(t)});class Y0 extends Fe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Y0.create=(e,t)=>new Y0({getter:e,typeName:je.ZodLazy,...Le(t)});class Z0 extends Fe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return fe(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}}Z0.create=(e,t)=>new Z0({value:e,typeName:je.ZodLiteral,...Le(t)});function bR(e,t){return new ll({values:e,typeName:je.ZodEnum,...Le(t)})}class ll extends Fe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{expected:Ue.joinValues(n),received:r.parsedType,code:ae.invalid_type}),Ee}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{received:r.data,code:ae.invalid_enum_value,options:n}),Ee}return _n(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ll.create(t,{...this._def,...r})}exclude(t,r=this._def){return ll.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ll.create=bR;class X0 extends Fe{_parse(t){const r=Ue.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ge.string&&n.parsedType!==ge.number){const s=Ue.objectValues(r);return fe(n,{expected:Ue.joinValues(s),received:n.parsedType,code:ae.invalid_type}),Ee}if(this._cache||(this._cache=new Set(Ue.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ue.objectValues(r);return fe(n,{received:n.data,code:ae.invalid_enum_value,options:s}),Ee}return _n(t.data)}get enum(){return this._def.values}}X0.create=(e,t)=>new X0({values:e,typeName:je.ZodNativeEnum,...Le(t)});class gf extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ge.promise&&r.common.async===!1)return fe(r,{code:ae.invalid_type,expected:ge.promise,received:r.parsedType}),Ee;const n=r.parsedType===ge.promise?r.data:Promise.resolve(r.data);return _n(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}gf.create=(e,t)=>new gf({type:e,typeName:je.ZodPromise,...Le(t)});class cl extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:l=>{fe(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(n.data,i);if(n.common.async)return Promise.resolve(l).then(async a=>{if(r.value==="aborted")return Ee;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Ee:c.status==="dirty"||r.value==="dirty"?Ql(c.value):c});{if(r.value==="aborted")return Ee;const a=this._def.schema._parseSync({data:l,path:n.path,parent:n});return a.status==="aborted"?Ee:a.status==="dirty"||r.value==="dirty"?Ql(a.value):a}}if(s.type==="refinement"){const l=a=>{const c=s.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),l(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),l(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ol(l))return Ee;const a=s.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>ol(l)?Promise.resolve(s.transform(l.value,i)).then(a=>({status:r.value,value:a})):Ee);Ue.assertNever(s)}}cl.create=(e,t,r)=>new cl({schema:e,typeName:je.ZodEffects,effect:t,...Le(r)});cl.createWithPreprocess=(e,t,r)=>new cl({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects,...Le(r)});class Ri extends Fe{_parse(t){return this._getType(t)===ge.undefined?_n(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ri.create=(e,t)=>new Ri({innerType:e,typeName:je.ZodOptional,...Le(t)});class ul extends Fe{_parse(t){return this._getType(t)===ge.null?_n(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ul.create=(e,t)=>new ul({innerType:e,typeName:je.ZodNullable,...Le(t)});class gg extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ge.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}gg.create=(e,t)=>new gg({innerType:e,typeName:je.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class vg extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ff(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Os(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Os(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}vg.create=(e,t)=>new vg({innerType:e,typeName:je.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class Q0 extends Fe{_parse(t){if(this._getType(t)!==ge.nan){const n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ge.nan,received:n.parsedType}),Ee}return{status:"valid",value:t.data}}}Q0.create=e=>new Q0({typeName:je.ZodNaN,...Le(e)});class UF extends Fe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Z_ extends Fe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),Ql(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Z_({in:t,out:r,typeName:je.ZodPipeline})}}class _g extends Fe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(ol(s)&&(s.value=Object.freeze(s.value)),s);return ff(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}_g.create=(e,t)=>new _g({innerType:e,typeName:je.ZodReadonly,...Le(t)});var je;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(je||(je={}));const J0=mi.create;Pi.create;Zn.create;const $F=Nt.create;mf.create;pf.create;Ea.create;ll.create;gf.create;Ri.create;ul.create;const VF=Vz,SR=C.createContext({}),eS=e=>o.jsx(SR.Provider,{value:{name:e.name},children:o.jsx(Uz,{...e})}),wR=C.createContext({}),uh=()=>{const e=C.useContext(SR),t=C.useContext(wR),{getFieldState:r,formState:n}=$z(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},yg=C.forwardRef(({className:e,...t},r)=>{const n=C.useId();return o.jsx(wR.Provider,{value:{id:n},children:o.jsx("div",{ref:r,className:te("flex flex-col gap-1.5",e),...t})})});yg.displayName="FormItem";const xg=C.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=uh();return o.jsx(Vr,{ref:r,className:te(n&&"text-[var(--break-red)]",e),htmlFor:s,...t})});xg.displayName="FormLabel";const bg=C.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=uh();return o.jsx(ZC,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:s,"aria-invalid":!!r,...e})});bg.displayName="FormControl";const CR=C.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=uh();return o.jsx("p",{ref:r,id:n,className:te("font-mono text-[11px] text-[var(--fg-dim)]",e),...t})});CR.displayName="FormDescription";const Sg=C.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=uh(),l=s?String((s==null?void 0:s.message)??""):t;return l?o.jsx("p",{ref:n,id:i,className:te("font-mono text-[11px] text-[var(--break-red)]",e),...r,children:l}):null});Sg.displayName="FormMessage";const qF=$F({current:J0().min(1,"Current password is required."),next:J0().min(8,"New password must be at least 8 characters.")});function WF(){const[e,t]=C.useState("idle"),r=sF({resolver:gF(qF),defaultValues:{current:"",next:""}}),n=async s=>{t("rotating");try{await he.changeKeystorePassword(s.current,s.next),r.reset({current:"",next:""}),Xn.success("Password rotated",{description:"Re-run `jinn run` with the new password."})}catch(i){Xn.error("Rotation failed",{description:i instanceof Error?i.message:String(i)})}finally{t("idle")}};return o.jsx("div",{"data-testid":"security-tab",children:o.jsxs(be,{className:"border-[var(--severity-blocking-border)]",children:[o.jsxs(ir,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(pn,{className:"flex items-center gap-2 text-[var(--break-red)]",children:[o.jsx(rO,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Security"]}),o.jsx(Ns,{children:"Rotate keystore password · last rotated never"})]}),o.jsx(Ce,{variant:"destructive",children:"Danger zone"})]}),o.jsx(et,{children:o.jsx(VF,{...r,children:o.jsxs("form",{onSubmit:r.handleSubmit(n),className:"flex flex-col gap-4","data-testid":"security-password-form",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsx(eS,{control:r.control,name:"current",render:({field:s})=>o.jsxs(yg,{children:[o.jsx(xg,{children:"Current password"}),o.jsx(bg,{children:o.jsx(St,{type:"password",autoComplete:"current-password",...s})}),o.jsx(Sg,{})]})}),o.jsx(eS,{control:r.control,name:"next",render:({field:s})=>o.jsxs(yg,{children:[o.jsx(xg,{children:"New password"}),o.jsx(bg,{children:o.jsx(St,{type:"password",autoComplete:"new-password",...s})}),o.jsx(CR,{children:"At least 8 characters."}),o.jsx(Sg,{})]})})]}),o.jsxs(ie,{type:"submit",variant:"destructive",disabled:e==="rotating"||!r.formState.isValid,className:"self-start",children:[o.jsx(KD,{className:"h-3 w-3","aria-hidden":"true"}),e==="rotating"?"Rotating…":"Rotate password"]})]})})})]})})}function GF(e){const t=[],r=e.split(`
|
|
296
|
+
`);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const a=s.slice(3).trim(),c=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)c.push(r[n]??""),n++;n++,t.push({kind:"code",lang:a,text:c.join(`
|
|
297
|
+
`)});continue}const i=/^(#{1,3})\s+(.*)$/.exec(s);if(i){t.push({kind:"heading",level:i[1].length,text:i[2]}),n++;continue}if(/^-\s+/.test(s)){const a=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)a.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:a});continue}if(s.trim()===""){n++;continue}const l=[s];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)l.push(r[n]??""),n++;t.push({kind:"paragraph",text:l.join(" ")})}return t}function tS(e){const t=[],r=/`([^`]+)`/g;let n=0,s,i=0;for(;(s=r.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(C.createElement("code",{key:`c-${i++}`},s[1])),n=s.index+s[0].length;return n<e.length&&t.push(e.slice(n)),t}function KF(e){const t=GF(e);return C.createElement(C.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?C.createElement("h1",{key:n},r.text):r.level===2?C.createElement("h2",{key:n},r.text):C.createElement("h3",{key:n},r.text):r.kind==="code"?C.createElement("pre",{key:n},C.createElement("code",null,r.text??"")):r.kind==="list"?C.createElement("ul",{key:n},...(r.items??[]).map((s,i)=>C.createElement("li",{key:i},...tS(s)))):C.createElement("p",{key:n},...tS(r.text??""))))}const YF=`# Build a plug-in
|
|
298
|
+
|
|
299
|
+
Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
|
|
300
|
+
|
|
301
|
+
## 1. Scaffold
|
|
302
|
+
|
|
303
|
+
\`\`\`bash
|
|
304
|
+
jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
|
|
305
|
+
cd @you/my-swe-skill
|
|
306
|
+
yarn install
|
|
307
|
+
yarn test
|
|
308
|
+
\`\`\`
|
|
309
|
+
|
|
310
|
+
The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
|
|
311
|
+
|
|
312
|
+
\`\`\`
|
|
313
|
+
@you/my-swe-skill/
|
|
314
|
+
├── jinn.plugin.json # the canonical manifest
|
|
315
|
+
├── skills/example/SKILL.md
|
|
316
|
+
├── test/plugin.test.ts # passes immediately
|
|
317
|
+
├── package.json
|
|
318
|
+
├── tsconfig.json
|
|
319
|
+
└── README.md
|
|
320
|
+
\`\`\`
|
|
321
|
+
|
|
322
|
+
## 2. Edit your skill
|
|
323
|
+
|
|
324
|
+
Open \`skills/example/SKILL.md\` and replace it with the skill your plug-in offers. A SolverType plug-in can ship one or more skills; a runtime plug-in usually ships an MCP server in \`.mcp.json\` instead. See \`shape-reference.md\`.
|
|
325
|
+
|
|
326
|
+
## 3. Publish to npm + chain
|
|
327
|
+
|
|
328
|
+
\`\`\`bash
|
|
329
|
+
npm publish --access public
|
|
330
|
+
jinn solver-plugins publish npm:@you/my-swe-skill
|
|
331
|
+
\`\`\`
|
|
332
|
+
|
|
333
|
+
\`jinn solver-plugins publish\` lazily completes your identity bootstrap (Stage 1) the first time you call it. If you have not yet funded your agent EOA with ETH on testnet, the verb pauses and tells you what to send where. Re-run when the wallet is funded.
|
|
334
|
+
|
|
335
|
+
The verb packs the plug-in, uploads the tarball to IPFS, and writes a \`plugin:<cid>\` record on the on-chain IdentityRegistry under your builder agentId.
|
|
336
|
+
|
|
337
|
+
## 4. Confirm it published
|
|
338
|
+
|
|
339
|
+
Open the operator app's \`/build\` route. Under "Published plug-ins for SWE-rebench v2" you should see your plug-in. Under "Your published plug-ins" you should see the same record.
|
|
340
|
+
|
|
341
|
+
## 5. Run it
|
|
342
|
+
|
|
343
|
+
An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
|
|
344
|
+
|
|
345
|
+
\`\`\`bash
|
|
346
|
+
jinn solver-plugins show npm:@you/my-swe-skill
|
|
347
|
+
jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
|
|
348
|
+
\`\`\`
|
|
349
|
+
|
|
350
|
+
The next task they claim runs against your plug-in. The signed envelope's \`executor.plugins[]\` carries your CID; the network explorer attributes the score to your builder agentId.
|
|
351
|
+
|
|
352
|
+
## Next
|
|
353
|
+
|
|
354
|
+
- \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
|
|
355
|
+
- \`examples.md\` — annotated reference plug-ins.
|
|
356
|
+
- \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
|
|
357
|
+
- \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
|
|
358
|
+
- \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
|
|
359
|
+
`,ZF="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md",rS="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function XF(){return o.jsxs(be,{className:"p-6",children:[o.jsx(ir,{className:"mb-2 p-0",children:o.jsx("span",{className:rS,children:"Quickstart · 60 seconds"})}),o.jsxs(et,{className:"p-0",children:[o.jsx("div",{className:"hfmf-intro-markdown",children:KF(YF)}),o.jsx(st,{className:"my-5"}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{className:rS,children:"Next"}),o.jsx("a",{href:ZF,target:"_blank",rel:"noreferrer",className:"border-b border-border pb-px font-mono text-[12px] text-primary no-underline hover:text-[var(--accent-sky-hover)]",children:"Read the full quickstart on GitHub →"})]})]})]})}const QF=[{name:"name",type:"string",required:!0,description:"npm package name. Used as the canonical identifier across the registry."},{name:"version",type:"string",required:!0,description:"Semantic version. New versions publish under a new IPFS CID."},{name:"description",type:"string",required:!1,description:"Short prose description of what the plug-in offers."},{name:"jinn.supports",type:"string[]",required:!0,description:'Either ["jinn.runtime"] (runtime plug-in) OR one or more SolverType identifiers (solver-type plug-in). Mixing is rejected.'},{name:"jinn.capabilities",type:"object",required:!1,description:"Optional capabilities map. Reserved for future use; not consumed by Hermes today."},{name:"jinn.mcpServers",type:"object",required:!1,description:"Optional inline MCP server map. The Hermes harness reads .mcp.json instead; declare MCP there for harness-agnostic portability."},{name:"jinn.skills",type:"string[]",required:!1,description:"Relative paths to SKILL.md files. Each declared skill becomes available to the harness as an external skill directory."}],JF=[{id:"runtime",label:"Runtime plug-in",requires:'singleton — supports must be exactly ["jinn.runtime"]',example:'{ "jinn": { "supports": ["jinn.runtime"] } }'},{id:"solver-type",label:"SolverType plug-in",requires:'one or more SolverType ids; cannot include "jinn.runtime"',example:'{ "jinn": { "supports": ["swe-rebench-v2.v1"] } }'}],wm="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function e7(){return o.jsxs(be,{className:"p-6",children:[o.jsxs(ir,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:wm,children:"Reference"}),o.jsx("h2",{className:"m-0 font-serif text-[28px] leading-[1.2] text-foreground",children:"Plug-in shape"})]}),o.jsxs(et,{className:"p-0",children:[o.jsxs(Da,{children:[o.jsx(Oa,{children:o.jsxs(Kr,{children:[o.jsx(Qe,{children:"Field"}),o.jsx(Qe,{children:"Type"}),o.jsx(Qe,{children:"Required"}),o.jsx(Qe,{children:"Description"})]})}),o.jsx(Ma,{children:QF.map(e=>o.jsxs(Kr,{"data-field-required":e.required?"true":"false",children:[o.jsx(Je,{className:"font-mono text-[13px] text-primary",children:e.name}),o.jsx(Je,{className:"font-mono text-[13px] text-muted-foreground",children:e.type}),o.jsx(Je,{children:o.jsx(Ce,{variant:e.required?"default":"outline",children:e.required?"yes":"no"})}),o.jsx(Je,{className:"font-mono text-[13px] text-muted-foreground",children:e.description})]},e.name))})]}),o.jsx(st,{className:"my-8"}),o.jsxs("div",{className:"mb-4 flex flex-col gap-1",children:[o.jsx("span",{className:wm,children:"Modes"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Two modes"}),o.jsx("p",{className:"m-0 mt-1 max-w-[72ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:"The validator enforces exactly two exclusive modes. Mixing is rejected."})]}),o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:JF.map((e,t)=>o.jsxs(be,{className:"flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4",children:[o.jsx("span",{className:wm,children:t===0?"Mode · 01":"Mode · 02"}),o.jsx("h4",{className:"m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground",children:e.label}),o.jsx("p",{className:"m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground",children:e.requires}),o.jsx("pre",{className:"m-0 overflow-x-auto rounded-sm border border-border bg-background px-3 py-2.5 font-mono text-[12px] leading-[1.5] text-primary",children:o.jsx("code",{children:e.example})})]},e.id))})]})]})}const ER="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function t7(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function Yu({solverType:e}){return o.jsxs(ir,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:ER,children:"Registry"}),o.jsxs("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:["Published plug-ins for ",e]})]})}function r7({solverType:e}){const{data:t,isLoading:r,error:n}=Oe({queryKey:["discovery","plugin-publications",e],queryFn:()=>he.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return o.jsxs(be,{className:"p-6",children:[o.jsx(Yu,{solverType:e}),o.jsxs(et,{className:"flex flex-col gap-2 p-0",children:[o.jsx(fn,{className:"h-4 w-full"}),o.jsx(fn,{className:"h-4 w-5/6"}),o.jsx(fn,{className:"h-4 w-4/6"})]})]});if(n)return o.jsxs(be,{className:"p-6",children:[o.jsx(Yu,{solverType:e}),o.jsx(et,{className:"p-0",children:o.jsx(nt,{variant:"blocking",children:o.jsxs(at,{children:["Discovery unavailable. ",n.message]})})})]});const s=(t==null?void 0:t.publications)??[];return s.length===0?o.jsxs(be,{className:"p-6",children:[o.jsx(Yu,{solverType:e}),o.jsx(et,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:ER,children:"Empty registry"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-foreground",children:"No plug-ins published yet. Be the first."}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Run"," ",o.jsx("code",{className:"rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary",children:"jinn solver-plugins publish"})," ","and your plug-in appears here under your builder agentId."]})]})})]}):o.jsxs(be,{className:"p-6",children:[o.jsx(Yu,{solverType:e}),o.jsx(et,{className:"p-0",children:o.jsxs(Da,{children:[o.jsx(Oa,{children:o.jsxs(Kr,{children:[o.jsx(Qe,{children:"Plug-in"}),o.jsx(Qe,{children:"Version"}),o.jsx(Qe,{children:"Builder agentId"}),o.jsx(Qe,{children:"CID"}),o.jsx(Qe,{children:"Status"})]})}),o.jsx(Ma,{children:s.map(i=>o.jsxs(Kr,{children:[o.jsx(Je,{className:"font-mono text-[12px] text-foreground",children:i.name}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:i.version}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:i.builderAgentId}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:t7(i.cid)}),o.jsx(Je,{children:i.revoked?o.jsxs(Ce,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:["Revoked",i.revokedReason?` · ${i.revokedReason}`:""]}):o.jsx(Ce,{variant:"success",className:"rounded-full",children:"Active"})})]},`${i.builderAgentId}:${i.cid}`))})]})})]})}const wg="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",Cm="rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary";function $l(){return o.jsxs(ir,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:wg,children:"Builder"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Your published plug-ins"})]})}function n7({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=Oe({queryKey:["discovery","builder-artifacts",e],queryFn:()=>he.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return o.jsxs(be,{className:"bg-[var(--bg-sunken)] p-6",children:[o.jsx($l,{}),o.jsx(et,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border p-6",children:[o.jsx("span",{className:wg,children:"Identity pending"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Complete identity bootstrap to see your published plug-ins. Run"," ",o.jsx("code",{className:Cm,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})})]});if(n)return o.jsxs(be,{className:"p-6",children:[o.jsx($l,{}),o.jsxs(et,{className:"flex flex-col gap-2 p-0",children:[o.jsx(fn,{className:"h-4 w-full"}),o.jsx(fn,{className:"h-4 w-5/6"}),o.jsx(fn,{className:"h-4 w-4/6"})]})]});if(s)return o.jsxs(be,{className:"p-6",children:[o.jsx($l,{}),o.jsx(et,{className:"p-0",children:o.jsx(nt,{variant:"blocking",children:o.jsx(at,{children:"Discovery unavailable."})})})]});const i=((r==null?void 0:r.artifacts)??[]).filter(l=>l.artifactType==="plugin");return i.length===0?o.jsxs(be,{className:"p-6",children:[o.jsx($l,{}),o.jsx(et,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:wg,children:"Nothing yet"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["You have not published any plug-ins yet. Scaffold one with"," ",o.jsx("code",{className:Cm,children:"jinn create plugin"}),", then publish with ",o.jsx("code",{className:Cm,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})})]}):o.jsxs(be,{className:"p-6",children:[o.jsx($l,{}),o.jsx(et,{className:"p-0",children:o.jsxs(Da,{children:[o.jsx(Oa,{children:o.jsxs(Kr,{children:[o.jsx(Qe,{children:"Plug-in"}),o.jsx(Qe,{children:"Version"}),o.jsx(Qe,{children:"Supports"}),o.jsx(Qe,{children:"Status"})]})}),o.jsx(Ma,{children:i.map(l=>o.jsxs(Kr,{children:[o.jsx(Je,{className:"font-mono text-[12px] text-foreground",children:l.name}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:l.version}),o.jsx(Je,{className:"font-mono text-[12px] text-muted-foreground",children:l.supports.join(", ")}),o.jsx(Je,{children:l.revoked?o.jsx(Ce,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:"Revoked"}):o.jsx(Ce,{variant:"success",className:"rounded-full",children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}function s7({value:e,onChange:t}){const r=e==="plugin";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ie,{type:"button",variant:r?"outline":"ghost",size:"sm","aria-pressed":r?"true":"false",className:"rounded-full",onClick:()=>{r||t("plugin")},children:"Plug-ins"}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",disabled:!0,"aria-pressed":"false",className:"rounded-full opacity-60",children:["Harnesses",o.jsx("span",{className:"ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]",children:"Coming soon"})]})]})}const i7="swe-rebench-v2.v1";function a7(){const{data:e}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:5e3}),[t,r]=C.useState("plugin");return o.jsxs("div",{className:"mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8",children:[o.jsxs("header",{className:"flex flex-col gap-2 pb-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",children:"Build · Plug-ins"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[14px] leading-[1.7] text-muted-foreground",children:"Scaffold a SolverPlugin, publish it to npm and IPFS, watch it appear in the registry under your builder identity. Anchored on the SWE-rebench v2 SolverNet for v0."})]}),o.jsx(XF,{}),o.jsx(e7,{}),o.jsx(st,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4 pt-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Registry"}),o.jsx(s7,{value:t,onChange:r})]}),t==="plugin"?o.jsxs(o.Fragment,{children:[o.jsx(r7,{solverType:i7}),o.jsx(n7,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}const Zu=({...e})=>o.jsx(F4,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg font-mono text-[12px]",description:"group-[.toast]:text-[var(--fg-muted)]",actionButton:"group-[.toast]:bg-[var(--accent-sky)] group-[.toast]:text-[var(--bg-sunken)] font-mono text-[10px] uppercase tracking-[0.14em]",cancelButton:"group-[.toast]:bg-transparent group-[.toast]:text-[var(--fg-muted)] font-mono text-[10px] uppercase tracking-[0.14em]"}},...e});function o7(){const{data:e,isLoading:t}=Oe({queryKey:["bootstrap"],queryFn:()=>he.getBootstrap(),refetchInterval:1500}),r=$C(),[n,s]=C.useState(!1),i={restartPending:n,setRestartPending:s};if(r.status==="disconnected"&&!e)return o.jsxs(ln,{delayDuration:150,children:[o.jsx(eL,{connection:r}),o.jsx(Zu,{})]});if(e&&e.mode!=="running")return o.jsxs(ln,{delayDuration:150,children:[o.jsx(X5,{}),o.jsx(Zu,{})]});if(t||!e)return o.jsxs(ln,{delayDuration:150,children:[o.jsx(_M,{headline:"Starting jinn"}),o.jsx(Zu,{})]});const l=e.chain==="base"?"mainnet":"testnet",{pluginBuilderUi:a,embeddedAgent:c}=Yv();return o.jsx(ln,{delayDuration:150,children:o.jsxs(uj.Provider,{value:i,children:[o.jsx(FC,{children:o.jsx(mL,{header:o.jsx(f4,{network:l}),tabs:o.jsx(h4,{}),rail:c?o.jsx(m4,{}):void 0,children:o.jsxs(LD,{children:[o.jsx(Wt,{path:"/events/:id",children:o.jsx(IP,{})}),o.jsx(Wt,{path:"/events",children:o.jsx(LP,{})}),o.jsx(Wt,{path:"/overview",component:kP}),o.jsx(Wt,{path:"/operator/join/:cid",children:o.jsx(l8,{})}),o.jsx(Wt,{path:"/operator/execution-data",children:o.jsx(Fl,{children:o.jsx(T8,{})})}),o.jsx(Wt,{path:"/operator/memberships",children:o.jsx(Fl,{children:o.jsx(Sz,{onRestartPending:()=>s(!0)})})}),o.jsx(Wt,{path:"/operator/registry",children:o.jsx(Fl,{children:o.jsx(Oz,{})})}),o.jsx(Wt,{path:"/operator/network",children:o.jsx(Fl,{children:o.jsx(Mz,{onRestartPending:()=>s(!0)})})}),o.jsx(Wt,{path:"/operator/security",children:o.jsx(Fl,{children:o.jsx(WF,{})})}),o.jsx(Wt,{path:"/operator",children:o.jsx(Zl,{to:"/operator/memberships"})}),o.jsx(Wt,{path:"/captures",children:o.jsx(Zl,{to:"/operator/execution-data"})}),o.jsx(Wt,{path:"/configuration",children:o.jsx(l7,{})}),o.jsx(Wt,{path:"/launcher/create",children:o.jsx(y6,{})}),o.jsx(Wt,{path:"/launcher/launched/:solverNetId",children:o.jsx(xI,{})}),o.jsx(Wt,{path:"/launcher",children:o.jsx(WP,{})}),o.jsx(Wt,{path:"/build",children:a?o.jsx(a7,{}):o.jsx(Zl,{to:"/overview"})}),o.jsx(Wt,{children:o.jsx(Zl,{to:"/overview"})})]})})}),o.jsx(Zu,{})]})})}function l7(){const e=typeof window>"u"?"":window.location.hash;return o.jsx(Zl,{to:`/operator${e}`})}const c7=new ZA({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});BD().finally(()=>{wA.createRoot(document.getElementById("root")).render(o.jsx(X.StrictMode,{children:o.jsx(XA,{client:c7,children:o.jsx(o7,{})})}))});
|